Affinity Tool

Everything about latency. Tips, testing methods, mouse lag, display lag, game engine lag, network lag, whole input lag chain, VSYNC OFF vs VSYNC ON, and more! Input Lag Articles on Blur Busters.
Post Reply
Coldplayer
Posts: 31
Joined: 23 Jul 2017, 08:19

Affinity Tool

Post by Coldplayer » 14 May 2023, 08:54

Hi just wondering with Affinity tool is it best to put the mouse/graphics card on the same core or have them separate? Also apart from mouse/keyboard are there any other devices that would benefit assigning to their own core?

Thanks

User avatar
Tiberiusmoon
Posts: 147
Joined: 10 Feb 2023, 05:05

Re: Affinity Tool

Post by Tiberiusmoon » 14 May 2023, 12:27

Use latencymon to test, each system can have different factors.

kokkatc
Posts: 108
Joined: 23 Mar 2017, 13:49

Re: Affinity Tool

Post by kokkatc » 15 May 2023, 17:16

Coldplayer wrote:
14 May 2023, 08:54
Hi just wondering with Affinity tool is it best to put the mouse/graphics card on the same core or have them separate? Also apart from mouse/keyboard are there any other devices that would benefit assigning to their own core?

Thanks
I used to mess around with core interrupt affinities quite a bit.

Here's what I found in regards to your question...

For starters, taking your USB controller or MOUSE off core 0 has a significant impact on how your mouse behaves. Every time I did this on several different systems, whether it's intel/AMD, my mouse speed instantly became faster and more erratic. Ultimately I didn't like the feel of my mouse when moving it to another core so I keep it on 0 now. You'll have to decide for yourself if you prefer the behavior of your mouse after taking it off core 0.

The biggest latency improvements will come w/ taking your GPU off core 0. I personally move it to core 3 or 4. You can use latency monitor to get an idea of which core has the most headroom. Once you figure that out, put your GPU on that core and run Latency Monitor to test. I do get less stuttering when doing this and games are smoother. Frametimes before and after will confirm this.

In regards to whether both your GPU and USB need to be on the same core or not, I don't think so, but I have encountered weird behavior at times when changing both my GPU and USB to different cores. I wouldn't be surprised if there are certain core combinations you want to stay away from but this is based on a system by system basis. Get familiar with Latency Monitor.

Also as a side note, Windows 10 and Windows 11 differ quite a bit it seems in how interrupts are dealt with. When changing the GPU core affinity on Win 10, my latency improvement is rather significant. When changing GPU affinity on Windows 11, the latency improvement is minor in comparison. Windows 11 must have made some optimizations in this area.

I'd also keep it simple and not begin changing too many devices interrupt core affinity. Your NIC likely uses RSS (Receive side scaling) and already scales the load across several cores, so leave your NIC alone. I haven't tested my audio all that much so I couldn't say on that device. Put your GPU/USB in MSI mode, test different cores for your GPU/USB and go from there.

Coldplayer
Posts: 31
Joined: 23 Jul 2017, 08:19

Re: Affinity Tool

Post by Coldplayer » 15 May 2023, 21:47

Sorry not too sure what to look for in latencymon. Judging off these screenshots what core should i change the GPU to? Also in the drivers tab is there anything wrong with anything I can clear up?

Cheers
Attachments
latencymon2.png
latencymon2.png (45.43 KiB) Viewed 5805 times
Latency Mon.png
Latency Mon.png (43.92 KiB) Viewed 5805 times

Coldplayer
Posts: 31
Joined: 23 Jul 2017, 08:19

Re: Affinity Tool

Post by Coldplayer » 15 May 2023, 21:54

Anyone sure what ndis.sys is and why it's causing latency? I've disabled bluetooth/wifi. I've just got stock network drivers should I install the realtek drivers?
Attachments
ndis.png
ndis.png (9.26 KiB) Viewed 5801 times

User avatar
Tiberiusmoon
Posts: 147
Joined: 10 Feb 2023, 05:05

Re: Affinity Tool

Post by Tiberiusmoon » 16 May 2023, 01:27

Download the network driver that comes from the manufacturer website of your motherboard.
You can assign NDIS to core 9 and 10 to see if it reduces latency further.

Also take note that power saving features will affect latency results negatively.
So set your GPU preferred power plan to max for Global, and use windows ultimate power plan while doing the latencymon test.

Set GPU to core 3

Coldplayer
Posts: 31
Joined: 23 Jul 2017, 08:19

Re: Affinity Tool

Post by Coldplayer » 16 May 2023, 08:24

Any reason to put it to Core 3 as I think it's a hyperthreaded core. I ran autogpu affinity which said core 10 had the best FPS. Should I go with that or go with the lowest latency one on latencymon?

I've just changed GPU to core 10 but changed anything else yet. Can anyone give me recommendations on what to change based on the screenshots i've attached. The first screenshots I ran i didn't leave it running long enough.

Thanks
Attachments
newlatency2.png
newlatency2.png (46.89 KiB) Viewed 5620 times
newlatency.png
newlatency.png (74.54 KiB) Viewed 5620 times

User avatar
Tiberiusmoon
Posts: 147
Joined: 10 Feb 2023, 05:05

Re: Affinity Tool

Post by Tiberiusmoon » 16 May 2023, 09:35

Hyperthreading adds latency, reduces single core performance, and adds heat to gain hyperthreaded cores.

Disable it and re run the tests.

kokkatc
Posts: 108
Joined: 23 Mar 2017, 13:49

Re: Affinity Tool

Post by kokkatc » 16 May 2023, 12:24

Coldplayer wrote:
15 May 2023, 21:47
Sorry not too sure what to look for in latencymon. Judging off these screenshots what core should i change the GPU to? Also in the drivers tab is there anything wrong with anything I can clear up?

Cheers
Try placing your GPU on CORE 6. You have hyperthreading, so every even # (Starting with 0) is your core, and the number just below the even number is your thread. EX. Core 0 = Core, Core 1 = thread, Core 2 = Core, Core 3 = thread, etc. 0, 2, 4, 6, 8, 10, 12, 14 = Core. 1, 3, 5, 7, 9, 11, 13, 15 = threads. Before you do, check to see what your system's average latency is first because you want to compare how much this changes after changing your GPU to a different core. The point is to confirm if moving a device to another core actually lowered your overall system's latency. As said earlier, Latency Monitor is a great tool for this, get familiar.

In Latency Monitor the 'Main' tab gives you a quick overview of your system's DPC Latency. If you see nothing but green you should be relatively fine. If you see spikes of RED, you likely have a problem driver or setting. The stats tab is a good place to look at your system's 'Average measured interrupt to DPC Latency,' along with getting more detailed information about specific driver issues. The Drivers tab is very useful as well as it will list in order of latency which drivers have the highest/lowest latency. Typically your nvlddmkm.sys (GPU), dxgkrnl.sys(GPU), ntoskrnl.exe drivers will have the highest latency. If other drivers are showing higher latency than the ones I just mentioned, it's good to investigate further to see if you have faulty drivers.

Note: NDIS, TCPIP = your NIC (Network Interface Card)

I saw a previous post suggesting to move it to core 10. My suggestion would be to leave your NIC alone and let the built in RSS (Receive side scaling) do its thing. RSS already load balances your NIC's interrupts to multiple cores depending on your CPU. There's really no point to move it to another core manually. It will not yield lower DPC latency.

Coldplayer
Posts: 31
Joined: 23 Jul 2017, 08:19

Re: Affinity Tool

Post by Coldplayer » 17 May 2023, 09:41

Thanks for the tips, changed my mouse to the same core as my GPU and it feels way faster and hard to control. Not sure if it's good to learn how to use this or change it back.

Post Reply