New Job Scheduler Entries

Any issues, problems or troubleshooting topics related to the Prepar3D client application.
tedporter
Posts: 3
Joined: Sun Mar 25, 2012 3:07 pm

Re: New Job Scheduler Entries

Post by tedporter »

erikschlijper wrote: Fri Dec 03, 2021 3:34 pm
tedporter wrote: Fri Dec 03, 2021 3:09 pm
erikschlijper wrote: Fri Dec 03, 2021 2:59 pm

Thanks Ted! That totally makes sense to me. But what value should I enable for 5.3? Should I set AffinityMask=4095, and the other one to, about p3d core, to 4092?

Sincerely

Erik
Hi Erik,

That is not so easy to determine as 5.3GHz is the CPU's collective frequency and regardless of the speed you really need to see which core(s) are being driven the hardest using Task Manger and then using the Advance Mode to create a mask to try and spread the load more. Sorry I cannot give you an exacting answer.

Kind Regards,


Ted.
Hi Ted,

With 5.3 I meant P3DV5.3, my CPU is at stock speed, HT on. No OC to any frequency. I'll do as you've advised! Thanks
Lol :-) That is me over thinking it...
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: New Job Scheduler Entries

Post by Beau Hollis »

Every system is different and your mileage may very. By default P3D is doing its best to utilize all the CPU resources available. Tweaking these settings is not likely to give you a big FPS gain, but it may help reduce stutters and long frames that can be caused by the OS pre-empting our main or render threads.
A few things to clarify:
1) By default P3D uses all cores. These cfg entries are way of restrictions which cores we use or for moving specific workloads around to specific cores. As other have noted, the OS already tries to do this for you, so in theory you should be able to leave these settings at default values and be fine.
2) Each thread scheduler is assigned to only one core because the job of that scheduler is to assign work to that core specifically
3) Even a core which p3d is maxing out can be pre-empted by the OS. Other processes may also be playing games with thread and process affinity to encourage utilization of specific cores. If your OS is pre-empts our main or render threads, you may get a long frame as a result though fps limiting can help smooth this out.
4) My comment about 'heavy addons such as PMDG' is a theoretical one. Leaving cores open for add-ons to use will only benefit performance if the add-ons are utilizing multi-threading. As other have noted, the OS would already try to assign this work to a core with a lower workload. I provided sample code for how add-on developers might do this in their code. This sort of trick might be harder to take advantage of for general use. For our solution developers that are configuring custom hardware and software for training devices, this could be quite useful.
5) Keeping one or more cores free might help in cases where p3d is paging in lots of scenery. This is really the only case where you'll see our overall CPU utilization get high across most cores because terrain texture creation is often being done on all the background schedulers.
Beau Hollis
Prepar3D Software Architect
Ray Proudfoot
Posts: 518
Joined: Thu May 18, 2017 8:19 am

Re: New Job Scheduler Entries

Post by Ray Proudfoot »

Beau, very helpful, thanks. Is there any advantage in using Hyperthreading with v5.3 or not?

I recently turned it off as it allows higher overclocking. Running an i7-8086K at 5.2 (3 cores) and 4.8 (3 cores).
Ray (Cheshire, England).

System: P3D v5.3HF2, Intel i9-13900K o/c to 5.8GHz, Nvidia RTX 4090 24Gb, 32Gb Corsair DDR5 RAM, Asus ROG STRIX HERO mobo, Crucial T700 4Tb SSD, Win 11 Pro, BenQ 32” UHD monitor, Fulcrum One Yoke
User avatar
Fresjay76
Posts: 12
Joined: Wed May 29, 2019 3:23 am

Re: New Job Scheduler Entries

Post by Fresjay76 »

Beau,

Thanks for the clarification. The reasons you state are the reasons this interests me so much as it is something Sims have needed for some time. The ability to utilize the hardware present. I am interested not for FPS increase, but rather increasing smoothness and performance. Really high FPS is not necessary but smoothness is. Hard to do anything when the sim is a slide show.

Jason
P3D v5.2HF1, ORBX, Aerosoft, FlyTampa, Flightbeam, FSDT, REX, AS, QW Carenado, PMDG, FSL
System:
Ryzen 9 5950X
ASUS RTX 3080
32Gb DDR4 3600
1Tb Sabrent Rocket (System), 2TB 980 PRO (P3D), 3x1Tb Samsung SSD (Programs), 16TB IronWolf NAS
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: New Job Scheduler Entries

Post by Beau Hollis »

The main advantage of HT on is that you double your logical cores. Having more cores can speed up terrain and auto-gen streaming. If you move the camera too quickly the paging system can get behind which causes things like blurry ground textures and missing blocks of autogen buildings and trees. Physical cores can run faster/cooler when HT is off because they don't have to manage two workloads. Some users have seen a benefit to enabling HT to get more queues, but then using the affinity mask to prevent P3D from scheduling work on the HT core associated with the main thread. So for default case where main thread is core 0, you can try making off core 1 and this may allow you to keep core 0 running faster and cooler while other cores that are doing asynchronous terrain can keep do more work at the cost of a bit of speed. Other processes might still throw work on that core though so disabling HT is probably your best bet if your goal is getting the main thread running as fast as possible.

If you have 4 or fewer physical cores, I would suggest leaving HT on and maybe trying your tune the affinity settings if you want to get more performance out of it. In addition to the main thread we have two other dedicated threads dx12 rendering work and other per-frame rendering work. If you have only 4 logical cores this would leave you with just one core left for background work like terrain loading and you may see slower terrain paging speeds than you did in v4.

We don't really have enough data yet to say XYZ setting will work better. Part of adding these options is to enable the community to experiment with them and report back to us with your findings. If the community discovers a combination of settings that is better across a broad range of hardware, we'll be happy to receive that feedback and tweak the defaults. In the past we've tried things like masking off cores based on feedback only to find that it worked well on some intel chips but caused serious slowdowns on some AMD chips.
Beau Hollis
Prepar3D Software Architect
Ray Proudfoot
Posts: 518
Joined: Thu May 18, 2017 8:19 am

Re: New Job Scheduler Entries

Post by Ray Proudfoot »

Great reply, thanks. I’ll experiment.
Ray (Cheshire, England).

System: P3D v5.3HF2, Intel i9-13900K o/c to 5.8GHz, Nvidia RTX 4090 24Gb, 32Gb Corsair DDR5 RAM, Asus ROG STRIX HERO mobo, Crucial T700 4Tb SSD, Win 11 Pro, BenQ 32” UHD monitor, Fulcrum One Yoke
ahuimanu
Posts: 112
Joined: Mon Dec 17, 2012 5:45 am

Re: New Job Scheduler Entries

Post by ahuimanu »

Beau,

Thank you for the documentation, would please also add this to the documentation that accompanies the SDK?
User avatar
kevinfirth
Posts: 191
Joined: Wed May 15, 2013 11:24 am
Location: Kidderminster, UK
Contact:

Re: New Job Scheduler Entries

Post by kevinfirth »

Beau Hollis wrote: Mon Dec 06, 2021 8:22 pm
Thank you for your feedback Beau, that's quite helpful. I'm sure those of us with a little understanding will post some results for review.

Can I just comment on how nice it is to see some more active developer contributions here as well. P3D 5.3 is a great point update, and while I certainly don't expect or need to see your time being consumed by endless forum debates, your team's engagement here on factual points, however free and open you are able to be, is highly valued. Thankyou
Tamba765
Posts: 77
Joined: Tue May 30, 2017 11:42 pm

Re: New Job Scheduler Entries

Post by Tamba765 »

Why should we, as end users have to go through this stuff? This seems to be something that LM should be taking care of.
Pete Locascio
User avatar
JorgenSA
Posts: 6010
Joined: Sun Mar 11, 2018 7:17 am
Location: 5 NM ENE of EDXF

Re: New Job Scheduler Entries

Post by JorgenSA »

You don't HAVE to. If you don't want to, then just leave it alone.

But FYI, and as an example, for Windows Update, Microsoft takes more than 16 million different hardware configurations into account.

Your system and mine are probably very different, so we need to tailor our own P3D configuration files to our own hardware configurations. That is something L-M cannot do for us.

Jorgen
System: i5-12600K@4.9 GHz, ASUS ROG STRIX Z690-I motherboard, 32 GB 4800 MHz DDR5 RAM, Gainward RTX 3060 w/ 12 GB DDR6 VRAM, Windows 10 Pro.

All views and opinions expressed here are entirely my own. I am not a Lockheed-Martin employee.
Tamba765
Posts: 77
Joined: Tue May 30, 2017 11:42 pm

Re: New Job Scheduler Entries

Post by Tamba765 »

I wish I had a clue what you guys are talking about. Maybe then I could actually complete a flight without the P3Dv5.3 frame rates dropping to the point where the program freezes completely. I have an Intel Core i7 8700K (Coffee Lake) processor with 6 cores and 12 threads. I tried emptying the AffinityMask settings in the .cfg. It repopulated with the same settings it originally had, which were: P3DCoreAffinityMask=4095, MainThreadScheduler=0, RenderThreadScheduler=2, FrameworkerThreadscheduler=4. Does this look correct for my setup?
The last time I used an AffinityMask was with FSX, due to 8-minute freezes I was getting during flights. There was an AffinityMask calculator available that simply gave you setting to use based on the CPU information you typed in, and it worked well. It seems things have gotten way more complicated since those days. I'm assuming that the AffinityMask is what's causing my difficulties since they didn't occur in the previous P3D version, but I guess it's possible it could be something else. I haven't made any changes to my machine and am using the same basic sim settings as before. I'm using Active Sky, Vatsim, and PMDG aircraft with no additional AI programs. Any suggestions would be welcome. Thanks.
Pete Locascio
Pete Locascio
User avatar
JorgenSA
Posts: 6010
Joined: Sun Mar 11, 2018 7:17 am
Location: 5 NM ENE of EDXF

Re: New Job Scheduler Entries

Post by JorgenSA »

Pete,

I could believe that this was the AffinityMask calculator you used:

https://www.gfsg.co.uk/affinitymask.asp ... m=utilties

Try setting both the AffinityMask and the P3DCoreAffinityMask to the value the calculator comes up with, and set the MainThreadScheduler to 0.

Then see what happens.

Jorgen
System: i5-12600K@4.9 GHz, ASUS ROG STRIX Z690-I motherboard, 32 GB 4800 MHz DDR5 RAM, Gainward RTX 3060 w/ 12 GB DDR6 VRAM, Windows 10 Pro.

All views and opinions expressed here are entirely my own. I am not a Lockheed-Martin employee.
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: New Job Scheduler Entries

Post by Beau Hollis »

Pete,
Sorry that you're having this issue. Those affinity settings values look correct. 4095 = 111111111111 which is showing all 12 cores enabled. I don't believe we changed the default behavior of affinity in 5.3. We just write it out now so you can see that we're using under the hood and modify it (if you want to). If you're seeing a performance drop in v5.3 with the same settings as v5.2, it's likely related to something else we changed. I'd suggest starting a new thread with any major performance issues and post as much detail about your settings and use case as you can. Performance is important to us, and we'll do our best to see what's going on and fix it.
Thanks
Beau Hollis
Prepar3D Software Architect
User avatar
Fresjay76
Posts: 12
Joined: Wed May 29, 2019 3:23 am

Re: New Job Scheduler Entries

Post by Fresjay76 »

Not sure why my first post was duplicated by someone else but I think I get how this works. So at install of 5.3 the program should see my CPU and thus adjust the mask to work with it based on my cores count? If so I will see little reason to mess with it. Other than maybe to move certain processes around if it is loading 1 core too much. But most of my friends using 5.3 are seeing a nice enough performance boost so we shall see.

Jason
P3D v5.2HF1, ORBX, Aerosoft, FlyTampa, Flightbeam, FSDT, REX, AS, QW Carenado, PMDG, FSL
System:
Ryzen 9 5950X
ASUS RTX 3080
32Gb DDR4 3600
1Tb Sabrent Rocket (System), 2TB 980 PRO (P3D), 3x1Tb Samsung SSD (Programs), 16TB IronWolf NAS
User avatar
Beau Hollis
Lockheed Martin
Posts: 2452
Joined: Wed Oct 06, 2010 3:25 pm

Re: New Job Scheduler Entries

Post by Beau Hollis »

Not sure why my first post was duplicated by someone else but I think I get how this works. So at install of 5.3 the program should see my CPU and thus adjust the mask to work with it based on my cores count?
Yes. Sorry if that wasn't clear. If you leave all that as-is it will behave the same way it did in previous releases. By default (for several years now), we detect the number of cores and set an affinity mask that uses all of them. The main difference now is that we write the default value we calculate into the Prepar3D,cfg. The main reason for this is that it makes the setting a bit more accessible since you need only find the existing entry and change it, rather than having to consult the documentation.
Are there any plans to post a reference guide per CPU core count to have a as a basis to start from.
I'll take an action to compile some info based on what I've posted here into the advanced configuration section of the learning center. It's probably be limited to explaining how the settings work though rather than making specific suggestions for different core counts.
Beau Hollis
Prepar3D Software Architect
Post Reply