protonscr

Force arbitrary steam-level regeneration of Vulkan shaders

steamclosed
ValveSoftware/steam-for-linux#8973 · opened 2022-12-07 by timothom · updated 2022-12-07 · 1 comments · github
2 matching comments, n / p to jump
Ttimothom 2022-12-07 github

Your system information

  • Steam client version (build number or date):
    *** --> Build Dec 1 2022 at 22:40:28**
  • Distribution (e.g. Ubuntu):
    *** --> Manjaro Linux 22.0.0 Sikaris**
  • Opted into Steam client beta?: [Yes/No]
    *** -->No**
  • Have you checked for system updates?: [Yes/No]
    *** -->Yes, system packages are current, FYI Nvidia driver is 525.60.11**

Please describe your issue in as much detail as possible:

Describe what you expected should happen and what did happen. Please link any large code pastes as a Github Gist

-->
I ran into some system stability issues unrelated to Steam. I think I have them cleared up, but I would like to stress test my system to be sure. One of the easiest ways to make my system crash was with Steam's ' Processing Vulkan shaders '. Specifically, I mean the steam dialog window that pops up after you first download a game and are running it for the first time. The game hasn't launched yet, this is steam getting ready to launch the game. The subsequent workload (a gray/black steam menu with a progress bar...the game is NOT running yet) is a great stability test.

The only problem, once Steam gets this done for the game, it will save the compiled shaders in some database (is it .foz file somewhere? I can't find it for the life of me) and not re-generate them again until it has to (like the game did an update or a device driver changed). This is fine behavior for the regular path.

The game I am testing with mostly is Tiny Tina's Wonderlands, which also will do an additional 'Optimizing Shaders' phase in-game. I have found it possible to force THIS phase of shader re-compilation by specifying an alternate path for the shader persistent cache path via the env:

__GL_SHADER_DISK_CACHE_PATH="/home/timothom/.tim_vulkan/tiny_tina" %command%

However I'm not sure this compilation is as stressful on my CPU as phase when Steam does it.

2 questions:

1 - How can force Steam to re-compile the Vulkan shaders the next time I launch the game?

2 -Where are these steam-level first-pass compiled shaders stored?

The only way I can do it now is to uninstall and reinstall the game. I don't think any of us want me or any steam users doing that unnecessarily.

This is not a bug, this is a question I can't figure out after trying to make this happen for a few hours and found myself stumped.

BTW, I am very happy with my Linux gaming experience via Steam. Valve does a GREAT job and you are a wonderful part of the Linux community. I appreciate your efforts and product very much. Thank you for your time.

Steps for reproducing this issue:

Kkisak-valve maintainer 2022-12-07 github

Hello @timothom, going to Steam -> Settings -> Shader Pre-Caching and toggling Enable Shader Pre-Caching off and on again will reset the entire sub-component including flushing any locally built game shaders by fossilize.

If you inspect the game's environment, like using htop, going the the game's process, and pressing e (for environment variables), we can see Steam sets some shader cache environment variables for the game like AMD_VK_PIPELINE_CACHE_PATH DXVK_STATE_CACHE_PATH MESA_GLSL_CACHE_DIR MESA_SHADER_CACHE_DIR and __GL_SHADER_DISK_CACHE_PATH. These are commonly <steam library folder>/shadercache/<appid> or a near variant.

As a side note, there is also a feature request at #6486 for finer grained control of this sub-component.

If a game does its own application-level caching of shaders, that is independent of Steam's shader pre-caching.