Skyrim Special Edition

File information

Last updated

Original upload

Created by

thappsnek

Uploaded by

thappysnek

Virus scan

Safe to use

Tags for this mod

79 comments

  1. VRNord
    VRNord
    • member
    • 10 kudos
    Locked
    Sticky
    Got the affinity working, but priority still says normal when I look in the Task Manager details despite using /high in the arguments?  Or is there somewhere else I should look to see its priority?
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      Shoot. Yes, this only affects the affinity. I've changed the mod name/instructions accordingly. Thanks for catching this!
    2. boring3
      boring3
      • premium
      • 237 kudos
      The issue is because the High Process Priority won't be inherited (skse64_loader.exe to SkyrimSE.exe).
      windows - Is process priority inherited? - Stack Overflow

      Here's a PowerShell solution.
      You can short this into one line.
      [System.Diagnostics.Process]::Start("skse64_loader.exe").WaitForExit();
      $p = [System.Diagnostics.Process]::GetProcessesByName("SkyrimSE")[0];
      $p.PriorityClass = 0x80;
      $p.ProcessorAffinity = 0xFF5;

      Priority Classes:
      https://docs.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setpriorityclass#parameters

      To use with arguments
      [System.Diagnostics.Process]::Start("skse64_loader.exe", "arg1 arg2").WaitForExit();


    3. VRNord
      VRNord
      • member
      • 10 kudos
      boring3, is your powershell solution possible to run within MO2?  I tried replacing the arguments with your example (changed to my system drive letters etc), and it just hangs with an open command prompt window.  So I thought maybe I need to replace the binary field with the Powershell .exe location, but then it just opens and closes powershell and the game never runs.
    4. boring3
      boring3
      • premium
      • 237 kudos
      I don't think there's any thing you need to modify in the code snippet.
      But yes. It's bit complicated if you want to run in Mo2 or Vortex.
      Still. Not hard anyway.

      1. Create a ps1 file in Skyrim root path. And copy&paste the code snippet.
      Filename doesn't matter.

      2. In Mo2 or Vortex. Add executable.

      Binary: (not direct to powershell because you may have different path)
      C:\Windows\System32\cmd.exe
      Arguments: (Change "a.ps1" to same to your ps1 filename)
      /c powershell -ExecutionPolicy Bypass -file "a.ps1"

      3. Done.

      And next version of Skyrim Priority will able to set Affinity and have TES6 Redfall Support.
      Sorry there's still some other competitor. I can't stop my step.
    5. VRNord
      VRNord
      • member
      • 10 kudos
      Oh I didn’t realize your plugin works with VR!  I will wait for your update with affinity then. 

      thanks!
    6. thappysnek
      thappysnek
      • member
      • 26 kudos
      Thank you boring3!!
    7. oskkar
      oskkar
      • premium
      • 2 kudos
      I would like to share my experience here too.
      The methods with CMD don't work for me, the SKSE plugin also didn't work, probably some problem with my machine since it works for so many people, interestingly the method with PowerShell works very well. It suddenly occurred to me that more people might have this problem so I came here to tell you what I did.

      I already had a script that I used to start Skyrim with High Priority as well as set Affinity and after seeing the thppysnek's method using CMD I thought it might be possible to do the same with Powershell, and thanks to Talos I was absolutely right, in general it's exactly the same thing, you just need to change the CMD executable to PowerShell that is in:
      %SystemRoot%\system32\WindowsPowerShell\v1.0\powershell.exe

      And paste this code into Arguments:

      Start-Process skse64_loader.exe;
      $nid = (Get-Process skse64_loader).id;
      Wait-Process -Id $nid;
      $mask = '1111111111110101';
      $bits = [Convert]::ToInt32($mask, 2);
      $Process = Get-Process SkyrimSE;
      $Process.ProcessorAffinity = $bits;
      $Process.PriorityClass = 'high'

      In this case the afinicade is adjusted following the xrayy's method for a 16-thread processor, which is my case, but if someone has more or less threads it is possible to adjust easily by changing the 4th line ($mask = '1111111111110101';) , here it is possible to see sixteen numbers ranging between 0 and 1 between '', each of these numbers represents a thread, 1 means that the SkyrimSE process can use the thread, 0 means the opposite, if your processor has more threads you should add 1 until the number of characters between '' equals the number of available threads, if you have less, just delete 1 until equaling the amount. That is, for a 12-thread processor the 4th line would look like this:
      $mask = '111111110101';

      If you have 20 threads it would look like this:
      $mask = '11111111111111110101';

      That's it, after adjusting the amount of threads you just need to copy and paste the code into Arguments.

      Result:

      Sorry if it got too confused, I'm not very good at explaining things and English isn't my native language so I'm turning to Google Translate. If anyone wants to make a tutorial in order to make it clearer feel free to use any content from this post.
  2. deathtome1998
    deathtome1998
    • supporter
    • 0 kudos
    so I've read the comments on here mentioning the CPU affinity calculator and that for someone with 12 cores it's 0-11 you check, then you uncheck 1 and 3. however after trying to figure out myself how to do a 24 core CPU that has 8 P-cores and 16 E-cores and failing miserably to find an answer. does anyone know how to do that? I think it should be 0-23 checked but that's where I get stuck is what to do after that. hoping someone can help, thanks in advance to whoever can.
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      I! yes I, shall gladly accept your thanks!
      Per xrayy's guide, with the help of this CPU Affinity Calculator, and with your setup, you should have this:
      

      These are the same instructions for boring3's Skyrim Priority SE AE - skse plugin. His solution is a plugin whereas here we're using powershell (this works no matter the Skyrim version/SKSE version).
    2. deathtome1998
      deathtome1998
      • supporter
      • 0 kudos
      thanks a bunch for the answer. I thought I just needed to untick 1 and 3 but wasn't totally sure and didn't want to screw it up.
  3. papageorgio
    papageorgio
    • member
    • 10 kudos
    I've been doing some digging into this stuff, and it looks interesting.  If i only have 4 cores and 4 logical processors, am i just wasting my time?
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      Yes. Actually, likely no. What we're doing here is using powershell to implement what xrayy describes in his mod, xrayys optimized skyrim cpu balance.
      He states that his cpu balancing trick works "if you own a cpu with at least 4 physical cores/8 logical cores". Refer to his mod first, then use the techniques here to implement it.
    2. papageorgio
      papageorgio
      • member
      • 10 kudos
      understood, thanks for the quick reply
    3. thappysnek
      thappysnek
      • member
      • 26 kudos
      Oops, my bad, I misread your CPU description. You stated you have 4 physical/4 logical, so xrayy's method may not work for you as he stated you would need 8 logical cores.
  4. Krabberab
    Krabberab
    • premium
    • 5 kudos
    What would be the hexidecimal for 12900k?
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      Please use the link to the hexidecimal calculator to convert values.

      From Katarsi's comment below:
      CPU Affinity Mask Calculator
      Check the boxes in the calculator table starting from 0. If you have 12 threads (logical processors), check 0-11. Then uncheck 1 and 3. The result in the CPU Affinity Bitmask (hex) box below the table will tell you. For example, mine is 0x0000000000000FF5.
    2. Krabberab
      Krabberab
      • premium
      • 5 kudos
      So I count both P and E cores?

      12900k has 8 performance cores 8 efficiency cores (16 cores in total) and 24 threads.

      So on any CPU it's a matter of unchecking core 1+3? I happen to own Processor Lasso- I guess I could just disable 1+3 there in a Skyrim SE profile and then I'd be good to go?
  5. mwlshf
    mwlshf
    • member
    • 1 kudos
    Well,it just confused me that is there any difference between yours and "xrayys optimized skyrim cpu balance"?And where is the code?
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      There is no code per se with this, it's a batch file approach (or powershell) that uses OS commands to set how your Skyrim program is handled in memory. The new Skyrim Priority mod uses the SKSE and other utilities to do the same thing but as a SKSE mod. Use one or the other but not both.
  6. SAGETHABODYBAG
    SAGETHABODYBAG
    • premium
    • 3 kudos
    I have a solid pc but not the best in the world and I've been running rudy enb and dyndolod for some time, I have been searching for something like this for a very long time as I just needed a tiny push to get 60 FPS everywhere almost and ths did it. Thanks man.
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      You owe me your life savings now ;-p
  7. Sykorex
    Sykorex
    • member
    • 1 kudos
    Skyrim Priority SE AE released a new update so do I need to install this mod now?
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      If you use Skyrim Priority, then no, you don't need this. However, if there's another game update and throws the SKSE addresses off thus outmoding the Skyrim Priority, you can always come back to using this approach.
  8. ioniaclips
    ioniaclips
    • member
    • 0 kudos
    Hey guys I got everything working ,steps are simple, but do I have to launch the game through the new exectuable everytime or just once?
    1. thappysnek
      thappysnek
      • member
      • 26 kudos
      Sorry, haven't reviewed comments in a while. You need to launch the game through whatever configures the priority and availability. So, if you use the batch file approach, use the batch file always.
  9. Katarsi
    Katarsi
    • premium
    • 116 kudos
    All these technicalities are a little bit over my head but I'm willing to figure it out.
    I have a rather good processor in my laptop, 6 cores 12 threads. I installed Process Lasso. I'm using xrayys principle too. Well, I didn't actually start using anything, I'm just preparing. Right now I'm at setting up the Executable in my MO2.
    I'm stuck at figuring out the hexadecimal equivalent of CPU priority. I take it FF5 isn't the one for me, but how do I see which one is? It actually is FF5, figured out how to look it up in Process Lasso.
    1. Randomis1
      Randomis1
      • supporter
      • 0 kudos
      How do you decide what to write, or is it FF5 for everyone?
    2. Katarsi
      Katarsi
      • premium
      • 116 kudos
      CPU Affinity Mask Calculator
      Check the boxes in the calculator table starting from 0. If you have 12 threads (logical processors), check 0-11. Then uncheck 1 and 3. The result in the CPU Affinity Bitmask (hex) box below the table will tell you. For example, mine is 0x0000000000000FF5.
  10. Randomis1
    Randomis1
    • supporter
    • 0 kudos
    What do we do in step 5c? Do we check all boxes?
  11. MC93X
    MC93X
    • premium
    • 190 kudos
    Awesome.