GPU: VICTORY_COMPILER_GUARD=0 leaves the driver compiler's faults to the driver (NVIDIA) #158

Open
pjanes22 wants to merge 1 commit from upstream-pr/158 into main
pjanes22 commented 2026-11-25 17:52:02 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by pjanes22 on 2026-11-25T17:52:02Z.


The pipeline library's crash guard (Making + the vectored handler
compiler_crashed) sees an access violation near address 0 on a compiling
thread before the driver's own handlers do. NVIDIA's compiler
(nvgpucomp64.dll) takes such faults itself and handles them: the log shows
"first-chance exception 0xc0000005 at nvgpucomp64.dll+0x2d5..." and the
pipeline is then made or refused normally.

With the guard on, on an RTX 5080 20-28 world mesh pipelines a run were
reported as "the driver's compiler crashed making a pipeline", their threads
parked and their names written to crashed.txt; every later run refused them
at once with E_FAIL (0x80004005) without asking the driver. That is why the
refusals came with no debug-layer message and changed from run to run.
An older fork without the guard made the same shader pairs on the same card.

Fix: VICTORY_COMPILER_GUARD (default on, unchanged on AMD): 0 registers no
handler and ignores crashed.txt.

With the guard off the driver itself answers: most of these pipelines are
made, the rest are refused with E_OUTOFMEMORY (0x8007000E), as Yoshi-233
measured in #15. Not tested whether the guard could tell the two cases apart
by itself (e.g. by the faulting module).

AI-assisted: analysis and patch written with Claude, run and tested on my machine.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:5496372015 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/158). Originally posted by [pjanes22](https://github.com/pjanes22) on 2026-11-25T17:52:02Z. --- The pipeline library's crash guard (`Making` + the vectored handler `compiler_crashed`) sees an access violation near address 0 on a compiling thread before the driver's own handlers do. NVIDIA's compiler (nvgpucomp64.dll) takes such faults itself and handles them: the log shows "first-chance exception 0xc0000005 at nvgpucomp64.dll+0x2d5..." and the pipeline is then made or refused normally. With the guard on, on an RTX 5080 20-28 world mesh pipelines a run were reported as "the driver's compiler crashed making a pipeline", their threads parked and their names written to crashed.txt; every later run refused them at once with E_FAIL (0x80004005) without asking the driver. That is why the refusals came with no debug-layer message and changed from run to run. An older fork without the guard made the same shader pairs on the same card. Fix: `VICTORY_COMPILER_GUARD` (default on, unchanged on AMD): `0` registers no handler and ignores crashed.txt. With the guard off the driver itself answers: most of these pipelines are made, the rest are refused with E_OUTOFMEMORY (0x8007000E), as Yoshi-233 measured in #15. Not tested whether the guard could tell the two cases apart by itself (e.g. by the faulting module). AI-assisted: analysis and patch written with Claude, run and tested on my machine.
KernelSmoker commented 2026-11-25 18:52:27 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by KernelSmoker on 2026-11-25T18:52:27Z.


Verified PR head 97a673c (x86_64-pc-windows-gnu, Rust 1.98.1):

  • cargo clippy -p victory-gpu --no-deps --all-targets --locked --target x86_64-pc-windows-gnu: no warnings in crates/victory-gpu/src/pipeline/library.rs.
  • cargo check --workspace --all-targets --locked --target x86_64-pc-windows-gnu: passed.

Two minor cleanup notes in crates/victory-gpu/src/pipeline/library.rs:

  1. Line 125 (/// Whether the driver crashed making the pipeline named \name` before.) was left above compiler_guard()instead of staying abovefn crashed(name: &str)`.
  2. In Making::new (lines 169–174), only AddVectoredExceptionHandler requires unsafe; compiler_guard() and tracing::warn! can sit outside the unsafe block. (Also note that endless(name, true) still runs when VICTORY_COMPILER_GUARD=0, which is fine if only the VEH crash guard is meant to be disabled.)
<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7171519491 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/158#issuecomment-7171519491). Originally posted by [KernelSmoker](https://github.com/KernelSmoker) on 2026-11-25T18:52:27Z. --- Verified PR head `97a673c` (`x86_64-pc-windows-gnu`, Rust 1.98.1): - `cargo clippy -p victory-gpu --no-deps --all-targets --locked --target x86_64-pc-windows-gnu`: no warnings in `crates/victory-gpu/src/pipeline/library.rs`. - `cargo check --workspace --all-targets --locked --target x86_64-pc-windows-gnu`: passed. Two minor cleanup notes in `crates/victory-gpu/src/pipeline/library.rs`: 1. Line 125 (`/// Whether the driver crashed making the pipeline named \`name\` before.`) was left above `compiler_guard()` instead of staying above `fn crashed(name: &str)`. 2. In `Making::new` (lines 169–174), only `AddVectoredExceptionHandler` requires `unsafe`; `compiler_guard()` and `tracing::warn!` can sit outside the `unsafe` block. (Also note that `endless(name, true)` still runs when `VICTORY_COMPILER_GUARD=0`, which is fine if only the VEH crash guard is meant to be disabled.)
Aniseto commented 2026-11-26 20:08:13 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by Aniseto on 2026-11-26T20:08:13Z.


First test report from this machine for Belobug/VIctory-Belobug-AMD, at the exact PR head 97a673c:

System

  • GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders, 16 GB), driver 32.0.16.2124
  • CPU: Intel Core i5-12400F, 64 GB RAM
  • OS: Windows 11 Pro build 26200 x64
  • Toolchain: Rust 1.98.1 (pinned by rust-toolchain.toml), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env)
  • Build: debug; default branch here is a-publier, not main

Results

  • cargo test -p victory-gpu --lib pipeline::library -- --test-threads=1 (default VICTORY_COMPILER_GUARD): 4 passed, 0 failed, 0 ignored (112 filtered out, exit 0)
  • VICTORY_COMPILER_GUARD=0 cargo test --workspace --locked --no-fail-fast -- --test-threads=4: 551 passed, 12 failed, 17 ignored across 25 binaries (exit 101), 0 SKIPPED. The 12 failures were dynamic_slots_are_held_until_released, sdr_and_display_deferrals, six modules::xmem tests, four emit::valu_tests tests and repository_passes_policy.

What this adds
KernelSmoker checked this head with clippy and cargo check on x86_64-pc-windows-gnu; this is the first Windows MSVC run on a physical NVIDIA adapter in the thread. The four pipeline::library tests pass at this exact head with the guard at its default. With the guard off, the full suite at the same head had the failures listed above; I did not establish whether they come from this change, from this head's older base or from this host. This head is far from the current a-publier (cd8dfc0), so no comparison against current main is implied.

Not tested
A real driver compiler fault with the guard on or off, a paired smoke run under the title, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data.

AI-assisted (OpenCode), model: DeepSeek V4.1 Flash Free - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:comment:7202340524 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/158#issuecomment-7202340524). Originally posted by [Aniseto](https://github.com/Aniseto) on 2026-11-26T20:08:13Z. --- First test report from this machine for `Belobug/VIctory-Belobug-AMD`, at the exact PR head `97a673c`: **System** - GPU: NVIDIA GeForce RTX 5070 Ti (Blackwell, 32-lane waves only, mesh shaders, 16 GB), driver 32.0.16.2124 - CPU: Intel Core i5-12400F, 64 GB RAM - OS: Windows 11 Pro build 26200 x64 - Toolchain: Rust 1.98.1 (pinned by `rust-toolchain.toml`), MSVC 14.44.35207, DXC 1.9.2609.5 (shared env) - Build: debug; default branch here is `a-publier`, not `main` **Results** - `cargo test -p victory-gpu --lib pipeline::library -- --test-threads=1` (default `VICTORY_COMPILER_GUARD`): 4 passed, 0 failed, 0 ignored (112 filtered out, exit 0) - `VICTORY_COMPILER_GUARD=0 cargo test --workspace --locked --no-fail-fast -- --test-threads=4`: 551 passed, 12 failed, 17 ignored across 25 binaries (exit 101), 0 SKIPPED. The 12 failures were `dynamic_slots_are_held_until_released`, `sdr_and_display_deferrals`, six `modules::xmem` tests, four `emit::valu_tests` tests and `repository_passes_policy`. **What this adds** KernelSmoker checked this head with clippy and `cargo check` on `x86_64-pc-windows-gnu`; this is the first Windows MSVC run on a physical NVIDIA adapter in the thread. The four `pipeline::library` tests pass at this exact head with the guard at its default. With the guard off, the full suite at the same head had the failures listed above; I did not establish whether they come from this change, from this head's older base or from this host. This head is far from the current `a-publier` (`cd8dfc0`), so no comparison against current main is implied. **Not tested** A real driver compiler fault with the guard on or off, a paired smoke run under the title, release profile, AMD and Intel GPUs, native wave64 hosts, Wine, game data. AI-assisted (OpenCode), model: **DeepSeek V4.1 Flash Free** - checked out the PR's head commit in a detached worktree, built it, ran the tests, wrote this report; the worktree was not modified; no game data was used.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/158:upstream-pr/158'
git switch 'upstream-pr/158'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/158'
git switch 'upstream-pr/158'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/158'
git switch 'upstream-pr/158'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/158'
git switch 'main'
git merge --squash 'upstream-pr/158'
git switch 'main'
git merge --ff-only 'upstream-pr/158'
git switch 'main'
git merge 'upstream-pr/158'
git push origin 'main'
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
Belobug/VIctory-Belobug-AMD!158
No description provided.