feat(play): NVIDIA's shader cache raised to 10 GB when it holds under 4 GB, so Longshot's shaders stop compiling again #243
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
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
2 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!243
Loading…
Reference in a new issue
No description provided.
Delete branch "HumanBean/LongshotLauncher:feat/nvidia-shader-cache-room"
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?
Players on NVIDIA report every pipeline compiling again with no driver update. Their shader cache is held at 1 GB (the NVIDIA Control Panel's Shader Cache Size), while a start of Longshot builds about 2 GB into it, so the driver throws pipelines out as it fills. A player who raised it to 10 GB saw no more rebuilds, and logs on the forge show caches sitting at 1025 MB (Longshot#2079).
Summary
On Windows, before a build (which prepares the shaders) and before Play, the launcher reads NVIDIA's Shader Cache Size through NVAPI. A size under 4 GB is raised to 10 GB, the same 10 GiB the game gives NVIDIA's cache on Linux (
hos_main.cdriver_cache_room), and Home says so in its notice.Core/DriverSettings.cs:RaiseShaderCache/ShaderCacheShortdecide, behindINvidiaShaderCache.NvApiProfilesreads and writes the current global profile'sPS_SHADERDISKCACHE_MAX_SIZE(0x00AC8497, MB;NVDRS_SETTING_V1handled as bytes, 12320 long at pack 4). This is the setting the control panel's Global Settings changes.0xFFFFFFFF), any size of 4 GB or more, andPS_SHADERDISKCACHEturned off are all left alone, and so is a driver that doesn't know the setting.NVAPI_INVALID_USER_PRIVILEGE), Home shows a card once per launcher start: Stop shaders compiling again at every start, then "NVIDIA's shader cache holds 1 GB, and Longshot needs about 2 GB." and a quieter note ("For every game on this PC. Windows asks for permission first."). Raise to 10 GB is the primary button and Not now a quiet link. The button starts the launcher again elevated with--raise-nvidia-shader-cache, which does only that (Program.Main), and reads Waiting for Windows… while UAC asks. Success is a toast. A refusal turns the card into the steps to do it by hand, with Try again.nvapi_interface.h,NvApiDriverSettings.h,nvapi.h), and the MB unit from NVIDIA Profile Inspector's reference (1 GB =0x400, 10 GB =0x2800).Read first:
Core/DriverSettings.cs(RaiseShaderCache,NvApiProfiles.ShaderCache/SetShaderCacheMb), thenLauncherService.RoomInNvidiaCache.The game side, which logs the limit and stops counting on a cache under 4 GB, is a Longshot pull request of its own (linked in a comment).
Testing
Tested: the app and
tests/launcher_corecompile (dotnet build, Linux). The screenshot scenehome-nvidia-cacherenders the card (screenshot in the latest comment). The policy has checks intests/launcher_core/DriverSettingsChecks.cs(NvidiaCacheChecks): 1 GB raised, not raised twice, 4 GB / 100 GB / Unlimited / Off / cache off / setting unknown left alone. Those checks have not run on this PC (no tests are run here); CI runs them.Still to test (none of it can run on Linux):
Risks
NvidiaProblem). The game then starts as before.🤖 Generated with Claude Code
The new notice on Home (screenshot scene
home-nvidia-cache), when the driver wants an administrator: Raise it to 10 GB beside it.Possibly related, for context:
The game side: Longshot#2125 reads the limit, logs it, and stops counting on a cache under 4 GB.
The offer is now a card of its own, like the Hookshot-saves and launcher-update offers, in place of a button squeezed beside the warning notice: a title, one line with Details, Not now and Raise to 10 GB (Waiting for Windows… while UAC asks). Success is a toast; a refusal turns the card into the steps to do it by hand, with Try again.
The card redone: its whole text with no Details, Raise to 10 GB as the one strong button, Not now as a quiet link.
WIP: feat(play): NVIDIA's shader cache raised to 10 GB when it holds under 4 GB, so Longshot's shaders stop compiling againto feat(play): NVIDIA's shader cache raised to 10 GB when it holds under 4 GB, so Longshot's shaders stop compiling again