GPU: cap command lists per submission (VICTORY_SUBMIT_MAX_RUNS) #1463

Open
github-bot wants to merge 1 commit from github-bot/gh-1463 into main AGit
Owner

@⁠Bebrik229 on GitHub · 2026-11-24 18:13 UTC · original
Bebrik229:gpu/submit-max-runs → main · +39 −8 · 1 files · 1 commits · open

A title frame's runs go to the queue in one ExecuteCommandLists call and the host waits on the fence, so a batch of heavy compute work stalls the device for its whole duration: on an RTX 5070 a 28-list batch held the GPU for ~63 s and Windows removed the device (0x887A0006) after the ~2 s reset threshold, ending the run.

VICTORY_SUBMIT_MAX_RUNS splits the batch into chunks of runs, keeping each submission's worst-case GPU time bounded; the default keeps every run in one call as before. The per-list timing path (VICTORY_GPU_TIMING) still submits each run on its own.

Observed on the Grand Theft Auto VI title: a deterministic 28-run batch of compute lists took 63 s on the GPU and removed the device twice; with the cap at 4 the same content submits in bounded chunks.

**@⁠Bebrik229** on GitHub · 2026-11-24 18:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/1463) `Bebrik229:gpu/submit-max-runs` → `main` · +39 −8 · 1 files · 1 commits · open A title frame's runs go to the queue in one `ExecuteCommandLists` call and the host waits on the fence, so a batch of heavy compute work stalls the device for its whole duration: on an RTX 5070 a 28-list batch held the GPU for ~63 s and Windows removed the device (0x887A0006) after the ~2 s reset threshold, ending the run. `VICTORY_SUBMIT_MAX_RUNS` splits the batch into chunks of runs, keeping each submission's worst-case GPU time bounded; the default keeps every run in one call as before. The per-list timing path (`VICTORY_GPU_TIMING`) still submits each run on its own. Observed on the Grand Theft Auto VI title: a deterministic 28-run batch of compute lists took 63 s on the GPU and removed the device twice; with the cap at 4 the same content submits in bounded chunks.
A title frame's runs go to the queue in one ExecuteCommandLists call and
the host waits on the fence, so a batch of heavy compute work stalls the
device for its whole duration: on an RTX 5070 a 28-list batch held the
GPU for 63 s and Windows removed the device (0x887A0006) after the ~2 s
reset threshold, ending the run.

VICTORY_SUBMIT_MAX_RUNS splits the batch into chunks of runs, keeping
each submission's worst-case GPU time bounded; the default keeps every
run in one call as before. The per-list timing path (VICTORY_GPU_TIMING)
still submits each run on its own.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:32:48 +00:00
Author
Owner

@⁠pfhandler on GitHub · 2026-11-24 20:50 UTC · original

Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB):

  • VICTORY_NO_HOST_PAD=1 — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets VICTORY_KEYS drive the title again.
  • VICTORY_MODE=1920x1080 — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here).

Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above.

diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs
index c7f7c45..2535b68 100644
--- a/crates/victory-gpu/src/dxgi.rs
+++ b/crates/victory-gpu/src/dxgi.rs
@@ -219,6 +219,19 @@ struct Mode {
 }
 const _: () = assert!(size_of::<Mode>() == 32);
 
+/// The console's fixed output mode, overridable for hosts smaller than the
+/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead.
+fn mode_size() -> (u32, u32) {
+    const DEFAULT: (u32, u32) = (3840, 2160);
+    let Some(text) = std::env::var_os("VICTORY_MODE") else {
+        return DEFAULT;
+    };
+    let text = text.to_string_lossy();
+    text.split_once('x')
+        .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?)))
+        .unwrap_or(DEFAULT)
+}
+
 /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks
 /// for a 120 Hz one to allow 120 Hz frame intervals).
 /// shortcut: fixed mode, not the host display's; report the host's rates if
@@ -242,9 +255,10 @@ extern "system" fn modes(
         return MORE_DATA;
     }
     *count = 1;
+    let (width, height) = mode_size();
     let mode = Mode {
-        width: 3840,
-        height: 2160,
+        width,
+        height,
         refresh: [60, 1],
         format: 0,
         scanlines: 1, // progressive
diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs
index a411bd0..da8d66c 100644
--- a/crates/victory-hle/src/modules/gameinput.rs
+++ b/crates/victory-hle/src/modules/gameinput.rs
@@ -1134,6 +1134,11 @@ mod host {
 
     impl Source for Host {
         fn pad(&mut self, slot: usize) -> Option<PadState> {
+            // The keyboard stand-in pad only exists while no host pad is
+            // connected; this hides a host pad the title mis-handles.
+            if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() {
+                return None;
+            }
             if self.empty_until[slot].is_some_and(|until| Instant::now() < until) {
                 return None;
             }
**@⁠pfhandler** on GitHub · 2026-11-24 20:50 UTC · [original](https://github.com/Marvisak/VIctory/pull/1463#issuecomment-7144123348) Local patches for two issues hit while running GTA VI 1.0.2.1 through VIctory on Linux (GE-Proton 11-14, vkd3d-proton 3.2.0, RTX 4060 Ti 8 GB): - `VICTORY_NO_HOST_PAD=1` — a connected host pad (e.g. DualShock appearing as XInput pad 0) keeps the keyboard stand-in pad from being enumerated. Hiding the host pad lets `VICTORY_KEYS` drive the title again. - `VICTORY_MODE=1920x1080` — the DXGI output mode list is fixed at the console's 3840x2160. Reporting 1920x1080 instead keeps the title's render targets and VRAM use down on smaller hosts (Series S profile + 1080p settled around 3.5 GB VRAM here). Both are local uncommitted diffs, posted here for reuse. Tested only on the configuration above. ```diff diff --git a/crates/victory-gpu/src/dxgi.rs b/crates/victory-gpu/src/dxgi.rs index c7f7c45..2535b68 100644 --- a/crates/victory-gpu/src/dxgi.rs +++ b/crates/victory-gpu/src/dxgi.rs @@ -219,6 +219,19 @@ struct Mode { } const _: () = assert!(size_of::<Mode>() == 32); +/// The console's fixed output mode, overridable for hosts smaller than the +/// console's 4K target: `VICTORY_MODE=1920x1080` reports that instead. +fn mode_size() -> (u32, u32) { + const DEFAULT: (u32, u32) = (3840, 2160); + let Some(text) = std::env::var_os("VICTORY_MODE") else { + return DEFAULT; + }; + let text = text.to_string_lossy(); + text.split_once('x') + .and_then(|(w, h)| Some((w.trim().parse().ok()?, h.trim().parse().ok()?))) + .unwrap_or(DEFAULT) +} + /// The console's mode list: one 4K mode at 60 Hz (Grand Theft Auto VI looks /// for a 120 Hz one to allow 120 Hz frame intervals). /// shortcut: fixed mode, not the host display's; report the host's rates if @@ -242,9 +255,10 @@ extern "system" fn modes( return MORE_DATA; } *count = 1; + let (width, height) = mode_size(); let mode = Mode { - width: 3840, - height: 2160, + width, + height, refresh: [60, 1], format: 0, scanlines: 1, // progressive diff --git a/crates/victory-hle/src/modules/gameinput.rs b/crates/victory-hle/src/modules/gameinput.rs index a411bd0..da8d66c 100644 --- a/crates/victory-hle/src/modules/gameinput.rs +++ b/crates/victory-hle/src/modules/gameinput.rs @@ -1134,6 +1134,11 @@ mod host { impl Source for Host { fn pad(&mut self, slot: usize) -> Option<PadState> { + // The keyboard stand-in pad only exists while no host pad is + // connected; this hides a host pad the title mis-handles. + if std::env::var_os("VICTORY_NO_HOST_PAD").is_some() { + return None; + } if self.empty_until[slot].is_some_and(|until| Instant::now() < until) { return None; } ```
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:29 UTC · original

Automated triage for the maintainers.

Needs rebase. This pull request conflicts with main (conflicting: crates/victory-gpu/src/host.rs). It will be reviewed once it is rebased onto the current main.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:29 UTC · [original](https://github.com/Marvisak/VIctory/pull/1463#issuecomment-7149598047) <!-- victory-triage v1 head=68f23d9e41f9bfb1b1d1ba58d20efb7d4384f892 verdict=needs-rebase at=2026-11-25T01:29:02Z --> Automated triage for the maintainers. **Needs rebase.** This pull request conflicts with `main` (conflicting: `crates/victory-gpu/src/host.rs`). It will be reviewed once it is rebased onto the current `main`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/1463/head:github-bot/gh-1463'
git switch 'github-bot/gh-1463'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-1463'
git switch 'github-bot/gh-1463'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-1463'
git switch 'github-bot/gh-1463'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-1463'
git switch 'main'
git merge --squash 'github-bot/gh-1463'
git switch 'main'
git merge --ff-only 'github-bot/gh-1463'
git switch 'main'
git merge 'github-bot/gh-1463'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!1463
No description provided.