Shader cache causing stutter?

Out of my depth as to how/why this happens, so take my speculation with a pinch of salt. I’m content that the issue is real though.

Most easily seen on a clean install of Zwift, there’s something not quite right with how the game recalls things like rider avatars (that I assume are compiled into a shader cache), which causes the game to stutter when other riders come into view - mainly from the opposite direction. I’m not sure if there is some regular clearing of cache that causes this to reoccur, but sometimes I get a lovely and smooth experience and others it seems to stutter a lot for no reason, when I haven’t changed anything at all. This is irrespective of frame rate, internet is rock solid etc. Maybe a reboot (rather than system shutdown/startup) or Windows update clears something which makes it worse, as some shaders are recompiled instead of pulling from cache. I don’t know.

On a brand new system though the game when first loaded stutters like crazy for a while, until it settles down, presumably as the shader cache is built up in storage. This doesn’t appear to affect other parts of the game such as scenery, with the exception of Crit City and Bologna which seem to stutter even with few others around. It’s most obvious with the avatars, and it feels like the jersey is what pops into view most obviously when the stutter happens. Could be any part of the avatar’s make up though I guess, or maybe the specific combination of everything that user has selected for their avatar.

Anyway I’ve tried absolutely everything in terms of Nvidia settings to try and resolve this, and I’ve seen it on multiple systems and setups over at least the last six months. My current setup is a 12th gen Intel CPU and RTX 3060 Ti, so there’s no lack of hardware power here. Windows and Zwift are installed on an NVMe SSD. I’m very rarely at less than 95fps, capped by vsync. Furthermore I’m using adaptive sync so any actual drops in frame rate are smoothed out. Concluded it’s nothing I’m doing wrong. There’s always been a weird FPS drop irrespective of hardware in Zwift (hence the 60fps rubber band/zooming issue), but it seems worse at present, as though a setting or configuration is wrong somewhere. Certainly the performance of the game on a new install is horrendous and it never used to be like that.

Shader cache folders are all over the place in the Zwift directories, including many within those for the launcher (‘doesn’t affect the game’ :upside_down_face:) since it went to WebView2 rather than IE. These are just the ones I know about and can see. Maybe the problem is the game or Nvidia driver not knowing where to pull things from so having to recompile in real time?

I would love to think this will be looked at but I suspect it’ll be ignored as a niche problem, like the bonkers ongoing requirement to run OBS to prevent avatars flickering. Rant over. :expressionless:

Do you have a stream of it we can see. I run a pretty high end PC as well and can’t say I’ve noticed any such issues but I could just not be looking at the right thing.

I don’t stream or have the tools (or will, tbh) to try and capture it, but I suspect it wouldn’t show up anyway. On my main rig it’s microstutter, randomly.

On a brand new system it’s ridiculously bad, but gets better over time. I suspect this is expected behaviour, but instead of it just getting to a point where there’s no stutter at all, some bits keep having to be recompiled. This would explain why it’s random on my main PC.

It could be as simple as a particular asset (or several) that isn’t configured correctly, causing them to seem ‘new’ every time you come across them. Or the game/driver is looking in the wrong place. As I mentioned, there are now tons of different shader cache folders.

Just had a thought; maybe this is related to the freezing issues on other platforms. If the game is trying to pull something that it can’t (or doesn’t exist), and rather than causing a stutter it causes a fatal error in the Radeon/Intel driver.

Done some Googl… research, and then my own testing on this. Since Nvidia driver 471.11 (June 2021), there is no longer an NV_Cache folder, a location that Zwift has always used - and still does if you use an older driver that 471.11. It can be seen populating in real time on a clean install. That folder was replaced by a DXCache folder in a different location, which Zwift does not use since it is not a DirectX game. Edit: this is wrong, it does populate.

I assume this change is why there are now numerous cache folders in Zwift’s own temporary folder (named EBWebView and previously believed to be only for the launcher), some of which are called GPUcache. A solution was presumably required to the removal of NV_Cache by Nvidia.

It remains to be seen whether using a more recent driver resolves the stuttering I’m seeing, if for some reason there was a duplication or confusion over shader cache location. Historically the driver used has never made any difference whatsoever to stability or performance, in my experience. However on initial testing I’m dubious that anything is improved, making me wonder if there’s still an issue that needs resolving.

Edit: there’s no difference, the cache files just go into DXCache instead. And it’s still stuttering, so I still believe there may be a problem with it.

Shader cache locations actively used by Zwift:
AppData\Local\NVIDIA\DXCache
AppData\Local\NVIDIA\GLCache
AppData\Local\Temp\Zwift\EBWebView\Default\GPUCache
AppData\Local\Temp\Zwift\EBWebView\GrShaderCache\GPUCache
AppData\Local\Temp\Zwift\EBWebView\ShaderCache\GPUCache
AppData\Local\Temp\Zwift\EBWebView\Default\Cache\Cache_Data*

This one could be for something other than shaders, I guess.

Edit 2: this is all bollocks

1 Like

Tried swapping settings and various bits of hardware last, no difference. Something isn’t right at present, the game stutters/judders like mad every single time you start a ride and gets better as the ride goes on, as though the cache isn’t being used and various bits are being recompiled instead of pulled from storage. I can see that the [many] cache locations appear to be being populated over time, but they don’t seem to be being used. This is on an i3-12100F/GTX 980 system, and irrespective of resolution setting. It’s really bad on a fixed refresh rate display.

This is very recent, it definitely wasn’t like this on other builds I’ve done in previous weeks/months. I’m wondering if the issues I’ve been seeing randomly on my main rig (adaptive sync) for quite a while were just a precursor to how it is now.

Getting sick of this.

1 Like

Solo ride on London (by far the least complex world on the game) and it was stuttering from time to time even on my main rig with adaptive sync and Zwiftalizer showing 95fps locked at vsync throughout. Sometimes even just the intersection popping up caused a stutter, it’s ridiculous.

Considering other current issues with workouts and screenshots causing the frame rate to tank for some people, I’m leaning towards this not being a cache thing but a problem of too much CPU load. So when there’s a spike in demand caused by other riders coming into view, or the workout overlay, or the pain effect, or someone taking a screenshot, there’s not enough capacity and the frame time is negatively affected.

Fully aware I’m just rambling along to myself and nobody cares btw.

5 Likes

I’ve always been curious. Do you never get contacted directly by Zwift technical staff regarding the matters you raise here? It seems strange (to me) to have someone who is very active in the user community and who has this level of understanding and yet to not make the most of their (your) willingness to help problem-solve issues.

6 Likes

For me i notice reduced frame rate just before it pops up then when it does it seems to go back to how it was before.

Asked me once about the avatar flickering/stutter thing that OBS resolves. They set up a Zoom call and I demonstrated it and explained exactly how to replicate it. I was really pleased they’d engaged on it.

That was in September, Wes has now left the business, and the problem is still there.

2 Likes

I think the only reason I’m not seeing a sustained, reduced frame rate from this is because the 12th gen CPUs are still easily fast enough to feed the GPU. But it introduces a delay that is enough to interrupt the delivery of frames to the display. On a fixed refresh rate display it’s particularly noticeable to me, compared to before/usual. If you’re at vsync, it should be butter smooth, but it’s not.

It’s pretty similar to disabling Game Mode which sees Windows constantly try to park CPU cores, having a massive detrimental effect on the smoothness in Zwift.

I experienced this for the first time today - pretty ugly! Reduced frame rates don’t typically bother me that much as far as noticing it but this stutter was very noticeable and annoying!

1 Like

That stuff about the game using shader cache folders in the WebView2 directory was horseshit I think. They aren’t specific to Zwift, so I think they just relate to the use of WebView2 by the launcher.

The issue could still be concerning the shader cache (for example there are now some DirectX folders that I don’t recall seeing before, being populated as the game runs), but not those I listed.

Still the same on 1.26.0.

Edit: finally picked one up in Zwiftalizer. 95fps locked, with a big frame time spike causing one data point at 51fps for no reason whatsoever. That’s very noticeable on screen.

This wasn’t in a workout.

Sometimes you get a massive stutter when an intersection image comes up that you’ve not seen in a while, or the first chat message comes on screen. Something’s not right with how stuff is being loaded.

Still the same, despite a few lovely smooth rides since 1.26.1 was released. Fed up with trying to guess what it is, possibly a crap server that I sometimes connect to and others not. Who knows.

Still the same on 1.27.0.

Turn the HUD off and use view 3. The passing road stutters intermittently irrespective of frame rate - I’m at 95fps with Gsync. No reason for this to happen.

1 Like

Have you tried without adaptive sync and vsync on?

Have you gone into bios and played with some of the settings like disabling cstates, there are a couple of other settings that can impact games by down clicking them CPU rather than run at certain speeds, is your ram also at xmp1?

Nvidia control panel make sure any power or quality settings under Manage 3D settings are set to high performance

Just for s$&ts and giggles turn off all exploit protection in windows

Try all this one at a time and see if it. I don’t have issues with Zwift but suffer similar issues in other games which have been an ongoing nightmare since I put my high end rig together a year ago!!!

One more thing, is your GPU core down clocking? For nvidia GPUs you can lock the core in MSI Afterburner to stop it from down clocking, has always been something that causes stutters in games. I lock my 370 at 1920mhz which via running a few benchmarks seems to be the best value for me

Yes.

Never needed before, but yes.

Yes.

Doesn’t do anything, tested thoroughly in the past.

I don’t see why this would do anything, never needed in the past.

No. Also, never a problem before.

All solid suggestions, but the reason this thread exists is because it’s behaviour that shouldn’t be happening.

1 Like