Jump to content
Sign in to follow this  
MammyJammy

New P3D 5.3+ Affinity Mask Calculator

Recommended Posts

10 hours ago, MammyJammy said:

my Prepar3D.cfg


[JobScheduler]
AffinityMask=65535
P3DCoreAffinityMask=16382
MainThreadScheduler=3
RenderThreadScheduler=1
FrameWorkerThreadScheduler=5

My FSUIPC6.ini


[Programs]
RunIf1=AM=49153,CLOSE,"E:\ActiveSkyP3D\ASP3D.exe" "-simVersion=5"
RunIf2=AM=49153,CLOSE,"E:\PFPX_20\PFPX.exe"
RunIf3=AM=49153,CLOSE,"E:\Navigraph\Charts\Navigraph Charts.exe"

Feature is live @ http://izn-flightsim.s3-website-us-east-1.amazonaws.com/affinity.html

And if you don't have a registered copy of FSUIPC, seriously, go buy one.  It's a fantastic tool.

This is what I use local here as an example for fellow simmers with FSLabs Airbus with UMP policy affinity 252

My Prepar3D.cfg:

[JobScheduler]
AffinityMask=254
P3DCoreAffinityMask=126
MainThreadScheduler=0
RenderThreadScheduler=2
FrameWorkerThreadScheduler=4

My FSUIPC6 ini file:

[Programs]
RunIf1=AM=1,CLOSE,MIN,"C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"
RunIf2=AM=192,CLOSE,MIN,"H:\HiFi\ASP3D\ASP3D.exe" "-simVersion=5"
RunIf3=AM=128,CLOSE,MIN,READY,DELAY[=30],"H:\PRO-ATC-X\proatcx.exe"
RunIf4=AM=192,CLOSE,MIN,READY,DELAY[=60],"D:\AIG_TrafficController_0.3.3.11\AIGTech - Traffic Controller.exe" "-P3DV5"

 


 

André
 

Share this post


Link to post

I've had some success using the new settings, created with this calculator. Consistent 29.9 FPS (limited to 30fps) in the PMDG 777 cockpit at cruise.

I have noticed decreased FPS on approach, especially around FSDT LAX w/ Orbx TE SoCal, so I still have some tuning & testing to do.

Used the Asus AI predictions of my best cores on my i9-12900k to set the cores for P3D. Left my "worst" core & HT threads unassigned for the OS to use.

Assigned supplementary programs to the efficiency cores.

spacer.png

Calculator settings: https://i.imgur.com/SXOQ3XI.png

Edited by Daniel M

Daniel M

i9-12900K, 32GB DDR5 RAM, PNY RTX 3090, Custom Watercooling

Share this post


Link to post

Hey everyone,

Based on some of the posts in the P3D 5.3 HF2 thread, I've added a few new features to the affinity calculator.  This tool takes out the guesswork or manual calculation of the affinity masks and lets you work visually, all based on the cores/threads for your CPU.

Tool available @ https://izn-flightsim.s3.amazonaws.com/affinity.html

 

New features:

Copy/Save links to your configuration
If you use the tool to generate a configuration, you can copy/paste a link to the tool that will reference that specific configuration (your cores/logical processors, masks, etc.)  This will be helpful to share configurations in forums like this.  At the bottom of the CPU table you'll see a new entry with the link in it.  Just select it, copy, and paste where ever.
spacer.png

 

Load from a previous configuration
If you have a previous [JobScheduler] entry (or one has been posted here), you can now load from a previous configuration.  This is helpful if you've put together a complex set of affinity masks - You can copy from your prepar3d.cfg file into the tool and it will generate a visual of your current configuration.  You can adapt from there.  Likewise, for some of the posts out here that have [JobScheduler] entries, you can paste into the tool to see what they look like.
spacer.png

 

Proper labeling of Intel 12th gen performance and efficiency cores
This has been in the tool for a few weeks, but I'll stress it again given some of the posts in the HF2 thread - This tool will properly label the p-cores and e-cores for 12600K, 12700K, and 12900K processors.  This takes a lot of guesswork out of figuring out which cores are which or doing the reverse binary to decimal math yourself.  Just point-and-click or use a preset.  @micstatic @psolk tagging you as you had inquired about this in the other thread.

Showing the link sharing feature, here's the current config I am running on a 12900K:

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=16&threads=24&affinity=16777215&coreAffinity=16766940&mainThread=2&renderThread=7&frameThread=8#presetAnchor

 

  • Like 3
  • Upvote 2

Share this post


Link to post

thanks @MammyJammy  With the 12700k the mention previously by Steve was to try the below.  I'm still a little unclear on this tool.  Does below still seem like a logical edit? 

 

[JobScheduler]
AffinityMask=1048533
P3DCoreAffinityMask=1048533
MainThreadScheduler=0
RenderThreadScheduler=1
FrameWorkerThreadScheduler=2


5800X3D, Gigabyte X570S MB, 4090FE, 32GB DDR4 3600 CL14, EVO 970 M.2's, Alienware 3821DW  and 2  22" monitors,  Corsair RM1000x PSU,  360MM MSI MEG, MFG Crosswind, T16000M Stick, Boeing TCA Yoke/Throttle, Skalarki MCDU and FCU, Saitek Radio Panel/Switch Panel, Spad.Next

Share this post


Link to post
2 hours ago, micstatic said:

I'm still a little unclear on this tool.

IF there's something in particular that isn't clear, lemme know.  Happy to make adjustments where appropriate.  The basics are that the blue cores are the first AffinityMask, the green ones the P3DCoreAffinityMask (which with 5.3+ in many ways becomes the important one) and lastly there's various colors to represent the ThreadScheduler cores.  All you do is click the radio button next to what you want to set, then click on a cell in the table that represents your CPU.  Copy/paste the [JobScheduler] it spits out at the bottom into your prepar3d.cfg.

 

2 hours ago, micstatic said:

[JobScheduler]
AffinityMask=1048533
P3DCoreAffinityMask=1048533
MainThreadScheduler=0
RenderThreadScheduler=1
FrameWorkerThreadScheduler=2

It certainly looks like a reasonable config.  I would only make a few suggestions:

  1. Give the regular AffinityMask as many cores as you can.  Since the primary P3D processes won't run on them, they will likely have a bunch of headroom.  These will be used by any DLLs or EXEs that need to run in the P3D process space.  Based on a !@#$load of testing over the past few weeks, I can't really find a benefit in completely depriving the AffinityMask a core.
  2. The 12-series Intel processors are beasts (I'm convinced the transistors were fabricated from the fibers of Zeus' beard) but they are also space heaters.  I'd spread out the ThreadSchedulers a bit to prevent a hotspot from adjacent cores that will impact the boost clocks of your cores.  The MainThreadScheduler will be the most taxing, running at or near 100% almost continuously.  If you really wanna nerd out, use a tool like HWMonitor64 to find your coolest, highest-boosting core and place the MainThreadScheduler on it, masking out the HT portion of that core away from the P3DCoreAffinityMask.

Give this a try:

[JobScheduler]
AffinityMask=1048575
P3DCoreAffinityMask=1015284
MainThreadScheduler=0
RenderThreadScheduler=5
FrameWorkerThreadScheduler=10

If you want to see what it looks like in the tool, click the link below:

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=12&threads=20&affinity=1048575&coreAffinity=1015284&mainThread=0&renderThread=5&frameThread=10#presetAnchor

 

Share this post


Link to post

@MammyJammy, thanks so much.  Will try.  Luckily the 12700k is cooler than the 12900k.  My cooler seems to easily keep it in check.  

Edited by Ray Proudfoot
Long quoted post removed.

5800X3D, Gigabyte X570S MB, 4090FE, 32GB DDR4 3600 CL14, EVO 970 M.2's, Alienware 3821DW  and 2  22" monitors,  Corsair RM1000x PSU,  360MM MSI MEG, MFG Crosswind, T16000M Stick, Boeing TCA Yoke/Throttle, Skalarki MCDU and FCU, Saitek Radio Panel/Switch Panel, Spad.Next

Share this post


Link to post
On 1/7/2022 at 4:43 AM, CaptKornDog said:

Anyone have a positive experience with settings for a 5900X (SMT enabled)?  This is what I'm currently trying but it just absolutely becomes a stutter fest in heavy city areas, and not much difference in behavior as I move cores around despire getting FPS typically 35+.

 


[JobScheduler]
AffinityMask=16777215
P3DCoreAffinityMask=1048572
MainThreadScheduler=0
RenderThreadScheduler=2
FrameWorkerThreadScheduler=4

 

I have the same CPU, please try the following:

AffinityMask=16777215
P3DCoreAffinityMask=8388604
MainThreadScheduler=2
RenderThreadScheduler=18
FrameWorkerThreadScheduler=0

Install the Ryzen Master and find the first preferred core of the CCD0 (marked with a star) and use it for the MainThreadScheduler.

Find the first preferred core of the CCD1  and use it for the RenderThreadScheduler.

Then find the second preferred core (marked with a dot) of the CCD0 and CCD1 and use either one for the FrameWorkerThreadScheduler.

P3DCoreAffinityMask uses all except Core 0, HT0 and HT11 where I park Active Sky and Chaseplane with FSUIPC:

[Programs]
RunIf1=AM=8388608,c:\program files\parallel 42\chaseplane\chaseplane.exe
RunIf2=AM=8388608,"C:\Program Files\HiFi\ASP3D\ASP3D.exe" -simVersion=5

 

Share this post


Link to post
On 1/6/2022 at 6:43 PM, CaptKornDog said:

This is what I'm currently trying but it just absolutely becomes a stutter fest in heavy city areas, and not much difference in behavior as I move cores around despite getting FPS typically 35+.

With a quiet hour during my workday I was able to upload another thing I've been working on for a little while:  A helpful tuning guide for squeaking out some extra system performance for Prepar3D.  At the very bottom of the Affinity Calculator is a help section, and the last item in the list has some non-affinity optimizations you may find helpful.  It includes things like power settings, Nvidia control panel settings, disk options, etc.  A lot of this is stuff I've gathered over the years here at the Avsim forums and other places and does not involve any Prepar3D.cfg tweaks beyond the affinity masking that is the main topic of this thread.

Your mileage may vary, but all of this has been helpful on the last three systems I've built for P3D.

https://izn-flightsim.s3.amazonaws.com/affinity.html

spacer.png

  • Like 3

Share this post


Link to post
3 hours ago, aekaragi said:

I have the same CPU, please try the following:

AffinityMask=16777215
P3DCoreAffinityMask=8388604
MainThreadScheduler=2
RenderThreadScheduler=18
FrameWorkerThreadScheduler=0

With hyperthreading on, I would recommend that you mask off the HT portion of each core that runs the thread schedulers (particularly the MainThreadScheduler).  More like this:

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=12&threads=24&affinity=16777215&coreAffinity=6291412&mainThread=1&renderThread=16&frameThread=0#presetAnchor

[JobScheduler]
AffinityMask=16777215
P3DCoreAffinityMask=6291412
MainThreadScheduler=1
RenderThreadScheduler=16
FrameWorkerThreadScheduler=0

And if you run FSUIPC with the [Programs] section...

[Programs]
RunIfX=AM=10485803,CLOSE,"<PATH TO ADD ON .EXE AND OPTIONAL ARGUMENTS>"

 

Edited by MammyJammy
URL

Share this post


Link to post

The affinity calculator is a great tool - thanks so much @MammyJammy!

I have read through this whole thread and I am still a bit confused (not with how to use it) but with which core to place things on and/or which to mask. Is there a right or wrong way to set up the masks?

I have an i7-7700k (4 cores with HT enabled) and the tool gave me this:

[JobScheduler]
AffinityMask=252
P3DCoreAffinityMask=252
MainThreadScheduler=0
RenderThreadScheduler=2
FrameWorkerThreadScheduler=4

So Core 0 is free for the OS, I'm using Process Lasso to place utilities like AS, ASCA, RC, Littlenavmap, FS Flight Keeper onto core 1 (HT0). Anything like ut_live, couatl (fired off by dll.xml or exe.xml) is also on core 1 using PL. I use P3D with complex add-ons/aircraft, frame rates limited in NV.

It seems OK to me but I would like someone to validate if possible.

 

Share this post


Link to post

I'm also interested in knowing if what I have done is good:

6700K HT-ON

[JobScheduler]
AffinityMask=255
P3DCoreAffinityMask=252
MainThreadScheduler=0
RenderThreadScheduler=1
FrameWorkerThreadScheduler=2

 

So Core 0  Core 0 HT left alone.

Should I put my add-ons onto one of those using Process Lasso?  Or FSUIPC?

Or should I use some left over P3D cores?

Edited by VHOJT

Share this post


Link to post
12 hours ago, VHOJT said:

I'm also interested in knowing if what I have done is good:

6700K HT-ON

[JobScheduler]
AffinityMask=255
P3DCoreAffinityMask=252
MainThreadScheduler=0
RenderThreadScheduler=1
FrameWorkerThreadScheduler=2

 

So Core 0  Core 0 HT left alone.

Should I put my add-ons onto one of those using Process Lasso?  Or FSUIPC?

Or should I use some left over P3D cores?

You always use left over cores for other (non-marginal) processes.

Share this post


Link to post
5 hours ago, Fiorentoni said:

You always use left over cores for other (non-marginal) processes.

Sorry to be obtuse, do you mean:

Use LP (logical processor) 1 for leftover process (leaving LP 0 for Windows), or use LP 5,6,7 for leftover processes (these aren't specifically allocated to any P3D task)?

6700K has four cores, 8 LPs with HT on.

Edited by VHOJT

Share this post


Link to post
20 hours ago, VHOJT said:

I'm also interested in knowing if what I have done is good:

6700K HT-ON

 

On 1/30/2022 at 7:28 PM, jjf said:

I have read through this whole thread and I am still a bit confused (not with how to use it) but with which core to place things on and/or which to mask. Is there a right or wrong way to set up the masks?

 

My advice for both of you would be the same, given you have 4 core processors with hyperthreading on:

1)  Give P3D as many cores as you can.  The newer 64-bit versions are much better at leveraging high core counts, so give P3D as much as you can.  If you mask off 1 core and 1 HT logical processor, you are giving up 25% of your compute power.  You can move the ThreadSchedulers around to give some breathing room from the OS and other stuff far more effectively w/ P3D 5.3.

2)  Only put the ThreadSchedulers on physical cores.  You want these to have as much horsepower as possible and that's not in the hyper thread of a given core.  The worst case would be running two thread schedulers on the same core/HT core.  Yikes, don't do that...You'll run out of compute on that core.

For both, I'd recommend something more like this, leveraging all cores but being specific about where the ThreadSchedulers go:

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=4&threads=8&affinity=255&coreAffinity=255&mainThread=2&renderThread=4&frameThread=6#presetAnchor

If you really want to keep a core open for your OS, go for it, but I'd give it only a single core if you can.  As per some other recommendations in this thread, I'd still leave the full AffinityMask on all cores.  Something like one of these options:

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=4&threads=8&affinity=255&coreAffinity=252&mainThread=0&renderThread=2&frameThread=4#presetAnchor

OR

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=4&threads=8&affinity=255&coreAffinity=254&mainThread=1&renderThread=3&frameThread=5#presetAnchor

Of course you will have to test what works best on your respective systems and the type of flying you do.  The free core may work better based on your add-ons, so experiment.

Hope it helps.

Share this post


Link to post
2 hours ago, MammyJammy said:

 

 

My advice for both of you would be the same, given you have 4 core processors with hyperthreading on:

1)  Give P3D as many cores as you can.  The newer 64-bit versions are much better at leveraging high core counts, so give P3D as much as you can.  If you mask off 1 core and 1 HT logical processor, you are giving up 25% of your compute power.  You can move the ThreadSchedulers around to give some breathing room from the OS and other stuff far more effectively w/ P3D 5.3.

2)  Only put the ThreadSchedulers on physical cores.  You want these to have as much horsepower as possible and that's not in the hyper thread of a given core.  The worst case would be running two thread schedulers on the same core/HT core.  Yikes, don't do that...You'll run out of compute on that core.

For both, I'd recommend something more like this, leveraging all cores but being specific about where the ThreadSchedulers go:

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=4&threads=8&affinity=255&coreAffinity=255&mainThread=2&renderThread=4&frameThread=6#presetAnchor

If you really want to keep a core open for your OS, go for it, but I'd give it only a single core if you can.  As per some other recommendations in this thread, I'd still leave the full AffinityMask on all cores.  Something like one of these options:

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=4&threads=8&affinity=255&coreAffinity=252&mainThread=0&renderThread=2&frameThread=4#presetAnchor

OR

https://izn-flightsim.s3.amazonaws.com/affinity.html?cores=4&threads=8&affinity=255&coreAffinity=254&mainThread=1&renderThread=3&frameThread=5#presetAnchor

Of course you will have to test what works best on your respective systems and the type of flying you do.  The free core may work better based on your add-ons, so experiment.

Hope it helps.

Thank-you very much for your suggestions.  I have tried each suggestion you gave.

My hardest-hitting scenario so far is takeing off KLAX facing the city:

The affinity setings that work best for that, keeping frames smoothest at 30 is the one I posted, which goes against your very logical advice about using an actualy phyiscal core.  I cannot understand why.  Even allowing P3D access to Core 0 and HT0 and running stuff from Core 1 onwards results in more stutters/lower FPS.  Allowing access even to Core0 HT and blocking off Core0 causes stutters.

I cannot for the life of me figure out why, but that's what appears to work best at this stage.  Also - your autogen draw distance advice on your website was good.  I have it on high - but likely will turn it down to medium in areas like London or LA.

Edited by VHOJT

Share this post


Link to post

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