Avidean

Setting Affinity on other programs launched by exe.xml

Recommended Posts

So I guess this appiles to FSX too but i use P3D V2.

I have found that setting the affinity of programs that run along side P3D V2

to use core 1,2 and 3 only gives slightly better performance. However it

is a pain to use the task manager to set the affinity of each program each time

I run the sim. I have already figured out how to permanently assign an affinity

Mask to a program but I am having difficulty with programs that are launched

by exe.xml

 

Setting the affinity permanently involves editing the Target field in the properties of

the programs shortcut like so. Here is an example:

 

before: "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"

this target will launch TrackIR using all cores.

 

After edit: C:\Windows\System32\cmd.exe /C start "" /affinity 0E "C:\Program Files (x86)\NaturalPoint\TrackIR5\TrackIR5.exe"

This target will launch TrackIR using cores 1,2 and 3 only.

 

Not going to get into why that's another discussion.

 

So the problem arises with EZDOK Camera.

 

EZDOK is launched by the exe.xml

 

My exe.xml reads:

  <Launch.Addon>
    <Name>EZdok camera addon</Name>
    <Disabled>False</Disabled>
    <Path>C:\Program Files (x86)\EZCA\EZCA.exe</Path>
  </Launch.Addon>
</SimBase.Document>

 

 

So if I create a shortcut for EZCA.exe and edit the target to read:

C:\Windows\System32\cmd.exe /C start "" /affinity 0E "C:\Program Files (x86)\EZCA\EZCA.exe"

 

And then edit the exe.xml to read:

 

<Launch.Addon>
    <Name>EZdok camera addon</Name>
    <Disabled>False</Disabled>
    <Path>C:\Windows\System32\cmd.exe /C start "" /affinity 0E "C:\Program Files (x86)\EZCA\EZCA.exe"</Path>
  </Launch.Addon>
</SimBase.Document>

 

It stand to reason that when Prepar3D.exe is executed EZDOK will be started automatically

using cores 1,2 and 3 only.

 

However this does not happen. In fact after making the edits the edits EZDOK does not launch at all.

 

Any suggestions?


 

 

 

Share this post


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

Put another way is there a config file in EZDOK where something like "Affinity Mask=" can be added for the desired affect?

Share this post


Link to post

Hello:

 

This is an interesting idea; for more options and related info on how the "Shortcut" CMD line might be configured for Affinity Mask", see:

 

https://www.techenclave.com/community/threads/cpu-affinity-made-easy.10995/

 

http://www.tech-recipes.com/rx/37272/set-a-programs-affinity-in-windows-7-for-better-performance/

 

 

Multi-core CPU HEX equivalency tables for CPU core "Affinity Mask" are shown here:

 

http://blogs.msdn.com/b/santhoshonline/archive/2011/11/24/how-to-launch-a-process-with-cpu-affinity-set.aspx

 

 

...and here:

 

http://www.agony-unleashed.com/index.php?/topic/11905-processor-affinity/#entry156722

 

 

...along with examples of setting CPU "Task Priority" level from the shortcut CMD line:

 

http://www.agony-unleashed.com/index.php?/topic/11905-processor-affinity/

 

 

FYI: For years, I have used a freeware convenient and unobtrusive "snap-in" for Windows Task Manager called "PRIO" which allows saving ones Affinity Mask and Task Priority settings for 'most' (...but not all) processes, with access to other useful Windows info and settings from a tabbed GUI in Windows TaskManager:

 

http://www.prnwatch.com/prio/

 

 

Hope this helps ! :smile:

 

GaryGB

Share this post


Link to post

So I guess this appiles to FSX too but i use P3D V2.

I have found that setting the affinity of programs that run along side P3D V2

to use core 1,2 and 3 only gives slightly better performance. However it

is a pain to use the task manager to set the affinity of each program each time

I run the sim. I have already figured out how to permanently assign an affinity

Mask to a program but I am having difficulty with programs that are launched

by exe.xml

 

[middle sections from the opening post of this thread omitted for brevity in this quote]

 

It stand to reason that when Prepar3D.exe is executed EZDOK will be started automatically

using cores 1,2 and 3 only.

 

However this does not happen. In fact after making the edits the edits EZDOK does not launch at all.

 

Any suggestions?

 

Hi Again:

 

Sorry for the delay in getting back to this thread.

 

FYI: I don't yet have P3D and EZCA installed to allow testing this 'personally', so perhaps you might also inquire in the "official" EZdok Camera add-on support forum, while awaiting replies from others here who have a similar installation:

 

http://www.simforums.com/forums/ezdok-software_forum39.html

 

 

 

Additionally, you may wish to test your exe.xml file with a full configuration of both the:

 

< Disabled > False< /Disabled >  ...and  <ManualLoad> parametric elements so that 'EZCA' execution is done step-wise:

 

http://www.prepar3d.com/SDKv2/LearningCenter/utilities/simconnect/simconnect.html#The%20EXE%20xml%20and%20DLL%20xml%20files

 

 

...as discussed in these pertinent threads on EZCA and exe.xml

 

http://forum.avsim.net/topic/329443-how-to-generate-a-new-exexml-file/

 

http://forum.avsim.net/topic/428438-ezdok-help-root-section-in-exexml-file-not-found/

 

 

PS: After first making a backup of your original "active" exe.xml file inside a ZIP file, when editing exe.xml be certain that after editing exe.xml, it is being saved with the required "xml" file extension" rather than "txt"

 

 

Ex: If using Windows NotePad, this is done by setting:

 

Menu > File > Save As > File Name > Exe.XML

 

...and:

 

Menu > File > Save As > Save As Type > All Files (*.*) . :wink: 

 

Hope this might help ! :smile:

 

GaryGB

Share this post


Link to post

If you don't mind spending some cash, you may wish to ckeck out Process Lasso. You can set affinity and priority for any program. Abstracts away much of the complexity.

Share this post


Link to post

 

 


Sorry for the delay in getting back to this thread.

 


If you don't mind spending some cash

 

Thanks for the replies. I am a bit busy this week but I'll look into all of that soon:-)

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