Archived

This topic is now archived and is closed to further replies.

martinlest2

FS2004 & CPU Core Affinity settings

Recommended Posts

<p>I have been reading through the some of the various posts on this subject and have a question which is still unanswered...</p>
<p> </p>
<p>Assuming that FS9 gains nothing from running on more than one core (some say it actually loses), is there anything to be gained from having it run on a core<em> other</em> than Core0 ? As far as I can tell, Windows also tends to run on Core0 and it is very obvious when FS9 starts to load how it is always Core0 that is at or close to 100%, whereas the other cores (I have  an i7-950 + HT, so see eight) hardly stir off zero.</p>
<p> </p>
<p>I am ot sure how I'd set this up though. In the Task manager affinity settings for FS9.exe, all cores are checked by default, but of course because of the way FS9 was designed, in practice the process uses only Core0. At least that's how I understand it. If I unchecked Core0, then I would presumably be getting FS9 to run on Cores1 to 7. Which is not, I gather, at all what should be happening. So if I unchecked all <em>cores</em> and then rechecked, say, just Core2... ??? FS9 would then run on one core, but not Core0, which other processes seem to prefer too.</p>
<p> </p>
<p>Or should I just leave things as they are? To be honest I am more concerned with the life of my CPU, with one core maxed out so much of the time (I only use the PC for FS9 & FSX) than with performance in FS, which is pretty good anyway.</p>
<p> </p>
<p>For anyone not sure what the question here is about, here is a simple video which explains the matter:</p>
<p> </p>
<p>


<p> </p>
<p>(I am not recommending (or otherwise) that anyone follows the instructions there by the way).</p>
<p> </p>
<p>Thanks,</p>
<p> </p>
<p>Martin</p>
<p> </p>
<p>LATER: <em>I meant the link to the video to open the page at Youtube, rather than embed the video here. If what's happened is unacceptable, apologies. Maybe a moderator can change it so there's just a link, if there's a problem?</em></p>

===============================================================================================================================================

 

Another coding problem. Here's the text reposted:

 

I have been reading through the some of the various posts on this subject and have a question which is still unanswered...

 

Assuming that FS9 gains nothing from running on more than one core (some say it actually loses), is there anything to be gained from having it run on a core other than Core0 ? As far as I can tell, Windows also tends to run on Core0 and it is very obvious when FS9 starts to load how it is always Core0 that is at or close to 100%, whereas the other cores (I have  an i7-950 + HT, so see eight) hardly stir off zero.

 

I am ot sure how I'd set this up though. In the Task manager affinity settings for FS9.exe, all cores are checked by default, but of course because of the way FS9 was designed, in practice the process uses only Core0. At least that's how I understand it. If I unchecked Core0, then I would presumably be getting FS9 to run on Cores1 to 7. Which is not, I gather, at all what should be happening. So if I unchecked all cores and then rechecked, say, just Core2... ??? FS9 would then run on one core, but not Core0, which other processes seem to prefer too.

 

Or should I just leave things as they are? To be honest I am more concerned with the life of my CPU, with one core maxed out so much of the time (I only use the PC for FS9 & FSX) than with performance in FS, which is pretty good anyway.

 

For anyone not sure what the question here is about, here is a simple video which explains the matter:

 

(as above)....

 

(I am not recommending (or otherwise) that anyone follows the instructions there by the way).

 

Thanks,

 

Martin

 

LATER: I meant the link to the video to open the page at Youtube, rather than embed the video here. If what's happened is unacceptable, apologies. Maybe a moderator can change it so there's just a link, if there's a problem?

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Many people claim it makes no difference, but using more then one core to run FS9 did make a very slight FPS increase on my system.  On average I saw a 5-9 FPS increase if I used cores 2 and 3 for FS2004.  Keep in mind, when you set your frame rate to unlimited, your frame rate will bounce around, so it may be very hard to see the small increase which is why many people see no difference.  You'll have to prove the FPS increase for yourself setting up a saved flight at a very frame rate hungry airport with everything maxed etc etc etc and repeat the test on core 0 and then spread across two other cores (not using core 0).

The quickest way to set core affinity is to write yourself a small batch program.

 

Windows XP Users
To set affinity in windows XP I use a line that looks like this:

psexec -a 2,3 cmd /C Start "" "C:\Program Files (x86)\Microsoft Games\Flight Simulator 9\fs9.exe" /CFG:NORMAL-fs9

psexec is a utility you have to use to set affinity in Windows XP and can be downloaded here:
psexec -a 2,3   tells XP to run FS2004 on cores 2 and 3.
fs9.exe" /CFG:NORMAL-fs9   Tells FS2004 to use the "NORMAL-fs9.cfg" file.  I have multiple fs9.cfg files for various aircraft.

Window 7 Users
To set affinity in windows 7 you could use a batch program that looks like this:

cmd /C Start "" /affinity xx  "C:\Program Files (x86)\Microsoft Games\Flight Simulator 9\fs9.exe" /CFG:NORMAL-fs9
where xx is =
01 - 1st CPU
02 - 2nd CPU
03 - 1st and 2nd CPU
04 - 3rd CPU
05 - 1st and 3rd CPU
06 - 2nd and 3rd CPU
07 - 1st 2nd and 3rd CPU
08 - 4th CPU
09 - 1nd and 4th CPU
0A - 2rd and 4th CPU
0B - 1st 2nd and 4th CPU
0C - 3rd and 4th CPU
0D - 1st 3rd and 4th CPU
0E - 2nd 3rd and 4th CPU
0F - 1st 2nd 3rd and 4th CPU

Keep in mind the file paths will differ on your system, but you'll get the general idea.
If you want to test this batch program concept out first on notepad.exe you can read this.

Window 7 users could also set affinity using this easy method:

 

Will running FS9 over muliple cores save your CPU? I have no clue.

 

RJ

Share this post


Link to post
Share on other sites

Thanks for the reply. Any comments? Is this a good idea, a bad idea, or pointless (especially in relation to stress on the CPU itself)?

Share this post


Link to post
Share on other sites

Pointless?

 

You own a Beech Baron and run one engine at full power every flight and the second engine at idle. Which engine will fail first?

Your beech baron has two fuel pumps to deliver fuel. Do you fly with one pump off and leave the second pump to handle the entire load?

 

You own a multi core CPU. Do you run everything on one core and leave the others idle?

All cores are contained in one chip, spreading the load across multiple cores will it aid in spreading out heat dissipation? Maybe not too much, but why not spread the hot spots across multiple cores. Heat is a CPU's cancer, why heat up only one core?

Will running a program across multiple cores reduce bottle neck? For FS2004, so slight people say it's pointless.

 

I see no disadvantage running FS2004 on two other cores (which is what I do, just don't use core 0).

Do what makes sense.

 

RJ

Share this post


Link to post
Share on other sites

I would not call it pointless, but I've seen no benefit (this is on a Corei7) giving FS more than 2 physical processors (4 cores). What is more useful is being able to keep it off the 0 physical processor (cores 0-1) just because by default so much other crap will run there. I also shuffle them from one Fs session to the next. What I've found most important with my i7 is to assign entire physical processors to FS, that is cores in pairs starting with even core#s. Making it play more hopscotch than necessary across physical processors has a definite negative impact on rates, smoothness, and stability.
For example (core# affinity settings):
2,3,6,7, or 4,5,10,11 = good
1,3,5,7 or 4,6,8,10 = not as good
 

Share this post


Link to post
Share on other sites

If I run FS2004 on just one processor with my i7-920, I get slight stutters. When I change the affinity for fs9.exe to all processors, then the stutters go away.

Share this post


Link to post
Share on other sites

I tried it with FSX and got worse performance but I don't really know what I'm doing.

 

Obviously ..... if running FSX

Share this post


Link to post
Share on other sites

3Green, thanks, sounds interesting. Since my CPU has 2 cores + Hyperthreading, I'm not sure of the path to take. These are my options:

 

1) Assign Core0 and Core2 (the two physical cores)

2) Assign all but Core 0.

 

I have no option in BIOS for disabling HT; if I had it, it would be all clear for me. What do you all think is better?

Share this post


Link to post
Share on other sites

Affinity mask has been proven to provide worse fps then without it.

I personally don't use it because it causes me to get bad fps and blurries

Share this post


Link to post
Share on other sites

Hmmm .. opinion divided, as on so many other threads. Thanks for the ideas. I think though Jim, if you say 'pointless' it'd be good if you said why. The one word answer isn't so convincing :smile: Have you tried out different settings to come to that conclusion? I did say in any case, I was more thinking of CPU life than FS9 performance (which as you see from the screenshot holds around 60fps except at busy airports or in heavy cloud).

I was thinking along the same lines as 'tj22': What is more useful is being able to keep it off the 0 physical processor (cores 0-1) just because by default so much other crap will run there. I'll try a little experiment..

 

First, running FS9 on cores 2-7 (leaving 0-1 for the 'crap'!) and see what happens:according to the performance tab (and my Intel CPU Usage meter), I have around 40% CPU usage on cores 3, 5 & 7 this way. Core 0 is under 10% now. Does this mean that FS9 is running on more than one core? I thought it couldn't..

 

Second, running FS9 on cores 2-3 only, forcing FS9 to run on one CPU, as designed. That way the Task manager performance tab shows core 2 at 100% much of the time.

 

I'll see if there are any performance differences.

 

Martin

Share this post


Link to post
Share on other sites

All,

 

FS04 is a single core program, it runs on one thread only. if you want to adjust which core it uses that is fine,. and you may notice a difference because of what else you are running on core zero. Anything after that is the ol' fish oil effect.

Share this post


Link to post
Share on other sites

Note to 3Green.. I tried your batch file. the first thing is that FS9 now ignores my [Old Modules] entry in the fs9.cfg file and wants to disable a batch of dll files. Also, having used the following line:

cmd /C Start "" /affinity 0E "D:\FS9\fs9.exe" /CFG:NORMAL-fs9

when I look at the affinity settings via Task Manager, FS9 is using cores 2, 3 & 4, not CPUs 2, 3 & 4. In other words, cores 0,1,5,6 & 7 are not being used. How do I arrange it so that cores 2 through to 7 are being used? Also, would need to fix the cfg file issue. I don't understand the last part of the batch file.

Is there another way to get FS9 always to use selected affinity settings? I don't want to have to manually set the values via Task Manager every time I start a flight of course.

Jim, as I say, if you select cores 2-7 when FS9 is running, they all show roughly 40% activity. So FS9 must be using more than one core. Whether that helps or hinders performance is a different question, but it does seem that FS9 can be made to run on multi-cores, no? I don't think I am misinterpreting what I am seeing in Task Manager etc.

Thanks.

Share this post


Link to post
Share on other sites

I tried changing the affinity settings on my recently resurrected FS9 box - an old E8400 OC'd to 3.6, 560Ti, 8GB, Win7 64bit. This is only a dual core, but after disabling either core 0 or 1 saw my frames dip on average about 5 fps. This was while sitting at an FSDT airport (so Couatl engine) along with REX weather engine, AI at 80% and AES running. Simply window FS9 and then you can change the affinity settings dynamically to immediately see any impact.

 

FS9 might be a single thread application, but seems addons that run as background apps can take advantage of being moved to other cores if FS9 is allowed to utilize other cores for their processes - in the same manner that FSX/P3D does.

 

On that, a good idea if you are using Affinity settings to only use physical cores, and not any cores with hyperthreading - this avoids stutters due to thread collisions. Same as in FSX/P3D - so use core 0, 2, 4, 6, 8 for hyperthread enabled CPU's.

 

We all know what works for some, might not work as well for others. Just try changing the settings while running FS9 and see what happens with your fps.

Share this post


Link to post
Share on other sites

Try leaving out the last part, so it look like this:

 

cmd /C Start "" /affinity 0E "D:\FS9\fs9.exe"

 

That should be enough.

Share this post


Link to post
Share on other sites

Hi. I tried that but (may be a separate glitch - very odd), now, no matter what value I put in for the affinity, 01,02,03. (with or without the zero) 0E, 0F etc. etc, I always get cores1-4 active - same result every time. I've given up on the whole thing for now!

Share this post


Link to post
Share on other sites

 

 


FS04 is a single core program, it runs on one thread only

It was written in the single core era, but it is ~not~ single threaded. (As to how the workload is distributed over the 30 or so threads - hard to say. Task Manager doesn't dig that deep.) In any case when you spread the affinity, the CPU's internal architecture does the heavy lifting to make it happen, so results are like so many things with FS - hardware-dependent.
 

Share this post


Link to post
Share on other sites

 

 


when I look at the affinity settings via Task Manager, FS9 is using cores 2, 3 & 4, not CPUs 2, 3 & 4
In WIN XP, where do you find core useage data? I see only CPU.

 

I am wondering what effect running in full-screen or windowed mode has on FS9 performance.

Certainly the graphics are handled *totally* differently.

What about CPU activity? 

 

There's often discussion about "my FS9 does this, or that" but hardly ever distinction about windowed mode 

Share this post


Link to post
Share on other sites

Why do people keep saying that Windows processes run on core 0? They typically don't have an affinity either, and they'll run wherever the kernel wants them to, which is an available processor.

 

Honestly, unless you write your own pre-emptive multitasking kernel, you're probably worse at scheduling processes than the folks who wrote the NT kernel task scheduler. Leave things alone.

 

Cheers!

Luke

Share this post


Link to post
Share on other sites

All,

 

FS04 is a single core program, it runs on one thread only. if you want to adjust which core it uses that is fine,. and you may notice a difference because of what else you are running on core zero. Anything after that is the ol' fish oil effect.

 

True very true. FS9 is a single core program. Affinity mask won't make a difference. However there was a program wrote about a year or so ago for Intel and AMD cpu's to run on multi core systems. It was called auto cpu affinity for FS 2004. It had to be started before FS9 was started, and it would allocate the process across all 4 processors.

Share this post


Link to post
Share on other sites

True very true. FS9 is a single core program. Affinity mask won't make a difference. However there was a program wrote about a year or so ago for Intel and AMD cpu's to run on multi core systems. It was called auto cpu affinity for FS 2004. It had to be started before FS9 was started, and it would allocate the process across all 4 processors.

 

Snake oil. There's nothing that can allocate a single thread across multiple processors.

 

Cheers!

Luke

Share this post


Link to post
Share on other sites

I think some here must be confusing thread with process. FS runs in a single process, but with multiple threads. And yes threads on a single process can run on multiple processors, as determined by the process affinity mask. To insist FS is confined to a single core, much less a a single thread is just plain wrong.

 

Share this post


Link to post
Share on other sites

I think some here must be confusing thread with process. FS runs in a single process, but with multiple threads. And yes threads on a single process can run on multiple processors, as determined by the process affinity mask. To insist FS is confined to a single core, much less a a single thread is just plain wrong.

 

While FS9 may have multiple threads, only one is doing any meaningful work.

 

Cheers!

Luke

Share this post


Link to post
Share on other sites

recently we had nonsense about fs9 using 1024x1024 textures.  now fs9 is multicore capable? 

 

sad.

Share this post


Link to post
Share on other sites

FS9 never has been multicore. This is a fact. However, Windows can pick any core (physical/virtual) any time, run FS9 there and in the next second (or even clock cycle) run it in another core. Part of the discussion here is if there is any advantage in restricting the cores FS9 can use. I can remember seeing this discussion since HT appeared.

 

For me, I've just got my answer (select only physical cores, let Windows decide which one), but I'll have to test it before being happy with this solution.

 

True very true. FS9 is a single core program. Affinity mask won't make a difference. However there was a program wrote about a year or so ago for Intel and AMD cpu's to run on multi core systems. It was called auto cpu affinity for FS 2004. It had to be started before FS9 was started, and it would allocate the process across all 4 processors.

 

That program didn't get to be enough snake oil for me. In my old P4 2.8 HT I gained some stability, in my current AMD Athlon 64x2 4000+ desktop didn't notice anything... and in my i5 laptop (see my specs) I gained some stutters.

Share this post


Link to post
Share on other sites