Bitcoin Forum
May 07, 2024, 08:42:32 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: cpuminter-multi and cpuminer-opt how to use --cpu-affinity option  (Read 296 times)
boumacor (OP)
Newbie
*
Offline Offline

Activity: 38
Merit: 0


View Profile
April 10, 2018, 03:58:22 PM
 #1

For the last couple of days I've been testing the --cpu-affinity option with my dual opteron 6376 trying to get cpuminer to use just 4 threads (14/15 and 30/31) instead of everything or the first one.

For some reason the --cpu-affinity option is noticed by both programs (using --cpu-affinity 6 or --cpu-affinity 0x6 for testing) but in all of the cases the program uses all cores or using the -t 2 option core 0 and core 1. But this is not what I want.

I'm sure I'm doing something wrong, but no idea what. Should the --cpu-affinity option go with another option ?

This is my commandline :
./cpuminer -a yescrypt -o stratum+tcp://hub.miningpoolhub.com:17021 -u <my_mph_username> -p d=10

I'm using Ubuntu 16.04 LTS and this is updated useing the apt-get update -y && apt-get upgrade -y. So this shoud be just fine. Any suggestions ?
1715071352
Hero Member
*
Offline Offline

Posts: 1715071352

View Profile Personal Message (Offline)

Ignore
1715071352
Reply with quote  #2

1715071352
Report to moderator
1715071352
Hero Member
*
Offline Offline

Posts: 1715071352

View Profile Personal Message (Offline)

Ignore
1715071352
Reply with quote  #2

1715071352
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715071352
Hero Member
*
Offline Offline

Posts: 1715071352

View Profile Personal Message (Offline)

Ignore
1715071352
Reply with quote  #2

1715071352
Report to moderator
HashAuger
Newbie
*
Offline Offline

Activity: 481
Merit: 0


View Profile WWW
April 10, 2018, 04:46:43 PM
 #2

The --cpu-affinity parameter uses a hex-based mask to specify which combination of available threads should be used. Instead of specifying just the number of threads you want to use, you have to figure out a bit representation of all the threads you want to enable and then convert that to hex. This allows you to skip virtual or hyper-threaded cores and limit mining to just the physical cores. For example, on an Intel i7 with four physical and four virtual cores, I use 0x55 to indicate that only the four physical cores should be used. Basically each 5 represents enabling only the first thread in a pair. However, that value is based on the Windows convention of numbering physical cores starting at zero.  I have seen somewhere that with Linux the first physical core starts at one instead - so you would need to reverse which threads are enabled by each bit.  Finally, I would also suggest using both the --cpu-affinity and --threads parameters together just so the software can better understand your intent.
Generalzod580
Member
**
Offline Offline

Activity: 96
Merit: 12


View Profile
June 08, 2021, 03:47:36 AM
 #3

The --cpu-affinity parameter uses a hex-based mask to specify which combination of available threads should be used. Instead of specifying just the number of threads you want to use, you have to figure out a bit representation of all the threads you want to enable and then convert that to hex. This allows you to skip virtual or hyper-threaded cores and limit mining to just the physical cores. For example, on an Intel i7 with four physical and four virtual cores, I use 0x55 to indicate that only the four physical cores should be used. Basically each 5 represents enabling only the first thread in a pair. However, that value is based on the Windows convention of numbering physical cores starting at zero.  I have seen somewhere that with Linux the first physical core starts at one instead - so you would need to reverse which threads are enabled by each bit.  Finally, I would also suggest using both the --cpu-affinity and --threads parameters together just so the software can better understand your intent.

This is the best comment i can find anywhere online for --cpu-affinity after searching for days in the past and even years later today.
For my 2 physical cores to run 2 threads which is the best setting for yepower algorithm coins that need physical cores like veco coin and butkoin i use --cpu-affinity 0x5 --threads 2 since each 5 represents the first thread in a pair. it works with higher hash rate now. thanks
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!