Dual Core Question - Permanently setting CPU affinity for a program; is it possible?

Sharky Forums


Results 1 to 3 of 3

Thread: Dual Core Question - Permanently setting CPU affinity for a program; is it possible?

Hybrid View

  1. #1
    Tiger Shark ynd Aznbnet's Avatar
    Join Date
    Oct 2002
    Posts
    584

    Dual Core Question - Permanently setting CPU affinity for a program; is it possible?

    Is it possible to permanently set CPU core affinity for a program? It seems that I have to reset it every time I reopen an application or game. Is there any way to make an affinity permanent? Also, warcraft 3 won't allow me to open the affinity console when I try to open it from the task panel. Here's the message it gives me when I try to do so.


    Why is it doing that and is it possible to bypass it so that I can set an affinity?

    Thanks
    Main Rig - AMD Phenom II 940 | ECS A780GM-A Ultra | eVGA GTX 460 SC 768MB | G.SKILL 4GB DDR2 | Audigy 2 ZS Platinum | Enermax EG651P-VE M | Lian Li PC V1200B Plus | Dell 2407WFP | Windows 7 Ultimate Retail

  2. #2
    Great White Shark
    Join Date
    Nov 2000
    Posts
    21,595
    Process affinity is dynamic, it cannot be set permanently unless there is a program option or it is hard coded in the program.

    The access denied message you received indicates that you do not have sufficient rights to the running program.

    Do you have a reason you want to change the affinity? If you want the program to run at a higher priority, that can be permanently set by using a batch or script file to run the program using the START command.

  3. #3
    Great White Shark
    Join Date
    Nov 2000
    Location
    Alpharetta, Denial, Only certain songs.
    Posts
    9,925
    You can quasi-permanently set processor affinity by using the command imagecfg on the program you wish to use.

    For example, I have had nothing but issues with FarCry, until I set the processor affinity to only a single processor. Weird, but it happens.

    You use a program called imagecfg.exe It should be in your Windows install. If it isn't, you can download it at several places.

    You then enter these commands. The first undoes any previous affinity Windows has set. This step isn't necessarily needed, it's just good practice. The next assigns the process to one CPU or the other. file.exe is the program you wish to change the affinity for.

    Code:
    imagecfg -u file.exe
    imagecfg -a 0x1 file.exe
    0x1 is CPU 0
    0x2 is CPU 1

    *Edit: One more thing I found:

    Flaws:
    Imagecfg does not seem to recognize folders with spaces in it like "C:\Program Files". To get by this copy the Imagecfg.exe file to that directory and exclude the directory /path.
    Last edited by James; 12-24-2005 at 12:24 PM.

    Crusader for the 64-bit Era.
    New Rule: 2GB per core, minimum.

    Intel i7-9700K | Asrock Z390 Phantom Gaming ITX | Samsung 970 Evo 2TB SSD
    64GB DDR4-2666 Samsung | EVGA RTX 2070 Black edition
    Fractal Arc Midi |Seasonic X650 PSU | Klipsch ProMedia 5.1 Ultra | Windows 10 Pro x64

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •