Page 1 of 2 12 LastLast
Results 1 to 20 of 21

Thread: HOW TO: Process/File Affinity, Imagecfg Control

  1. #1
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006

    HOW TO: Process/File Affinity, Imagecfg Control

    With HyperThreading and Dual Core CPUs being common in all kinds of systems there may be alot of people interested in controlling which processes use which CPU. This would work for Dual CPU systems to.

    The program to use for this is Imagecfg.exe. You can google it to find a download, or get it off of a Windows 2000 or Windows XP Server Resource Kit.


    Imagecfg.exe will work with Windows XP(32 bit and 64 bit), Windows 2000, Windows 2003, and hopefully Windows Vista. It is a permanent change to the file, so make a backup before testing.


    Imagecfg.exe has a bunch of uses, use the "/?" switch to see all of your choices.


    To set a process's affinity use "imagecfg -a 0xn [File Path] [File Name]

    Replace n with the CPU you want the process to use.

    1 = CPU0
    2 = CPU1
    4 = CPU2
    8 = CPU3

    So if you wanted to set C:\Test\Dummy.exe to use the second CPU(CPU1) ir would look like this:

    imagecfg -a 0x2 C:\Test\Dummy.exe

    For dual core or dual CPU users both CPUs will perform equally, but with HyperThreading enabled systems the first CPU (CPU0) is faster, because the 2nd CPU is just a virtual CPU recycling unused cycles from the first CPU.

    By moving processes around it can allow you maximize the performance of CPU intensive programs and games by assigning all necessary processes to 1 CPU, freeing the other CPU for the intensive application.

    I've just started messing around with this so I don't have any benchmarks or proof that this does anything, theoretically it should help, most likely in a very small ammount though.


    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.


    I'll update this with more information as I get it. Mark and Scott on here, Robpol86.com, and PlanetAMD64 Helped me get all this info.
    Last edited by YARDofSTUF; 09-02-07 at 11:46 AM.

  2. #2
    SG Enthusiast
    Join Date
    Feb 2002
    Posts
    3,852
    Well, not all of it.

  3. #3
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Quote Originally Posted by Scott
    Well, not all of it.

    My bad, I left you out!

    I'm not even sure how to benchmark this effectively.

  4. #4
    resident plumber Mark's Avatar
    Join Date
    Apr 2001
    Location
    .
    Posts
    12,985
    are you still using this YoS ?

    might try it myself i guess.

  5. #5
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Quote Originally Posted by Mark
    are you still using this YoS ?

    might try it myself i guess.

    Yup, use it for folding, run the games off the 2nd core, split EAC and LAME.

    Works out good.

  6. #6
    resident plumber Mark's Avatar
    Join Date
    Apr 2001
    Location
    .
    Posts
    12,985
    *bump*

    just wanted to thank ya YoS, i was having to reset the affinity on each new
    work unit, just tried setting this up with F@H and it works just fine.


  7. #7
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Quote Originally Posted by Mark
    *bump*

    just wanted to thank ya YoS, i was having to reset the affinity on each new
    work unit, just tried setting this up with F@H and it works just fine.


    Cool, glad it works for ya too. Do remember that each new core you download will start off trying to use both.

  8. #8
    resident plumber Mark's Avatar
    Join Date
    Apr 2001
    Location
    .
    Posts
    12,985
    Quote Originally Posted by YARDofSTUF
    Cool, glad it works for ya too. Do remember that each new core you download will start off trying to use both.
    so does that mean i have to start it and then restart it to have the affinity set with that comand ?

  9. #9
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Quote Originally Posted by Mark
    so does that mean i have to start it and then restart it to have the affinity set with that comand ?

    I usually stop F@H, then run imagecfg then reload F@H

  10. #10
    resident plumber Mark's Avatar
    Join Date
    Apr 2001
    Location
    .
    Posts
    12,985
    mine seems to be saving the affinity setting on new work units according to the task manager.

  11. #11
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Quote Originally Posted by Mark
    mine seems to be saving the affinity setting on new work units according to the task manager.

    New units yes, new cores are what I mean. the other *.exe files.

  12. #12
    resident plumber Mark's Avatar
    Join Date
    Apr 2001
    Location
    .
    Posts
    12,985
    ah i see, i set the imagecfg to the console.exe, did you set yours to the individual cores ?

    i wonder if i did this right

    i followed the instructions here and used "imagecfg -a 0x1 c:\path\to\file.exe", where file.exe is the console.exe

  13. #13
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Quote Originally Posted by Mark
    ah i see, i set the imagecfg to the console.exe, did you set yours to the individual cores ?

    i wonder if i did this right

    i followed the instructions here and used "imagecfg -a 0x1 c:\path\to\file.exe", where file.exe is the console.exe
    I did it to each *.exe file.

  14. #14
    resident plumber Mark's Avatar
    Join Date
    Apr 2001
    Location
    .
    Posts
    12,985
    Quote Originally Posted by YARDofSTUF
    I did it to each *.exe file.
    console or core exe ?

  15. #15
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Quote Originally Posted by Mark
    console or core exe ?

    all

  16. #16
    resident plumber Mark's Avatar
    Join Date
    Apr 2001
    Location
    .
    Posts
    12,985
    i just set the console affinity and it seems to work.

  17. #17
    Great guide, thanks. How can I undo the settings I added? In other words I want to enable the app on all the cores (I have a q6600)?

    Thanks.

  18. #18
    Quote Originally Posted by graysky View Post
    Great guide, thanks. How can I undo the settings I added? In other words I want to enable the app on all the cores (I have a q6600)?
    The answer is to backup the exe first since this utility literally modifies the exe you point it to use. It's only useful if you literally want the app to stay running on one and only one core.

  19. #19
    Junior Member
    Join Date
    Oct 2010
    Posts
    1
    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.
    Enclose the path with "" and spaces are no problem.

    Sorry for the bump but I found this guide still very helpfull running Simcity 4 on my core 2 duo, maybe others might too.

  20. #20
    Second Most EVIL YARDofSTUF's Avatar
    Join Date
    Nov 2000
    Location
    USA
    Posts
    70,006
    Good to know it works for you. I still use this for running multiple instances of EAC.

Similar Threads

  1. No delays in birth control prescriptions
    By BaLa in forum General Discussion Board
    Replies: 4
    Last Post: 04-03-05, 12:46 AM
  2. Microsoft - Why?!
    By Joel in forum General Discussion Board
    Replies: 7
    Last Post: 01-13-04, 02:27 PM
  3. Have you ever dealt with a control freak?
    By Debbie in forum General Discussion Board
    Replies: 41
    Last Post: 08-18-03, 06:38 PM
  4. Anyone familiar with Microsoft access?
    By CoolJ in forum Software Forum
    Replies: 6
    Last Post: 04-16-03, 10:33 PM
  5. Is everybody on drugs or w33d tonight?
    By Brent in forum General Discussion Board
    Replies: 7
    Last Post: 04-14-03, 09:41 PM

Bookmarks

Posting Permissions

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