Jump to content
Sign in to follow this  
John_Cillis

AffinityMask Tweak

Recommended Posts

A brief post to distract from the news regarding ACES...Since setting up my new system and installing FSX, I've been testing the various tweaks and found I worked thru most fairly quickly. Having a Quad core system, I assumed having FSX hitting all cores would be a good thing. Yet I'd still see a very slight hesitation in turns. Usually my experiences with hesitations on slower systems was related to I/O and I started thinking as to what good it is, if FSX is hitting all cores, when one or more cores is also tasked by the O/S for I/O. So I experimented with a couple of AffinityMask ( [JOBSCHEDULER] ) settings...AffinityMask=14, which sets up FSX for the last three cores and...AffinityMask=12, which sets up FSX for the last two cores.Testing each AffinityMask entry I also monitored my core temps and confirmed that FSX was hitting the cores I had intended.What I found, and it may indeed be unique to my experience, is AffinityMask=12 offered the best smoothness for me. Why two cores out of the four and not three is beyond me, unless I have another process that is using the first two cores. I didn't see an impact in frames vs. running on four cores vs. two, just a noticeable improvement in smoothness.There's certainly no real science with my experimentation other than casual observation, but I wanted to share something that can be tried for those on quad core systems.My specs--Q82008 GB RamGT 120 w/ 1GB RamVista 64

Share this post


Link to post
Share on other sites

Thanks for the info.I might as well contribute to this by adding that I was told a few weeks ago that AffinityMask=255 is for 8 cores, for i7 users.

Share this post


Link to post
Share on other sites
Thanks for the info.I might as well contribute to this by adding that I was told a few weeks ago that AffinityMask=255 is for 8 cores, for i7 users.
Yes, 255 corresponds to "11111111" in binary, each bit when set to 1 enables affinity for that specific core. In my two examples, 12 equates to "1100" and 14 equates to "1110". Normally "1111" (15) would be the setting for a quad core system, although I believe with SP2 and above FSX will use all available cores unless the AffinityMask is set for something different.Regards,John

Share this post


Link to post
Share on other sites

I don't use SP2 simply because of the alpha texture transparency issue with addons. So the AffinityMask thing is very important to me.

Share this post


Link to post
Share on other sites
What I found, and it may indeed be unique to my experience, is AffinityMask=12 offered the best smoothness for me. Why two cores out of the four and not three is beyond me, unless I have another process that is using the first two cores. I didn't see an impact in frames vs. running on four cores vs. two, just a noticeable improvement in smoothness.There's certainly no real science with my experimentation other than casual observation, but I wanted to share something that can be tried for those on quad core systems.
Well, I tried it, and to my surprise, I find my system is smoother also with only the last two cores being assigned to FSX.In other words, Affinitymask=12.I'll try flying like this for a while and see how it behaves.Maybe the overhead of scheduling work on four cores ends up fouling up something, and just two makes for smoothersailing.. Just a guess on my part :-)Q6600@3.0, WinXP Pro, 2 GB RAM.

Bert

Share this post


Link to post
Share on other sites
I might as well contribute to this by adding that I was told a few weeks ago that AffinityMask=255 is for 8 cores, for i7 users.
If I could clarify the math used with the Affinity Mask, for:1 core your mask would be 1 which is 00001 in binary2 core your mask would be 3 which is 00011 in binary3 core your mask would be 7 which is 00111 in binary4 core your mask would be 15 which is 01111 in binary8 core your mask would be 31 which is 11111 in binaryI've got a Core i7 and my mask is set to 31! I notice smoother performance without much improvements in frame rates, although frame rates drop significantly under high load situations. I've not tried entries other than powers of two (minus 1), but after reading John's post I think I'll do some experimentation.You'll find a lot of the fsx.cfg tweaks here. The affinity mask one is about half way down the page.Mike.

Mike Beckwith

Share this post


Link to post
Share on other sites
Guest Alphahawk3
A brief post to distract from the news regarding ACES...Since setting up my new system and installing FSX, I've been testing the various tweaks and found I worked thru most fairly quickly. Having a Quad core system, I assumed having FSX hitting all cores would be a good thing. Yet I'd still see a very slight hesitation in turns. Usually my experiences with hesitations on slower systems was related to I/O and I started thinking as to what good it is, if FSX is hitting all cores, when one or more cores is also tasked by the O/S for I/O. So I experimented with a couple of AffinityMask ( [JOBSCHEDULER] ) settings...AffinityMask=14, which sets up FSX for the last three cores and...AffinityMask=12, which sets up FSX for the last two cores.Testing each AffinityMask entry I also monitored my core temps and confirmed that FSX was hitting the cores I had intended.What I found, and it may indeed be unique to my experience, is AffinityMask=12 offered the best smoothness for me. Why two cores out of the four and not three is beyond me, unless I have another process that is using the first two cores. I didn't see an impact in frames vs. running on four cores vs. two, just a noticeable improvement in smoothness.There's certainly no real science with my experimentation other than casual observation, but I wanted to share something that can be tried for those on quad core systems.My specs--Q82008 GB RamGT 120 w/ 1GB RamVista 64
Very interesting. I tried it with the i7 920. The setting of 12 does force the last 2 cores into full usage on my PC. My task manager shows 50%. The last two cores stay at 100% most of the time.....I never see it drop below 47%. Sometimes the other two cores will kick in and take all cores to 100%. What is strange about this is that without the affinity mask setting my CPU usage can be as low as 24% at times. Using this....as I said I never see it drop below 47%....and yes it does seem to be much smoother...but this will require more testing on my part and is very subjective but still very interesting how it forces the last two cores into constant high usage....and yes I get the same results as you if I use the last 3 cores....the second core..core1...is used at full and the other 3 are picking up the slack but I am not getting much total CPU usage with that setting....very strange. While I agree with you this is certainly not science maybe someone can chime in here and answer as to why this setting forces the last two cores into what for me so far is full usage.

Share this post


Link to post
Share on other sites

This is great. I didn't try it before because Nick_N said SMT (multi-threading) didn't have any effect on FSX and should be disabled in the bios. I just tried all the options and found out that the best is affinitymask=255 (or 254 if you want to have a free core for TrackIR or something else).I noticed a nice improvement, even in the loading of the flight, and now all cores work inside FSX. 7 of them are just used for texture loading, though. Frame rate in flight is slightly better also.Here are some screens:Without SMT, 4 cores working and CPU usage never exceeds 50%ScreenHunter_08Jan241000.jpgWith SMT, during the loading of the flight, 8 cores used and the loading is fasterScreenHunter_02Jan240944.jpgWith SMT during flight, 8 cores used and CPU usage sometimes reaches 100%.ScreenHunter_04Jan240950.jpgI would say, turn on SMT in the bios and put the affinity mask tweak in fsx.cfg. Get all your cores to work.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
If I could clarify the math used with the Affinity Mask, for:
I should amend my earlier post with the following correction:1 core = 1 dec or 00000001 bin2 core = 3 dec or 00000011 bin3 core = 7 dec or 00000111 bin4 core = 15 dec or 00001111 bin5 core = 31 dec or 00011111 bin6 core = 63 dec or 00111111 bin7 core =127 dec or 01111111 bin8 core =255 dec or 11111111 binSorry guys, I wasn't thinking straight.

Mike Beckwith

Share this post


Link to post
Share on other sites
I should amend my earlier post with the following correction:1 core = 1 dec or 00000001 bin2 core = 3 dec or 00000011 bin3 core = 7 dec or 00000111 bin4 core = 15 dec or 00001111 bin5 core = 31 dec or 00011111 bin6 core = 63 dec or 00111111 bin7 core =127 dec or 01111111 bin8 core =255 dec or 11111111 binSorry guys, I wasn't thinking straight.Mike.
You can also specify the affinity mask for specific cores depending on which bit is setFor instance, for two cores on a 4 core system, the possible values are:Dec Value / Core # ____3 2 1 003__0 0 1 105__0 1 0 106__0 1 1 009__1 0 0 110__1 0 1 012__1 1 0 0 Back to my original observation, it seems shifting the affinity off of Core 0 and possibly Core 1 seemed to help smoothness although impact on fps seemed negligible. With each of these settings I can watch cpu usage and temps go up for the cores selected and usage/temps down for the ones that aren't.

Share this post


Link to post
Share on other sites
Guest simjunkie

I am very interested to hear about this. I'm trying the n=255 setting with HT enabled.Sure looks like it's using all those threads.-jk

Share this post


Link to post
Share on other sites
You can also specify the affinity mask for specific cores depending on which bit is setFor instance, for two cores on a 4 core system, the possible values are:Dec Value / Core # ____3 2 1 003__0 0 1 105__0 1 0 106__0 1 1 009__1 0 0 110__1 0 1 012__1 1 0 0 Back to my original observation, it seems shifting the affinity off of Core 0 and possibly Core 1 seemed to help smoothness although impact on fps seemed negligible. With each of these settings I can watch cpu usage and temps go up for the cores selected and usage/temps down for the ones that aren't.
I do not know the internal architecture of the Q6600, so I do not know if it cares what cores are loaded and how the cores might contend for internal resources, but after a bit of trial, I am now flying with the mask set at 6. For me, this gives the smoothest performance.

Bert

Share this post


Link to post
Share on other sites
Guest Alphahawk3
I do not know the internal architecture of the Q6600, so I do not know if it cares what cores are loaded and how the cores might contend for internal resources, but after a bit of trial, I am now flying with the mask set at 6. For me, this gives the smoothest performance.
Bert, I am going to try the 6 setting. I keep waiting for Nick to chime in here as this is his cup of tea. I also do not understand the architecture but set at 12 does give me smoother performance. Plus when I click on map from in the middle of flight it is opened instantly...not one bit of a delay. The load is faster also. This I can time and prove to myself without trusting my eyes. I never put this setting in as supposedly FSX was using all the cores....and it does but with the setting of 12 on my PC it is using two of the cores to their max....very interesting. Requires much more testing. Regards

Share this post


Link to post
Share on other sites

i have just tried this with my amd phenom 9850, chopped this back to two cores instead of the four i was running, and wow, it has slightly improved my frame rates, but the smoothness is outstanding i get no stutters what so ever, and the CS 757 which gave me around 20fps and slight stuttering during turns now gives me on average 25fps and no stutters what so ever, i will be monitoring this on my system and see if i get any decrease in performance.it seems counter productive to remove two cores from running FSX as you would think that you need all the processing power you can get, but it seesm to work in my brief tests, will keep you postedJason

Share this post


Link to post
Share on other sites

On my I7 it also seems to be smoother if i leave 1 core free (by setting the mask to 254 instead of 255). I wonder why...


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

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...