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.

A Frame-Time Analysis of P3D v3 -- Effects of CPU Affinity, Frame Lock, and HT

Featured Replies

 

 


A the end of the day HT enabled or disabled no AM works perfectly OK, it's just not optimum. Seems odd that around these HT and AM discussions do we see less interest in optimisations, probably simply because it's hard to understand and difficult to see the results. We can run P3D on two cores works fine, but we need worry more about where those addons go as I keep saying. It is the effects of these other exes that go to produce the big changes in performance, not the AM.

 

So is there a way to control those other one's assignment to cores?

  • Replies 596
  • Views 171.1k
  • Created
  • Last Reply
  • Commercial Member

 

Yes easiest way is to make a .bat file that starts one or more addon exe apps.

 

Lets say we use AM=85 on our four core HT enabled that's 8 LPs, 85 allocates one LP of each core to the sim, then we can start our addons above core zero:

 

start /B "" /affinity F8 "C:\Program Files (x86)\FSTraffic\FSTraffic.exe"

Here in the .bat file we use hexadecimal F8 hex = 11,11,10,00 avoids core zero and one LP of core 1, whereas our AM=85 is decimal 85 dec = 01,01,01,01. allocating one LP of each core. We could also use C0=11,00,00,00 gives less bandwidth to the addons. It's a balancing act after we avoided core zero. In this case we avoid core zero because 85 puts the first sim job there.

 

We can keep the .bat somewhere logical and drag/drop a shortcut to it on the desktop so we can start it whenever we like, and we can allocate that .bat in exe.xml so it starts just after the sim, and so on. Once the .bat is made and tested, it's no different than starting the .exe itself.

 

Programs like process lasso are not necessary and add a process where it's not required and these corral the exe onto LPs whereas we actually want to start the exe with affinity.

 

Steve Waite: Engineer at codelegend.com

Hi Steve,

 

Id like to reiterate the views of people on here and say thanks for sharing your knowledge on HT and P3D, its been invaluable.

 

Just as a little bit of clarity for myself what AF would you propose for the 5930k 6 core? Im running a couple of addons but not meny as i offload a few of them to a networked laptop. I have seen a few AF values in this thread but would like some clarification.

 

Your help is relly appreciated.

 

Regards

 

James

Intel 10900k @ 5.1 HT on, Nvidia 3090, 32GB RAM @3800mhz, 1TB NVME Drive (P3Dv5.1), 1440p 48' Ultrawide Monitor.

  • Commercial Member

Hi James,

 

You're welcome!  :smile:

 

With networked addons we can set and forget, although these do create OS processes across the CPU and also more processes within the affinity of the sim, such as SimConnect client handling.

 

Consider these setups, which give addons two threads at least:

 

A six core with HT enabled (3960x etc.), try P3D on AM=1365 or AM=85 and addons on Hex A00

 

01,01,01,01,01,01=1365 - loads scenario faster - or

00,00,01,01,01,01=85

10,10,00,00,00,00=2560 = A00 hex - addons

 

A four core with HT try AM=245 or AM=85 and addons on Hex A00

11,11,01,01=245 - loads scenario faster - or

01,01,01,01=85

10,10,00,00=160 = A0 hex - addons

 

which to choose 4 or 6 LPs depends on scenery.

Steve Waite: Engineer at codelegend.com

Conclusions from other threads in LM forums:

01 in physical core zero -> the main P3D task will be shared by Windows LP 0 and P3D LP1 on physical core zero, the ideal is having a physical core entirely assigned to P3D.

 

00 in core zero has been considered not ideal because core zero is very slightly faster than the others and it is better to leave it to P3D than to Windows. Also a remark from Beau.

  • Commercial Member

How's that any different to what's being discussed here? Don't understand your point.

 

You started out by saying AM=0 != NoAM or something like that, and about how P3D makes it's own AM up without one. Now you are saying that the LM devs are making AM recommendations.

 

01 in physical core zero -> the main P3D task will be shared by Windows LP 0 and P3D LP1 on physical core zero, the ideal is having a physical core entirely assigned to P3D.

 

00 in core zero has been considered not ideal because core zero is very slightly faster than the others and it is better to leave it to P3D than to Windows. Also a remark from Beau.

 

...Face it AM=85 puts 01 onto core zero allocating only one LP, or is that not what you mean by physical core 0?

 

On my system core zero (that's always a physical core by the way) is no faster or slower than any of the other five cores. However, I believe there exist some motherboards that can accommodate overclocking individual cores, but I've not looked into it.

 

 

Remember I am talking with the proper nomenclature that "physical core zero" is logical processor zero with HT disabled, and is logical processors zero and one with HT enabled.

Steve Waite: Engineer at codelegend.com

...Face it AM=85 puts 01 onto core zero allocating only one LP, or is that not what you mean by physical core 0?

 

In this HT configuration Windows will use Logical core 0 and P3D will use Logical core 1 both of physical core 0. I am just saying that it was concluded in the specific forum I am referring that not sharing the main P3D task with a Windows task gives better results. 11 instead of 01 or 10.

 

But the main conclusion in that forum is that there is not one best solution that gives the best results in every diferent system.

Steve,

 

Thanks for your reply and guidance. Is there anyway we can offload these other processes on to another core? Eg: conhost.exe? ( i believe this is a simconnect client process)

 

Im going for smoothness and terrain loading (sharpness) rather than outright FPS. Would you reccomend AM 1365 or AM 84? I understand that AF 84 would leave the first to cores for windows and addons.

 

Again thank you,

 

James

Intel 10900k @ 5.1 HT on, Nvidia 3090, 32GB RAM @3800mhz, 1TB NVME Drive (P3Dv5.1), 1440p 48' Ultrawide Monitor.

@Steve

 

Yes, I settled for 340 a couple months ago.

 

With v 3.3.5 would you advice another value ?

I also run 4 Prosim modules ( all exe ) , OpusFSI and SIOC ( Opencockpits hardware ) on the same cpu..

 

Thanks in advance..

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

 

Steve, am I understanding you correctly when I state the following 2 "rules of thumb" as summary of your comments:

 

1) For HT-enabled CPUs, leave HT on, but do not assign 2 LPs from the same physical core to FSX/P3D, (i.e. leave 1 LP per core free to handle other tasks).  

2) 4 LPs dedicated to FSX/P3D will produce the smoothest results (i.e. least variance in frame times), assuming > 4LPs exist.

Theory for a good Affinity Mask HT enabeled

Assumptions:

  1. Both logical cores in a physical core use the same resources on that physical core
  2. Winows will use the first free logical core it finds
  3. The first core assigned to P3 is the heaviest in terms of consumption of resources

With assumptions 1, 2 and 3, separating windows and P3D on different physical cores can bring benefits since when on two logical cores supported by the same physical core, they will share the resources of the physical core underneath even if they are on different logical cores.

For that reason configurations of  01 or 10 where 1 is a logical core assigned to P3D for the first two logical cores will not be optimal.

 

For a 4 core CPU with Hyper-threading, 

An optimal value should be populating both logical cores of  physical core 1 with only with P3D tasks. - 11

Both logical cores of Physical core 2 also with P3D tasks - 11

Both logical cores of Physical core 3 with windows tasks and  addons or extra programs - 00

The last core divided between windows and addons and P3D - 01

 

in an easier representation

Core 1 - 11

Core 2 - 11

Core 3 - 00

Core 4 - 01

 

So we have 11 11 00 01 - this is the binary representation of the affinity mask

Translated to DEC -> 241

 

For 6 cores 11 11 11 11 00 01 - 4081

 

Why the first and Main P3D task on logical cores belonging to the first physical core and not any other? Some people assume that they run slightly faster.

Why windows on logical cores of physical core 3 in a four core CPU? Just empirical results and it may vary from system to system.

 

Edit:

Reserving both logical cores running on the same physical core to windows, (core 3 in this case), seems to improve texture loading.

Separating windows and P3D can also eventually make the sim more stable.

  • Commercial Member

In this HT configuration Windows will use Logical core 0 and P3D will use Logical core 1 both of physical core 0. I am just saying that it was concluded in the specific forum I am referring that not sharing the main P3D task with a Windows task gives better results. 11 instead of 01 or 10.

 

But the main conclusion in that forum is that there is not one best solution that gives the best results in every diferent system.

You were referring to AM=85. AM=85=01,01,01,01 which means that the app will utilise logical processor 0 (LP0) and ignore LP1, the O/S will use LP0 and LP1.

 

Avoiding sharing tasks on cores for better performance, with or without HT enabled, is a truism and a fact of nature, it is not something they "concluded" in those forums or anywhere else.

 

 

in an easier representation

Core 1 - 11

Core 2 - 11

Core 3 - 00

Core 4 - 01

 

So we have 11 11 00 01 - this is the binary representation of the affinity mask

Translated to DEC -> 241

It would really help all if you used the correct nomenclature in this discussion, cores and LPs start at zero, and *zero is on the right* since 241=11,11,00,01 that means that the rightmost 01 is core zero and the rightmost 1 is LP zero. But it is clear you are aware of the problem of managing HT enabled systems.

 

 

It's worth remembering that FSX is different to FSX-SE when utilising many cores, and they are different to P3D v2 and then P3D v3 is a little different to v2 as well. It would take a bit of work to deduce these differences, and understanding the different ways Windows apps can utilise multi-threading is a pre-requisite. P3D is the easiest to understand.

 

 

Steve, am I understanding you correctly when I state the following 2 "rules of thumb" as summary of your comments:

 

1) For HT-enabled CPUs, leave HT on, but do not assign 2 LPs from the same physical core to FSX/P3D, (i.e. leave 1 LP per core free to handle other tasks).  

2) 4 LPs dedicated to FSX/P3D will produce the smoothest results (i.e. least variance in frame times), assuming > 4LPs exist.

1. Yes. And we avoid allocating both LPs of the first core encountered, but we can gang up the remaining jobs if we don't have enough cores.

 

2. As it says in the P3D documentation, the first job is at its leanest when the sim is split into four jobs. When less jobs are created the first LP will host more work of the sim that could otherwise be allocated on another LP. When more jobs are created then there is more work in the thread arbitration.

 

Since v3.2 P3D it is more efficient with job allocations beyond four LPs, excess jobs are not so bad for the threading arbitration now. This fact eases the necessity or requirement of an AM slightly, though a system with 6 or more cores, and any HT enabled system, will be better off with a suitable AM.

 

 

@Gerrard,

 

I think it's possible you might be able to improve on that but *only* by way of scenery loading, but I remember we tried a few different AMs with no luck. Wait till you got 8 or 10 cores we'll have another look  :wink:

 

 

 

 

 

Steve Waite: Engineer at codelegend.com

Guys, it's really an interesting read!

 

Thanks everyone for explaining this stuff to us, ingorants... :) I find it really incredible how you guys have been able to disect this stuff into comprehensible ideas for us all.

 

Yet, I'm still trying different things, and since I changed to 4K, I'm yet to find the right settings for my rig. I'm currently running a 6700K OC at 4.9 on liquid, and a GTX1080 also OCd. HT is off... Only AA I have is within P3d 2x, and FXAA enabled... and frames are normally solid at around 50/60 with complex addons, but every odd second they spike down to 35 or so, and then up again... It's not unfliable, but I wasn't having this before.

 

Can anyone suggest any specific AM settings to start trying?

 

After several tests I have decided to stay HT Off, and I currently am getting a solid performance, but with several spikes on the FPSs which I didn't use to get on the non4k Setup, or with the 980ti. I suppose the drivers of the GPU are still to be improved, but if there are any suggestions that can be of help I really appreciate it!

 

Take care.

Giorgio La Pira

Guys, it's really an interesting read!

 

Thanks everyone for explaining this stuff to us, ingorants... :) I find it really incredible how you guys have been able to disect this stuff into comprehensible ideas for us all.

 

Yet, I'm still trying different things, and since I changed to 4K, I'm yet to find the right settings for my rig. I'm currently running a 6700K OC at 4.9 on liquid, and a GTX1080 also OCd. HT is off... Only AA I have is within P3d 2x, and FXAA enabled... and frames are normally solid at around 50/60 with complex addons, but every odd second they spike down to 35 or so, and then up again... It's not unfliable, but I wasn't having this before.

 

Can anyone suggest any specific AM settings to start trying?

 

After several tests I have decided to stay HT Off, and I currently am getting a solid performance, but with several spikes on the FPSs which I didn't use to get on the non4k Setup, or with the 980ti. I suppose the drivers of the GPU are still to be improved, but if there are any suggestions that can be of help I really appreciate it!

 

Take care.

 

For a quad-core with HT enabled (which you should be doing) and 3 LPs dedicated to P3D/FSX you want an affinity mask of 84.  If you don't have any background tasks that will interrupt your simming or any 3rd party add-ons that use external applications, you could use 85 instead to use 1 LP per core on all 4 cores.  

 

I found a nice Affinity Mask calculator here which lets you calculate AMs up to 8 core HT-enabled CPUs (i.e. 16-thread CPUs).  http://www.gatwick-fsg.org.uk/affinitymask.aspx?SubMenuItem=hardware

Guys, it's really an interesting read!

 

Thanks everyone for explaining this stuff to us, ingorants... :) I find it really incredible how you guys have been able to disect this stuff into comprehensible ideas for us all.

 

Yet, I'm still trying different things, and since I changed to 4K, I'm yet to find the right settings for my rig. I'm currently running a 6700K OC at 4.9 on liquid, and a GTX1080 also OCd. HT is off... Only AA I have is within P3d 2x, and FXAA enabled... and frames are normally solid at around 50/60 with complex addons, but every odd second they spike down to 35 or so, and then up again... It's not unfliable, but I wasn't having this before.

 

Can anyone suggest any specific AM settings to start trying?

 

After several tests I have decided to stay HT Off, and I currently am getting a solid performance, but with several spikes on the FPSs which I didn't use to get on the non4k Setup, or with the 980ti. I suppose the drivers of the GPU are still to be improved, but if there are any suggestions that can be of help I really appreciate it!

 

Take care.

 

I would suggest 

241 with HT enabled. Test it and please share your results.

It will give you the advantages of Hyper-treading, (smoothness) while running as if Hyper-treading was off - Logical cores on the same physical core running similar tasks.

Archived

This topic is now archived and is closed to further replies.

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.