Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

There are some old games who don't like the multicore processors in today's computers. I am wondering if there is a way to set the CPU affinity for them to '1' under Wine or CrossOver? i.e. In a native Windows environment you would right click on the game's process in the Task Manager then set the affinity there.

I've came across a program called RunFirst.exe, but can't figure out a way to run it, then the game in one command.

Suggestions are appreciated. Thanks!

share|improve this question

3 Answers 3

up vote 0 down vote accepted

Run the taskmgr.exe that comes with Wine, it allows you to set the affinity just like in Windows :).

I don't know how to set it permanently or automate setting it, though.

Possibly the same API that Windows uses for this task is present in Wine, which means that a Windows tool could be used for that task.

Edit:

I found a tool that does exactly that:

http://retired.beyondlogic.org/solutions/processutil/processutil.htm

Process -a name_of_exe 1 sets the affinity mask to processor 0.

Process -a name_of_exe 11 sets the affinity mask to processor 0 and 1.

... and so on.

See also:

http://en.wikipedia.org/wiki/Affinity_mask

share|improve this answer

I think it's possible with the taskset command. Run wine like this:

taskset -c 0 wine program_name.exe

to get rid of debug-messages:

WINEDEBUG=-all taskset -c 0 wine program_name.exe

The "-c 0" part will set cpu affinity for core 1, "-c 1" would set it for core 2, etc. See "man taskset" for some more info.

share|improve this answer
    
Thanks for the tip, just tried it, but Mac OS X doesn't seem to come with taskset. Any other ideas? –  hpy Mar 29 '10 at 5:28

Setting processor affinity on OS X is not supported. There is no such system call that wine could make to achieve this functionality. The related bug for this at WineHQ is appropriately closed as a WONTFIX (Bug 30480 - Setting CPU affinity doesn't work on Macs).

See also this related SU question: "How to set processor affinity on OS X?".

So while Jens' answer is a valiant effort, Wine will silently (or not so silently, depending on WINEDEBUG) discard those API calls to set affinity on a Mac.

The workaround commonly cited is to use one of Xcode's developer tools (like Instruments) to limit the total number of active cores available to the entire system. Not pretty, but it works. Instruments.app Preferences: General Pane

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.