Repository navigation
GPU: cap the time a frame waits for compute pipelines made at their dispatch (#1420) - #1450
arminkhaleghirod wants to merge 1 commit into
Conversation
…ispatch With VICTORY_PIPELINE_COMPUTE_WAIT on (the default) a compute dispatch makes its pipeline on the spot, however long that takes. With an empty cache the first cutscene met 457 compute programs in one frame at about a second each: the frame did not end for over 30 s and the title's own hang watchdog stored to address 0 (+0x23cf683, fxceless#1420). A frame now waits for such pipelines up to VICTORY_PIPELINE_COMPUTE_WAIT_MS (8,000 by default, summed over threads); after that its dispatches wait within the frame's budget as with VICTORY_PIPELINE_COMPUTE_WAIT=0. The first 600 frames (loading) still make theirs whatever it costs.
|
This cap addresses a startup stall I measured on RTX 5060 Laptop / GE-Proton11-14 with a At Assisted by Codex (GPT-6.2-Sol High). |
|
Windows repro for the crash in #1420: Windows 11 build 26200, RTX 4060 Laptop GPU (8 GiB, driver 610.88). I built base
All three faults were writes to |
|
Follow-up test context (2026-11-27): a later build using the pipeline pre-build approach in PR #1226, with early-use keys identified from a prior run involving the #1450/#1442 changes, advanced into the prologue without reproducing +0x23cf683 in the observed window. The tested build was based on the pre-build PR, not this PR, so this is not evidence that #1450 prevents the watchdog. Performance remained very low and draws were still dropped; this is a preliminary single-run observation, not a confirmed fix. No game files, derived assets, screenshots, or raw logs are attached. |
…ispatch With VICTORY_PIPELINE_COMPUTE_WAIT on (the default) a compute dispatch makes its pipeline on the spot, however long that takes. With an empty cache the first cutscene met 457 compute programs in one frame at about a second each: the frame did not end for over 30 s and the title's own hang watchdog stored to address 0 (+0x23cf683, fxceless#1420). A frame now waits for such pipelines up to VICTORY_PIPELINE_COMPUTE_WAIT_MS (8,000 by default, summed over threads); after that its dispatches wait within the frame's budget as with VICTORY_PIPELINE_COMPUTE_WAIT=0. The first 600 frames (loading) still make theirs whatever it costs. (cherry picked from commit 17a6f01, fxceless/victory-fork pull request fxceless#1450) Port: our ready() had only the compute_waits() branch (without the upstream rule that the first 600 frames make their compute pipelines whatever it costs); the PR's version of the branch is taken whole, so those frames now make theirs too, and later frames make them while under VICTORY_PIPELINE_COMPUTE_WAIT_MS (8,000 ms a frame, summed over threads). It matches our cold-cache crash at victory-image+0x23cf683 (a frame over 30 s, the title's watchdog storing to 0). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ELINE_COMPUTE_WAIT_MS set Unset, a dispatch makes its compute pipeline whatever it costs, as before (and the first-600-frames rule does not apply), so the cap can be measured as one variable; `=8000` is upstream's default. victory-gpu lib: 392 passed, 0 failed unset. With the variable set, the pending-pipeline test fails by design: frame 0 is one of the first 600, whose compute pipelines are made at once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…es by the card's budget Every title buffer's copy (a least of 64 KiB) and the windows of title memory outside buffers go to the card, up to totals chosen by the card's budget (8 GB: 768/512 MB; 12 GB: 1/1 GB; 16 GB: 1.5/1.5 GB; 24 GB: 2/2 GB; 32 GB and more: 3/3 GB). Windows go main's way: one buffer in a GPU upload heap where the device has such heaps, two sides where it has none. A window goes to the card up to 97 hundredths of the budget, and the texture queue keeps the room of both totals (at most 1.5 GiB of buffers and 2 GiB of windows). Every switch of its own still wins: VICTORY_CARD_BUFFERS_MIN_KB, _MIN_MB, _MB, VICTORY_CARD_WINDOWS_MB, VICTORY_WINDOW_UPLOAD, VICTORY_CARD_ROOM_FOR_BUFFERS. Off, nothing changes. A line at the first copy says what was chosen. On an RTX 5090 with fxceless#854 and fxceless#1450, four alternated runs of four minutes: 183.1 and 186.2 ms a frame without the switch, 154.2 and 158.1 ms with it. Port: in this tree windows outside buffers stay off by default (VICTORY_CARD_WINDOWS_MB 0, not 1,280) and VICTORY_WINDOW_UPLOAD is off by default, so without the switch windows still do not go to the card and with it they go with two sides unless VICTORY_WINDOW_UPLOAD=1. The room kept (card_room_kept) is still capped by VICTORY_CARD_ROOM_KEPT_MB, now the buffers' and the windows' room together, and that switch is named in the start-up line too. The window line keeps reserve_window's saturating add. The README line is left out. (cherry picked from commit e408259) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings, each behind its own switch and off unless set: VI-BR-PORT's held levels (VICTORY_HELD_LEVELS), copies and refreshes (SEND_OWN, UNDER_WORDS, UNDER_WIDE, WIDE_FILLS, REFRESH_AHEAD), page parts and guards (PAGE_PARTS, GUARD_REST, OPEN_ONE_VIEW), the heap pass aside (HEAP_PASS_ASIDE); from fxceless/victory-fork fxceless#1450 (PIPELINE_COMPUTE_WAIT_MS), fxceless#1461 (SAMPLER_ORDER), fxceless#1468 (CARD_READ_COPY), fxceless#1476 (CARD_SIDE), fxceless#1424 (WIDE_READS), fxceless#1427; Belobug's FidelityFX bridge (VICTORY_FIDELITYFX_DIR); a local window icon (VICTORY_WINDOW_ICON); and fixes to LAZY_REMAP's copies and clean pages. Nothing derived from XCL. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Another data point for #1420 / this fix, on different hardware: RTX 3060 12 GB, Ryzen 7 5700X (8c/16t), 32 GB RAM, Windows 11, Series S profile, old line (
Caveat: by then the pipeline library was warm, and one run without this PR but with the warm library did not crash either, so these runs show that nothing else broke rather than prove the fix on a cold library. The address matches #1420 exactly. |
…ait (VICTORY_HEAD_MAP_WAIT=1) The title dispatches the head blend-shape map (compute 61e54e90adccaf6a, avatarmanz/VIctory-7900XTX#166) once for a head. Here a dispatch waits for its pipeline only within the frame's half second of budget and is then dropped ("a dispatch without a host pipeline dropped"): with a cold cache the head's skin around eyes and teeth can be lost. With VICTORY_HEAD_MAP_WAIT=1: - make::early queues that pipeline at its creation, at the front of the ahead queue (Queue::push/push_ahead), cache or no cache. - Its dispatch (State::dispatch, execute_indirect of kind DISPATCH, via pipeline::host_dispatch_pipeline / make::ready_dispatch) waits for it up to 2 s, one allowance over the run (HeadMapWait); after a timeout, said once, later dispatches wait within the frame's budget as before. - VICTORY_PIPELINE_COMPUTE_WAIT=1 still wins (it makes the pipeline in place); the fxceless#1450 cap (VICTORY_PIPELINE_COMPUTE_WAIT_MS) is honoured: a frame out of room waits within its budget, and the head wait is counted to the cap. - Lines: the switch once; "head blend-shape map pipeline queued at its creation"; "head blend-shape map pipeline at its first dispatch" (frame, already_ready, host_pipeline, wait_ms); a warning at the deadline. Off unless =1 (Vice-Tay has it on unless =0): unset, no pipeline is marked, ready_dispatch is ready, and pipelines are queued, made and waited for exactly as before. Pure tests: switch and shader match, queue order, the bounded and once-spent wait. Port: TaynanGT/Vice-Tay 3e3fd57901d4f26caf115e3cbb68fa52825ce6f5 (fxceless#372), GPL-3.0. Written anew for this tree (no scene_input here; the ahead queue instead of the screen queue; no driver-failure publication without workers). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Fixes the
+0x23cf683crash in #1420 without turning compute waiting off.Cause. With
VICTORY_PIPELINE_COMPUTE_WAITon (the default), a compute dispatch builds its pipeline on the spot, however long that takes. With an empty cache, the first cutscene hit 457 compute programs in one frame, at about a second each. The frame did not end for over 30 s, so the title's own hang watchdog stored to address 0.Change. A frame now waits for such pipelines for at most
VICTORY_PIPELINE_COMPUTE_WAIT_MS(8,000 by default, summed over threads). After that, its dispatches wait within the frame's budget, as withVICTORY_PIPELINE_COMPUTE_WAIT=0.Tested on an RTX 4080 16 GB, Ryzen 9 7950X, 32 GB RAM, Windows 11. Diag build of 9a9091d plus this change, Series X profile, the run-278 switch set,
VICTORY_BVH_BUILDER=0.+0x23cf683fault in 2 of 2 runs, about a minute after Enter on the start screen. In the log,frame=3107stayed stuck for about 30 s while compute pipelines were built one by one.a frame waited its cap for compute pipelines). The game reached the world and ran 5+ minutes without a fault.One machine and one scene, so the 8 s default may want tuning on slower CPUs.