Anonymous edits have been disabled on the wiki. If you want to contribute please login or create an account.


Warning for game developers: PCGamingWiki staff members will only ever reach out to you using the official press@pcgamingwiki.com mail address.
Be aware of scammers claiming to be representatives or affiliates of PCGamingWiki who promise a PCGW page for a game key.

Difference between revisions of "User:Handlingcfg/Affinity Settings"

From PCGamingWiki, the wiki about fixing PC games
(Created page with "When game performance (fps) is limited by '''cpu''', setting specific affinity and priority could change the performance of the game. changing priority may cause stability is...")
 
(2 intermediate revisions by the same user not shown)
Line 25: Line 25:
 
for NN:use [[https://bitsum.com/tools/cpu-affinity-calculator/ affinity calculator]]
 
for NN:use [[https://bitsum.com/tools/cpu-affinity-calculator/ affinity calculator]]
  
3)rename the file
+
3)rename the file to ".bat"
  
 
4)create shortcut to bat file and change its icon  
 
4)create shortcut to bat file and change its icon  
Line 48: Line 48:
 
YY:is same number with NN,only starts with 0x, its like 0x'''NN'''
 
YY:is same number with NN,only starts with 0x, its like 0x'''NN'''
  
3)rename the file
+
3)rename the file to ".bat"
  
 
4)create shortcut to bat file and change its icon
 
4)create shortcut to bat file and change its icon
Line 63: Line 63:
 
==Turning off ht/smt==
 
==Turning off ht/smt==
 
It is iether turned of in bios, or with amd ryzen master (or equvalent) software. For this you need to search how to change your motherboard brands bios.
 
It is iether turned of in bios, or with amd ryzen master (or equvalent) software. For this you need to search how to change your motherboard brands bios.
 +
 +
 +
==General Affinity Mask numbers for ht/smt open==
 +
1--------1 core
 +
 +
5--------2 core
 +
 +
15-------3 core
 +
 +
55-------4 core
 +
 +
155------5 core
 +
 +
555------6 core
 +
 +
1555-----7 core
 +
 +
5555-----8 core
 +
 +
 +
note:if ht/smt closed or your cpu doesnte have this feature, just use sequential numbers.

Revision as of 13:07, 19 January 2022

When game performance (fps) is limited by cpu, setting specific affinity and priority could change the performance of the game. changing priority may cause stability issues for some games.

Basics

Almost every game written to be work on with specific number of threads. This number depends to publishers market expectation and statistical distribution of core count of potential users for that time period.


-if game designed to work on 4 cores, and user has less than 4, the performance will be slower

-if game designed to work on 4 cores and user has more than 4, the performance could be slower or not.

-if ht/smt feature is on and user have 4 or more cores, the performance could be slower.


Set Affinity with custom shortcut

method 1:

1)create new txt file in executables directory

2)add the line below with changing names

%WINDIR%\System32\cmd.exe /C start "exe name(here can be empty)" /AFFINITY NN "path to exe"

for NN:use [affinity calculator]

3)rename the file to ".bat"

4)create shortcut to bat file and change its icon


method 2 (with powershell):

if method 1 wont work for some situations:

1)create new txt file in executables directory

2)add the line below with changing names

%WINDIR%\System32\cmd.exe /C start "exe name(here can be empty)" /AFFINITY XX "path to exe"

than add the line below to second line

PowerShell "$Process = Get-Process -Name """gamenamewithouthspace*""" ; $Process.ProcessorAffinity=YY"

the * character is wildcard, it is used for remaining letters. for example for far cry 5, far* can be used, if only process is starting with far letters, it will work.

YY:is same number with NN,only starts with 0x, its like 0xNN

3)rename the file to ".bat"

4)create shortcut to bat file and change its icon


Set Priority with custom shortcut

add the line below to the bat file

wmic process where name="game.exe" CALL setpriority "128"


Turning off ht/smt

It is iether turned of in bios, or with amd ryzen master (or equvalent) software. For this you need to search how to change your motherboard brands bios.


General Affinity Mask numbers for ht/smt open

1--------1 core

5--------2 core

15-------3 core

55-------4 core

155------5 core

555------6 core

1555-----7 core

5555-----8 core


note:if ht/smt closed or your cpu doesnte have this feature, just use sequential numbers.