Skip to content

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

Open
Mumogg wants to merge 1 commit into
Marvisak:mainfrom
Mumogg:gpu/wine-compiler-crash
Open

Mumogg wants to merge 1 commit into
Marvisak:mainfrom
Mumogg:gpu/wine-compiler-crash

Conversation

@Mumogg

@Mumogg Mumogg commented Nov 25, 2026 •

Copy link
Copy Markdown

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

… the run

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 <noreply@anthropic.com>

@catminou4 catminou4 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 Nov 25, 2026 •

Copy link
Copy Markdown
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants