Jump to content
Sign in to follow this  
Jimm

Affinity Mask: An Observation

Recommended Posts

Thanks newtie, 116 is a cool number for four core CPUs with HT. I mean, here's an example where we have a balance of addon activity with the sim. 116 utilises three cores, 1,2,3, but splits the sim into four thread jobs to produce the lean main thread doing the rendering, leaving the first core 0, for the jobscheduler to fill with addon activity. It's basically a more refined version of using AM=14 on a four core with no HT.

Steve, I have placed AM=116 on all my sims...and will leave it there.  Not getting any worse performance over what I was using...of 244.  

 

Mitch

Share this post


Link to post

Well, I just want to confirm what Jim and some others on this thread have said. I can not find any benefit from using AM on P3D v3.2.

When I use AM (I have tried a lot of AM settings) I got worse performance compared to NOT using any AM setting.

I have the same CPU as Jim, the I7-4790k. Maybe that has something to do with it. Maybe it's just that P3D v3.2 uses a modern CPU in a good way.

Share this post


Link to post

There can be problems when limiting P3D fps with NI with certain GPU/driver versions so it's got to be tested on a per system basis, depends on GPU/Monitor/Interface cable etc.

 

We use particular settings for GPU functions when testing for performance, and so as when we are testing an AM. We are looking for the best possibility of throughput with our CPU and addons. We would usually unset certain GPU functions, like limiter, AA and VSync, so we don't get these effectively limiting the performance during testing. Once we are sure the sim keeps the best fps/stability across the broadest of scenarios, we can then apply AA and VSync, or maybe a Fixed fps, and so on, to obtain our best image quality. When looking for top performance we might have a less than desired setup for viewing and running the sim.

Thank you Steve, that makes sense. 


Best regards,
David Roch

AMD Ryzen 5950X //  Asus ROG CROSSHAIR VIII EXTREME //  32Gb Corsair Vengeance DDR4 4000 MHz CL17 //  ASUS ROG Strix GeForce RTX 4090 24GB OC Edition //  2x SSD 1Tb Corsair MP600 PCI-E4 NVM //  Corsair 1600W PSU & Samsung Odyssey Arc 55" curved monitor
Thrustmaster Controllers: TCA Yoke Pack Boeing Edition + TCA Captain Pack Airbus Edition + Pendular Rudder.

 

Share this post


Link to post

Interesting. Removed AM and FFTF and gave it a test run. Loaded the same flight into EGLL I have been using to test. Much less blurries and faster loading textures, at the cost of some fluidity.

 

I'm guessing this is simply because the sim now has more processing power at hand, given that all cores were in use. Think I will stick with an AM of 238 or 244 for now, seems to be the best balance between performance and visual quality.

 

 

I have to agree with both Jim and Steve here.

 

It is easier to not tweak the AM and let the sim use all cores, but there will definitely be a small performance impact in terms of smoothness since the main thread is essentially going to be handling 7 other jobs competing for throughput. Not to mention addons being put on top of that. Also the fact that the main thread now shares a core with the fiber thread/second thread.

 

But using an AM, frees up that 1 or 2 cores to help alleviate the job of the main core as well as allows addons to be seperated from P3D's processing to ensure smoother performance.

 

I know I'm being extremely simple here, but that's the point.

 

Truth at the end of the day as I see it, at least on my system, is that its a balance between smoothness and the blurries with 3.2. No AM gives you full power at the cost of smoothness and assigning an AM (apart from one that uses all cores anyway) trades a bit of the visual quality in terms of texture loading, with better fluidity. Give it more cores and you see less/no blurries.

 

All that being said,  I'm pretty sure the autogen building improvements is what changed the way the sim handles processing and texture loading, unless the coding has been significantly changed. But that is out of my "pay grade".

 

Regards,

Share this post


Link to post

I have placed AM=116 on all my sims...I was using 244

Hi Mitch, seems cool. As I said it would be hard to see any real differences between 116 and 244. Only when in certain heavy scenery circumstances would 244 become a problem as the last core is shared by jobs four and five. Using just four should pan out as better most of the time, in more varied scenes.

 

 

Removed AM and FFTF...AM of 238 or 244

Good post, but beware that FFTF can be the cause of wild effects or do very little at all depending on system. Whereas changing AMs when they all meet the criteria of a good setup is difficult to judge. Going to 238 from 85 can help if the system is running a heavy load of plug-ins, dlls specified in dll.xml, and exe's started from exe.xml, these run in the affinity of the sim. Spreading the sim out more may not be helpful with systems using lots of networking where LPs unspecified for the sim will see more use.

 

 

Irrespective of these AMs, we're talking about four cores, 8 LPs or not we've only got four cores. More cores are coming and it's a duty of software to worry about that. My antivirus scanner creates twelve jobs with HT enabled, six competing with another six, two per core on my six core, kills the system. With HT disabled there are only six, and the system works much better with only those six. Problem is, turning off HT makes that six core system slouch along a bit. I don't even think about switching HT off for that reason.

 

 

There is no correct AM, we can get close on the HT four core with 116 or 85, and we can get close on the HT six core with 340 or 1360. Understanding why 116 and 340 came about is what counts. It does not matter who 'it' works for and who it does not work for, what matters is how it works, what it does and what options we have - that's the point of these discussions, I'm perfectly happy spelling it out.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Going to 238 from 85 can help if the system is running a heavy load of plug-ins, dlls specified in dll.xml, and exe's started from exe.xml, these run in the affinity of the sim.

 

Steve- first, thanks for your commitment to helping others with your very sound technical guidance. I follow closely. If I use AM 170, HT on (specs below) and start FSX to the free flight screen then start my add ons as admin (ASN, FSXFlight, and PilotEdge client) will the add ons utilize non FSX LPs or do I need to do something else to keep them from interfering?

[CPL]  I9-9900K @5.0GHz HT ON, Maximus XI Hero, ASUS TUF RTX4080 OC, 32GB DDR4 3200 14, 1TB NVMe SSD, 500GB SSD, 1TB HDD, 40" Samsung 4K TV, Honeycomb Alpha & Bravo, Logitech Rudder Pedals, WIN11

Share this post


Link to post

That's the trick. Our AM will only succeed if we take care with addons. Once the sim is up and running as you say, the jobscheduler will try to take care of things by placing addon threads on the least active cores. We can improve the likelihood of that by starting addons with some kind of affinity setup. I suggest using the .bat batch file method: Start an app with Affinity batch file (.bat) since this uses the system startup procedure that initiates the addon into an affinity space. It's important to note that moving an app by changing the checked/unchecked CPUs in Task Manager, Set Affinity menu item, may not always result with the action intended and can bunch threads inefficiently. Some addons do very little, but others may set off a big surge of activity every now and then. Basic rules; keep the addon exes off of the first core presented to the sim in the AM, and give these addons at least two logical processors.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

 

Background processes of the sim can take seconds to complete, these don't affect fps directly. fps suffers when things become inefficient, or just too much to handle. We can watch fps to determine if the sim is running efficiently, but requires sorting trends to ascertain the real differences in performance. Dropping LOD a notch will increase fps, but rather importantly this has not increased the available performance of the system.

 

 

Looking at AM=170=10,10,10,10=7,5,3,1

 

Efficient LPs for addon exes to utilise would be from 01,01,01,00=6,4,2

 

We've got to put them somewhere so at least we can keep them off of core 0 (LPs 0,1).

 

Remember the system can still use any LPs of those cores, but addons by definition run when the sim runs, the rest we don't really care too much about.

 

 

In testing poor AMs can result in a loss of real performance. Not in fps but in how the system reacts to changes in load. Remember to do at least two flights after changing an AM or HT as the first flight will always be the least effective.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Remember the system can still use any LPs of those cores, but addons by definition run when the sim runs, the rest we don't really care too much about.

Steve as you indicate getting the addons correct are important, I have noticed with the GTN750 gauge there are options in the Flight1 config settings, you can opt to have the AM set on Auto, cores 1-8 or All.

if I set 'Auto', checking in task Manager indicates its core 'cpu7', if I change it in the config file to core 1 it sets it in Task manager to 'cpu0' is this a hinder or helpful having it on one core or will it be bettet set to 'ALL'

 

bob

 

ps running AM=116

Share this post


Link to post

The problem is people just plugging in random AM values without having any idea what they actually mean.

 

If you're going to experiment, at least type the numbers into Windows Calculator in Programmer mode and understand what the binary means. I've seen some crazy AM values like four threads running on two physical cores on a HT-enabled Quad-Core CPU etc. Of course you're going to get blurries and stutters when you're deliberately sabotaging CPU performance like that.


Asus Prime X370 Pro / Ryzen 7 3800X / 32 GB DDR4 3600 MHz / Gainward Ghost RTX 3060 Ti
MSFS / XP

Share this post


Link to post

The problem is people just plugging in random AM values without having any idea what they actually mean.

 

If you're going to experiment, at least type the numbers into Windows Calculator in Programmer mode and understand what the binary means. I've seen some crazy AM values like four threads running on two physical cores on a HT-enabled Quad-Core CPU etc. Of course you're going to get blurries and stutters when you're deliberately sabotaging CPU performance like that.

I think that is the problem as well. I've seen 14, 84, 85, 116, 170, 240, 244 and many others. While I feel I'm pretty tech savvy, I most certainly do not understand binary. SteveW's posts are very helpful and thought out but many are over my head. So you have people plugging in numbers and hoping they magically work to perfection.

 

Might be a good idea for a utility that can determine AM for people.


Jason Weaver - WestWind Airlines; FlyUK Airlines; VirtualUnited.org

5.jpg

Banner_MJC12.png

Share this post


Link to post

Might be a good idea for a utility that can determine AM for people.

 

The tool is called "calculator" and comes with every Windows build, which you have to use in the "Programmer" mode. The only "trick" you need to know is that counting the processors is a little bit odd and starts from the "right". Means, a four core has core 3, core 2, core 1 and core 0, now, AM either turns the core on ("1") or off ("0"). Like this, you can easily play around using the calculator on your own. If you want core 3 on, core 2 on, core 1 on and core 0 off (for example to use core 0 for other tools) the binary code is 1110. Put this into your calculator in binary mode ("Bin") and switch to "Dec" and it will tell you the AM number ("14" in this case).


Greetings, Chris

Intel i5-13600K, 2x16GB 3200MHz CL14 RAM, MSI RTX 4080 Gaming X, Windows 11 Home, MSFS

Share this post


Link to post

I think that is the problem as well. I've seen 14, 84, 85, 116, 170, 240, 244 and many others. While I feel I'm pretty tech savvy, I most certainly do not understand binary. SteveW's posts are very helpful and thought out but many are over my head. So you have people plugging in numbers and hoping they magically work to perfection.

 

Might be a good idea for a utility that can determine AM for people.

http://www.gatwick-fsg.org.uk/affinitymask.aspx?SubMenuItem=hardware

Share this post


Link to post

That's the trick. Our AM will only succeed if we take care with addons. Once the sim is up and running as you say, the jobscheduler will try to take care of things by placing addon threads on the least active cores. We can improve the likelihood of that by starting addons with some kind of affinity setup. I suggest using the .bat batch file method: Start an app with Affinity batch file (.bat) since this uses the system startup procedure that initiates the addon into an affinity space. It's important to note that moving an app by changing the checked/unchecked CPUs in Task Manager, Set Affinity menu item, may not always result with the action intended and can bunch threads inefficiently. Some addons do very little, but others may set off a big surge of activity every now and then. Basic rules; keep the addon exes off of the first core presented to the sim in the AM, and give these addons at least two logical processors.

 

Background processes of the sim can take seconds to complete, these don't affect fps directly. fps suffers when things become inefficient, or just too much to handle. We can watch fps to determine if the sim is running efficiently, but requires sorting trends to ascertain the real differences in performance. Dropping LOD a notch will increase fps, but rather importantly this has not increased the available performance of the system.

 

 

Looking at AM=170=10,10,10,10=7,5,3,1

 

Efficient LPs for addon exes to utilise would be from 01,01,01,00=6,4,2

 

We've got to put them somewhere so at least we can keep them off of core 0 (LPs 0,1).

 

Remember the system can still use any LPs of those cores, but addons by definition run when the sim runs, the rest we don't really care too much about.

 

 

In testing poor AMs can result in a loss of real performance. Not in fps but in how the system reacts to changes in load. Remember to do at least two flights after changing an AM or HT as the first flight will always be the least effective.

Thanks Steve! Great as usual. System runs super this way.

 

The problem is people just plugging in random AM values without having any idea what they actually mean.

 

If you're going to experiment, at least type the numbers into Windows Calculator in Programmer mode and understand what the binary means. I've seen some crazy AM values like four threads running on two physical cores on a HT-enabled Quad-Core CPU etc. Of course you're going to get blurries and stutters when you're deliberately sabotaging CPU performance like that.

Agreed in general.  I have a pretty extensive EE (digital design) and software background and I built my system. I don't plug in random AMs (or random anything) without a clear reason and at least a basic understanding.

 


[CPL]  I9-9900K @5.0GHz HT ON, Maximus XI Hero, ASUS TUF RTX4080 OC, 32GB DDR4 3200 14, 1TB NVMe SSD, 500GB SSD, 1TB HDD, 40" Samsung 4K TV, Honeycomb Alpha & Bravo, Logitech Rudder Pedals, WIN11

Share this post


Link to post

i got a Intel Core i5-6400 6 MB Skylake Quad-Core & the task manager shows only 4 threads

 

should i be using AM

Share this post


Link to post
Guest
This topic is now closed to further replies.
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...