Finding FSX.CFG and setting an affinity mask

The place for hardware and software issues, FS and non-FS related

Moderators: Guru's, The Ministry

User avatar
Paul K
Red Arrows
Red Arrows
Posts: 7814
Joined: 12 Jun 2005, 16:41
Location: Norfolk UK

Re: Finding FSX.CFG and setting an affinity mask

Post by Paul K »

Remember you can alter your affinity mask settings on the fly using Task Manager.

Start task manager by right clicking on the tool bar at the bottom ( this is with FSX/P3D in windowed mode, obviously ), click on the processes tab, right click on fsx.exe or p3d.exe and set your affinity by clicking on the cores. I have a quad core i7 with hyperthreading enabled, so Task Manager presents me with eight CPU boxes to tick, ( CPU 0 to CPU 7 inclusive ). Opinion differs on whether you should have all cores ticked ( which equates to AffinityMask=255 in the .cfg ) or leave the first one ( i.e. CPU 0 ) unticked and available for Windows to use ( which equates to AffinityMask=254 in the .cfg ). Anyway, you can try it out.

Using the same Task Manager window, you can also set the simulator's priority. It warns of potential instability, but the only one I've come across is the sound breaking up, which can be rectified by pressing the Q key twice ( sound off - sound on ) in the sim.

User avatar
DaveB
The Ministry
Posts: 30457
Joined: 17 Jun 2004, 20:46
Location: Pelsall, West Mids, UK
Contact:

Re: Finding FSX.CFG and setting an affinity mask

Post by DaveB »

Ro..
That is your prerogative mate ;)

Paul..
That's something I didn't know. I often go into Task Manager when things suddenly slow (which they do from time to time) as a throw back from when I got pinged by that bitcoin bug in WinXP.. just to see if I've been pinged by it again! I didn't realise you could change the AffinityMask dynamically :-O

On the subject of Task Manager.. I'm sure many of us have heard that it can be advantageous to have FSX start (and run) with as few processes as possible running. This makes sense as you don't need stuff running you don't need. Point is though.. what don't you need :dunno: I think I have something like 49 processes running when FSX is on the go and to be brutally honest, I've no idea what the vast majority of them do :|

There are questions about FSXB that puzzle me to. Prior to installing and using it, I remmed out my AffinityMask setting (I see it's still remmed out and set at 15) and had DynamicHeadMovement switched off.. I don't like it and off is where it should stay. However, FSXB seems to make a fresh run at FSX each time you run it (which is why you should run it each time you fly as it checks your system 'at that time' and makes 'adjustments' accordingly.. so says the blurb) and it turns DynamicHeadMovement back ok which is a pain but something I've got to live with.. there being no option in the program to turn the darned thing off. Now.. the odd thing is.. FSXB must add an affinity mask because I tell it to do so. There are other settings I make in it.. 2048 textures for example which it makes. If I run FSX without running FSXB first.. Dynamicheadmovement remains ticked on but all the other changes I've made are gone. I've just looked at my cfg and there's no additional affinity mask entry.. texture load is 1024 but the one I really want off.. dynamicheadmovement.. is on :| I must try and look at both it and the FSX.cfg while both programs are running (if that's possible) to see what changes have been made and snap a copy.
TBH.. the single biggest (and noticeable) improvement it makes is to turn Windows Aero on. I'd never heard of Windows Aero before FSXB (WinXP doesn't have it which is probably why). I gather that FSX is coded to turn it off so how FSXB turns it back on again, I've no idea. If I don't run FSXB, I get the old rubbishy wibbly-wobblies in FSX so it does manage to turn it on.

All these questions and many more whizz around my addled brainbox :lol:
ATB
DaveB B)smk
ImageImage
Old sailors never die.. they just smell that way!

User avatar
DaveB
The Ministry
Posts: 30457
Joined: 17 Jun 2004, 20:46
Location: Pelsall, West Mids, UK
Contact:

Re: Finding FSX.CFG and setting an affinity mask

Post by DaveB »

Well.. I've answered some of those questions :lol:

I ran FSXB and FSX then jumped into Users/Application Data/e t c and had a look at what was in there. I found an FSX.cfg (as one would) and another file called fsxb.cfg. Looking inside both, the fsx.cfg was a modded version of my standard file and fsxb.cfg was a duplicate of my original so what it must do is copy the original.. make the changes called for in the GUI and make that the 'live' fsx.cfg. When you exit, it lobs your original back (fsxb.cfg.. renaming it to fsx.cfg in the process) and removes the modded 'live' file. I've kept copies of both for reference :)
In addition to other changes made in various sections (1024 to 2048 for example) I found these two entries at the bottom of the cfg:
[BufferPools]
RejectThreshold=126976
Poolsize=49000000
[JOBSCHEDULER]
AffinityMask=14
:)

I can, should I wish, use this 'saved' file as my 'live' cfg and FSX will run as if FSXB were also running (based on the system at that particular time) though I cannot make Windows Aero spring into life. I had a look online last night and while I found lots of references on how to turn it on or off in Win7 (and/or Vista) I found nothing to suggest it could be turned on for FSX as FSX turns it off! It's a great program isn't it.. FSX that is 8)
ATB
DaveB B)smk
ImageImage
Old sailors never die.. they just smell that way!

rohan
Trident
Trident
Posts: 362
Joined: 05 Apr 2008, 12:15

Re: Finding FSX.CFG and setting an affinity mask

Post by rohan »

Just one point, guys. Using task manager allows you to change the affinity of one or more processes already running under Windows but that is NOT the same as using an affinity mask setting. The two operations work on different parts of the system - task manager works with processes, and only processes. The internal mask setting tells FSX which processor cores it can use for it's internal threads. The biggest difference is that task manager only works on a process that is already running, whereas the mask tells FSX where to put its threads when it starts up. I can explain more if you want, but it gets rather technical rather quickly ...

Shame they're both called affinity settings ... it would be understandable if there was more similarity in their function.

User avatar
DaveB
The Ministry
Posts: 30457
Joined: 17 Jun 2004, 20:46
Location: Pelsall, West Mids, UK
Contact:

Re: Finding FSX.CFG and setting an affinity mask

Post by DaveB »

You're not wrong there Ro :doh: :lol: Just as the water starts to clear.. someone jumps in the puddle again :lol:

ATB
DaveB B)smk
ImageImage
Old sailors never die.. they just smell that way!

rohan
Trident
Trident
Posts: 362
Joined: 05 Apr 2008, 12:15

Re: Finding FSX.CFG and setting an affinity mask

Post by rohan »

Paul K wrote:... It warns of potential instability...
Paul,
this warning also applies to unsuitable values of the affinity mask within FSX. As I've tried to explain before, there is no point at all in having a mask value with more than three cores selected. Doing so will force FSX to run code fragments in parallel that were never designed for that situation, which in layman's terms means that sooner or later you're going to run into code blocking - a wonderful term for one piece of code waiting for some resource to become available, while another piece of code finds itself having to wait for another resource to become available, but what if the resource for the first piece of code is in use by the second piece of code, or vice versa, or even both at the same time ???? Result, at best instability, at worst CTD.

But what do I know ...

User avatar
TSR2
The Ministry
Posts: 16347
Joined: 17 Jun 2004, 14:32
Location: North Tyneside, UK
Contact:

Re: Finding FSX.CFG and setting an affinity mask

Post by TSR2 »

that's right Ro,

As Dave will tell you, I had years of problems running the VA client for any length of time. FSX would start to freeze. You could leave it for a period of time anywhere from 5 minutes to as much as an hour and it would come back, and the freezing would get more frequent until it would eventually give up. I never really got to the bottom of it for several years, until after the last rebuild I had done a VA flight before any tweaking and it worked, so I left it (on the premise if its not broken etc). So the only thing I've done to my cfg file is modify some paths for AI etc. The funny thing is the sim would work fine for a random run about, but only seemed to suffer when using the VA client (either FSUIPC or Simconnect) but what you are saying would make sense.

P3D v2 though is a different kettle of fish :lol:
Ben.:tunes:

ImageImageImage

rohan
Trident
Trident
Posts: 362
Joined: 05 Apr 2008, 12:15

Re: Finding FSX.CFG and setting an affinity mask

Post by rohan »

... and I will refrain from commenting on thread handling and affinity mask settings in P3D since I have no knowledge of what LM have done to those areas at this time ...

Suffice to say that when FSXsp2 / FAXacc were made multi-threaded (that is, capable of using more than one processor), there is in effect some operating system code within FSX to achieve that - and by extension in P3D too.

The problem you describe with the VA client was precisely because you were running an FSX add-on app at the same time. Whenever you do that, you MUST use an appropriate value for the mask setting AND use some tool to set the affinity for the add-on app. Unless you coordinate these two affinity values properly, you can guarantee that you'll run into code blocking ...

User avatar
DaveB
The Ministry
Posts: 30457
Joined: 17 Jun 2004, 20:46
Location: Pelsall, West Mids, UK
Contact:

Re: Finding FSX.CFG and setting an affinity mask

Post by DaveB »

..you MUST use an appropriate value for the mask setting AND use some tool to set the affinity for the add-on app
That's me gone again :worried: How would you go about setting the affinity for the addon app.. in this case, the FSA Client *-)

ATB
DaveB B)smk
ImageImage
Old sailors never die.. they just smell that way!

rohan
Trident
Trident
Posts: 362
Joined: 05 Apr 2008, 12:15

Re: Finding FSX.CFG and setting an affinity mask

Post by rohan »

Use task manager as Paul described above ... or there are / were some small freeware applets that do the same thing. I can't remember the name of the one that I tested, but can look it up if you're interested. There's even a payware version.

Have to say though that it was back in 2010 when I last looked at it, but even if the website has since disappeared, I can always send you a copy. IIRC, the main difference is that using task manager is a manual process every time, while the applets usually automate the job ...

Post Reply