fix(intel-gpu): a rest pipeline in place of a mesh pipeline before other work #546

Merged
gilmarcs merged 4 commits from upstream-pr/546 into main 2026-11-29 08:16:59 +00:00
gilmarcs commented 2026-11-28 00:39:11 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gilmarcs on 2026-11-28T00:39:11Z.


Summary

Works around an Intel Arc driver hang: a mesh pipeline left bound on a command list while other work is recorded after it hangs the GPU. A small "rest" pipeline is bound in its place before that work.

Fixes #227

Problem

On an Arc B580 (driver 32.0.101.9175) the game hung with DXGI_ERROR_DEVICE_HUNG on the first large frame of the world, sometimes as a page fault at what looks like a null base plus an offset.

What the measurements ruled out and pinned down:

  • Not caused by a translated shader, uploads, copies, freed resources, uninitialized descriptors, 64-bit atomics, or command lists running in parallel.
  • The trigger is a mesh pipeline staying bound while copies, clears, dispatches or barriers are recorded after it. No mesh draw is needed: binding the pipeline is enough.
  • The pipeline's contents don't matter: a synthetic mesh pipeline (trivial shaders, empty root signature, minimal state) hangs the same way.
  • The failure is probabilistic: the more mesh pipeline binds, the more likely it is.

This points to the driver, not to the translated title. I've reported it to Intel.

Changes

  • New crates/victory-gpu/src/mesh_rest.rs: a vertex-only "rest" pipeline with an empty root signature, whose one point is clipped away.
  • A host list with a mesh pipeline bound gets the rest pipeline before anything else is recorded:
    • before every title call that records work;
    • before a draw, dispatch or indirect execution binds a pipeline of another kind;
    • before an indirect execution's argument copies and clamp passes;
    • before the list closes.
  • Calls that only set state (viewports, scissors, render targets, topology, blend factor, stencil reference, depth bounds) leave the mesh pipeline bound. A run of mesh dispatches therefore keeps a single bind.
  • After a rest, the draw state binds its own pipeline and graphics root signature again (and the topology, in draw mode).
  • An indirect execution held back for merging is recorded before the rest pipeline is bound, so it never runs under the rest pipeline. On Intel this means indirect mesh executions are merged less often.
  • A per-frame log line follows the frame-rate line: mesh pipelines bound, rest pipelines bound in their place, and rest draws.

Configuration

VICTORY_MESH_REST:

Value Behaviour
bind Bind the rest pipeline. Default on Intel.
draw Bind it and draw its clipped point, for a driver that only applies a pipeline at a draw.
off Previous behaviour. Default on other vendors.

NVIDIA and AMD are unchanged unless the switch is set.

Testing

  • cargo test -p victory-gpu with VICTORY_MESH_REST=draw forced on, on the Arc B580: 454 passed, 0 failed. This includes a new test that builds the rest pipeline, draws with it and submits the list.
  • cargo clippy -p victory-gpu --all-targets --all-features -- -D warnings: clean for the files this PR changes. The two manual_is_multiple_of errors in shadow.rs and descriptor.rs are already on main.
  • In game, diagnostics build, --series-s --dlss off --fps 30, VICTORY_MESH_REST=bind: through the intro into the Vice City night street, with correct colour, lighting and character shading, at 9–13 fps with 500–1,250 draws/frame. Before the patch, a similar scene ran at 3 fps with 1,448 draws/frame. The extra binds did not show up as dropped draws or as preparation time: most of the frame was copies and textures.

Known limitations / follow-ups

  • Memory: the session still ends about 40–60 s after the world appears, with private bytes around 19 GB and video memory at its budget. Several people see this independently, and it looks unrelated to this change: the patch only lets the game get far enough to hit it. It will be tracked separately.
  • Still to measure: VICTORY_MESH_REST=draw on the same scene, read from the new per-frame line.
  • Removal: this is a driver workaround. Once Intel ships a fix, I'll open a PR that removes it or limits it to affected driver versions.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5535007858 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/546). Originally posted by [gilmarcs](https://github.com/gilmarcs) on 2026-11-28T00:39:11Z. --- ## Summary Works around an Intel Arc driver hang: a mesh pipeline left bound on a command list while other work is recorded after it hangs the GPU. A small "rest" pipeline is bound in its place before that work. Fixes #227 ## Problem On an Arc B580 (driver 32.0.101.9175) the game hung with `DXGI_ERROR_DEVICE_HUNG` on the first large frame of the world, sometimes as a page fault at what looks like a null base plus an offset. What the measurements ruled out and pinned down: - Not caused by a translated shader, uploads, copies, freed resources, uninitialized descriptors, 64-bit atomics, or command lists running in parallel. - The trigger is a mesh pipeline staying bound while copies, clears, dispatches or barriers are recorded after it. No mesh draw is needed: binding the pipeline is enough. - The pipeline's contents don't matter: a synthetic mesh pipeline (trivial shaders, empty root signature, minimal state) hangs the same way. - The failure is probabilistic: the more mesh pipeline binds, the more likely it is. This points to the driver, not to the translated title. I've reported it to Intel. ## Changes - New `crates/victory-gpu/src/mesh_rest.rs`: a vertex-only "rest" pipeline with an empty root signature, whose one point is clipped away. - A host list with a mesh pipeline bound gets the rest pipeline before anything else is recorded: - before every title call that records work; - before a draw, dispatch or indirect execution binds a pipeline of another kind; - before an indirect execution's argument copies and clamp passes; - before the list closes. - Calls that only set state (viewports, scissors, render targets, topology, blend factor, stencil reference, depth bounds) leave the mesh pipeline bound. A run of mesh dispatches therefore keeps a single bind. - After a rest, the draw state binds its own pipeline and graphics root signature again (and the topology, in `draw` mode). - An indirect execution held back for merging is recorded before the rest pipeline is bound, so it never runs under the rest pipeline. On Intel this means indirect mesh executions are merged less often. - A per-frame log line follows the frame-rate line: mesh pipelines bound, rest pipelines bound in their place, and rest draws. ## Configuration `VICTORY_MESH_REST`: | Value | Behaviour | | --- | --- | | `bind` | Bind the rest pipeline. **Default on Intel.** | | `draw` | Bind it and draw its clipped point, for a driver that only applies a pipeline at a draw. | | `off` | Previous behaviour. **Default on other vendors.** | NVIDIA and AMD are unchanged unless the switch is set. ## Testing - `cargo test -p victory-gpu` with `VICTORY_MESH_REST=draw` forced on, on the Arc B580: 454 passed, 0 failed. This includes a new test that builds the rest pipeline, draws with it and submits the list. - `cargo clippy -p victory-gpu --all-targets --all-features -- -D warnings`: clean for the files this PR changes. The two `manual_is_multiple_of` errors in `shadow.rs` and `descriptor.rs` are already on `main`. - In game, diagnostics build, `--series-s --dlss off --fps 30`, `VICTORY_MESH_REST=bind`: through the intro into the Vice City night street, with correct colour, lighting and character shading, at 9–13 fps with 500–1,250 draws/frame. Before the patch, a similar scene ran at 3 fps with 1,448 draws/frame. The extra binds did not show up as dropped draws or as preparation time: most of the frame was copies and textures. ## Known limitations / follow-ups - **Memory:** the session still ends about 40–60 s after the world appears, with private bytes around 19 GB and video memory at its budget. Several people see this independently, and it looks unrelated to this change: the patch only lets the game get far enough to hit it. It will be tracked separately. - **Still to measure:** `VICTORY_MESH_REST=draw` on the same scene, read from the new per-frame line. - **Removal:** this is a driver workaround. Once Intel ships a fix, I'll open a PR that removes it or limits it to affected driver versions.
jstrdev commented 2026-11-28 14:29:30 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jstrdev on 2026-11-28T14:29:30Z.


@gilmarcs Thanks for your work on Intel Arc compatibility! I've tested your mesh-rest patch on my B580 and obtained significantly better results, although a GPU hang is still possible.

Captura de pantalla 2026-11-28 151607

Setup

  • Intel Arc B580 12 GB (Battlemage)
  • Ryzen 5 7600X
  • Driver 32.0.101.9175
  • ReBAR enabled
  • Default Windows TDR settings
  • Base commit: 63d8873, with minor local launcher modifications
  • Series S profile
  • Diagnostics build, frame generation disabled

Configuration

  • VICTORY_MESH_REST=bind
  • VICTORY_D3D12_DRED=light
  • VICTORY_TEXTURE_ROOM_PERCENT=60
  • VICTORY_WARMUP_RESTART=0

Results

  • Total runtime: 10 minutes and 35 seconds.
  • 18.6 FPS at approximately 3,000 draws/frame.
  • 12 FPS during controllable gameplay at 4,478 draws/frame.
  • Characters, geometry and lighting render, although some visual artifacts remain.
  • The GPU eventually hangs when rotating the camera during gameplay.

DRED findings

  • Device removal reason: DXGI_ERROR_DEVICE_HUNG (0x887A0006).
  • GPU page fault: 0x8000313ce000.
  • Host command list 1546.
  • Stopped at command 141/377 (op 42, DispatchMesh).
  • Mesh shader: f0c7efd2aceb2aaa.
  • Associated pixel shader: 7d85c9cab3c80721.

Memory immediately before the crash

  • VRAM usage: 9,334 MB.
  • Process private memory: 25,168 MB.
  • Available physical RAM: 1,163 MB.

I haven't isolated the exact cause of this remaining hang. However, reaching controllable gameplay with the default TDR settings is a substantial improvement over my previous tests.

I'll test VICTORY_MESH_REST=draw next.

Does this page fault resemble the driver issue you reported to Intel, or could it indicate a separate problem?

AI-assisted investigation and reporting. Diagnostic logs attached.

Previous investigation: https://github.com/fxceless/victory-fork/issues/1079
B580_meshrest_bind_diagnostics_20261128.txt

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7240709409 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/546#issuecomment-7240709409). Originally posted by [jstrdev](https://github.com/jstrdev) on 2026-11-28T14:29:30Z. --- @gilmarcs Thanks for your work on Intel Arc compatibility! I've tested your mesh-rest patch on my B580 and obtained significantly better results, although a GPU hang is still possible. <img width="1806" height="988" alt="Captura de pantalla 2026-11-28 151607" src="https://github.com/user-attachments/assets/04f12d56-1b52-42bb-b2b2-6c1e21c4971d" /> ### Setup - Intel Arc B580 12 GB (Battlemage) - Ryzen 5 7600X - Driver 32.0.101.9175 - ReBAR enabled - Default Windows TDR settings - Base commit: `63d8873`, with minor local launcher modifications - Series S profile - Diagnostics build, frame generation disabled ### Configuration - `VICTORY_MESH_REST=bind` - `VICTORY_D3D12_DRED=light` - `VICTORY_TEXTURE_ROOM_PERCENT=60` - `VICTORY_WARMUP_RESTART=0` ### Results - Total runtime: 10 minutes and 35 seconds. - 18.6 FPS at approximately 3,000 draws/frame. - 12 FPS during controllable gameplay at 4,478 draws/frame. - Characters, geometry and lighting render, although some visual artifacts remain. - The GPU eventually hangs when rotating the camera during gameplay. ### DRED findings - Device removal reason: `DXGI_ERROR_DEVICE_HUNG` (0x887A0006). - GPU page fault: `0x8000313ce000`. - Host command list 1546. - Stopped at command 141/377 (op 42, DispatchMesh). - Mesh shader: `f0c7efd2aceb2aaa`. - Associated pixel shader: `7d85c9cab3c80721`. ### Memory immediately before the crash - VRAM usage: 9,334 MB. - Process private memory: 25,168 MB. - Available physical RAM: 1,163 MB. I haven't isolated the exact cause of this remaining hang. However, reaching controllable gameplay with the default TDR settings is a substantial improvement over my previous tests. I'll test `VICTORY_MESH_REST=draw` next. Does this page fault resemble the driver issue you reported to Intel, or could it indicate a separate problem? AI-assisted investigation and reporting. Diagnostic logs attached. Previous investigation: https://github.com/fxceless/victory-fork/issues/1079 [B580_meshrest_bind_diagnostics_20261128.txt](https://github.com/user-attachments/files/35549852/B580_meshrest_bind_diagnostics_20261128.txt)
gilmarcs commented 2026-11-28 15:05:46 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by gilmarcs on 2026-11-28T15:05:46Z.


More one GPU page fault at: 0x80001a55f000

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7241196609 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/546#issuecomment-7241196609). Originally posted by [gilmarcs](https://github.com/gilmarcs) on 2026-11-28T15:05:46Z. --- More one GPU page fault at: `0x80001a55f000`
jstrdev commented 2026-11-28 15:33:17 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by jstrdev on 2026-11-28T15:33:17Z.


Update: I tested VICTORY_MESH_REST=draw on the same B580 setup.

  • 6m56s total runtime.
  • Successfully controlled the character, rotated the camera and progressed through gameplay.
  • No GPU hangs or device removal.
  • Manually closed the game successfully.
  • Default Windows TDR.
  • The previously suspected mesh pipeline (f0c7efd2aceb2aaa) was also bound during this run.

Performance remains around 9–14 FPS during gameplay.

This is only one successful run, but draw mode appears promising. Further controlled testing is planned.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7241554983 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/546#issuecomment-7241554983). Originally posted by [jstrdev](https://github.com/jstrdev) on 2026-11-28T15:33:17Z. --- Update: I tested VICTORY_MESH_REST=draw on the same B580 setup. - 6m56s total runtime. - Successfully controlled the character, rotated the camera and progressed through gameplay. - No GPU hangs or device removal. - Manually closed the game successfully. - Default Windows TDR. - The previously suspected mesh pipeline (f0c7efd2aceb2aaa) was also bound during this run. Performance remains around 9–14 FPS during gameplay. This is only one successful run, but draw mode appears promising. Further controlled testing is planned.
cbw2580147369-commits commented 2026-11-29 05:25:56 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by cbw2580147369-commits on 2026-11-29T05:25:56Z.


Independent reproduction of your draw result, from a third Arc B580 - Windows 10 19045, 16 GB of RAM, driver 32.0.101.9175, base 959dcaf (fxceless main, 28 November) with your patch applied by hand.

Your config, with @gilmarcs's patch:

mode time at the world end peak private
bind 210 s title supervisor, memory 23.0 GB
draw 544 s (9 min 4 s) title supervisor, memory.load_percent=92, 1.19 GB free 24.7 GB
no patch 40-60 s 0x887A0006 19.2 GB

No DXGI_ERROR_DEVICE_HUNG in the draw run, and the same in the bind run - the patch holds on this card too. Frame rates: 18-20 fps in light views (366-951 draws/frame), 12.7 in the intro field (3691 draws), 12 on the night street (1118 draws), 7-9 in the heaviest views (1241-4600). Your 9-14 fps during gameplay matches.

One thing to compare against your 10 min 35 s on bind: I am on 16 GB, so 9 minutes is the memory wall, not the patch, and it gets there at 24.7 GB of private bytes. If your 25 GB figure is right, your machine must be 32 GB - that is the whole difference between our two runs, and it is worth saying so in the thread so nobody reads 10 min 35 s as achievable on 16 GB.

Two notes:

  1. I could not test the camera-rotation DispatchMesh page fault. The keyboard has no mapping for the analogue sticks, so the camera never moves here. Your DRED numbers (mesh shader f0c7efd2aceb2aaa, pixel 7d85c9cab3c80721, host list 1546, command 141/377) are the only trace of it I have.
  2. Watch out for a silent trap in the launcher: powershell -File joins -Extra a,b into one comma-separated string, and play deletes every VICTORY_* variable it was not told about, so --set VICTORY_MESH_REST=draw,VICTORY_TEXTURE_ROOM_PERCENT=60 arrives as one invalid variable and the code falls back to the Intel default bind. Check that the victory_gpu::mesh_rest line in the log says mode=Draw before trusting a run. I measured three runs believing they were draw when they were bind.

Field report, samples and screenshots: https://github.com/cbw2580147369-commits/victory-arc-b580

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7251250586 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/546#issuecomment-7251250586). Originally posted by [cbw2580147369-commits](https://github.com/cbw2580147369-commits) on 2026-11-29T05:25:56Z. --- Independent reproduction of your `draw` result, from a third Arc B580 - Windows 10 19045, 16 GB of RAM, driver 32.0.101.9175, base `959dcaf` (fxceless main, 28 November) with your patch applied by hand. Your config, with @gilmarcs's patch: | mode | time at the world | end | peak private | |---|---|---|---| | `bind` | 210 s | title supervisor, memory | 23.0 GB | | **`draw`** | **544 s (9 min 4 s)** | title supervisor, `memory.load_percent=92`, 1.19 GB free | 24.7 GB | | no patch | 40-60 s | `0x887A0006` | 19.2 GB | No `DXGI_ERROR_DEVICE_HUNG` in the draw run, and the same in the bind run - the patch holds on this card too. Frame rates: 18-20 fps in light views (366-951 draws/frame), 12.7 in the intro field (3691 draws), 12 on the night street (1118 draws), 7-9 in the heaviest views (1241-4600). Your 9-14 fps during gameplay matches. One thing to compare against your 10 min 35 s on `bind`: I am on 16 GB, so 9 minutes is the memory wall, not the patch, and it gets there at 24.7 GB of private bytes. If your 25 GB figure is right, your machine must be 32 GB - that is the whole difference between our two runs, and it is worth saying so in the thread so nobody reads 10 min 35 s as achievable on 16 GB. Two notes: 1. I could not test the camera-rotation `DispatchMesh` page fault. The keyboard has no mapping for the analogue sticks, so the camera never moves here. Your DRED numbers (mesh shader `f0c7efd2aceb2aaa`, pixel `7d85c9cab3c80721`, host list 1546, command 141/377) are the only trace of it I have. 2. Watch out for a silent trap in the launcher: `powershell -File` joins `-Extra a,b` into one comma-separated string, and `play` deletes every `VICTORY_*` variable it was not told about, so `--set VICTORY_MESH_REST=draw,VICTORY_TEXTURE_ROOM_PERCENT=60` arrives as one invalid variable and the code falls back to the Intel default `bind`. Check that the `victory_gpu::mesh_rest` line in the log says `mode=Draw` before trusting a run. I measured three runs believing they were `draw` when they were `bind`. Field report, samples and screenshots: https://github.com/cbw2580147369-commits/victory-arc-b580
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!546
No description provided.