Skip to content

D3D12.X: log adapter device creation failures - #653

Closed
vascomfduarte wants to merge 1 commit into
xcl-dev:mainfrom
vascomfduarte:fix/d3d12-adapter-error-logging
Closed

vascomfduarte wants to merge 1 commit into
xcl-dev:mainfrom
vascomfduarte:fix/d3d12-adapter-error-logging

Conversation

@vascomfduarte

@vascomfduarte vascomfduarte commented Nov 24, 2026 •

Copy link
Copy Markdown

What is in it

Log adapter-specific D3D12 device creation failures in crates/xcl/src/hle/d3d12x/real.rs.

Previously, failed device creation attempts were silently ignored. This change logs the adapter name and returned error without changing adapter selection or WARP fallback behavior.

Tested

Local validation — AMD RX 6700 XT

  • cargo check -p xcl — passed.
  • git diff --check — passed.
  • End-to-end tests — 3 passed in an earlier run.
  • Environment: AMD Radeon RX 6700 XT, Windows 10, Agility SDK v620.

Regression comparison

  • Baseline: 9ce2070.
  • PR head: d4c55a7.
  • Both runs: 641 passed, 3 failed, 21 ignored.
  • The same three failures occurred on both versions, with no additional failures introduced.

Pre-existing failures on the RX 6700 XT:

  • placed_title_textures_share_vram_and_preserve_pixels — 3D texture subresource 2 mismatch.
  • transitions_apply_when_their_list_is_submitted — PoisonError.
  • d32s8_targets_take_their_own_size_of_video_memory — PoisonError.

Independent validation — @Chrysana

  • Environment: AMD RX 9070 XT, Windows 11 25H2.
  • cargo test --workspace --no-fail-fast -- --test-threads=4 on d4c55a7 — 684 passed, 0 failed, 41 ignored.
  • Two debug-layer tests were skipped because the D3D12 debug layer was unavailable.
  • Retail-title smoke tests completed without crashes or device removals.
  • No adapter initialization warnings were emitted during successful GPU initialization.

Regression run

Retail-title smoke tests performed by @Chrysana on an AMD Radeon RX 9070 XT using scripts/smoke.ps1 for 60 seconds, with the same saved state and XCL_PRESS_A_AT=14,17,21.

Baseline — main (91f9a5e)

xcl-smoke v1
commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1153 (PresentX 1153)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17138 MB

PR head — d4c55a7

xcl-smoke v1
commit: d4c55a775ac7212af1a785c33ba5a723ae786382
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1520 (PresentX 1520)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17446 MB

Both runs reached the intro video, with no crashes or device removals.

Additional regression comparison — local merge onto newer main

Chrysana also tested a clean local merge of this PR onto main (91f9a5e).

Build Frames shown Peak commit
main (91f9a5e) 1,153 17,138 MB
PR merged (d974fba) — run 1 1,168 17,132 MB
PR merged (d974fba) — run 2 1,149 17,137 MB

No meaningful regression in frame count, memory usage or stability was observed.

Note: The original PR head (d4c55a7) is based on an older revision of main, so its higher frame count should not be attributed to the logging change. The local merge was not pushed.

All retail-title smoke results were produced by Chrysana, not on my own hardware.

Source: Chrysana's regression report

Not tested

  • Retail-title smoke tests on my own RX 6700 XT.
  • The actual adapter device creation failure path. The RX 9070 XT initialized successfully in the independent smoke tests.
  • Reproduction of the previously observed E_INVALIDARG failure caused by an incompatible d3d12SDKLayers.dll.
  • Optional XCL_SAMPLE_* tests (sample assets unavailable).
  • NVIDIA and Intel GPUs on my own hardware.

AI use

ChatGPT (GPT-6) and Codex assisted with debugging, code review, test analysis and PR preparation. I reviewed the code and validated the results from my own environment.

The independent tests and smoke runs were performed by @Chrysana on their own hardware, with assistance from Claude Code (Claude Opus 5.5) for test execution, log analysis and reporting.

@MonkeyPython

Copy link
Copy Markdown

Cross-vendor data point: the four tests reported failing on AMD are green on NVIDIA wave32 — they are not flaky fixtures.

Setup: Windows 11 Pro 26300, Ryzen 7 7800X3D, 32 GB, RTX 3080 Ti 12 GB (driver 621.01, wave32-only), main dd2ae9a, release, cargo test --workspace --release -- --test-threads=4: 690 passed / 0 failed / 41 ignored, 2 internal SKIPPED (the wave64 pair).

All four pass here:

  • hle::d3d12x::title_textures::tests::placed_title_textures_share_vram_and_preserve_pixels ... ok
  • hle::d3d12x::title_textures::tests::transitions_apply_when_their_list_is_submitted ... ok
  • hle::d3d12x::vram::tests::d32s8_targets_take_their_own_size_of_video_memory ... ok
  • gpu::recomp::tests::gpu_nonfused_mad_and_mac_prevent_fma_contraction ... ok

So the failures in this PR and in #602's author's RX 5700 XT report are vendor-specific (AMD), not test-instability. Also for the #650/#656 choice: hle::kernelx::tests::xmem_virtual_query_marks_cpu_readable_memory ... ok on this adapter at this commit.

Not tested: AMD GPUs (this host's Raphael iGPU is a separate, much smaller adapter).

AI use: Gentle Shell (Pi coding agent), model qwen4-max: ran the suite and wrote this report from its log; a human reviews it before posting. No code changes.

@MesshM

MesshM commented Nov 24, 2026

Copy link
Copy Markdown

Test run of d4c55a775ac7212af1a785c33ba5a723ae786382 on AMD RDNA4. I merged it onto current main 91f9a5e locally (clean merge) and tested that tree.

Tested

  • AMD Radeon RX 9060 XT 16 GB (RDNA4, native wave64), driver 32.0.32029.2010; Ryzen 7 5700X, 64 GB RAM, Windows 11 Pro build 26200, Rust 1.100.0 stable-x86_64-pc-windows-msvc, debug
  • cargo build --workspace + cargo test --workspace -- --test-threads=4 on the merge: 692 passed, 0 failed, 41 ignored, exit code 0; xcl lib tests 652 passed, 0 failed, 21 ignored
  • 0 SKIPPED; no test failed here.

Review: The three failures in the description (RX 6700 XT, on both versions) do not show up on RDNA4: the whole suite passes on this adapter. One thing to consider: on a machine with an adapter that cannot do feature level 12_0 (an old iGPU next to the discrete GPU), the new warning is logged at every start for an expected failure; logging it only when no adapter at all succeeds, or at info level, would keep it useful. Not a blocker.

Not tested: no retail title or regression run (I have no unpacked game), no XCL_SAMPLE_* tests, release build; the PR's head on its old base was not run, only its merge onto main.

Run and review by Claude Code (Claude Opus 5.5) on this machine; the review points were checked against the code.

@Chrysana

Copy link
Copy Markdown

Regression run for d4c55a7 on the retail title, which the description lists as not performed. AMD RDNA4: no regression, and no new warning when the GPU opens normally.

Setup: AMD Radeon RX 9070 XT 16 GB, driver 32.0.32015.2008 (the CPU's integrated Radeon is also present; XCL opened the RX 9070 XT first), Ryzen 7 9800X3D, 31 GB RAM, Windows 11 25H2 build 26200.9974, rustc 1.100.0 x86_64-pc-windows-msvc, DXC 1.9.2602.17, no Agility SDK. Retail title 1.0.2.1. Debug build for the tests, release builds for the runs.

Tests: cargo test --workspace --no-fail-fast -- --test-threads=4 at d4c55a7: 684 passed, 0 failed, 41 ignored. SKIPPED: the two debug-layer tests (the D3D12 debug layer isn't installed here).

Title runs: scripts/smoke.ps1 -Game <folder> -Seconds 60 with XCL_PRESS_A_AT=14,17,21, same saved state. d4c55a7 is 18 commits behind main, so it was also merged onto main 91f9a5e (clean, local merge d974fba, not pushed):

build frames peak commit
main 91f9a5e 1153 17138 MB
d4c55a7 merged onto 91f9a5e 1168, 1149 17132, 17137 MB
d4c55a7 (its own base 9ce2070) 1520 17446 MB
  • Every run above reached the intro video. A second main run stayed in the menus (1176 frames, the scripted presses came too early) and isn't compared.
  • No D3D12: failed to initialize GPU line in any run: the first adapter opened every time.
  • No crash or device removal in any run.

Regression run:

main:

xcl-smoke v1
commit: 91f9a5e9f03156ea82dc55a18f7704862da7a5db
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1153 (PresentX 1153)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17138 MB

PR merged onto main:

xcl-smoke v1
commit: d974fba935efd5c03c5d49790558bda5dbbd641a
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1168 (PresentX 1168)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17132 MB

PR head:

xcl-smoke v1
commit: d4c55a775ac7212af1a785c33ba5a723ae786382
gpu: AMD Radeon RX 9070 XT
title: retail-title
seconds: 60
exit: 0x0
frames shown: 1520 (PresentX 1520)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 17446 MB

Not tested: the failure path itself (no adapter failed here). It's the case this PR is for: earlier today a stale Graphics Tools d3d12SDKLayers.dll (10.0.26100.1 against D3D12Core 10.0.26100.9818) made every device fail with E_INVALIDARG under XCL_D3D12_DEBUG=1, and the log only showed WARP's error. That DLL has since been removed from this machine, so I couldn't rerun it.

AI use: Claude Code with Claude Opus 5.5 built the commits, ran the tests and the title runs, read the logs, and wrote this report. The runs were made on my machine.

@vascomfduarte

Copy link
Copy Markdown
Author

Thanks for running the smoke tests, @Chrysana! I've added the results to the PR description and the checks are now passing. Really appreciate the help!

@throny

throny commented Nov 24, 2026

Copy link
Copy Markdown
Collaborator

Two contributors checked independently and found that #1444 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.

@vascomfduarte

Copy link
Copy Markdown
Author

Two contributors checked independently and found that #1444 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.

Thanks for pointing this out and for reviewing both PRs.

I've compared the changes and agree that #1444 addresses the same issue as #653, with a more complete approach to error reporting and additional debug-layer diagnostics. I'll close #653 in favor of #1444 to avoid duplicate work.

Thanks to everyone involved in the review!

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