Fixing stuttering in iRacing with overlays, G-SYNC, and triple monitors
This article is provided without warranty or support, YMMV etc. However, if you are a professional racer (sim or otherwise), I'm willing to offer assistance on this issue for fee. Email me at [gsync AT chen DOT do].
I got into sim racing a couple of months ago and have been struggling to get overlays to work performantly with iRacing but I believe I've figured out at least a bunch of the issues that can occur and I hope this can help others.
My setup
- AMD 9800X3D, PBO, IF 2000MHZz
- 32GB DDR5 @ 6000
- NVIDIA 5080
- 3x LG Ultragear 32GS75Q-B, running at 2560x1440 @ 180Hz
- SimHub for overlays
The problem
G-SYNC was not reliably working, and this resulted in noticeable stuttering during races, especially during corners. It was unclear initially why G-SYNC would stop working, as it would be working with overlays, but restarting iRacing sometimes would cause it to not work. Disabling Multi-Plane Overlays did not help here.
Using Nvidia Surround would generally fix G-SYNC, but this would break when overlays were used.
I used a couple of different tools here to help diagnose the issue, including Special K (understanding monitor MPO state), Intel PresentMon (understanding rendering mechanism), and CapFrameX (recording frametimes to visualise stuttering). I used NVIDIA Profile Inspector to enable the G-SYNC support indicator, which gives more detailed information on G-SYNC status.
Measurement of GPU wattage can cause stuttering
Any tool that measures system metrics, especially GPU metrics, can cause stuttering. People have mentioned this especially applies to getting GPU power. In my case, the offending tool was MSI Afterburner which I was using to undervolt. CapFrameX visualised the stuttering quite clearly.
I was also using Nvidia's statistics overlay to render some metrics, including GPU power which I have since disabled, but this doesn't seem to reliably cause stuttering in my case.
Integrated GPU can cause stuttering
I noticed that the Nvidia statistics overlay would show drastically different FPS and FPS 1% metrics compared to iRacing, which was a hint that something wasn't quite right, especially with FPS 1% going as low as 15fps!
Analysing iRacing frametimes with CapFrameX showed stable frametimes after resolving stuttering caused by GPU metrics, but I was still able to see stuttering, which did confuse me at first...
I noticed in Task Manager that DWM (the desktop window manager/compositor) was running on my iGPU, and realised that even though I had SimHub and iRacing using the dGPU, any composition of windows would require the dGPU to copy 7680x1440 worth of image data to the iGPU, process composition on the iGPU, then copying this back to the dGPU to render. I estimate a frame to be about 33MB worth of data, and at 180hz, that's almost 12GB of framebuffer copies every second. When G-SYNC was working, the lower FPS meant that there was less frames being copied so the stuttering was less noticeable.
Unfortunately, it doesn't appear you can force Windows to use the dGPU for compositing. I tried adding DWM to the graphics settings and having it to use the 5080, but this had no effect.
Disabling the iGPU fixed stuttering when compositing was required, which happens when overlays being used. The downside is that you are now unable to use the iGPU for anything else. I hope Windows provides a mechanism to change this in the future.
Multi-Plane Overlays
Multi-Plane Overlays are a relatively new (2018?) GPU technology that provides a mechanism for OSes and apps to render overlays reaaaaally fast. However, it seems that this can cause problems and visual issues so most of the articles you find about it are about disabling it. However, MPOs seem pretty important to performant overlays, so I'm confused as to why iRacing recommends it to be disabled.
Interestingly enough, Special K says that DISPLAY1 supports MPO, but Display 2 and 3 don't support it. I ensured that DISPLAY1 was the center screen, as that's the screen I want overlays to be performant on.
G-SYNC and Overlays
I had some cases where G-SYNC was working (indicator was visible), but something was horribly broken, as iRacing was averaging about 30fps. Turns out what was happening was Nvidia drivers was trying to sync based on both iRacing and SimHub frame updates at the same time, and this resulted in heavy stuttering.
The fix here is to ensure that the global G-SYNC options are for Fullscreen only, then use NVIDIA Profile Inspector to set iRacing to have G-SYNC support for Fullscreen and Windowed.
My monitors have an onboard FPS overlay. I used this to verify that G-SYNC was actually working, as the FPS display will fluctuate.
G-SYNC not working after sleep/wake
The final hurdle was G-SYNC was not working after a sleep / wake. I found some comments and articles that mentioned some monitors have issues on sleep/wake and G-SYNC state, so I tried disabling deep sleep on my monitors which resolved the issue. Working theory is deep sleep + wake on monitors does not properly restore G-SYNC state.
V-Sync off
I don't understand why there are people saying to turn on V-sync in NVIDIA Control Panel but disable it in game. My understanding is that this effectively disables G-SYNC, and when I turn it on, iRacing FPS is clamped to an integer divisor of monitor refresh rate, so in my case [180, 90, 45].
Set in-game FPS limit to a smidge under your monitor refresh rate
You may see tearing if your FPS is higher than the monitor refresh rate. I set mine to 175.
Good luck!
There could be other factors at play in your setup that could cause issues.
If this article has helped you, please reference or link to this post.