Automatically defining Affinity for WinXP processes?

For system help, all hardware / software topics NOTE: use Coders Corner for all coders topics.

Moderators: Krom, Grendel

Post Reply
Max_T
DBB Admiral
DBB Admiral
Posts: 1685
Joined: Wed Jul 10, 2002 2:01 am

Automatically defining Affinity for WinXP processes?

Post by Max_T » Thu Jan 01, 2004 2:26 pm

Is it possible? I got a P4 with HT and defauklt affinity is to use both CPUs for all processes. I need a specific process with specific name to set affinity to only CPU 0. I don't feel like doing it manually every time the process starts. Is there a way to make affinity to <u> automatically</u> default to only 1 cpu for a <u> specific process</u> only?
User avatar
Warlock
DBB 3D Artist
DBB 3D Artist
Posts: 3363
Joined: Wed May 12, 1999 2:01 am
Location: Midland, Tx, U.S.
Contact:

Post by Warlock » Thu Jan 01, 2004 4:50 pm

on my W2kAS if i right click on the exe i can set it in there
User avatar
CDN_Merlin
DBB_Master
DBB_Master
Posts: 9485
Joined: Thu Nov 05, 1998 12:01 pm
Location: Capital Of Canada

Post by CDN_Merlin » Thu Jan 01, 2004 4:55 pm

If you've got A P4, then you only have 1 CPU right? Which would defy what you are trying to do here no?
Max_T
DBB Admiral
DBB Admiral
Posts: 1685
Joined: Wed Jul 10, 2002 2:01 am

Post by Max_T » Thu Jan 01, 2004 6:32 pm

Warlock: hmm, i don't see this under WinXP. In WinXP this is done through the task manager. Good suggestion, but it's different in WinXP.

Merlin: P4 with HT means P4 with hyperthreading. Hyperthreading means there is one physical but two logical CPUs, and the OS sees two CPUs like in real SMP systems. So no, I am not defying anything Image

Xciter: believe it or not, but trhough my own testing, i found HT to work really well in some situations, I do not want to disable it, it only gets in the way of one single application - Descent3. Thanx to creative *&^^$&^$% drivers, that still don't work with SMP systems. For some odd reason, D3 reboots my PC if HT is enabled. After hours of troubleshooting, i was able to play D3 with HT enabled with the -nosound switch.
Then after some time, i thought of trying to assign affinity to only one logical CPU, instead of two. Today i tried it, and D3 hasn't rebooted my PC. I can keep HT and play D3 with sound, as long as i set the affinity of the process MAIN.EXE to only CPU 0. This takes like 10 seconds to do, I don't mind doing it manually. But i was hoping there was a way to automatically start a specific process (MAIN.EXE) with a given affinity setting (CPU 0, but not CPU 1), so i wouldn't have to change it manually every time i start D3.

This is not a questions of whether I need HT or not, I decided to keep it on. I just need to find out if there is a way to automate all this.
User avatar
BUBBALOU
DBB Benefactor
DBB Benefactor
Posts: 4193
Joined: Tue Aug 24, 1999 2:01 am
Location: Dallas Texas USA
Contact:

Post by BUBBALOU » Thu Jan 01, 2004 6:36 pm

Dual PROCESS (HT) and Dual PROCESSOR (2 CPU's) are totally different worlds. It is nice when you have a program that works with dual(X), like 3dsmax, photoshop......getting a litle boost

Just leave it as is, if you have an issue when a new game will not run out of the box.... then think about disabling HT.

PS go get the new Creative drivers
Max_T
DBB Admiral
DBB Admiral
Posts: 1685
Joined: Wed Jul 10, 2002 2:01 am

Post by Max_T » Thu Jan 01, 2004 6:45 pm

Guys, you are not reading.

I know the differences between real SMP and HT. ANd i can't leave it as it is, since it reboots my PC when i play D3.

Like i said, all i need to know is if there is a way to automatically set specific affinity for a process with a specific name whenever it starts up. Otherwise i'll be doing it manually every time.

Oh and, i went through all creative driver versions for Audigy2. Problem was present on all of them.
Max_T
DBB Admiral
DBB Admiral
Posts: 1685
Joined: Wed Jul 10, 2002 2:01 am

Post by Max_T » Thu Jan 01, 2004 9:17 pm

thanx, i'll check it out.

edit: looks like exactly what i was looking for.

Thanx
User avatar
Admiral LSD
DBB Admiral
DBB Admiral
Posts: 1240
Joined: Sun Nov 18, 2001 3:01 am
Location: Northam, W.A., Australia
Contact:

Post by Admiral LSD » Fri Jan 02, 2004 12:15 am

<BLOCKQUOTE><font size="1" face="Arial">quote:</font><HR><font face="Arial" size="3">Originally posted by Max_T:
Warlock: hmm, i don't see this under WinXP. In WinXP this is done through the task manager. Good suggestion, but it's different in WinXP.</font><HR></BLOCKQUOTE>

I think there's a registry key that enables that under at least 2k Pro (though I fail to see how XP would be any different) but I really can't remember for sure.

<font face="Arial" size="3">Thanx to creative *&^^$&^$% drivers</font>


heh, this is one of the reasons why my BSLive is sitting in an anti-static bag (and also one of the reasons I didn't buy another Creative card for this PC) waiting for me to either put an axe through it or sell it to some unsuspecting fool, I haven't decided which.
User avatar
BUBBALOU
DBB Benefactor
DBB Benefactor
Posts: 4193
Joined: Tue Aug 24, 1999 2:01 am
Location: Dallas Texas USA
Contact:

Post by BUBBALOU » Fri Jan 02, 2004 6:06 am

I guess that lil program for sysbase is your only option besides disabling HT

according to M$ for XP Pro

Managing processor affinity on multiprocessor systems:

If you want to assign a particular process or program to a single processor to improve its performance at the expense of other processes, in Task Manager, click Set Affinity. This option is available only on multiprocessor systems.

not dualprocess CPU's
User avatar
Tetrad
DBB Alumni
DBB Alumni
Posts: 7585
Joined: Thu Nov 05, 1998 12:01 pm
Location: Dallas, TX

Post by Tetrad » Fri Jan 02, 2004 1:08 pm

XP sees a P4 with HT as two processors. Just like XP sees my dual xeons with HT as four processors.
Garfield3d
DBB Captain
DBB Captain
Posts: 506
Joined: Thu Nov 05, 1998 12:01 pm
Location: Plano, Texas, United States of America
Contact:

Post by Garfield3d » Fri Jan 02, 2004 2:45 pm

His program won't implode. People recommend affinity for only one processor in HT systems for Dark Engine games (System Shock 2, Thief) too and those games run perfectly fine when messing with the affinity.
User avatar
Grendel
3d Pro Master
3d Pro Master
Posts: 4390
Joined: Mon Oct 28, 2002 3:01 am
Location: Corvallis OR, USA

Post by Grendel » Fri Jan 02, 2004 4:03 pm

<BLOCKQUOTE><font size="1" face="Arial">quote:</font><HR><font face="Arial" size="3">Originally posted by Max_T:
I know the differences between real SMP and HT. ANd i can't leave it as it is, since it reboots my PC when i play D3.</font><HR></BLOCKQUOTE>

Well, the problem is not D3 -- I'm running it on a P42.8C w/ HT enabled under XPP just fine..
Max_T
DBB Admiral
DBB Admiral
Posts: 1685
Joined: Wed Jul 10, 2002 2:01 am

Post by Max_T » Fri Jan 02, 2004 6:38 pm

The problem is creative drivers. For me, it only happens when i play d3, no matter what sound i pick (d3d, eax, etc). And also, it reboots when IE plays those clicking sounds when you click on a new link (i had to disable taht sound too).

It's weird and annoying, but there are workarounds, so I don't have to disable HT.
Max_T
DBB Admiral
DBB Admiral
Posts: 1685
Joined: Wed Jul 10, 2002 2:01 am

Post by Max_T » Fri Jan 02, 2004 6:40 pm

Thanx Xciter, that program worked likea charm.
User avatar
Vindicator
DBB Benefactor
DBB Benefactor
Posts: 3166
Joined: Mon Dec 16, 2002 3:01 am
Location: southern IL, USA
Contact:

Post by Vindicator » Sat Jan 03, 2004 1:41 am

My god... just get a different sound card already! Image
Max_T
DBB Admiral
DBB Admiral
Posts: 1685
Joined: Wed Jul 10, 2002 2:01 am

Post by Max_T » Sat Jan 03, 2004 11:17 pm

btw, if any1 needs it, the program and the instructions can be found here:

http://www.robpol86.com/tutorials/imagecfg.php
Post Reply