Processor affinity, priority and hyperthreading etc

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

  1. Diablo

    Diablo Registered

    Joined:
    Jan 20, 2013
    Messages:
    404
    Likes Received:
    0
    OK, reading this thread again, I think I should add an excerpt of what I have posted to the "Optimization coming" thread, since it is better suited here and contains a general explanation of how +procmask works and why and when it could be useful with a HT enabled processor:

    And to clarify some more, +procmask is different from the fullproc option of earlier gMotor based simulations. It sets the processor affinity, meaning, it tells Windows to only use those (logical) processors, that are set to 1 in the mask, to run the rFactor2 process on. If that also implies a thread count, I don´t know. On the other hand the fullproc option, which is gone now, was used to tell the program to make better use of multicore processors, because it was originally designed for single core CPUs back then, if I remember correctly. And by the way, apparently it is incorrect, that rFactor only uses 2 threads:
    Code:
    "Process Name","Operation","PID","TID"
    "rFactor2.exe","Process Profiling","12272","0"
    "rFactor2.exe","Thread Profiling","12272","12848"
    "rFactor2.exe","Thread Profiling","12272","12692"
    "rFactor2.exe","Thread Profiling","12272","11576"
    "rFactor2.exe","Thread Profiling","12272","11712"
    "rFactor2.exe","Thread Profiling","12272","14320"
    "rFactor2.exe","Thread Profiling","12272","14052"
    "rFactor2.exe","Thread Profiling","12272","12528"
    "rFactor2.exe","Thread Profiling","12272","12588"
    "rFactor2.exe","Thread Profiling","12272","10128"
    "rFactor2.exe","Thread Profiling","12272","13260"
    "rFactor2.exe","Thread Profiling","12272","12504"
    "rFactor2.exe","Thread Profiling","12272","13032"
    "rFactor2.exe","Thread Profiling","12272","11932"
    "rFactor2.exe","Thread Profiling","12272","10496"
    "rFactor2.exe","Thread Profiling","12272","12824"
    That´s an excerpt of a profiling run with Process Monitor, which only highlights process and thread IDs. As you can see, those are 15 threads! That´s when rFactor2 is running and only showing the main menu. While in the cockpit sitting in the garage, so the actual simulation is running, this goes down to 11 threads.
    So, why don´t I see all my cores heavily loaded then, you might ask. Well, first off, the demand of the physics thread for CPU resources seems to be farily low, judging by the CPU graph in rFactor2, still plenty of headroom there on my Phenom II X4 965. Whereas the graphics bar is always at maximum.
    Also, additional threads don´t necessarily make for a faster running programm. I have to admit, I am a little out of my depth here, but for those threads to translate to shorter execution times, they must be able to run asynchronously. That does not seem to be a trivial task to accomplish, and some problems simply cannot be multithreaded at all due to their sequiential nature. But I will leave a more indepth explanation to those, who have a better understanding of that matter.

    And since I only recently stumbled upon it, +SimThreadPrio might be an option worth some exploration, but until my CPU runs out of steam, I don´t think I will see any difference between using and not using it.
    The same is true for +highprio in the context of the operating system as a whole. Unless rFactor2 has to compete for resources with other CPU intensive programs, there should be little gain expected by using this option as well. And why would I run such concurrent programs on my system, while running rFactor2, in the first place? I can see however that it was good for some additional performance, with earlier versions, since those ran on older CPUs with less clock frequency and less cores, so Windows services could take away some precious CPU cycles.
     
  2. DrMabuse1963

    DrMabuse1963 Registered

    Joined:
    May 10, 2012
    Messages:
    155
    Likes Received:
    2
    Think you can see the Load of the cores with Aida 64 ( http://www.aida64.com/) on your Display , i use it with the LCD from my G15 , but i got only a i5 3570K and see the 4 cores ( @4,2GHz in Game 92%-97% load at all cores ) .
     
  3. Diablo

    Diablo Registered

    Joined:
    Jan 20, 2013
    Messages:
    404
    Likes Received:
    0
    Well, not so for me. I am obviously GPU limited then, no surprise there. But I didn´t use AIDA to come to that conclusion. Downloaded the demo and was just overwhelmed with all those options and whatnot. Maybe it is possible, but I just want to accomplish one simple task, and AIDA is just overkill. So I remembered Windows´ very own Performance Monitor:
    View attachment 5975

    The red line shows rFactor2 processor time and the green shows overall processor time of the whole system, just to be sure, nothing was interfering with the simulation and thus slowing it down. Apparently processor time for a single process is not scaled to 100% but takes into account the number of cores, 4 in my case, which is why it can be up to 400%. I didn´t bother to find an option which changes that. Total processor time on the other hand is scaled to 100%.
    The spike at the beginning is from ALT+TABing back to the sim. Then I immediatly entered the C6.R, which sat in the garage at Palm beach already. There were 9 additional AI drivers, just so the CPU gets something more to do. I drove about two and a half minutes, which you can see by the higher percentage values. But they are nowhere near to really taxing my CPU.
     
    Last edited by a moderator: Feb 2, 2013
  4. Novis

    Novis Registered

    Joined:
    Oct 7, 2010
    Messages:
    251
    Likes Received:
    4
    Graphics threads are hard to split into multiple threads. Usually because the drivers or OS only support a single thread handling graphics calls. (I'm out of touch how current versions of Win/DX works so it could be possible.) A single graphics thread in a GPU unlimited system will use close to 100% of a single processor.

    The other thread that do heavy processing in RF2 is the physics thread. As it need less processing power than the graphics thread the game would gain no performance to split it into more parallell threads. Adding many AI cars can of course change that fact and if so prove it to be a poor design.

    It is not only Intel HT processors that can gain performance boost by unloading cores. New AMD processors share resources inside same core also.
     

Share This Page