GPU: keep host pipeline libraries per adapter #1015
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1015"
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?
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by yumaste on 2026-11-28T11:10:36Z.
Port of Marvisak/VIctory#2803. The NVIDIA fork currently uses one host pipeline library per cache directory. A run on another adapter can reject that library, then replace it with an incompatible one.
Scope the serialized library, pending replacement and temporary file to the actual D3D12 adapter. The shared early and slow lists stay at the cache root. A compatible legacy library can still load without modifying the legacy files. An unreadable scoped cache disables writes for that run. Keep the mapped-file lifetime and pending replacement path used by this fork.
Related to #555, which selects the device. This PR uses the identity of the device that was actually created.
Windows validation:
cargo test -p victory-gpu --locked --lib: 456 passed, 36 ignored.VICTORY_LIBRARY_MAP=0. The switching test serializes and reopens real D3D12 libraries on Intel hardware and Microsoft WARP.manual_is_multiple_oflint allowed.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Dukestar69 on 2026-11-28T11:47:22Z.
Review: APPROVED
Tested locally merged onto
main(63b902f).cargo xtask policypassed (294 files ok).cargo test -p victory-gpu --lib pipeline::passed (28 passed; 0 failed, includingswitching_between_hardware_and_warp_preserves_each_cache,legacy_cache_is_read_only_and_an_unreadable_scope_is_protected, anda_new_save_supersedes_an_existing_pending_library) with 0 compiler warnings.Clean per-adapter pipeline library isolation preventing cache clobbering across hardware/WARP switches. LGTM.
Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Exopus-0x65f7ad0 on 2026-11-28T13:36:35Z.
Tested the upgrade path on native Windows, with an existing preloaded cache: the case most users will hit after updating.
Setup: RTX 5060 Ti 8 GB, Windows 11 26300, driver from today.
63b902fplus this PR, plus local commits (one local commit tolibrary.rs, a save-cadence tweak, was reverted for this test so the PR runs as written). The cache was filled byvictory preloadthis morning (host-pipelines.bin, 73,988,180 bytes, at the cache root). README launcher defaults. Two starts in a row.host pipeline library loaded bytes=73988180 mapped=true(the legacy file, mapped)host pipeline library loaded bytes=75690220 mapped=true(the scoped file)bytes=75690220 … made=1189 loaded=963adapters/hardware-10de-2d04-1444196e-a1/host-pipelines.bincreated (75,690,220 B)host-pipelines.binSo:
Blob::readtriesMapped::openfirst, which was my one worry for 16 GB machines.loaded=963on start 1 matches what the same save gives without the PR (loaded=961), so no warm-up was lost in the move.One unrelated thing: start 1 stalled during world load (no frame lines after a 1,030 ms frame). It's the stall from #846, which I also got on a build without this PR this morning on the same machine, so it's not caused by this change.
Looks good from here. 👍
Edit: the stalls I mention here turned out to come from a local, unpublished commit in my own build (a dispatch that waits for its compute pipeline with no time limit). With it off, 0 stalls in 5 starts. They are not the upstream #846 stall; see my correction on #846.