Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Affinity Mask Confusion - hoping for some further clarification

Featured Replies

Hi,

 

I don't know about the rest of you but, despite the best efforts of various stalwarts here and elsewhere, I am finding that I remain in a state of perpetual confusion where Affinity Mask values are concerned :( Okay, perhaps I am just being a tad thick, but the impression I am getting is that while the approach to determining the correct value is fairly consistent the outcome often is far from being the case.

 

I now have Prepar3D V3 installed and running very well on my, admittedly, fairly high spec rig which includes an i7 5960X (8 Physical Cores and not yet overclocked) and 2xASUS STRIX GTX980s running in SLI. I note that all 16 logical processors (LP) are being used and the first is displaying most activity. My understanding is that despite my observed good performance this may in fact be undesirable, which is where this Affinity Mask thing comes in....again! Does Prepar3D V3 in fact need the AffinityMask addition to Prepar3D.cfg? What to do, what to do?!

 

Having researched this topic ad nauseum I have unearthed a collection of recommended Affinity Mask values for the plucky innocent simmer with an 8 cored CPU:

 

i7 5960X (8 Cores)

Hyperthreading Enabled

 

Decimal (Affinity Mask Value) = Binary (5960X Core Allocation for Prepar3D - reading from the right (core 0/1 with 2 LPs) to the far left, the 7/8th core). N.B Core 1 is usually referred to as Core 0.

 

21504 = 0101010000000000

21824 = 0101010101000000 (Steve Waite of codelegend.com)

21844 = 0101010101010100 (Affinity Mask Calculator: http://www.gatwick-fsg.org.uk/affinitymask.aspx?SubMenuItem=hardware)

43008 = 1010100000000000

43648 = 1010101010000000

 

So, there is my dilemma!

 

Is it just a case of 'sucking it' and see what difference each chosen value makes or is there a more scientific approach to establishing the 'correct value'?

 

Thanks,

Mike

The theory seems to say that with hyperthreading enabled, Prepar3D (and FSX) should be set to make sure that any secondary threads off the main core one end up on their own physical core, and not a virtual one provided by hyperthreading.

 

This leads us to: 01  01  01 01 01 01 01 00 (21844)

 

This prevents the main thread of Prepar3D from using any of the first core (*so it can be used for system and other processes), and also puts the secondary threads of Prepar3D on their own physical core, keeping them from using the extra HT-provided virtual cores.

 

You could probably also do 01 01 01 01 01 01 01 01 (21845) and give P3D access to all the primary physical cores on your CPU, but with eight cores, you can probably spare one for other system activities and not feel any impact whatsoever.

 

It's a black art, man...

  • Author

Hi Greg,

 

I think I have just experienced an epiphany and I owe it all to you!!

 

Your explanation is both clear and concise and certainly begs the question as to why this topic has become entrenched in so much mystery. Perhaps the answer lies with those that have been trying to enlighten us. Maybe they have been assuming too much or else, as I have suggested, this pupil's monosynaptic brain with that one surviving neuron is just too thick to comprehend what may appear perfectly obvious to others.....LOL!

 

Anyway, you have provided what I needed to know and for that I am very grateful. In a hyper-threaded environment, giving Prepar3D preferential exclusive access to all physical cores, with the exception of the first which is reserved for System and other Programs/Processes running alongside, makes complete sense.

 

I can now understand why the relatively straightforward selection of Affinity Mask value for the 8-cored i7 5960X will likely be less easy to arrive at for processors with fewer cores. Presumably this explains why we see so much debate and variations in experience amongst our merry band of serious simmers. The i7 5960X gives the user a certain luxury of choice and, if my experience is anything to go by, then the selection of Affinity Mask value may not be so critical and differences in performance may be very slight, if noticeable at all. I see very good results with no Affinity Mask and all 16 LPs are seen to be active, the first most of all, but the application of the value 21844, which takes all 8 virtual cores out of the equation, has all but eliminated those barely perceptible micro-stutters noted when viewing scenery passing by each side of the aircraft. So even with the mighty i7 5960X the application of an Affinity Mask still appears to have some relevance.

 

Once again, many thanks for this moment of enlightenment!

 

Cheers!

Mike

  • Commercial Member

I'm not sure i agree at all with what's been posted, at least not at all for FSX.

 

I can't speak too much for P3D, but I can speak authoritatively about FSX. 

 

Beyond using an external Affinity Mask Setting (term I've coined until a better one comes up - and I'm not ready to discuss this because comparative testing is still being done), FSX is going to task Core 0 (logical 0 and 1 if hyper-threading is enabled) with certain scenery loading regardless of whether Core 0 is set in Affinity Mask. I'll come back to this post tomorrow (sorry, I'm on my way out of the house) and provide with more information on this.

 

As FSX is going to task Core 0 with scenery loaded, it's best just let it have it's way and assign Core 0 in Affinity Mask.  It will use that core even if it's not set in AF.  That would be 1XXX for non-hyper-threaded and 11XXXXXX for hyper threaded.

 

The only reason I would ever recommend anyone run FSX hyper-threaded dis if they had a 3000 series i7 or earlier or they're going to stream or record live video as they run FSX, or if they will run A LOT of external programs at the same time.  Short of that, it's best to turn Hyper-threading off.

 

The I7 4000 (4700K and above) processors seem to run FSX FAR, FAR better when you don't assign an Affinity Mask (this I believe is also written in Jim Young's AVSIM Setup Guide) as they are more capable of managing core usage on their own. This has been my personal experience as well, and I've tested that and compared AF settings while using other high processor bandwidth programs concurrently running with FSX.

 

The advice I'd offer is not to use it with the 4000 (Haswell) and 5000 series i7s.

 

There is a TERRIFIC Example of how Hyper threading works here in the forums as well I believe in Jim's AVSIM Setup Guide.

 

Hope this helps.  Remember, it's for FSX only, not P3D.

 

 

Dave

 

 

edit:  Very sorry, it is the FIBERS, not graphics (textures) per se which are unmovable from Core 0.

 

My theory regarding eliminating Core 0 out of the Affinity Mask and using the other 3 remaining cores is that it very similar to running without an Affinity Mask setting as FSX is still going to utilize Core 0, just that Core 0 won't be hammered by other FSX processing functions.  who knows, maybe this is indeed better for older 4 core processors!  But for Haswell and later, the jury seems to be out and most have better performance with the processor managing itself.

 

Sincerely hope this is helpfuil.

 

By the way, the thread I was referencing is located HERE.

 

Dave

Edited by DaveCT2003

Dave Hodges

 

System Specs:  I9-13900KF, NVIDIA 4070TI, Quest 3, Multiple Displays, Lots of TERRIFIC friends, 3 cats, and a wonderfully stubborn wife.

  • Author

Hi Dave,

 

Interesting info and, yes, I am aware that the advice given if you are running FSX is to turn hyper-threading off in the Bios. Whether or not this advice still holds for Prepar3D I'm not sure. It may be that LM have introduced code which now allows the sim to take advantage of multiple threads.

 

I can only cite my own experience with the Haswell i7 5960X which does seem to like an Affinity Mask (AM) setting of 21844. I checked again earlier this evening with and without the AM and confirmed my earlier findings. In addition, I noted that when I rolled the F-22 at 400+ knots, while flying the default Winter Wonderland Weather around Langley AFB and beyond, the execution of this manoeuvre was noticeably smoother with AM=21844. I realise I'm probably nit picking as these challenges to the sim are being made while using quite high in-sim settings. If I was flying, say, the Bonanza or the Black Hawk then I would probably not notice any changes in fluidity. Indeed, following the installation of V3 I flew for a couple of weeks and thoroughly enjoyed the wonderfully smooth motion. This really enhances the flight model thereby contributing significantly to the immersion. At that time the AM=0 so all LPs were in use. Frame updates are always perfect when the foot is off the gas!

 

Regards,

Mike

Superb thread topic and post-analysis Mike.

Stupidly expensive rig, nonplussed Memsahib, disinterested offspring and a fascinated cat as Rio.  XP11, P3Dv3 and an Oculus Rift.

If we disable the virtual cores, wouldn't that be the same as not using HT..?

5950x3d 5.4-5.7 GHz - Asus ROG 870 Crosshair Apex - GSkill Neo 2x 24 Gb 6000 mhz / cas 26 -  MSI RTX 5090 Gaming Trio OC - 1x SSD M2 6000 2TB - 1x SSD M2 2800/1800 1Tb -  Corsair 5400  case - Corsair 360 liquid cooling set  - 3x 75’ TCL tv.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 

FOV : 200 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Hi Guys,

 

any idea of what the best AF setting on P3Dv3 would be for an i7 6700 Overclocked Quadcore processor?

 

I am just in the process of reinstalling Win7 and migrating from FSX to P3D but I really have no idea on where to start with the AF as it's all different on FSX. Thanks!

Giorgio La Pira

I wonder if anyone has a clue... After reading all those topics about it I still don't know if I should use HT or not and if I should use AM or not. And what exactly it would do for P3D... I guess you simply have to give it a try and see for yourself. Problem is you have to know what to look at... and afaik the differences can't be measured and are all very subjective. The easiest solution for all this is to not use AM and let P3D do the job. :wink:

heheheh thanks Jeroen... I'm at the same situation at the moment. I'm completely new with P3D and I will have to start slowly.

Giorgio La Pira

 The easiest solution for all this is to not use AM and let P3D do the job. :wink:

 

Well, I let it do that unfortunately, and it decided to run P3D across all 4 physical and 4 logical cores which was a huge no-no.

Daniel Moser

 

92logo4.png

I'm not sure i agree at all with what's been posted, at least not at all for FSX.

 

I can't speak too much for P3D, but I can speak authoritatively about FSX. ...

 

 But for Haswell and later, the jury seems to be out and most have better performance with the processor managing itself.

 

Sincerely hope this is helpfuil.

 

By the way, the thread I was referencing is located HERE.

 

Dave

 

 

Core0 is on the right in the notation, not on the left...  you seem to be adding to the confusion here...

 

And for FSX, I would disagree with your premise... setting an Affinity Mask, excluding Core0, has definite benefits on a Haswell processor.

Bert

Core0 is on the right in the notation, not on the left... you seem to be adding to the confusion here...

 

And for FSX, I would disagree with your premise... setting an Affinity Mask, excluding Core0, has definite benefits on a Haswell processor.

To which I also agree!

 

My 4970k running at 4.7Ghz performs best in FSX and now P3D with AM=14 (Hyperthreading off). Other choose to run the same and similar processors with Hyperthreading on, in which case you would set AM=84.

 

The biggest benefit I see with using AM=14 is that unlike without any AM entry, (which equals AM=15) the CPU load is now focused mainly on Physical Cores 1-2-3, wherease without AM set, Core 0 would be under heavy load. In FSX this helped many users who were seeing issues running ASN etc, and resource intensive aircraft PMDG737/777 which would end up with FSX freezes/crashes due to the load on Core 0.

 

With P3D 3.0 now, I have only added FFTF Fiber_Frame_Time_Fraction=0.01 and AffinityMask=14.

 

The improved VAS management makes a world of difference allowing me to use the settings and scenery I have always wanted to use. most of my flying is out of Flytampa Dubai and lots of 12-15 hour sectors in the PMDG777). Hence where in FSX I previously had to disable Flytampas OMDB city scenery and load only the airport, in order to actually complete a ULR flight out of OMDB to another distant VAS heavy airport/scenery.

 

That problem is a thing of the past (as long as one doesnt forget the hard 4GB limit).

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.