Jump to content
Sign in to follow this  
angeli662

AffinityMask - Why?

Recommended Posts

3 hours 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.

I switched from 85 to 245, and set up TrackIR to run on the last two cores only, and... WOW.  85 was running nicely but 245 is even smoother now when panning in the VC.  Thank you!


- Kevin

Windows 10 / i9-10900k / Zotac RTX-3080 Trinity OC (12GB) / MSI MEG Z490 ACE mobo / Corsair H150i RGB PRO XT liquid cooler / 32GB Corsair Vengeance LPX 3333MHz C16 DDR4 RAM / Dell Alienware AW3418DW WQHD 3440x1440 GSync / Samsung 970 EVO Plus M.2 2TB (OS) & 860 EVO 4TB SDD / WD Caviar Black 4TB HDD  / EVGA Supernova 850 G5 PSU / Be Quiet Dark Base Pro 900 rev 2 case / Virpil Warbird base with ThrustMaster Warthog HOTAS grip / MFG Crosswind rudder pedals / Virtual-Fly TQ6+ throttle quadrant / Winwing Orion HOTAS F-18 Throttle / Virpil TCS+ collective base with Hawk-60 grip / Saitek Trim Wheel / Saitek Radio and Switch Panels / Winwing Combat Ready Panel / Tobii 5

Share this post


Link to post

Steve

For v4 shall i stay with 116 or perhaps try a different af mask?

Thanks

Mike

Share this post


Link to post
6 hours ago, mikeymike said:

116 has been working great with ht on

I7 4790k

+1


Specs: Win10, 4790K, nVidia 1080ti, Saitek Yoke+Quadrant+Radio/Switch and AP panels, VRInsight 737 overhead, Virtual Avionics 737 MCP. 3 x 1440*900 main display + 1024*600 VDU display. NLR V3 Motion seat. Oculus DK2 CV1 HTC Vive VR headsets.

Share this post


Link to post
6 hours ago, SteveW said:

With a .bat file use something like:

start /B "" /affinity A0 "C:\Program Files (x86)\FSWeather\FSWeather.exe"

Where A0=10,10,00,00 - the app will start only on those two cores and be restricted to only those. When using programs like proc lasso if the app is started first it will start on 11,11,11,11 and then be corralled into 10,10,00,00 and is not the intended result. The .bat method ensures the app starts only on those LPs we want, make sure any affinity changing apps do the same.

 

instead of creating a batch file, can also create a shortcut that launches an .exe with /affinity assigned to it.  

see https://www.eightforums.com/tutorials/40339-cpu-affinity-shortcut-program-create-windows.html

for this to work, have to launch the shortcut as an admin (or config to run as admin).  

I have AM=01011101 (93d) for p3dv4, so assigned trackIR to 00000010 (02 hex), and ASP4/ASCA to 10100000 (A0 hex).  Works well.

 

 

  • Upvote 1

i9-10900k @ 5.1GHz 32G XMP-3200 | RTX3090 | 3T m.2 | Win11 | vkb-gf ultimate & pedals | virpil cm3 throttle | 55" 4k UHDTV | HP R-G2 VR | DCS

 

 

 

Share this post


Link to post

Excellent kdfw.

I'm looking at this tomorrow.

 

Cheers,

Mark

Share this post


Link to post
4 hours ago, mikeymike said:

Steve

For v4 shall i stay with 116 or perhaps try a different af mask?

Thanks

Mike

Hi Mike,

Interesting and useful point to bring in.Reason for 116=01,11,01,00 is that we would have an aggressive addon that saturates a core. If we use 85=01,01,01,01 or 245=11,11,01,01 and even if we carefully only run it only on cores of the background tasks 10,10,00,00 it stalls those cores and decreases the sim performance whatever we do. So with HT enabled we can do 116=01,11,01,00 and use four LPs and pull out the main task onto its own core, the two tasks on the third core don't max out together so yield the least decrease in performance, the rightmost pair of LPs (LP0 and LP1) are unused by the sim and the addon can there on 00,00,00,11 unable to affect the sim. Otherwise try 85 and 245.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

The shortcut method works great, because it's basically a one line batch file and similar commands work from the batch files just the same. I do find it easier to actually write out the command line in notepad before copy and paste into a shortcut box. The .bat files can be stored in a backup up location and shortcuts can be dragged and dropped from them onto the desktop or menu just the same. An advantage of the bat file method can start a selection of apps and the sim itself.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post
6 hours ago, newtie said:

start /B "" /affinity A0 "C:\Program Files (x86)\FSWeather\FSWeather.exe"

OK, I'm assuming 'start /B' is start the batch file and is not dependent on anything else, that is, using a Z instead of a B. Is there a space between the B and ""?

What's the relationship between A0 and the AM? What would 85 look like and why?

The rest makes sense.

 

Thanks,

Mark

/B? can't remember Mark without looking up some help page on the web for that stuff. A0 is simply the Hex value 10100000=160 decimal can probably do a decimal version of the command but that line works fine with Hex as it stands simply replace app path with path of your exe and Hex value of mask required. 85=01010101 would be 55 Hex but you would leave the sim to set it's own affinity through setting the jobscheduler value AffinityMask.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

...the following line worked well in both the shortcut Target and in the .bat file and uses a decimal value for the AffinityMask which may be preferred:

C:\Windows\System32\cmd.exe /c start "Notepad" /affinity 9 "C:\Windows\Notepad.exe"


Steve Waite: Engineer at codelegend.com

Share this post


Link to post
1 hour ago, kdfw__ said:

can also create a shortcut that launches an .exe with /affinity assigned to it.

Thanks, it's a good point - we can use .bat commands in the Target line of shortcuts, I've included that in my forum help pages on using bat files.


Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Guys, when testing P3D and viewing graphs in Task Manager, stuff like that, be sure to have the sim with settings that do not flatline it. Here are some shots of VSync On/Off and Unlimited on the Slider, with increasing sim features until it flatlines in the lower graph:

P3DVSyncLimits.jpg

 

More on that from my forum help page 'P3D VSync and Performance Tuning': http://www.codelegend.com/forums/viewtopic.php?f=2&t=698&p=5762#p5762

  • Upvote 1

Steve Waite: Engineer at codelegend.com

Share this post


Link to post

Very well explained Steve . Thanks.

regards

Gerard

  • Upvote 1

13900 8 cores @ 5.5-5.8 GHz / 8 cores @ 4.3 GHz (hyperthreading on) - Asus ROG Strix Gaming D4 - GSkill Ripjaws 2x 16 Gb 4266 mhz @ 3200 mhz / cas 13 -  Inno3D RTX4090 X3 iCHILL 24 Gb - 1x SSD M2 2800/1800 2TB - 1x SSD M2 2800/1800 1Tb - Sata 600 SSD 500 Mb - Thermaltake Level 10 GT case - EKWB Extreme 240 liquid cooling set push/pull - 2x 55’ Sony 4K tv's as front view and right view.

13600  6 cores @ 5.1 GHz / 8 cores @ 4.0 GHz (hypterthreading on) - Asus ROG Strix Gaming D - GSkill Trident 4x Gb 3200 MHz cas 15 - Asus TUF RTX 4080 16 Gb  - 1x SSD M2 2800/1800 2TB - 2x  Sata 600 SSD 500 Mb - Corsair D4000 Airflow case - NXT Krajen Z63 AIO liquide cooling - 1x 65” Sony 4K tv as left view.

FOV : 190 degrees

My flightsim vids :  https://www.youtube.com/user/fswidesim/videos?shelf_id=0&sort=dd&view=0

 

Share this post


Link to post

hello all

with the possibility to overclock per core on a modern bios an motherboard, with an am=245, wich core should be better to oc with a I7 7700K?

thanks


Frédéric Giraud

Share this post


Link to post
11 hours ago, SteveW said:

/B? can't remember Mark without looking up some help page on the web for that stuff. A0 is simply the Hex value 10100000=160 decimal can probably do a decimal version of the command but that line works fine with Hex as it stands simply replace app path with path of your exe and Hex value of mask required. 85=01010101 would be 55 Hex but you would leave the sim to set it's own affinity through setting the jobscheduler value AffinityMask.

Thanks Steve. How do I check that AS16 is in fact tied (using only)  those two assigned cores? I ran that .bat this morning prior to going to work and it seemed to work fine with AM=85. I wanted a way to confirm that a TaskManager doesn't show what's actually running.

 

Cheers,

Mark

Share this post


Link to post

Other than Task Manager details page - set affinity menu item shows current affinity in the checkboxes, I don't know of an app that does that for any process but there's probably something. The affinity of most processes is uninteresting compared to apps like P3D and FSX.


Steve Waite: Engineer at codelegend.com

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
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...