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

Open
Mumogg wants to merge 1 commit from upstream-pr/2401 into main
Mumogg commented 2026-11-25 12:57:11 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Mumogg on 2026-11-25T12:57:11Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:6604994209 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2401). Originally posted by [Mumogg](https://github.com/Mumogg) on 2026-11-25T12:57:11Z. --- *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)
catminou4 commented 2026-11-25 14:06:42 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by catminou4 on 2026-11-25T13:19:25Z.

Review: COMMENTED


Under Wine, a host driver compiler crash costs its pipeline only, unless VICTORY_WINE_EXIT=1. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.

<!-- greyfinch-sync:Marvisak/VIctory:review:6058345469 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2401#pullrequestreview-6058345469). Originally posted by [catminou4](https://github.com/catminou4) on 2026-11-25T13:19:25Z. **Review:** COMMENTED --- Under Wine, a host driver compiler crash costs its pipeline only, unless VICTORY_WINE_EXIT=1. Static review only: victory-gpu/victory-hle are Windows-only (D3D12/windows-sys); not compiled or tested on this macOS arm64 host. rustc 1.98.1.
Marvisak commented 2026-11-25 16:09:13 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T15:30:44Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7166956855 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/2401#issuecomment-7166956855). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T15:30:44Z. --- <!-- 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 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/2401:upstream-pr/2401'
git switch 'upstream-pr/2401'

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/2401'
git switch 'upstream-pr/2401'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/2401'
git switch 'upstream-pr/2401'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/2401'
git switch 'main'
git merge --squash 'upstream-pr/2401'
git switch 'main'
git merge --ff-only 'upstream-pr/2401'
git switch 'main'
git merge 'upstream-pr/2401'
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
Marvisak/VIctory!2399
No description provided.