Affinity Mask Calculator  

Prepar3D (P3D V1, V2, V3 & V4) - Flight Simulator X - FSX Steam Edition

Contributor Ted Porter


Important Note! Prepar3D (P3D) 2.x, 3.x and 4.x Users

Please be aware that P3D V2.x, V3.x and V4.x by default will use all Cores, and most importantly all Threads on those CPUs that have Hyper Threading enabled. On machines with four or more cores, P3D will dedicate logical core #0 for rendering tasks which is visually shown in the screen shot at the bottom of this page. To this end, it is suggested that the Expert Mode calculator be used to tune your P3D V2.x, V3.x or V4.x Affinity Mask rather that the Easy Mode calculator.

Additional Note for Prepar3D (P3D) V4.x Users ~ Windows 10 64-bit Version 10.0.15063

I ran some tests with P3D v4 using and not using an Affinity Mask.

Not using an Affinity Mask, Logical Core #0 is 100% utilised by the rendering tasks. This can be seen in the screen shot immediately below this paragraph. However, unlike P3D v3, the load balancing of the other logical cores and threads is far better implemented. You can make a comparison between this screen shot and the P3D v3 screen shot at the bottom of the page to see the difference.

P3D v1 - v2 - v3 - v4 Affinity Mask Calculator

Whereas, using an Affinity Mask of 4094 for my hexacore CPU to move the rendering tasks to thread #0, made all of the logical cores and threads from #1 to #5 constantly hit 100% utilisation and caused the scenery to become blurred. Adjusting the Affinity Mask to 4092, which forces P3D v4 to use logical core #1 rather than thread #0 for the rendering tasks, reduced the constant 100% CPU utilisation. Having said that, you can see from the following screen shot that using an Affinity Mask of 4092 still causes the other logical cores and threads to be more active than without an Affinity Mask. However, the scenery was not blurred and on my system and it reduced the number of micro stutters that had been apparent.

It should be noted, that P3D v4 is designed differently from its predecessors, and what works for one system may have a positive or negative effect on another system. The findings presented here are meant as an aid and not a definitive solution.

P3D v1 - v2 - v3 - v4 Affinity Mask Calculator

Affinity Mask Calculator - [Easy Mode] - Select CPU Core Type

    Calculate


fsx.cfg or prepar3d.cfg configuration file entry to add/change

[JOBSCHEDULER]
AffinityMask=n

Affinity Mask Calculator - [Expert Mode] - Select Physical Cores - (8 Cores Supported)

    Calculate


fsx.cfg or prepar3d.cfg configuration file entry to add/change

[JOBSCHEDULER]
AffinityMask=n

What Is An Affinity Mask?

An affinity mask is a bit mask indicating which CPU Core a process should be run on by the scheduler of an operating system. Setting the affinity mask for FSX/P3D declassifies its default use of CPU cores, which can lead to better application performance.

Windows 7 - FSX SP2 - The following example uses an affinity mask value of 1364 applied to a Hexacore CPU with Hyper-threading enabled utilising cores #1 to #5, whilst running FSX SP2. Note how core #0 is almost at idle, allowing it to take care of processing other system requests and processes.

FSX FSX-SE Affinity Mask Calculator

Windows 10 64-bit Version 1607 - P3D v3.1 - The following example uses an affinity mask value of 4095 applied to a Hexacore CPU with Hyper-threading enabled running P3D v3.1. Note how logical core #0 thread #0 is at 100% dedicated to P3D rendering tasks. The other logical cores and threads load balance the other P3D processing requests.

P3D v1 - v2 - v3 - v4 Affinity Mask Calculator

Always backup your data before making changes to configuration files. This software has no guarantees or warranties and is used at your own risk!