GPU: an opt-in slow-pipeline guard, VICTORY_SLOW_PIPELINES=1 (stacked on #2721) #2909
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2911"
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 Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-25T23:50:13Z.
Stacked on #2721, the slow-frame report; only the last commit is new. Split out of #2721 after review.
With
VICTORY_SLOW_PIPELINES=1(off by default, because it drops title work), compute dispatches and mesh draws are timed. A pipeline is dropped when one of its commands goes over the limit (VICTORY_SLOW_PIPELINE_MS, 100 ms) in 3 frames in a row, not counting its first 10 frames.State::bind).The point: a submission can't be stopped once it runs, and one the host takes 2 s for resets the device. The cost is that what the dropped pipeline computes is missing; each ban and retry is logged.
Tests
skips.draw::tests::a_banned_pipeline_is_dropped_from_lists_recorded_after_the_banchecks on the host GPU that a list recorded before the ban still runs it, and one recorded after doesn't.--features diagnostics. The two NVIDIA heap-limit failures that #2121 fixes also happen on main.Not run with the title.
Imported from Marvisak/VIctory. Originally posted by kotekompotek on 2026-11-25T23:52:59Z.
Review: COMMENTED
Scoped review: opt-in drop of pipelines measured too slow happens at record time (closed lists keep the commands — replay isn't corrupted), and per-op timing via time_start/time_end feeds the decision. One thing to double-check on the base: skipping a draw entirely also skips its resource transitions/barriers the prelude planned — if the next draw assumed the dropped one's final states, a skip could need a state repair; worth confirming the planner handles mid-list holes.
Imported from Marvisak/VIctory. Originally posted by fuzeofficlal on 2026-11-26T00:04:07Z.
Review: COMMENTED
Verified head
7abc8fc3(stacked on#2721) cleanly merged ontoorigin/main(63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP +VICTORY_D3D12_DEBUG=1).Code & Concurrency Review
VICTORY_SLOW_PIPELINESoff (andVICTORY_FRAME_TIMING != 1),skips()andtiming()stay lock-free relaxed atomic checks without allocating query heaps/readback buffers or takingGUARD. Timestamp deltas safely usesaturating_subandfrequency.max(1).crates/victory-gpu/src/frame_budget.rs:584, testL1136): The!timedmessage still reads"GPU work (commands are not timed with VICTORY_SLOW_PIPELINES=0)". Now that timing is split out behindVICTORY_FRAME_TIMING=1, pointing users toVICTORY_FRAME_TIMING=1avoids nudging someone who only wants command timings to turn on the drop guard.frame_budget.rs:471, 492-501): OnceANY_BANNEDflips true (for 60s–16m), every recording thread takes the globalMutex<Option<Guard>>on everyState::bind(even for unbanned pipelines), contending withran()/presented(). Using anRwLock(read lock inskips()) would keep parallel list recording uncontended.Local Verification (
VICTORY_D3D12_DEBUG=1)frame_budget::tests15/15,draw::tests21/21 (includinga_banned_pipeline_is_dropped_from_lists_recorded_after_the_ban),pipeline::21/21,host::tests(non-descriptor) 12/12.--features diagnostics):frame_budget::tests15/15,draw::tests::a_banned_pipeline_is_dropped_from_lists_recorded_after_the_ban1/1.cargo clippy --locked -p victory-gpu --all-targets -- -D warnings(default and--features diagnostics) &cargo test -p xtask --locked(6/6, policy ok): clean.Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T00:36:17Z.
@fuzeofficlal thanks, both notes are addressed:
16aa2a49), merged into this branch.skips()now reads the banned names from anRwLockand never takes the guard's mutex (0f845952). The set is rewritten only when bans change.a_banned_pipeline_is_skippednow asserts thatskips()takes no guard lock.The guard stays opt-in (
VICTORY_SLOW_PIPELINES=1). The frame budget tests and clippy, with and withoutdiagnostics, pass.Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-26T02:20:51Z.
Automated triage for the maintainers.
Needs work (unchanged). Thanks for stating the purpose: the guard keeps the device from being reset when one submission takes about 2 s, and gives up the banned pipeline's output to do it. The head has not changed, so this still carries all of #2721. Please rebase once #2721 is settled, so the diff is only
frame_budget.rsand theskipscheck indraw.rsState::bind.Whether to ship a switch that drops the title's work is still the maintainer's call. Note also that #2936 traced a loading-time device removal to missing title memory in the page table (
memory::CAPACITY), not to a slow pipeline as such. Evidence that the guard's case still happens once that kind of cause is fixed would help the decision.CI: passing.
Generated by Claude Code
Imported from Marvisak/VIctory. Originally posted by 0xkn0wh3r3 on 2026-11-26T06:42:25Z.
Understood. I'll rebase this onto main once #2721 lands or closes, so the diff is only the guard. To answer what it's for: it's a way to keep the device alive, not a diagnostic or a frame-rate tool. A submission can't be stopped once it runs, and one that takes the host about 2 s resets the device, which ends the run. The guard trades the dropped pipeline's output (logged per ban and retry) for a run that keeps going. That's why it's off by default and needs
VICTORY_SLOW_PIPELINES=1.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.