Bitcoin Forum

Bitcoin => Mining software (miners) => Topic started by: Diapolo on July 15, 2011, 03:17:47 PM



Title: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: Diapolo on July 15, 2011, 03:17:47 PM
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 :D.

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$!


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: grue on July 15, 2011, 03:30:19 PM
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;


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: dikidera on July 15, 2011, 03:43:33 PM
Whats the difference between setting it via Task Manager?


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: Diapolo on July 15, 2011, 06:16:08 PM
Whats the difference between setting it via Task Manager?

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

Dia


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: deepceleron on July 21, 2011, 09:28:42 PM
You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 (http://sites.amd.com/us/game/downloads/Pages/radeon_win7-32.aspx#2") 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.


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: sc8nt4u on July 22, 2011, 02:29:22 AM
Why can't you just outright disable every core but one in the bios?


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: tysat on July 22, 2011, 06:46:08 AM
You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 (http://sites.amd.com/us/game/downloads/Pages/radeon_win7-32.aspx#2") 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?


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: deepceleron on July 22, 2011, 09:20:41 AM
You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 (http://sites.amd.com/us/game/downloads/Pages/radeon_win7-32.aspx#2") 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.


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: Meatball on July 22, 2011, 05:00:50 PM
You can also remove all the existing ATI software, and do a fresh "display driver only" install of the WHQL Catalyst 11.6 (http://sites.amd.com/us/game/downloads/Pages/radeon_win7-32.aspx#2") 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.)



Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: OgNasty on July 24, 2011, 03:29:53 AM
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.


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: kwaaak on July 24, 2011, 03:51:45 AM
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.


Title: Re: howto: start mining software with CPU affinity (Win only) to avoid "core eating"
Post by: FreeJAC on July 25, 2011, 04:08:41 AM
would this help possibly with the CPU possibly overheating due to the high usage?