Skip to content
View in the app

A better way to browse. Learn more.

The AVSIM Community

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

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

Featured Replies

 

 


Nice system. Why not run it efficiently with the best performance?

 

I've followed all your suggestions (and that was after I tried experimenting on my own, when I first got P3d 2.x). I discovered one benefit. There is a very imperceptible improvement in "smoothness" with ASN on its own physical core and P3d blocked from using that core. But otherwise, frame times are fairly evenly distributed, not matter what combination of settings that I have used. And believe me, it doesn't take "days" with 12 physical cores and 24 logical cores. It does take weeks. And after awhile one realizes that it's only an intellectual exercise.

  • Replies 596
  • Views 171.1k
  • Created
  • Last Reply
  • Commercial Member

And after awhile one realizes that it's only an intellectual exercise.

Hardly. I've found upward of 5% performance improvements getting the AM right, and I'm not talking about fps. I keep repeating you won't change that. What you change is the way stuff runs concurrently. You may see the weather installed quicker overall but notice some snatches, yet be entirely unaware of the performance benefit. You're wasting everyone's time coming onto this thread and trashing the idea of the AM and HT if you're just not interested in it.

Steve Waite: Engineer at codelegend.com

  • Commercial Member

Remember the AM can only reduce the available processors. But then there's many four core systems using three cores to perfectly good effect. Why the 8 and 12 core big shots can't get good results from that is probably freudian. From much research, a 4GHz CPU need only provide 4 jobs to the sim, 5 jobs slows it down (NOT fps), so if you've got a 6 core or more, mask it.

Steve Waite: Engineer at codelegend.com

Okay Steve, we get the message. Perhaps this topic has now run its course and we should all move on before the discussion degrades any further and we start to fall out. Whether our impressions are subjective or not, in the end, does it really matter? If what we see is pleasing and truly conveys the feeling of flight, however it is come by, then we have achieved our personal goal with P3D. I can't speak for Jay but my mind remains open on this one. I have no doubt that I will continue to experiment as I've always been curious by nature.

 

Meantime, thank you for remaining so patient in the face of what must have seemed at times to be unreasonable stubbornness. However, we can only report what we see despite it appearing to fly in the face of accepted and proven logic.

 

Regards,

Mike

  • Commercial Member

Face it, if three cores work for the four corers, then why not for the 6, 8, or 12? Because it does. Your descriptions of stutters and stuff like that is some other problem, nothing to do with AMs or HT. If it doesn't work for you or Jay, it's not changing anything, eggs are eggs.

Steve Waite: Engineer at codelegend.com

Steve, I for one find your comments here very helpful and illuminating, in fact I had to go back and re-read the entire thread last night because I found there were nuggets of info posted in Oct/Nov last year that I read at the time but honestly don't think that I understood then.  It is seeming to become clearer now so thank you for your patience with us!  Cheers K

Kevin Firth - AMD 9800X3D; Asus Prime X670E; 64Gb Cas30 6000 DDR5; RTX5090; AutoFPS

  • Commercial Member

Thanks Kevin! All comments appreciated. I don't mind keeping the thought process going.

 

In a nutshell getting the right number of cores for a system is good only for background processing, and does nothing really much for fps. In order to test that, an fps trace can be assessed for "irregularity". We can get a higher fps at the expense of background regularity too, so we have to be careful not to pay too much attention to outright fps once we've set the sim up for required detail.

 

In the background, how fast is it building Autogen or setting up weather? How is that affected? During the tests I'm watching the same scene unfold over and over. I got a feeling that those things were running pretty well when the sim was running smoother, didn't seem cause for concern on typical hardware.

 

In tests I made with a 6 core 4GHz and a raft of usual addons, and in stock trim too, I saw generally a gain of a little over 5% stability going from 3 cores to 4, and I lose that stability going from 4 to 5 cores. Then not much changes after that, it's a sweet spot worth having.

 

Keep in mind that maybe a faster CPU and more intense scenery, could possibly use 5 or even 6 cores more efficiently. But the sim was built during the rise of the dual core and simply may not have anything left in it worth pursuing after 4 cores.

 

Going forward as we get CPUs with more cores, we can use them instead for running other stuff away from the cores devoted to the sim. I've shown in other posts that the Windows jobscheduler is pretty savvy and will keep other jobs away if there is free bandwidth elsewhere. But hopefully we'll get new sims that take care of the problems automatically.

 

The 4 core guys get pretty good performance on 3 cores, and I've shown that going to HT On and carefully utilising 4 LPs of those 3 cores can be a couple of % more stable than HT Off which is what Intel would have expected.

 

Problems come with interacting addons utilising HT cores in the same way we get the sim to avoid. Going between HT On or Off didn't produce stutter. Although I could force some processing onto the core with the main sim thread and cause sawtoothing of that thread HT On or Off, but the GPU could increase the fps slightly during these times. The sim knocks out frames irrespective of how much the background jobs have completed.

 

Jay's right when he says there's little to add in terms of performance, in the scheme of it there is only 5% plus or minus. We shouldn't write it off, because we're in this discussion to find out how to tune the CPU. Many cored CPU's will be cooler anyway, tuned with the least work necessary to do the job well enough.

Steve Waite: Engineer at codelegend.com

  • Commercial Member

We can start apps with an Affinity Mask with the Windows batch system. We first right-click in expolorer where we want to create a new batch file and choose New Text File. This makes a new file with .txt extension.

 

I will use a fictitious weather program called FSWeather.exe found in the folder "C:\Program Files (x86)\FSWeather".

 

Rename it FSWeather.bat

Choose Edit and type in the command lines:

 

CD\
CD "C:\Program Files (x86)\FSWeather"
C:\Windows\System32\cmd.exe /C start /affinity F8 FSWeather.exe
F8=248=(11,11,10,00)=3,4,5,6,7

 

With HT enabled on a 4 core CPU we have 8 Logical Processors. We can use an affinity mask in the FS JOBSCHEDULER section AffinityMask=85=(01,01,01,01)=0,2,4,6

 

We can make a shortcut to the bat file to place on the desktop or wherever, or we can simply double-click the batch file.

 

On a 4 core HT enabled system, we get good performance starting our weather engine away from core zero and use all four cores for the simulator.

 

 

Note: We change directory in the .bat, because the start processor cannot resolve "C:\Program Files (x86)\FSWeather\FSWeather.exe" when there are spaces in the path. Make sure the exe name does not have spaces too.

Steve Waite: Engineer at codelegend.com

  • Commercial Member

Feedback today suggests the .bat is proving to be a pretty cool weapon in our sim toolbag!

 

 

Whether our impressions are subjective or not, in the end, does it really matter? If what we see is pleasing and truly conveys the feeling of flight, however it is come by, then we have achieved our personal goal with P3D. I can't speak for Jay but my mind remains open on this one. I have no doubt that I will continue to experiment as I've always been curious by nature.

Sorry to come back to you Mike, since from what you say, you continue to appear mistaken by concentrating on how the sim looks in operation, rather than seeming to understand the optimisation of the CPU which is the main aim of the affinity mask.

 

 

If you can imagine, we want the sim to run the least CPU for the best performance it is capable of giving, this reduces heat and increases available memory.

 

If performance can be improved along the way, and I've demonstrated it can by a little, then that's more than handy to most of us.

 

We reduce unnecessary VAS consumption and decrease the amount of heat generated with an Affinity Mask. We also use them to help apps avoid competing for core use.

 

If we get no better performance, as you keep saying, with 5 jobs over 4, then why have 5 jobs? Or more? If we don't apply an AM the sim creates as many jobs as there are processors. Of course, instead of that we optimise, like we do with any engineered system. Allowing the sim to break up into 16 jobs on a 8 core HT enabled system, or turning off HT to reduce job count to 8 to save heat and VAS, is history.

 

 

we can only report what we see despite it appearing to fly in the face of accepted and proven logic.

I don't really think you see anything that's flying in the face of accepted logic.

 

 

Hopefully I've helped overcome your frustration a bit, I'm sure the penny will drop sooner or later. If you do experiment some more, I'm sure you'll find that .bat technique I posted above is a hard won bit of know-how.

 

 

...overclockers please note that even with an optimised affinity mask, operating in HT mode will always produce more heat because there's more work being done.

Steve Waite: Engineer at codelegend.com

I tried experimenting with running an i6700k with different clock multipliers for different cores in an attempt to increase the speed of the cores that are doing most of the work in P3D and decrease the speed (and heat) of the cores that are under occupied.

 

Unfortunately my motherboard won't allow me to do this:

40(4) 49(3) 49(2) 40(1) on the multipliers with an AM of 116 and HT on, so i had to compromise with this:

40 40 49 49 with an AM of 15.

 

I then changed the affinity of P3D31 to 15 with HT on so that the sim would get 4 LP's on the overclocked cores. I then went into process explorer and changed the affinity of explorer.exe to 11110000 (inverse of AM15) and found that each application that runs after that launches automatically to 11110000 which is kind of convenient. I double checked that all CPU consuming processes were off the overclocked cores.

 

I TRIPLE CHECKED THAT I WAS NOT OVERHEATING ANY INDIVIDUAL CORE.

 

I haven't got any scientific data but subjectively I concluded it wasn't worth the trouble. It is much easier to just give a more modest overclock across all cores. It is possible that with HT turned off I could have hit the 5GHZ mark but I think one of the problems is that the heat produced by a single core doesn't dissipate away quickly enough to the cooler cores via the heat transfer over the CPU case. It isn't worth the risk.

 

WARNING: EXTREME caution needed if experimenting with this

I tried experimenting with running an i6700k with different clock multipliers for different cores in an attempt to increase the speed of the cores that are doing most of the work in P3D and decrease the speed (and heat) of the cores that are under occupied.

 

Unfortunately my motherboard won't allow me to do this:

40(4) 49(3) 49(2) 40(1) on the multipliers with an AM of 116 and HT on, so i had to compromise with this:

40 40 49 49 with an AM of 15.

 

I then changed the affinity of P3D31 to 15 with HT on so that the sim would get 4 LP's on the overclocked cores. I then went into process explorer and changed the affinity of explorer.exe to 11110000 (inverse of AM15) and found that each application that runs after that launches automatically to 11110000 which is kind of convenient. I double checked that all CPU consuming processes were off the overclocked cores.

 

I TRIPLE CHECKED THAT I WAS NOT OVERHEATING ANY INDIVIDUAL CORE.

 

I haven't got any scientific data but subjectively I concluded it wasn't worth the trouble. It is much easier to just give a more modest overclock across all cores. It is possible that with HT turned off I could have hit the 5GHZ mark but I think one of the problems is that the heat produced by a single core doesn't dissipate away quickly enough to the cooler cores via the heat transfer over the CPU case. It isn't worth the risk.

 

WARNING: EXTREME caution needed if experimenting with this

I tried similar with all cores AF/HT on/off on my i7 4790K. I found I attained the smoothest performance when overclocking @4.5. I believe LM has gotten in right with CPU utilization across all cores so AF is not necessary. My biggest grope with v3.1 is that it will not run smoothly without some form of tweaking, which I believe, defeates the intention of LM.

Good point about the CPU utilization with P3D it probably isn't worth it. P3D runs smoothy and beautifully without tweaking if you don't add anything to it because it can easily attain greater than monitor refresh frame rates on default trim. The default scenery is so ordinary that you can turn down the autogen to normal and not feel like you are missing anything and thereby getting all the benefits of a really smooth simulator. ORBX scenery and the like are really designed for FSX-SE with the 1/2 VSYNC lock it is as simple as that. P3D really need to fix the AA problem in clouds though. It really spoils all the good work that went into P3D because on FSX-SE steve fixer you can even solve that problem.

Sorry to come back to you Mike, since from what you say, you continue to appear mistaken by concentrating on how the sim looks in operation, rather than seeming to understand the optimisation of the CPU which is the main aim of the affinity mask.

 

 

Hi Steve,

 

Please, no apology is necessary; I'm just happy you have not given up on me...lol

 

I would like to reiterate that I do understand what is being discussed here and, as you are aware, I have tried applying a number of Affinity Mask values suggested by your good self. Unfortunately, and for whatever reason as yet undetermined, none have produced results which I am seeing currently under a wide range of conditions with my current setup. Yes I admit my observations are empirical without any supporting data which is making me think that I should be doing something about that...with your help.

 

Now I would be the first to acknowledge that, other than for some conservative (safe?) overclocking, my CPU is not yet optimised for P3D. :smile:  Also, I remain very keen to explore this further. After all, it does seem pretty pointless investing in all this hardware without exploiting its full potential.

 

Let me start the ball rolling.

 

I have now installed FRAPS and FRAFS so providing Frame Time charts is not a problem. The following image is the result of a short 2 minute flight out of Eglin (default scenario).The flight involved taking off over the ocean, climbing to 2000ft, 180 degree turn back to fly overland with Eglin on my right.

 

Setup: 8 core/No HT, No AM, VSync: ON, Triple buffering: Enabled, Frames: Unlimited, Monitor refresh: 120Hz (G-Sync: Disabled).  Sim settings: Medium to High. Vehicle: F22-Raptor (very frame rate friendly so may not be the best choice...or is it?). AF= 16x, MSAA= 4x, SGSSAA(NI)= 4x. ORBX FTX:Global Base and Vector, FTX:Trees HD.

 

Prepar3D%202016-01-27%2022-13-47-52-Time

 

I would welcome your comments. This is my first stab at doing this (hence choosing the P3D default scenario) so please be gentle!

 

To me the sim's performance appears very smooth - almost on a par with Rob's videos.

 

What would you like me to do next?

 

Regards,

Mike

I tried similar with all cores AF/HT on/off on my i7 4790K. I found I attained the smoothest performance when overclocking @4.5. I believe LM has gotten in right with CPU utilization across all cores so AF is not necessary. My biggest grope with v3.1 is that it will not run smoothly without some form of tweaking, which I believe, defeates the intention of LM.

 

Interesting point about smoothness. On my fairly decent system, I seemed to hit maximum FPS with a combination of an AM set with a low FFTF in the cfg file.

 

However, the best perceived combination of smoothness and terrain paging seems to be achieved with no AM or FFTF set, and with a TEXTURE_BANDWIDTH_MULT set between 90 and 120...that's it. Opening the bandwidth up seems to do wonders (if the hardware can handle the load without getting saturated); FPS aren't that far off from max. As always YMMV, but that's what I currently find on my system.

  • Commercial Member

Hi Steve,

 

Please, no apology is necessary; I'm just happy you have not given up on me...lol

 

I would like to reiterate that I do understand what is being discussed here and, as you are aware, I have tried applying a number of Affinity Mask values suggested by your good self. Unfortunately, and for whatever reason as yet undetermined, none have produced results which I am seeing currently under a wide range of conditions with my current setup. Yes I admit my observations are empirical without any supporting data which is making me think that I should be doing something about that...with your help.

 

Now I would be the first to acknowledge that, other than for some conservative (safe?) overclocking, my CPU is not yet optimised for P3D. :smile:  Also, I remain very keen to explore this further. After all, it does seem pretty pointless investing in all this hardware without exploiting its full potential.

 

Let me start the ball rolling.

 

I have now installed FRAPS and FRAFS so providing Frame Time charts is not a problem. The following image is the result of a short 2 minute flight out of Eglin (default scenario).The flight involved taking off over the ocean, climbing to 2000ft, 180 degree turn back to fly overland with Eglin on my right.

 

Setup: 8 core/No HT, No AM, VSync: ON, Triple buffering: Enabled, Frames: Unlimited, Monitor refresh: 120Hz (G-Sync: Disabled).  Sim settings: Medium to High. Vehicle: F22-Raptor (very frame rate friendly so may not be the best choice...or is it?). AF= 16x, MSAA= 4x, SGSSAA(NI)= 4x. ORBX FTX:Global Base and Vector, FTX:Trees HD.

 

Prepar3D%202016-01-27%2022-13-47-52-Time

 

I would welcome your comments. This is my first stab at doing this (hence choosing the P3D default scenario) so please be gentle!

 

To me the sim's performance appears very smooth - almost on a par with Rob's videos.

 

What would you like me to do next?

 

Regards,

Mike

What I'm saying is you won't see any difference with 8 cores or 4. With 8 jobs you have 4 jobs doing nothing other than using up VAS and generating heat.

 

Your trace of fps may be OK to use since you can see the change in fps (instability) as the trace increases in height.

 

Try HT Off and AM=240=(11110000) - should produce a slightly better graph.

 

Try HT On and AM=21760=(01,01,01,01,00,00,00,00) Should produce the same result, maybe slightly better.

 

By the way, when looking at performance you don't want vsync on, just pure unlimited, otherwise you've got a process holding frames.

Steve Waite: Engineer at codelegend.com

Archived

This topic is now archived and is closed to further replies.

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.