protonscr

The Finals compiles shader cache at every game launch on Nvidia gpu

vkd3dclosed
HansKristian-Work/vkd3d-proton#2506 · opened 2025-06-14 by sklynic · updated 2025-07-19 · 4 comments · github
Ssklynic 2025-06-14 github

Software information

This game have a shader compliation (UE5 pre compiling shader cache) when start it for the first time.

On Proton&amdgpu (here I uses laptop's intergrate gpu for comparison), the game compiles shader at first launch, then every launch afterwards only takes seconds (using exist shader cache).

However, when using Proton with Nvidia gpu, after compiled shader cache at first launch, the game still compiles shader at every launch, keeps exist vkd3d-proton.cache untouched (for all time), and UE5's .upipelinecache/.ushadercache files untouched (until closing the game then write it, when compiling shader these two are untouched).

System information

  • GPU: NVIDIA GeForce RTX 3060 Mobile / Max-Q; AMD Radeon 680M
  • Driver: 575.57.08; mesa 25.1.3
  • Wine version: Proton Experimental
  • VKD3D-Proton version: (the one shipped with Proton Experimental.) 4a06883816c55481f9ad901276ce2b9851755cd2 vkd3d-proton (vkd3d-1.1-4605-g4a068838)

Log files

Log files are too big, compressed here:

steam-2073850_amdgpu_2nd-launch.tar.gz

steam-2073850_nvidia_2nd-launch.tar.gz

Ssklynic 2025-06-14 github

also a side note: find this in the launch log with nvidia gpu, is this relevent to the issue?

vkd3d_pipeline_library_disk_cache_initial_setup: Cannot load existing on-disk cache due to driver version mismatch.

Ssklynic 2025-06-14 github

this is due to nvidia driver removes shader cache that bigger than 1024MB. even with this env set __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1
, nvidia's driver removes them anyway. it's not a vkd3d's bug.

MMatheus-Faneco 2025-07-18 github

Hey, not sure if this is still an issue for you, but here’s a workaround I used in case it helps anyone facing the same issue.

You're right, the problem seems to be that shaders are deleted when the cache exceeds 1 GB, but this only happens when using the default nv/glcache directory.

In this NVIDIA forum post, a moderator stated:

"The shader cache size is a (soft) maximum of 128MB. It is a good idea to use a dedicated location for each application so that heavy applications can use the entire shader cache. In fact, various games on Steam are doing exactly this.
There is no setting available to increase the size of the cache currently."

So, I created a custom cache directory:
mkdir -p ~/.the_finals_nvcache

Then added this to the game's launch options:
__GL_SHADER_DISK_CACHE_PATH="$HOME/.the_finals_nvcache" __GL_SHADER_DISK_CACHE_SKIP_VALIDATION=1 %command%

With this setup, shaders now persist. The game compiles them on first launch as expected, and subsequent runs are noticeably faster.

Hope this helps.

Ssklynic 2025-07-19 github

Replying to 2506 (Comments)

Good to hear that env would work. I had figure out you needs to set __GL_SHADER_DISK_CACHE_SKIP_CLEANUP=1 at system level (for example /etc/envorinment then logout&login) than steam's launch command to make it work.

Also let's move to https://github.com/ValveSoftware/Proton/issues/7317 if there is further issue about this game running on proton as it's the general issue traker; it's not vkd3d's issue after all.