Sign in to follow this  
ex_

Is it possible to get stable 60FPS?

Recommended Posts

I am new to Prepar3D, but love it so far!  I loaded up an old copy of FSX on a new machine and did not like the performance, so I looked at this sim as a good current sim to move to.  Loving almost everything so far, except that I cannot get a stable framerate.

 

I've read that this is mostly due to the CPU doing most of the rendering.  I've done some affinity mask stuff I've read about, and it does seem to help, but not cure the problem.

 

I can get 144fps at high altitude with most settings turned up to max.  However, once you approach some 3D objects like scenery buildings and AUtogen buildings, it goes south fast.  I understand that adding more stuff to process will increase the frametime and decrease framerate, but is there a happy balance where someone could get 60fps or higher even in heavy scenery areas?

 

What is confusing me is this:  Neither my CPU nor my GPU are maxed or even close most of the time, yet framerates suffer.  (I unlike most of you (I've been reading) cannot stand 30-55fps for anything.  I want a frame available from any game or sim every time my monitor is ready for one.  That means absolutely no skipped frames or stutters).  In many applications I can achieve this, but not here.

 

So, what exaclty is the reason Prepar3D does not get higher framerates even though GPU AND CPU are not maxed?  To be clear, I do know that it is maxing one of my cores, but couldn't the rendering by moved to multiple cores and or the GPU?  WOuldn't that improve things?  I understand why the flight calculation stuff needs to be done by the CPU, but I don't think I'd be incorrect to compare modern flight sims to modern racing sims, where many components on dozens of cars are calculated at once and provide real race drivers with valuable seat time.  Both Assetto Corsa and Project CARS use the CPU for physics, and the GPU for graphics.  Couldn't this flight sim do the same?

 

my specs:

 

i5-4670 3.4ghz

GTX970

Asus 144hz monitor 1080p

Seagate 2TB HDD

Win7 on SSD

Share this post


Link to post
Help AVSIM continue to serve you!
Please donate today!

There is a legacy trick to get all cores used at around 80-90% (on my system). After the sim is up and running, go into the task manager, enter the affinity/cores (or similar) entry, switch off core 1, quit okay, do the same once more, switch on core 1 again, make sure all cores are running again.  Watch core usage.

 

Be advised that LM does NOT approve this method (their argument was it would interfere with their threading mechanism). However, it gives me a couple of more fps, less fluctuations (yes I measered and recorded them) and no adverse effects, as far as I can tell.

 

The more CPU throughput also gives the GPU more work.

 

This can be automated using e.g. a batch file.

 

Do it at your risk, however, given this does not modify the simulator configuration there isn't that much risk.

 

Kind regards, Michael 

 

 

Share this post


Link to post

I am experiencing the same thing as you. Virtual cockpits in advanced aircraft like the PMDG 777 or 737 will lower the framerate in VC view because of the sheer number of clickspots in the cockpit.

 

However, this afternoon I am going to test what I get on lowest settings and see what I can get and report back.

 

Usually with my settings I get stable 40fps but I want to see what I can get on minimum

Share this post


Link to post

Michael...

Could you go into a bit more detail and step by step for the tweak you describe here, please?   

"After the sim is up and running, go into the task manager, enter the affinity/cores (or similar) entry, switch off core 1, quit okay, do the same once more, switch on core 1 again, make sure all cores are running again."

 

Task Manager in Windows 7, has a Performance Tab and a "Resource Monitor" ... but I do not immediately see how to switch a core off and back on.

I note that there is Core 0 and then Core 1.

 

Also, could you explain what this actually does in system?   Why does the "OFF" then "ON" change how the cores perform and activate all four?

 

thanks

RMM

Share this post


Link to post

Hi,

 

unfortunately I run Win 10, and moreover the German flavor, thus I can't tell you the exact naming of the entries. 

 

As far as I recall from Win 7, when you open the Task Manager (not the performance manager it includes) you see a list of all running programs immediately. Now you right click with the mouse Prepar3.exe. There are several entries like "Priority" (which I would always set to high, btw.) and one more "Association", or similar. This one shows the cores used with checkboxes which you can activate and deactivate.

 

This procedure is not quite popular, but in no way did I invent it. A proper Google search should provide several hits. It was also mentioned in a thread on the LM forum (a year or so ago) which I participated in.

 

I can't tell you why this procedure re-distributes load over the cores, I only can tell you it does. As I told you - and would like to repeat - there are differing opinions if this is good or evil. Actually, it does not "activate" the other cores, even without this procedure they should be running at around 50 % or so. As far as I know, these threads are mainly for texture loading, while the main thread (usually at 100%) does all the other work.

 

Kind regards, Michael

Share this post


Link to post

There is a legacy trick to get all cores used at around 80-90% (on my system). After the sim is up and running, go into the task manager, enter the affinity/cores (or similar) entry, switch off core 1, quit okay, do the same once more, switch on core 1 again, make sure all cores are running again. Watch core usage.

 

Be advised that LM does NOT approve this method (their argument was it would interfere with their threading mechanism). However, it gives me a couple of more fps, less fluctuations (yes I measered and recorded them) and no adverse effects, as far as I can tell.

 

The more CPU throughput also gives the GPU more work.

 

This can be automated using e.g. a batch file.

 

Do it at your risk, however, given this does not modify the simulator configuration there isn't that much risk.

 

Kind regards, Michael

Hi Michael,

 

You're correct, I just tested this and observed the results, you would see better performance that way.

 

By starting the sim without an AffinityMask, and then by switching off LP0, then back on again, helps alleviate the problems associated with starting without an AM. This moves the jobs off LP0, gives job 1 a core to itself, no longer sharing with another job, then widens the affinity back to zero. When affinity is narrowed on the sim, multiple jobs are running on the same LP so as to make more work for that LP. The LPs look busier but achieve no further purpose since the main sim job cannot take notice of them all.

 

Instead start the sim with an AffinityMask that already masks one of the first LPs. Better still, try starting the sim with an AffinityMask that enables just 4 LPs.

 

I hate to say it, but I believe unfortunately this technique only works because the performance is poor before setting out. More cores and HT enabled makes it more apparent. There are better ways to improve performance, keep addons off the main sim thread and give it a core to itself.

  • Upvote 1

Share this post


Link to post

I went back and played around a bit more, paying attention to framerates and other performance changes.  Strange, that now I'm noticing more often that all of my cpu cores (4) are maxed or close... especially if in an F-22 Raptor at full speed across the landscape ;)  The apparent purpose (and I read this somewhere on this site I think) is that some cores will be tasked with loading and unloading textures.

 

I have a theory I don't know if anyone else has already disproven... could it be that the transfer of rendering between cores, and from CPU cores onto the GPU is the bottleneck in most systems?  That, because the rendering job is not all being done by one contained environment, it could be getting stuck momentarily or caught in a traffic-jam of sorts?

Share this post


Link to post

I went back and played around a bit more, paying attention to framerates and other performance changes.  Strange, that now I'm noticing more often that all of my cpu cores (4) are maxed or close... especially if in an F-22 Raptor at full speed across the landscape ;)  The apparent purpose (and I read this somewhere on this site I think) is that some cores will be tasked with loading and unloading textures.

 

I have a theory I don't know if anyone else has already disproven... could it be that the transfer of rendering between cores, and from CPU cores onto the GPU is the bottleneck in most systems?  That, because the rendering job is not all being done by one contained environment, it could be getting stuck momentarily or caught in a traffic-jam of sorts?

 

It's an interesting theory. A real eye-opener for me was when SteveW above said that there are three CPU consuming activities the simulator does: rendering, data transfer and simconnect. In the future, we will get mindblowing frame-rates when a bulk of rendering is done on the graphics card. That will mean the data transfer will be greatly cut down. The CPU will act as an over-all planner and coordinator of activities, rather than being the planner, manager and executor all in one. The benefit of going to the GPU is that people won't have to replace their machines, just by a cheap PASCAL GPU which can do bulk CUDA calculations onboard on 3D RAM. The bad news for P3D is that it needs to completely re-write the simulator. It is also not good news for Dovetails upcoming simulator, because they will be doing all their development on the old fashion CPU-GPU concept. If X10 had any brains, they would ramp up their development ten times as soon as the first PASCAL GPU's start shipping. They will then be ahead of the pack.

 

Only my 2 cents.

Share this post


Link to post

Steve, if I understand correctly, Michael's technique would be unnecessary if one sets a correct AffinityMask entry within the sim's CFG?

 

For example: I have an Intel 6700K  with HT Off and set AffinityMask: 84  Is this the correct value for 6700K with HT Off ?

Share this post


Link to post

4 core HT Off No AM =(1111) addons on 14=(1110)

 

4 core HT On AM=85=(01,01,01,01) addons on 248=(11,11,10,00)

Share this post


Link to post

SteveW...

Could you provide the .CFG section titles and exact code for both the AM and Addons entries you suggest?

thanks

RMM

Share this post


Link to post

Steve,

 

Currently I am running Fs with Unlimited fps.

At a very detailed airport with locked at 30 or even 25 I am getting 17-23.

With Unlimited 27+ ...

Taxiing is smoother.

 

However Large turns above multiple cloud layers with OC gives jitters.

 

Could I use an external frameratelimiter to have the advantage of Unlimited with detailed scenery but with a higher lowest fps to avoid jitters ?

 

Thanks

Share this post


Link to post

4 core HT Off No AM =(1111) addons on 14=(1110)

 

4 core HT On AM=85=(01,01,01,01) addons on 248=(11,11,10,00)

From what I understand...

4 core HT off - No AM required

4 core HT on - AM should be 85

 

What you mean by addons on 14 and addons on 248?

 

Ted

Share this post


Link to post

Steve,

Currently I am running Fs with Unlimited fps.

At a very detailed airport with locked at 30 or even 25 I am getting 17-23.

With Unlimited 27+ ...

Taxiing is smoother.

However Large turns above multiple cloud layers with OC gives jitters.

Could I use an external frameratelimiter to have the advantage of Unlimited with detailed scenery but with a higher lowest fps to avoid jitters ?

Thanks

I've had the same problem and found out that it's mostly to do with AA rendering of the clouds. The stutters occurred when the GPU was peaking at 99%. Turning down AA to 4x solved that problem albeit with slightly less realistic looking clouds. I have a 970 so I cannot expect too much with AA settings.

From what I understand...

4 core HT off - No AM required

4 core HT on - AM should be 85

 

What you mean by addons on 14 and addons on 248?

 

Ted

I believe he means to use 14 and 248 if you have addons running

Share this post


Link to post

If you have a 4 core with HT=Off, use No AM in the cfg AM=0=(1111), and with proc lasso or a bat, set addons to 14=(1110)

 

same here

4 core HT On AM=85=(01,01,01,01), set addons to 248=(11,11,10,00)

requoted :)

Share this post


Link to post

Steve, you do have a way with words...

 

AM=0=(1111)   :wink:

 

do you mean AM=15=(1111)?

 

For the record... my recommendation

 

Quad core processor

 

HT off, AffinityMask=14

 

or, if you must..

 

HT on, Affinitymask=84 or 244,  take your pick..

Share this post


Link to post

Bert, why not use correct nomenclature to have a common understanding with others? Perhaps it might help if it is made clear that AM=0, or not specifying an AM in the cfg means 15 on a four core, 255 on an 8 core, and 1023 on a 10 core, etc.

 

So when we say use no AM or AM=0, we mean those number of bits unmasked represents the number of cores.

 

Anyway, when I say use no AM (AM=0) with your four core I'm saying give it four cores 0,1,2,3. And give your addons the cores that the sim uses for background tasks, 1, 2, 3.

 

 

The reason that escapes some, is that since the background tasks take any number of seconds, it's not particularly troublesome to allow the sim background threads on those cores mixed with addons.

 

Split the sim into Rendering (job 1, core 0) and background tasks (jobs 2,3,4, cores 1,2,3).

 

But if we allow the first sim job to share with addons, the main job sawtooths, giving rise to stutter. The main job does the rendering so don't allow it to be interrupted. Mix addons with sim background tasks when you only have 4 cores.

 

When we use HT with the four core we would use an AM=85 for the same reasons and put our addons on 248.

Share this post


Link to post

 

The alternative to 85 on the 4 core HT=On being 170. Since this discussion is about maintaining a high fps, I've presented AMs for that purpose, we can take a little from the background to maintain our primary job throughput.

 

In the case of more cores I've shown elsewhere how 5 jobs on 5 cores produces worse performance than 4 jobs on 4 cores, and that HT disabled is not a good idea, so long as we are not going for GHz world records, and have an optimised AM. Optimised AMs are quite important regarding VAS and heat too. It's pretty average to apply optimisations to machines these days, although how to go about it may not always be so obvious.

Share this post


Link to post

Steve,

 

Currently I am running Fs with Unlimited fps.

At a very detailed airport with locked at 30 or even 25 I am getting 17-23.

With Unlimited 27+ ...

Taxiing is smoother.

 

However Large turns above multiple cloud layers with OC gives jitters.

 

Could I use an external frameratelimiter to have the advantage of Unlimited with detailed scenery but with a higher lowest fps to avoid jitters ?

 

Thanks

try using 29fps or 30fps limit within NVidia Inspector,

 

and then in the sim display settings

 

1. set 29 or 30 fixed on the slider, no vsync,

or

2. set vsync on and triple buffer on with Unlimited.

 

Note VSync will hook into that NI limit so it's helping to cap the fps. The fixed setting requires more power but creates frames that are equi-distant.

 

SteveW...

Could you provide the .CFG section titles and exact code for both the AM and Addons entries you suggest?

thanks

RMM

What CPU(s) does your PC use?

Share this post


Link to post

Not sure that mask for AM=0 is quite right, if no mask is set P3D by default will not use CPU0( as viewed from task manager) That would be 254 on a 4C/8T or 4094 on a 6C/12T system. It doesn't work like FSX, the default behaviour was changed some time ago in the 2.x versions. It only appears to not use the first logical CPU it comes to , not the first and second logical CPU's. Too lazy to dredge up the thread from LM where it was explained , but that's what I see on my 3.1  install.

 

Postby Zach Heylmun » Mon, 25 Nov 2013, 11:58

Hey James,

V2 is smarter about generating its default affinity mask, but if you want to tinker with it yourself you still have to add the entry to the config file. P3D is still better off with one thread per physical core, so it generates an affinity maskthat puts one thread on each physical core of a processor. If you have 4+ physical cores, the application will bump itself off of the first core to free up the processor for the OS and other applications. Thanks,

Share this post


Link to post

Rmmm, on 06 Feb 2016 - 5:07 PM, said:snapback.png

SteveW...
Could you provide the .CFG section titles and exact code for both the AM and Addons entries you suggest?
thanks
RMM

What CPU(s) does your PC use? 

 

Hi Steve:

I have a new build.   i76700k CPU with 16GB of Ram and an  EVGA Classified 980Ti GPU

Your recent other threads are in my bookmarks.   Your suggestions are really welcome and greatly appreciated.

RMM

Share this post


Link to post

Not sure that mask for AM=0 is quite right, if no mask is set P3D by default will not use CPU0( as viewed from task manager) That would be 254 on a 4C/8T or 4094 on a 6C/12T system. It doesn't work like FSX, the default behaviour was changed some time ago in the 2.x versions. It only appears to not use the first logical CPU it comes to , not the first and second logical CPU's. Too lazy to dredge up the thread from LM where it was explained , but that's what I see on my 3.1  install.

 

Specifying no affinity mask in the P3D v3.1 Prepar3D.cfg file results in every Logical Processor (LP) being utilised by the sim, very easy to check in a few minutes with Task Manager.

 

This is especially not cool since with Hyperthreading enabled, the first two LPs are occupied by sim jobs 1 and 2. Not good. But since we want to be using Hyperthreading we must use an AM if we have more than 4 LPs on the CPU. Specifying AM=0 results in the same situation as with not specifying an AM. AM=0 (or no AM) is not interpreted as a binary number, but rather it is interpreted as every bit unmasked. And every bit unmasked on an 8 core with hyperthreading enabled would be AM=65535. Even without HT enabled, CPUs with more than four cores will not run P3D so efficiently unless the Mask only enabled 4 bits, which results in the sim splitting into just four jobs. Five jobs or more are wasted and reduce performance.

 

 

 

Rmmm, on 06 Feb 2016 - 5:07 PM, said:snapback.png

What CPU(s) does your PC use? 

 

Hi Steve:

I have a new build.   i76700k CPU with 16GB of Ram and an  EVGA Classified 980Ti GPU

Your recent other threads are in my bookmarks.   Your suggestions are really welcome and greatly appreciated.

RMM

 

Enable Hyperthreading, Specify in Prepar3D.cfg

[JOBSCHEDULER]
AffinityMask=85

AffinityMask=85=(01,01,01,01)=0,2,4,6 we delimit HT pairs with commas to show the Hyperthreding is enabled.

 

We do not process lasso or move sim threads after the sim has started. This does not result in the natural arrangement of sim jobs, but rather this causes mounting of multiple sim jobs onto single LPs making them look more active.

 

Use a batch file (.bat) or process lasso to keep your addons on LPs 3,4,5,6,7=AM=248. Starting apps with a batch file for affinity

 

The reason for doing it this way is that we have to keep known activity (Addon exe's) away from the first sim job.

Share this post


Link to post

SteveW:  I think the proverbial lightbulb may have finally gone off in my head after reading your most recent post.  All the various discussions about the AM issue were causing me confusion and I instinctively knew I was missing something.  When I first read your statement about using a 248 AM I initially thought you were referring to inside of the P3D config file which made no sense to me.  As it was obvious that you know quite a bit about this subject I went to the link (Starting apps with a batch file for affinity) and I realized that was not the case.  So I think I'm now starting to grasp this subject much better.  I do have some questions regarding the link but before going there I want to ensure that my current understanding is basically accurate

 

Under the assumption that we are talking about a 4 physical core processor with HT active and one has additional add-ons with the desire to keep them off some of the first few cores that P3D will use and we wish to have P3D use 4 of the eight cores available, it becomes necessary to use an AM=85 in P3D config file (01,01,01,01).  It's my understanding that the reason for not using AM=15 (00,00,11,11) is that placing P3D on the first 4 logical cores created by the first 2 physical cores is not as efficient as putting P3D into the first logical core created by each of the 4 physical cores (0,2,4,6). 

 

We then could create a batch file to set an affinity mask = 248 (11,11,10,00) for one or more add-ons which keeps them off of core 0 and core 2 which are the first two used by P3D.  Hopefully I have gotten this correct.  Assuming I do I have some questions:

 

  1. In the specific assumptions above is starting the add-ons on core 3 going to cause any significant reduction in the effectiveness of P3D on core 2 inasmuch as they are both controlled by the 2nd physical core?
  2. Is there any merit to shoving add-ons to just cores 5, 6 and 7 allowing P3D exclusive use 0, 2, and 4?  Perhaps the answer to both 1 and 2 is it depends on the add-ons in question and their particular demands.
  3. With regard to the batch link you provided I wasn't clear on a few things:
  • In that post there is the following:  I will use a fictitious weather program called FSWeather.exe found in the folder "C:\Program Files (x86)\FSWeather".  Rename it FSWeather.bat.  If I take it literally this seems to imply to change the extension of the fictitious program from .exe to .bat which didn't make sense.  Perhaps it means that we are to create a batch file that will be given the name FSWeather.bat??
  • One the lines for this potential batch file reads:  C:\Windows\System32\cmd.exe /C start /affinity F8 FSWeather.exe.  Below that batch example it then reads:  "F8=248= . . . ."  How did F8 become = to 248?  Is there something else required to make F8 mean 248?

I think that's it for now.  Let me know if I'm on the right track and if you can help clarify the batch file confusion I'm having.

 

Rick

Share this post


Link to post

We then could create a batch file to set an affinity mask = 248 (11,11,10,00) for one or more add-ons which keeps them off of core 0 and core 2 which are the first two used by P3D. Hopefully I have gotten this correct.

 

Realise you want to get a response from Steve but in the mean time if you write a batch file to get other applications off the simulators LP's (local processes), the batch file is in hexidecimal not decimal. AM = 248 (decimal) is actually (F8)hexidecimal in the batch file. In the operating system, it will run a batch file (.bat) which then executes your addon as per the hexidecimal AM. It is only the P3D.cfg where the affinity is in decimal (what a silly decision).

We then could create a batch file to set an affinity mask = 248 (11,11,10,00) for one or more add-ons which keeps them off of core 0 and core 2

 

You aren't trying to exclude all addons from using the simulators cores, just from the main processes that the simulator runs. The other processes are less busy so addons can go there. That is why we have the overlapping affinity masks for the simulator and addons, partially sharing resources.

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