Tests: enable D3D12 debug layer before GPU runner device #2012
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2022"
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 luckyteagirl on 2026-11-25T00:55:41Z.
Addresses #2016.
XCL_D3D12_DEBUG=1currently lets the GPU test runner create a D3D12 device before D3D12.X enables the debug layer. Enabling the layer after that removes the runner's device. This change enables the layer before the runner creates a device and makes both paths share one process-wide initialization, so the backend does not enable it again later.What is in it
gpu::agility::enable_debug_layer()retrieves the active Agility SDK or inbox debug interface and callsEnableDebugLayerat most once.XCL_D3D12_DEBUGasks for it.Tested
8921c36fd3f719bee619e040a0b802fbb22391baonmain6567c5ffa38fbc7039b2d6bf520154689cc1f482. Windows 11 build 26200, Ryzen 9 5980HX, Radeon RX 6800M driver30.0.13002.13003, Rust 1.99.0 MSVC, DXC/DXIL1.9.2609.5, debug build.git diff --checkandcargo build --locked --workspace -j 2passed.XCL_ADAPTER=6800M,XCL_REQUIRE_GPU=1, andXCL_D3D12_DEBUG=1,cargo test --locked --workspace --no-fail-fast -j 2 -- --test-threads=4 --show-outputcompleted across 20 test binaries: 854 passed, 143 failed, 45 ignored. Six explicitSKIPPEDtests are included in the passed count:gpu_raw_window_view_reaches_its_top(no GPU),pso_measurement_compiles_an_exact_synthetic_record(device error),placed_title_textures_share_vram_and_preserve_pixels(no reserved cube with mips),test_title_draws_with_a_root_signature_under_the_debug_layer(missingd3d12SDKLayers.dll),heap_window_out_of_memory_falls_back_to_the_switch_form(no heap windows), anduploads_start_from_each_subresources_state(no D3D12 debug layer). The GPU device was suspended (0x887A0005), followed by many GPU test failures.gpu::recompsubset exited with0xC0000005atgpu_bvh64_intersect_ray_across_memory_windows_and_grazing. The isolatedgpu_sparse_vram_descriptors_buffers_and_xmemtest also exited with0xC0000005, both with and withoutXCL_D3D12_DEBUG=1.0x887A002D), so the specific device-removal fix needs validation on a system with Graphics Tools installed. The code path compiled and the flag was exercised, but the layer was not actually enabled here.cargo build --locked --release -p xcl -j 2passed. A locally owned title ran for 7 seconds on this head and main400e638869ee8e8f8238079db3b70fce2abd3c2b: each showed one frame, no crash, and no device removal. Peak process commit was 6,998 MB on this head versus 7,069 MB on main.Regression run
main:
PR head:
Not tested
The 7-second title run did not request the D3D12 debug layer. This machine lacks
d3d12SDKLayers.dll, so enabling the layer and validating the reported device-removal fix remain untested; longer title runs, other adapters, and newer AMD drivers are also untested.AI use
OpenAI Codex (GPT-6, exact variant not exposed in this session) implemented the fix, ran the checks, reviewed the diff, and drafted this description.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:25:47Z.
Code review on
8921c36:gpu::agility::enable_debug_layer()(OnceLock) and invoking it before device creation ingpu::recomp::runner::initcleanly preventshle::d3d12x::real::initfrom callingEnableDebugLayerafter a runner device already exists.CIworkflow approved (currently running).Remaining before merge:
PR descriptioncheck.Build and test (Windows, no GPU)finishes green.8921c36.Imported from ivall/xcl. Originally posted by nnonno91 on 2026-11-25T01:33:21Z.
Tested
Independent Graphics Tools check on exact head
8921c36fd3f719bee619e040a0b802fbb22391baand parent6567c5ffa38fbc7039b2d6bf520154689cc1f482. Windows 11 25H2 (26200.9974), Ryzen 7 9800X3D, AMD Radeon(TM) Graphics (32.0.21042.62) and RTX 5090 (32.0.16.1742). Inbox D3D12 withd3d12SDKLayers.dll10.0.26100.9818, Rust 1.100.0 x64 MSVC, DXC/DXIL 1.8.2502.11, unoptimized dev/test profiles with debug info off.cargo build --workspace --lockedpassed on the clean PR head.cargo test --locked -p xcl --lib gpu::recomp::runner::debug_layer_initialization_order_probe -- --exact --test-threads=1 --nocapture. The temporary probe created the GPU runner device, checked whetherID3D12InfoQueue1was present, dispatched a 64-lane shader, calledd3d12x::real::init(), then checked the original runner device and dispatched again. Separate processes for both devices, both revisions, and withXCL_D3D12_DEBUGunset or set to1. All eight final probe runs passed their assertions (1 passed, 0 failed, 0 ignored, 0 skipped per run), with the debug-enabled parent runs explicitly asserting the expected device loss.0x887A0007, and the second dispatch failed atCreateComputePipelineStatewith0x887A0005, matching #2016. The backend selected WARP on the AMD run.Not tested
Agility SDK builds, the full workspace test suite with the debug layer, and real-title smoke runs. The probe covers the runner-first initialization order from #2016.
AI use
OpenAI Codex (GPT-6 family, exact variant unavailable) prepared and ran the temporary probe, checked the logs, and drafted this report.
Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:43:51Z.
Update on
8921c36:Build and test (Windows, no GPU)is now green, and@nnonno91verified exact head8921c36across both AMD Radeon Graphics and RTX 5090 withd3d12SDKLayers.dll(confirming the runner retains its debug queue and hardware adapter instead of hitting0x887A0007/0x887A0005).Remaining before merge: Fixing the failing
PR descriptioncheck (and if needed, confirming a full suite pass on the head).Imported from ivall/xcl. Originally posted by raylitebull on 2026-11-25T01:54:16Z.
@luckyteagirl—8921c36now passes every check (CLEAN,Build and test+PR descriptionbothSUCCESS, and verified on both AMD RX 6800M / Radeon iGPU and NVIDIA RTX 5090). This PR is currently marked Draft; once marked Ready for review, it is ready to merge!upstream-sync referenced this pull request2026-11-25 04:08:41 +00:00
Imported from ivall/xcl. Originally posted by DavidM1911 on 2026-11-25T04:12:10Z.
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!