GPU Cache

Mesa Shader Cache

Mesa stores per-application compiled GPU shader cache data on Linux so OpenGL and Vulkan programs do not have to recompile the same GLSL, SPIR-V, and driver-lowered shader variants on every launch. Depending on Mesa version, this cache lives either as many files under mesa_shader_cache or as a newer single-file mesa_shader_cache_db database containing compiled shader blobs and related metadata. Kudu removes both cache formats so stale driver-specific shader artifacts can be rebuilt cleanly without touching saves, settings, accounts, or other personal data.

Why it matters

Why clean Mesa Shader Cache?

  • Compiled shader blobs from an older Mesa build or previous GPU driver stack can become invalid after an update, causing stutter, hitching, or long pauses while a game recompiles shaders on launch
  • A corrupted mesa_shader_cache_db file can make one app repeatedly rebuild shaders every run, which shows up as unusually slow startup and recurring in-game compilation pauses
  • Per-application shader variants accumulate across game updates and graphics setting changes, so the cache can grow large under ~/.cache and waste disk space without improving current performance
  • Stale pipeline cache entries can trigger visible glitches such as missing effects, incorrect lighting, or black surfaces until the application regenerates fresh compiled shaders
  • When many small cache files build up in the older mesa_shader_cache directory, filesystem overhead increases and shader lookups can become less efficient, especially on slower storage
  • The single-file cache database can suffer SQLite page fragmentation over time; VACUUM rewrites the database without deleting rows, but clearing it fully is the simplest way to reclaim space and force a clean rebuild
  • After switching GPUs, changing Mesa drivers, or moving between integrated and discrete graphics, old cached shader variants may no longer match the active hardware, leading to extra compilation stalls and inconsistent frame pacing
What gets cleaned

Cache paths Kudu targets

Linux

~/.cache/mesa_shader_cache
~/.cache/mesa_shader_cache_db
Frequently asked

Common questions about Mesa Shader Cache

Free & open source

Download Kudu and reclaim your disk space.

Available on Windows, macOS, and Linux. No account required, no feature gates, no telemetry without consent. All cleaning targets are open source and community-auditable.