Skip to content

D3D12.X: say why no GPU made a device with the debug layer on - #1444

Open
WillyboPeep wants to merge 1 commit into
xcl-dev:mainfrom
WillyboPeep:debug-layer-mismatch
Open

WillyboPeep wants to merge 1 commit into
xcl-dev:mainfrom
WillyboPeep:debug-layer-mismatch

Conversation

@WillyboPeep

@WillyboPeep WillyboPeep commented Nov 24, 2026 •

Copy link
Copy Markdown

With XCL_D3D12_DEBUG=1, a D3D12 debug layer of another SDK version than the D3D12 runtime makes every device fail with E_INVALIDARG. Only the runtime's debug output names the cause (D3D Error 887a002d: D3D12 SDKLayers dll does not match the D3D12SDKVersion of D3D12 Core dll). XCL dropped each GPU's error, logged WARP's alone (could not create a D3D12 device (D3D12 device (WARP): The parameter is incorrect. (0x80070057))) and went on with the fallback device. So on such a machine test_title_draws_with_a_root_signature_under_the_debug_layer fails with twelve [FAIL] lines from the test title (eleven D3D12.X: …, one DirectStorage) and exit 0xc0000409, on main as on any branch, and a title run with the debug layer draws nothing without saying why.

It happens after Windows Update moves the inbox D3D12Core.dll on while the Graphics Tools optional feature keeps its older d3d12SDKLayers.dll (here 10.0.26100.10068 against 10.0.26100.1).

What is in it

  • D3D12.X: say why no GPU made a device with the debug layer on – hle/d3d12x/real.rs: each GPU's create_device error is logged before WARP is tried; with the debug layer on and no GPU device, one warning names the d3d12SDKLayers.dll beside the loaded D3D12Core.dll and both versions, and says what to do. gpu/recomp/dxc.rs: file_version is pub(crate) for that (dxc.rs is a translator source, so the translated cache is rebuilt once). tests/e2e.rs: the debug-layer test skips on that warning, as it does without the layer.

Tested

  • NVIDIA GeForce RTX 4090 (driver 621.01, 32-lane waves), AMD Ryzen 7 9800X3D, 32 GB RAM, Windows 11 Pro 10.0.26300 (inbox D3D12Core 10.0.26100.10068, Graphics Tools d3d12SDKLayers 10.0.26100.1), Rust 1.98.1 MSVC, DXC 1.9.2602.17; debug for the suite, release for the runs.
  • The cause: an OutputDebugString capture during the debug-layer test title's run shows D3D Error 887a002d: … D3D12 SDKLayers dll does not match the D3D12SDKVersion of D3D12 Core dll. once per device attempt.
  • cargo test -p xcl --test e2e: on main 930e8b4 2 passed, 1 failed (this test); with this change 3 passed, the debug-layer test printing SKIPPED … no GPU made a device with the debug layer on. The log line it skips on:
    D3D12: with the debug layer on (XCL_D3D12_DEBUG) no GPU made a device; the usual cause is a debug layer of another SDK version than the D3D12 runtime (d3d12SDKLayers.dll 6.2.26100.1 (C:\WINDOWS\SYSTEM32\d3d12SDKLayers.dll); D3D12Core.dll 6.2.26100.10068 (C:\WINDOWS\SYSTEM32\D3D12Core.dll)) – update the Graphics Tools optional feature, or run without XCL_D3D12_DEBUG
  • cargo build --workspace + cargo test --workspace --no-fail-fast -- --test-threads=4 on 4394201 (the same tree as this PR's head 9274ac3, which only has another author): 751 passed, 0 failed, 41 ignored. SKIPPED: gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware (no wave64), set_predication_buffer_state_and_kickoff ("no GPU": it sets XCL_D3D12_DEBUG=1 itself, so it gets no device here for the same reason; with this change its output carries the warning), and the debug-layer test as above. On main 930e8b4 this test fails as described above (cargo test -p xcl --test e2e: 2 passed, 1 failed, twelve [FAIL] lines); the full suite was not rerun there.
  • With a debug layer that matches the runtime, the test runs as before: @futurepro62's full-suite run of 9274ac3 below (RTX 5070 Ti, debug layer installed): 751 passed, 0 failed, only the two wave64 tests SKIPPED.

Regression run

Both runs sit at the title's start screen without input, so both show the commit growth of #1307 (fixed by #1321), on main as here.

main:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 4090
title: DUMP
seconds: 60
exit: 0x0
frames shown: 1636 (PresentX 1636)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 89484 MB

PR:

xcl-smoke v1
commit: 9274ac3205fa9ecb46c165cf106f546fea2d2b47
gpu: NVIDIA GeForce RTX 4090
title: DUMP
seconds: 60
exit: 0x0
frames shown: 1584 (PresentX 1585)
presents per 2 s (last 3): 60 40 55
device removals: 0
crashes: 0
peak commit: 94125 MB

Not tested

  • AMD and Intel GPUs. An Agility SDK runtime with its own d3d12SDKLayers.dll.
  • Going on without the debug layer instead of with the fallback device (the layer stays on in the process once enabled; a separate ID3D12DeviceFactory might allow it, not tried).

AI use

  • Claude Code (Claude Opus 5.5) found the cause, wrote the change and the test change, ran the builds, tests and runs on my PC, and drafted this description.

With XCL_D3D12_DEBUG a debug layer of another SDK version than the D3D12
runtime makes every device fail with E_INVALIDARG; only the runtime's debug
output names the cause (887a002d, "D3D12 SDKLayers dll does not match the
D3D12SDKVersion of D3D12 Core dll"). XCL dropped each GPU's error, logged
WARP's alone and went on with the fallback device, so the debug-layer e2e
test failed with twelve D3D12.X failures in the test title.

Each GPU's error is now logged before WARP is tried, and with the debug layer
on a warning names both DLLs and their versions. The e2e test skips on that
warning. Seen on Windows 11 26300 with the inbox D3D12Core 10.0.26100.10068
(Windows Update) beside the Graphics Tools' d3d12SDKLayers 10.0.26100.1.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Anon64

Anon64 commented Nov 24, 2026

Copy link
Copy Markdown

Regression run for this PR: head 9274ac3, based on main 930e8b4. RTX 3060 12 GB (581.80, wave32), Windows 11 26200, release, XCL_NETWORK=0, A pressed every 4 s from 20 s, scripts/smoke.ps1 on a retail title for 60 s.

main 930e8b4:

xcl-smoke v1
commit: 930e8b49c1c2ec683d22c724a398b39111cd0e56
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1537 (PresentX 1537)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 92236 MB

this PR:

xcl-smoke v1
commit: 9274ac3205fa9ecb46c165cf106f546fea2d2b47
gpu: NVIDIA GeForce RTX 3060
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1581 (PresentX 1581)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 90927 MB

No device removals or crashes; 103 % of main's frames, 99 % of its peak commit.

Peak commit in both runs is mostly the pipeline preload's DXC compiles on this machine (#1035; 23 GB on main with XCL_PSO_PRELOAD=0), so it varies run to run.

Not tested: the whole suite; whether the title reaches the changed code in these 60 s.

Written with Claude Code (Claude Opus 5.5) from runs on this machine.

@futurepro62

futurepro62 commented Nov 24, 2026 •

Copy link
Copy Markdown

Full-suite run, since this PR has no test report yet. Tested exact head 9274ac3 (on its base 930e8b4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 616.64, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.100.0 MSVC, debug, D3D12 debug layer installed.
  • cargo build --workspace, then XCL_REQUIRE_GPU=mesh cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored. SKIPPED (no wave64): gpu_geometry_wave32_prefix_count_over_a_mask, gpu_wave32_program_in_wave64_hardware.
  • No new #[test] functions in the diff.
  • Same head on the AMD Radeon iGPU of the 9800X3D (RDNA2, XCL_ADAPTER=radeon), cargo test --workspace -- --test-threads=4: 751 passed, 0 failed, 41 ignored, no skips.

Not tested

  • a release build, a game (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.

@DavidM1911

Copy link
Copy Markdown
Contributor

Verification on RTX 3060 Ti (Windows 11), branch merged with current main:

  • cargo test -p xcl --lib: all passed, 0 failed, ~21 ignored. (Intermittent single-test flake / 0xc0000005 abort under parallel scheduling; clean on single-threaded rerun — same flake seen on unmodified main.)

Thanks!

@throny

throny commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Two contributors checked independently and found that #653 solves the same problem in a different way: #1607, group D43. You may want to compare them with the other author and agree on one, or say in the PR why both are needed.

This is a hint, not a request from the maintainers; nobody from the project has adopted #1607 so far.

AI use: Claude Code (Claude Opus 5.5), posted by a script from the #1607 table.

brandostrong added a commit to brandostrong/xcl that referenced this pull request Nov 25, 2026
…ssage ids

A run that picked up new validation errors looked clean in the block: frames
and peak commit say nothing about them, and the log's per-id cap hides how
often each one fired. smoke.ps1 prints `debug layer messages: 538x5151 745x5307`
from report.json (n/a when the layer was off, none when there were none) and
pr_check.py refuses a PR whose run shows ids main's run did not; ids main's run
showed and the PR's no longer shows are a fix, not a problem.

-DebugLayer turns the layer on for the run so the line has ids in it. It is a
switch and not the default: with the layer requested and no Graphics Tools
device creation can fail outright (xcl-dev#1444), so forcing it would break smoke runs
there. Both runs of a pair get it; blocks without the line still pass.

Co-Authored-By: Claude Code <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants