Processor Affinity
#1
Posted 25 August 2010 - 08:16 AM
As some of you probably know, Eve is a single-threaded application. That means it cannot use more than one cpu core. Now what you'll find is that Windows tends not to keep it on that core but will schedule it (assign it/switch it to cores) according to what Windows perceives as "best". If the application is old enough to not be multithreaded or multiprocessor aware then this isn't optimal - it usually isn't worth setting affinity on multithreaded apps unless you know for sure the max number of cpus it'll use.
For example with Eve running and having access to all cpus it took me 42 minutes to re-encode 30 minutes of video (two pass). Once I set the cpu affinity to just one cpu for Eve, the same 30 minutes of video took 27 minutes to re-encode - the encoder maxed out the other 3 cpus where before it wasn't able to.
Anyway this is a snip of an email I sent to Draelor about how to do this :
OK I've got this sorted, Win7 is a bit stricter on syntax than Vista was.
Assume you're me - four clients, four cpus and you want each client to use a different cpu. Here's what to put in each shortcut "target" field :
Client 1 : C:\Windows\System32\cmd.exe /C start "Eve1" /normal /affinity 0x1 "C:\Program Files (x86)\CCP\EVE\Eve.exe"
Client 2 : C:\Windows\System32\cmd.exe /C start "Eve2" /normal /affinity 0x2 "C:\Program Files (x86)\CCP\EVE2\Eve.exe"
Client 3 : C:\Windows\System32\cmd.exe /C start "Eve3" /normal /affinity 0x4 "C:\Program Files (x86)\CCP\EVE3\Eve.exe"
Client 4 : C:\Windows\System32\cmd.exe /C start "Eve4" /normal /affinity 0x8 "C:\Program Files (x86)\CCP\EVE4\Eve.exe"
Notes -
1) The affinity mask is binary so I've entered the mask as a hexidecimal number. eg /affinity 0x3 would use cpu0 and cpu1, 0x5 would use cpu0 and cpu 2 etc all the way up to 0xF which uses all four cpus;
2) Windows (and most other OS) counts the cpu cores starting at 0, not 1 so a quad core would have cpu0, cpu1, cpu2 and cpu3;
2) I tend not to manually assign anything to cpu0 as its the cpu handling the base kernel and the scheduler, so in my case I assign Othran to cpu1, Slant to cpu2 and the other two to cpu3 as they don't do anything much right now;
3) When you change the shortcut target you may lose the Eve icon and get a command box icon. Just change it back by clicking "Change Icon" and point the browser at the relevant eve.exe file.
Ask if it makes no sense at all to you
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#2
Posted 25 August 2010 - 08:37 AM
"Except that, as is usually said of spoons, THERE IS NO SHIELD." - Lord Maldoror
"Bob Shaftoes is drenched in Hyperions" -
"Cambions are like Drakes that go really fast" -
BASIC-042620081900
WOLFPACKS-053120081600
FLYBYS-2206081600
My YouTube Channel
#3
Posted 25 August 2010 - 08:57 AM
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#4
Posted 25 August 2010 - 10:27 AM
CCP Wrangler
#5
Posted 25 August 2010 - 10:43 AM
#6
Posted 25 August 2010 - 11:09 AM
Incidentally, I've never got much joy out of SLI with Eve - I run 3-4 clients (window mode) across two monitors, and have always got better performance disabling SLI and running 1-2 clients per card, with a monitor connected to each.
Yeah the problem here is that the app is in window mode. Getting SLI focus on a window reliably was hard enough before Vista/Win7 but it WAS do-able. It still is but if you're running Aero on the desktop then the desktop itself is using "3D" features like transparency. Even with Aero disabled there's several problems with multiple monitor setups with various graphics SLI setups.
This causes a variety of issues, depending on your hardware & drivers. For me* it causes massive DPC (delayed protocol call) latency. This is so bad that it actually skews the system clock by about 5 minutes per HOUR. If you're playing Eve for a couple of hours then you can virtually guarantee you'll get traffic control & cap issues as your local time is shifting so much in relation to the server that the "old" cap problems (going to zero instantly etc) resurface.
None of this occurs when you run SLI full-screen.
It can be ameliorated by sync'ing your system time every 10 mins or so (Win7 by default does this once a week) but that's a workaround. I sync'd with Strathclyde Uni every 5 minutes when I was trying to work out what the hell was going on - I remembered the ancient "Spread spectrum clock bug" is all
On the wife's machine** its not so bad which makes me think its having "hybrid" graphics setup that causes a lot of the problems.
Like you I just run Eve on a single gpu. Its not like it needs SLI anyway
*Alienware M17x (revision 1) with 2xGTX280M and 1x9400M
** Alienware M17x (rev 2) with 2xHD5870 cards.
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#7
Posted 25 August 2010 - 12:30 PM
#8
Posted 25 August 2010 - 12:36 PM
You can use "/AFFINITY 1" for core 0 and 2 for core 1 (alternatively 0x1 and 0x2)Righto, so I have only a dual core processor. What's the hex to assign one to core0 only, and the other to core1 (as per Windows listing)?
In wildness is the preservation of the world,
so seek the wolf in thyself
#9
Posted 25 August 2010 - 12:50 PM
The only reason I put 0x in before the mask is so its obvious to s/w & h/w peeps that it is hex. You don't need to put 0x in if you don't want to, makes no odds.
Full table for quad-core is :
0x1 - cpu0
0x2 - cpu1
0x3 - cpu0 and cpu1
0x4 - cpu2
0x5 - cpu0 and cpu2
0x6 - cpu1 and cpu2
0x7 - cpu0, cpu1 and cpu2
0x8 - cpu3
0x9 - cpu0 and cpu3
0xA - cpu1 and cpu3
0xB - cpu0, cpu1 and cpu3
0xC - cpu2 and cpu3
0xD - cpu0, cpu2 and cpu3
0xE - cpu1, cpu2 and cpu3
0xF - cpu0, cpu1, cpu2 and cpu3
The mask extends up to 0xFF for Win7 AFAIK - ie 8 cpus.
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#10
Posted 25 August 2010 - 12:52 PM
In wildness is the preservation of the world,
so seek the wolf in thyself
#11
Posted 25 August 2010 - 01:25 PM
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#12
Posted 25 August 2010 - 02:40 PM
#13
Posted 25 August 2010 - 03:04 PM
XP cavemen like me don't have many options, one which I've found works alright is http://www.mlin.net/SMPSeesaw.shtml
Do a search for "process.exe affinity"
Thats what I used on XP/2k3 32bit boxes. Very useful.
If its XP64 then good luck finding anything that works reliably
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#15
Posted 26 August 2010 - 03:54 AM
Yep - as Silas said. The default for the mask is hex anyway.
The only reason I put 0x in before the mask is so its obvious to s/w & h/w peeps that it is hex. You don't need to put 0x in if you don't want to, makes no odds.
Full table for quad-core is :
0x1 - cpu0
0x2 - cpu1
0x3 - cpu0 and cpu1
0x4 - cpu2
0x5 - cpu0 and cpu2
0x6 - cpu1 and cpu2
0x7 - cpu0, cpu1 and cpu2
0x8 - cpu3
0x9 - cpu0 and cpu3
0xA - cpu1 and cpu3
0xB - cpu0, cpu1 and cpu3
0xC - cpu2 and cpu3
0xD - cpu0, cpu2 and cpu3
0xE - cpu1, cpu2 and cpu3
0xF - cpu0, cpu1, cpu2 and cpu3
The mask extends up to 0xFF for Win7 AFAIK - ie 8 cpus.
The pattern will follow.
Reason being that it's binary:
01 = 0x1 - cpu0
10 = 0x2 - cpu1
11 = 0x3 - cpu0 and cpu1
100 = 0x4 - cpu2
101 = 0x5 - cpu0 and cpu2
110 = 0x6 - cpu1 and cpu2
111 =0x7 - cpu0, cpu1 and cpu2
1000 = 0x8 - cpu3
1001 = 0x9 - cpu0 and cpu3
1010 = 0xA - cpu1 and cpu3
1011 = 0xB - cpu0, cpu1 and cpu3
1100 = 0xC - cpu2 and cpu3
1101 = 0xD - cpu0, cpu2 and cpu3
1110 = 0xE - cpu1, cpu2 and cpu3
1111 = 0xF - cpu0, cpu1, cpu2 and cpu3
If you convert the Hex into binary, you can see that where there's a 1 that CPU is turned on (cpu0 being the far right and working to the left). Where there's a 0, that CPU is turned off.
#16
Posted 26 August 2010 - 06:33 AM
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#17
Posted 26 August 2010 - 07:49 AM
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#18
Posted 26 August 2010 - 12:57 PM
It didn't do that for me - I had two instances running on the same core last night (four in total - one on CPU1, one on CPU3 and two on CPU2).Interesting. If you force two instances of Eve onto the same cpu then when you login the second account the first account will disconnect with the usual "Transport failed....".
I KNOW I had two accounts on one cpu in 2004/5 so CCP have broken something (else).
In fact at one point I had two clients running on each of two cores, before switching one in Task Manager.
CCP Wrangler
#19
Posted 26 August 2010 - 01:06 PM
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.
#20
Posted 26 August 2010 - 01:06 PM
I really meant that the standard version of Win7 can handle 8 cpus rather than anything else Baka - enterprise will handle up to 64 IIRC You're still limited to two cpu sockets for the standard versions right enough (Home Premium I think only supports one socket).
My point was that the pattern follows - it's the same pattern on the 72 Processor box we have at work - it's just a shitload of 1s and 0s, telling us which CPUs are on or off for a particular task. If you want all 72 processors for a task, you take the binary number with 72 1s all in a row and convert it to hex.
#21
Posted 31 August 2010 - 02:46 PM
Trying to route the HD audio over HDMI to one monitor/TV while having other monitors on DVI is not as straightforward as I'd assumed :@
If anyone else is looking for a nice little solution that will switch the audio over to HDMI/other output when Media Centre loads (and/or other options) then I can recommend :
Audio Renderer
Works very nicely indeed and saved me writing a script to do it
MORAL, adj. Conforming to a local and mutable standard of right. Having the quality of general expediency.