Tom's Hardware > Forum > CPU & Components > CPUs > Set CPU Affinity prior to app launch?

Set CPU Affinity prior to app launch?

Forum CPU & Components : CPUs - Set CPU Affinity prior to app launch?

Tom's Hardware: Over 1.4 million members in 6 different countries available to answer all your high-tech questions. Sign up now! Its free!
Word :    Username :           
 

For the life of me, I can't remember how to set CPU Affinity for an application BEFORE it launches. Changing it WHILE the app is running is easy but I don't want to always have to crtl-alt-del into Processes to change AFTER I run the app.

I have an app that wants to run on CPU 0 and not CPU 0/1. So I got CPU 0 @ 100% and CPU @ 15% or something. I've put " -cpu 0 -cpu 1" at the end of the target line, but that doesn't work. I can't remember the proper syntax....argh.

What's the proper syntax/methodology to Set Affinity on Target line?

Much thanks.

Sponsored Links
Register or log in to remove.

I would also appreciate the answer to this! Great question.

Reply to TechnologyCoordinator

I did a ton of farking research on this. I could not find a clear solution.

If anyone knows the answer I too would greatly appreciate it.

Reply to mpjesse

Until now, I didn't know you could set affinity of any program from Task Manager. :oops:

I'd love an answer to this as well. It would be nice to have all processes run on one core and your games on the other without having to manually set the affinity each time.

Reply to SEALBoy

Add me to the list of the curious...

Reply to weilin

LMAO. Well now I don't feel like such a noob. I guess if ya gotta ask a question, better make it a good one, eh? ;)

Ya, you can set affinity from Process in Task Manager, but it's WHILE the app is running.

Someone, somewhere, at sometime.....told me how to do it, but I've long since forgotten :oops:

Reply to skyguy

LOL.

Can we get a 6th??? ;)

Reply to skyguy

I thought there was an application one had to download which would change the beginning of the executable to make it permanently on one core or the other. It would probably break things if you ever tried to run a patch on the program though (without changing back to the original executable first).

Reply to Valerarren

As far as I know, there are no way to preset affinities with Task manager.

I think this is the application to set affinity that you're mentioning.

I'm linking to the official source here:

http://forums.amd.com/lofiversion/ [...] 65211.html

Also a google caché of the same page because AMD forums were under repair at the moment...
http://209.85.165.104/search?q=cac [...] cd=1&gl=ar

I read in that site that now you don't need to modify the exe to make it work. I sincerely didn't test it so don't complain if that program misteriously wipes out all your pr0n. I can't find mine, thats for certain. (??)

Hope it helps and as usual, sry for my english!

Reply to The-Darkening

Quote :

I heard duct tape works with bailing twine and a shot of whiskey for the user.Other than that I have no clue but I did make a tape and twine ball and used it as a trash can ball as i was getting drunk. :D

Was that before or after you bent the pins installing your 3200+? :o :oops: :oops: Sorry Vern....i'll can it with the pin jokes, from now on. :wink:

Reply to 1Tanker

here's one way to do so...if you're interested you can get the source code (on the left and check how they do it) else just download the binary
http://www.adsciengineering.com/StartAffinity/

Reply to SSS_DDK

here's another one

http://www.appliedvisual.com/xcpu.htm

PS: i never tested any of them so watch out for eventual threats
PS2: they got the source code so i guess you can check if it's safe.

Reply to SSS_DDK

There's a program called Launch & Set (although the link seems to be down at the moment) which allows you to set the affinity of a program to either or both cores before you launch it. It's only a small program (about 60k) so drop me a PM with your email if you want a copy. If I get too many requests I'll upload it and send you a link instead.

Reply to Ford_Prefect

I always used "Firedaemon" myself for this specific purpose, well at least for starting my game server on specific cores. Never tried it with any regular applications.

http://www.firedaemon.com/

Reply to koolaidkitten

Wow, thanks for the responses!

Ford, I've sent you a PM so you can email me that prog to try out.....it seems simple enough.

I'll try that first and see how it goes. Maybe look into SSS's suggestions.


Much apppreciated, great help.
8)

Reply to skyguy

hmmm...I'm kinda tempted to write a little tray app that lets you add processes to a list and auto changes their affinity and priority. Really should be doing my own work tho!

That imagecfg link is interesting. Not sure how it works, I can't remmeber if there is a var for affinity in the PE headers or not.

Reply to djgandy

THG seems to already have an app created to do just that:

http://www.tomshardware.com/2004/0 [...] index.html

has anyone used this? i just upgraded to dual core this weekend and running into issues with older games.

------------------------------ AMD Phenom II X4 940 BE @3.5
Gigabyte 780g matx
G.Skill 4x2gig DDR2 800
evga 8800gt 512mb on 22" Gateway LCD
Reply to MayDay94

Yea. The THG Task Assignment Program is very usefull. I have used it often recently, as long as TaskAssign.exe is running in memory (Assuming you have already Set Processor Affinity) it will run the Specified Application(s) in it's App List, using the processor you have specified.

Reply to Anonymous

Hi! check this tool I made
[url=http://usuarios.lycos.es/coreaffinity/][/url]

Reply to Anonymous

I would ordinarily remind people that downloading and running files linked by new registrants is quite a bit less than wise. But here at Tom's we are smarter than that...




BLAAAAAAAAAAHAHAHHAHAHAHHAHHAHAHAHAHAAAH!!!!!!




Oh mah... I kill myself sometimes... :D

------------------------------ Which Chip? Well, it depends on which set of thieving b@stardz you choose to support: The ones who use insider trading to enrich themselves while running their company into the ground? Or the ones who illegally pay vendors to not support the first group?
Reply to Scotteq

If you dont't want people to help in this forum, just say it; and in order to prevent other users, first check if you are right or not with that kind of affirmations. I'm offering for free a software of my property, and I think I deserve a little of respect. So, if you don't trust, the answer is easy: don't click.
One more thing, I just registered to post this link to give people a solution that I made for myself, and I wanted to share it. Perhaps, Scotteq, you're not as smart as you pretend to. No more to say.

Reply to Anonymous

hi guys, i know this is a bit old but i have been searching for info on a similar topic and wanted to let you know about a program called cpu-control. i think it will do what you want and it is free.

http://www.koma-code.de/index.php? [...] &Itemid=93

just trying to help

Reply to superhighperf

I know this is an old thread, but here's the easy answer that didn't come up. WinXP (and also Vista, I believe) has a utility included called start. This utility can be used to run a program with a specified cpu affinity. the command would look like this:

start /affinity xx myprogram.exe

Use the actual name of the program you want to run, of course, and substitute xx for a hex number representing the affinity you want as follows:

01 - 1st CPU
02 - 2nd CPU
03 - 1st and 2nd CPU
04 - 3rd CPU
05 - 1st and 3rd CPU
...
etc

Reply to Eldin
Tom's Hardware > Forum > CPU & Components > CPUs > Set CPU Affinity prior to app launch?
Go to:

There are 427 identified and unidentified users. To see the list of identified users, Click here.

Sponsored links
  • Ask the community now
  • Publish
Ad
They won a badge
Join us in greeting them