perf(gpu): add opt-in tiered WDDM residency orchestrator (VICTORY_WDDM_RESIDENCY=1) #282
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/TaynanGT--Vice-Tay!282
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-282"
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?
@Vladimir-Human on GitHub · 2026-11-27 13:37 UTC · original
Vladimir-Human:feat/uma-wddm-adapter-scorer→main· +1769 −32 · 6 files · 1 commits · openSummary
Split out WDDM tiered residency (
VICTORY_WDDM_RESIDENCY=1, default0) first per@TaynanGT's review (UMA fast path & smart multi-GPU adapter selection removed here; automatic UMA selection stays off everywhere):crates/victory-gpu/src/residency_wddm.rs:IDXGIAdapter3::SetVideoMemoryReservationon local VRAM (targets_working_bytes, capped strictly belowAvailableForReservationandBudget, with UMA cap<= 25%viaprobe_uma).ID3D12Device1::SetResidencyPrioritytiering for committed RT/depth/hot buffers (HIGH), active textures (NORMAL), and idle texture pool blocks (LOW/MINIMUM).ID3D12Device::Evict/MakeResidentlifecycle on aged idlepool.rstexture heaps (completed_submission >= idle_fence), with rollback onmapped()failure and zero D3D12 debug errors.crates/victory-gpu/src/pool.rs):VICTORY_WDDM_RESIDENCY=0,pool::room,pool::texture,Pool::take_ripe, andPool::reclaimexecute the exact unmodified baseline code paths without querying submissions or modifying residency state.Verification
cargo xtask policy:asset policy: 323 files okcargo clippy -p victory-gpu --all-targets -- -D warnings(default &--features diagnostics): 0 warningsVICTORY_D3D12_DEBUG=1) &VICTORY_D3D12_WARP=1(--test-threads=1):residency_wddm::tests: 3 passed, 0 failed (both HW & WARP)pool::tests: 12 passed, 0 failed (both HW & WARP, includingdefault_disabled_wddm_take_ripe_and_reclaim_preserve_baseline_order)No gameplay run was performed locally for this change; performance impact in-game is unmeasured.
The remaining smart-adapter scorer & explicit
VICTORY_UMA_FAST_PATH=1(autodisabled) portion is staged onVladimir-Human/Vice-Tay:feat/smart-adapter-uma-optinfor follow-up once this lands.- Probe D3D12_FEATURE_ARCHITECTURE1 at device init (with legacy ARCHITECTURE fallback and runtime telemetry) and automatically disable redundant RAM-to-RAM card buffer twins and copy-queue bounce copies on UMA adapters, with VICTORY_UMA_FAST_PATH=0/1 and VICTORY_CARD_BUFFERS=0/1 controls and zero regression on discrete GPUs. - Add residency_wddm.rs wrapping IDXGIAdapter3::SetVideoMemoryReservation (clamped to OS AvailableForReservation and Budget), ID3D12Device1::SetResidencyPriority (HIGH for RT/depth/hot buffers, NORMAL for active textures/heaps, LOW/MINIMUM for idle pool blocks), and fence-safe lock-free Evict()/MakeResident() on aged idle pool.rs texture heaps with VICTORY_WDDM_RESIDENCY=0 opt-out and WARP/legacy driver tolerance. - Add adapter.rs upgrading hardware selection via IDXGIFactory6 (DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE) scoring dedicated VRAM (>= 4 GiB), SM 6.6+, TiledResourcesTier, and display output LUID affinity, checking MonitorFromWindow output adapter LUID vs device.GetAdapterLuid() at startup and presenter creation, and fixing numeric GPU model substring filters ("4090", "6700", etc.) in VICTORY_D3D12_ADAPTER.@TaynanGT on GitHub · 2026-11-27 13:43 UTC · original
@Vladimir-Human UMA, residency reservations and adapter selection should be independently testable. Start with an explicit adapter choice so the same physical GPU runs both sides. Record local and shared memory alongside frame time before recommending any of these as a default.
Add native UMA fast path, tiered WDDM residency, and smart multi-GPU adapter scorerto Add opt-in UMA fast path, tiered WDDM residency, and smart multi-GPU adapter scorer572aa47524to56af81d4f7@Vladimir-Human on GitHub · 2026-11-27 14:12 UTC · original
@TaynanGT Updated to
56af81d4(rebased ontomain, 4/4 CI green). All three behavioral paths now default to0(OFF) so baseline behavior stays unchanged unless explicitly opted in, and each subsystem can be measured independently on the same physical GPU pinned viaVICTORY_D3D12_ADAPTER:VICTORY_UMA_FAST_PATH00,1,auto1forces UMA fast path (for same-GPU A/B);autofollowsD3D12_FEATURE_ARCHITECTURE1.UMA. Disables card buffer twins (shadow::cards,Host::card_ready,card_before,card_budget,shadow::card_room_kept() == 0) and bounce copy-queue staging (upq::on,relay_copy).VICTORY_CARD_BUFFERS=0|1overrides card buffers independently.VICTORY_WDDM_RESIDENCY00,1IDXGIAdapter3::SetVideoMemoryReservation(clamped<= AvailableForReservationandBudget),ID3D12Device1::SetResidencyPriority(HIGHRT/depth/hot buffers,NORMALactive textures/heaps,LOW/MINIMUMidle pool blocks), and fence-safeEvict()/MakeResident()on aged idlepool.rsheaps (preservingVICTORY_RIPE_BLOCKSunder normal VRAM, collapsing to1/0hot spares under>= 75%/>= 85%pressure).VICTORY_SMART_ADAPTER00,1IDXGIFactory6(DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE) scoring (SM 6.6+, dedicated VRAM>= 4 GiB,TiledResourcesTier, output LUID tiebreak). When0, keeps the baseline first-SM-6.6+ loop with zero extra probe devices.Explicit
VICTORY_D3D12_ADAPTER=<name|index>selection (including numeric GPU model substrings such as4070,4090,6700) and read-only startup telemetry (uma,cache_coherent_uma, active switch states, output LUID check, and local/sharedDXGI_QUERY_VIDEO_MEMORY_INFObudget/usage/reservation alongside frame-time logs) remain active across both control and opt-in runs.Suggested same-GPU A/B sequence (pinning
VICTORY_D3D12_ADAPTER=<gpu>across all runs and recording local/shared VRAM + frame time):0)VICTORY_UMA_FAST_PATH=1(orautoon an APU)VICTORY_WDDM_RESIDENCY=1VICTORY_D3D12_ADAPTER):VICTORY_SMART_ADAPTER=1Tests added/verified on both RTX 4070 SUPER and WARP (
VICTORY_D3D12_DEBUG=1,0debug errors):adapter::tests::all_three_subsystems_default_off_and_toggle_independently,adapter::tests::uma_policy_defaults_off_and_toggles_independently_with_safe_overrides,adapter::tests::live_device_probes_architecture1_and_luid_cleanly, andresidency_wddm::tests::live_wddm_reservation_priority_and_evict_make_resident_roundtrip.@TaynanGT on GitHub · 2026-11-27 14:25 UTC · original
@Vladimir-Human The three switches now give us independent comparisons. Start with WDDM residency alone on the same discrete adapter and report the eviction count, local/shared memory and p10 frame rate. Test
autofor the UMA path on an APU and leave the scorer for a machine with two eligible adapters.@Facostarr on GitHub · 2026-11-27 16:20 UTC · original
I tried the effect of the UMA fast path on an APU (Ryzen AI Max+ 395 / Radeon 8060S, driver 32.0.32029.2010), without building the PR. Per the diff, for the
-Machine 7900xtxprofile the UMA policy comes down toVICTORY_CARD_BUFFERS=0,VICTORY_RELAY_COPY=0andVICTORY_INDIRECT_CARD_BUDGET=0(VICTORY_UP_QUEUEandVICTORY_CARD_WINDOWS_MBare already off by default), so I ran877a40ewith those three.Series S, same save, world only: 3 FPS median against 17 with card buffers on. The CPU takes over the snapshots and compares: copying back goes from 14-18 ms to 120-310 ms per frame, preparing from 46-52 ms to 300-470 ms, and private memory reaches 112.8 GB (commit 153.9 GB, from 31.5 and 73 GB). On this UMA APU, the compare on the card is what keeps the host fast, so
autowould be a large regression on such machines.Also, unless I misread it, the
pool.rschanges (take_ripe,reclaim) run on the default path with all three new switches at 0, so the PR may not be behaviour-neutral by default; worth a check.Full report, with log lines and the other switches tried on this APU: #319
@TaynanGT on GitHub · 2026-11-27 16:25 UTC · original
@Facostarr The 17-to-3 FPS result is enough to keep automatic UMA selection off for this APU. It applies to the three toggles on
877a40e. The exact PR still needs the same-save check. I’ll check whethertake_ripeandreclaimenter the new path with all three switches at zero.56af81d4f7tob4c1f1dd25@Vladimir-Human on GitHub · 2026-11-27 19:53 UTC · original
@Facostarr @TaynanGT Updated
#282(b4c1f1dd, rebased ontomain):Strict default-0 neutrality in
pool.rs(confirmed@Facostarr's catch):VICTORY_WDDM_RESIDENCY=0(default),pool::room,pool::texture,Pool::take_ripe, andPool::reclaimnow execute the exact unmodified baseline paths — skippinghost::submissions(),queue::queued(),reclaim_with_fence,take_ripe_or_restore, andset_heap_priority. Addedpool::tests::default_disabled_wddm_take_ripe_and_reclaim_preserve_baseline_orderverifying baseline ordering and zero residency side effects at0.@Facostarrspotted when reading the earlier diff was real inpool.rs(take_ripe/reclaimenteredtake_ripe_or_restore/reclaim_with_fenceeven at0); that is now completely eliminated.Removed automatic UMA card-buffer disable:
UmaFastPathMode::AutosoVICTORY_UMA_FAST_PATH=auto(or unset) resolves toOffand never disables card buffers automatically on UMA APUs after@Facostarr's Ryzen AI Max+ 395 / Radeon 8060S measurement (17 -> 3 FPS regression and 31.5 -> 112.8 GB private memory spike).VICTORY_UMA_FAST_PATH=1remains strictly an explicit diagnostic override.Verified cleanly on
b4c1f1dd(xtask policy324 files ok,clippy -p victory-gpu --all-targets -- -D warnings0 warnings, and bothVICTORY_D3D12_DEBUG=1HW RTX 4070 SUPER andVICTORY_D3D12_WARP=1:adapter::tests6/6,residency_wddm::tests3/3,pool::tests12/12).@TaynanGT on GitHub · 2026-11-27 19:59 UTC · original
@Vladimir-Human The new guard in
pool.rsrestores the default-off reclaim path. Please split out WDDM residency first, with the test that checks baseline ordering and zero residency side effects. Keepautooff on UMA given the Radeon 8060S result.Add opt-in UMA fast path, tiered WDDM residency, and smart multi-GPU adapter scorerto perf(gpu): add opt-in tiered WDDM residency orchestrator (VICTORY_WDDM_RESIDENCY=1)b4c1f1dd25to4687df5eb8@Vladimir-Human on GitHub · 2026-11-27 20:48 UTC · original
@TaynanGT Done — split
#282(4687df5, rebased ontomain2a577f8) down to tiered WDDM residency only (VICTORY_WDDM_RESIDENCY=1, default0):residency_wddm.rs,pool.rs(including the strict default-0 baseline guard andpool::tests::default_disabled_wddm_take_ripe_and_reclaim_preserve_baseline_order),residency.rs,resource.rs, and the minimalhost.rsreservation/priority hooks (using a localresidency_wddm::probe_umahelper so there is noadapter.rsdependency).adapter.rs,host/upq.rs,shadow.rs, and all UMA fast-path / smart-adapter selection changes from#282and staged them onVladimir-Human/Vice-Tay:feat/smart-adapter-uma-optinwith automatic UMA selection (auto) kept disabled per@Facostarr's Radeon 8060S result.#282(4687df5) cleanly:xtask policy(323 files ok),clippy -p victory-gpu --all-targets -- -D warnings(default &diagnostics, 0 warnings), and bothVICTORY_D3D12_DEBUG=1HW +VICTORY_D3D12_WARP=1:residency_wddm::tests3/3,pool::tests12/12.View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.