GPU: an opt-in slow-pipeline guard, VICTORY_SLOW_PIPELINES=1 (stacked on #2721) #2911
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2911
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-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?
@0xkn0wh3r3 on GitHub · 2026-11-25 23:50 UTC · original
0xkn0wh3r3:gpu/slow-pipeline-guard→main· +1525 −42 · 6 files · 12 commits · openStacked 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.
The report named the frame's time, ours, the GPU's and pipeline waits, and the slowest commands by their shader hashes: enough to see that a frame was slow, not what made it so. It now splits the frame into its parts and names the largest as what bound it, with why: - our work around submissions, each phase on its own: descriptor heap sync (and evictions), texture uploads, refreshing host copies of title memory, and copy-back of what shaders wrote; - the GPU's; - pipeline waits; - the rest ("outside submissions"): the title's own work on its threads and the translation of its command-list calls as it makes them. With the guard on, the GPU's part is broken down by kind of command (compute, mesh, and their indirect forms: time and count) and by how the commands' programs reach memory: title memory by address through the page table (whose writes set bitmap bits with atomics), write marks through views, views picked from the heap, view addresses read. The slowest commands are described the same way, with their group counts: "600 ms compute 1024x1x1 groups [title memory by address] [compute ..]". A GPU-bound frame's why reads, for example, "80% of the timed GPU time is compute work (412 commands); 80% is in programs using title memory by address". Nothing in it depends on a particular title. The phases are a few Instant reads per submission and relaxed atomic adds, as before; with the guard off nothing is timed or locked.f3578e3) into gpu/frame-budget 1bf3f89ff0@0xkn0wh3r3 on GitHub · 2026-11-26 00:36 UTC · original
@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.@Marvisak on GitHub · 2026-11-26 02:20 UTC · original · edited 2026-11-26 07:23 UTC
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
@0xkn0wh3r3 on GitHub · 2026-11-26 06:42 UTC · original
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.