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

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

@⁠pjanes22 on GitHub · 2026-11-25 17:52 UTC · original
pjanes22:fix/compiler-guard-switch → main · +20 −1 · 1 files · 1 commits · open

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.

**@⁠pjanes22** on GitHub · 2026-11-25 17:52 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/158) `pjanes22:fix/compiler-guard-switch` → `main` · +20 −1 · 1 files · 1 commits · open 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.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:36:53 +00:00
Author
Owner

@⁠KernelSmoker on GitHub · 2026-11-25 18:52 UTC · original

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.)
**@⁠KernelSmoker** on GitHub · 2026-11-25 18:52 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/158#issuecomment-7171519491) 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.)
Author
Owner

@⁠Aniseto on GitHub · 2026-11-26 20:08 UTC · original

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.

**@⁠Aniseto** on GitHub · 2026-11-26 20:08 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/158#issuecomment-7202340524) 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 can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-158'
git switch 'github-bot/gh-158'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-158'
git switch 'github-bot/gh-158'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-158'
git switch 'main'
git merge --squash 'github-bot/gh-158'
git switch 'main'
git merge --ff-only 'github-bot/gh-158'
git switch 'main'
git merge 'github-bot/gh-158'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.