Jump to content

Sign in to follow this  
ComSimPilot

P3Dv5 CPU utilizes all cores - an observation

Recommended Posts

Posted (edited)

Hi all,

I have recently upgraded from the 7700K to the 10900K and I would like to share this observation. For years we have been complaining that FSX/P3D do not utilize all CPU threads. This image below proves that P3Dv5 is using all cores a very positive sign that of how much P3D has evolved since its first iteration.

Sjylugh.png

Edited by ComSimPilot
  • Like 1

Simulators: MSFS 2020 Premium Deluxe | Prepar3D v5 Academic | X-Plane 11 | DCS  World  Open Beta
PC Hardware: Dell U3417W Intel i9 10900K | msi RTX 2080 Ti  Gaming X Trio msi MPG Z490 Gaming Edge Wifi | G.Skill 32GB 3600Mhz CL16 | Samsung 970 EVO Plus/860 EVO/850 EVO x 1TB, Western Digital Black Caviar Black x 6 TB Corsair RM1000i Corsair H115i Platinum Fractal Design Define S2 Gunmetal |
Controls: Fulcrum One Yoke Virpil VPC WarBRD Base Virpil VPC MongoosT-50CM Grip, Thrustmaster Warthog/F/A-18C Grip Thrustmaster TPR Rudder Pedals TrackIR 5Monsterteck Desk Mounts |
My fleet catalog: Link                                                                                                                                                       

Share this post


Link to post
Posted (edited)

It did in P3D v4 also. Just sayin'.
(Ryzen 1700X and now Ryzen 3700X user). 😊
 

Edited by F737NG
  • Like 2

Ryzen 3700X 4.4GHz(PBO) / Gigabyte AB350 Gaming 3 / ASUS GTX 1070 O8G / 32GB Corsair Vengeance 3200 MHz / triple monitor

P3Dv5 HF1 + FS Global Ultimate NG + ORBX + ASP3D (beta) + ChasePlane + WIN 10 Pro
QW 757 787 / AS A32x A330 / MJC Dash 8 / A2A PA-28 / Carenado XL560 / PMDG 737 777 / FT E-Jets v2 / JF C152 / PA A380

Share this post


Link to post

FSX is the same. With HT enabled you can see that both Logical Processors (LP) of core zero are nearly maxed therefore the main rendering thread is sharing bandwidth of core zero with the second thread. With FSX and P3D we need to see only the first LP utilised. We use an Affinity Mask to do that, there's lots of info around the site regarding this problem.

  • Upvote 2

Steve Waite: Engineer at codelegend.com

Share this post


Link to post
2 minutes ago, SteveW said:

FSX is the same. With HT enabled you can see that both Logical Processors (LP) of core zero are nearly maxed therefore the main rendering thread is sharing bandwidth of core zero with the second thread. With FSX and P3D we need to see only the first LP utilised. We use an Affinity Mask to do that, there's lots of info around the site regarding this problem.

Steve thanks for the reply. Trying to understand your comment, you mean that the first LP is not fully utilized? As I see it my processor is utilized more than 90% which is a good sign, isn't it?  Would you suggest a specific AM for the 10900K. Currently I run with no set AM in the .cfg file. 


Simulators: MSFS 2020 Premium Deluxe | Prepar3D v5 Academic | X-Plane 11 | DCS  World  Open Beta
PC Hardware: Dell U3417W Intel i9 10900K | msi RTX 2080 Ti  Gaming X Trio msi MPG Z490 Gaming Edge Wifi | G.Skill 32GB 3600Mhz CL16 | Samsung 970 EVO Plus/860 EVO/850 EVO x 1TB, Western Digital Black Caviar Black x 6 TB Corsair RM1000i Corsair H115i Platinum Fractal Design Define S2 Gunmetal |
Controls: Fulcrum One Yoke Virpil VPC WarBRD Base Virpil VPC MongoosT-50CM Grip, Thrustmaster Warthog/F/A-18C Grip Thrustmaster TPR Rudder Pedals TrackIR 5Monsterteck Desk Mounts |
My fleet catalog: Link                                                                                                                                                       

Share this post


Link to post
Posted (edited)

No. I am saying the first two LPs of HT core 0, the two top leftmost graphs, are both nearly fully utilised. That means they are each getting only 50% of the possible throughput. So what we do is use an AM with an "01" for each HT core so that these tasks gain up to 100% of core bandwidth because they are not shared.

We could turn HT off and by that we would enable only one LP per core, so that we are avoiding the sharing of the core.

Rather than disable HT we can use the AM to enable only one LP per core.

with HT disabled we get ten cores 1111111111

and with HT enabled we get 20 LPs 01,01,01,01,01,01,01,01,01,01

So we could use an AM = 349525 instead of disabling HT and we are using ten cores.

With the ten core CPU we get 20 LPs with HT enabled, two per core. It is still only ten cores. Even so we might only want to use 8 cores and leave two cores for the system (4 LPs). SO giving an example AM of 00,00,01,01,01,01,01,01,01,01. See that each pair, separated by commas, belong to one core.

So we are using 8 cores (8 LPs) for P3D and leaving two cores (4 LPs) for the system. Remember that the "01" on the far right represents the two top graphs on the left. We can copy and paste that list of 01's into the binary field of Windows calculator set to programmer mode and we get the decimal value 21845 So we can use an AM of 21845 for the ten core CPU and get good performance

Edited by SteveW
  • Like 1
  • Upvote 2

Steve Waite: Engineer at codelegend.com

Share this post


Link to post
Posted (edited)

But you are quite right to point out that P3D will use every Logical processor it finds.

With Hyperthreading (HT) disabled P3D will find all ten cores since there is only one LP per core and will make a task on each LP. However, when HT is enabled there are 2 LPs per core and we see P3D filling all 20 LPs with 20 tasks, that's still the ten cores we started with each core shared between two tasks. With a movie converter we probably want all 20 LPs. But with P3D (and FSX) we have one task that renders the screen, the remaining tasks pull in the data.

We want to be sure that the main rendering task get's 100% of the core. So that by applying the AM in HT mode we can enable only the first LP with that leftmost two graphs  the rightmost  "01" in the binary AM without switching off HT.

We also see an overhead on the CPU for each task set up so we don't necessarily want too many tasks, because after a certain point, no matter how many tasks, we can't pull in data any faster, the system is saturated at some point. Again with HT disabled we half the task count, or leaving HT enabled we restrict the task count with the AM.

Edited by SteveW

Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Well, this whole discussion has me scratching my head.  The pic posted by the OP shows no activity on LPs 1, 12, and 15, which is odd with no AM unless the OP is using per-core hyperthreading on the 10900K to disable HT on physical cores 0, 6, and 7.

And Steve...I'm having a hard time connecting the poster's original thesis with your posts here...you talk about a "problem", but the OP is saying the opposite--that the software is finally using all the LPs (though it isn't in this case).

One question comes to mind as I try to make sense of this...if you do use per-core HT, I wonder what the affinity mask looks like (e.g. if HT is disabled on cores 0 and 1, and enabled on the other 8, does the affinity mask reflect an 18 LP processor?

 


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 2080Ti XC Ultra, Samsung 55" JS8500 4K TV@30Hz, 5xSamsung SSD, eVGA 1KW PSU, 1Gbps internet

SB XFi Titanium, optical link to Yamaha RX-V467, 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

In the image the top leftmost two graphs are nearly maxed, that's two LPs of one core shared, maybe look again.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

...double checked and sure enough LP0 is almost maxed (top left), and LP1 (Just right of top left) is fully maxed. Both those LPs are getting around 50% of the core throughput.

Disabling HT would allow only one task per core. Using the AM method of "01" for each core allows only one Task per core.

The overall CPU throughput is also showing around 94% because most of the 20 LPs are all maxed.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post
10 minutes ago, w6kd said:

if you do use per-core HT, I wonder what the affinity mask looks like (e.g. if HT is disabled on cores 0 and 1, and enabled on the other 8, does the affinity mask reflect an 18 LP processor?

First of all, always use LP0 (or call it core zero if you like, HT disabled). generally HT on or off is across the whole CPU. However with HT disabled on 0 and 1 and the remaining all HT enabled, then the CPU looks like an 18 core CPU. and you would use an AM 01,01,01,01,01,01,01,01,1,1, the two rightmost ones representing cores 0 and 1. Always use the comma or dot delimited nomenclature when using or mixing in HT.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post
Posted (edited)

...in technical discussions it's also more professional and less disconcerting to avoid the terms "scratching of head", "having a hard time" and so on as are not necessary and put off those trying to learn something. 

Edited by SteveW

Steve Waite: Engineer at codelegend.com

Share this post


Link to post
Posted (edited)

Going back to the example of converting a video stream, the program can render a frame on each LP. With HT enabled the program can render two frames at once on one core. Even so  those two frames are rendered at half speed because the core is shared. Even so, because the HT mode saves time swapping the context (that is, saving and loading registers of each thread for it's share of the core time, or time-slice) that time is shorter.

Similarly we can use that gain in performance with some of the tasks in P3D (and FSX) by allowing two tasks per core, one on each LP. We can see that P3D (and FSX) do that with every task. We avoid sharing the first task with another task on the first core (core zero) by disabling HT or using "01".

However, with many cored CPUs (such as the ten core) we easily gain the maximum draw on scenery from the system without using all ten cores. With lesser cores we might gain a small amount of performance pulling in the scenery data with two per core.

A test can be made by measuring how quickly the system can get to the first render of the simulator screen. We can use a stopwatch and compare as we add cores or LPs to the AM. We see that the time taken reduces as we add cores. At some point that time decrease becomes very short, we have reached the maximum pull on the data. However we still continue to see small gains as each LP added enabled the data to be assembled more quickly. Since these tasks are not time sensitive like the main rendering task, we can see that enabling pairs of HT LPs continue to reduce the time taken to get to the start of the simulation. However, as I mentioned, too many tasks becomes a burden on the system overall and contributes to poorer performance in the main rendering task.

Edited by SteveW

Steve Waite: Engineer at codelegend.com

Share this post


Link to post
16 minutes ago, SteveW said:

...double checked and sure enough LP0 is almost maxed (top left), and LP1 (Just right of top left) is fully maxed. Both those LPs are getting around 50% of the core throughput.

Disabling HT would allow only one task per core. Using the AM method of "01" for each core allows only one Task per core.

The overall CPU throughput is also showing around 94% because most of the 20 LPs are all maxed.

OK, the 94% overall CPU load supports that.  The graphs show the same heavy line at 0 and 100%, and I find it rare that a core would be firewalled at 100% without even a momentary dip.

7 minutes ago, SteveW said:

...in technical discussions it's also more professional and less disconcerting to avoid the terms "scratching of head", "having a hard time" and so on as are not necessary and put of those trying to learn something. 

I consider the terms quite appropriate to impart a sense of confusion about what was being said.  Maybe it's a US vs British language thing.  If anyone is truly so weak-kneed that "I'm scratching my head" (in America, a colloquialism for "this has me confused") makes them run away and hide, well, so be it. 


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 2080Ti XC Ultra, Samsung 55" JS8500 4K TV@30Hz, 5xSamsung SSD, eVGA 1KW PSU, 1Gbps internet

SB XFi Titanium, optical link to Yamaha RX-V467, 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
Posted (edited)
3 minutes ago, w6kd said:

I consider the terms quite appropriate to impart a sense of confusion about what was being said.  Maybe it's a US vs British language thing.  If anyone is truly so weak-kneed that "I'm scratching my head" (in America, a colloquialism for "this has me confused") makes them run away and hide, well, so be it. 

That is often referred to as supercilious - it  only serves to make your post appear to be saying that anther is wrong. But they were not.

 

Edited by SteveW

Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Let's look at how a single core handles two identical threads:

SwitchingImproves.jpg

On the right the core is HT disabled - no Hyperthreading, each thread (one orange and one purple) gets a time slice and between each slice the CPU has to save the situation to be loaded later.

Now in a simple way of showing it, on the left is the same core with HT enabled, and with the same two threads arranged so that each thread occupies an LP to itself. The two threads are still time sliced, since there is only one core. But these two threads finish sooner with HT enabled because their context is saved.


Steve Waite: Engineer at codelegend.com

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.


    31%
    $7,835.00 of $25,000.00 Donate Now
×
×
  • Create New...