Jump to content
Sign in to follow this  
darth_damian_000

What is JobScheduler Affinity Mask?

Recommended Posts

Up until recently, I had no issues with textures. Now, all of a sudden, I am getting them.

I asked about it on the ORBX forum, and they advised to "remove jobscheduler affinity mask" in the p3d.cfg file.

 

Can anyone tell me what this jobscheduler affinity mask do? how is it vital to my simulator, and what is going to happen if I remove it? How do I remove it anyway (change a value, delete the line altogether?)

It seems relevant to say that I have an i7 hyperthreaded quad core CPU.

 

Thanks you all!

Share this post


Link to post

It's not a value that's set in the Prepar3D.cfg config file out of the box. You would have to have manually entered it or some other program inserted it. So you can check in the Prepar3D.cfg found in the folder "C:\Users\[you]\AppData\Roaming\Lockheed Martin\Prepar3D v3", open with notepad and Find "JOBSCHEDULER". If you don't have one then ignore it or investigate the many discussions found on the subject. The issues surrounding it are many, and the theory is difficult to understand. It is a system dependent setting that isn't required unless you want to fine tune heat and CPU resources. This often leads to users pasting a number in that works for someone else, but would be no use to their system.

 

The bigger problem regarding core affinity (where processes run on which cores of the CPU), is what happens when we run other programs alongside the simulator processes on cores that combine to interrupt each other and reduce performance. This leads to fine tuning the addon apps affinity to avoid the main processes of the simulator.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post
Guest

That line isn't there by default in the cfg so if it IS there, you must have put it there yourself... which would be odd but it is not the first time people add tweaks to their cfg's without knowing what they are doing.  :wink: If the line is indeed there simply delete it (both the [Jobscheduler] line as well as the AffinityMask line underneath it). It isn't needed at all, specially if you don't know how to deal with it. (Although some people say it does wonders for their sim.) It's not vital and nothing will happen to your sim when you remove it.

 

What it does is can be read here: http://www.prepar3d.com/SDKv2/LearningCenter/getting_started/performance/tuning_guide.html

 

Although the advice from ORBX is a bit simple it does show that in general it is adviced to not use any performance tweaks with P3D.

Share this post


Link to post

The line you mentioned tells p3d how many and which cores to use.

 

It should look like that


[JOBSCHEDULER]
AffinityMask=244

You can delete both lines to cancel, the entry does not exists by default on the p3d.cfg file.

 

Read more about Affinity Mask:

http://www.avsim.com/topic/444793-one-tweak-to-rule-them-all-how-to-set-affinity-mask-correctly/

 

---

 

As for your original problem, just try to think if you did some mod or updated drivers and if the problem started after that, try to revert to the situation you had before.

 

Otherwise, backing up and deleting the p3d.cfg to get a fresh one might help as a starting point.

 

Share this post


Link to post

I appreciate the input I received thus far. My stance on "tweaking" is conservative, as in, I don't want to tweak unless I really really have to. I never opened the CFG file, until today, and I didn't find these lines, so indeed that is not the issue. The only thing that has changed since last startup is.....I installed new livery to my aerosoft airbus, and used it during this flight. I will do more research, hopefully to come up with some sort a solution.

 

Thank you for your responses you guys. This is such a helpful community.

 

EDIT:

I had issues at KDFW. There was an elevation issue, where the parking space where my plane was essentially sunk below the airport. I had to use the Vector Configuration Tool to add the airport to the list of exclusions where ftx vector has an influence on. Could this be a possible cause?

Share this post


Link to post

 

 

[JOBSCHEDULER]

AffinityMask=0

 

Is the above equal to no AM set at all? As if there were no these lines in Prepar3d.cfg?

 

Thanks 

Share this post


Link to post
Guest

 

EDIT:

I had issues at KDFW. There was an elevation issue, where the parking space where my plane was essentially sunk below the airport. I had to use the Vector Configuration Tool to add the airport to the list of exclusions where ftx vector has an influence on. Could this be a possible cause?

Elevation problems won't have an impact on performance or result in texture problems. (BTW You didn't yet say what problems you have exactly.) However... the quote above makes it clear you have installed FTX Vector. Did the problems perhaps start after installing Vector? Vector is known to hurt performance unless you turn down/off quite a few options.

 

It is very odd that Orbx tells you to remove the jobscheduler entry without knowing if you had that entry. Instead, Orbx maybe should have told you to remove Vector. ;)

Share this post


Link to post

 

 


BTW You didn't yet say what problems you have exactly

 

That's right. The problem is that the textures are ridiculous. Everything seems fine when my view in the cockpit, or when it's a bird's eye view (although in this case I suppose its more accurate to call it a "international space station view") of the airplane and the scenery below it. The problem is this: When I cycle through camera views (I know, I know, I'm getting EZ-DOK soon), I will eventually end up on a view from the nearest tower. Once that happens, the textures go blurry. Like if the ground has grass, then the entire ground turns green (with a few houses sticking up). Similarly, the ground turns tan when I am over a desert. When I switch to a cockpit view, the textures look blurry and don't seem to want to reload after a few seconds.

 

 

 


Instead, Orbx maybe should have told you to remove Vector. ;)

 

HAH! The way they replied, and from the responses I received here, it seems like it is a grasping-for-straws situation so that I keep vector, but even if I do they still have my money :[

Share this post


Link to post
Guest

 

 


I will eventually end up on a view from the nearest tower. Once that happens, the textures go blurry.

 

Ah, well, if that is all, why don't you skip that tower view...?  :wink: Like instead of cycling through all the views you could switch between them using the default keys. Or you could edit out the tower view from the camera.cfg.

 

I usually delete views I never use: saves a lot of key pressing. Like in my Aerosoft Airbus, which has TONS of defaults views, I only use two views (VC and radio panel) so I removed all other views from the various configs and now I can switch between the two views simply by pressing A without the need to also press Shift and without having to see views I don't want. I don't do performance tweaks anymore but there are a lot of 'convenience tweaks' out there!  :wink:

Share this post


Link to post

 

 


Or you could edit out the tower view from the camera.cfg.

 

I know that the aerosoft airbus has a ton of annoying views, many of which don't allow you to pan the camera. I'm going to bite another add-on bullet and get EZ DOK, now that it is seemingly available for p3d.

 

Do you heavily use the radio when you're simming?

Share this post


Link to post

Is the above equal to no AM set at all? As if there were no these lines in Prepar3d.cfg?

 

Thanks 

 

It would probably read 0 as invalid and just ignore the value, yes. Because you're essentially telling the sim "Don't use any CPU cores at all". However if you don't want the tweak, it's best to remove the two lines altogether.


Asus Prime X370 Pro / Ryzen 7 3800X / 32 GB DDR4 3600 MHz / Gainward Ghost RTX 3060 Ti
MSFS / XP

Share this post


Link to post

It would probably read 0 as invalid and just ignore the value, yes. Because you're essentially telling the sim "Don't use any CPU cores at all". However if you don't want the tweak, it's best to remove the two lines altogether.

 

Thanks Jim.

 

Dirk.

Share this post


Link to post

An application, in this case P3D, interprets the Affinity Mask, whatever value is assigned in its configuration file, in the way it sees fit. Generally AM=zero is assumed to be all Logical Processors unmasked. For example on a four core CPU this value would be represented with binary as 1111, each "one" representing a core. The core referred to as "core zero" is on the right, and the core referred to as core three on the left.

To the software, these cores are referred to as Logical Processors, the four core CPU has four Logical Processors (LPs).

Problems arise when we introduce Hyper Threading (HT) CPUs since these have two LPs per core.

Each LP of an HT core takes a turn in sharing the core on a time slice basis. The complicated state of play the software is at when the switch to another process is made is preserved with the HT mode. Without HT this information takes more time to establish as the two processes share time on the core, on the same LP. That's how HT mode increases the performance of Windows, there could be as many as 200 processes all sharing those LPs simply booting up.

The problem with that is some apps, P3D for example, don't care if the LPs are in pairs sharing each core, they go on and use them as if they are unshared.

P3D deliberately makes a job on every LP it finds, and if there are four cores, it will make four jobs, one on each LP. The main job which takes care of rendering the screen, is at it's leanest, and running at it's best when there are four parts. P3D provides the Affinity Mask setting because we must ascertain how the CPU(s) should be utilised and pass that information into the sim so that it knows how to start on the available CPUs.

P3D will put a job on each LP, so the core 0 LPs 0 and 1 will each receive a job. Obviously we've now got the situation whereby the main job shares the core with another job, defeating the way the sim code has thinned out the jobs, plonking them back on the same core again. That's why the [JOBSCHEDULER] section is introduced for the app. There are other reasons for it such as to distribute work across the CPU or CPU Packages on multi-CPU motherboards, and obviously in the case of P3D preventing it from making too many jobs or utilising two LPs per core which can create a lot of heat.

With P3D, jobs after a count of four increase the speed the scenery data is collected, but reduce the rendering performance slightly (since P3Dv3.2 this is negligible).

This problem of Hyper Threading leads to the Affinity Mask values that look like this: 11,11,11,10=254 and 11,11,11,01=253. (I put commas in the binary to show the HT Pairs grouped. Remember LP0 of core zero is on the right).

Generally if we have no AM with a four core and HT disabled, we get the same result in the sim with HT enabled and an AM that looks like this: 01,01,01,01=85. As it can be seen that all four cores are utilised by the sim in the same way as if HT is disabled.

 

We can make sure that other processes that must be run alongside the sim, like weather engines,  are run away from the core hosting the LP running the main sim job. Other processes of the PC will generally stay dormant while the sim runs. We can use other programs or batch files to start apps so that they avoid the main sim core.

 

We see more complicated arrangements for affinity, like AM=116 for example. This came about because four core HT enabled users wanted to devote an entire core to other processes and use three cores for the sim. 01,11,01,00=116 can be seen that the first core, core zero on the right, is not utilised by the sim, the addons would be run there. Move along to the left, and we've enabled one LP for the sim main job, that's the main thing we talked about earlier. The next two jobs along are on the same core, but it's not too bad since they don't usually demand maximum throughput together.





 

  • Upvote 1

Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Steve i have read countless descriptions and breakdowns of HT and AM from you for a very long time and todays lesson finally made sense to me, it has the same info you always provide but for some crazy logical reason all my cores(my brain) were utilised....lols..... thank you Sir.


tpewpb-6.png

 

Share this post


Link to post

Is the above equal to no AM set at all? As if there were no these lines in Prepar3d.cfg?

 

Thanks 

 

AM = zero is bad syntax and should be avoided.

 

If you do not want to set an affinity mask, leave this line out entirely.


Bert

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