SledDriver

P3D multicore usage anomoly

Recommended Posts

1 hour ago, newtie said:

Are you using NVI?

Interesting suggestion.

NVI is on the machine, but I just checked and it has the default settings for P3D which I've looked through and there is nothing in there which would control frame rate.

Share this post


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

17 minutes ago, Bert Pieke said:

And that may again explain some differences in user experience..

I like the fluid feel of my airplane in "normal" scenery situations, and recognize that downtown LA or SEA with full Orbx regions is going to introduce a minor performance impact which I will have to live with. No blurry scenery or fps hell though :cool:.

I'm targetting 30fps, and the machine will hold that even flying into a busy airport.

The only time I see slowdowns are at dawn/dusk, but I believe this is a know phenomena.

And yes glassy smooth animation is what I go for. Maybe we can't have perfection until LM replace some more core code, but I get pretty close.

I also test by flying over busy airports at Mach 1.6 in the F-22. If it can handle that, then it's very smooth with GA planes.

Share this post


Link to post
19 minutes ago, Bert Pieke said:

No guessing.. my recipe calls for the first option.

Sorry my sloppy typing.

I assume you actually use:

Framerate limit = 0
Scanline Sync = x/2   60

Correct? Cos that seems to do nothing for me. It just runs at unlimited, bouncing between 45 and 60 fps unless I do:

Framerate limit = 30
Scanline Sync = x/2   0

Share this post


Link to post
Posted (edited)
16 minutes ago, SledDriver said:

P3D main processing will be thousands of threads, all perfectly capable of being distributed across many cores.

That's just how CPU's work.

The fact that it loads up Core0 unless you stop it, is almost certainly legacy programming which has not yet been rewritten by LM.

This has been discussed as long as FSX has existed... SP1 and then SP2 made the first steps towards offloading some of the work (mainly scenery loading) onto the other cores.. The Aces Team explained this in detail. So yes, the guys who wrote it..

LM has continued along this path with every new release version improving on this behavior.

At present, P3DV4.5. loads up using two cores for the main threads which you can see if you simply sit still on the tarmac after all the scenery has loaded.  As soon as you take off, the other cores show activity varying with scenery loading requirements.

What we are trying to do with resetting the Affinity after P3D has started is to interfere somewhat with LM's settings.. Time will tell if that is always wise, or not..

Edited by Bert Pieke

Share this post


Link to post
Posted (edited)
5 minutes ago, SledDriver said:

Sorry my sloppy typing.

I assume you actually use:

Framerate limit = 0
Scanline Sync = x/2   60

Correct? Cos that seems to do nothing for me. It just runs at unlimited, bouncing between 45 and 60 fps unless I do:

Framerate limit = 30
Scanline Sync = x/2   0

Not sure why it is not working for you... this is something new for me too (I was using NVI before) but it gives me very fluid flight which I like!  Do you have several monitors, or unusual Nvidia settings?

Edited by Bert Pieke

Share this post


Link to post
1 minute ago, Bert Pieke said:

This has been discussed as long as FSX has existed... SP1 and then SP2 made the first steps towards offloading some of the work (mainly scenery loading) onto the other cores.. The Aces Team explained this in detail. So yes, the guys who wrote it..

Yes I am aware of that, 15 years ago or so. I think the key word in there is 'mainly'. And early multicore stuff often wasn't very clever sometimes wasting more time managing cores and threads than any benefit gained.

I believe it is quite reasonable to suggest that a modern machine with a modern OS can handle this stuff much better than any old FSX legacy coding which is still in P3D to date. i see no problem 'fooling' the app into spreading the load.

It's working great here . 🙂

Share this post


Link to post
4 minutes ago, Bert Pieke said:

Not sure why it is not working for you... this is something new for me too (I was using NVI before) but it gives me very fluid flight which I like!  Do you have several monitors, or unusual Nvidia settings?

The only thing I ever tweaked in NVI was FSX.

And yes I have 5 monitors on the system, but only one used for P3D

Share this post


Link to post
Just now, SledDriver said:

The only thing I ever tweaked in NVI was FSX.

And yes I have 5 monitors on the system, but only one used for P3D

Maybe RTSS is sensitive to that.. who knows..

All that really matters is that you have smooth flight, and whether that is using the same settings as someone else.. Who cares :wink:

Share this post


Link to post
1 hour ago, SledDriver said:

Top post on this page disagrees with you. Who is right?

Is it as suggested a the top of this page:

Framerate limit = 0
Scanline Sync = x/2

Or is it

Framerate limit = 30
Scanline Sync = x/2

Please don't guess.

You will be right... when you find what works for you, your system, and the way you fly.  Setting FR=0/Scanline Sync=x/2 will work fine for some folks.  For my simming experience and hardware I needed to set the Framrate.  In RTSS setting my FR to 29 and Scanline Sync x/2 to 60 gives me the smoothest performance (and not surprisingly, least variation in frame rate).

Since you get 37 FPS when you set RTSS to FR=0/SSx/2=60, are you certain your monitor is running at 60 Hz?  Could it be running at 75 Hz?

 

Share this post


Link to post
2 hours ago, SledDriver said:

Yes I am aware of that, 15 years ago or so. I think the key word in there is 'mainly'. And early multicore stuff often wasn't very clever sometimes wasting more time managing cores and threads than any benefit gained. I believe it is quite reasonable to suggest that a modern machine with a modern OS can handle this stuff much better than any old FSX legacy coding which is still in P3D to date. i see no problem 'fooling' the app into spreading the load.

This reminds me of a similar trick back in the FS9 days where you could manually tweak the affinity of FS9.EXE in task manager and it seemed to use two cores. Instead of being 100% on one, it was 50% on two. Strangely enough the sum between the cores never seemed to exceed 100.... I wonder?

At the end of the day, there is nothing you can do in Windows to make a single thread divide its work between multiple cores. What I suspect is happening is that the kernel is switching the thread between cores rapidly, more often than Task Manager updates so it looks like two cores are being run. Instead of spending 1000ms executing on a single core, it's spending 500ms on a core, and 500ms on another. I suspect it helps you a little because it may reduce thermal heating on that core, and it hurts you a LOT because you're likely flushing your L1 and L2 caches on a regular basis.

But no matter what, there is no silver bullet. Sequential code is just that, sequential.

Share this post


Link to post
55 minutes ago, lownslo said:

You will be right... when you find what works for you, your system, and the way you fly.  Setting FR=0/Scanline Sync=x/2 will work fine for some folks.  For my simming experience and hardware I needed to set the Framrate.  In RTSS setting my FR to 29 and Scanline Sync x/2 to 60 gives me the smoothest performance (and not surprisingly, least variation in frame rate).

Since you get 37 FPS when you set RTSS to FR=0/SSx/2=60, are you certain your monitor is running at 60 Hz?  Could it be running at 75 Hz?

 

Well the nVidia control panel says the monitor refresh is at 60Hz during the sim.

Share this post


Link to post
6 minutes ago, Luke said:

This reminds me of a similar trick back in the FS9 days where you could manually tweak the affinity of FS9.EXE in task manager and it seemed to use two cores. Instead of being 100% on one, it was 50% on two. Strangely enough the sum between the cores never seemed to exceed 100.... I wonder?

At the end of the day, there is nothing you can do in Windows to make a single thread divide its work between multiple cores. What I suspect is happening is that the kernel is switching the thread between cores rapidly, more often than Task Manager updates so it looks like two cores are being run. Instead of spending 1000ms executing on a single core, it's spending 500ms on a core, and 500ms on another. I suspect it helps you a little because it may reduce thermal heating on that core, and it hurts you a LOT because you're likely flushing your L1 and L2 caches on a regular basis.

But no matter what, there is no silver bullet. Sequential code is just that, sequential.

Hmm. Just fired up the sim again. Didn't do the core thing. Core0 hammered. other 5 cores at 30-50%.

Did the core thing. All cores regularly at max, and sim definitely smoother.

Get it - smoother. But no, I'll put it back to the old way which is obviously the right way and live with the stutters. 😉

I obviously don't actually know how it is actually programmed either. All I can do is report what I see.

Yes and I remember the split core = 100% thing. But that wasn't FSX/P3D. This is later code than that at least.

Hopefully LM will sort this out properly some time and recode the whole kernel of the sim.

 

Share this post


Link to post

Of course, it's a never ending story trying to tweak all this stuff.

There are simply too many variables for any human to keep up with. You change one thing and you have to tweak again - weather, location, speed, plane, etc, etc.

That's why none of us should be doing this. The blinking computer should be optimising all these things for us on the fly - literally.

Some day, huh...

Share this post


Link to post
3 hours ago, SledDriver said:

Top post on this page disagrees with you. Who is right?

Is it as suggested a the top of this page:

Framerate limit = 0
Scanline Sync = x/2

Or is it

Framerate limit = 30
Scanline Sync = x/2

Please don't guess.

When RTSS is set for using scanline sync the frame limiter is "autodisable".
In better words scanline has priority to frame limiter
That is what i read in RTSS forum in the morning from one of the DEVELOPERS (of rtss), so i think it is attendible. (If I understood correctly)
Unfortunately today I didn't have time to test it on my sim, so I can't give you information from my sim, but as soon as I try I will let you know

  • Upvote 1

Share this post


Link to post
Posted (edited)
7 hours ago, SledDriver said:

I do all my testing in worst case scenario I can think of. Anything else is pointless. I'm not interested in gliding through the desert only to hit fps hell when I go anywhere near civilisation. 🙂

Well the 'desert', and 'anywhere near civilization' rhetorically or not are pretty close to the same benchmark.   Are you saying you've achieved a level of performance where no possible scenario taxes the system such that you lose literally 'perfectly smooth' performance, ever?  That's news to me from reading the testimonies here of so many people I've never had the sense the sim was truly now truly tackled by the current generation of hardware.    I'm assuming you're well loaded w/ FTX regional sceneries and the most taxing of aircraft like the EM505 Phenom 300 w/ the G1000 avionics.

I have to mention for many years I believed I had fabulous performance because presumably it was the best I'd ever achieved.  All that changed a couple years ago when I learned the current setup where literally perfect smoothness was first achieved after decades of flight simming.  This is why I'm still doing well on a 6 y/o platform.

Edited by Noel

Share this post


Link to post
3 hours ago, SledDriver said:

Hmm. Just fired up the sim again. Didn't do the core thing. Core0 hammered. other 5 cores at 30-50%.

Did the core thing. All cores regularly at max, and sim definitely smoother.

Get it - smoother. But no, I'll put it back to the old way which is obviously the right way and live with the stutters. 😉

I obviously don't actually know how it is actually programmed either. All I can do is report what I see.

Yes and I remember the split core = 100% thing. But that wasn't FSX/P3D. This is later code than that at least.

Hopefully LM will sort this out properly some time and recode the whole kernel of the sim.

 

If it works for you, it works for you. No argument there.

As you mentioned, and I agree, that the variables involved in PC settings alteration is enormous.

I ended up with  RTSS as a frame rate limiter because I had the same exact problem locking frames at 30 in NVI that you have with RTSS. Sometimes it worked, other times wild variation. Worthless.

The RTSS 1/2 Vsync wasn't available then (that I know of) and I just set RTSS 30fps lock with unlimited and it smoothed things right out and worked all the time. I didn't bother telling anyone; see all the posts above 😊 But, it seems to have emerged as a working solution for many.

Here's what mine looks like (7.2.2)

https://drive.google.com/file/d/1Ppk0zT5cdjaD7j3Jo6DWicXp5ISHBLHo/view?usp=sharing

I'm using a triple monitor setup (stretched image, no view groups) which has had no adverse effect, You might try disconnecting all monitors except your P3D one and see what happens after a uninstall/reinstall. I use the following tools to do a complete and thorough uninstall of my programs. RevoUninstaller (free trial) and SearchEverything (free).

Cheers,

Mark

Share this post


Link to post
Posted (edited)
On 4/13/2019 at 12:01 AM, SledDriver said:

Hmm. Just fired up the sim again. Didn't do the core thing. Core0 hammered. other 5 cores at 30-50%.

Did the core thing. All cores regularly at max, and sim definitely smoother.

Get it - smoother. But no, I'll put it back to the old way which is obviously the right way and live with the stutters. 😉

I obviously don't actually know how it is actually programmed either. All I can do is report what I see.

Yes and I remember the split core = 100% thing. But that wasn't FSX/P3D. This is later code than that at least.

Hopefully LM will sort this out properly some time and recode the whole kernel of the sim.

 

Today i could test the RTSS scanline thing and the result is very good. For me it works.

Also i tried the core thing and FINALLY my core0 isn't at 100% forever but all core (6 core cpu) are equal (screen below) (Thanks for that)
At the moment i am on cruise but when i am approaching in Amsterdam (flytampa EHAM and more traffic) i re-check the usage of CPU.

It-Work.png
RAM.jpg

Edited by Simone99

Share this post


Link to post
8 hours ago, Simone99 said:

Today i could test the RTSS scanline thing and the result is very good. For me it works.

 

BTW, we have been working with the notion of "Scanline Sync X/2 and 60" thinking that 60 is the monitor refresh rate.

If you hover over the 60 setting in the app, you will get a description that indicates that the value is actually related to the vertical location of the Vsync tear line.. and not the refresh rate at all :blush:

So, you can set it to any value except for zero.. and it will still work..

Just try setting it to 1 as a test :wink:

  • Upvote 1

Share this post


Link to post
Posted (edited)
On 4/13/2019 at 4:55 AM, SledDriver said:

By who? The actual guys who wrote it?

Did you ever actually look at the thread count on your modern PC with anything running. It's not uncommon to have no 'apps' open and the CPU still be handling 20,000 threads, and you're trying to tell me that P3D main routines are in one thread.

That just doesn't make sense.

P3D main processing will be thousands of threads, all perfectly capable of being distributed across many cores.

That's just how CPU's work.

The fact that it loads up Core0 unless you stop it, is almost certainly legacy programming which has not yet been rewritten by LM.

To be making statements like this it's clear you haven't done any threaded programming before.

Those thousands of threads you see are mostly background tasks by windows. Many windows processes have lots of threads so they can easily be scheduled and spread over multiple cores.

Yes the P3D main routines are in one thread. It is only possible to multi thread so much, which LM have already done with scenery loading, etc. You'll also get some addons on different threads like AS, Chaseplane, GSX, and UTL, but any code execution that interacts with the flight model/physics through SimConnect/FSUIPC has to be done on the main thread as they are not thread-safe (Unless something has changed recently that I'm not aware of).

One of the biggest issues with threading is keeping things in sync, if you put different parts of the code on different threads, it becomes much harder to keep them in sync. This is why scenery and autogen is easy to offload, because loading scenery can be done independently of aircraft systems.

A good analogy would be thinking of threads as crew members on a flight. Adding more pilots into the cockpit wouldn't be very helpful, you never want more than one pilot handling the controls at once. But adding a co-pilot, first officer, or flight attendants in the cabin is fine, as they are doing their own thing that doesn't interfere with the flying. But again this gets to a point where there aren't enough jobs for the crew to do. I mean you could technically have 1 flight attendant per passenger if you wanted, but then they'd constantly be blocking each other and causing traffic jams in the aisles.

It's hard to have multiple people (threads) doing the same thing, whether in life or in programming.

Edited by itsjase
  • Like 1
  • Upvote 1

Share this post


Link to post
Posted (edited)
42 minutes ago, itsjase said:

Yes the P3D main routines are in one thread. It is only possible to multi thread so much, which LM have already done with scenery loading, etc. You'll also get some addons on different threads like AS, Chaseplane, GSX, and UTL, but any code execution that interacts with the flight model/physics through SimConnect/FSUIPC has to be done on the main thread as they are not thread-safe (Unless something has changed recently that I'm not aware of).

This has been my understanding as well.  I asked Sled what happens to performance when he encounters the most complex scenario possible but he did not answer the question, instead saying he always tests in the most complex scenarios.  My point was to elucidate exactly what happens when you go thru his setup routine and end up w/ all cores operating at essentially the same load.   On first glance you might surmise if all 6 cores managing all of the work P3D throws at it it would be considered 100% multithreaded--indeed, this is the promised land!  But...we see zero evidence of this.   If you want to see the difference in total thruput between a very multithreaded benchmark versus single threaded performance by the same CPU use one of the benchmarking tools and you easily see the dramatic increase in throughput.  IOW, Sled would have truly found the promise land that his machine can handle absolutely anything P3D and its myriad addons can throw at it.  And this, of course, is beyond a first...it's a miracle!

I'm thinking Sled, if anything, is seeing lower total performance.  Just a hunch, but as I say if he truly is seeing the main WORK of P3D being spread equally over 6 cores or what have you he would be seeing performance others have not yet seen.

For my hyperthreaded hexacore I mask Core0 from P3D, and Windows processes and a few other low demand FS addons are masked from every other core than Core0.  P3D has access to LPs 3 thru 12 IOW.  Provided I'm under the limit for what my GPU can do I have 100% perfectly smooth flight provided the main thread is staying under about 95% utilization.  Truly the promised land of video performance.  But alas, it's a 6y/o CPU and it simply can't manage too much stuff, and then there's my GPU.  Ahh...if only P3D were super multithreaded!

Edited by Noel

Share this post


Link to post
Posted (edited)

 

1 hour ago, Noel said:

I'm thinking Sled, if anything, is seeing lower total performance.  Just a hunch, but as I say if he truly is seeing the main WORK of P3D being spread equally over 6 cores or what have you he would be seeing performance others have not yet seen.

Yeah I think you're correct, what he's probably seeing is overall less performance, but maybe a more stable framerate as the frame drops usually occur when a core gets hammered to 100%

Having 20fps constant might look smoother to him than 30fps with intermittent drops to 20fps.

Edited by itsjase

Share this post


Link to post

"Having 20fps constant might look smoother to him than 30fps with intermittent drops to 20fps."

You guys seem to be making up things I have never said. I mean, where did you get that from?

My system is delivering rock solid 30fps locked down with RTSS. Unlocked it delivers 45-60fps.

Again, I reiterate, my system is on the whole running very smooth with only occasional longer stutters,and no microstutters.

Geez what are you guys on?

" I asked Sled what happens to performance when he encounters the most complex scenario possible but he did not answer the question, instead saying he always tests in the most complex scenarios."

And just what is wrong with that answer precisely???

Share this post


Link to post
2 hours ago, Noel said:

IOW, Sled would have truly found the promise land that his machine can handle absolutely anything P3D and its myriad addons can throw at it.  And this, of course, is beyond a first...it's a miracle!

I'm thinking Sled, if anything, is seeing lower total performance.  Just a hunch, but as I say if he truly is seeing the main WORK of P3D being spread equally over 6 cores or what have you he would be seeing performance others have not yet seen.

Oh great one, 😉 what I am trying to point out is that if I don't mess with cores, on my 8700K the overall CPU usage is around 50-60% as 5 cores are not being worked hard.

if I do the core0 disable/reenable thing, I get around 86% overall CPU utilisation,AND A SMOOTHER SIM, WHETHER YOU BELIEVE IT OR NOT.

So perhaps you'd care to explain again why I shouldn't be doing this?

I really don't understand quite what you guys are driving at with being so negative about my real-world reports after a lot of reports. We're all in the same game here, but as in most clubs, sooner or later the club members can't stop fighting with other club members who are supposed to have exactly the same interests. ☹️

Share this post


Link to post

Sorry if I came accross as agressive, I'm just trying to point out you are trivialising a lot of things that LM has done/and continues to do, to improve the sim.

I'm confused though, you say you're locked at 30fps through RTSS but your system can do 45-60fps. So from my understanding before you touch the cores you have a locked 30fps with 60% cpu usage? But then after you disable/enable the core you get the same locked 30fps but with a higher cpu usage?

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