Jump to content
Sign in to follow this  
Sethos

Turning off hyper-threading had quite an impact on my P3Dv5

Recommended Posts

Let me preface this by saying that I'm kinda perplexed by this result. I've messed around with affinity masks before in previous versions of Prepar3D and never had any conclusive results. Always some vague placebo "I think it's smoother if I do this..." but never the numbers to back it up. However, during my 'performance killer' run, I saw some major differences under v5. To explain, that run simply consists of taking off in a default jet (F-35 in this case) out of OrbX's SoCal and then fly for a few minutes. That will usually give you shaky FPS and stutters as the vast amounts of autogen cells are loaded. If the sim runs acceptable here, it'll most likely run acceptable everywhere else.

Under v5, I saw a huge difference. Turning HT off via an affinity mask, gave me a very smooth result, smoother than my sim has ever been here, whereas the default all cores mask was the usual shaky, low FPS like the previous entries (I'd say it was a good bit lower but my settings are also higher). Sim still stutters in both cases when a cell loads, which can be down to OrbX's models or just the sim of course.

I will also note, I had to use OBS instead of Nvidia Share, as that would make the sim crash with the RTSS overlay (It's a sensitive mistress this), so that could potentially have taken a bit of performance as well.

These are my settings and specs can be found in the signature. Framerate capped to 30 via Nvidia settings. 

 

Has anyone been playing around with affinity masks under v5 and seen any differences? 

Edited by Sethos
  • Like 1

Asus TUF X670E-PLUS | 7800X3D | G.Skill 32GB DDR @ CL30 6000MHz | RTX 4090 Founders Edition (Undervolted) | WD SNX 850X 2TB + 4TB + 4TB

Share this post


Link to post
21 minutes ago, Sethos said:

Turning HT off via an affinity mask

Can you explain?  I am under the impression HT is controlled by a BIOS setting and in a then-booted system optimized within an individual application with Affinity Mask.


Frank Patton
MasterCase Pro H500M; MSI Z490 WiFi MOB; i7 10700k 3.8 Ghz; Gigabyte RTX 3080 12gb OC; H100i Pro liquid cooler; 32GB DDR4 3600;  Gold RMX850X PSU;
ASUS 
VG289 4K 27" Monitor; Honeycomb Alpha & Bravo, Crosswind 3's w/dampener.  
Former USAF meteorologist & ground weather school instructor. AOPA Member #07379126
                       
"I will never put my name on a product that does not have in it the best that is in me." - John Deere

Share this post


Link to post

@Sethos I have an 9900KS. So 8 cores and HT on makes it 16. 
I added an affinity mask to disable the HT part of the cores. It runs way way way smoother. I tested it for 24 hours using the same scenario. And the conclusion is, that the hyper threading causes stuttering, and the affinity mask to turn it off removes the stuttering. 

  • Upvote 1

Share this post


Link to post
6 minutes ago, fppilot said:

Can you explain?  I am under the impression HT is controlled by a BIOS setting and in a then-booted system optimized within an individual application with Affinity Mask.

Yes you are correct.  I disable HT in BIOS instead of setting it up as an affinity mask in the cfg.

  • Like 1

Sean Green

Share this post


Link to post
8 minutes ago, fppilot said:

Can you explain?  I am under the impression HT is controlled by a BIOS setting and in a then-booted system optimized within an individual application with Affinity Mask.

It is but you can technically 'turn it off', which is what I'm referring to here, by simply masking off the logical cores, i.e only using the physical cores through an affinity masks. Then you end up with the same effect as disabling hyper-threading without having to do it globally.


Asus TUF X670E-PLUS | 7800X3D | G.Skill 32GB DDR @ CL30 6000MHz | RTX 4090 Founders Edition (Undervolted) | WD SNX 850X 2TB + 4TB + 4TB

Share this post


Link to post

I run HT on with an AM. Scenery loading (PS) vastly improved.

Share this post


Link to post
1 minute ago, Sethos said:

It is but you can technically 'turn it off', which is what I'm referring to here, by simply masking off the logical cores, i.e only using the physical cores through an affinity masks. Then you end up with the same effect as disabling hyper-threading without having to do it globally.

I would love to gain a better understand of that.  If you have time would you PM me a bit more about it?

  • Upvote 1

Frank Patton
MasterCase Pro H500M; MSI Z490 WiFi MOB; i7 10700k 3.8 Ghz; Gigabyte RTX 3080 12gb OC; H100i Pro liquid cooler; 32GB DDR4 3600;  Gold RMX850X PSU;
ASUS 
VG289 4K 27" Monitor; Honeycomb Alpha & Bravo, Crosswind 3's w/dampener.  
Former USAF meteorologist & ground weather school instructor. AOPA Member #07379126
                       
"I will never put my name on a product that does not have in it the best that is in me." - John Deere

Share this post


Link to post

Nothing new for my system. P3D v4.x was always a lot smoother with HT off. It's well documented that HT/SMT off can improve performance in some games as well, not all however. 

  • Like 1

Share this post


Link to post
27 minutes ago, Sethos said:

It is but you can technically 'turn it off', which is what I'm referring to here, by simply masking off the logical cores, i.e only using the physical cores through an affinity masks. Then you end up with the same effect as disabling hyper-threading without having to do it globally.

That's not the same as disabling HT in the BIOS, because other running processes (there are hundreds) can still be tasked by the OS to run on the LPs that you masked-off in the P3D affinity mask. 

Consider this case:  HT on and an affinity mask that restricts P3D to run on only one LP per core (e.g. AM=85 or 01010101 on a 4-core CPU).  In this case, P3D's main thread will place a heavy load on LP 0, and no load on its paired LP 1.  The OS sees LP 1 as a good target to assign threads because it has no load.  So it puts threads from other processes on LP 1, which shares CPU's physical processing unit with LP 0.  You really don't want CPU 0 diverting its work from the main thread, but that's what will happen as the processing unit alternates between the instruction stacks on LP 0 and LP 1.  Additionally, with HT on, CPU 0 is sharing it's limited and super-fast cache memory between the processes running on the two LPs instead of using it all for the P3D main thread. 

With HT off in the BIOS, LP 0 is CPU 0...with it loaded way up by P3D's main thread, the OS will then assign other processes to the other less-heavily utilized CPUs.

 

  • Like 3
  • Upvote 2

Bob Scott | President and CEO, AVSIM Inc
ATP Gulfstream II-III-IV-V

System1 (P3Dv5/v4): i9-13900KS @ 6.0GHz, water 2x360mm, ASUS Z790 Hero, 32GB GSkill 7800MHz CAS36, ASUS RTX4090
Samsung 55" JS8500 4K TV@30Hz,
3x 2TB WD SN850X 1x 4TB Crucial P3 M.2 NVME SSD, EVGA 1600T2 PSU, 1.2Gbps internet
Fiber link to Yamaha RX-V467 Home Theater Receiver, Polk/Klipsch 6" bookshelf speakers, Polk 12" subwoofer, 12.9" iPad Pro
PFC yoke/throttle quad/pedals with custom Hall sensor retrofit, Thermaltake View 71 case, Stream Deck XL button box

Sys2 (MSFS/XPlane): i9-10900K @ 5.1GHz, 32GB 3600/15, nVidia RTX4090FE, Alienware AW3821DW 38" 21:9 GSync, EVGA 1000P2
Thrustmaster TCA Boeing Yoke, TCA Airbus Sidestick, 2x TCA Airbus Throttle quads, PFC Cirrus Pedals, Coolermaster HAF932 case

Portable Sys3 (P3Dv4/FSX/DCS): i9-9900K @ 5.0 Ghz, Noctua NH-D15, 32GB 3200/16, EVGA RTX3090, Dell S2417DG 24" GSync
Corsair RM850x PSU, TM TCA Officer Pack, Saitek combat pedals, TM Warthog HOTAS, Coolermaster HAF XB case

Share this post


Link to post
2 minutes ago, w6kd said:

In this case, P3D's main thread will place a heavy load on LP 0, and no load on its paired LP 1.  The OS sees LP 1 as a good target to assign threads because it has no load.  So it puts threads from other processes on LP 1, which shares the processing unit on CPU 0 with LP 0.

Bob, that assumes that the Windows scheduler isn't aware of Hyperthreaded CPUs. It most certainly is, and has been since XP.

Cheers

  • Like 1
  • Upvote 1

Luke Kolin

I make simFDR, the most advanced flight data recorder for FSX, Prepar3D and X-Plane.

Share this post


Link to post
5 minutes ago, Luke said:

Bob, that assumes that the Windows scheduler isn't aware of Hyperthreaded CPUs. It most certainly is, and has been since XP.

Cheers

And yet observation of LP 1 when running P3D on an HT-enabled CPU with an AM restricting P3D to a single LP per core does reveal that LP 1 is being tasked by the OS.


Bob Scott | President and CEO, AVSIM Inc
ATP Gulfstream II-III-IV-V

System1 (P3Dv5/v4): i9-13900KS @ 6.0GHz, water 2x360mm, ASUS Z790 Hero, 32GB GSkill 7800MHz CAS36, ASUS RTX4090
Samsung 55" JS8500 4K TV@30Hz,
3x 2TB WD SN850X 1x 4TB Crucial P3 M.2 NVME SSD, EVGA 1600T2 PSU, 1.2Gbps internet
Fiber link to Yamaha RX-V467 Home Theater Receiver, Polk/Klipsch 6" bookshelf speakers, Polk 12" subwoofer, 12.9" iPad Pro
PFC yoke/throttle quad/pedals with custom Hall sensor retrofit, Thermaltake View 71 case, Stream Deck XL button box

Sys2 (MSFS/XPlane): i9-10900K @ 5.1GHz, 32GB 3600/15, nVidia RTX4090FE, Alienware AW3821DW 38" 21:9 GSync, EVGA 1000P2
Thrustmaster TCA Boeing Yoke, TCA Airbus Sidestick, 2x TCA Airbus Throttle quads, PFC Cirrus Pedals, Coolermaster HAF932 case

Portable Sys3 (P3Dv4/FSX/DCS): i9-9900K @ 5.0 Ghz, Noctua NH-D15, 32GB 3200/16, EVGA RTX3090, Dell S2417DG 24" GSync
Corsair RM850x PSU, TM TCA Officer Pack, Saitek combat pedals, TM Warthog HOTAS, Coolermaster HAF XB case

Share this post


Link to post

Same here, as for every version since FSX, best results on my rig are with an AM basically "turning off" HT. 

  • Upvote 1

Greetings, Chris

Intel i5-13600K, 2x16GB 3200MHz CL14 RAM, MSI RTX 4080 Gaming X, Windows 11 Home, MSFS

Share this post


Link to post
38 minutes ago, w6kd said:

And yet observation of LP 1 when running P3D on an HT-enabled CPU with an AM restricting P3D to a single LP per core does reveal that LP 1 is being tasked by the OS.

I think both can be true at the same time. 🙂

I'd be curious as to what processes were being scheduled and for how long. I'm not convinced that core contention or cache thrashing causes latency great enough to visible by the naked eye. I suspect manually changing the core affinity is either doing just enough to not trigger a specific race condition, or it's indirectly preventing said condition from happening.

Cheers!


Luke Kolin

I make simFDR, the most advanced flight data recorder for FSX, Prepar3D and X-Plane.

Share this post


Link to post

What is noticeable in the video is the P3D5 Task Scheduler can easily bloat many cores on the left video at 100% for a certain amount of time, whereas on the right video, it seems to balance things out more evenly. It looks looks like it is non-HT aware and wrongly assigns tasks competing for the same resource on the same core which is mutually blocking both LP0 and LP1 at the same time.

I've never looked at whether P3D is using mainstream Microsoft CCRT, Intel TBB or their own task scheduler, but this video makes me wondering.

  • Like 1

Jean-Luc | reality-xp.com
This message from Reality XP is protected by a disclaimer: reality-xp.com/aboutrealityxp/email.html

Let your voice be heard and help us make a difference for you: Vote !
Open up communications with Reality-XP (Microsoft Flight Simulator Forums)

Share this post


Link to post

I noticed in the video, that with „HT off“ the GPU load is way higher than with „HT on“. So maybe P3D is shifting more load to the GPU when it has less CPU threads available, and the GPU handles this load actually better than the CPU?!


Regards

Oliver Holstein

Boeing777_Banner_Pilot.jpg

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