Your tr 1950x with cpu-affinity 1 makes no sense, the Ryzen is behaving as expected.
Affinity of 1 means that only CPU 0 will be used for all threads..
There should be as many bits set in the affinity mask as there are threads to run,
If there are fewer bits than threads you start doubling up threads on logical cores, very bad.
I don't know what to tell you. For some reason, this is happening on the TR CPU.
So for some reason, that's expected behavior on my Ryzen, but not the TR.
As for WHY I did "1", it's because I read somewhere on this thread that value means to alternate every other core starting with CPU 0. Misinformation, perhaps, but it was the only info I had to go on until now.
The only affinity that might make sense with 8 threads is either 0x5555 or 0xaaaa.
The only difference is even vs odd numbered cores. Some think 0xaaaa is better
because it leaves core 0 free. I don't know if it matters, but I digress.
Thanks. With that info, I can reverse-conclude that the hex value is just binary for 0101010101010101 (representing 16 threads).
I was wondering how that worked.
I will try this and get back to you (not in a position to test right now).
How do you know cpus 0 to 8 are not on seperate physical cores? Check the CPU core
temperatures with 1/2 threads and default affinity and confirm all cores are the same relative temperature.
If 4 cores are hot and 4 cool your assumption was correct and you need to use affinity to
spread the threads over all the cores.
I know with Cryptonight because something about making sure they're on the right CCX so they don't share cache - or something of that matter. Without doing anything, the hashrate is terrible. After getting it to alternate cores, hashrate was 5 to 6x faster.
I used xmr-stak to verify. Their miner was easier to mine Cryptonight. They alternated the cores - can verify with monitoring tools such as HWInfo, Task Manager, and CoreTemp.
I want to use cpuminer-opt because of xmr-stak's dev fee. Using cpuminer-opt, I noticed without any affinity settings (just the thread setting), they were not alternating - AND the hasrate was much lower.
With your TR1950x you would use a mask of 0x55555555 for 16 threads, IF YOU NEED IT.
Thanks for this. Will try and report back.
And remember NEVER USE AFFINITY WITH DEFAULT THREADS.
Of course - default threads usually mean 100% of CPU, so no reason to set affinity.
Please provide a full report to clear up all this confusion.
Will do.
I don't have any idea if TR maps logical cores differently than Ryzen, or differently than Intel.
If it does blame AMD. I don't have any problem with Intel CPUs, never use affinity.
I'm not sure, but I think with my Haswell, it might just automatically alternate (use physical cores) without the need of setting affinity (just set the threads). I haven't had the time to play with Cryptonight on my Haswell yet. I'll check it out when I have time and let you know.
Some people tend to use decimal for affinity. Those that do probably don't know what they
are doing because affinity is a bitmap. If you don't understand a bitmap represented in hexadecimal
it's even more difficult to understand it in decimal.
Does it work with binary values?
--cpu-affinity 1010101010101010
UPDATE:
With 0x5555 and 8 threads for Ryzen (or 0x55555555 and 16 threads for TR), I get an overall 60-65% CPU utilization, and the load is spread evenly across all cores (virtual and physical).
What's weirder is on the TR, I revert back to "1", and it behaves the exact same! WTF is going on?
Hashrate using 16 threads (out of 32) - no affinity settings:
Around 400 H/s
Hashrate using 16 threads - affinity set to 1 (previously):
Around 850 H/s
Hashrate using 16 threads - affinity 0x55555555:
Around 600 H/s
Hashrate using after going back to affinity 1, still 16 threads:
Around 600 H/s
I tried also on the Ryzen. So affinity 1 = only mines on core 0. With Affinity set to 0x5555 (8 threads out of 16), around 60% cpu utilization spread across all cores (same behavior as TR).
I'm baffled.