You can create a shortcut to assign affinity.

X:\Windows\System32\cmd.exe /C start /affinity Y game.exe

Y is hexadecimal and is a bit mask:

0x1 - 0001 - Core0
0x2 - 0010 - Core1
0x3 - 0011 - Core1 & Core0
0x4 - 0100 - Core2
0x5 - 0101 - Core2 & Core0
0x6 - 0110 - Core2 & Core1
0x7 - 0111 - Core2 & Core1 & Core0
0x8 - 1000 - Core3
0x9 - 1001 - Core3 & Core0
0xA - 1010 - Core3 & Core1
0xB - 1011 - Core3 & Core1 & Core0
0xC - 1100 - Core3 & Core2
0xD - 1101 - Core3 & Core2 & Core0
0xE - 1110 - Core3 & Core2 & Core1
0xF - 1111 - Core3 & Core2 & Core1 & Core0
Answer from Hasan Manzak on Stack Exchange
🌐
Tom's Hardware Forum
forums.tomshardware.com › home › cpus
Question - Setting affinity of cores ? | Tom's Hardware Forum
March 11, 2023 - But it gradually got more and more out of date with modern CPUs and by the time I had a Coffee Lake Refresh, it was sufficiently archaic that it would stutter, skip, and have random crashes, and one of the common fixes for it was to set it to run on only one core every time you started the software. These are rare things though. ... When playing a game and I disable CPU 0 and CPU 1 will it use CPU 2, 3 , 4, 5 and so on depending on the game
Discussions

starcraft 2 technical issues - Any benefit to setting CPU affinity for a game? - Arqade
Many games are not written with ... with multiple distinct CPU chips rather than multi-core CPUs that share a cache and so on. Some games might even break without CPU affinity set, because they were only tested on single-core systems and make some bad assumptions about the ... More on gaming.stackexchange.com
🌐 gaming.stackexchange.com
PSA to anyone struggling with performance: Change the affinity
I’ll have to give this a try! The stuttering issues really sucks on the quest Link. So much so that I just don’t play pc VR games More on reddit.com
🌐 r/intotheradius
11
57
December 14, 2023
Disabling a core through Set Affinity. What is it exactly?
So I am playing a game and I am trying to get better performance from it. One particular post online recommends disabling one of your cores through the games exe in the process tree if it is at 100% usage. Looking at the Performance in task manager does show one at roughly 100% and the others... More on forums.tomshardware.com
🌐 forums.tomshardware.com
5
0
February 16, 2018
ELI5: Why does disabling CPU affinity starting with Core 1 and every other core improve the game's performance dramatically?
It's hard to say exactly without looking at the code, but it sounds like a caching/memory access issue. Not sure this description would work on a 5 yo, but here goes: The OS is responsible for scheduling the process (in this case, Grim Dawn.exe). What that means is occasionally, the OS says here you go Grim Dawn, you can use this cpu core for a little while. When GD gets to a reasonable stopping point, it can cede control back to the OS, otherwise, the OS will forcibly stop it and move on to running some other program on that core. While GD is running, it's like "ooh I need this and I need that" and pulls data from disk into memory and from memory into cache, which is like memory but it's actually in the CPU so it's way faster. In a single core CPU world, this was very boring, because you always got scheduled on the same one. If you got 90+% of the CPU time, there's a good chance that the stuff you wanted is still sitting there waiting for you in cache, so it's really fast to access. However, we now all have multi core CPUs, which means the OS has more resources available to schedule all the processes that want to run. Great! This means that in the past, where GD might have gotten to run 90% of the time, now it's runnning 99+% of the time. However, it introduces a new complication, migrations. The OS doesn't always schedule the GD process on the same core that it was running on previously. This causes two memory access problems, cache locality and NUMA. You see, the CPU actually has several caches. Some are shared between all the cores, but some are local to individual cores. And guess what, the local ones are faster than the shared ones. You can see the problem. GD is running. It pulls a bunch of data into it's local cache, then pop it ends up on a different core. All that data it pulled into local cache is now in someone else's local cache! It has to start over pulling data closer to itself only to get migrated again. The other problem is similar, but involves main memory. Most CPUs these days have a Non-Uniform Memory Access (NUMA) architecture. It's quite a complicated subject, but basically, it means that some of your memory is assigned to each core, and that memory is "closer to" one core than the others (i.e. faster). Once again, you can imagine GD getting migrated to a different core and all it's data is now further away. (incidentally NUMA is the main reason why memory comes in matched pairs these days and MBs tell you which order to use the dimm slots in). Both of these issues can be alleviated by pinning. That's what you are doing when you unassign all the other cpu affinities. This forces the OS to only ever schedule on a single core. No more migrations! So if this is so great, why doesn't Windows do this by default? Turns out writing an OS is complicated. Basically you have to optimize everything for the average case, and computer games (or other processes) which need to monopolize a single core are not the average case. The easiest counter example to auto pinning everything is to imagine other processes pinned on your GD core at the same time. Now your 99+% is back down to 90% or less, hurting your frames. It's also worth noting that all of these things happen even to single threaded programs. Things get much more complicated, and there are more ways it can slow down with multi threaded programs which share memory. TL;DR, it's almost certainly Cache Locality and NUMA issues caused by process migration. More on reddit.com
🌐 r/Grimdawn
26
48
November 21, 2017
People also ask

How does setting CPU affinity interact with multi-core processors?
It allows you to control how an application uses the multiple cores, which can be crucial for performance in multi-core environments.
🌐
winbuzzer.com
winbuzzer.com › home › how to set cpu affinity via windows task manager, system properties, powershell, and cmd
How to Set CPU Affinity via Windows Task Manager
Can setting CPU affinity improve performance for gaming?
Yes, particularly for older games not optimized for multi-core processors. Assigning these games to a single core can prevent crashes and improve performance.
🌐
winbuzzer.com
winbuzzer.com › home › how to set cpu affinity via windows task manager, system properties, powershell, and cmd
How to Set CPU Affinity via Windows Task Manager
Does setting CPU affinity affect all users on the computer?
No, CPU affinity settings apply only to the specific instance of the application and need to be set each time the application is run.
🌐
winbuzzer.com
winbuzzer.com › home › how to set cpu affinity via windows task manager, system properties, powershell, and cmd
How to Set CPU Affinity via Windows Task Manager
🌐
Steam Community
steamcommunity.com › discussions › forum › 11 › 4843148592918789108
Automating CPU Affinity :: Hardware and Operating Systems
September 28, 2024 - ... Yes with some older games it was like this; where after the game loads up it was best to ALT+TAB over to Task Manager (Details tab) and then change Affinity to 1 Core/Thread and click OK.
🌐
XbitLabs
xbitlabs.com › home › blog › setting affinities for better performance in games
Setting Affinities for Better Performance in Games | XbitLabs
July 26, 2025 - However, separating tasks on threads from different cores can introduce a latency/FPS penalty which is not optimal. This is once again a game-by-game situation, but if you notice that your game is not performing as expected you can try setting the affinity for the game to use only physical cores without the virtual threads so no splitting is happening.
🌐
Vista Forums
vistax64.com › vista forums › gaming
Solved - Setting processor affinity made easy | Vista Forums
December 14, 2008 - To begin, create a shortcut to the game on the desktop. Right click the shortcut and select properties. In the "shortcut" tab, find the line for "target". Copy this in front of the target: C:\Windows\System32\cmd.exe /C START "Need for Speed Undercover" /high /affinity 1. Now, NFS Underground will automatically run in high priority on Core 0.
Top answer
1 of 3
3

It depends on the game and the OS. Many games are not written with multi-core support in mind, but still make use of OS-level primitives that cause the OS to migrate processes between cores, which in some cases can impact performance due to cache line misses and resource allocation issues, and depending on the graphics hardware this can theoretically make a big difference, although the difference will be greater on systems with multiple distinct CPU chips rather than multi-core CPUs that share a cache and so on. Some games might even break without CPU affinity set, because they were only tested on single-core systems and make some bad assumptions about the order of operations that occur in asynchronous APIs.

The best thing to do is to try it and measure the difference, if any, and re-measure it every time there's a new graphics driver or API version update, since future versions of graphics drivers in particular can change things immensely.

That said, if a game is written to take advantage of multiple cores, then it never makes sense to set the CPU affinity on it.

2 of 3
1

Day9 claimed back in 2010 that it has some effect. In some other casts he said that he invested a lot of time into tweaking his setup, because he did not have a lot of money, his computer kept overheating and everybody wanted him to stream in HD.

Some time ago he gave a Video Streaming Tutorial

His setup is as follows

  • Encoder CPU: 0,1,2,3
  • Starcraft 2 CPU: 4,5
  • Screen Capturing Software CPU: 6,7

As long as the CPUs are going to be used all the time it makes sense that the same programs should keep using them to save context switches.

Then again it was back in 2010 and maybe the operating systems do a better job of this.

I would give it a try to see if the results are better, but only if you need your computer to do a lot of computation at the same time.

If you just play Starcraft, without streaming, it is easier to disable, close or suspend any other applications or services that might drain a lot of resources.

Find elsewhere
🌐
WinBuzzer
winbuzzer.com › home › how to set cpu affinity via windows task manager, system properties, powershell, and cmd
How to Set CPU Affinity via Windows Task Manager
January 12, 2025 - Manually assigning the application to a single thread solves this. Conversely, those getting lag on Discord or other VoIP applications while playing an intensive game can assign only a portion of their cores to the game to ensure their system has enough resources to handle both at once. In this tutorial, we’ll be covering how to set CPU/processor affinity for individual apps, as well as how to change the CPU priority to prefer foreground apps.
🌐
Reddit
reddit.com › r/intotheradius › psa to anyone struggling with performance: change the affinity
r/intotheradius on Reddit: PSA to anyone struggling with performance: Change the affinity
December 14, 2023 -

I've been struggling with horrible performance (dropping to unplayable levels in certain areas even on low graphics settings) but finally found a solution not posted anywhere else to my knowledge. I only decided to try it after reading that UE4 is horrible at multithreading and after confirming it worked, decided to post here in hopes that it can help someone else too.

In the task manager, click the "Details" tab and right click on the game, then select "set affinity". In the Processor affinity window, uncheck all odd numbered CPU's. Leave CPU 0 and all even numbers checked.

If you're playing on an oculus device, locate the "Oculus Debug Tool" and disable a setting called "(PC) Asynchronous Spacewarp".

I'm now able to play with all settings on high with no noticeable frame drops, hopefully this will help you too.

My set-up: RTX 3070 TI - i9 9900k - 32gb ram - Quest 3 via link

🌐
Tom's Hardware Forum
forums.tomshardware.com › home › cpus
Disabling a core through Set Affinity. What is it exactly? | Tom's Hardware Forum
February 16, 2018 - Set affinity just tells Windows that the process is/isn't allowed to run on certain cores. Preventing the game from running on a core just ends up redistributing the threads to other cores. In this particular case though, since one core is at 100% while the others are at about 30%, that one ...
🌐
Reddit
reddit.com › r/grimdawn › eli5: why does disabling cpu affinity starting with core 1 and every other core improve the game's performance dramatically?
r/Grimdawn on Reddit: ELI5: Why does disabling CPU affinity starting with Core 1 and every other core improve the game's performance dramatically?
November 21, 2017 -

I do this every game session and it seems to work when I check my FPS. I forgot where I read this. I tried the script that automates the process but it always ends up in an error so I do it manually.

Top answer
1 of 5
31
It's hard to say exactly without looking at the code, but it sounds like a caching/memory access issue. Not sure this description would work on a 5 yo, but here goes: The OS is responsible for scheduling the process (in this case, Grim Dawn.exe). What that means is occasionally, the OS says here you go Grim Dawn, you can use this cpu core for a little while. When GD gets to a reasonable stopping point, it can cede control back to the OS, otherwise, the OS will forcibly stop it and move on to running some other program on that core. While GD is running, it's like "ooh I need this and I need that" and pulls data from disk into memory and from memory into cache, which is like memory but it's actually in the CPU so it's way faster. In a single core CPU world, this was very boring, because you always got scheduled on the same one. If you got 90+% of the CPU time, there's a good chance that the stuff you wanted is still sitting there waiting for you in cache, so it's really fast to access. However, we now all have multi core CPUs, which means the OS has more resources available to schedule all the processes that want to run. Great! This means that in the past, where GD might have gotten to run 90% of the time, now it's runnning 99+% of the time. However, it introduces a new complication, migrations. The OS doesn't always schedule the GD process on the same core that it was running on previously. This causes two memory access problems, cache locality and NUMA. You see, the CPU actually has several caches. Some are shared between all the cores, but some are local to individual cores. And guess what, the local ones are faster than the shared ones. You can see the problem. GD is running. It pulls a bunch of data into it's local cache, then pop it ends up on a different core. All that data it pulled into local cache is now in someone else's local cache! It has to start over pulling data closer to itself only to get migrated again. The other problem is similar, but involves main memory. Most CPUs these days have a Non-Uniform Memory Access (NUMA) architecture. It's quite a complicated subject, but basically, it means that some of your memory is assigned to each core, and that memory is "closer to" one core than the others (i.e. faster). Once again, you can imagine GD getting migrated to a different core and all it's data is now further away. (incidentally NUMA is the main reason why memory comes in matched pairs these days and MBs tell you which order to use the dimm slots in). Both of these issues can be alleviated by pinning. That's what you are doing when you unassign all the other cpu affinities. This forces the OS to only ever schedule on a single core. No more migrations! So if this is so great, why doesn't Windows do this by default? Turns out writing an OS is complicated. Basically you have to optimize everything for the average case, and computer games (or other processes) which need to monopolize a single core are not the average case. The easiest counter example to auto pinning everything is to imagine other processes pinned on your GD core at the same time. Now your 99+% is back down to 90% or less, hurting your frames. It's also worth noting that all of these things happen even to single threaded programs. Things get much more complicated, and there are more ways it can slow down with multi threaded programs which share memory. TL;DR, it's almost certainly Cache Locality and NUMA issues caused by process migration.
2 of 5
19
For the couple of people who asked: Ctrl + Shift + Esc (Task Manager) > Details > Right Click Grim Dawn.exe > Set Affinity > Uncheck all CPU's except one. Preferably not CPU 0 since it's naturally the one most busy with other tasks - CPU 1 is usually a good call. Steps vary depending on your version of Windows, but you should be able to find your way around. You are going to have to do this every time you launch the game. I assume there is a permanent way of setting it up, but you'd probably need a 3rd party tool. @ u/Mister_ER @ u/StantlerTT
🌐
Overclock.net
overclock.net › home › forums › video games › pc gaming
limit games to one cpu core | Overclock.net
September 1, 2009 - ... When you open the game (can be done with any game), minimize it, ctrl+alt+del and enter task manager. Find the process for the game (under Processes), and then right click the process > set affinity.
🌐
Steam Community
steamcommunity.com › discussions › forum › 1 › 1631916406861117726
Core affinity for older games :: Help and Tips
Single threaded applications (like old games) will only utilize one core anyway. You generally don't need to micromanage this in any case. My advice is don't try to create solutions to problems that don't exist. Fallout 3 was the only game I had to fuss over cores usage, and that was handled in the game's config anyway.
Top answer
1 of 3
52

Process Lasso from BitSum
I have been struggling with this for ages. then a friend pointed me to this.
how he found it, I have no idea.
but process lasso is a very simple tool, that just works. I don't know why Microsoft hasn't allowed us to set affinity/priority on a permanent level, or why nobody seems to know [yet] about this tool, but I had to tell someone.
I kept ending up on dead forums that didn't do what I needed, and I couldn't resurrect them or reply now that I found the tool, but here you go.
I hope I help at least one future user!

2 of 3
6

Hi waihong_63,

Welcome to Microsoft Community.

For a way to set CPU affinity for an application, I found two threads shared by a user in the community. There is information about changing the CPU affinity through the registry and shortcut parameters, which I think will help you.

How to Permanently Set Priority & Affinity With Shortcut File

How to Permanently Set Priority Processes Using Registry Editor

In the case of an application that can only run with a small number of CPU cores, there is an upper limit on the number of cores that the application can support by default (this needs to be confirmed based on information provided by the application's developer), but it can still be forced to change through methods such as the registry.

Disclaimer: Generally, modifying registry subkeys or work group is intended for advanced users, administrators, and IT Professionals. It can help fix some problems, however, serious problems might occur if you modify the registry incorrectly. Therefore, make sure that you follow these steps carefully. For further protection, back up the registry before you modify it. Then, you can restore the registry if a problem occurs. For more information about how to back up and restore the registry, click here to view the article.

Please feel free to let me know if you got any further updates, thanks.

Best Regards,

Manson - MSFT | Microsoft Community Support Specialist

Top answer
1 of 6
8

Setting affinity does do something, but you'll never want to use it.

Setting the CPU affinity forces Windows to only use the CPU (or cores) selected. If you set the affinity to a single CPU, Windows will only run that application on that CPU, never on any others.

Windows automatically puts run applications on the least-busy processor, so limiting it to a single CPU doesn't let Windows do its job. Even if CPU/core 1 is busy running other applications, Windows won't be able to run an application with affinity set on CPU/Core 2.

Really the only reason you would want to do that is to run an old application that doesn't work correctly when running on a multi-CPU/Core system.

2 of 6
6

This is a very useful feature in certain scenarios. Let's say you have a multi-threaded application that tends to either be idle or aggressively grabbing 100% of every CPU for several minutes, doing searches, builds, etc. Let's call this application "eclipse."

Let's also say that while you're working on this application, you have a bunch of other applications that have modest cpu requirements, but are essentially real-time applications. For example, while you're using Eclipse and it is randomly kicking off builds or doing gwt compiles, you're also using your computer to stream music or perform research in a browser window (for example, researching the cause of a build problem). Sure, you will not die if your music skips or your browser stops responding, but it's annoying.

What affinity lets you do is confine your cpu eating app to 7/8 cores so that everyone else is guaranteed access to a relatively unused cpu and you don't constantly have to deal with stuttering and interruptions to the usability of everything else on your computer while eclipse is grinding away.

🌐
Reddit
reddit.com › r/amd › manually assigning cpu affinity to games for better performance tested on csgo
r/Amd on Reddit: Manually assigning cpu affinity to games for better performance tested on csgo
March 26, 2019 -

the reason why ryzen can't compete with even the older intels is because ryzen's core are divided up by 2 CCX's in your processor chip, and ccx sucks at communicating with each other.

So if you assign csgo to JUST use 4 of the physical threads in the latter CCX ie 8 10 12 14 (for some reason the first 4 doesn't perform as well) it will feel good to play cs again.

so here's my hour wasted using ryzen 1700 @ 3.7ghz, 2x 8gb 2933 ram, 1080 graphic card, csgo on 1024x768 all low

my current launch options: -novid -nojoy -console -freq 144 +mat_queue_mode 2 -d3d9ex -threads 4***(obviously this was changed around testing different affinity counts, but they say its a snakeoil so who knows)***

8c/16t smt on w/ no affinity assignment: 296.40

8c/8t smt OFF w/ no affinity assignment: 349.12

8c/16 smt on w/ csgo on 0 8 10 12 14: 386

8c/16 smt on w/ csgo on 0 2 4 6 : 398.14

8c/16 smt on w/ csgo on 8 10 12 14: 418

proof and more gruesome visual aids for each scenarios these numbers do not represent real game performance. I only.used the map because its consistent every time and dm thing is stupid because its going to be different every other time just view the benchmark map fps to compare relative increase from the baseline. you can always try it out for yourself, if it sucks it only takes 5 seconds to revert back.

presumably this would also work in other dual core intensive games like sc2 but i dont play those other than cs. and it should work the same for 1600/2600s and other ryzens.(except they are 3+3 instead of 44)

howto easy mode: [set affinity on task manager] (https://imgur.com/a/4BpHSLu)

how to assign permanently: download process lasso

tl;dr volvo ryzen optimization update when


here's some technical mumbo jumbos

toms hardware with inter/intra ccx latency chart (scroll down)

anadtech's ian cutress briefly going over ryzen's design on his ryzen 1200/1300 review

AMD decided to go with the 2+2 arrangement for the quad core Ryzen parts, following on from the 3+3 arrangement on the hex-core Ryzen 5 CPUs..... The downside is core-to-core latency, as the CPU would have extended latency between neighboring cores and those in the different CCX, and it goes back to the non-uniform memory access argument with the Ryzen 7 CPUs.

🌐
Seven Forums
sevenforums.com › gaming › 382904-set-affinity-game.html
Set AFFINITY of a game Solved - Windows 7 Forums
October 5, 2015 - System Manufacturer/Model Number: ... Stock Hard Drives: 80GB Internet Speed: 1Mbps Other Info: WHAT U WANNA KNOW !!! ... In task manager, in the processes tab search the process. The context menu contains a "set affinity" option that allows to chose which CPUs will run ...
🌐
Steam Community
steamcommunity.com › discussions › forum › 0 › 144513248275579963
Force core affinity :: Suggestions / Ideas
But there are relatively easy work-arounds to make this happen. The simplest is to set launch arguments on steam itself to set core affinity on steam, as it will then pass that affinity to any game it launches.