Tests: XCL_D3D12_DEBUG=1 removes the GPU test runner's device once a test starts the D3D12.X backend (23 failures) #2016
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#2016
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
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?
@cindertheblue on GitHub · 2026-11-25 00:46 UTC · original
With
XCL_D3D12_DEBUG=1,cargo test --workspaceloses the GPU partway through: 23 tests fail and 11 more skip withno GPU. The cause is the order in which the tests create D3D12 devices, not the tests that fail.Cause.
real::init()enables the debug layer (crates/xcl/src/hle/d3d12x/real.rs:478–483,EnableDebugLayer) when the D3D12.X backend first starts. In the test binary the GPU test runner (gpu::recomp::runner::init) has made its own device by then. Enabling the debug layer after a device exists removes that device (the documented behaviour ofID3D12Debug::EnableDebugLayer). From then on every test that uses the runner's device gets0x887A0005(CreateComputePipelineState/CreateRootSignature/CreateCommittedResource: "The GPU device instance has been suspended").In the lib tests the backend is first started by
gpu::recomp::tests::gpu_sparse_vram_descriptors_buffers_and_xmem(andgpu_uma_import_check_at_initcallsreal::init()too). In a single-threaded run the log showsxcl: D3D12: debug layer enabledinside that test, and the first0x887A0005comes in the next test.On
main6567c5f, AMD Radeon RX 7600 XT, driver 32.0.31041.1004, Windows 11 Home 26200.9974, rustc 1.99.1, debug, Graphics Tools installed:cargo test --workspace --no-fail-fast -- --test-threads=4XCL_D3D12_DEBUG=1XCL_D3D12_DEBUG=1 cargo test -p xcl --lib gpu::recomp -- --test-threads=1--skip gpu_sparse_vram_descriptors_buffers_and_xmem --skip gpu_uma_import_check_at_initThe same 19
gpu::recomptests fail in each of my three single-threaded runs (two on20cf130, one on6567c5f), all with0x887A0005. The 2 failures without the variable are unrelated to this.Possible fixes (not tried):
XCL_D3D12_DEBUGis set, so the backend's later call finds it already on.Both change
crates/xcl/srcoutside tests, so I am reporting it rather than opening a PR.Separately: with the debug layer on,
gpu_sparse_vram_descriptors_buffers_and_xmemitself logs error 1419 (SetComputeRootSignaturebeforeSetDescriptorHeapswith the*_HEAP_DIRECTLY_INDEXEDABI root signature). That test-only fix is #2017; it does not change the device removal above.AI use: Claude Code (Claude Opus 5.5) found the cause, ran the tests and wrote this issue from the real output.
@CalvyPZ on GitHub · 2026-11-25 23:18 UTC · original
Closing: both parts of this issue are fixed on
mainby merged PRs.72d048b). It is the first fix proposed above:gpu::agility::enable_debug_layerruns once per process,gpu::recomp::runner::initcalls it before it makes its device (runner.rs:90), andreal::inituses the same call (real.rs:488), so the backend no longer turns the layer on after a device exists.gpu_sparse_vram_descriptors_buffers_and_xmem: #2017, merged 2026-11-25 (b282d6b); the test sets its descriptor heaps (gpu/recomp/tests.rs:4468).Checked on
main08db802by reading the code. I did not run the suite for this comment. The before/after run is the one on #2022 (parent6567c5floses the device with0x887A0007/0x887A0005, the PR head keeps it, on a machine with Graphics Tools installed).Not covered: the 23-failure run from this report has not been repeated on
main, and there is no test in the suite that pins the order. IfXCL_D3D12_DEBUG=1 cargo test --workspacestill loses the device on a tree with #2022, please reopen with the commit.AI use: Claude Code (Claude Fable 5.2) read the issue, the PRs and the code on
mainand wrote this comment.