Game: Deleting NVIDIA shader cache causes pipelines to load every boot and excess RAM usage #1156
Labels
No labels
area/accessibility
area/audio
area/input
area/install
area/menu
area/renderer
area/saves
area/tooling
area/upscaling
beanstalk: approved
beanstalk: failed
beanstalk: needs approval
beanstalk: running
beanstalk: tested
ci: approved
good first issue
gpu/amd
gpu/igpu
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
needs measurements
platform/linux
platform/macos
platform/steam-deck
platform/windows
preview
priority
critical
priority
high
priority
low
regression
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/Longshot#1156
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Reported on Discord
Longshot version
Longshot v3.0.0-rc.5; Hookshot 2.3.2. The reporter later tested Nightly 376.
What happened
The reporter initially suspected Longshot and Hookshot overwrite each other's NVIDIA shader-cache files, but further testing with only Longshot installed/rebuilt indicates the behavior also occurs after clearing NVIDIA's shader cache, without Hookshot.
With a fresh Longshot build, the first launch loads pipelines; at the main menu it uses about 10–12 GB RAM and creates an approximately 1 GB NVIDIA shader-cache file. Subsequent launches go directly to the main menu without a pipeline-loading screen and use about 10–12 GB RAM. After closing the game and clearing the NVIDIA shader cache (manually or with DDU), the next launch loads pipelines again; the reporter says it then uses about 18–20 GB RAM at the main menu. Subsequent launches continue to show pipeline loading (around 30–40 seconds) and use around 18–20 GB RAM, with the shader-cache file increasing in size on each run.
The earlier alternating-app test reportedly showed a similar difference: whichever app was run first compiled quickly and later launches did not repeat it (about 10 GB RAM); running/building the other app appeared to trigger repeated compilation and around 20 GB RAM. The reporter now believes cache deletion, rather than a conflict between the apps, is the central trigger.
NVIDIA shader-cache directory and files
C:\Users\<user>\AppData\Local\NVIDIA\GLCache\be6a607e7a9c8f8f9917daf3807f0576\76ba14ed21429ba6Files observed:
Graphics card and driver version
NVIDIA RTX 5070 Ti, driver 621.14.
Resolution
The reporter reports that this behavior is resolved in Nightly 376. After installing/running that nightly, they cleared NVIDIA's cache and relaunched: shader compilation took about five minutes, RAM reportedly stayed below 4.5 GB during compilation, was about 9 GB at the main menu and below 12 GB in-game. The next boot went directly to the main menu with no pipeline-loading screen. They ask that the issue be closed.
The relevant pipeline-cache save fix is Longshot#903, first included in nightly-358-1aec0c3c; the reporter's Nightly 376 test confirms the behavior resolved for their setup.
What is still unknown
From Discord:
Additional reproduction details from Discord: Longshot v3.0.0-rc.5 and Hookshot 2.3.2 alternate behavior depending on which is built/run. For either order, the first app reportedly compiles shaders quickly, then does not recompile on later opens and uses about 10 GB RAM in-game. Building/running the other app then appears to overwrite the same NVIDIA GLCache files, causes slower shader compilation on each open, and about 20 GB RAM in-game. Using only one is the reporter's workaround. They suspect the NVIDIA cache but have not confirmed the cause. Still needed: Windows version, CPU/system RAM, clarify what the 10/20 GB measures, and evidence/logs or screenshots of cache and behavior.
From Discord:
Further clarification from Discord: the reporter says they have now confirmed this is an issue with Longshot / the NVIDIA shader cache, not a Longshot–Hookshot conflict. They report that deleting the shader file in either app's testing causes the observed shader recompilation and RAM-use behavior. The precise reproduction/evidence and cause are still unknown.
Updated with more from Discord: Added the single-Longshot cache-clear reproduction, repeated pipeline loading, RAM and cache-size observations; cause remains unconfirmed.
Game: Longshot and Hookshot appear to overwrite NVIDIA GLCache shader filesto Game: Deleting NVIDIA shader cache causes pipelines to load every boot and excess RAM usageUpdated with more from Discord: Renamed the issue to focus on NVIDIA shader-cache deletion, repeated pipeline loading, and increased RAM use, as requested.
From Discord:
The reporter asks whether they can add pictures showing the NVIDIA/Longshot cache file structure before and after clearing the NVIDIA cache. They have not attached the pictures yet.
From Discord:
Additional cache-folder screenshots from Discord (before clearing NVIDIA's shader cache): after a fresh build, before launching Longshot,
rc/cacheshowslongshot_pipelines.bin(864,765 KB),longshot_programs.bin(7,617,818 KB), andlongshot_vk_pipelines.bin(1,465,567 KB), among other files. After launching, the folder additionally showslongshot_compute_variants.bin,longshot_computes.bin,longshot_module_ids.bin,longshot_pipeline_states.bin,longshot_pipelines.bin.built, andlongshot_vk_pipelines_play_1.bin,_play_2.bin, and_play_3.bin. Existing pipeline/program/Vulkan pipeline files retain the displayed sizes in both screenshots. These images document Longshot's own cache before/after launch, not NVIDIA's cache before/after clearing. Attachments:before_starting_the_game.pngandafter_starting_the_game.pngfrom Discord message 1572020889141248122. Remaining: Windows version, CPU/system RAM, RAM measurement method, logs/performance measurements, and NVIDIA cache evidence before/after clearing.From Discord:
Additional screenshots from Discord (message 1572021516017860829) show the NVIDIA GLCache folder before launching Longshot after a fresh build, and after launch; both states are before clearing NVIDIA's cache. Before launch it lists
b1e9447e9c4752ec.bin(185 KB) and.toc(1 KB),e3fb34c5b7c4b995.binand.toc(1 KB each), andb4217564bad97491.bin(1,049,165 KB) and.toc(775 KB). After launch, the displayed folder contains onlyb4217564bad97491.bin(1,465,037 KB) and.toc(1,218 KB). These show changes across launch, not a direct before/after-clear comparison.From Discord:
Additional screenshots from Discord message 1572022119653707956 show Longshot's
C:\Users\<user>\Games\Longshot\rc\cacheafter clearing NVIDIA's shader cache, before and after starting the game. Before launch, the displayed cache containsprompts,longshot_pipelines.bin,longshot_prepared.bin,longshot_programs.bin,longshot_programs.idx,longshot_vk_pipelines.bin, andlongshot_vk_pipelines.stamp. After launch it additionally showslongshot_load_start.txt,longshot_pipeline_states.bin,longshot_pipelines.bin.built, andlongshot_vk_pipelines_play_4.bin;longshot_pipelines.binandlongshot_programs.bindisplay the same sizes as before. This adds Longshot-side cache state for the post-NVIDIA-cache-clear run; it still does not show NVIDIA GLCache contents after clearing. Attachments:Before_starting_game_after_emptying_shader_cache.pngandAfter_starting_game_after_emptying_shaders.pngfrom message 1572022119653707956.From Discord:
From Discord message 1572022529193672857: screenshots directly show NVIDIA
GLCache\be6a607e7a9c8f8f9917daf3807f0576\76ba14ed21429ba6after clearing (empty), then after launching Longshot it containsb4217564bad97491.bin(1,049,478 KB) andb4217564bad97491.toc(943 KB). This documents the cache repopulating after a cleared launch. Attachments:Before_starting_game_after_emptying_shader_cache.pngandAfter_starting_game_after_emptying_shaders.png.Related fix now available: Longshot#903 writes pipeline cache after a sufficiently long precompile before the title; first included in nightly-357-55e8fbd5. It may address the repeated compilation following cache clearing, but whether it resolves this reporter's NVIDIA case is not confirmed.
Updated with more from Discord: Added the Nightly 376 test result and linked the merged pipeline-cache save fix (#903), which first shipped in nightly-358-1aec0c3c.