fix(gpu): cap how long a frame waits for compute pipelines (hang watchdog at 30 s) #315

Closed
Lyrnc wants to merge 2 commits from upstream-pr/315 into main
Lyrnc commented 2026-11-27 20:56:50 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-27T20:56:50Z.


Builds on #243. This branch is #243's commit plus one more, so merging this lands both. If #243 lands first, this one is only the second commit.

Problem

With #243, a compute dispatch waits for its pipeline however long that takes. With an empty cache, the first cutscene met 457 compute programs in one frame, at about a second each. That frame then ran for more than 30 s. The title's own hang watchdog fires after 30 s and stores to address 0 (+0x23cf683), which crashes the title. This was reported on fxceless/victory-fork as #1420.

Fix

The fix is armin's commit from fxceless/victory-fork#1450 (still open there). The author is kept.

  • Cap per frame. A frame waits for such pipelines for at most VICTORY_PIPELINE_COMPUTE_WAIT_MS, summed over threads. The default is 8,000 ms, which leaves room under the watchdog's 30 s for makes that other threads have already started.
  • Past the cap. The rest of that frame's dispatches wait within the frame's budget, as they did before #243. The first time this happens, one warning is logged.
  • Loading. The first 600 frames make their pipelines whatever it costs, so #243's one-shot set-up passes keep working.

Conflict resolution here: #243 has no 600-frame rule, so the condition is now compute_waits() && (early || compute_room(frame)). With VICTORY_PIPELINE_COMPUTE_WAIT=0, a dispatch waits within the budget exactly as before. Only pipeline/make.rs changes.

Verification

On Windows 11, RTX 5080:

  • cargo clippy -p victory-gpu --all-targets -- -D warnings: nothing in make.rs. The errors it gives are in other files and are on main too (#265 fixes those).
  • cargo test -p victory-gpu --lib pipeline::make: 6 pass, and pending_pipeline_is_recorded_for_the_next_launch fails. It fails the same way on #243's head without this commit.
  • cargo fmt --check was not used: it already fails on main (in apps/victory and in this file), so I kept the surrounding style.

Not run in game on this branch.

AI use: Claude Code (Claude Opus 5.5) ported the commit, resolved the conflict with #243, ran the checks above and drafted this description.

🤖 Generated with Claude Code

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5532993751 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/315). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-27T20:56:50Z. --- Builds on #243. This branch is #243's commit plus one more, so merging this lands both. If #243 lands first, this one is only the second commit. ### Problem With #243, a compute dispatch waits for its pipeline however long that takes. With an empty cache, the first cutscene met 457 compute programs in one frame, at about a second each. That frame then ran for more than 30 s. The title's own hang watchdog fires after 30 s and stores to address 0 (`+0x23cf683`), which crashes the title. This was reported on fxceless/victory-fork as #1420. ### Fix The fix is armin's commit from fxceless/victory-fork#1450 (still open there). The author is kept. - **Cap per frame.** A frame waits for such pipelines for at most `VICTORY_PIPELINE_COMPUTE_WAIT_MS`, summed over threads. The default is 8,000 ms, which leaves room under the watchdog's 30 s for makes that other threads have already started. - **Past the cap.** The rest of that frame's dispatches wait within the frame's budget, as they did before #243. The first time this happens, one warning is logged. - **Loading.** The first 600 frames make their pipelines whatever it costs, so #243's one-shot set-up passes keep working. Conflict resolution here: #243 has no 600-frame rule, so the condition is now `compute_waits() && (early || compute_room(frame))`. With `VICTORY_PIPELINE_COMPUTE_WAIT=0`, a dispatch waits within the budget exactly as before. Only `pipeline/make.rs` changes. ### Verification On Windows 11, RTX 5080: - `cargo clippy -p victory-gpu --all-targets -- -D warnings`: nothing in `make.rs`. The errors it gives are in other files and are on `main` too (#265 fixes those). - `cargo test -p victory-gpu --lib pipeline::make`: 6 pass, and `pending_pipeline_is_recorded_for_the_next_launch` fails. It fails the same way on #243's head without this commit. - `cargo fmt --check` was not used: it already fails on `main` (in `apps/victory` and in this file), so I kept the surrounding style. Not run in game on this branch. AI use: Claude Code (Claude Opus 5.5) ported the commit, resolved the conflict with #243, ran the checks above and drafted this description. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Lyrnc commented 2026-11-29 22:09:40 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by Lyrnc on 2026-11-29T22:09:40Z.


Closing: main has its own per-frame cap for compute pipeline waits now (88244e8d, refined in 11e8b54c), and aee4c45a keeps a long stall from ending as a crash at +0x23cf683. That covers what this PR did. Thanks to everyone who tested it.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7263452039 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/315#issuecomment-7263452039). Originally posted by [Lyrnc](https://github.com/Lyrnc) on 2026-11-29T22:09:40Z. --- Closing: main has its own per-frame cap for compute pipeline waits now (88244e8d, refined in 11e8b54c), and aee4c45a keeps a long stall from ending as a crash at +0x23cf683. That covers what this PR did. Thanks to everyone who tested it.

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
trustno1-coder/VIctory-NVIDIA!315
No description provided.