Windows Vista Forums

Setting processor affinity made easy

  1. #1


    Join Date : Dec 2008
    Posts : 1
    Vista 32
    Local Time: 10:52 PM

    Setting processor affinity made easy

    While dual core and quad core processors are a great advance in processing power, many games in XP and Vista run better on a single core. Need for Speed Underground is one such game. In my search to find an easy way to set processor affinity, I found the easy method outlined below. This method is the best I've found and actually WORKS without having to make system-wide changes.

    Enjoy!

    Here's a tip I use for some games which have problems with dual core. It saves the trouble of [alt][tab] out of the game each time, and I find it easier than creating a batch file. You may have already seen this, if so, the short answer is written in red at the bottom of this post.....

    Affinity and priority can be permanently added to an application's shortcut so that you don't have to change it every time you run it.

    To begin, create a shortcut to the game on the desktop.

    Right click the shortcut and select properties. In the "shortcut" tab, find the line for "target". Copy this in front of the target: C:\Windows\System32\cmd.exe /C START "Need for Speed Undercover" /high /affinity 1. Now, NFS Underground will automatically run in high priority on Core 0.

    Here's an example for the game Tombraider Legend which also balks at dual core processing.




    The target line originally looks like this:
    • "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"
      So I change it to this:
    • C:\Windows\System32\cmd.exe /C START "Tomb Raider" /high /affinity 1 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"
    The affinity can be set to any CPU core by changing the number to the corresponding hex value.
    1st core = 1
    2nd core = 2
    3rd core = 4
    4th core = 8
    5th core = 10 ( hexadecimal 16 )
    6th core = 20 ( hexadecimal 32 )

    The priority can have any value of either: low, normal, high, realtime, abovenormal, belownormal.



    So to run on only the 4th core at high priority you would put:
    • C:\Windows\System32\cmd.exe /C START "Tomb Raider" /high /affinity 8 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"
      or to run on the 2nd AND 3rd cores with priority realtime you would put:
    • C:\Windows\System32\cmd.exe /C START "Tomb Raider" /realtime /affinity 6 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe" (Since 2+4=6)
    Sometimes if the game needs to be run as administrator, then you get an error from not starting in the correct folder. Then also add:
    /d "<directory>"
    The end result being:
    C:\Windows\System32\cmd.exe /C START "Tomb Raider" /d "C:\Program Files (x86)\Tomb Raider - Legend" /high /affinity 1 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"

    Finally, you just need to change the icon since this will set it to the CMD icon. From the same window, click "change icon" then browse to the location of the exe.
    And if you need to run as admin, click the advanced button and check the box"run as administrator"


      My System SpecsSystem Spec

  2. #2



    Member
    Join Date : Jul 2008
    Posts : 44
    Vista Ultimate 64-bit
    Local Time: 12:52 AM


     

    Re: Setting processor affinity made easy

    Thank you so much! This works great on old games like Raganarok and Age of Empires.

      My System SpecsSystem Spec

  3. #3
    MrNeeds's Avatar

    PC Geek



    Join Date : Oct 2008
    Lymm, Cheshire, UK
    Posts : 1,823
    Vista Home Premium x64 / 7 Ultimate x64
    Local Time: 05:52 AM
    uk uk england

     

    Re: Setting processor affinity made easy

    Quote Originally Posted by Tiberius Jonez View Post
    While dual core and quad core processors are a great advance in processing power, many games in XP and Vista run better on a single core. Need for Speed Underground is one such game. In my search to find an easy way to set processor affinity, I found the easy method outlined below. This method is the best I've found and actually WORKS without having to make system-wide changes.

    Enjoy!

    Here's a tip I use for some games which have problems with dual core. It saves the trouble of [alt][tab] out of the game each time, and I find it easier than creating a batch file. You may have already seen this, if so, the short answer is written in red at the bottom of this post.....

    Affinity and priority can be permanently added to an application's shortcut so that you don't have to change it every time you run it.

    To begin, create a shortcut to the game on the desktop.

    Right click the shortcut and select properties. In the "shortcut" tab, find the line for "target". Copy this in front of the target: C:\Windows\System32\cmd.exe /C START "Need for Speed Undercover" /high /affinity 1. Now, NFS Underground will automatically run in high priority on Core 0.

    Here's an example for the game Tombraider Legend which also balks at dual core processing.




    The target line originally looks like this:
    • "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"
      So I change it to this:
    • C:\Windows\System32\cmd.exe /C START "Tomb Raider" /high /affinity 1 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"

    The affinity can be set to any CPU core by changing the number to the corresponding hex value.
    1st core = 1
    2nd core = 2
    3rd core = 4
    4th core = 8
    5th core = 10 ( hexadecimal 16 )
    6th core = 20 ( hexadecimal 32 )

    The priority can have any value of either: low, normal, high, realtime, abovenormal, belownormal.



    So to run on only the 4th core at high priority you would put:
    • C:\Windows\System32\cmd.exe /C START "Tomb Raider" /high /affinity 8 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"
      or to run on the 2nd AND 3rd cores with priority realtime you would put:
    • C:\Windows\System32\cmd.exe /C START "Tomb Raider" /realtime /affinity 6 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe" (Since 2+4=6)

    Sometimes if the game needs to be run as administrator, then you get an error from not starting in the correct folder. Then also add:
    /d "<directory>"
    The end result being:
    C:\Windows\System32\cmd.exe /C START "Tomb Raider" /d "C:\Program Files (x86)\Tomb Raider - Legend" /high /affinity 1 "C:\Program Files (x86)\Tomb Raider - Legend\trl.exe"

    Finally, you just need to change the icon since this will set it to the CMD icon. From the same window, click "change icon" then browse to the location of the exe.
    And if you need to run as admin, click the advanced button and check the box"run as administrator"
    or if you got a Nvidia Graphics card, you could just turn threaded optimization off.

      My System SpecsSystem Spec

  4. #4



    Newbie
    Join Date : Nov 2009
    Posts : 1
    Vista Ultimate x64
    Local Time: 10:52 PM


     

    Re: Setting processor affinity made easy

    FIFA 10 by default runs on one core. Need to use at least 2 cores for better performance. Used the following line on the shortcut target box:

    D:\Windows\System32\cmd.exe /C START "FIFA 10" /d "D:\Program Files/EA Sports/FIFA 10" /high /affinity 6 "D:\Program Files\EA Sports\FIFA 10\FIFA10.exe"

    Also tried:

    D:\Windows\System32\cmd.exe /C START "FIFA 10" /high /affinity 6 "D:\Program Files\EA Sports\FIFA 10\FIFA10.exe"

    Game starts but still uses only the first core. I can see priority goes up to high but no core change. What am I doing wrong?


    p.s. System root is D: and game is also on D:.

      My System SpecsSystem Spec

Setting processor affinity made easy

Similar Threads
Thread Thread Starter Forum Replies Last Post
I made a big mistake on setting acct.! HELP! lvgirl Vista mail 1 13 Jan 2009
Which processor setting is better? Han Solo General Discussion 7 01 Dec 2008
Processor Affinity Brink Tutorials 6 30 Sep 2008
Unable to set processor affinity for a game. VistaJames Vista Games 0 13 Dec 2007
Vista Taskmanager Processor Affinity error Bitbob Vista installation & setup 4 06 May 2007