Processor affinity, priority and hyperthreading etc

Discussion in 'General Discussion' started by dsuspense, Jan 29, 2013.

  1. dsuspense

    dsuspense Registered

    Joined:
    Jan 18, 2013
    Messages:
    107
    Likes Received:
    0
    Alot of talk recently about disabling hyperthreading and assigning processor affinity to the rFactor2.exe process.
    Has anyone tried some benchmarks/tests to see if running rF2 on the physical cores (0,2,4,6) makes a difference as opposed to running against physical and logical cores (0,1,2,3,4,5,6,7) ?

    I am able to assign both rFactor2.exe priority and processor affinity in the task manager, by right clicking on the process and selecting those in the drop down menu.
    I have seen others use the 'start' command or the '+procmask' argument to rFactor2.exe

    Funny thing is if I check the rFactor2.exe in Task Manager when I start with the following shortcut:

    "C:\ISI\rFactor2\Launch rFactor.exe" C:\ISI\rFactor2\Launch rFactor.exe +fullproc +highprio +procmask=5

    I do not see the rFactor2.exe process priority as High, or an affinity to my first 2 physical cores...

    So...does using these command arguments even work?

    Does not look like it does, if you check Task Manager while running rF2...
     
  2. MJP

    MJP Registered

    Joined:
    Oct 5, 2010
    Messages:
    988
    Likes Received:
    21
    Can't speak about priority mainly because I don't run other stuff which might take significant cpu time whilst I'm running rF2 but +procmask in the 'Advanced' tab works fine for me.
     
  3. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,345
    Likes Received:
    6,572
    Slighty off topic, but isn't it usually NOT recommended to run tasks at high priority? Better to lower the priority of unimportant tasks instead.

    Especially when you consider the high rate of FFB updating for example, you don't want the main rFactor process eating into processing time of other tasks that ultimately support it. That's probably a simplistic way of looking at it... :)
     
  4. Diablo

    Diablo Registered

    Joined:
    Jan 20, 2013
    Messages:
    404
    Likes Received:
    0
    That command does not work. "Launch rFactor.exe" does not seem to accept arguments, at least not procmask. That´s for the individual components. To set process affinity properly, the easiest way is in the "Advanced" tab of the launcher, sub-tabs Single or Multiplayer CLI. Just put +procmask=5 into the additional command line parameters field. Then start rF2 from within the launcher.

    Hmm, I can´t think of any supporting tasks that would run outside the context of rFactor2, and anything inside that context inherits the priority. I wouldn´t run programs with "realtime" priority though, since those can and will take the operating system with them, should they crash. Anyway, in my optinion high priority is not really necessary these days with plenty of unutilized cores unless you have other programs, that tax your CPU, but I doubt that´s what one would do, if they wanted to run a game or simulation.
     
  5. dsuspense

    dsuspense Registered

    Joined:
    Jan 18, 2013
    Messages:
    107
    Likes Received:
    0
    Ahh...that is what it was, did not set it in the Advanced CLI params.
    Now it works, thanks!

     
  6. DurgeDriven

    DurgeDriven Banned

    Joined:
    Mar 20, 2012
    Messages:
    6,320
    Likes Received:
    43
    Even running at stock clocks my 2500K eats rFactor2 with Launch rFactor.exe , nothing else.

    I would be looking at my bios if I was you.

    If you run power or energy settings, don't manually control core speeds all the above seems pointless to me.
     
  7. Spinelli

    Spinelli Banned

    Joined:
    Jan 28, 2012
    Messages:
    5,290
    Likes Received:
    32
    Yes I have heard the same thing over the years, dont use highprio as it can take resources away from other stuff like ffb, wheel, etc. However, on my old computer (AMD FX-57, 2gb ram, ATI X805XT Platinum Edition, or HD 3850 AGP) using highprio made a world of difference when I would use it in Half Life 2 and other non-wheel games. Way less stutters and smoothness, it really made a difference.

    I always use fullproc for gt legends and rfactor, and it makes a difference. You can see all 4 cores get nicely loaded. Probably helps frames and smoothness, I always use it.

    Procmask 5, weird never heard this in years of pc gaming......
     
  8. Diablo

    Diablo Registered

    Joined:
    Jan 20, 2013
    Messages:
    404
    Likes Received:
    0
    Nope, why would one want to burn away electrical energy, if the system is idle most of the time? Plus, since rFactor apparently cannot utilize all the cores of a quad core system anyway, why should those idle cores run at full speed, eat electricity and spit out heat and noise?
    Energy saving technology has come a long way and Windows 7 does a fine job of utilizing it, so there is virtually no performance loss to it. I have noticed little gain in disabling the power saving features of my Phenom II X4 965. What I have found though, is that it gets hot, obviously, even when I sit in front of an idle desktop. Maybe not as hot as if it was actually crunching away on all four cores, but still, that´s just wasted energy for what, a theoretical 5% advantage? If I could translate that advantage 1:1 into actual fps and I had a system that already runs at 100 fps, would those 5 fps extra really be important? Not to me.
    But with rFactor2 30 fps with my PC seems more reasonable, so 5% of 30 translate to 1.5 fps. Not worth it IMO, since my PC is basically running 24/7 at the moment and gaming or number crunching is about 3h per day at most.

    Oh and before anyone runs off into the BIOS, there is a quite simple way of enabling high performance mode, switch the "Power Plan" in Windows 7 to "Performance" instead of "Balanced", which effectively disables the power saving techniques by constantly running the CPU in its highest performance state (P0).
     
  9. Diablo

    Diablo Registered

    Joined:
    Jan 20, 2013
    Messages:
    404
    Likes Received:
    0
    Hearing things I do a lot, especially on forums, only I read instead of hear them there. ;) There is a lot of superstition and hear-say involved, if you ask me. And I don´t believe that there should be problems with FFB, because that´s what the driver is for, which runs in a totally different domain of an operating system and as such is immune to being starved by the scheduler, unless you use realtime priority maybe. I never noticed any difference in the feel to my FFB wheel with highprio.

    +procmask is a command line option for rFactor2, which is basically the same as running a program from a batch script with:
    Code:
    start /affinity
    so you can pin the program to only a subset of your available cores/processors.
     
  10. Cracheur

    Cracheur Registered

    Joined:
    Jan 3, 2012
    Messages:
    315
    Likes Received:
    8
    i strongly doubt that this would help a lot. i agree on the ht disable tip but not the affinity performance gain on games.
    can you post benchmarks and screenshoots of taskmanager showing cpu usage?
     
  11. Spinelli

    Spinelli Banned

    Joined:
    Jan 28, 2012
    Messages:
    5,290
    Likes Received:
    32
    So it is basically just setting the game to use for example, all 4 of your cores? You have to manually do this just like in RFactor 1/GT Legends?? RF2 doesnt automatically use all your cores unless you do this???

    Not sure about RF2 but in RF1 and GT Legends it works. My frames where maxing out at like 300 fps in certain tests, then I enabled all 4 cores, re-did the tests and max frames went up to 500ish. Not saying that you need those high frames for this to make any impact, but it was just a way for me to prove that it had an effect on how much CPU power the game was using.
     
  12. Novis

    Novis Registered

    Joined:
    Oct 7, 2010
    Messages:
    251
    Likes Received:
    4
    That would be the same thing. The +procmask=5 would spread the load onto different cores instead of using HT.
     
  13. Novis

    Novis Registered

    Joined:
    Oct 7, 2010
    Messages:
    251
    Likes Received:
    4
    It is giving the OS a hint on what processor to use for a process. The OS will always have a policy how to spread the load between the processors but will sometimes do it wrong.

    For example, a single-threaded application would run faster if it is only run on one processor as then it would have it process state inside that processor all the time and the process state and cache hasn't to be updated on a new processor. A multi-threaded application will run faster if you spread its threads on as many processors as it have active threads to utilize the extra processing power.

    With HT logical processors share resources on one physical processor so a multi-threaded application would run faster if you let its threads run on separate physical processors. A core would in this example be concidered as a physical processor.
     
    Last edited by a moderator: Jan 30, 2013
  14. Lazza

    Lazza Registered

    Joined:
    Oct 5, 2010
    Messages:
    12,345
    Likes Received:
    6,572
    Nitpicking a bit, but an OS will tend to move a single thread between physical processors in order to spread the load (and therefore, heat) which in the long run will allow it to maximise performance.

    I think this is true while the number of threads is lower than the number of physical processors; as the number of threads increases HT helps improve performance. I think ;)
     
  15. Novis

    Novis Registered

    Joined:
    Oct 7, 2010
    Messages:
    251
    Likes Received:
    4
    While I agree with you that this is what tends to happen in an OS it is not done so because of the performance based on a single process. With a single-threaded application on a multi-core processor, spreading the load should only have a performance advantage if you run into heat or power related problems so the processor has to throttle down. Running on a single core may on the other hand have the additional advantage that a procesor is able to boost that core if the heat and power of the processor is low as a total.

    Some OS resources that a single-threaded game use can be run in parallel with the game thread so strictly speaking the game is not single-threaded and may gain performance running on multiple cores.

    Yeah, but it's more like the total processing requirements of all the threads rather than the number of them that matters. You can have one heavy processing thread run on one physical processor and let all the others run on another as long as the processors can handle the total load. The average response time for the threads may not be optimal, but sometimes that is not what you want either (playing games). Here is when assigning process priority starts to play a role.

    HT definitly helps total processor performance but a single thread runs faster if it has a HT core by itself.
     
    Last edited by a moderator: Jan 30, 2013
  16. Spinelli

    Spinelli Banned

    Joined:
    Jan 28, 2012
    Messages:
    5,290
    Likes Received:
    32
    Ok I am not talking about HT as my CPU doesn't have it, and many disable it anyway, I just mean do u have to use that mask 5 thing with RFactor 2 for it to use all your cores??? It doesn't use all your cores automatically?? I understand how we have to do it manually or add the command line parameter with RFactor 1 & GT Legends, because they are older, but I am shocked that we still have to do this with a 2012 game.....
     
  17. Diablo

    Diablo Registered

    Joined:
    Jan 20, 2013
    Messages:
    404
    Likes Received:
    0
    No don´t use procmask then. It is only useful to force Windows to spread rFactor2´s threads across physical cores, if HT is enabled. Or if you explictily want to limit rFactor2 to certain cores, as opposed to having it use all available.

    Edit: +procmask=5 is only one of many possible mask values, in this case, to use the (logical) processors 0 and 2 (processor numbering starts at 0).
     
  18. Cracheur

    Cracheur Registered

    Joined:
    Jan 3, 2012
    Messages:
    315
    Likes Received:
    8
    Even though the UQG-method seems to wide-spread in this forum... it might be usefull to have a feedback from the developers.




    * unqualified guess
     
  19. Novis

    Novis Registered

    Joined:
    Oct 7, 2010
    Messages:
    251
    Likes Received:
    4
    Everything doesn't work according to theories all the time. If you don't belive in software principles, treat it like a black box and throw all the paraméters at it. It shouldn't be that hard to test.
     
  20. newtonpg

    newtonpg Registered

    Joined:
    Oct 5, 2010
    Messages:
    97
    Likes Received:
    0
    Please dont take me wrong but...

    Everything ever works according to the theories unless one or more of the assumed theoretical statements is wrong. :) :D :rolleyes:
     

Share This Page