Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

CPU Affinity in Linux?

Karsten Rutledge
Linux User
Join date: 8 Feb 2005
Posts: 841
10-20-2006 12:37
I believe most people here are probably aware that under Windows SL has issues with processor affinity, and if you restrict it to a single CPU you often get a 3x jump in FPS. (Note this only applies on dual core systems such as PentiumD and Centrino Duo, not Hyperthread CPUs, such as Pentium4.)

Does this problem manifest in Linux at all? I have a Centrino Duo laptop with an nVidia 7900 GTX that gets positively miserable performance running the SL client native. On my previous laptop by the same manufacturer I got 25-30 FPS in SecondLife running emulated under WINE on a Pentium 4 3.6ghz with an nVidia 6800. On my new laptop running native OR emulated I get in the 15 FPS range. Running SL under Windows on the same laptop netted me in the 60-70 FPS range.

I'm running Slackware 10.2 on it at the moment, with the latest nVidia drivers. Does anyone know of an easy way to force SLinux to stick to one processor to test this, and/or other suggestions on why my performance is abysmal?
_____________________


New products, updates, rants, randomness.
Addictive high-quality games for sale: Greedy Greedy, On-A-Roll, Mancala and the newly released Khet laser strategy game.
Dale Glass
Evil Scripter
Join date: 12 Feb 2006
Posts: 252
10-20-2006 15:31
From: Karsten Rutledge

I'm running Slackware 10.2 on it at the moment, with the latest nVidia drivers. Does anyone know of an easy way to force SLinux to stick to one processor to test this, and/or other suggestions on why my performance is abysmal?


use taskset, syntax:
CODE

taskset -p [mask] [pid]


or:
CODE

taskset [mask] -- [command] [arguments]


Mask specifies a bitmask with a bit per CPU. For example to force usage of only CPU0 specify the mask as 1, or to force CPU1 use 2. 3 would allow both.

Now, I tried this here, and it doesn't make any difference for me. Maybe Linux has a better scheduler.
_____________________
Current projects:
TrustNet
Read my blog for news about them.
Karsten Rutledge
Linux User
Join date: 8 Feb 2005
Posts: 841
10-20-2006 15:46
From: Dale Glass
use taskset, syntax:
CODE

taskset -p [mask] [pid]


or:
CODE

taskset [mask] -- [command] [arguments]


Mask specifies a bitmask with a bit per CPU. For example to force usage of only CPU0 specify the mask as 1, or to force CPU1 use 2. 3 would allow both.

Now, I tried this here, and it doesn't make any difference for me. Maybe Linux has a better scheduler.


Thanks Dale, I'll give that a try. I'm just trying to figure out why I have such horrible performance on a machine that should be doing 4x better at least.
_____________________


New products, updates, rants, randomness.
Addictive high-quality games for sale: Greedy Greedy, On-A-Roll, Mancala and the newly released Khet laser strategy game.
Merrick Moose
Registered User
Join date: 20 Oct 2005
Posts: 191
10-20-2006 18:58
SL itself will only handle one CPU, but locking it to one CPU will prevent it from jumping back and fourth which is a waste of resources in itself.
Charlie Omega
Registered User
Join date: 2 Dec 2002
Posts: 755
10-26-2006 12:31
From: Karsten Rutledge
(Note this only applies on dual core systems such as PentiumD and Centrino Duo, not Hyperthread CPUs, such as Pentium4.)?


I have actually noticed a serious change in client performance on my P4 HT when I change affinity.

I have to set affinity on this CPU or 15 to 20 mins. online the client is either unusable or crashes. I set CPU affin to 0 and all is well. (havn't tried SLinux on this system yet but the winblows client does this)
_____________________
From: 5oClock Lach
With a game based on acquiring money, sex, and material goods, SL has effectively recreated all the negative aspects of the real world.


Mega Prim issues and resolution ideas....
http://blog.secondlife.com/2007/10/04/second-life-havok4-beta-preview-temporarily-offline/