Jump to content
Sign in to follow this  
toby23

One Tweak to Rule Them All - How to set Affinity Mask Correctly

Recommended Posts

toby23 - Thank you for the post, this has been the best change/tweak I have done and the sim is nice and smooth, thank you


Nick Sciortino

 

Share this post


Link to post

Yes Mick, 15 will get all 4 cores running the sim and would seemingly raise temps. I use 14 (which is is done by default...if you leave the [JobScheduler] out of the config file. I see no performance difference between the two. Using a SB 2500K@4.2ghz.

cheers, 

I agree no difference in performance between Affinity Mask 15 and leaving job scheduler out except I get best result with frames locked to 30 in sim and without affinity mask set there are too many blurries. 

 

What I need to know is why there is a temp difference between setting affinity mask in p3d cfg or setting in task manager ? there is something going on that I don't understand.

Share this post


Link to post

Just look at the load pattern in Task Manager while the sim is running (in a window).

 

If Core0 is largely un-used, as the default would suggest, you are going to get less

heat than if all four cores are used with AM=15.


Bert

Share this post


Link to post

Just look at the load pattern in Task Manager while the sim is running (in a window).

 

If Core0 is largely un-used, as the default would suggest, you are going to get less

heat than if all four cores are used with AM=15.

Bert, that still doesn't truly answer the question. There are (at least) two methods for enabling P3Dv2 to use all cores:

1. via a config tweak

2. via the Task Manager

 

Both will accomplish the same end result; except that the config tweak apparently is causing higher a higher temperature...


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
n4gix, on 21 Jun 2014 - 7:04 PM, said:n4gix, on 21 Jun 2014 - 7:04 PM, said:

Bert, that still doesn't truly answer the question. There are (at least) two methods for enabling P3Dv2 to use all cores:

1. via a config tweak

2. via the Task Manager

 

Both will accomplish the same end result; except that the config tweak apparently is causing higher a higher temperature...

The equivalence or non-equivalence of both methods has been under debate for some time now. My personal - unproven - take is that the simulator indeed gets the assigned cores in both cases, while load sharing between the simulator and the remaining programs (and you've to count in all the OS tasks) and/or even between the remaining programs might be different. As an example, assigning cores 1-7 to the simulator, you can assign all the reaming programs to core 0, or can distribute them over cores 0-7 etc. There is a tool (EasyToolz, which I found by reference from http://simmershome.de/, but there are even more intricate ones) which has a checkbox to differentiate this. Supposedly, this is only one example and there are even more possibilities of load distribution.

 

Kind regards, Michael


MSFS, Beta tester of Simdocks, SPAD.neXt, and FS-FlightControl

Intel i7-13700K / AsRock Z790 / Crucial 32 GB DDR 5 / ASUS RTX 4080OC 16GB / BeQuiet ATX 1000W / WD m.2 NVMe 2TB (System) / WD m.2 NVMe 4 TB (MSFS) / WD HDD 10 TB / XTOP+Saitek hardware panel /  LG 34UM95 3440 x 1440  / HP Reverb 1 (2160x2160 per eye) / Win 11

Share this post


Link to post

I'm coming late to this party but I'm not sure about this:
 

I also see minimal activity on cores 1 and 2, which indicates system activity, so I will reserve these two cores, as well as core 4, for the system and other programmes and assign cores 3,5,6,7 and 8 to Prepar3D. 5 cores is plenty for Prepar3D and 3 is fine for the system and other programmes.

Why should preventing P3D from using other cores result in better performance comparing with utilising all cores?

Also, if there is "minimal acivity" one some cores  why not less Windows make use of them?
 
Microsoft states: 
 

Windows won’t move a running thread that could run on a different processor from one CPU to a second processor to permit a thread with an affinity for the first processor to run on the first processor. For example, consider this scenario: CPU 0 is running a priority 8 thread that can run on any processor, and CPU 1 is running a priority 4 thread that can run on any processor. A priority 6 thread that can run on only CPU 0 becomes ready. What happens? Windows won’t move the priority 8 thread from CPU 0 to CPU 1 (preempting the priority 4 thread) so that the priority 6 thread can run; the priority 6 thread has to stay in the ready state.
 
Therefore, changing the affinity mask for a process or a thread can result in threads getting less CPU time than they normally would, because Windows is restricted from running the thread on certain processors. Therefore, setting affinity should be done with extreme care—in most cases, it is optimal to let Windows decide which threads run where.

 

Source: Windows Internals, Sixth Edition, Part 1 - Chapter 5 Processes, Threads, and Jobs

Share this post


Link to post

Thanks for the informative post, not an issue with my system yet E8600 dual core, but might be when I upgrade to a new CPU.

 

Cheers

Martin

Share this post


Link to post

 

 


There are posts by LM staff on their forum indicating that they are now not that sure that this is true.

 

Thanks for that info Jabloomf1230.  MGH's post (above) seems to concur.

Share this post


Link to post

It would be different if AM prevented other tasks from accessing a core assigned to P3d, but it doesn't work that way. To do so, one would have to assign an AM to every task that is active and that is completely impractical. I have tried setting separate AMs for P3d, TrackIR and ASN that isolate the three apps to specific cores and it makes absolutely no difference in performance on my system. Keep in mind that my PC has 12 physical cores and P3d2 will use all of them.

 

Basically, Win 7 and especially Win 8.1 do an excellent job of scheduling tasks over multiple cores.

Share this post


Link to post

 

There are posts by LM staff... ...that it really makes no sense to disable 25% of the cores in P3d by default...

Thanks for that info Jabloomf1230.  MGH's post (above) seems to concur.

 

 

This is certainly true while CPUs have low core counts.

 


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Need Help,

 

Sorry guys but how to you get the binary numbers please. Searching but cant find.

 

Regards

Share this post


Link to post

I am not the kind of person to dedicate the little time I have spare to writing a guide for the sake of self promotion.

 

The one and only reason that I wrote the guide is because with a default install of Prepar3D and, even after trying various tips and tricks found online, all that I experienced was stuttery flight and blurry textures, using the default F22 flight as a baseline.

 

After applying the value I worked out using the steps outlined in the guide, I have the smoothest and sharpest flying experience that I have ever had.

 

That's worth sharing in my book.


Ryzen 5800X3D, 64GB RAM, RTX 4090, Windows 10

Share this post


Link to post

Need Help,

 

Sorry guys but how to you get the binary numbers please. Searching but cant find.

 

Regards

Did you read the first post? It has very specific instructions, complete with pictures and everything... :He He:


Fr. Bill    

AOPA Member: 07141481 AARP Member: 3209010556


     Avsim Board of Directors | Avsim Forums Moderator

Share this post


Link to post
Guest
This topic is now closed to further replies.
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...