Nytro

Set up AffinityMask in v4 = 60 fps all the time!

Recommended Posts

Hello guys,

maybe some of you remember I criticized v4 hard when it came out. I even removed it from my hard drive due to very bad performance. Now, after v4 Hotfix was out, I gave it another try with the same result. Then I found something about AffinityMask setting on Youtube. The guy was mention that AffinityMask gives only a HUGE advantage if you just dedicate ALL cores for rendering tasks. Without any blurred textures/terrain as usual when using AffinityMask...

So what I did was, I set up for my Ryzen 6 Core 12 Threads processor - according to this - an AffinityMask of 4095:

[JOBSCHEDULER]
Affinity Mask=4095

It gaves me a huge performance gain in almost every area 60 fps+ now with my Ryzen 1600 + GTX 1060 + 16 GB DDR4. Without OC! Almost every area because next to LAX, NYC Skyline I get only around 33 - 40 fps. Shortly after takeoff again 60 fps.

My settings: 1080p, SSAA x4, ULTRA Texture, 16x Antisop, VSync On + Triple Buff + Unlimited fps, Mesh/Terrain all maxed out, Autogen all on Very Dense/Very High, Shadows, HDR Lighting on, Water on Ultra, Cloud distance 100 mi, volumetric fog, detailed precipitation. Switched off: Dynamic lights (huge fps drop), Dynamic Reflections OFF (see nothing + huge fps drop) Some shadows such as: Internal shadows (I dont like them), Buildings, Vegetation, Objects.

Addons I use:

FTX Global + Vector, OpenLC EU, North America, ORBX FTX NorthCal + SoCal. Here and there some addon airports such as Dubai, Sydney. NYC / Miami from Dzrewicki Design.

Here Is a list and explanation about AffinityMask: I marked my recommed settings for your CPU as BOLD:

 

For 4-core 4-thread CPU (for example Core i5):

15=1111 = ALL 4 Cores

For 4-core 8-thread CPU (for example Core i7)
255=11111111 = ALL 8 cores
254=11111110 = last 7 cores
252=11111100 = last 6 cores
127=01111111 = first 7 cores
63=00111111 = first 6 cores
84=1111= all 4 cores HT on
14=1110 = last 3 cores HT off

For 6-core 12-thread CPU (Ryzen 6 Core CPUs, or Intel Core i7 5820K+)
4095=111111111111 = ALL 12 cores
4094=111111111110 = last 11 cores
4092=111111111100 = last 10 cores

For 8-core 16-thread CPU (Ryzen 8 Core CPUs 1700X, 1800X)
65535=1111111111111111 = ALL 16 cores

 

Hope you can improve your fps :)

Greets Nytro

  • Upvote 1

Share this post


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

But you're just using what amounts to default values, as P3D will use as many cores as possible on a clean config. You haven't actually changed anything. 

  • Upvote 5

Share this post


Link to post

But without that setting im back to 20 - 25 fps in LAX and max. 40 - 50 fps in other areas. CPU cores goes max to 60 - 70 %, in LAX when its lagging with 20 fps only 30 %. With AM on 4095 I have now 60 - 70 % usage in LAX and sometimes even 90 %+ when its need loading textures.

Share this post


Link to post

Then there's something wrong at your end, you've changed settings between your AF mask testing, simulation conditions aren't the same or there's something wrong with how Windows assigns the jobs to a Ryzen CPU. Because by default, P3Dv4 will use every core available and use as much power as it needs. An affinity mask won't make it be able to use each core "more". What you usually do with affinity masking is limit how many CPUs you allocate to the sim, maybe remove logical cores from the mix. That means you can free up entire cores for background applications to use or the sim's addons, to free up additional render time for the sim itself. While V4 will use a many cores as it's given, it doesn't seem to have any performance or improved rendering to show for it, so when you've got 8 cores, you can happily chop off two cores and use them for something else.

So while I may sound like a stick in the mud, which I do apologise for, your approach just defies how affinity masking works and your results are slightly questionable. So again, unless this is a Ryzen specific bug, then this won't do anything.

  • Upvote 3

Share this post


Link to post
1 minute ago, Sethos1988 said:

Then there's something wrong at your end, you've changed settings between your AF mask testing, simulation conditions aren't the same or there's something wrong with how Windows assigns the jobs to a Ryzen CPU. Because by default, P3Dv4 will use every core available and use as much power as it needs. An affinity mask won't make it be able to use each core "more". What you usually do with affinity masking is limit how many CPUs you allocate to the sim, maybe remove logical cores from the mix. That means you can free up entire cores for background applications to use or the sim's addons, to free up additional render time for the sim itself. While V4 will use a many cores as it's given, it doesn't seem to have any performance or improved rendering to show for it, so when you've got 8 cores, you can happily chop off two cores and use them for something else.

So while I may sound like a stick in the mud, which I do apologise for, your approach just defies how affinity masking works and your results are slightly questionable. So again, unless this is a Ryzen specific bug, then this won't do anything -- Sans for Ryzen users, obviously.

Agreed

Share this post


Link to post
3 hours ago, Nytro said:

Hello guys,

maybe some of you remember I criticized v4 hard when it came out. I even removed it from my hard drive due to very bad performance. Now, after v4 Hotfix was out, I gave it another try with the same result. Then I found something about AffinityMask setting on Youtube. The guy was mention that AffinityMask gives only a HUGE advantage if you just dedicate ALL cores for rendering tasks. Without any blurred textures/terrain as usual when using AffinityMask...

So what I did was, I set up for my Ryzen 6 Core 12 Threads processor - according to this - an AffinityMask of 4095:

[JOBSCHEDULER]
Affinity Mask=4095

It gaves me a huge performance gain in almost every area 60 fps+ now with my Ryzen 1600 + GTX 1060 + 16 GB DDR4. Without OC! Almost every area because next to LAX, NYC Skyline I get only around 33 - 40 fps. Shortly after takeoff again 60 fps.

My settings: 1080p, SSAA x4, ULTRA Texture, 16x Antisop, VSync On + Triple Buff + Unlimited fps, Mesh/Terrain all maxed out, Autogen all on Very Dense/Very High, Shadows, HDR Lighting on, Water on Ultra, Cloud distance 100 mi, volumetric fog, detailed precipitation. Switched off: Dynamic lights (huge fps drop), Dynamic Reflections OFF (see nothing + huge fps drop) Some shadows such as: Internal shadows (I dont like them), Buildings, Vegetation, Objects.

Addons I use:

FTX Global + Vector, OpenLC EU, North America, ORBX FTX NorthCal + SoCal. Here and there some addon airports such as Dubai, Sydney. NYC / Miami from Dzrewicki Design.

Here Is a list and explanation about AffinityMask: I marked my recommed settings for your CPU as BOLD:

 

For 4-core 4-thread CPU (for example Core i5):

15=1111 = ALL 4 Cores

For 4-core 8-thread CPU (for example Core i7)
255=11111111 = ALL 8 cores
254=11111110 = last 7 cores
252=11111100 = last 6 cores
127=01111111 = first 7 cores
63=00111111 = first 6 cores
84=1111= all 4 cores HT on
14=1110 = last 3 cores HT off

For 6-core 12-thread CPU (Ryzen 6 Core CPUs, or Intel Core i7 5820K+)
4095=111111111111 = ALL 12 cores
4094=111111111110 = last 11 cores
4092=111111111100 = last 10 cores

For 8-core 16-thread CPU (Ryzen 8 Core CPUs 1700X, 1800X)
65535=1111111111111111 = ALL 16 cores

 

Hope you can improve your fps :)

Greets Nytro

With what aircraft...Default? With what view spot mode outside the cockpit. If you can get that sitting in the VC of any PMDG aircraft at FlyTampa EHAM I may be game.

 

Share this post


Link to post
1 hour ago, Sethos1988 said:

Then there's something wrong at your end, you've changed settings between your AF mask testing, simulation conditions aren't the same or there's something wrong with how Windows assigns the jobs to a Ryzen CPU. Because by default, P3Dv4 will use every core available and use as much power as it needs. An affinity mask won't make it be able to use each core "more". What you usually do with affinity masking is limit how many CPUs you allocate to the sim, maybe remove logical cores from the mix. That means you can free up entire cores for background applications to use or the sim's addons, to free up additional render time for the sim itself. While V4 will use a many cores as it's given, it doesn't seem to have any performance or improved rendering to show for it, so when you've got 8 cores, you can happily chop off two cores and use them for something else.

So while I may sound like a stick in the mud, which I do apologise for, your approach just defies how affinity masking works and your results are slightly questionable. So again, unless this is a Ryzen specific bug, then this won't do anything.

I didn't try any tweak yet, but I can guarantee that P3D v4 does not use all my resources, my GPU stays around ~40% while my CPU ~50% and the first core is the most used.
btw I have an i7 7700k @ 5ghz

  • Upvote 1

Share this post


Link to post

Just tried this at Uk2000 EGLL in the PMDG 747, didn't work for me.

Share this post


Link to post

I dont have PMDG 747. I never fly with VC since I cannot see every button and always have to adjust camera viewing angles. Then you have to spin your head to read things, very annoying. Can only imagine flying with 3D Cockpit with VR glasses, but on a display, no way...

I do have an A320 2D panel which is bugged. There I got only 20 fps in LAX, but CPU is on 80 % then.

And yes this is what I understand too, P3D uses all cores, but the first core always 100 %. But it holds back power for "unknown task to come" as a LM dev mentioned few month ago. So with that setting you force P3D to split up all rendering task on all cores to the max without reserve power. For my understanding...

And sure it could be on Ryzen only, people have to test it if they have similar problems with low CPU usage and low FPS at the same time...

Share this post


Link to post
29 minutes ago, Berike said:

I didn't try any tweak yet, but I can guarantee that P3D v4 does not use all my resources, my GPU stays around ~40% while my CPU ~50% and the first core is the most used.
btw I have an i7 7700k @ 5ghz

Don't recall saying P3D uses all your resources, that would be quite a bogged down machine if it did. It'll use up as many cores that are available and use up as much of its power as it 'needs'. Not sure why you'd want your GPU sitting at 100%, that has little to do with your overall framerate or rendering smoothness of terrain / autogen. If you want it to use my GPU power, just pile on GPU specific settings. 

And you also need to understand how rendering works if you think your CPU will be sitting at 90%+ usage all the time. That, again, has nothing to do with affinity mask settings. First core is responsible for all the rendering / calculation of the simulation, planes, their systems, physics. That will often spike or run high, depending on your framerate target too. It does NOT multi-thread, not even on a logical core. You cannot affinity mask yourself out of that, nor tweak a .cfg, that just comes down to how the ESP engine works.

Every other core is used to prepare and render terrain. Also believe autogen to some extend, though I am not sure. So all your other cores will only work when there's secondary render tasks to complete, so they may see 0% use, they might spike to 100% over cities or complex terrain, or when travelling fast. 

So looking at an arbitrary number like overall usage is absolutely pointless. This is how the engine works, this is why people always talk about poor multi-threading capabilities, because your framerate is directly linked to what the capabilities and speed of your primary rendering core is.

Again, has nothing to do with affinity masking.

Share this post


Link to post

With no AM,

613e4e3b1e52ea8.png

With AM on,

67df7585011a393.png

Noticed that load was shifted from CPU 0 to CPU 2, and the rest are doing very little.

I7 4770 HT on.

Share this post


Link to post

AM war is back !!!

This is the P3D forum I use to know when I first started with LM P3D v3.0

Great,  I missed it so  much 😂

Clear skies,

  • Upvote 2

Share this post


Link to post

My 6 core 5820 runs best at AM = 340 in V3 and AM = 980 in V4.

That is because I have all kind of addons running too.

In V3 I tested with AM = 4095 . It seemed a little smoother when the system was not taxed very much , but caused some stutters in heavy scenery + rain. AM = 340  handled that better ..

 

Share this post


Link to post

Looking forward to SteveW's take on all of this.

  • Upvote 1

Share this post


Link to post

I have NOT checked in V4 but I noticed that in V3, my system worked better with AM=15 added to the cfg file. I *KNOW* it's the default but it made a difference in V3. CUrrently I'm running default in V4 and it's running just fine so I don't mess with it.

 

Vic

  • Upvote 1

Share this post


Link to post
Guest
This topic is now closed to further replies.