why changing CPU affinity for some games by removing core 0 fixes the performance issues

137 viewsOtherTechnology

I’ve seen couple of games like stalker, elder ring or fallout 4 perform better when you remove 1 core from the game’s executable. But why?

In: Technology

3 Answers

Anonymous 0 Comments

Most Windows processes (desktop, browsers, messaging services, email, etc) tend to run on Core 0 (the first CPU core).

By telling your game not to use Core 0 forces it to use another Core (or other multiple Cores) which aren’t bogged down those processes.

Anonymous 0 Comments

how can you even do that ?

Anonymous 0 Comments

So when you have CPU with Simultaneous Multi Threading (SMT) like Intel’s Hyperthreading, the workload isn’t necessarily distributed to actual physical cores of the CPU.

When the CPU is working through the instructions it receives from the software it is running, those instructions rarely use ALL of the cores resources.

For example, a core might have 4 Arithmetic Processing Units, but an instruction only needs 2. So you have 2 spare APUs going unused on that core.

If you have another instruction in the queue that also only needs 2 APUs, you could execute both of those instructions on the same core at the same time and get more performance out of your CPU.

That’s what SMT implementations do. They organise instructions so that multiple threads can be executed on the same physical core simultaneously by fitting them into the cores resources.
And that’s where virtual cores come from, 2 virtual cores per physical core means the CPU will always be trying to share its resources so it has two threads executing where ever possible.

But because you want always get instructions that can fit together, especially from two specific threads, using virtual cores will never perform as consistently well as using separate physical cores.

Now what affinity is is specifying that you want some software to execute on that core as much as possible.

And basically no one thinks to write their application with a process affinity of anything other than the first group.

So you get a lot of things (including the OS) competing for those group resources while the rest of the CPU goes unused.

So when you set affinity to something other than the first group, that process will all but get a physical core to itself.