Skip to content

1.2.0

Choose a tag to compare

@Kkthnx Kkthnx released this 23 Sep 20:08
· 32 commits to main since this release

Clears the NVIDIA and Windows DirectX/OpenGL shader caches in one click.

Download the zip below, extract it, open the NvidiaShaderCleanup folder and double-click NvidiaShaderCleanup.bat. Approve the UAC prompt. Run NvidiaShaderCleanup.bat -DryRun first if you want to see exactly what it would touch.

Fixed

  • Services are stopped before the background processes. nvcontainer.exe is the host process for the NvContainer services, so killing it first made Windows restart the service immediately and re-lock the very caches the tool was about to clear. nvcontainer is off the kill list for the same reason.
  • Driver held files are handled properly. A few .nvph index files are held open by the kernel mode display driver. No process or service can release them, so re-running the tool could never clear them and the old advice to "close your games and try again" was wrong. They are now queued for deletion on the next reboot with MoveFileEx, the same mechanism Windows installers use. This is the real reason NVIDIA's own instructions involve a reboot.
  • Services that were running at the start are restarted even if they went down some other way.
  • Stopped services are restarted from a finally block, so an error part way through can no longer leave the display service down.
  • Space freed is measured as size before minus size after, so locked files are no longer counted as freed.

Added

  • Cache folders are found by name under the known NVIDIA roots rather than hard coded, so new driver layouts such as PerDriverVersion work with no code change. This closed real gaps: %APPDATA%\NVIDIA\ComputeCache, OptixCache, the SysWOW64 system profile and the ServiceProfiles accounts were all being missed.
  • %__GL_SHADER_DISK_CACHE_PATH%\GLCache is cleared when that variable has moved the OpenGL cache.
  • New flags: -AllUsers, -IncludeD3DSCache, -SkipServices, -SkipRebootSchedule, -LogPath, plus -WhatIf support.
  • Exit codes: 0 cleared, 1 partly cleared, 2 fatal error.
  • The launcher passes its arguments through and returns the script exit code.

Full list in CHANGELOG.md.