Welcome to the Second Life Forums Archive

These forums are CLOSED. Please visit the new forums HERE

Torley! Need a sticky covering dual proccessor slowdowns

Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
10-08-2006 08:48
Dual CPUs are the future and more and more people are moving to them every day and it seems like every day there is a post complaining about their new high end machine running SL like it were a 1996 vintage doorstop computer. The cure is really simple, the client only needs to be set to a single CPU instead of using both. Why it isn't in the client code already is not for mere mortals to know but there is a cure we can use to get around the problem.

SL needs to be set to a single CPU. This is called setting affinity in geek speak. If you are not getting the framerate you expect from your dual core CPU, AMD or Intel, try setting affinity to a single CPU. To do this, open the Task Manager (control+alt+del) while SL is running. Go to Processes and find Secondlife.exe and right click it. Select Set Affinity and you should see a list of CPUs. CPU 0, CPU 1 etc. If you see four CPUs checked but know you only have two cores then you have hyperthreading on. You need to select a single core, doesn't matter which one, and leave the rest unchecked. Close out the task manager and you should see a significant increase in framerate.

If this does indeed cure your problem then you have two choices besides waiting for LL to fix it (ETA probably after Havok 2 update). You can manually set affinity each time you start SL or you can find a utility to do it for you.

Note: This really isn't a fault in SL itself, it is an XP and OpenGL problem for the most part.

I suggest folks post what third party solutions or work arounds they have found here in an easy to locate central thread so it can be easily accessed.

Here are some I found looking through recent posts:

Setaffinity:
http://s8.quicksharing.com/v/5795272/setaffinity.zip.html

WinLauncherXP 2.0.5 Beta:
http://www.majorgeeks.com/download870.html

StartAffinity:
http://www.adsciengineering.com/StartAffinity/

Shoveaffinity:
http://www.adsciengineering.com/tools/shoveaffinity/

Imagecfg:
http://www.robpol86.com/Files/imagecfg.exe

Copy imagecfg.exe to %systemroot%\system32 (or C:\Windows\system32), and %systemroot%\system32\dllcache (or C:\Windows\system32\dllcache).
Doing so will make imagecfg a system command.

To use this tool to set affinity masks for an executable, type the following command in a command prompt window or run dialog:
imagecfg -a 0x1 c:\path\to\file.exe
If the above didnt work, try typing the following:
imagecfg -u c:\path\to\file.exeimagecfg -a 0x1 c:\path\to\file.exe
0x1 = CPU0 (first logical/physical CPU)
0x2 = CPU1 (second CPU)
0x3 = CPU2 (third CPU)
etc...

This tool only works on NT based operating systems (Windows NT, 2000 Family, XP Family, 2003 Family, Longhorn/Vista).
It will work on Multiprocessor machines and Uniprocessor machines with HyperThreading Technology (and probably multicore processors).


Also, here are some excellent threads with lots of info:

/111/66/132023/1.html

http://forums.amd.com/index.php?showtopic=65211&st=35
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Kumi Kuhr
Registered User
Join date: 9 Jul 2005
Posts: 43
excellent post Kathmandu
10-08-2006 12:24
One question: I'm on a dual-core Intel Mac -- does the same advice apply for me?
_____________________
avid explorer, gregarious loner
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
10-08-2006 14:03
From: Kumi Kuhr
One question: I'm on a dual-core Intel Mac -- does the same advice apply for me?


I dunno... i have no clue as to select a CPU using an Intel Mac let alone whether it will help. Likely as not being its more an OpenGL and XP thing.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Takuan Daikon
choppy choppy!
Join date: 22 Jun 2006
Posts: 305
10-08-2006 14:27
Thank you for that info, now I am quite curious whether I could expect better performance by doing this. I am not unhappy with my performance on my dual-core machine, but the possibility of better performance is exciting.
Hank Rucker
Registered User
Join date: 15 Jul 2006
Posts: 1
Bravo!
10-08-2006 15:14
This is it. This post and all of the others like it are why the forums are an excellent resource for the Second Life community... I cannot think of a better example.

Written by a non-Linden, posting a clear and concise "this is what is broken, and here is what you do to ameliorate it". Something we seldom see on the Official Blog, and never from non-Lindens.

Bravo!

I also have a dual core processor and will be very interested in trying this out when I can actually log back in due to yet another replicator attack based grid outage.

I know Phillip Linden says he and the other Linden's don't have time to read every post anymore. You know what? That doesn't matter... That is why there is a search function. Having a problem? Try some search keywords, and you might just find a solution. Like the parent of this thread.

It doesn't get much clearer than that.

Thank you, Kathmandu Gilman...

PS: No, REALLY! THANK YOU! I have gone from a maybe 15-25 FPS to almost seeing 50 on occasion! Wow. I'm using the WinLauncher program btw... Just AMAZING the boost in performance!

We meet up in game, I SO owe you a beer... Heh
Torley Linden
Enlightenment!
Join date: 15 Sep 2004
Posts: 16,530
10-09-2006 13:17
Hey Kath, it's stickied. =)

I'm in a similar boat (my main computer has an Opteron 170).

I just also wanted to mention that AMD has an official update for this too, Dan recently let me know:

AMD Dual-Core Optimizer
_____________________
Bri Hasp
Registered User
Join date: 13 May 2005
Posts: 18
affinity
10-21-2006 17:39
The imagecfg MS tool doubled my FPS after an easy setup and sticks.

I tried the above mentioned AMD Dual-Core Optimizer utility and had 0% change:

Perhaps it has no affect on X2 threading.
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
10-22-2006 18:51
Yeah, same here, didn't do diddly for me either. The other solutions have worked as far as I can tell.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
SuezanneC Baskerville
Forums Rock!
Join date: 22 Dec 2003
Posts: 14,229
10-22-2006 20:33
It would be good to change the title of this sticky to something that doesn't start with "Torley!". Perhaps "Dual processors- problems and solutions"
_____________________
-

So long to these forums, the vBulletin forums that used to be at forums.secondlife.com. I will miss them.

I can be found on the web by searching for "SuezanneC Baskerville", or go to

http://www.google.com/profiles/suezanne

-

http://lindenlab.tribe.net/ created on 11/19/03.

Members: Ben, Catherine, Colin, Cory, Dan, Doug, Jim, Philip, Phoenix, Richard,
Robin, and Ryan

-
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
10-22-2006 20:46
From: SuezanneC Baskerville
It would be good to change the title of this sticky to something that doesn't start with "Torley!". Perhaps "Dual processors- problems and solutions"



I can't, its going to take a moderator to do it.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Nick Niles
Registered User
Join date: 9 Aug 2006
Posts: 6
11-14-2006 10:08
why not recode SL for multithreading? i was running it on an Core 2 duo, both cpus were used , why not make it threaded? it would run faster on dual core computers and not much slower on none smp computers
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
11-14-2006 14:28
Bwahahahaha... they can't even get Havoc 2, which has been worked on for 3 years now and was "supposed to be any day now" two years ago. SL works for the most part now, recoding is a massive undertaking and will likely break everything. You have to consider almost 8 years of legacy coding.

Also, most of the problem with SL running on multicore is more an OpenGL problem than SL from what I can tell.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Ricky Lucero
Registered User
Join date: 25 Jul 2006
Posts: 122
11-21-2006 12:57
I thought I'd post my experience here in regards to the dual core procs and setting the affinity at an attempt at better performance.

I have a Dell M1710 Laptop. Core Duo 1.83GHz (T2400). 2GB ram, nvidia 7900gs go. The game works pretty well for the most part on this machine, however averages 20fps in non-laggy areas. A little low if you ask me, for the setup. So, I set affinity to one processor or the other, and it get a consistent drop of about 2fps. Both processors actually works better than setting SL to run on only one.

I've tested this in both Windows XP and Windows Vista on the same laptop. Same results.
Simona Ferlinghetti
Registered User
Join date: 17 Oct 2006
Posts: 5
11-29-2006 00:35
This worked for me :)

One note for Vista users: you'll have to execute cmd.exe as Administrator.
To do so:

Hit the start button
Type cmd in the search box
Press Ctrl-Shift-Enter

And a dosbox will pop up, with full administrator rights.
Sterling Whitcroft
Registered User
Join date: 2 Jul 2006
Posts: 678
Mac Users:
12-23-2006 11:35
SL on an INTEL Dual Core MAC runs in just one processor. (Tiger OS)
It looks like LEOPARD, due out in 07Q2, will offload the graphics handling to the second processor--at least for the OpenGL stuff that's used by SL.
This should be automagic. Lets hope its a HUGE net speed increase, too!
Arachnid Baxter
Registered User
Join date: 8 Jan 2007
Posts: 44
01-11-2007 16:49
For those who are curious about the technical details:

SL is a single-threaded application. This means it can only take advantage of one CPU.

A single CPU can only execute one thing at a time. To create the illusion of multiple programs executing simultaneously, operating systems like Windows run each program for a very small amount of time, before giving the next program in line a 'slice'. Things become more complex when multiple CPUs or cores are introduced, as a program could potentially be running on one CPU, stopped by the OS for something else to have its time, then restarted on a _different_ processor or core.

This wouldn't be a problem, except that CPUs 'cache' a lot of information relevant to processes running on them - recently accessed data and the like. The impact of this caching is enormous - the main difference between a Pentium 4 and a Celeron, for example, is the amount of cache. To make matters worse, some architectures have different memory banks for different processors. When a program like SL is suspended on one CPU and restored on another, the CPU it's now running on doesn't have any of the cached information the first one had, and so it suffers a massive slowdown while it loads everything in, or transfers it from the other CPU. By the time it's done with that, it's probably been sent back to the first CPU by the OS, and the whole process starts all over again.

'Thread affinity' is a way to tell Windows that this program wants to run consistently on a particular CPU. Windows will then make sure it doesn't get sent to another CPU just because that one's available slightly sooner. Some OSes figure this out pretty well on their own. Windows, apparrently, doesn't.

Regarding the suggestion of making SL multi-threaded: Some things are easier to parallelise than others. To take a trivial example, calculating prime numbers is trivial to run on multiple CPUs, as is cracking passwords. Generally, the more integrated different parts of a process are, the harder they are to parallelise. Games and similar graphical applications like SL parallelise very badly. It is possible to get some gain from multiple processors, but it takes a _lot_ of hard work and refactoring, and more likely than not introduces a _lot_ of bugs that have to be squashed in the process.
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
01-11-2007 17:31
What amazes me though is that a relatively trivial detail like having the client set affinity itself would have and still would solve a lot of problems people experience. Multiple core computers are the future. Why LL doesn't do this boggles my mind.

SL and other games don't need to be multi threaded to take advantage of dual processors, clever programing can offload tasks from one cpu to the other like using the second cpu as a physics accelerator for example or the second CPU dedicated to nothing but dealing with the cashe.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
Arachnid Baxter
Registered User
Join date: 8 Jan 2007
Posts: 44
01-11-2007 18:16
From: Kathmandu Gilman
SL and other games don't need to be multi threaded to take advantage of dual processors, clever programing can offload tasks from one cpu to the other like using the second cpu as a physics accelerator for example or the second CPU dedicated to nothing but dealing with the cashe.


That _is_ multi-threading - you can't use more than one CPU simultaneously without having more than one thread.

For games, tasks that can be offloaded generally fall into two categories: Relatively easy to offload, but with minimal performance advantage, like dealing with the cache, or extremely difficult to offload, but with decent performance advantage (physics calculator - it interacts with the rest of the game so closely that spinning it off into its own thread would be a nightmare).
Haravikk Mistral
Registered User
Join date: 8 Oct 2005
Posts: 2,482
01-12-2007 12:21
As per this blog entry:

From: Cory Linden
* Multithreading in the client for rendering and texture decodes. This offers a significantly smoother experience and speed improvements on multi-core/multi-processor systems. The message handling, texture decoding, and texture management portions of the viewer have [changed] a fair amount to accommodate these changes.

Yum :)
_____________________
Computer (Mac Pro):
2 x Quad Core 3.2ghz Xeon
10gb DDR2 800mhz FB-DIMMS
4 x 750gb, 32mb cache hard-drives (RAID-0/striped)
NVidia GeForce 8800GT (512mb)
Ricky Lucero
Registered User
Join date: 25 Jul 2006
Posts: 122
01-28-2007 02:34
Strange new behavior in 1.13.2(15), that I thought I'd share:

I have a DELL XPS M1710 with a Core Duo T2400 1.83GHz processor. This thing is loaded, and has the 256MB Nvidia 7900GS. SL would usually do quite well without changing affinity, until this latest build.

Old behavior:
Open SL, log in, FPS is about 5 for the first 10-20 second, then it goes nuts and goes way up to about 20FPS, then all is normal.

New Behavior:
Open SL, log in. FPS stays at around 5. Change affinity to one processor, FPS goes up immediately. Change affinity again back to both processors, and FPS again increases. Now all is normal.

Sucks that I have to mess with the affinity now, when I never had to before.
Ashrilyn Hayashida
Registered User
Join date: 6 Jul 2006
Posts: 103
02-22-2007 07:42
I have an Opteron 165, dual core, about 1.8 GHz. OC'd to 2.2 GHz

I think in the first look client, even with "multiple threads" off, the framerate seemed to be okay, comparable to what it was on a single core system.

In the main client, I *did* find that assigning SL to just one core very greatly increased performance.
Trace Wilder
Registered User
Join date: 25 Jan 2007
Posts: 6
What changed between version 13 and 14/15...?
04-30-2007 07:58
Hi this is the first time ive posted on any of the forums. Until now Ive never really needed to. I have been having all of the problems that have been being discussed here and tried setting it so it is only using one of the CPU's. But I am still having serious issues with screen skip and and things taking forever to rezz. I guess, this is my question: I began playing in sl in Jan 07 and im pretty sure it was the version 13 that was out....Everything ran great for me then...Version 14 came along and I updated to it and had all the symtoms im having now. So at that time there was a way to revert back to 13, which i did and solved the problem. Everything is fine until version 15 comes out and now im back with all the problems I had before.....Im not very knowlegable on troubleshooting whether it is Server side or Client side, or maybe some settings that are changed. But im assuming that since it ran fine before its not something that I have done, and has something to do with the new version 15. Does anyone know what version 15 may have changed that would cause the severe screen skipping that I could fix?...My last couse of action will be re-installing tonight, but after that I am just completely screwed...HELP...!!!

Thanks,
Trace Wilder

PS I hope this is in the right thread just have found that the duel core symtoms seem to be closest to my problems....
Usagi Musashi
UM ™®
Join date: 24 Oct 2004
Posts: 6,083
04-30-2007 08:04
I have both cores on........With First Look I stop turning off the 2nd core. But NOW having issues yet again. WIth a diff cpu and mb and ddr2 from the first problem issue. Its indeed the UI and LLabs side thats for sure.


CPU: AMD (6000+ 125 Watts AM) (3015 MHz)
Memory: 2047 MB
OS Version: Microsoft Windows XP Service Pack 2 (Build 2600)
Graphics Card Vendor: NVIDIA Corporation
Graphics Card: GeForce 7900 GTX/PCI/SSE2/3DNOW!
OpenGL Version: 2.0.3
Lanx Grigg
Registered User
Join date: 5 May 2007
Posts: 1
05-05-2007 07:32
Running with the same hardware as Ricky, only on a Toshiba Satellite... setting affinity isn't doing much, although I remember it working when I first got started with SL.
Kathmandu Gilman
Fearful Symmetry Baby!
Join date: 21 May 2004
Posts: 1,418
05-05-2007 08:27
Actually, since the Firstview client came out, this sticky has basically been made obsolete. New clients seem to have fixed a lot of the problems involving multiple processors.
_____________________
It may be true that the squeaky wheel gets the grease but it is also true that the squeaky wheel gets replaced at the first critical maintenance opportunity.
1 2 3