Sign in to follow this  
Jimm

Affinity Mask: An Observation

Recommended Posts

I recently bit the bullet, again, reinstalling everything.  I won't get into specifics but recent OOMs I experienced made me start an investigation.  After reinstalling a basic setup, my tubeliners, ORBX FTX Global, ASN, REX, with a few 3rd party airports, I looked into possibly making some changes to my cfg file and even my nvidia settings.  One of the changes I made was incorporating an Affinity Mask setting.  I went through a tut here at AVSIM to determine the appropriate number and plugged it in.  I left the rest of the cfg file alone, cloning other settings with a previously saved version I had before the reinstall.  I made a couple of changes to my nvidia display, via the control panel and went ahead and flew a route.

 

My route was rather short, EGKK to EGPF, with an Airbus A318 from Aerosoft.  About half way through my flight I noticed that the ground scenery over England suddenly started to look blurred.  Not just a slight blur, but as if I was going to be flying over desert.  I also noticed that my clouds were not refreshing properly, leaving large gaps between refresh, and even then, the clouds were looking off.  I took at the ground below, and I noticed that the once beautiful ground shadows looked like tetris blocks.  Before approach, at about 4000 feet, the ground started to look better and so did the clouds, but from that point to touchdown, all of the surrounding ground textures were very blurry.  With the exception of the airport scenery, which looked fine, everything else look bad.  I completed the flight without any issue.

 

Afterwards, I thought about what would have caused this issue, and realized that the AM setting I placed in cfg could be the cause.  I went ahead and commented out the AM line in my cfg and later on, performed a new flight.  This time, my flight took me from EGKK to LOWW, a much longer flight with a slightly different aircraft.  I had OpenLC Europe installed and active within FTX Central as well.  After a 2hr and 15 min flight, the entire flight was beyond perfect.  I had no issue with my weather, clouds (saw some great thunderstorms with tops above FL400.  As for the scenery, it was clean and clear, no blurries at all.

 

With this change, I am convinced that AM doesn't always work or rather, is needed.  I never used it before for v3, up until recently, which had the bad effects from the flight mentioned initially.  Changing things back to no AM has made a difference and I don't really think I need it anymore.  All of this was just an observation for those who may consider using it.  I guess you need to determine of any issues you have with P3D warrant it's use.

 

-Jim

Share this post


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

Here come the two critical questrions, Jim: Which processor do you use (i.e. # of physical/logical cores)? Do you have Hyperthreading in the BIOS on or off?

 

Kind regards, Michael

Share this post


Link to post

I have an intel i7-4790K, oc'd to 4.5ghz.  I never ever ever touched hyperthreading so it would be a yes, I use it. :)

 

I have a feeling your answer will be, "well sure, with your processor, you never needed to use AM", and if that's the case, I'll be happy with that response and continue on with great, stable scenery and wonderfully beautiful puffy clouds. :D

 

-Jim

Share this post


Link to post

No, The 4790 has 4 cores and 8 threads, that's the same as mine (although mine is weaker). If you have HT off, most would agree you should not use any AM with a 4 core processor. This is what I use at present.

 

If you have HT on (check in the BIOS, or the Task Manager/Resouce Monitor should show you the # of threads) things get more complicated, but usually it's suggested to use an AM in this case. I expect Steve Waite will jump in soon and tell you what to do in this case  :smile: Until then, you can read his page http://www.codelegend.com/forums/viewtopic.php?f=2&t=532

 

 

Kind regards, Michael

  • Upvote 1

Share this post


Link to post

No, The 4790 has 4 cores and 8 threads, that's the same as mine (although mine is weaker). If you have HT off, most would agree you should not use any AM with a 4 core processor. This is what I use at present.

 

If you have HT on (check in the BIOS, or the Task Manager/Resouce Monitor should show you the # of threads) things get more complicated, but usually it's suggested to use an AM in this case. I expect Steve Waite will jump in soon and tell you what to do in this case  :smile: Until then, you can read his page http://www.codelegend.com/forums/viewtopic.php?f=2&t=532

 

 

Kind regards, Michael

Well then this begs the question as to why I would need it if everything is running fine?

 

-Jim

Share this post


Link to post

It's not just the number of cores... it's the processor architecture. The 4770K and above processors seem to function best without AM as they manage processing better.  I believe there are a few threads on this.

 

My very best to all.

Share this post


Link to post

"About half way through my flight I noticed that the ground scenery over England suddenly started to look blurred.  Not just a slight blur, but as if I was going to be flying over desert."

 

Same here, with AF=14 (i5 3470)

 

In the middle of the flight, i changed the AF via task manager, and all the blurries gone.

Share this post


Link to post

 

 


In the middle of the flight, i changed the AF via task manager, and all the blurries gone.

 

With blurries, we think in terms of ongoing maintainable processor throughput as it infills and backfills the terrain. With P3D, we no longer think in terms of frame rates, more about blurries which are the way of knowing that the system is overloaded. P3D has tried to make it so that we can complete a flight with less compromise on framerates and more compromise on terrain rendition (but not at the critical airport destination where the terrain needs to appear so that we can land). If there aren't enough processing resources, this is a better approach than compromising frames. It is all about throughput of processing. If you change the AF mid flight, I think you can temporary cause processing to complete throughput of rendition, but later it will fall behind again because the underlying cause is not addressed. Affinity mask is able to influence (but not control) the job-scheduling load outside of the simulator and that is why it is helpful when addons are running as well as the simulator.

Share this post


Link to post

It's not just the number of cores... it's the processor architecture. The 4770K and above processors seem to function best without AM as they manage processing better. I believe there are a few threads on this.

 

My very best to all.

This statement is totally incorrect.

 

There are enough threads with enough info on HT and AM that prove that using HT with a correct AM gives the best performance and with the smoothest experience...

 

( my cpu : 5820K@ 4.3 Ghz , HT on and AM=340 , addons outside P3D on cores 0,1,10 and 11 )

  • Upvote 1

Share this post


Link to post

Jim- I have the same exact processor but not overclocked above 4.0.    I've tried a number of AM settings as well as the FTFF tweak and both have provided no advantage.  And in fact when I have the AM tweak in the cfg it has produced blurred terrain.  FTFF produced slower loading textures when in the cfg. 

 

While I have read many of SteveW's posts and his fantastic work with this setting, I have yet to gain advantage from AM. 

 

But then again maybe I'm not adjusting it quite right. 

 

Pretty happy with the performance now.  Only have trouble in real heavy cloud coverage.  And that's cause my GPU is a tad on the old side.  GTX 760. 

Share this post


Link to post

Jim- I have the same exact processor but not overclocked above 4.0.    I've tried a number of AM settings as well as the FTFF tweak and both have provided no advantage.  And in fact when I have the AM tweak in the cfg it has produced blurred terrain.  FTFF produced slower loading textures when in the cfg. 

 

While I have read many of SteveW's posts and his fantastic work with this setting, I have yet to gain advantage from AM. 

 

But then again maybe I'm not adjusting it quite right. 

 

Pretty happy with the performance now.  Only have trouble in real heavy cloud coverage.  And that's cause my GPU is a tad on the old side.  GTX 760. 

Jason, thanks for your input.  I was beginning to think I was the only one who didn't benefit from using AM.  Since i started to use P3D v3.2, I recognized the huge improvement to fps and overall performance.  I only recently read some posts concerning AM and it's potential benefits, thinking perhaps I might gain some more performance, but like you, it got worse.  As you say, we may not be setting it correctly, but to be honest, if our sim works fine and to our liking, I guess we can do without.  Only one potential benefit I could glean from Michael's link above was heat.  Spanning the cores properly, there may be a benefit of reduced heat, but again, I run my sim on a laptop and it seems to expel the heat as efficiently as it can.   Since my typical length of flights span a little over 2 hours at a time (which is about the norm for what i have time for), I cannot complain one bit about how everything comes together.  I got my cloud issue straight with REX and ASN and my settings in P3D are just right.  I only run FTX Global nowadays, since I fly tubeliners and I don't receive any added benefit of having ORBX regions (or even Vector for that matter) installed.  As long as my sim doesn't look like a blurry mess, I'm happy.

 

-Jim

Share this post


Link to post

I think that true benefit of using AM becomes distinctive when you're utilizing the external applications such as ASN, FSC, RC4, PATC...too many to mention. "Naked" P3D does not need AM. 

Share this post


Link to post

I think the whole AM thing needs to be revisited but only about version 3.2

 

In earlier versions of P3D I always had an AM setting in my CFG per the suggestions made on this forum, and it did help, but somehow with V3.2 it doesn't help anymore. Something has changed. I removed the AM settings and the sim works much better for me. Doesn't no entry in the CFG still default to AM=14? I only use one tweak FFTF 0.10. My rig is basically an i7 4770 oc 4.3 with a 980ti. I have not touched HT. It runs very smoothly with very few blurries. I still use NVI at 4xSSGA to help the visuals. Again, it is fine, no slow down. That being said, I don't run my sliders all the way to the right. I have found decent balances between visuals and performance.

Share this post


Link to post

There are enough threads with enough info on HT and AM that prove that using HT with a correct AM gives the best performance and with the smoothest experience...

 

Well ... I guess the prize question then is: What is the correct AM?

 

Tweaking FSX and P3D seems to require really specialist knowledge these days. I'll jump in when I have a really high-end new system.

Share this post


Link to post

This statement is totally incorrect.

 

There are enough threads with enough info on HT and AM that prove that using HT with a correct AM gives the best performance and with the smoothest experience...

 

( my cpu : 5820K@ 4.3 Ghz , HT on and AM=340 , addons outside P3D on cores 0,1,10 and 11 )

 

Correct I'm here with Gerard ;-)

Share this post


Link to post

The effects of hyperthreading and affinity masks and how these affect P3D (and FSX) is well understood.

 

An AM in the cfg is not enough on its own, it is also required to know what addons are doing and that they must be configured accordingly. If we've got worse performance with an AM, it is very simple, we got it wrong.

 

When we do not apply an AM, we are actually leaving the AM at default, that is with all logical processors enabled.

 

When the sim runs it splits into the same number of jobs that it finds cores (or rather Logical Processors).

 

HT enabled simply sets each core to emulate two cores by sharing the bandwidth of one core, these appear as two cores to software. HT has the advantage of reducing switching time between processes. Without an AM and with HT enabled, we get double the sim job count, two per core - unless we are using a dual core CPU, we don't want that.

 

Two equal threads running on a non HT core are comprehensively outperformed by the same two threads on an HT processor, one per LP. Both jobs on the same HT LP will perform the same as they do on the non-HT enabled core. It should be obvious we can increase the overall performance of the sim and its associated plug-ins if we know how to utilise HT properly.

 

The sim creates monolithic threads which are split into fibres. These fibres cannot benefit from HT enabled cores because they are switching within their main threads, which are running solely on one LP.

 

Addons often mean simconnect and require networking, and these are best offered improvements that HT can provide. The system will utilise HT very well when care is taken.

 

When the sim is split into four parts, the first thread job becomes leanest, with three jobs serving it. If we provide less than four LPs to the sim, the sim jobs are combined. If we do not provide an AM with HT enabled, those jobs occupy both LPs of each core, reducing the performance of each core since they are shared by monolithic threads of the sim each vying for maximum throughput when needed. When we split the sim into more than four parts, the main thread does not split out any more, but instead is put to task servicing those extra jobs, on a 4GHz class CPU these extra jobs add nothing.

 

What extra jobs do actually do is to expand the effective LP count running below the sim. When the sim uses system resources these extra LPs come into play, however when the sim is heavily set these extra jobs squeeze out the other processes on those extra LPs which is a compromise.

 

Depending on the setup these extra jobs beyond four may actually be a problem, in fact they generally are. Gerard has some good data and tested these situations very well, and came to the same conclusion.

 

So to conclude, four LPs presented to the sim means the sim gets the best configuration it can have. That's why no AM and HT disabled works very well (esp. on a four core CPU). When we have six or eight or more cores, those excess jobs beyond four are filled with sim jobs that reduce the performance of the sim main job and addons, and the system interaction with the sim. But it's not bad performance because we have allocated at least four LPs so we get the leanest main job, and we've got more cores for system processes to find holes to run in. It may be good performance but it's not the best performance.

Share this post


Link to post

i run titan card on an I 7  3770k 3.50 ghz with windows7 , P3D version 3.1 mostly flying with NGX , dash8 400 and FSDT airports like KLAS, KLAX, CYVR, flightbeam KSFO and  ASNEXT for weather. i have never turned on HT . what would you suggest for AM? i have it set to 0. running the sliders pretty much in the middle i only get 14 frames at FSD vancouver with occasionnal stutters when heavy overcast.

 

henry

Share this post


Link to post

The first sim job takes maximum bandwidth often so we try to ensure addon activity does not utilise that core. The second sim job does not often require maximum throughput, so we can put an addon there. Job three often draws maximum use of a core, and job four usually slightly less than that. So we can put addons on the same core as job four, and at a push we can put addons on the core with job three as well. A good rule of thumb is to allocate at least two LPs per exe. If we only allocate one, test that addon thoroughly especially if it's a simconnect client.

 

Let's look at four cores HT off no AM - we have LPs 0,1,2,3 and the sim on all four LPs, main sim thread on LP0:

addons should be kept off of LP0, so allocate two LPs to each addon from LPs 1,2,3.

 

Now with four cores HT on we have LPs 0,1,2,3,4,5,6,7, remember that 0 & 1, and so on, are sharing a core so we allocate an AM=85=01,01,01,01 (or 170=10,10,10,10) to more or less replicate the HT Off situation. However addons without AM support will utilise these as if they are regular cores and double the thread count on each HT core. So with AM=85 we might assign addons to LPs 3,5,7. Notice 3,5,7 are also the brother LPs of the LPs utilised by the sim 0,2,4,6.

 

Regarding the differences with P3D v3.2, this version handles sim job counts beyond four slightly better now. So if we allocate five LPs to the sim, this will reduce the performance less with P3Dv3.2, than with earlier versions of P3D (and FSX).

Share this post


Link to post

Steve, with HT off and no AM, would you suggest limiting the fps externally (NI)?

Thanks ;-)

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.

Share this post


Link to post

If members think it works well for them, let it be.  If members think it does not work, like me, then let that be.  Everyone is therefore happy.  But, if one who has tweaks such as the AM and has unexplained crashes, then this should be their first clue.  Rebuilding the FSX.cfg (not sure yet about the P3D.cfg) is well known as the best fix for most crashes.

Share this post


Link to post

What does not work for you Jim?

Share this post


Link to post

Before everyone starts flexing their brains, I should clarify that my post was intended not to start a tweak war, nor a Ken Burns documentary about the bits and bytes of coding.  I've seen a lot of discussion lately about the use of AM and I came forward to inform others who weren't sure whether to use it or not, that it's usage on my machine actually was not any more effective than without.

 

I honestly do not see any negative implications in not using the AM setting line in my cfg.  I'm not saying I'm an exception to the rule, just that AM may not be that proverbial magic bullet that a lot of people are looking for.

 

As far as solutions to crashes, it's much easier to backtrack when you keep track of whatever you set differently than from what you had.  Sage advice was given a long time ago by trusted sources that when it comes to setting up your sim, make one change at a time and then test, so if things go south, you'll know immediately what it was that caused the issue...simple as that.  The same thing goes for setting changes to external sources.

 

I have now given up trying to figure it all out.  It's like that gift horse in not looking in his mouth.

 

-Jim

Share this post


Link to post

It is not about whether "it works" (whatever it is) or not, it's about how to use stuff. If you got a tray that can handle four drinks, it's a waste of time comparing it to a tray that can handle six, other than you only got space for four. People chiming in with stuff about whether it works for them or not without any technical data are blurring the subject back into the realms of mysticism. HT works, and AMs are a necessary fact of life.

  • Upvote 1

Share this post


Link to post

It is not about whether "it works" (whatever it is) or not, it's about how to use stuff. If you got a tray that can handle four drinks, it's a waste of time comparing it to a tray that can handle six, other than you only got space for four. People chiming in with stuff about whether it works for them or not without any technical data are blurring the subject back into the realms of mysticism. HT works, and AMs are a necessary fact of life.

Then if AM is necessary, how come LM hasn't released instruction concerning it's usage, and how it needs to be set for every user?

 

-Jim

Share this post


Link to post
Guest
This topic is now closed to further replies.
Sign in to follow this