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

xmrig & Ryzen Threadripper 1950X #593

Closed
hammuh1911 opened this issue Nov 13, 2017 · 15 comments
Closed

xmrig & Ryzen Threadripper 1950X #593

hammuh1911 opened this issue Nov 13, 2017 · 15 comments

Comments

@hammuh1911
Copy link

I use Nicehash Miner Legacy and have very low hash rate with xmrig.
(xmr-stak-cpu is working fine with more than 1 kH/s)
I am using Ryzen Threadripper 1950X. Specs:
16 cores
32 threads
32 MB L3 cache

Windows 10 Pro & NHML 1.8.1.5

What settings do I use to improve hashrate? I think there needs to be CPU affinity but am not sure how to figure the value. Thanks!

@HaTaX2
Copy link

HaTaX2 commented Nov 14, 2017

I believe the CPU affinity mask you want is '55555554' to use 15 cores leaving core 0 unused to keep the system from being too unresponsive. Change that last 4 to a 5 if you want all 16 cores to be used. In my experience xmrig and xmr-stak-cpu are nearly identical in performance with xmr-stak-cpu normally being slightly faster, they both mine CryptoNight so you really only need to enable / use one of them.

@hammuh1911
Copy link
Author

Thanks. You are right. The xmrig hash rate improved with either of the following as extra launch parameters:
--cpu-affinity 0x55555554
--cpu-affinity 0x55555555
I was interested in knowing because after benchmark NHML selected xmrig as most profitable, but the settings were wrong and it was not making much. So I disabled xmrig to use xmr-stak-cpu instead. xmr-stak-cpu works fine with the default settings. I was curious if xmrig would earn more if I found the correct settings. (Answer is no based on my brief testing.)

@HaTaX2
Copy link

HaTaX2 commented Nov 15, 2017

I'll admit I did exactly the same thing as you, I just wanted to find the miner that performed the best and it took a bit more tweaking of xmrig just to find out that they're nearly identical with xmr-stak-cpu having maybe a 1-3% lead. On top of that, you can set less threads and such easily for xmr through the settings in NHML where as xmrig requires a bit more complex configuration.

(In case you're curious, take the affinity strings and convert them from hex to binary. You'll have 32 bits and each one of those indicates a thread/core number, if it's a 1 it's assigned, 0 is not assigned. So you'll see a pattern of '01010101' where the right most bit is thread/core 0 and the left most is thread/core 31)

@mchu519
Copy link

mchu519 commented Nov 18, 2017

I'm thinking about getting the Ryzen 1950x with GTX 1080. Planning to use nice hash with it to pay for the system over time. Just curious what's the hash rate you guys are getting with the 1950x and the wattage its using.

@hammuh1911
Copy link
Author

Around 1.33 Kh/s on cryptonight. Stock, no overclock. Wattage unknown.

@j1mmyfever
Copy link

Could you clarify where this config goes? I'm current editing the Config_0.txt file with processor affinity sections, and only mining with the first 1950x listed in nicehash, but I can't seem to get over 700 h/s.

This is my config_0.txt.

"cpu_thread_num": 16,
"cpu_threads_conf" :
[
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 0 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 2 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 4 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 6 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 8 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 10 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 12 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 14 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 16 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 18 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 20 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 22 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 24 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 26 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 28 },
{ "low_power_mode" : false, "no_prefetch" : true, "affine_to_cpu" : 30 }
],

I'm confused why the 1950x is showing up in Nicehash legacy as 2 CPUs, and its throwing all my normal configuration math off.

Thanks

@hammuh1911
Copy link
Author

When you go into settings you'll be able to see a list of algorithms for each device. You can click on the algorithm and add parameters. You have to do this twice because threadripper is like two processors. I did it all within nicehash and didn't edit any files directly.

@j1mmyfever
Copy link

WOW, I did not realize you could change parameters in the GUI. That's going to make life so much better.

I'm still playing, but with the affinity switches above, I got up to about 950 h/s so far. I'll keep tweaking. I haven't done things like adjust page file on this system yet, so I have more work to do as well.

Thanks

@HaTaX2
Copy link

HaTaX2 commented Nov 20, 2017

Take a look here for some other tweaks you can do with CPU mining:
https://github.com/nicehash/NiceHashMiner/wiki/Notes-and-hints-on-CPU-mining

Ryzen / ThreadRipper don't have hyperthreading, but they have their own version of it. Any way you name it, it's an implementation of SMT and as such it behaves the same as HT on the Intel CPUs. The jist of it is that if your CPU supports SMT in any way, you'll likely see better performance running on half the number of threads as your CPU has 'cores' in task manager.

So close to the 1Kh/s mark, I'm sure with just a little more work you'll be able to get well over 1Kh/s. Good luck!

@j1mmyfever
Copy link

j1mmyfever commented Nov 20, 2017

I got it to the 1.3 kh/s, but only via editing the config_0 and config_1, and marking them ReadOnly so that nicehash can't modify them. If you know how to import this into Nicehash, by all means I'm all ears. Edit: I'm going to mess with the hyperthread setting in the previous article you listed later.

Config_0.txt:

"cpu_thread_num": 8,
"cpu_threads_conf": [
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 1
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 3
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 5
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 7
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 9
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 11
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 13
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 15
}
],

Config_1.txt:

"cpu_thread_num": 8,
"cpu_threads_conf": [
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 17
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 19
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 21
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 23
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 25
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 27
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 29
},
{
"low_power_mode": false,
"no_prefetch": false,
"affine_to_cpu": 31
}
],

@hammuh1911
Copy link
Author

I got xmr-stak-cpu to work fine with the lock pages in memory tweak. Don't think I did anything else. For xmrig I also had to add --cpu-affinity 0x55555555 as a launch parameter in nicehash, twice b/c threadripper is 2 CPUs apparently. I feel it runs stable and haven't bothered with any other tweaks. Should be double what a ryzen 7 makes and I'm getting that, maybe slightly more. I have memory in quad channel configuration which might help things.

@j1mmyfever
Copy link

I bet that memory is making the difference. I only have two sticks in the A2/B2 config that the align with ASRock instructions. It's temp ram I got a deal on while I work to find a good price on 128gb QVL listed memory. I'll be able to add to this thread after that fact if it changes anything. It would make sense why I have to set the affinity to particular threads maybe.

Lock pages in memory was already specified for my user account, so I'm thinking maybe nicehash legacy does it automatically if you Run as Administrator and it has the perms to add the user rights assignment.

@j1mmyfever
Copy link

I would expect the 1920x to do about 975h/s, so that 900 sounds pretty close. 6 threads per CPU in Nicehash seems right as well. You could try changing the CPU affinities to even vs odd numbers, or vice versus, and see if that does anything. I don't know much about how this works, but I think it matters based off your memory configuration in the system.

@HaTaX2
Copy link

HaTaX2 commented Jan 10, 2018

The lag is because the miner is effectively using 100% of your CPU to mine, there isn't much left in the way of CPU time for the OS and other things so everything will feel laggy. If you're going to be using the system while mining I would recommend that you take one of the config files and only utilize 5 threads / cores. This should leave you enough CPU time that you won't notice too much of an impact in normal use.

@DillonN DillonN closed this as completed Feb 19, 2018
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

6 participants
@HaTaX2 @DillonN @hammuh1911 @mchu519 @j1mmyfever and others