Repository navigation
GPU diagnostics: a pipeline whose creation faults is refused and the title goes on (opt-in, on #491) - #2292
GPU diagnostics: a pipeline whose creation faults is refused and the title goes on (opt-in, on #491)#2292desplmfao wants to merge 8 commits into
Conversation
Some host drivers crash while compiling a translated shader. Under Wine the fault inside vkCreate*Pipelines ends the process with exit code 3 before any handler runs, so nothing names the shader and the same crash comes back on every run. With VICTORY_PIPELINE_JOURNAL=1, each host pipeline is noted in pipeline-journal/pending/ while it is created, and the note is removed when creation returns. A note left at the next start names the pipeline that was being created when the process ended: it goes into pipeline-journal/crashed.txt and is refused from then on, its draws and dispatches dropped like those of any refused pipeline. Pipelines are created one at a time while the journal is on, so a crash names only the pipeline that caused it. Off by default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A crash with one pipeline in creation names it (crashed.txt) as before. A crash with several in creation makes them suspects (suspects.txt): they are not refused, but each is created alone until its creation returns, so a repeat crash leaves one note and names it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # README.md # crates/victory-gpu/src/pipeline/host.rs
…refused pipelines drop draws Suggested by YaBulochka in Marvisak#491: - A note in pending/ is named <key>@<stages and sizes>@<pid>-<n>, for example 4e296b1885c37b29@compute-2232@32-23, so pending/ can be read without the log. The same goes as a comment above the pipeline's line in crashed.txt. - At start-up, the refused pipelines are listed with a warning that every draw and dispatch using one is dropped. How many is only known once the title asks for them; each is still logged once when first skipped. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
fromthemoonx found in Marvisak#491 that a second instance opening the journal refused the pipeline the first one was creating. Notes name their process id; one whose process is still running is now skipped and kept. The README says how to undo the refusal a quit during creation causes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…(VICTORY_PIPELINE_SOFT_CRASH) The pipeline journal learns of a pipeline that crashes the host's compilers (dxil-spirv's deep recursion, the driver's compiler) only after the process has died, one restart per pipeline. With VICTORY_PIPELINE_SOFT_CRASH=1, pipeline workers survive such a fault: - loads and creations in `library::pipeline` run through a small assembly frame (`soft_crash::guarded`) with unwind data. A vectored handler, on an armed thread inside such a call, points the faulting context back at that frame, which returns the exception code. Faults of the error kind only (not C++ or other software exceptions; not heap corruption); - the pipeline is refused for the rest of the run and appended to the journal's crashed.txt at once (with its stages, sizes and the code), logged once with the code and address; - the worker that faulted hands its place to a fresh thread (its stack may have lost its guard page); - after 8 faults, faults are left alone and end the process as before. Pipeline workers also get a 256 MiB stack (reserved only), and armed threads keep 64 KiB for handling an overflow. Nothing between the fault and the frame is unwound: locks and memory the host held then are lost, which is why it is opt-in. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
catminou4
left a comment
There was a problem hiding this comment.
GPU diagnostics: VICTORY_PIPELINE_JOURNAL crash journal — a pipeline whose creation faults is refused next run, suspects isolated one-by-one (+1034 incl. README). 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. Ambitious self-healing for driver crashes; the 'quit during single creation looks like a crash' caveat is honest. Windows-only path.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Out of draft: it has now caught real faults in the title. Our stack with #439 but without #2309 has two programs on which vkd3d-proton's dxil-spirv recurses until the stack runs out ( |
Stacked on #491 (the pipeline journal). Its commits come first here; the change is the last commit,
a690518.Problem
Under Wine/vkd3d-proton, creating a host pipeline runs dxil-spirv and then the driver's compiler inside the title's process. On some translated shaders, one of them faults. Examples here: dxil-spirv recursing about 100k frames on #439's loop shapes, and NVIDIA's compiler crashing on others. A single bad pipeline ends the run. #491 then refuses it from the next run on, but that is one restart per bad pipeline.
Change
Opt-in, with
VICTORY_PIPELINE_SOFT_CRASH=1:pipeline/soft_crash.rs). That covers bothLoad*PipelineandCreate*PipelineState.0xC0000374) and stack-buffer overrun (0xC0000409) are left alone.crashed.txtimmediately, in the existing format plus(fault 0x…), so later runs refuse it too.SetThreadStackGuarantee(64 KiB)so the handler has stack left after an overflow. Pipeline workers get a 256 MiB stack, which is reserved, not committed.Risks
This is why it is opt-in:
virtual_setup_exception stack overflow). The guard can't catch that one; the bigger stack makes it less likely.Related
make.rs(256 and 64 MiB). Expect a one-line conflict; I can drop the stack part here if Shaders, GPU: one back edge per loop header, and a large stack for pipeline threads #1885 lands.VICTORY_SKIP_PIPELINES) have the same goal by different means.Tested
RTX 5080, Linux, Proton with vkd3d-proton 3.2.0:
cargo test -p victory-gpu --lib soft_crash: 6 passed. They cover an access violation (0xC0000005), an illegal instruction (0xC000001D), a deep-recursion stack overflow on a 1 MiB thread (0xC00000FD), values and panics passing through, threads that aren't armed staying unguarded, and the fault-kind filter.cargo test -p victory-gpu --lib journal: 8 passed, includinga_pipeline_whose_creation_faulted_is_refused_now_and_in_later_runs.cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without--features diagnostics: clean.In the title. The build was our stack with Shaders: one console wave sharing LDS runs in the console flow on 32-lane hosts #439 but without Shaders: one back edge per block, so vkd3d-proton converts #439's loops (stacked on #439) #2309. There, vkd3d-proton's dxil-spirv recurses until the stack runs out on two of Shaders: one console wave sharing LDS runs in the console flow on 32-lane hosts #439's programs, and before this change that ended the process. Run under Proton, with vkd3d-proton 3.2.0,
VICTORY_PIPELINE_SOFT_CRASH=1andVICTORY_PIPELINE_JOURNAL=1:Both are stack overflows (
0xc00000fd) inside vkd3d-proton under Wine, caught 10 s into the run. 383 more pipelines were created after the second one, so no host lock was lost. The title kept running until I stopped it 90 s later.crashed.txtlists both, each with a# compute-… (fault 0xc00000fd)comment.AI-assisted (Claude Code).
🤖 Generated with Claude Code