GPU pipeline::make: permanently MAKING pipelines re-burn VICTORY_PIPELINE_WAIT_MS every frame #1181
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/fxceless--victory-fork#1181
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@BitWuehler on GitHub · 2026-11-25 23:03 UTC · original
Environment
fxceless/victory-fork+ open perf PRs (#1078, #1086, #1136, #1137, #1138, #1146, #154, #159, #1112)Finding 1: Repeated per-frame
VICTORY_PIPELINE_WAIT_MSstall on stuckMAKINGpipelinesIn world frames, 4 pipelines remain
(4 being made)for the entire session. Becausemake::ready()entersmake::wait()wheneverp.made.get().is_none(), every frame that binds one of them re-burns the fullVICTORY_PIPELINE_WAIT_MSbudget:VICTORY_PIPELINE_WAIT_MS=500:framelogreportspipelines: 0 made, 0 loaded, 500.1 ms waitedon every world frame (med=761.2 ms / 1.3 fps,usual frame: 616 ms).VICTORY_PIPELINE_WAIT_MS=50: World frames immediately improved tomed=252.1 ms (4.0 fps),max=8.6 fps (116.8 ms/frame), andusual frame: 87–92 ms(with50.1 msof that still spent onPipelineWaitUs).Suggested improvement: Once a
Pendinghas waited through a substantial fraction of a frame's budget without completing, skipwait()on subsequent frames (still checkingp.made.get()locklessly so it becomes usable if the worker ever finishes). That preserves first-frame waiting for normal PSOs while dropping steady-state stall on stuck entries to0.0 ms.Finding 2: Startup prewarm hang from
early-pipelines.txtAfter a run persisted newly seen late-scene entries into
early-pipelines.txt(2,678 entries), 4 consecutive launches hung during startup prewarm right after loadingearly-pipelines.txt(before anyms/frameoutput). Restoring the prior 2,663-entry list immediately restored normal boot into the scene.Note: Log analysis and write-up were AI-assisted based on local runtime measurements.
@BradRoland on GitHub · 2026-11-25 23:22 UTC · original
I reproduced the repeated wait in a native Windows WARP replay with four jobs held in
MAKING. With a 20 ms configured budget, main recorded 30–34 ms of elapsed wait on each of six frames on this machine. The same job consumed the shared budget every time. This reproduces the scheduling behavior independently of Proton.The pipeline change in powplusplus’s #867 already stops repeated waits. In the replay it spent the first frame’s budget and recorded zero on every later frame. Three of the jobs had their first wait marked as used while the frame budget was empty. A small follow-up gives those jobs a turn when a later frame has time. It recorded 27, 30, 30, 31, 0 and 0 ms across the six frames, with a different job getting each positive wait. At zero budget every frame recorded zero. A compute pipeline that finished later became usable on the next bind with zero additional waiting. I shared the correction with the original PR author. Follow-up on #867 · Runnable replay
The startup hang remains a separate finding. The early file contains pipeline keys. At startup the renderer reads them into a set, then matches them when the title creates a pipeline. A key’s position in the file therefore does not establish compile order. Your 14-entry set is a useful lead. Replaying halves from a saved copy would narrow it if the hang reproduces consistently. Early-list lookup
@BitWuehler on GitHub · 2026-11-26 00:01 UTC · original
Follow-up from live Linux (GE-Proton + RTX 5080) testing with #867's
waited_framechange inpipeline/make.rs:PipelineWaitUsdropped cleanly to0.0 ms waitedon subsequent world frames (even with a 200 ms first-frame budget).early-pipelines.txtreliably avoids the startup hang across runs, though without prewarm fewer pipelines load early (~1,857 vs. ~2,696). Thanks for #1194 — will capture the exact stalled prewarm key in a diagnostics build next.Note: Log analysis and write-up were AI-assisted based on local runtime measurements.
@BitWuehler on GitHub · 2026-11-26 00:14 UTC · original
Update after restoring
VICTORY_PIPELINE_WAIT_MS=500together with #867's one-framewaited_framecap + #1188 (VICTORY_BACK_QUIET=1):med=4.6 fps (217.7 ms),max=9.6 fps (104.3 ms/frame)(up from4.0 / 8.6 fps),usual frame: 98 ms,prep med: 79.0 ms,dropped med: 366.Note: Log analysis and write-up were AI-assisted based on local runtime measurements.
@BitWuehler on GitHub · 2026-11-26 00:23 UTC · original
A/B measurement on
VICTORY_TEXTURE_NO_WAIT(Linux GE-Proton + RTX 5080, with #867 + #1188):VICTORY_TEXTURE_NO_WAIT=0:tex med=200.5 ms,prep med=339.3 ms,fps med=2.0 (502.0 ms),max=10.2 fps (97.9 ms/frame)— scene loading stalls heavily waiting on texture memory to hold still, though steady frames later hit110 ms(38-frame usual mean).VICTORY_TEXTURE_NO_WAIT=1:prep med=79.0 ms,fps med=4.6 (217.7 ms),max=9.6 fps (104.3 ms/frame).NO_WAIT=0, so they are not caused byVICTORY_TEXTURE_NO_WAIT=1.Note: Log analysis and write-up were AI-assisted based on local runtime measurements.
@BitWuehler on GitHub · 2026-11-26 00:32 UTC · original
Consolidated Linux (GE-Proton11-14 + vkd3d-proton, RTX 5080) A/B summary across today's runs:
PIPELINE_WAIT_MS=500, no#867)500.1 ms waitedon every frame (4 stuckMAKINGjobs)PIPELINE_WAIT_MS=5050.1 ms waitedper frame;usual frame: 87–92 ms#867waited_frame+#1188(BACK_QUIET=1) +PIPELINE_WAIT_MS=5000.0 ms waitedsteady-state;usual frame: 98 msVICTORY_TEXTURE_NO_WAIT=0tex med=200.5 ms(loading stalls, steady frames hit110 ms)VICTORY_TEXTURE_NO_WAIT=1,TEXTURE_PAGES=0usual frame: 99 ms,94%card busy; visual artifacts unchangedVICTORY_CARD_WINDOWS_MB=256(WINDOW_UPLOAD=1)98%busyNote: Log analysis and write-up were AI-assisted based on local runtime measurements.
@j-fuxa on GitHub · 2026-11-26 01:41 UTC · original
Two notes from our tree, which hit the same stall (one global per-frame wait with no per-pipeline memory: up to 500 ms on every frame that binds a pipeline still being made).
One-frame cap against a per-pipeline budget. The one-frame claim in #1234 (taken under the budget lock only when the frame has budget left) gives the same steady state as our fix, which keeps a cumulative waited time per pipeline and stops waiting once it has used one full budget. A partial wait counts toward the budget, so a pipeline first bound when little was left still gets its turn later. Nothing to change there; mentioned in case the two are compared.
A worker panic would leave a pipeline "being made" for the rest of the run. In pipeline/make.rs at
fabf3c4,Pending::makerunsHostPipeline::newinsideOnceLock::get_or_initwith nocatch_unwind, and the worker loop doesnext().make()and thenWAITING.fetch_sub(1). The release profile has nopanic = "abort", so a panic in translation or pipeline creation unwinds out of the loop and ends that worker thread.madestays unset,waiting()is never decremented,DONEis never signalled, and the pool is one worker smaller. Every frame that binds the pipeline then waits for it (or drops its draws, with #1234) until exit.We cannot say whether this explains the four pipelines stuck as "(4 being made)" in this issue. A
panicked atline from a thread namedvictory-pipelines-Nin the log would show it.Suggested: run
HostPipeline::newunderstd::panic::catch_unwind(AssertUnwindSafe(..))inside theget_or_initclosure, treat a panic as a refused pipeline (None), log the shader hashes, and letmake()still notifyDONE. The worker then reachesWAITING.fetch_suband keeps serving the queue.Caveat: this is defensive. We observed no panic that we can tie to this issue, and we have not run your tree.
@milesah3ad on GitHub · 2026-11-26 01:47 UTC · original
@j-fuxa thanks, both points are useful.
On (2), data from this side: six sessions of this fork on an RTX 5080 (Windows, native D3D12, driver 621.24), all on
006c353(five of them with #1234), stdout and stderr captured, 5 to 20 minutes each, plus one session of avatarmanz/VIctory-7900XTX (a fork of this tree). Nopanicked atline anywhere, fromvictory-pipelines-Nor any other thread. In every session the frame line's "(N being made)" counted down to 0 once the cold pipelines were built and stayed there (the last 20 frame lines of each run: 0 in every line but one). So on this machine nothing stays stuck inMAKING: the stall here was the per-frame re-wait on pipelines that were still compiling, which #1234 removes.That doesn't rule out your panic case on other trees or drivers, and
catch_unwindaroundHostPipeline::newlooks like the right defensive change on its own: a lost worker and a pipeline that never reports done would be hard to see otherwise. Happy to run it here if someone opens it.AI-assisted (Claude Code); the numbers are from the logs of these runs.
@BitWuehler on GitHub · 2026-11-26 14:11 UTC · original
@j-fuxa @milesah3ad checked all 6 of our recent Linux (GE-Proton11-14 + vkd3d-proton, RTX 5080) logs where
(4 being made)stayed at 4: 0panicked at/ panic lines anywhere in those logs, matching @milesah3ad's Windows observation.So the 4 stuck entries on our Proton setup are likely long/hung driver/vkd3d compiles rather than panicking workers, though wrapping
HostPipeline::newincatch_unwindis still a great defensive safeguard. Pulling #1234 into our test build on top ofa20809dnext to validate the budget-aware one-frame claim on Linux/Proton too.Note: Log check and write-up were AI-assisted based on local logs.
@anon31-006459 on GitHub · 2026-11-26 17:08 UTC · original
Same on Linux / NVIDIA Ampere: RTX 3070 Ti 8 GB, driver 595.104.02, Proton Experimental 11.0-20261112, Ryzen 7 3700X, 32 GB RAM, fork main
ac25549+ the #1820 recipe, Series S.(4 being made)stayed at 4 for the whole session in every run I checked over two days. Each run also logs 4 compute pipelines ashost pipeline refused ... Invalid parameter (0x80070057). I have not checked whether those are the same 4, and your hung-compile reading may fit better.pipelines: 0 made, 0 loaded, 500.1 ms waitedon every world frame, usual frame about 655 ms (1.5 fps).VICTORY_PIPELINE_WAIT_MS=20: 126 to 160 ms frames in the same room (6.2 to 7.9 fps), and no extra draws dropped (170 to 320 a frame, as with 500).So +1 for not re-waiting on a pending entry that has already used up a frame's budget. 20 ms has been our default since.
AI-assisted (Claude Code, Claude Opus 5.5); numbers from runs on my machine.
@BitWuehler on GitHub · 2026-11-26 23:07 UTC · original
Follow-up on
52ac4ec(CachyOS, GE-Proton11-14 +vkd3d-proton, RTX 5080 16 GB, Series X profile), answering @anon31-006459's question above:#1353): With46da5ee(#1353panic guard) merged in52ac4ec,(4 being made)still stays at4across all world sessions with0panic log lines.0x80070057refused compute pipelines: Inpipeline/make.rs, a0x80070057refusal returnsNonefromHostPipeline::new, completesPending::make(), and decrementsWAITING(WAITING.fetch_sub(1)). In our Series X world runs (32-lane host), 6 compute shaders loghost pipeline refused ... 0x80070057whileWAITINGstays at 4 — confirming that 4 of the 8 worker threads are genuinely blocked inside never-returningvkd3d-proton/NVIDIA pipeline compiles.VK_NV_raw_access_chainsand#1234: LeavingVKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chainsunset causes additionalvkd3d-proton/NVIDIA compiles to spin at 98–100% of one core indefinitely during loading (preventing world entry). WithVK_NV_raw_access_chainsdisabled + PR#1234(7195775, one-frame wait cap) merged onto52ac4ec, the remaining 4 workers finish ~2,300 pipelines and steady-state world frames drop from 500 ms/frame pipeline wait to0.0 ms waiting for pipelines(at 5,000–6,900 draws/frame) despite(4 being made)remaining.(AI-assisted code audit, log analysis, and summary.)