Jump to content

Sign in to follow this  
Sethos

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

Recommended Posts

Posted (edited)

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

8700K Delid @ 5GHz | G.Skill 32GB DDR4 @ 3600MHz | MSI 1080 Ti Sea Hawk X | Windows 10 Pro (2004) | Monitors: LG 27UK650 / Acer XB270HU

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
MSI Z490 WiFi MOB;  i7 10700k Comet Lake 3.8 Ghz CPU; Ripjaws 32 gb DDR4 3600; ASUS GTX 1070 TI Turbo 8GB; MasterCase H500M; Corsair H100i Pro cooler; Corsair RMX850X PSU; ASUS VG289 4K 27"; Honeycomb Alpha Yoke A+.  Former USAF meteorologist & ground weather school instructor; AOPA Member #07379126 
                        There is no limit to what a man can do or where he can go if he doesn’t mind who gets the credit! - Benjamin Jowett

 

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.


8700K Delid @ 5GHz | G.Skill 32GB DDR4 @ 3600MHz | MSI 1080 Ti Sea Hawk X | Windows 10 Pro (2004) | Monitors: LG 27UK650 / Acer XB270HU

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
MSI Z490 WiFi MOB;  i7 10700k Comet Lake 3.8 Ghz CPU; Ripjaws 32 gb DDR4 3600; ASUS GTX 1070 TI Turbo 8GB; MasterCase H500M; Corsair H100i Pro cooler; Corsair RMX850X PSU; ASUS VG289 4K 27"; Honeycomb Alpha Yoke A+.  Former USAF meteorologist & ground weather school instructor; AOPA Member #07379126 
                        There is no limit to what a man can do or where he can go if he doesn’t mind who gets the credit! - Benjamin Jowett

 

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 | AVSIM Forums Administrator | AVSIM Board of Directors
ATP Gulfstream II-III-IV-V

System: i9-10900K @ 5.2GHz on custom water loop, ASUS Maximus XII Hero, 32GB GSkill 3600MHz CAS15, EVGA RTX3090 XC3 Ultra
Samsung 55" JS8500 4K TV@30Hz,
3x NVME 2x SATA Samsung SSD, EVGA 1KW PSU, 1Gbps internet
SoundBlaster XFi Titanium, TOSLINK to Yamaha RX-V467 HT Rcvr, Polk/Klipsch 6" bookshelf spkrs, Polk 12" subwoofer, 12.9" iPad Pro
PFC yoke/throttle quad/pedals with custom Hall sensors, Coolermaster HAF932 case, Stream Deck XL button box

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 | AVSIM Forums Administrator | AVSIM Board of Directors
ATP Gulfstream II-III-IV-V

System: i9-10900K @ 5.2GHz on custom water loop, ASUS Maximus XII Hero, 32GB GSkill 3600MHz CAS15, EVGA RTX3090 XC3 Ultra
Samsung 55" JS8500 4K TV@30Hz,
3x NVME 2x SATA Samsung SSD, EVGA 1KW PSU, 1Gbps internet
SoundBlaster XFi Titanium, TOSLINK to Yamaha RX-V467 HT Rcvr, Polk/Klipsch 6" bookshelf spkrs, Polk 12" subwoofer, 12.9" iPad Pro
PFC yoke/throttle quad/pedals with custom Hall sensors, Coolermaster HAF932 case, Stream Deck XL button box

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 i7-8700K@5.0GHz, 2x16GB 3200MHz CL14 RAM, Gigabyte AORUS 1080Ti, Windows 10 Home 64bit, Prepar3D 4.5

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

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.
  • Donation Goals

    AVSIM's 2020 Fundraising Goal

    Donate to our annual general fundraising goal. This donation keeps our doors open and providing you service 24 x 7 x 365. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. We reset this goal every new year for the following year's goal.


    34%
    $8,660.00 of $25,000.00 Donate Now
×
×
  • Create New...