Shaders: --pipelines says when the device is removed and stops making #2198
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2208"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from ivall/xcl. Originally posted by madaraXor on 2026-11-25T09:45:37Z.
When a driver compile hangs the GPU, the D3D12 device of
xcl shaders --precompile --pipelinesis removed, and everyCreateRootSignature/CreateComputePipelineStateafter it fails. The pass counted each of those as refused and went on, so it ended with thousands of "refused" pipelines and nothing saying why. On an RX 6700 XT withXCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1this happened right after a retail title's two screen-probe programs of about 3 MB of DXIL:GetDeviceRemovedReasongaveDXGI_ERROR_DEVICE_HUNG, and the 2 222 pipelines after them were reported as refused (466 made). Part of #1269.What is in it
crates/xcl/src/shaders.rs: after a failed root signature or pipeline,Pipelines::note_removedasksGetDeviceRemovedReason. The first time it says the device is gone, the pass prints the reason and the program whose pipeline failed first ("seen when making …": with several pipelines made at once, not necessarily the one that hung the GPU). From then on no pipeline is made (translation goes on), and those are counted apart from the refusals; the summary has a line for them.maketakes the program's name for the message.Tested
e4720ca(this commit onmain06c9f55).cargo test --workspace --no-fail-fast -- --test-threads=4: 1261 passed, 4 failed, 46 ignored. The 4:gpu::dxil::fuzz_tests::fuzz_validate_and_gpu_1(seed 540),hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory(#650), and the e2e teststest_title_runs_and_game_folder_is_untouchedandtest_title_draws_with_a_root_signature_under_the_debug_layer, which fail onmainon this machine too. SKIPPED: the six per-lane cases off16_programs_on_the_gpu/f32_programs_on_the_gpu(refused),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows).GetDeviceRemovedReasonafter a refused pipeline, is the one a local diagnostic build used to find the cause above: it printedDXGI_ERROR_DEVICE_HUNGfor the first pipeline refused after the probe programs.Regression run
scripts/smoke.ps1, 60 s, release builds, run in the same session.main:
PR:
Not tested
ALLOW_RETURNING_EXISTING_DEVICE), soID3D12Device5::RemoveDevicein a test would remove the device of every other GPU test in the process.xcl shaders).AI use
🤖 Generated with Claude Code
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T10:45:01Z.
Code review on
c0ae0e9:GetDeviceRemovedReason()inPipelines::removed(OnceLock<String>) and counting skipped post-removal builds inPipelines::lostcleanly stopsxcl shaders --pipelinesfrom burning through remaining PSOs after a device removal.Remaining before merge:
Build and testfinishing green plus dual-vendor (AMD + NVIDIA) verification onc0ae0e9.Imported from ivall/xcl. Originally posted by tiagonleal on 2026-11-25T12:31:37Z.
Verification on NVIDIA RTX 5070 Ti (Windows 11), head
c0ae0e902bf64c8f252ad1bd72b3dc833b75eff8Tested
c0ae0e902bf64c8f252ad1bd72b3dc833b75eff8(git rev-parse HEADof a clean worktree, no local changes; merge-base withmain568e7db7729c8fa6c8f0f4b32d798faaf11462bb). The PR was open and the head unchanged when I started and again before writing this.cargo testdefault), DXC from the Windows SDK 10.0.26100.0 (dxcompiler/dxil 1.8.2502.11).cargo test -p xcl --lib shaders -- --test-threads=4 --nocapture: 14 passed, 0 failed, 0 ignored (32 s including an incremental build). The PR adds no test of its own; this runs the existingshaderstests against the changedPipelinescode.cargo test -p xcl --lib -- --test-threads=4 --nocapture(whole lib): 1094 passed, 4 failed, 26 ignored. The 4 failures aregpu::dxil::fuzz_tests::fuzz_validate_and_gpu_0to_3withCreateComputePipelineState: Not enough memory resources are available to complete this operation. (0x8007000E). The same four fail with the same message on the merge-base568e7db(1094 passed, 4 failed, 26 ignored there), so they are not from this PR.SKIPPED:shaders::tests::pso_measurement_compiles_an_exact_synthetic_record: cannot disable the driver cache (Windows Developer Mode is required), 0x887A002D; and 23 GPU tests withno wave64orrefused (unsupported V_MUL_F16 / V_PK_MUL_F16 / V_CVT_F16_F32 ...)on this wave32-only GPU.Not tested
xcl shaders --pipelinesrun that hits a device removal: none of the tests I ran removes the device, so the new "device removed" message and the skipped-build count were not seen at run time.xcl-smoke;cargo test --workspace; release profile.AI use
Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5).
Imported from ivall/xcl. Originally posted by luckyteagirl on 2026-11-26T08:58:49Z.
Review: COMMENTED
At exact head
e4720ca(base06c9f55, current mainb49be18), the new device-removal latch is bypassed when a cached PSO probe fails for a program over the offline DXIL cap. This is a source-derived review; I did not inject device loss.make_with_cache_pathconverts the cachedCreateComputePipelineStateresult toOptionwith.ok()atshaders.rs:1297–1298. If that call failed because the device was removed,from_cachebecomesNone. With an existing blob andover_cap=true, the next branch deletes the blob, incrementscapped, and returns before the new finalnote_removedcheck. The current request is reported as capped rather than lost; subsequent over-cap cached requests can repeat the deletion without ever settingremoved. This also contradicts the PR's guidance that the driver cache keeps previously made pipelines after removal.Could the cached probe retain its HRESULT long enough to check
note_removedbefore stale-blob invalidation or an uncached retry, preserving the blob when the device is gone? A focused injected cached-probe removal with a blob and an over-cap DXIL program could assertlost=1,capped=0, unchanged cache file, and no next driver call. A genuinely stale blob should retain the existing capped behavior.AI assistance: two GPT-6.2 Sol agents independently confirmed the path; GPT-6.2 Astra checked the exact-head source and drafted this review.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:33:20Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T07:35:12Z.
Triage (#1607) – head
e4720caNo open or merged PR adds device-removal detection to
xcl shaders --pipelines; main still counts every pipeline failed after a removal as refused. #2220 changes the samePipelines::makesignature (adds a record hash for tracing), so whichever lands second needs a rebase, but the changes do not overlap.No problems found in the diff:
note_removedreports the reason once via theOnceLock, and later pipelines are counted inlostinstead ofrefused.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.