Best way to set cpu affinity automatically in Windows XP?
  • woerwoer April 2012
    title says it all

    I need hl.exe to run on one core, else i get horrible frame loss. Setting it in task manager isn't persistent (if I quit and start again, it goes back to all cores). THG task assignment manager is all I could find googling, and it doesn't always work
  • LethaLLethaL April 2012
    I could not verify any of this but if you want to take a look its from tomshardware
    http://www.tomshardware.com/forum/229129-28-affinity-prior-launch

    http://www.tomshardware.com/reviews/bang-dual-processing-buck,815.html

    or

    Eldin 10-25-2009 at 10:49:19 AM
    - 0 +

    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
  • woerwoer April 2012
    no /affinity parameter for the start command in XP, and also I'm hoping to find a way (program,w hatever) to set affinities just as they launch rather than manually. Thaks though sir, and nice to see you again!

    I went back to Processor Lasso, which works alright. I thought it had been causing my computer to freeze, but it happened a couple times without it running. I think it's massive disk IO in my new raid device causing it to freeze (happens with utorrent running @ full network speed and sometimes when transferring files)--not sure why yet.
  • LethaLLethaL April 2012
    yup i'm still alive and doing good!

    i'll do more research when i can and let you know if i find anything, i'll probably post it here one the forum because i don't seem to see you online on steam friends very often

    and i do miss cs1.6, the server we had, the comunnity we had it was tons of fun, talking about it bring back so much memories
  • NunesNunes April 2012
    This was an interesting read:
    http://www.techenclave.com/topic/392508-cpu-affinity-made-easy/

    What I'm getting from it, despite them not really talking about this particularly, is that some processors/drivers/versions of xp may have affinity as an option on multicores, but others seem to be missing it.

    Meanwhile, here was my batch file attempt. I was SUPER dirty, and literally copy the cmd.exe into the folder of my target program before calling the target .exe with the /C options.

    echo off
    copy c:\windows\system32\cmd.exe C:\Program Files\TextPad 5\
    "C:\Program Files\TextPad 5\cmd.exe" /C start /affinity 1 TextPad.exe
    pause

    looking at the results, /affinity isn't a valid switch.

    $0.02
  • NunesNunes April 2012
    Also, sup Lethal?
  • woerwoer April 2012
    goddamn the more I mess with affinity settings in Process Lasso, the more pissed off I am towards Windows. I was streaming CS (hltv.org has pro players streaming pugs now), and it was taking up ~20% of my cpu, which for just flash streaming is ridiculous (I'm on a Phenom x4 965 be). I tried switching Chrome to one core from all cores, and it dropped to around 8%. Let me repeat that: 20% across four cores vs. 8% on a single one.

    In CS using all cores means constant fps drops to 50 or lower, down and up and down and up and down and up, etc., etc., even with all settings at minimum. With everything on max and restricting it to one core I'm at a constant 99fps.

    Everything I've tried so far has worked as well or better when restricted to a single core.

    I'm curious if Windows 7 is any better, but I had installed it, and I can't run the mouse acceleration fix (dll injection into hl.exe to get direct mouse input passed into CS) along with EAX sound.
  • NunesNunes April 2012
    Oddly enough, I was poking around last night in my task manager and happened to see the manual option for Affinity. Which pops a list of my cores. And checkboxes. My proc/driver/OS/MoBo combo is capable, but it doesn't seem to be a valid cmd switch.

    I'm actually very interested in what the hell might make it show in some people's systems and not in others.

    /Also, that's ridiculous, dude... sheeeit.
  • woerwoer April 2012
    Mine has the option to set it manually from Task Manager. I was hoping for a way to have Windows memorize those choices so I wouldn't have to do it every time. It's fine for something I keep open all the time, but cs for example I do not. Process LAsso has been working out alright. It has some additional features that I'd rather not use (like changing priority when it somewhat arbitrarily decides a process is using too much cpu), but it memorizes affinity choices at least.
  • NunesNunes April 2012
    Yeah, that was more or less my experience as well. But that means there's a switch somewhere. Registry doesn't feel right. MsConfig doesn't feel right. CMD isn't right, apparently. What's Process LAsso written in? I have a code explorer that works pretty well at dissecting things in VB.Net and C#, so I could at least see what APIs it's calling to set affinity.

    It's a fucking computer. If you can set something manually, you damn well better be able to set it automatically. I don't like mysteries inside my devil-box.
  • woerwoer April 2012
    It's in c++ http://bitsum.com/prolasso_why_native.php

    " We [...] used the lowest level API available for process management - the largely undocumented NT Native APIs. "

    gotta love undocumented api's
  • NunesNunes April 2012
    HA! Good work. Probably the NTDLL.dll library then. Just based on it's being the biggest meanest Native API in NT.
  • LethaLLethaL April 2012
    Woer i am not sure if it could help but if i remember correctly cs had launch options you could set on steam to fix mouse accelleration with those commands -noforcemspd -noforcemaccel -noforcemparms

    there is also other commands for which directx you want to use, set how much memory you want cs to use, disable certain options to gain fps and such it might not fix your problems but it might help who knows

    This link has a lot of launch options
    http://www.mobility-gaming.com/index.php?site=articles&action=show&articlesID=27
    I remember using those commands while playing cs as launch options : -noforcemspd -noforcemaccel -noforcemparms -heapsize -noip -noipx -nojoy -dxlevel


    @Nunes Like i meontioned in a previous post i'm doing well and fine, how about you
  • NunesNunes April 2012
    Every day's a party. At least that's the best explanation I have for the number of clowns I deal with every day.
  • b1llyb1lly April 2012
    You can make it so when you right click the .exe, you can click "run on CPU1".

    http://www.sevenforums.com/tutorials/83864-processor-affinity-add-set-affinity-context-menu.html
  • b1llyb1lly April 2012
    And here's an open source program that seems to be able to do it also. http://www.adsciengineering.com/StartAffinity/
  • dandan January 2013
    Yeah, that's probably a trap.

    -dan
This discussion has been closed.
← All Discussions

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In Apply for Membership