Limelight Forums

Full Version: Increase FPS by 10-30 frames by isolating GMod to other cores
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
This guide won't actually fully isolate it but it will isolate it enough.

This will not work on all systems and is largely dependent on your CPU.

This only works on Windows.

Open Task Manager (GMod must also already be open).
If you are in the bad view, click more details.

[Image: v52ynlG.png?1]

Now click the details tab and then sort by CPU usage.

[Image: nDgjgwV.png?1]

Right hl2.exe and click "Set Affinity" (4th down for me).

You now have a window with all of your CPU cores and all of them are going to be checked. The number depends on your CPU. I have an 8 core CPU so I have 8. If you have an Intel quad core with hyperthreading you will also have 8. In this guide I'm assuming you are running at least a quad core CPU.

Uncheck the bottom half boxes like so:

[Image: J73DgAo.png]

Click OK.

Now look for another process using CPU. As low as 1% is enough to isolate, depending on your setup.
Right click the process and click "Set Affinity."

If you are having trouble because the process is moving around the list, sort by name and then right click.

[Image: lMtfNTA.png]

Uncheck the boxes in the top half as shown and click OK.

Continue this for any processes using CPU.


What does this do?
It helps keep GMod on its own CPU core to maximize your FPS. GMod is single-threaded and thus will be significantly slowed if something else is running on the same core.

Why give it multiple cores if it is single-threaded?
You might not need too, but in my set-up and limited testing I've found it helps. Windows does try to efficiently use each CPU core so you can benefit from it being able to choose which core to put it on because you will not be able to isolate all of the processes running on your PC easily.


Depending on where I am in the map I get an increase of 20-30 FPS.


automated it:

Here's a script that will launch GMod, set it's affinity to use half of your cores, and another process to use the other half. You can either select the process yourself of leave blank, press enter and it will use Steam.exe. It's written in Powershell so you can read the script and decide yourself if you want to trust it or not. I've also repackaged it as an EXE using PS2EXE, but if you don't want to use it, just save the below link to the .ps1 file, right click and run with powershell. Ez to keep on your desktop and run next time you want to play GMod.

If you get any errors about execution policy, open powershell as admin, type "Set-ExecutionPolicy Unrestricted" and press enter.
You might get some smartscreen errors/warnings with the EXE, in which case, just download the PS1 and run it that way instead.

PS1 Source: gmod.cykablyat.co.uk/LLGmodBooter.ps1
EXE File: gmod.cykablyat.co.uk/LLGmodBooter.exe
While this is indeed very helpful, if a game needs this amount of dedication to run properly, we can see that there are some serious problems here.
I don't have Set Affinity.

Only have: Collapse, End Task, Resource Values, Create Dump File, Goto details, Open File Location, Search Online & Properties.
(Aug 25, 2018, 01:27 PM)Vimpto Wrote: [ -> ]I don't have Set Affinity.

Only have: Collapse, End Task, Resource Values, Create Dump File, Goto details, Open File Location, Search Online & Properties.

You have the "Processes" (1st) tab open instead of "Details" (6th).
(Aug 25, 2018, 01:14 PM)Markus Wrote: [ -> ]While this is indeed very helpful, if a game needs this amount of dedication to run properly, we can see that there are some serious problems here.

For sure, it's just there's unfortunately no easy fix in sight. Making the engine take advantage of multiple cores is a significant rewrite FP likely will never do.

Theoretically someone could write a program that automated this but I can't be bothered
So uhh...  I automated this.


Here's a script that will launch GMod, set it's affinity to use half of your cores, and another process to use the other half. You can either select the process yourself of leave blank, press enter and it will use Steam.exe. It's written in Powershell so you can read the script and decide yourself if you want to trust it or not. I've also repackaged it as an EXE using PS2EXE, but if you don't want to use it, just save the below link to the .ps1 file, right click and run with powershell. Ez to keep on your desktop and run next time you want to play GMod.

If you get any errors about execution policy, open powershell as admin, type "Set-ExecutionPolicy Unrestricted" and press enter.
You might get some smartscreen errors/warnings with the EXE, in which case, just download the PS1 and run it that way instead.

PS1 Source: gmod.cykablyat.co.uk/LLGmodBooter.ps1
EXE File: gmod.cykablyat.co.uk/LLGmodBooter.exe

Liv.
Looks good, I should probably learn powershell one day.

How hard would it be to make it read process names from a text file? That way you can have it limit more than just one process and don't have to type the process names every time. Might play around and try myself...
(Aug 27, 2018, 12:06 AM)goigle Wrote: [ -> ]Looks good, I should probably learn powershell one day.

How hard would it be to make it read process names from a text file? That way you can have it limit more than just one process and don't have to type the process names every time. Might play around and try myself...

Hey man. If you just want it so that it targets a different process to Steam then you can replace "Steam" in the PS1 file where it targets it to something else. If you want to make it so that it reads from a text file, that's pretty easy too, however I'm assuming you just mean a text file containing one process. If you want to make it so it applies this to a few processes it's a bit different and I can provide some examples over PM. For just the one, pop this at the top of the script:

Code:
$secondtarget = Get-Content -Path C:\users\noop\desktop\blabla.txt

And then modify these lines as shown below:

Code:
Write-Host "Set affinity of" $secondtarget "to use other half of logical cores" -BackgroundColor DarkGreen
(Get-Process $secondtarget).ProcessorAffinity = [int]$otheraffin

Liv
Did and it was great from 10 to 30 thanks you Smile
(Aug 27, 2018, 01:07 PM)LiVHDX Wrote: [ -> ]Hey man. If you just want it so that it targets a different process to Steam then you can replace "Steam" in the PS1 file where it targets it to something else. If you want to make it so that it reads from a text file, that's pretty easy too, however I'm assuming you just mean a text file containing one process. If you want to make it so it applies this to a few processes it's a bit different and I can provide some examples over PM

I was thinking just putting a few processes (5-10) in a text file and have it loop through em.

I actually just bought a new CPU though so I don't even need this guide anymore :')

Appreciate the explanation though ofc
(Sep 2, 2018, 07:13 PM)goigle Wrote: [ -> ]
(Aug 27, 2018, 01:07 PM)LiVHDX Wrote: [ -> ]Hey man. If you just want it so that it targets a different process to Steam then you can replace "Steam" in the PS1 file where it targets it to something else. If you want to make it so that it reads from a text file, that's pretty easy too, however I'm assuming you just mean a text file containing one process. If you want to make it so it applies this to a few processes it's a bit different and I can provide some examples over PM

I was thinking just putting a few processes (5-10) in a text file and have it loop through em.

I actually just bought a new CPU though so I don't even need this guide anymore :')

Appreciate the explanation though ofc

Ah fair enough mate. That's easy to do anyway. Format list as CSV, make sure it has a key (header),
Code:
import-csv C:\blabla.csv | ForEach {

do some function with variable $_.headername

}