Login
Sign Up


You are using the mobile version of the forum, some features have been disabled to have it responsive.
Limelight Reunion 2024 - v4b1Limelight Discord
Ares Defence Services Discord
Limelight Reunion 2024 - v4b1Limelight DiscordAres Defence Services Discord

receiptDevelopment Blog:

Development Contributor Workflow

receiptHR Blog:

What *are* they doing over there?

receiptTeacher Blog:

Insight into the Teacher Team

receiptDevelopment Blog:

Infrastructure Upgrade 11/2019

receiptDevelopment Blog:

how suggestions???

receiptDevelopment Blog:

Planning for the future.


This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm whether you accept or reject these cookies being set.

A cookie will be stored in your browser regardless of choice to prevent you being asked this question again. You will be able to change your cookie settings at any time using the link in the footer.

Increase FPS by 10-30 frames by isolating GMod to other cores
goigle radio_button_checked
american!!!!
Developer
Posts: 978
Threads: 96
Likes Given: 535
Likes Recieved: 584 in 261 posts
Joined: Aug 2015
Reputation: 17
#1
Aug 24, 2018, 10:43 PM
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.


@LivHDX 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

If you fell for it, you're legally obligated to give me a +rep.         [Image: s7Y0Ioo.png]
(This post was last modified: Aug 27, 2018, 12:13 AM by goigle. Edited 3 times in total.)
The following 8 users Like goigle's post:
  • Armard, Auston, jess, Markus, Taylor, TiddyMan, Tom*, Vimpto
Markus radio_button_checked
Roleplayin' since 2011
Contributor
Posts: 1,748
Threads: 167
Likes Given: 1943
Likes Recieved: 578 in 383 posts
Joined: Aug 2015
Reputation: 11
#2
Aug 25, 2018, 01:14 PM
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.
[Image: sigs.php?steamid=STEAM_0:1:36038228]
Vimpto radio_button_checked
Ur mum gay
Membership
Posts: 1,390
Threads: 143
Likes Given: 579
Likes Recieved: 476 in 351 posts
Joined: Apr 2016
Reputation: 16
#3
Aug 25, 2018, 01:27 PM
I don't have Set Affinity.

Only have: Collapse, End Task, Resource Values, Create Dump File, Goto details, Open File Location, Search Online & Properties.
[Image: A0-A2-E523-B403-43-A9-80-EC-8421-F403-FB56.jpg]
[Image: D1-AB9352-843-C-47-B8-A770-E1392-CD291-FA.jpg]

Markus radio_button_checked
Roleplayin' since 2011
Contributor
Posts: 1,748
Threads: 167
Likes Given: 1943
Likes Recieved: 578 in 383 posts
Joined: Aug 2015
Reputation: 11
#4
Aug 25, 2018, 01:42 PM
(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).
[Image: sigs.php?steamid=STEAM_0:1:36038228]
(This post was last modified: Aug 25, 2018, 01:42 PM by Markus.)
The following 2 users Like Markus's post:
  • goigle, Quest
goigle radio_button_checked
american!!!!
Developer
Posts: 978
Threads: 96
Likes Given: 535
Likes Recieved: 584 in 261 posts
Joined: Aug 2015
Reputation: 17
#5
Aug 25, 2018, 05:36 PM
(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

If you fell for it, you're legally obligated to give me a +rep.         [Image: s7Y0Ioo.png]
Posts: 796
Threads: 46
Likes Given: 832
Likes Recieved: 681 in 291 posts
Joined: Aug 2015
Reputation: 9
#6
Aug 25, 2018, 09:57 PM
So uhh... @goigle 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.
The following 4 users Like bimkx's post:
  • goigle, Mark-the-Mushroom, Markus, Tom*
goigle radio_button_checked
american!!!!
Developer
Posts: 978
Threads: 96
Likes Given: 535
Likes Recieved: 584 in 261 posts
Joined: Aug 2015
Reputation: 17
#7
Aug 27, 2018, 12:06 AM
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...

If you fell for it, you're legally obligated to give me a +rep.         [Image: s7Y0Ioo.png]
(This post was last modified: Aug 27, 2018, 12:10 AM by goigle. Edited 1 time in total.)
The following 1 user Likes goigle's post:
  • bimkx
Posts: 796
Threads: 46
Likes Given: 832
Likes Recieved: 681 in 291 posts
Joined: Aug 2015
Reputation: 9
#8
Aug 27, 2018, 01:07 PM
(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
The following 1 user Likes bimkx's post:
  • Markus
TiddyMan radio_button_checked
Member
Membership
Posts: 113
Threads: 35
Likes Given: 41
Likes Recieved: 13 in 8 posts
Joined: Sep 2016
Reputation: 0
#9
Aug 27, 2018, 10:23 PM
Did and it was great from 10 to 30 thanks you Smile
     Join the Unit Mafia today! - TiddyMan#2935
[Image: sigs.php?steamid=STEAM_0:1:64959525&t=2]
goigle radio_button_checked
american!!!!
Developer
Posts: 978
Threads: 96
Likes Given: 535
Likes Recieved: 584 in 261 posts
Joined: Aug 2015
Reputation: 17
#10
Sep 2, 2018, 07:13 PM
(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

If you fell for it, you're legally obligated to give me a +rep.         [Image: s7Y0Ioo.png]
(This post was last modified: Sep 2, 2018, 07:13 PM by goigle.)
The following 1 user Likes goigle's post:
  • bimkx
Posts: 796
Threads: 46
Likes Given: 832
Likes Recieved: 681 in 291 posts
Joined: Aug 2015
Reputation: 9
#11
Sep 2, 2018, 07:15 PM
(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

}
The following 1 user Likes bimkx's post:
  • goigle




Users browsing this thread: 1 Guest(s)