Jump to content
Sign in to follow this  
AviatorMoser

A Frame-Time Analysis of P3D v3 -- Effects of CPU Affinity, Frame Lock, and HT

Recommended Posts

Here still 3392 for my 6-core 5820.

All cores are working nicely...


13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post

Today I changed my AM from 85 to 14 and turned off hyperthreading. What a pleasant surprise. Got a 4-6 fps boost. I am running a 4770k @4.4ghz paired with a 970.

85=(01,01,01,01) 4 cores used by the sim, and 14=(1110) 3 cores used by the sim avoid core 0. Since the ultimate fps is determined by the first thread, this looks like the improvement is merely through avoiding core zero, which probably has something running on it. HT enabled and 84=(01,01,01,00) would be the HT equivalent, but it won't improve fps, maybe smoothness.

 

 

Here still 3392 for my 6-core 5820.

All cores are working nicely...

3392=(11,01,01,00,00,00) which is also 3 cores used, but this time for 4 threads. Seems three cores are OK. Four core CPU owners can take a sigh of relief.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Today I changed my AM from 85 to 14 and turned off hyperthreading. What a pleasant surprise. Got a 4-6 fps boost. I am running a 4770k @4.4ghz paired with a 970.

I've been running this for a while.

 

I have the exact same box as you as well as the same OC.

 

Runs perfect.

Share this post


Link to post

you can't hurt anything by trying. Key to HT is so long as you got HT enabled you want a core to look like your 94% 0% pair in column 2 from the left on your graphic, was perfect. Maybe the problem is with the rest of your AM. So to allocate the whole CPU with maximum threads is AM=4094=(11,11,11,11,11,10) or 4093=(11,11,11,11,11,01). No AM=(11,11,11,11,11,11) so you can see the theme from your CPU monitor.

Ok tried 4094 and this is what I got,,,not sure if this is good for my cpu as some cores were running over 68c. This was in the air  as shown in my screenshot.

 

cpu_zps44w7ayix.jpg


Paul Grubich 2017 - Professional texture artist painting virtual aircraft I love.
Be sure to check out my aged cockpits for the A2A B-377, B-17 and Connie at Flightsim.com and Avsim library

i-5vbvgq6-S.png

Share this post


Link to post

100% usage on so many cores, Paul. Can anyone comment if that is normal behavior, because I usually see 100% usage on just the one rendering core.

Share this post


Link to post

Generally that's what we get, one LP running hard the rest "feeding" it. Paul's looks OK, the first core has LP1 occupied with LP0 pretty slack leaving core 0 full throughput to the renderer. However there's lots of threads pulling down performance slightly by stopping the main thread more often and increasing memory load. Improvements can come with the 6 core with HT enabled I am using AM=340. Depending on scenery and addons, AM=340=(00,01,01,01,01,00) gives four cores to four sim threads and leaves core 0 and 5 free to attract other processes, this gives the highest framerate and least dropouts on my system. Doubling up data collecting threads with AM's like 980=(00,11,11,01,01,00) makes more use of some cores perhaps with less intense scenery but can reduce overall performance by interrupting the main thread more often. I would go for an AM like 340 on a 6 core CPU and maybe with only four core CPU go for AM=212=(11,01,01,00) or AM=244(11,11,01,00) but these give very similar performance. Those all leave core 0 free some addons suggest that in their manuals if these addons start before the sim. Only careful testing can deduce the best one with the setup and addons. I'm comparing graphs of average fps minus average fps delta which gives a better representation of true performance than just fps traces.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

A couple of things that get repeatedly overlooked in these threads. A frame rate limit of 30 does absolutely nil if you are not able to maintain that under most circumstances. You should start with that but if you run at 25 FPS consistently then you have zero overhead left and you are subject to spikes and precieved stuttering.  

 

 

Very True.

 

I always recommend going to the heaviest scenery area and dial the scenery in so that you can maintain 30fps, then where ever you fly it should stay smooth.


Flight Simulator's - Prepar3d V5.3/MSFS2020 | Operating System - WIN 10 | Main Board - GIGABYTE Z390 AORUS PRO | CPU - INTEL 9700k (5.0Ghz) | RAM - VIPER 32Gig DDR4 4000Mhz | Video Card - EVGA RTX3090 FTW3 ULTRA Monitor - DELL 38" ULTRAWIDE | Case - CORSAIR 750D FULL TOWER | CPU Cooling - CORSAIR H150i Elite Push/Pull | Power Supply - EVGA 1000 G+ 

Share this post


Link to post

100% usage on so many cores, Paul. Can anyone comment if that is normal behavior, because I usually see 100% usage on just the one rendering core.

If P3D is anything like FSX in this regard all the assigned cores will peak for a while every 61 seconds as the lighting of the textures is refreshed. If you use a fast CPU with many cores the peak will be over quickly. If you have a slow CPU with say only 2 cores assigned (the main thread +one texture loader) with the affinitymask the peak will last longer.

 

Another way you might get a high load on all the assigned cores is if you set the FFTF too low. Then the texture loaders sometimes stall at 100% load as they don't get enough time to sync with the main thread.

Share this post


Link to post

SteveW I tried your suggested 340 and this is the result.

 

b45_zpsdjoogwho.jpg


Paul Grubich 2017 - Professional texture artist painting virtual aircraft I love.
Be sure to check out my aged cockpits for the A2A B-377, B-17 and Connie at Flightsim.com and Avsim library

i-5vbvgq6-S.png

Share this post


Link to post

Looks good Paul.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Not all CPU load is 'good' CPU load and the lack of CPU load isn't necessary a bad thing when it comes to hyperthreaded CPUs. Steve has made a lot of good points.

 

One misconception is that when you have hyperthreading on, because task manager shows the CPU load in % as lower, less work is done by the CPU. If hyperthreading on a quad core is off and we have 4 threads runnig at full speed, one on every core, it would show as 100% load in task manager. If we turn on hyperthreading and still have the same 4 threads running, one on each physical core, the exact same work is performed by the CPU, even though task manager now shows only 50% load. If we now were able to double the number of threads to 9, working on the same job as before, task manager would show 100%, but we wouldn't get twice as much work done. Probably only around 20% more work would probanly be done in the same timeframe actually.

 

I wonder if anyone has used Process explorer to actually see what threads are created by P3D? And more to the point, what kind of load are they creating on the system?

 

FSX has the main thread (the first core assigned by the affinity mask) that should load up a core fully. At the times when it doesn't run at a full core load its not the CPU being the bottleneck any more. This thread should have its own PHYSICAL processor core alone just as Steve has been saying. If it has to share that physical processor core with anything else the performance of the sim is suffering.

 

The other cores that are assigned by the affinitymask are responsible for loading ground textures, the terrain model and autogen. They are already designed to run separately from the main thread. If two are sharing one physical core with hyperthreading, together they will perform more work in a set time frame then one single thread alone on the same physical core would be able to do in the same time frame.

 

On top of this, FSX has 3 other threads that produce any significant CPU load. One de-bug thread, one sound thread and one thread that is loading most data from the hard drive. This can all be seen in process explorer. These 3 threads are not controlled by the affinitymask setting and are run on either core the OS seem fit. The de-bug and data loading thread are assigned a prefered affinity at game startup, whilst the sound affinity changes every time you select any other window in windows. We don't want these threads to end up on the same physical core as the main thread.

 

The data loading thread can be very bursty in its load. In certain scenery it will load up a full core frequently, in other scenery it will stay at a low core load all the time.

 

Do you run any addons that also create a lot of CPU load at times? If there's no vacant core for the OS to schedule it on, it has a high chance if getting put on the same physical core as the main thread.

 

That's why different affinitymasks work better with different systems.

 

Does P3D alone have any more threads created that cause a significant CPU load? LM have re-written a lot of code I believe. Are these potential threads assigned with the affinity mask?

 

The best thing is to know your own setup. Process explorer will give you many answers.

 

Personally I know when I fly around my MSE photo scenery in my Harrier I can happily use affinitymask 4089 on my hyperthreaded 6core CPU. If I head over to the UK and the Horizon photo scenery with added airports and autogen, the load on the data loading thread becomes way too high for that affinitymask and 4084 works better.

 

If I had other add-on that frequently caused a high CPU load I'd consider a different affinitymask that left more cores unassigned.

Share this post


Link to post

I wonder if anyone has used Process explorer to actually see what threads are created by P3D? And more to the point, what kind of load are they creating on the system?

The best thing is to know your own setup. Process explorer will give you many answers....

 

 

Process explorer, might work, but don't try Procmon...Flight1 cripples P3d if you have Procmon running. It's the THEMIDA intrusion DETECTION... which shuts down Prepared3-D if you have their GTN 750 installed.

 

The only workaround is to uninstall the GTN 750 and then run for Procmon. When you are you done with your diagnostics, you will have to reinstall the GTN 750.

 

Chas


My first sim flight simulator pD25zEJ.jpg

 

Take a ride to Stinking Creek! http://youtu.be/YP3fxFqkBXg Win10 Pro, GeForce GTX 1080TI/Rizen5 5600x  OCd,32 GB RAM,3x1920 x 1080, 60Hz , 27" Dell TouchScreen,TM HOTAS Warthog,TrackIR5,Saitek Combat Rudder Pedals HP reverbG2,Quest2

Share this post


Link to post
Thanks for this excellent info and methodology. I have tested it intensively the last days on my set-up (P3D V2.5, 4770K @4.4 GHz, GTX780, single beamer), using a standard flight with the default Beech B55, and a demanding scenery: AS Zurich V2, FTX global/vector/open LC, REX4 texture direct/SC, and FS Global Real Weather.
With that set-up I can basicly confirm the main conclusion regarding the factors contributing to a more smooth behaviour: frame limiter locked rather than unlocked, HT OFF rather than ON, all four cores in use rather than three. Regarding the core usage I use EasyToolZ rather than setting AF in the cfg. You can change the core usage on-the-fly, and I have the subjective feeling it delivers smoother results than setting AF.
 
However there is one feature which I cannot get rid-off, whatever the setting I apply. It’s the long spikes (vertixes?) of around 120 to 140 ms frame rendering time, occurring at an almost constant interval of around 10s. See attached screenshot, which is typical for this feature. Obviously you also note them when flying.
 
I played around with FFTF, scenery densities, LOD, core usage. The pattern of the pikes always stays, they may change in magnitude (but never really fall below 120ms), or be ‘complemented’ by additional spikes, but I do not succeed to remove them. Does some has any suggestion what I could further do ? One parameter I have not tested yet is CPU speed, but would it significantly change when going from 4.4 GHz to let’s say 4.6 GHz ?
 
Bild1.png?dl=0
 
Regards

With respect to my post above. Picture is hopefully working now ....

 

https://www.dropbox.com/s/wfkej8m9qej65z2/Spikes.JPG?dl=0

Share this post


Link to post

The jpg below shows a range of masks applied to the exact same 2minute scenario, no randoms, on a 6 core HT enabled, with Unlimited fps set. The scene is coming in low above the sea, crossing the shore, and ending over dense urban. Using complex weather with clouds gusts and wobbles all in the same places. The scenery levels are mid to high, and I've ensured that the settings are not plateauing performance. AA at 2xMSAA, default NI.

 

Pay attention to the light blue line, represents "fps - Delta (Av)", equates to the average fps less the average fps Delta (change in fps). The Affinity Masks of 980, 340, and 212, all give the better value light blue line, the others all lose out due to fps delta. All show raw fps performance to be close because the main sim thread, in each case, has a core unencumbered by other processes.

 

AMTESTS_12LP_P3DV3.jpg

 

AM=12 is interesting how fps performance holds even though it hosts the first two sim threads. In the cases above the sim is running on a turbo enabled Intel CPU, it's not an overclocked PC. This CPU performance rises to meet demand. The graphs in Task Manager can show 100% but the core may only be at 80-90%.


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.
×
×
  • Create New...