Bitcoin Forum
April 19, 2014, 12:48:24 AM *
News: Due to the OpenSSL heartbleed bug, changing your forum password is recommended.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: howto: start mining software with CPU affinity (Win only) to avoid "core eating"  (Read 3791 times)
Diapolo
Hero Member
*****
Offline Offline

Activity: 766


Bitcoin-Qt co-developer


View Profile WWW

Ignore
July 15, 2011, 03:17:47 PM
 #1

I saw quite a few topics from Phoenix users, who complain that Phoenix sucks up 1 full CPU core for each running instance.
Not all are seeing this behaviour, but the ones who do may be interested in this.

That is how I start Phoenix for my HD5830 via a batchscript:

Code:
CD $PATH_TO_YOUR_MINING_EXE$ (C:\Bitcoin\Phoenix for example)
START /AFFINITY 0x01 phoenix.exe -v -u http://XYZ:8080 -a 50 -k phatk AGGRESSION=12 BFI_INT DEVICE=1 FASTLOOP=false VECTORS WORKSIZE=256

Now let's take a look at /AFFINITY 0x01. This parameter allows you to set CPU affinity via a hex mask. I have a six core Phenom II, now I want Phoenix to use only the first core.

You have to think of your CPU cores as bits, so the Phenom would be 000001 (the right bit is ths first core, right -1 would be second core and so on).
Now you have to convert your CPU mask into hex, which is easy for 000001, it is 0x01. To use only core 2 (000010) the hex value is 0x02 and so on.

You now can try to set the affinity of every Phoenix instance to the same CPU or you distribute the instances over your cores.

An affinity gives you a great advantage, there is no core hopping of processes PLUS you can make Phoenix (or whatever you use) only use one core and not more.

Give it a try and if it works, consider a small donation Cheesy.

Dia

PS.: I had to use the CD $PATH_TO_YOUR_MINING_EXE$, because the affinity was not set if using START /D:$PATH_TO_YOUR_MINING_EXE$!

Like my work for Bitcoin-Qt?
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
1397868504
Hero Member
*
Offline Offline

Posts: 1397868504

View Profile Personal Message (Offline)

Ignore
1397868504
Reply with quote  #2

1397868504
Report to moderator
1397868504
Hero Member
*
Offline Offline

Posts: 1397868504

View Profile Personal Message (Offline)

Ignore
1397868504
Reply with quote  #2

1397868504
Report to moderator
1397868504
Hero Member
*
Offline Offline

Posts: 1397868504

View Profile Personal Message (Offline)

Ignore
1397868504
Reply with quote  #2

1397868504
Report to moderator
NastyFans - The UNOFFICIAL Nasty Mining Fan Club
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1397868504
Hero Member
*
Offline Offline

Posts: 1397868504

View Profile Personal Message (Offline)

Ignore
1397868504
Reply with quote  #2

1397868504
Report to moderator
1397868504
Hero Member
*
Offline Offline

Posts: 1397868504

View Profile Personal Message (Offline)

Ignore
1397868504
Reply with quote  #2

1397868504
Report to moderator
1397868504
Hero Member
*
Offline Offline

Posts: 1397868504

View Profile Personal Message (Offline)

Ignore
1397868504
Reply with quote  #2

1397868504
Report to moderator
grue
Staff
Hero Member
*****
Offline Offline

Activity: 1036


It is pitch black. You are likely to be eaten by a grue.


View Profile

Ignore
July 15, 2011, 03:30:19 PM
 #2

i did something similar in c#

Code:
Random rnd = new Random();
IntPtr affinity = (IntPtr)Math.Pow(2.0, rnd.Next(4));
...
miner[i].ProcessorAffinity = affinity;

1ELvnrA6PhUyDBS6iR25K1Xx4xXL6VMfJX
dikidera
Full Member
***
Offline Offline

Activity: 126


View Profile

Ignore
July 15, 2011, 03:43:33 PM
 #3

Whats the difference between setting it via Task Manager?
Diapolo
Hero Member
*****
Offline Offline

Activity: 766


Bitcoin-Qt co-developer


View Profile WWW

Ignore
July 15, 2011, 06:16:08 PM
 #4

Whats the difference between setting it via Task Manager?

Well, only that you don't need the Task Manager Wink.

Dia

Like my work for Bitcoin-Qt?
1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x
bitcoin:1PwnvixzVAKnAqp8LCV8iuv7ohzX2pbn5x?label=Diapolo
deepceleron
Hero Member
*****
Offline Offline

Activity: 1022



View Profile WWW

Ignore
July 21, 2011, 09:28:42 PM
 #5

You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 driver (which does include OpenCL despite it's name). This version does not have a CPU problem, and I have 2 miners running at 0-1% CPU.

http://we.lovebitco.in/how-bitcoin-works/
1DCeLERonUTsTERdpUNqxKTVMmnwU6reu5
"A Part of Us Remains Wherever We Have Been" - fortune cookie
sc8nt4u
Sr. Member
****
Offline Offline

Activity: 278


View Profile

Ignore
July 22, 2011, 02:29:22 AM
 #6

Why can't you just outright disable every core but one in the bios?

[Selling] Delta 120mm Fans 130CFM 3 Pin w/ 3 pin to 4 pin molex + fan screws
http://forum.bitcoin.org/index.php?topic=22366.0
tysat
Staff
Hero Member
*****
Offline Offline

Activity: 840


Keep it real


View Profile

Ignore
July 22, 2011, 06:46:08 AM
 #7

You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 driver (which does include OpenCL despite it's name). This version does not have a CPU problem, and I have 2 miners running at 0-1% CPU.

Can you then apply the 11.6b hotfix to be able to use cards without dummy plugs/monitors plugged in?

BTC 1MU8yfcdwiGvGcroz2ZYw2rZeCBt1aiNv7   Sean's Outpost: 1M72Sfpbz1BPpXFHz9m3CdqATR44Jvaydd
deepceleron
Hero Member
*****
Offline Offline

Activity: 1022



View Profile WWW

Ignore
July 22, 2011, 09:20:41 AM
 #8

You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 driver (which does include OpenCL despite it's name). This version does not have a CPU problem, and I have 2 miners running at 0-1% CPU.

Can you then apply the 11.6b hotfix to be able to use cards without dummy plugs/monitors plugged in?
The 11.6b driver reintroduces the CPU race bug.

http://we.lovebitco.in/how-bitcoin-works/
1DCeLERonUTsTERdpUNqxKTVMmnwU6reu5
"A Part of Us Remains Wherever We Have Been" - fortune cookie
Meatball
Sr. Member
****
Offline Offline

Activity: 322



View Profile

Ignore
July 22, 2011, 05:00:50 PM
 #9

You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 driver (which does include OpenCL despite it's name). This version does not have a CPU problem, and I have 2 miners running at 0-1% CPU.

This didn't fix it for me.  I've tried every combination of drivers 11.5, 11.6 & 11.7 with SDK's 2.1 & 2.4's, and on all my cards (5770's, 5830's, 5850's & a 6950) on W7 x32 & x64 and the poclbm.exe processes eat up 100% of whatever core I assign it too.  So, if it's a single core CPU I get 100% CPU utilization, dual core system, I'll have 50% CPU utilization, and even on my Core i7-860 (Quad Core/Hyperthreaded), poclbm uses 100% of 1 of the cores, showing up as ~13% usage.

Check your task manager and look at the performance tab.  You should see a CPU Usage History chart for every 'core' your computer sees.  On all mine, at least one of them is pegged at 100% (the one I've set the processes to run with.)

OgNasty
Donator
Hero Member
*
Offline Offline

Activity: 1064


Powered by NastyFans


View Profile WWW

Ignore
July 24, 2011, 03:29:53 AM
 #10

This worked well for me but I lose the ability to use the "title" command, so now I am not sure which window is which miner.  Not a big deal, but if anybody has a solution, let me know.

kwaaak
Full Member
***
Offline Offline

Activity: 132


View Profile

Ignore
July 24, 2011, 03:51:45 AM
 #11

This worked well for me but I lose the ability to use the "title" command, so now I am not sure which window is which miner.  Not a big deal, but if anybody has a solution, let me know.

Just do

Code:
start /affinity 1 /min miner_1.bat

And put a title line in the batch file.

You don't have to do Hex numbers, 1,2,3,… works, too.
FreeJAC
Member
**
Offline Offline

Activity: 112


View Profile

Ignore
July 25, 2011, 04:08:41 AM
 #12

would this help possibly with the CPU possibly overheating due to the high usage? 

Donate here.... 18NiDLDA3qRxkEPN36xrzsdSgvEkbDKgNr
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!