Jump to content
Sign in to follow this  
John_Cillis

AffinityMask Tweak

Recommended Posts

Hi Folks!Where do I set this Affinity Mask????I am a newbie at these things and don't know where to set this up.Thanks!Dennis


Sincerely,

Dennis D. Müllert

System Specs: Motherboard:  Gygabyte Aorus Z390 Master.  CPU: Intel 9th Gen Core i9 9900kf Eight-Core 3.6Mhz overclocked to 5Mhz.  Memory:  64GB Corsair DDR4 SDRAM 3200MHZ RGB.  GPU: 11GB GeForce RTX 2080Ti FTW3 Hybrid.  Monitor: Viotek 34" curved GNV34DBE.  Power Supply: 1000 Watt Power supply. HD 1: 1TB Samsung 9780 EVO Plus NVMe SSD.  HD 2: 2TB Samsung 860 EVO SATA SSD

Flight Sim Hardware:  Joystick: Thrustmaster T16000M.  Rudder Pedals: Thrustmaster TPR Pendular Pedals.  Yoke: Honeycomb Alpha.  Throttles: Honeycomb Bravo.

Share this post


Link to post
Share on other sites
Hi Folks!Where do I set this Affinity Mask????I am a newbie at these things and don't know where to set this up.Thanks!Dennis
Add a section (I added mine at the beginning) to your fsx.cfg:[JOBSCHEDULER]AffinityMask=xxReplace "xx" with a value based on how many (and what) cores you wish to assign the AffinityMask to. My AffinityMask is set to 6, for example.Regards,John

Share this post


Link to post
Share on other sites
Makes since to me. I just tried AffinityMask=6 on my Q6600. Did not notice any FPS increase but it did seem smoother. I tried both extremes, PMDG747 in KLAX with lots of traffic and then the default 172 in the middle of nowhere and in both cases there was almost no stutters which was unusual becasue with my FPS set to unlimited, I would normally get stutters when I pan around outside in spot view in both those situations. Maybe it is the placebo effect, or FSX in one of it's good moods, but I like it so far. Would like to hear the results from more concrete testing on this. If it's true, this is a major tweak.
I like your comment about FSX and it's moods.... I still sometimes run into situations in dense scenery where the fps descend into the single digits, but where I can recover by saving and then reloading the newly saved flight. This seems to clear the "clog".My two favorite mask settings are 6 and 14 (0110 and 1110). Not sure whether there is one setting that is best for all situations.Similar to the old debate about unlimited vs capped frame-rates. Only difference is that you cannot change the Core assignments on the fly.For what it is worth, 14 gives me faster load times and 6 feels smoother. Maybe a different video card or even video driver could change this, I imagine..If I can ever get a more definitive test in place, I'll certainly post my findings.

Bert

Share this post


Link to post
Share on other sites
Hi Folks!Where do I set this Affinity Mask????I am a newbie at these things and don't know where to set this up.Thanks!Dennis
Thanks for asking the question,I was trying to figure this out also,and Thank you John for the clear answer./Patrick/

Share this post


Link to post
Share on other sites
Guest RichUK

Edit..Answered a question that had already been answered. Not using all my cores this morning..

Share this post


Link to post
Share on other sites
Guest rdg

Good Morning,I am using a quad core 9650 and decided to give 3 cores a try. I used a test flight for each of the AffinityMask settings. I had always used four and had the micro stutter issue and had tried every tweak known to man (and woman).When I used 3 cores the stutters went away. Nothing more nothing less. It is not my imagination or wishful thinking, my stutters are gone.RegardsBob

Share this post


Link to post
Share on other sites
Good Morning,I am using a quad core 9650 and decided to give 3 cores a try. I used a test flight for each of the AffinityMask settings. I had always used four and had the micro stutter issue and had tried every tweak known to man (and woman).When I used 3 cores the stutters went away. Nothing more nothing less. It is not my imagination or wishful thinking, my stutters are gone.RegardsBob
I am glad to hear that people are seeing positive benefits from my thread. As I said in the beginning, the AffinityMask setting has always been available, and in SP 2 has always defaulted to use all available cores. I started experimenting with it just on a hunch that freeing up Core 0, regardless of the system, would help the system manage I/O better. I suspect on some systems results would be more observable than others, but so far I am happy with my adjustments. But even happier that members took interest in the thread...Regards,John

Share this post


Link to post
Share on other sites
Guest Nick_N
Nick, I wonder if more cores really add to the performance, or possibly just add to the congestion.FSX is multi-core aware and will assign work, but does this always translate into better performance?Just like a freeway with additional lanes does not necessarily enable more traffic, if the lanes merge backinto just one lane further along..I can see all cores on my Q6600 getting used in the default configuration, but with the mask set to 6 (0110), only two cores get used by FSX and the sim runs smoother.Not really better fps, but more consistency and less "hesitation" when making turns and overall smoother feel.The fact that I get at least as good performance with two cores enabled as with four, tells me that the last two cores cannotbe doing much to help. The only benefit I can point to is a faster initial load. Maybe my system is congested somewhere else,but I've got FSX on a separate Raptor drive, running the CPU at 3.0GHz, defrag, and don't run any additional stuff. I know that some systems run better with more autogen rather than less, and I wonder if this is a similar case, where a differentload pattern is handled better.. although common wisdom might have expected a different outcome.
BertThe affinitymask hook which was introduced with SP1 has been shown to assist some with issues, be them texture loading or mainly stutters. I used it with SP1 along with 2 other FSX.cfg tweaks that with SP2 are no longer valid.. [sCENERY]SmallPartRejectRadius=X[TERRAIN]SWAP_WAIT_TIMEOUT=XI used SWAP_WAIT_TIMEOUT in conjunction with TEXTURE_BANDWIDTH_MULTIPIER and found a setting of 37 for SWTO best when a setting of 70 was used with TBM.Since SP2 I have seen no need for the jobscheduler in any system I have set up for FSX but that does not mean the setting is invalid. Your assessment of 'confusion' is actually not too far off the mark. Indeed a lot of work went onto what Phil described as thread collision problems which were addressed in SP1 and I do believe they expanded that into SP2 work as well. At the same time the 'confusing' mess FSX presents to the memory subsystem, which Phil has also pointed out, along with the massive amount of PCIe bandwidth being influenced by autogen calls makes for a very strange and finicky application in reference to pulling the goods out of it, smooth and clear.The use of [JOBSCHEDULER]AffinityMask=n....can help. It can also make things worse, or, some may see no change at all. There are threads posted all over AVSIM and other websites that report positive, negative and neutral results. I did not overlook the setting or its use. I left it out of my tuning list simply because I have seen no need to run FSX on anything less that SP2 and have not seen any need for its use in my own and other systems I have helped get up to speed. It is not however invalid and could present a solution to some.By making changes to how cores are addressed one can help eliminate the collision issues which I am sure still remain and that would suggest stutters could be reduced or eliminated. However in removing access to a core that does mean the core is no longer available to the title for terrain and autogen calls. .. the question at that point is, is it needed for the installed hardware and the level of settings being applied. So the extra cores past the first and part of the second do add more CPU support to the title which is indeed used, however if that support is needed or not would be defined by the user, the rest of their installed hardware and what they are trying to push in scenery.Aces gave us the setting specifically because of threading issues and at this point it may or may not benefit i7 past the load times mentioned by Phil in the work Adam did with the DEM loader.===============================================During loading, we run the DEM loader on threads. You'll see good balanced usage across all cores, as well as about 1/3 faster load times on average.During flight we spawn threads for Autogen batch rebuilds as well as the terrain texture synthesis. The terrain texture work tends to be a bit bursty; as an area gets generated the load reduces true. But as you fly forward, as you bank, and as the terrain is lighted ( once a minute ) threads are spawned. The terrain grid system is radial around the current viewpoint, and, depending on level of detail, radius can be up to 4.5 tiles in either direction, something like 64 tiles. So there is plenty of work to go around. Autogen is more constant, with a 2km extent being batched.Even given the bursty nature of the core usage when flying, when there is load, its pretty balanced across the cores. And we got rid of as much of the stutters as we could by going to a lock-free synchronization style. It

Share this post


Link to post
Share on other sites
I am going to add the affinity mask use to the tuning list as soon as I get defined information about its use and i7 so I cover all procs (C2/Q/i7) at the same time. Its one of those settings, at least we know for sure with Intel C2/Q, which can be looked at after all else has failed to produce a smooth result.
Hi Nick,Thanks for your very detailed and, as usual knowlegable reply.Since this is indeed a dynamic application and different levels of scenery put different loads on the system, this could keep somefolks pretty busy for some time. Maybe FSXI, if it ever happens, has some further optimization in it - or.... maybe someonewill have access to the source code and can at some point provide an SP3 release...Just to muddy the waters even further, there is a second way of limiting the cores: setting affinity for the fsx.exe process in the task manager.It has the benefit of being adjustable during flight, and has a slightly different effect on core usage.I'm attaching two task manager snapshots, one with affinitymask=14 and one with core affinity with Core0 unchecked.It is yet more thing that folks can try... it seems to distribute the load differently... I cannot honestly say that I can describe any difference in flight...

Bert

Share this post


Link to post
Share on other sites
I am glad to hear that people are seeing positive benefits from my thread. As I said in the beginning, the AffinityMask setting has always been available, and in SP 2 has always defaulted to use all available cores. I started experimenting with it just on a hunch that freeing up Core 0, regardless of the system, would help the system manage I/O better. I suspect on some systems results would be more observable than others, but so far I am happy with my adjustments. But even happier that members took interest in the thread...Regards,John
Jonh, i almost forgot to thank you for the heads up in the use of affinity mask with SP2. Very useful thread indeed.Cheers.

Alvega

CPU: AMD 7800X3D | COOLER: Cooler Master MasterLiquid 240L Core ARGB | GPU: RTX 4070 TI Super 16GB OC | Mobo: ASUS TUF GAMING X670E-PLUS WIFI |
RAM: 32 GB Corsair Vengeance RGB DDR5 6000MHz PC5-48000 2x16GB CL36 | SSDs: WD Black SN770 2TB NVMe SSD (WIN11), WD Black SN850X SSD 2 TB M.2 2280 PCIe Gen4 NVMe (MSFS), Crucial MX500 2TB (Other stuff) | CASE: Forgeon Arcanite ARGB Mesh Tower ATX White | Power Supply: Forgeon Bolt PSU 850W 80+ Gold Full Modular White 

Share this post


Link to post
Share on other sites

John,I really think you have something here,I set AffinityMask=14 for my Q9650 3GHZ Vista 64 and the difference was incredible,then I decided to try 12 and I'm stunned at the smoothness of everything,no hiccups or stutters,I'm using my TRK IR4 and streaming some Live ATC also and the sim is just flowing like a river,it's great!!!Thank You John/Patrick/PS Would this work in other sims such as Black Shark?

Share this post


Link to post
Share on other sites
John,I really think you have something here,I set AffinityMask=14 for my Q9650 3GHZ Vista 64 and the difference was incredible,then I decided to try 12 and I'm stunned at the smoothness of everything,no hiccups or stutters,I'm using my TRK IR4 and streaming some Live ATC also and the sim is just flowing like a river,it's great!!!Thank You John/Patrick/PS Would this work in other sims such as Black Shark?
Go ahead and try, and report back. :(

Alvega

CPU: AMD 7800X3D | COOLER: Cooler Master MasterLiquid 240L Core ARGB | GPU: RTX 4070 TI Super 16GB OC | Mobo: ASUS TUF GAMING X670E-PLUS WIFI |
RAM: 32 GB Corsair Vengeance RGB DDR5 6000MHz PC5-48000 2x16GB CL36 | SSDs: WD Black SN770 2TB NVMe SSD (WIN11), WD Black SN850X SSD 2 TB M.2 2280 PCIe Gen4 NVMe (MSFS), Crucial MX500 2TB (Other stuff) | CASE: Forgeon Arcanite ARGB Mesh Tower ATX White | Power Supply: Forgeon Bolt PSU 850W 80+ Gold Full Modular White 

Share this post


Link to post
Share on other sites

I would but.............FSX is running and looking so good now.........I can't stop flying it!!!! :(

Share this post


Link to post
Share on other sites

So to be perfectly clear (lots of numbers up there)... AffinityMask=12 will set a Quadcore Q6600 (for instance) to run on only two cores, AffinityMask=14 will set it for three cores, and AffinityMask=15 will tell it to use all four? Mine is set to four at the moment, but I might have to mess around with this a bit.

Share this post


Link to post
Share on other sites
So to be perfectly clear (lots of numbers up there)... AffinityMask=12 will set a Quadcore Q6600 (for instance) to run on only two cores, AffinityMask=14 will set it for three cores, and AffinityMask=15 will tell it to use all four? Mine is set to four at the moment, but I might have to mess around with this a bit.
Yes, think of it this way:0000 = 00001 = 10010 = 20011 = 30100 = 4 etc1100 = 121110 = 141111 = 15 Core 0 , the core that the OS uses, is furthest to the right.

Bert

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...