Repository navigation
Conversation
|
Code review on
Remaining before merge: |
|
Verification on NVIDIA RTX 5070 Ti (Windows 11), head Tested
Not tested
AI use
Run and written with Claude Code (Claude Fable 5.2 and Claude Sonnet 5.5). |
When a driver compile hangs the GPU, the D3D12 device of the pass is removed and every later CreateRootSignature / CreateComputePipelineState fails. The pass counted each of those as refused and went on, so a run ended with thousands of "refused" pipelines and no hint of why. On an RX 6700 XT (RDNA2) with XCL_DIRECT_DXIL=1 XCL_HEAP_WINDOWS=1 this happened right after the retail title's two screen-probe programs of about 3 MB of DXIL; GetDeviceRemovedReason was DXGI_ERROR_DEVICE_HUNG, and the ~2 200 pipelines after them were reported as refused. After a failure the pass now asks GetDeviceRemovedReason. Once it says the device is gone, it prints the reason and the program whose pipeline failed first, makes no more pipelines (translation goes on), and counts the rest apart from the refusals in its summary. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
c0ae0e9 to
e4720ca
Compare
luckyteagirl
left a comment
There was a problem hiding this comment.
At exact head e4720ca (base 06c9f55, current main b49be18), 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_path converts the cached CreateComputePipelineState result to Option with .ok() at shaders.rs:1297–1298. If that call failed because the device was removed, from_cache becomes None. With an existing blob and over_cap=true, the next branch deletes the blob, increments capped, and returns before the new final note_removed check. The current request is reported as capped rather than lost; subsequent over-cap cached requests can repeat the deletion without ever setting removed. 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_removed before 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 assert lost=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.
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(Tests: align XMemVirtualQuery buffers and verify CPU flags #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