angeli662

AffinityMask - Why?

Recommended Posts

On my P3D v4 without AM on a 8 core CPU the core 01 always runs about 40%  and the others around 100, so I decided to use AM=255  all cores but still core 01 around 40% could it be that is the way P3D v4 utilizes the preocessor and it doesn't matter what AM is in the config?

Share this post


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

That is because no AM specified with a four core+HT is equivalent to AM 0  is equivalent to AM 255  is equivalent to 11,11,11,11 in binary. And so you will see the sim task on LP 0 (LP zero is the binary digit '1' on the far right, which is the top left graph in Task Manager) shares core zero with the sim task on LP 1 (rightmost pair ',11'). This setup works OK but you can do better with AM=85 and keep addon exe apps on the last two cores, LPs 5 and 7.

  • Upvote 1

Share this post


Link to post

Great example Steve (as always brother).

I've lost count of the number of times I've seen Affinity Mask explained as being read Left to Right, instead of Right to Left.

 

  • Upvote 1

Share this post


Link to post
21 minutes ago, SteveW said:

That is because no AM specified with a four core+HT is equivalent to AM 0  is equivalent to AM 255  is equivalent to 11,11,11,11 in binary. And so you will see the sim task on LP 0 (LP zero is the binary digit '1' on the far right, which is the top left graph in Task Manager) shares core zero with the sim task on LP 1 (rightmost pair ',11'). This setup works OK but you can do better with AM=85 and keep addon exe apps on the last two cores, LPs 5 and 7.

Steve, this is a 8 core 16 thread no HT, are you saying AM=85 for this processor?  thanks

Share this post


Link to post

Nope was thinking you were talking four core+HT as that's the norm for 8 LPs! But I see you have the 8 core HT disabled so 85 would actually work very nice. Four cores works well 01010101=85 and those addons would be well placed too. Since you have 8 unshared cores it's going to work great under all circumstances unless you turn on HT, then some kind of AM like 340 would be better.

 

Share this post


Link to post

...by the way No AM and AM=255 are still equivalent on 8 core HT Off as I stated above so no changes as you noticed. 8 core HT On no AM=AM=0=65535=11,11,11,11,11,11,11,11.

Share this post


Link to post

Hi,

One question to Steve, like i read it, with 4 core HT disabled 15 would work nice?

 

Share this post


Link to post

Four core HT disabled no AM = 0 = 15 because you only have four binary digits.

 

..with HT off and 8 cores I would check out 01111110 = 126 (six cores used by sim) or 00111100 = 60 (four cores used) avoiding the first and last cores.

Even better! HT enabled and 00,01,01,01,01,01,01,00 = 5460 (six LPs) or 00,00,01,01,01,01,00,00 = 1360 (four LPs).

Share this post


Link to post
10 minutes ago, SteveW said:

Nope was thinking you were talking four core+HT as that's the norm for 8 LPs! But I see you have the 8 core HT disabled so 85 would actually work very nice. Four cores works well 01010101=85 and those addons would be well placed too. Since you have 8 unshared cores it's going to work great under all circumstances unless you turn on HT, then some kind of AM like 340 would be better.

 

Thanks, Steve I will give a try HT on AM=340

Share this post


Link to post

01111110 = 126 or 00111100 = 60 would be the first I would try with HT Off and 8 cores.

Share this post


Link to post

Steve can you agree to this in difference HT on off in terms of raw CPU power.

Lot here tinkering they get the same power on 4core CPU with HT on as with a 8core CPU with HT off.

The gain is for a 4core intel cpu is approx 27% not 100% with HT on even more on the new Amd Ryzen 35%

Drawbacks single core performance is slightly higher with ht off with same CPU frq 1.5%

Heat you can have up to 20-25c higher CPU temp , mostly for the AVX instruktions in flight with P3dV4 not seen that in P3dv3 only on loading flight.

Not against HT , very interested to see high clocked 7820x 7900x with ht off  in P3DV4

Share this post


Link to post

Sooo... With a Core i7 4 core with HT on, an Affinity Mask of 85 would be best?

Share this post


Link to post
4 hours ago, angeli662 said:

On my P3D v4 without AM on a 8 core CPU the core 01 always runs about 40%  and the others around 100, so I decided to use AM=255  all cores but still core 01 around 40% could it be that is the way P3D v4 utilizes the preocessor and it doesn't matter what AM is in the config?

I am getting 100% load on ALL cores and threads with my i7 6700K @ 4,5 ghz. This is when the AM for all cores is set. So I guess when i9 10-core processors come out. I will buy such one for P3D V4. @4,0 ghz it should run quite nicely.

Share this post


Link to post
38 minutes ago, westman said:

Steve can you agree to this in difference HT on off in terms of raw CPU power.

Lot here tinkering they get the same power on 4core CPU with HT on as with a 8core CPU with HT off.

The gain is for a 4core intel cpu is approx 27% not 100% with HT on even more on the new Amd Ryzen 35%

Drawbacks single core performance is slightly higher with ht off with same CPU frq 1.5%

Heat you can have up to 20-25c higher CPU temp , mostly for the AVX instruktions in flight with P3dV4 not seen that in P3dv3 only on loading flight.

Not against HT , very interested to see high clocked 7820x 7900x with ht off  in P3DV4

There's a difference in requirements between using the CPU overclocked HT Off as very high frequency may overcome the loss in HT performance., but most systems are relaxed and are not run at such high frequencies, HT makes up for that. Heat related issues can be associated with HT enabled, overclock should be moderated to accommodate HT enabled.

Another thing to note is that the P3D type app (D3D sim) is different to the Handbrake type app (video encode) which would utilise all LPs similarly and work faster and hotter with HT enabled, but P3D splits out work from the main process and each are differing in requirements, and monolithic - when P3D is split into four the first two directly concerned with the rendering stage become leanest preferring a core to themselves. Both apps would utilise all LPs available if unmasked - Handbrake would gain from HT using all LPs and wasting no cycles, where P3D without a mask will not since it will congregate threads onto the same cores when they are actually designed to split work out over more cores. The HT Logical Processor fools these apps as they are seen as full cores each, with P3D we help it out with the AM and that is essential to manage heat and power use.

Share this post


Link to post

...the moral of the story is that if we are going for fps world records then perhaps turn off HT. Otherwise turn on HT and moderate the overclock to accommodate it. With HT enabled literally hundreds of threads switching are consumed more readily even more so on an 8 core, but remember that some apps like P3D are provided with the AM setting for a real reason.

To turn off the expensive HT mode is to lose a load of throughput especially in networking and I/O which is highly threaded in Windows. What makes sense to me is to work out how to use HT to its advantage not turn it off, takes a little more care that's all.

Share this post


Link to post
10 hours ago, Jazz+Funk said:

Hi All,

You may find my Affinity Mask Calculator helpful. I have made some notes on my own findings with P3D v4, which I have documented on the page.

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

Regards,

 

Ted.

Yes Ted, so I looked through the stuff written there - not too useful unfortunately:

 

"The following example uses an affinity mask value of 4095 applied to a Hexacore CPU with Hyper-threading enabled running P3D v3.1. Note how logical core #0 thread #0 is at 100% dedicated to P3D rendering tasks. The other logical cores and threads load balance the other P3D processing requests."

 

In the example on the page linked, 4095 is 11,11,11,11,11,11 which utilises all LPs. And the graphs on the page show sim task on LP0 SHARES core zero with sim task on LP1.

Remember that the clever programming of P3D splits out work from the first task so it can run on another core? Well that's running it on the same core and loses out by unnecessary sharing of the first core for the rendering. A common mistake many are making unfortunately.

P3D is not a multi-threaded app like the video encoder which we could process two hundred frames on one hundred cores and in HT mode it would finish sooner on 200LPs. P3D does not work anything like that, the issue I see most is that the way CPUs work and the way P3D works are not completely understood.

 

 

Share this post


Link to post
11 hours ago, Piotr007 said:

I am getting 100% load on ALL cores and threads with my i7 6700K @ 4,5 ghz. This is when the AM for all cores is set. So I guess when i9 10-core processors come out. I will buy such one for P3D V4. @4,0 ghz it should run quite nicely.

Doesn't look as good as I thought.

 

Share this post


Link to post

I've been comparing AMs P3D v4 on four cores +HT:

11,11,11,01=253 main task runs well but the background loading on LP3 intercepts second task on LP2 core 1 reducing overall performance, rendering performance is staggered, and adds no increase in loading performance.

11,11,01,01=245 main task performs well and the background tasks perform well without intercepting the second task on LP2, rendering performance is not staggered.

01,01,01,01=85 main task performs well and the background tasks perform well without intercepting the second task on LP2, rendering performance is not staggered. Background tasks can sometimes take a small amount longer to load certain objects but rendering is very slightly improved.

Avoid 255 and 253, use 245 or 85. Keep addons on last two cores 10,10,00,00.

  • Upvote 1

Share this post


Link to post
16 minutes ago, SteveW said:

I've been comparing AMs P3D v4 on four cores +HT:

11,11,11,01=253 main task runs well but the background loading on LP3 intercepts second task on LP2 core 1 reducing overall performance, rendering performance is staggered, and adds no increase in loading performance.

11,11,01,01=245 main task performs well and the background tasks perform well without intercepting the second task on LP2, rendering performance is not staggered.

01,01,01,01=85 main task performs well and the background tasks perform well without intercepting the second task on LP2, rendering performance is not staggered. Background tasks can sometimes take a small amount longer to load certain objects but rendering is very slightly improved.

Avoid 255 and 253, use 245 or 85. Keep addons on last two cores 10,10,00,00.

Hi Steve-

Is there a simple way to set AM for additional apps (AS16) without having to resort tp Process Lasso. I know this can be done thru task manager. Seems to be a lot of overhead running PL. Interestingly, on V4 with me, unlimited/HT off/ Vsyc on/no triple buffer seems to work pretty well, but I only run photo scenery with no AG. Like to try AM=85 with AS on the last two LCs just to see.

 

Thanks,

Mark

Share this post


Link to post

I have no a idea about 5960X, but what you are trying to achieve? Do you have low FPS, stutters? If not, you don't need it. Texture loading is much better with all cores. 

In FSX i used AM=14 with no HT enabled, no blurry textures and there was a FPS boost. It doesn't works this way in P3D for me. For my 2700K, no affinity mask(default all cores)works the best for P3D. If i exclude one core, i get blurry ground textures - not noticed with default textures, but after i added ORBX OpenLC. So, it realy depends on your system, it may work different with 6700 - 7700K.

Share this post


Link to post
9 minutes ago, lodestar said:

I have no a idea about 5960X, but what you are trying to achieve? Do you have low FPS, stutters? If not, you don't need it. Texture loading is much better with all cores. 

In FSX i used AM=14 with no HT enabled, no blurry textures and there was a FPS boost. It doesn't works this way in P3D for me. For my 2700K, no affinity mask(default all cores)works the best for P3D. If i exclude one core, i get blurry ground textures - not noticed with default textures, but after i added ORBX OpenLC. So, it realy depends on your system, it may work different with 6700 - 7700K.

Nothing, I was just curious to why the core 01 (2nd) sits @ about 40% and the other 7  100%   whether AM=0/255, perhaps Windows 10 is using that core who knows.

don't have blurry texture in P3Dv4 quite the contrary I have LOD set 9.5 and grounds texture are very sharp.

Share this post


Link to post
15 minutes ago, angeli662 said:

Nothing, I was just curious to why the core 01 (2nd) sits @ about 40% and the other 7  100%   whether AM=0/255, perhaps Windows 10 is using that core who knows.

don't have blurry texture in P3Dv4 quite the contrary I have LOD set 9.5 and grounds texture are very sharp.

the more cores - the better texture loading :happy: 

First core is doing something different then other cores. That's ok, it is how P3D works. 

P.S. There could be a reason LM, Dovetail and others want to use all cores. I can see better scenery loading if i enable HT, but i don't know how to prove it

Share this post


Link to post
6 minutes ago, lodestar said:

the more cores - the better texture loading :happy: 

First core is doing something different then other cores. That's ok, it is how P3D works. 

Core 01 is the second core, 00, 02, 03, 04, 05, 06, 07  are @ full :mellow:, this CPU soon wold be history just like my Titans will in a couple of days :biggrin:

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