Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adopting xmr-stak for CryptoNight variant 2 #19

Open
cryptoeight opened this issue Oct 11, 2018 · 22 comments
Open

Adopting xmr-stak for CryptoNight variant 2 #19

cryptoeight opened this issue Oct 11, 2018 · 22 comments

Comments

@cryptoeight
Copy link

Hello Nioroso,
as Monero is changing PoW on 18.10.2018 i was wondering:
Are you planning to adopt a new version of xmr-stak for Power supporting CryptoNight variant 2?

@madscientist159
Copy link
Contributor

Same question from this side. Is this something you are looking at updating? 👍

@thsitthisak
Copy link

I also waiting ^^

@nioroso-x3
Copy link
Owner

Yeah, I started working on this today.

@madscientist159
Copy link
Contributor

@nioroso-x3 I've got a working xmrig repo that I've been performance tuning the past few days alongside SChernykh. Which CPUs are you going to be tuning against? Unlike CNv7 we will need to decide which square root algorithm to use based on the expected utilization of an SMP4 core.

@gcy000
Copy link

gcy000 commented Oct 17, 2018

Hi nioroso-x3,
I’m currently using power8 cpu for xmr...any repo for that?

@rem260
Copy link

rem260 commented Oct 17, 2018 via email

@cryptoeight
Copy link
Author

@madscientist159 is it possible for you to share your working repo, even that it drops the performance 50%.
As you said 50% for the moment is still better than 0% if not updated at all ^^

Once the tuning is finished we can update again to get the best performance.

Thanks in advance.

@nioroso-x3
Copy link
Owner

https://github.com/nioroso-x3/xmr-stak

Ok, updated it to just working, need to optimize now.

@madscientist159
Copy link
Contributor

Darn, you beat me to it! 😃 Here's my optimized xmrig variant, it gets basically the same speed as CNv7 on the > 8 core chips, and ~62% of CNv7 on the 4 and 8 core devices.

https://github.com/madscientist159/xmrig

@nioroso-x3
Copy link
Owner

Darn, you beat me to it! Here's my optimized xmrig variant, it gets basically the same speed as CNv7 on the > 8 core chips, and ~62% of CNv7 on the 4 and 8 core devices.

https://github.com/madscientist159/xmrig

A lookup table for sqrt? You didnt try to do two square roots at once using vec_sqrt?

@madscientist159
Copy link
Contributor

madscientist159 commented Oct 17, 2018

@nioroso-x3 Of course I did -- you can see vestiges of that in how the xmrig source was restructured to allow two square roots right up next to one another. I also tried many other arcane instructions and methods for getting the square root (even going so far as trying to fill multiple execution pipelines with combinations of xsrsqrtesp, xssqrtsp, and xssqrtqp) -- empirically, on POWER9, using a dual 8 core test machine, the given LUT was the fastest by a significant margin (over 10%).

What it all comes down to is that square root, alongside division, is probably the weakest instruction in the entire POWER9 design. Not only is the issue time for the square root instruction terrible, but the VSX units are shared among SMT threads -- the LUT allows greater parallelism.

Don't take my word alone for it -- run it through perf and see for yourself! 😉

@nioroso-x3
Copy link
Owner

Ok, I added your fast square root for the 1x threads.

@thsitthisak
Copy link

hi ****

https://github.com/nioroso-x3/xmr-stak

Ok, updated it to just working, need to optimize now.

it show
"
[2018-10-18 11:41:15] : Difficulty changed. Now: 5000.
[2018-10-18 11:41:15] : New block detected.
[2018-10-18 11:41:28] : Result rejected by the pool.
[2018-10-18 11:41:28] : Difficulty changed. Now: 4999.
[2018-10-18 11:41:28] : New block detected.
[2018-10-18 11:43:13] : Result rejected by the pool.
[2018-10-18 11:43:13] : Difficulty changed. Now: 5000.
[2018-10-18 11:43:13] : New block detected.
[2018-10-18 11:43:28] : Result rejected by the pool.
[2018-10-18 11:43:28] : Difficulty changed. Now: 4999.
[2018-10-18 11:43:28] : New block detected.
[2018-10-18 11:43:32] : New block detected.
[2018-10-18 11:43:46] : Result rejected by the pool.
[2018-10-18 11:43:46] : Difficulty changed. Now: 5000.
[2018-10-18 11:43:46] : New block detected.
[2018-10-18 11:45:10] : New block detected.
[2018-10-18 11:45:11] : Result rejected by the pool.
[2018-10-18 11:45:11] : Difficulty changed. Now: 4999.
[2018-10-18 11:45:11] : New block detected.
[2018-10-18 11:45:21] : Result rejected by the pool.
[2018-10-18 11:45:21] : Difficulty changed. Now: 5000.
[2018-10-18 11:45:21] : New block detected.
""
is ok or not sir.

Sith

@nioroso-x3
Copy link
Owner

I tested it in the killallasics.moneroworld.com pool, you have to set cryptonight_v8 explicitly

@winsonhet
Copy link

Power 8 +ubuntu 16.04+at11.0
before update new version,V7 xmr-stak-power have been running well two month
install new version
https://github.com/nioroso-x3/xmr-stak
make install error

Scanning dependencies of target xmr-stak-c
[ 3%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_groestl.c.o
[ 7%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_skein.c.o
[ 11%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_jh.c.o
[ 14%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_blake256.c.o
[ 18%] Building C object CMakeFiles/xmr-stak-c.dir/xmrstak/backend/cpu/crypto/c_keccak.c.o
[ 22%] Linking C static library bin/libxmr-stak-c.a
[ 22%] Built target xmr-stak-c
Scanning dependencies of target xmr-stak-backend
[ 25%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/version.cpp.o
[ 29%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/jconf.cpp.o
[ 33%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/hwlocMemory.cpp.o
[ 37%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/cpuType.cpp.o
[ 40%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/minethd.cpp.o
[ 44%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/jconf.cpp.o
[ 48%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/globalStates.cpp.o
[ 51%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/backendConnector.cpp.o
[ 55%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/backend/cpu/crypto/cryptonight_common.cpp.o
[ 59%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/httpd.cpp.o
[ 62%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/http/webdesign.cpp.o
[ 66%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/utility.cpp.o
[ 70%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/executor.cpp.o
[ 74%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/console.cpp.o
[ 77%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/uac.cpp.o
[ 81%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/misc/telemetry.cpp.o
[ 85%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/socket.cpp.o
[ 88%] Building CXX object CMakeFiles/xmr-stak-backend.dir/xmrstak/net/jpsock.cpp.o
[ 92%] Linking CXX static library bin/libxmr-stak-backend.a
[ 92%] Built target xmr-stak-backend
Scanning dependencies of target xmr-stak
[ 96%] Building CXX object CMakeFiles/xmr-stak.dir/xmrstak/cli/cli-miner.cpp.o
[100%] Linking CXX executable bin/xmr-stak
CMakeFiles/xmr-stak.dir/xmrstak/cli/cli-miner.cpp.o: In function main': cli-miner.cpp:(.text.startup+0x70): undefined reference to OPENSSL_init_ssl'
cli-miner.cpp:(.text.startup+0x88): undefined reference to OPENSSL_init_ssl' cli-miner.cpp:(.text.startup+0xa4): undefined reference to OPENSSL_init_crypto'
cli-miner.cpp:(.text.startup+0xb8): undefined reference to OPENSSL_init_ssl' cli-miner.cpp:(.text.startup+0xc8): undefined reference to OPENSSL_init_crypto'
bin/libxmr-stak-backend.a(socket.cpp.o): In function tls_socket::init_ctx()': socket.cpp:(.text+0xc2c): undefined reference to TLS_method'
socket.cpp:(.text+0xcb8): undefined reference to `SSL_CTX_set_options'
collect2: error: ld returned 1 exit status
CMakeFiles/xmr-stak.dir/build.make:105: recipe for target 'bin/xmr-stak' failed
make[2]: *** [bin/xmr-stak] Error 1
CMakeFiles/Makefile2:142: recipe for target 'CMakeFiles/xmr-stak.dir/all' failed
make[1]: *** [CMakeFiles/xmr-stak.dir/all] Error 2
Makefile:127: recipe for target 'all' failed
make: *** [all] Error 2

@nioroso-x3
Copy link
Owner

You are missing some library, it compiles fine in Centos 7.

@rem260
Copy link

rem260 commented Oct 19, 2018

Ugh, performance is pretty terrible.

Power8, 74 threads, 1400h/s, was about 3k on cnv7

I can tell by the quiet machine room that the system is not working very hard.

@madscientist159
Copy link
Contributor

madscientist159 commented Oct 19, 2018

@rem260 Another Firestone user from the description of the sound? 😉

Can you give my xmrig version a try? On a 36 core POWER9 box it's running at around 68% of CNv7 and I'm actively working to try to boost that further. There's a tremendous amount of cache thrashing going on and POWER is very weak on both square root and division (basically the two worst instructions in the entire design), making things significantly worse.

@nioroso-x3
Copy link
Owner

Ugh, performance is pretty terrible.

Power8, 74 threads, 1400h/s, was about 3k on cnv7

I can tell by the quiet machine room that the system is not working very hard.

I haven't implemented the big endian aes optimization I had for cnv7, which was the bottleneck for power8.
I'll work on that next week.

@thsitthisak
Copy link

I tested it in the killallasics.moneroworld.com pool, you have to set cryptonight_v8 explicitly

Hi
I used ubutu, right now it's ok nothing re-complie, but performance was gone 50% ^^
Thank a lot

@gokou340
Copy link

Any updates on the optimization?

@thsitthisak
Copy link

i think no have any update and performance very poor ^^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants