Recompiler: enable D3D12 debug layer before device creation in GPU test runner #2150
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
goal:world-load
good first issue
help wanted
invalid
keep-open
off-goal
question
stale
test-only
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/xcl-dev--xcl!2150
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2150"
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?
@saurabhbhoir456 on GitHub · 2026-11-25 06:23 UTC · original
saurabhbhoir456:fix/2016-d3d12-debug-layer→main· +8 −0 · 1 files · 1 commits · openFixes #2016: XCL_D3D12_DEBUG=1 removes the GPU test runner's device once a test starts the D3D12.X backend.
The GPU test runner creates its D3D12 device in runner::init(), but the debug layer was being enabled in the D3D12.X backend after the device already existed. The debug layer must be enabled before any device is created.
Enable the debug layer in runner::init() when XCL_D3D12_DEBUG is set, before adapter selection and device creation.
Tested
AI use
@JoaoPauluu on GitHub · 2026-11-25 06:44 UTC · original
A run under Wine on Linux with vkd3d-proton as the host D3D12. vkd3d-proton has no debug layer, and the GPU is lost in this group with or without
XCL_D3D12_DEBUG=1. So this setup cannot show the ordering #2016 is about. One result differs with this PR: with the variable set, the run hangs.Tested
RTX 3060 12 GB (NVIDIA 620.70.06, 32-lane waves), i5-10400F, 16 GB, CachyOS (kernel 7.3.3), Proton Experimental 11.0-20261112 with the patched vkd3d-proton 3.1 from #257, DXC 1.9.2609.5. Release lib test binaries, cross-built for
x86_64-pc-windows-gnu:ce03bebas it is (based on6ea813a) andmain568e7db, no uncommitted changes.libtest gpu::recomp::tests --test-threads=1, one Wine process per run, 600 s cap:XCL_D3D12_DEBUGXCL_D3D12_DEBUG=1mainOn
mainwith the variable set, the backend logsxcl: D3D12: debug layer requested but unavailable: 0x887A002D(DXGI_ERROR_SDK_COMPONENT_MISSING).In the three runs that finish, the first
0x887A0005comes ingpu_sparse_vram_descriptors_buffers_and_xmem(UMA import check: check not run: queue: 0x887A0005,sparse windows: 0x887A0005). The later failures arekernel dispatch: D3D12 device removed. This happens without the variable too, so under vkd3d-proton something in that test removes the device whatever the debug-layer order.In the PR's run with the variable set, 75 tests reported
okand 3FAILED:gpu_more_atomics_sub_dword_scratch_valu,gpu_nonfused_mad_and_mac_prevent_fma_contractionandgpu_packed_math_dots_movrel, the same three that fail by that point in the other runs. The process then stayed ingpu_permlane16_wqm_and_lds_stride64until the cap. I ran it once and have not checked where it waits.Not tested
AI use
@DavidM1911 on GitHub · 2026-11-25 07:04 UTC · original
Verification on RTX 3060 Ti (Windows 11), branch merged with current
main:cargo test -p xcl --lib: all passed, 0 failed, ~26 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling — tracked in #1978; clean on single-threaded rerun.)Thanks!
@fromthemoonx on GitHub · 2026-11-25 07:13 UTC · original
It fixes #2016's repro on NVIDIA. But with the debug layer now on the runner's device from the start, the whole
XCL_D3D12_DEBUG=1suite does not finish here: the lib test binary aborts, and one integration test that passes onmainfails.Tested (exact head
ce03beb, base6ea813a; RTX 3060 12 GB, driver 610.88, Graphics Tools installed, Windows 11 Pro 26300, Rust 1.100.0 MSVC, DXC 1.9.2602.17, debug):main568e7dbXCL_D3D12_DEBUG=1 cargo test -p xcl --lib gpu::recomp -- --test-threads=1(#2016's repro)0x887A0005)cargo test --workspace --no-fail-fast -- --test-threads=4(no variable)XCL_D3D12_DEBUG=1 cargo test --workspace --no-fail-fast -- --test-threads=4gpu::recomp, the removed device); the lib binary finishes--test-threads=1)On this PR, with
XCL_D3D12_DEBUG=1:hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixelsis the last test started before the lib binary exits with 2173. It passes alone, on the PR and onmain.gpu::texture::tests::gpu_large_mixed_upload_keeps_tight_staging_and_exact_pixelsfails in the full lib run and passes alone. Onmainit printedSKIPPED …: no GPUin the same run, because the device was already removed, so it never really ran under the debug layer before.gpu_compute_e2e::offline_compute_pipeline_is_reused_by_a_second_processfails 2 of 2 (gpu_compute_e2e.rs:107): thexcl shaders --precompile --pipelineschild printspipelines made on the GPU 0, refused 1. Onmainwith the same variable it passes 2 of 2, because the child's device has no debug layer there.So the device is no longer removed, and the debug layer now reaches tests that used to skip, which exposes more problems. The issue's "23 failures" become an abort plus a new refused pipeline.
Not tested: AMD, a title (no smoke run here), which debug-layer message the refused pipeline gets.
AI use: Claude Code (Claude Opus 5.5) ran the tests and wrote this report.
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.