# Feature Suggestion: Assigning Interrupt affinities



## hans_glans (Jun 8, 2021)

Another thing many users do to help with latency issues is to assign the gpu driver (and optionally its pcie bridge) to a specific core, like described by Calypto here: 









						Calypto's Latency Guide
					

Calypto’s Windows Latency Guide Smoother, more responsive gameplay and input  Latency is the time between a cause and an effect. An example of latency is input lag, or the time between moving your mouse and the cursor moving on the screen. A good portion of latency comes from the operating system...




					docs.google.com
				




Very briefly, it helps alleviating the stress on core 0.
This is achieved by Microsoft’s Interrupt-Affinity Policy Tool which is tedious. 

An integration would be a big time saver.
Note that users with HT/SMT enabled would have to proceed differently.


----------



## W1zzard (Jun 14, 2021)

This has been added to test attached build, please confirm


----------



## hans_glans (Jun 14, 2021)

Looks great! I chose specific core 4 in my test and had this result:


http://imgur.com/a/ByZACPh

So it did successfully assign the bridge's affinity but not the gpu itself. I'm not quite sure if that makes a difference in the end.

According to Calypto, the actual gpu affinity must be changed.

There are also users reporting freezing when msi mode is set before affinities. (both using a 1080TI - no such reports on other cards)
Is there a way to first apply affinities, have the driver or system restart and then apply msi mode afterwards?


----------



## W1zzard (Jun 14, 2021)

hans_glans said:


> So it did successfully assign the bridge's affinity but not the gpu itself. I'm not quite sure if that makes a difference in the end.


Very strange, it should have set the GPU's affinity. I'll test with the Microsoft Tool



hans_glans said:


> Is there a way to first apply affinities, have the driver or system restart and then apply msi mode afterwards?


From what I understand affinities and priorities have no effect until MSI is enabled. This could be placebo? What's your sample size?


----------



## hans_glans (Jun 14, 2021)

It's only 2 users, both with a 1080TI, who reported this issue when setting msi mode before affinities.


----------



## W1zzard (Jun 15, 2021)

Does this build work better? Fixed some bugs in the MSI affinity code


----------



## hans_glans (Jun 15, 2021)

Yes, this time I picked core 7 and the gpu is assigned properly! 
It's great already but I would suggest an optimal scenario: 
The pci-bridge was still assigned to core 4 from the previous test. It'd be nice if previous affinities (only of gpu and its pci-bridge) were removed and then both the gpu and it's pci-bridge were assigned to the same specified core(s).


----------



## W1zzard (Jun 15, 2021)

I didn’t touch the bridge, it looks for devices of gpu class, with vendor 10de, with driver by nvidia


----------



## hans_glans (Jun 16, 2021)

Yes, but the corresponding bridge should be assigned to the same core as the gpu.




Also, shouldn't this only reach from #0 - #9 for my 10 cores processor?


----------



## W1zzard (Jun 17, 2021)

hans_glans said:


> Yes, but the corresponding bridge should be assigned to the same core as the gpu.


No reason imo. The PCIe path has nothing to do with interrupt handling



hans_glans said:


> Also, shouldn't this only reach from #0 - #9 for my 10 cores processor?


Correct, typical off-by-one error. Will fix. Also start at "1" to make it more readable for humans? Task Manager starts at 0 though


----------



## sewerin0911 (Jun 18, 2021)

These are the right settings for a 5900X with SMT right?

Thanks for adding HDCP btw.


----------



## hans_glans (Jun 18, 2021)

I'm personally not proficient enought to tell with certainty. In my experience you would assign SMT affinities either to every other core (so only the physical cores are ticked) or to the specific core + it's thread. I'm not sure if Spread Across All Processors helps over default. Try Calyptos suggestion for SMT in the guide and maybe someone more versatile can shed some light on it here.



W1zzard said:


> No reason imo. The PCIe path has nothing to do with interrupt handling
> 
> 
> Correct, typical off-by-one error. Will fix. Also start at "1" to make it more readable for humans? Task Manager starts at 0 though


Not sure - starting at "1" should be easier for inexperienced users, while it probably confuses everyone who is used to microsofts tool.


----------



## sewerin0911 (Jul 3, 2021)

I did it like that but also noticed a small bug here. Core starts at 0 (I have 24 Threads) and ends at 24. Actually it should be 23 

Also I set my cores like that without the logical cores.


----------



## W1zzard (Jul 3, 2021)

sewerin0911 said:


> and ends at 24. Actually it should be 23


Whoops lol, classic off-by-one error



sewerin0911 said:


> Also I set my cores like that without the logical cores.


any idea if the logical cores are 12..23 or 1,3,5,7,9.. ?


----------



## Selaya (Jul 3, 2021)

The latter.


----------



## sewerin0911 (Nov 17, 2021)

W1zzard said:


> Whoops lol, classic off-by-one error
> 
> 
> any idea if the logical cores are 12..23 or 1,3,5,7,9.. ?


The even numbers are the real cores and the odd numbers are the logical cores. 0 -> real 1 -> corresponding logical core and so on...



hans_glans said:


> I'm personally not proficient enought to tell with certainty. In my experience you would assign SMT affinities either to every other core (so only the physical cores are ticked) or to the specific core + it's thread. I'm not sure if Spread Across All Processors helps over default. Try Calyptos suggestion for SMT in the guide and maybe someone more versatile can shed some light on it here.
> 
> 
> Not sure - starting at "1" should be easier for inexperienced users, while it probably confuses everyone who is used to microsofts tool.


It is recommended to not play around with affinities anymore. SpreadAcrossAllProcessors can help in fact with scalability for sure. However, it is recommended to set it to a specific core (with corresponding logical core if SMT is enabled). The specific core is usually one of the best cores, procedure especially known on Ryzen CPUs. I would leave it on Default since it does not affect much. I tested it...


----------



## hans_glans (Nov 18, 2021)

Results can differ quite much according to my testing. Unfortunately, it seems like Windows reassigns affinities randomly across boots (please correct me here if wrong) so that specifying one for the gpu has inconsistent results. 

One core might be the best for one boot and the worst for another. Still, I think it can be beneficial to at least assign it away from core0 (the same is true for the USB controller for example which can result in more consistent mouse graphs...) due to most processes being active on that one by default - again please correct me here. 

So overall it can't really hurt to at least have the gpu assigned to one specific core that is not core0, I guess?!


----------

