gpu: trim mapped driver shader-cache pages when idle (VICTORY_DRIVER_TRIM) #112
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/ReTerryDavis--ReVIctory!112
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-111"
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?
@SovietBearz0r on GitHub · 2026-12-05 12:40 UTC · original
SovietBearz0r:minivi-drivercache-trim→main· +457 −2 · 5 files · 1 commits · closed without mergingReturn mapped driver shader-cache pages to the OS once pipeline work has settled:
VICTORY_DRIVER_TRIM(on;0off).What
New self-contained
crates/victory-gpu/src/drivercache.rs: walks the process's mapped files (VirtualQuery+K32GetMappedFileNameW), finds the driver's shader cache (NVIDIADXCache\*.nvphetc., files >= 16 MiB), unlocks 64 MiB chunks (VirtualUnlock) so resident pages can be dropped, only after >= 5 s without a pipeline load/creation (pipeline::quiet_ms()), with a 30 s empty-walk back-off. Nothing found = safe no-op; hooked into the host's existing sweep next topipeline::trim_library, and re-armed after pipeline activity.Verification
cargo test -p victory-gpu --lib: 717 passed (5 new: path matcher/filtering/chunking/quiet floor, on temp files); normal and--features diagnosticsbuilds compile.cargo check -p victory,cargo xtask policy, clippy: clean.VirtualUnlockon driver-owned cache pages is the documented way to let them go but only unofficially relied on; guarded by committed/mapped re-checks and the idle floor.Source: Androtim/MiniVI
c7d3102b(+499, newdrivercache.rs).@ReTerryDavis on GitHub · 2026-12-05 17:37 UTC · original
Closing this one —
VICTORY_DRIVER_TRIMis default-ON, untested in-game, and usesVirtualUnlockon GPU driver-owned shader-cache mappings (the same aggressive working-set trimming class recently reverted in8746753):drivercache.rs:261-300):found()validatescommitted_mappedonce before unlocking, then iterates 64 MiB chunks with 1 ms sleeps without re-verifying the mapping/path. If the driver unmaps its cache and the VA range is reused,VirtualUnlocktargets unrelated memory.VirtualUnlockon driver-owned memory can also silently break a driver's ownVirtualLockif present, and filename heuristics (*.bin/*.db/*.cache) are brittle across drivers.github-bot referenced this pull request2026-12-05 18:30:03 +00:00
@SovietBearz0r on GitHub · 2026-12-05 18:27 UTC · original
Review addressed and resubmitted as #159 (I can't reopen this one: GitHub doesn't let the author reopen a PR closed by the maintainer). The new PR is rebased on current main and its body lists point-by-point what changed; closed this thread is fine, please use the new one.
Pull request closed