GPU: under Wine, a host driver compiler crash costs its pipeline, not the run #2401

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

@⁠Mumogg on GitHub · 2026-11-25 12:57 UTC · original
Mumogg:gpu/wine-compiler-crash → main · +220 −3 · 5 files · 1 commits · open

From a tester working with Claude (AI-assisted). Measured on my own machine; the limits of what was measured are in "Tested".

Problem

Under Wine, when the host driver's compiler crashes inside vkCreateComputePipelines / vkCreateGraphicsPipelines, the process ends with exit code 3 and no handler of ours runs (#144, and the reason #491 needs a second run to name the pipeline). The cause is in winevulkan, not in vkd3d-proton or the driver: the fault happens inside a Unix call, Wine turns it into that call's status, and winevulkan's PE thunk for the function logs

err:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call.

and then calls ExitProcess(3). A vectored exception handler never sees it. (Read from the import table and thunk of winevulkan.dll of Wine 11.22 Staging; ExitProcess is one of two functions it imports from kernel32.)

Change

On first use of the pipeline workers, if winevulkan.dll is loaded, its import of ExitProcess is pointed at a function of ours (pipeline/wine.rs):

  • A pipeline worker that arrives there while it makes a pipeline is parked for good. Its pipeline counts as lost: nothing waits for it any more (ready and wait skip it, so it does not cost the per-frame budget), its draws and dispatches are dropped as for a refused one, missing says "lost to the driver's compiler", and an error line names its shaders.
  • The name the worker holds in the pipeline library is let go and refused to the threads waiting for it and to later ones (library::abandon), so a second title pipeline with the same host description does not wait for ever.
  • Another worker is started in its place.
  • Any other caller of that import exits as before. On Windows nothing happens (no winevulkan.dll).
  • VICTORY_WINE_EXIT=1 leaves Wine's exit alone.

This does not replace #491: that one remembers the pipeline for the next run; this one keeps the current run alive. Nothing is remembered here across runs.

shortcut: in the module comment: the parked thread keeps whatever the driver and vkd3d-proton held when the compiler crashed, so a later compile that needs the same lock would wait for it. I did not see that in the runs below, but it is possible.

Tested

RTX 5070 Ti (driver 615.78.08), Linux, Wine 11.22 Staging, vkd3d-proton and DXVK dxgi from GE-Proton11-14, VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains, Microsoft's d3dcompiler_47.dll (see #1279), Series X 1.0.2.1, clean cache folders.

cargo clippy --workspace --all-targets -- -D warnings (target x86_64-pc-windows-msvc) is clean; the pipeline:: tests pass under Wine (16, one new: the import-table rewrite on a synthetic image); cargo xtask policy passes.

In the title, on this branch as it is (main 940d32f + this commit), one run:

  • Without the change main ends at the first compiler crash here (about 80 s after start).
  • With it the run got past that, but not cleanly: 172 pipelines were lost in about a minute (158 compute, 8 mesh, 6 vertex), and 2.5 minutes after start the title itself faulted (a null write in title code, +0x23cf683), which ended the run. I do not know whether that fault follows from the lost pipelines.

With #259 merged on top (the level query that crashes NVIDIA's compiler), one run: 12 pipelines lost, all within one minute (mostly mesh and vertex+pixel pipelines, two compute), then the same title fault at 146 s.

The same mechanism, as a local patch on two forks that carry #259 and much else (so not this branch): three runs of 13 to 15 minutes in the world, 0, 3 and 8 pipelines lost, none ended by a crash; all three were stopped by my own time limit.

So what I can claim: the process no longer ends at the first compiler crash, and the lost pipeline is named in the same run. What I cannot claim: that a run on main is healthy afterwards. Losses come in bursts (many within a second), which I read as the driver's compiler being unwell for a while after a first crash, not as that many bad shaders; that is my inference, not something I measured.

Not tested: AMD/RADV or Intel under Wine, Proton's own Wine builds (the thunk may differ; the log line winevulkan does not import ExitProcess would show it), Windows beyond the unit test and the absence of winevulkan.dll.

🤖 Generated with Claude Code

**@⁠Mumogg** on GitHub · 2026-11-25 12:57 UTC · [original](https://github.com/Marvisak/VIctory/pull/2401) `Mumogg:gpu/wine-compiler-crash` → `main` · +220 −3 · 5 files · 1 commits · open *From a tester working with Claude (AI-assisted). Measured on my own machine; the limits of what was measured are in "Tested".* ## Problem Under Wine, when the host driver's compiler crashes inside `vkCreateComputePipelines` / `vkCreateGraphicsPipelines`, the process ends with exit code 3 and no handler of ours runs (#144, and the reason #491 needs a second run to name the pipeline). The cause is in winevulkan, not in vkd3d-proton or the driver: the fault happens inside a Unix call, Wine turns it into that call's status, and winevulkan's PE thunk for the function logs ``` err:vulkan:vkCreateComputePipelines Exception 0xc0000005 in Unix call. ``` and then calls `ExitProcess(3)`. A vectored exception handler never sees it. (Read from the import table and thunk of `winevulkan.dll` of Wine 11.22 Staging; `ExitProcess` is one of two functions it imports from kernel32.) ## Change On first use of the pipeline workers, if `winevulkan.dll` is loaded, its import of `ExitProcess` is pointed at a function of ours (`pipeline/wine.rs`): - A pipeline worker that arrives there while it makes a pipeline is parked for good. Its pipeline counts as lost: nothing waits for it any more (`ready` and `wait` skip it, so it does not cost the per-frame budget), its draws and dispatches are dropped as for a refused one, `missing` says "lost to the driver's compiler", and an error line names its shaders. - The name the worker holds in the pipeline library is let go and refused to the threads waiting for it and to later ones (`library::abandon`), so a second title pipeline with the same host description does not wait for ever. - Another worker is started in its place. - Any other caller of that import exits as before. On Windows nothing happens (no `winevulkan.dll`). - `VICTORY_WINE_EXIT=1` leaves Wine's exit alone. This does not replace #491: that one remembers the pipeline for the next run; this one keeps the current run alive. Nothing is remembered here across runs. `shortcut:` in the module comment: the parked thread keeps whatever the driver and vkd3d-proton held when the compiler crashed, so a later compile that needs the same lock would wait for it. I did not see that in the runs below, but it is possible. ## Tested RTX 5070 Ti (driver 615.78.08), Linux, Wine 11.22 Staging, vkd3d-proton and DXVK `dxgi` from GE-Proton11-14, `VKD3D_DISABLE_EXTENSIONS=VK_NV_raw_access_chains`, Microsoft's `d3dcompiler_47.dll` (see #1279), Series X 1.0.2.1, clean cache folders. `cargo clippy --workspace --all-targets -- -D warnings` (target `x86_64-pc-windows-msvc`) is clean; the `pipeline::` tests pass under Wine (16, one new: the import-table rewrite on a synthetic image); `cargo xtask policy` passes. In the title, on this branch as it is (`main` `940d32f` + this commit), one run: - Without the change `main` ends at the first compiler crash here (about 80 s after start). - With it the run got past that, but **not cleanly**: 172 pipelines were lost in about a minute (158 compute, 8 mesh, 6 vertex), and 2.5 minutes after start the title itself faulted (a null write in title code, `+0x23cf683`), which ended the run. I do not know whether that fault follows from the lost pipelines. With #259 merged on top (the level query that crashes NVIDIA's compiler), one run: 12 pipelines lost, all within one minute (mostly mesh and vertex+pixel pipelines, two compute), then the same title fault at 146 s. The same mechanism, as a local patch on two forks that carry #259 and much else (so not this branch): three runs of 13 to 15 minutes in the world, 0, 3 and 8 pipelines lost, none ended by a crash; all three were stopped by my own time limit. So what I can claim: the process no longer ends at the first compiler crash, and the lost pipeline is named in the same run. What I cannot claim: that a run on `main` is healthy afterwards. Losses come in bursts (many within a second), which I read as the driver's compiler being unwell for a while after a first crash, not as that many bad shaders; that is my inference, not something I measured. Not tested: AMD/RADV or Intel under Wine, Proton's own Wine builds (the thunk may differ; the log line `winevulkan does not import ExitProcess` would show it), Windows beyond the unit test and the absence of `winevulkan.dll`. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Under Wine a fault inside a Unix call never reaches a handler of ours:
winevulkan's thunk logs "Exception 0xc0000005 in Unix call." and calls
ExitProcess(3). One shader the driver's compiler does not survive ends
every run at the same place.

winevulkan's import of ExitProcess is pointed at a function of ours. A
pipeline worker that arrives there while it makes a pipeline is parked,
its pipeline counts as lost (nothing waits for it, its draws are dropped,
the frame line's reason says so), the name it holds in the pipeline
library is let go and refused to others, and another worker takes its
place. Any other caller exits as before. Nothing happens where
winevulkan is not loaded. VICTORY_WINE_EXIT=1 leaves Wine's exit alone.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:04:43 +00:00
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 15:30 UTC · original · edited 2026-11-25 22:22 UTC

Automated triage for the maintainers.

Needs rebase. This PR no longer merges cleanly into main (conflicts in crates/victory-gpu/src/pipeline.rs, pipeline/library.rs and pipeline/make.rs). It will be reviewed again once it is rebased.

From the earlier needs-work note: it needs the maintainer's decision (it patches winevulkan.dll's import table to park crashed pipeline workers); if wanted, read VICTORY_WINE_EXIT through crate::switch::on.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 15:30 UTC · [original](https://github.com/Marvisak/VIctory/pull/2401#issuecomment-7166956855) · edited 2026-11-25 22:22 UTC <!-- victory-triage v1 head=73e7e3ef9c9844e50c92ce050a84652eb0408905 verdict=needs-rebase at=2026-11-25T22:31:30Z --> Automated triage for the maintainers. **Needs rebase.** This PR no longer merges cleanly into `main` (conflicts in `crates/victory-gpu/src/pipeline.rs`, `pipeline/library.rs` and `pipeline/make.rs`). It will be reviewed again once it is rebased. From the earlier needs-work note: it needs the maintainer's decision (it patches `winevulkan.dll`'s import table to park crashed pipeline workers); if wanted, read `VICTORY_WINE_EXIT` through `crate::switch::on`. --- _Generated by [Claude Code](https://claude.ai/code)_
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline.rs
  • crates/victory-gpu/src/pipeline/library.rs
  • crates/victory-gpu/src/pipeline/make.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/2401/head:github-bot/gh-2401'
git switch 'github-bot/gh-2401'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2401'
git switch 'github-bot/gh-2401'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2401'
git switch 'github-bot/gh-2401'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2401'
git switch 'main'
git merge --squash 'github-bot/gh-2401'
git switch 'main'
git merge --ff-only 'github-bot/gh-2401'
git switch 'main'
git merge 'github-bot/gh-2401'
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!2401
No description provided.