Repository navigation
1.2.0
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.exeis 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.nvcontaineris off the kill list for the same reason. - Driver held files are handled properly. A few
.nvphindex 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 withMoveFileEx, 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
finallyblock, 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
PerDriverVersionwork with no code change. This closed real gaps:%APPDATA%\NVIDIA\ComputeCache,OptixCache, theSysWOW64system profile and theServiceProfilesaccounts were all being missed. %__GL_SHADER_DISK_CACHE_PATH%\GLCacheis cleared when that variable has moved the OpenGL cache.- New flags:
-AllUsers,-IncludeD3DSCache,-SkipServices,-SkipRebootSchedule,-LogPath, plus-WhatIfsupport. - Exit codes:
0cleared,1partly cleared,2fatal error. - The launcher passes its arguments through and returns the script exit code.
Full list in CHANGELOG.md.