Windows cross-compiling broken by RandomX v1.2.1
#367
Closed
opened 6 months ago by duke
·
11 comments
No Branch/Tag Specified
arm
asyncnotedecryption
danger
dev
dev-aarch64
dev-mac
dev-old-randomx
divzaddrs
dragonx
duke
freebsd
getfilterednotes
hip39
hushutils
insync
jahway603
master
mvstuff
onryo
p2p_privacy
ramhash
relaytx
rx-largepages
setbestchain
warmup
witness_cache
wolfssl
wolfssl_win
z_createrawtransaction
z_importwallet
z_signmessage
v0.11.2.z0
v0.11.2.z1
v0.11.2.z2
v0.11.2.z3
v0.11.2.z4
v0.11.2.z5
v0.11.2.z6
v0.11.2.z7
v0.11.2.z8
v0.11.2.z9
v1.0.0
v1.0.0-beta1
v1.0.0-beta2
v1.0.0-rc1
v1.0.0-rc2
v1.0.0-rc3
v1.0.0-rc4
v1.0.1
v1.0.10
v1.0.10-1
v1.0.11
v1.0.11-rc1
v1.0.12
v1.0.12-rc1
v1.0.13
v1.0.13-rc1
v1.0.13-rc2
v1.0.14
v1.0.14-rc1
v1.0.15
v1.0.15-rc1
v1.0.2
v1.0.3
v1.0.4
v1.0.5
v1.0.6
v1.0.7-1
v1.0.8
v1.0.8-1
v1.0.9
v1.1.0
v1.1.0-rc1
v1.1.1
v1.1.1-rc1
v1.1.1-rc2
v1.1.2
v1.1.2-rc1
v2.0.0
v2.0.0-rc1
v2.0.1
v3.0.0
v3.1.0
v3.1.1
v3.10.0
v3.10.1
v3.10.2
v3.2.0
v3.2.1
v3.2.1-alpha
v3.2.1-beta
v3.2.2
v3.2.3
v3.3.0
v3.3.1
v3.3.2
v3.4.0
v3.4.1
v3.5.0
v3.5.1
v3.5.2
v3.6.0
v3.6.1
v3.6.2
v3.6.3
v3.7.0
v3.7.1
v3.8.0
v3.9.0
v3.9.1
v3.9.2
v3.9.3
v3.9.4
Labels
bounty up to 500 HUSH 2001-5000 bounty
bounty between 2001 and 5000 HUSH 501-2000 bounty
bounty between 501 and 2000 HUSH arm
something doesn't work on arm beginners
for new developers bug
may or may not be a bug build
problems building documentation
not enough information feature
new feature high priority
high priority i2p
related to i2p low priority
low priority medium priority
medium priority question
something is not clear release
release label or issue related to it testing
related to testing tor
related to tor wontfix
this won't be fixed
Apply labels
Clear labels
0-500 bounty
bounty up to 500 HUSH 2001-5000 bounty
bounty between 2001 and 5000 HUSH 501-2000 bounty
bounty between 501 and 2000 HUSH arm
something doesn't work on arm beginners
for new developers bug
may or may not be a bug build
problems building documentation
not enough information feature
new feature high priority
high priority i2p
related to i2p low priority
low priority medium priority
medium priority question
something is not clear release
release label or issue related to it testing
related to testing tor
related to tor wontfix
this won't be fixed
No Label
0-500 bounty
2001-5000 bounty
501-2000 bounty
arm
beginners
bug
build
documentation
feature
high priority
i2p
low priority
medium priority
question
release
testing
tor
wontfix
Milestone
Set milestone
Clear milestone
No items
No Milestone
Projects
Clear projects
No project
Assignees
Assign users
Clear assignees
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.
No due date set.
Dependencies
This issue currently doesn't have any dependencies.
Reference in new issue
There is no content yet.
Delete Branch '%!s(MISSING)'
Deleting a branch is permanent. It CANNOT be undone. Continue?
No
Yes
In our 3.9.4 release we used an older version of Randomx df6e15e1303034831dc14128d654c157ddc0dce3 (which was from their master branch, not a release) which worked well for us.
When we upgraded to RandomX v1.2.1 (102f8acf90a7649ada410de5499a7ec62e49e1da) which was used in the 3.10.0 release we ran into compile failures when trying to cross-compile for windows. Our temporary fix to get release binaries made was to downgrade to the old version of RandomX on the
dev-old-randomx
branch and use that branch to produce Windows binaries.It's a bit confusing but Linux and Mac 3.10.0 use the RandomX 1.2.1 release while Windows uses the older code. This means that some performance improvements in 1.2.1 are not available on Windows and so mining DragonX and other RandomX HSC's will be slightly slower than using Linux or Mac.
This is the error:
Submitted issue to their git here: https://github.com/tevador/RandomX/issues/288
They suggest
-DARCH_ID=x86_64
to fix the problemUnfortunately this did not work, but gave me a clue. Old CMakeLists.txt has this:
while new has this
Removing CMAKE_SIZEOF_VOID_P appears to work so
src/jit_compiler_x86.cpp
is included in build. It is some additional check for 64-bit that's apparently failing.System is 64-bit so I'm not sure what's up, but I'll test the bins it created now.
@fekt are you using
DARCH=native
andDARCH_ID=x86_64
or justDARCH_ID=x86_64
?I tried with
DARCH_ID=x86_64
only on a fresh clone and it did not work. I then tried with both and alsoDARCH=x86_64
and none of those options worked either.The build is set to
x86_64-w64-mingw32
for MXE. Bin seems to work fine with mining and shows as 64-bit so I'm not sure what's up with that check.@fekt if you found something that works, it sounds good to me. I looked at the history of that line of code and it was added in
3f69ad7b79
and seems to be related to fixing a bug in 32bit systems. It looks like in fixing 32bit they broke cross-compiling, so you may want to report it to them as a bug and what you did to fix it.I fixed in
032f9b62da
and let them know in issue that removingCMAKE_SIZEOF_VOID_P
worked.Should we update all of the Windows bins with this version and update download links everywhere? There's a decent amount of Windows downloads already and will need to tell people to update again too if they want RandomX improvements.
@fekt I am not sure what we should do right now, seems like a team decision.
If we update 3.10.0 windows bins to use RandomX v1.2.1 it will later on be very confusing as to which version of RandomX people are using. They will all identify as 3.10.0 . We are also unsure if we will need another full node release soon to deal with getblocktemplate issues we are seeing.
What seems more reasonable is to make a new SD/SDX release, 1.4.1, that contains binaries from the dev branch for Windows. Then we will know that if people on Windows are using SD/SDX 1.4.0 they have the old randomx and if 1.4.1 the new randomx.
RandomX v1.2.1 speed improvements versus the old version are roughly in the 1% area, while the speed improvements in the way we use randomx code is about 10% faster vs the previous release, to put things in perspective. 1.2.1 is technically faster but most of the speedup was in our code changes, not randomx code changes.
I think adding to a new release makes most sense and probably doesn't need to be done right now. It really only affects DGRX users.
There was at least one DRGX Windows user reporting greater performance with new release and old RandomX so they are seeing improvements just with the code changes.
@fekt
No matter what, DRGX miners are going to see a large speedup if they use the new 3.10.0/1.4.0 release versus the old release. When we fixed the mining coredumps/bugs it lead to a pretty large 10% hashrate increase across all OS's.
Now, for Windows, they still get that ~10% speedup but lose out on the much smaller ~1% speedup of using RandomX 1.2.1 versus the older version we used to use. That ~1% speedup also will depend on the exact CPU and RAM they use and most people won't really notice it.
This change will be in the upcoming 3.10.1 hushd release so I think this issue can be closed