d3d12: log the host adapter selected by the device #2948
Code
Clone this repository
Checkout
From your project repository, check out a new branch and test the changes.
git fetch -u origin "github-pr/2948:github-pr/2948" git switch "github-pr/2948"
Open
leonida/mandy
wrexik wants to merge 4 commits from
github-pr/2948 into main
pull from: github-pr/2948
merge into: leonida:main
leonida:main
leonida:github-pr/3295
leonida:beta
leonida:docs/changelog-3483-3500
leonida:github-pr/3294
leonida:github-pr/2975
leonida:github-pr/2815
leonida:feat/gate-driver-start
leonida:feat/skip-pipelines-release
leonida:perf/lazy-compare
leonida:perf/mwaitx-wait
leonida:test/prio-ceiling-main
leonida:fix/ab-cpu-stdout
leonida:fix/gate-old-crashes
leonida:diag/ab-cpu
leonida:test/main-0312
leonida:github-pr/3291
leonida:diag/indirect-clamp-census
leonida:feat/barrier-enhanced
leonida:perf/texture-frame-ceiling
leonida:perf/dstorage-threads
leonida:fix/console-queue-dma-tables
leonida:fix/port-descriptors-record-parts
leonida:fix/frame-waits-fence
leonida:fix/console-sampler-words
leonida:fix/graphics-userdata-spill
leonida:fix/xg-reserved-layout-rotation
leonida:fix/barrier-console-flags
leonida:fix/switches-wait-test-child
leonida:test/list-value-waits
leonida:test/lot-gxdk-0412
leonida:fix/bvh-compacted-size
leonida:docs/i18n-quickstarts
leonida:feat/native-pipeline-slots
leonida:fix/clippy-leonida-gpu
leonida:fix/list-value-producers
leonida:fix/descriptor-page-straddle
leonida:fix/xmem-low-window
leonida:fix/ffx-jitter-never-zero
leonida:fix/run-stdout-closed
leonida:github-pr/2892
leonida:github-pr/2896
leonida:feat/warm-save-every
leonida:github-pr/2980
leonida:github-pr/2994
leonida:github-pr/3005
leonida:github-pr/3010
leonida:github-pr/3136
leonida:github-pr/3303
leonida:github-pr/3220
leonida:github-pr/3143
leonida:github-pr/3330
leonida:github-pr/3226
leonida:github-pr/3187
leonida:carry/3395
leonida:github-pr/2946
leonida:github-pr/2947
leonida:github-pr/2945
leonida:github-pr/2983
leonida:github-pr/3001
leonida:github-pr/3372
leonida:github-pr/3128
leonida:github-pr/3296
leonida:github-pr/2588
leonida:github-pr/3119
leonida:github-pr/3378
leonida:fix/crash-diagnostics
leonida:feat/dlss-mip-bias
leonida:fix/retired-out-of-order
leonida:fix/dxr-postbuild-barrier
leonida:fix/amd-relay-default
leonida:fix/removed-report-wait
leonida:feat/heap-twin
leonida:feat/vram-margin
leonida:github-pr/2472
leonida:github-pr/3123
leonida:github-pr/3088
leonida:assets/annonce-v1
leonida:github-pr/2794
leonida:github-pr/3300
leonida:github-pr/3304
leonida:github-pr/3308
leonida:github-pr/3367
leonida:github-pr/3369
leonida:fix/launcher-dlss-diagnostics
leonida:github-pr/3269
leonida:github-pr/2957
leonida:github-pr/3205
leonida:fix/crash-zero-guard
leonida:github-pr/3185
leonida:github-pr/3099
leonida:github-pr/3104
leonida:github-pr/3348
leonida:github-pr/3379
leonida:github-pr/3377
leonida:perf/darner-title-priority-ceiling
leonida:github-pr/3376
leonida:gh-readonly-queue/main/pr-3311-b5c45b663dbc5a9c3532bb3f307e5f81b32faefa
leonida:gh-readonly-queue/main/pr-3088-af22e7847ff5808f72d1a1881c24be2fafd20b54
leonida:gh-readonly-queue/main/pr-3123-7f3fa026a94c6646e89244f28e1ce22290361867
leonida:github-pr/3373
leonida:github-pr/3368
leonida:github-pr/3198
leonida:gh-readonly-queue/main/pr-3354-637baa0b77ba47222e7280b17c1a59c6a1781d57
leonida:gh-readonly-queue/main/pr-3365-d7a0e0196a43834813014b4bd3aa5502a8263b14
leonida:gh-readonly-queue/main/pr-3361-5dfe8bbd05ed12fb2f2e1718d9af77a7c5f46fd8
leonida:gh-readonly-queue/main/pr-3366-8da9148204e9d12c585efa9ac2b7cc1ab08c7682
leonida:github-pr/3346
leonida:github-pr/3375
leonida:github-pr/2958
leonida:github-pr/3151
leonida:github-pr/3307
leonida:github-pr/3278
leonida:github-pr/3374
leonida:fix/runtime-test-conservative-fixtures
leonida:github-pr/3366
leonida:ci/shard-semantic-linux
leonida:github-pr/3354
leonida:docs/fg-limit-fps-switch
leonida:github-pr/3365
leonida:fix/read-file-hard-link
leonida:github-pr/3364
leonida:fix/book-slot-heap-never-read
leonida:github-pr/3361
leonida:github-pr/3263
leonida:github-pr/3360
leonida:github-pr/3353
leonida:github-pr/3331
leonida:fix/alias-later-queued-submissions
leonida:github-pr/3352
leonida:github-pr/3228
leonida:github-pr/3349
leonida:claude/gallant-sagan-aamatr
leonida:github-pr/3200
leonida:github-pr/3132
leonida:github-pr/3323
leonida:github-pr/3332
leonida:github-pr/3340
leonida:github-pr/3311
leonida:github-pr/3334
leonida:github-pr/3297
leonida:github-pr/3256
leonida:github-pr/2567
leonida:github-pr/2851
leonida:d3d12/agility-sdk-621
leonida:github-pr/3164
leonida:github-pr/3114
leonida:github-pr/3050
leonida:github-pr/3113
leonida:github-pr/3326
leonida:github-pr/3144
leonida:github-pr/2642
leonida:github-pr/3072
leonida:github-pr/2789
leonida:github-pr/2643
leonida:github-pr/3009
leonida:github-pr/3035
leonida:github-pr/3031
leonida:github-pr/2686
leonida:github-pr/2834
leonida:github-pr/3321
leonida:github-pr/3325
leonida:github-pr/3290
leonida:github-pr/3324
leonida:github-pr/3130
leonida:claude/fervent-curie-m19lnr
leonida:github-pr/3309
leonida:github-pr/3305
leonida:github-pr/3306
leonida:github-pr/3302
leonida:github-pr/3301
leonida:github-pr/3345
leonida:github-pr/3211
leonida:github-pr/3027
leonida:github-pr/3286
leonida:github-pr/3235
leonida:github-pr/3265
leonida:github-pr/3275
leonida:codex/skip-no-hit-ray-passes
leonida:github-pr/2823
leonida:github-pr/2911
leonida:github-pr/3262
leonida:github-pr/3125
leonida:github-pr/3206
leonida:github-pr/3250
leonida:github-pr/3238
leonida:github-pr/3188
leonida:github-pr/2952
leonida:github-pr/3217
leonida:github-pr/3168
leonida:t3/preserve-fsr-sdk-restart-path
leonida:t3/propagate-host-failure-hresult
leonida:github-pr/3209
leonida:t3/launcher-custom-parameters
leonida:github-pr/3207
leonida:github-pr/3183
leonida:github-pr/3160
leonida:github-pr/3201
leonida:ci/less-to-run
leonida:github-pr/2930
leonida:github-pr/2797
leonida:github-pr/2999
leonida:perf/native-compute-shader-forms
leonida:github-pr/3191
leonida:github-pr/3011
leonida:github-pr/3019
leonida:github-pr/2996
leonida:gh-readonly-queue/main/pr-2789-45dc41f95c1cd0dcc29c2c50582e0e9af8a77259
leonida:claude/blissful-franklin-ukp7ag
leonida:github-pr/3141
leonida:github-pr/3156
leonida:github-pr/3150
leonida:github-pr/3153
leonida:github-pr/3163
leonida:github-pr/3142
leonida:github-pr/3139
leonida:github-pr/2841
leonida:github-pr/3069
leonida:github-pr/3098
leonida:github-pr/3107
leonida:github-pr/3071
leonida:github-pr/2774
leonida:github-pr/2889
leonida:github-pr/3075
leonida:github-pr/2661
leonida:github-pr/3064
leonida:github-pr/3054
leonida:github-pr/3049
leonida:github-pr/2855
leonida:github-pr/2943
leonida:github-pr/3016
leonida:github-pr/2887
leonida:github-pr/3006
leonida:github-pr/3003
leonida:github-pr/2993
leonida:notes/card-time-and-plant-flicker
leonida:github-pr/2989
leonida:feat/vulkan-rs
leonida:github-pr/2985
leonida:github-pr/2951
leonida:github-pr/2982
leonida:github-pr/752
leonida:github-pr/792
leonida:github-pr/2877
leonida:github-pr/2654
leonida:github-pr/2893
leonida:github-pr/2944
leonida:github-pr/2919
leonida:github-pr/2915
leonida:archive/ci/less-to-run/20261202T1121Z
leonida:github-pr/2800
leonida:github-pr/2822
leonida:github-pr/2833
leonida:github-pr/2840
leonida:github-pr/2831
leonida:github-pr/2832
leonida:github-pr/2801
leonida:github-pr/2890
leonida:github-pr/2891
leonida:github-pr/2664
leonida:github-pr/2807
leonida:rt-call-trace
leonida:github-pr/2755
leonida:perf/ahead-split
leonida:github-pr/2587
leonida:github-pr/2698
leonida:github-pr/2609
leonida:github-pr/3219
leonida:docs/readme-runtime-proposal
leonida:github-pr/2017
leonida:github-pr/1741
leonida:github-pr/1667
leonida:codex/coord-claim-check-20261124-7e48
No reviewers
Assignees
Clear assignees
No assignees
Labels
Clear labels
bug
Something isn't working
dependencies
Pull requests that update a dependency file
documentation
Improvements or additions to documentation
enhancement
New feature or request
missing claim
Needs a claim in #14
needs rebase
Conflicts with the base branch: rebase it on main
needs-triage
Needs maintainer evaluation before the next triage state
question
Further information is requested
ready-for-agent
Fully specified and ready for an AFK agent
submodules
Pull requests that update submodules code
No labels
bug
dependencies
documentation
enhancement
missing claim
needs rebase
needs-triage
question
ready-for-agent
submodules
Projects
Clear projects
No items
No project
Milestone
Clear milestone
No items
No milestone
Dependencies
No dependencies set
Notifications
1 participant
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
leonida/mandy!2948
Loading…
Reference in a new issue
No description provided.
Delete branch "github-pr/2948"
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?
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
Reviewers 0 approvals
Details
This pull request has changes conflicting with the target branch.
Merge manually to resolve the conflicts.
d3d12/crates/leonida-gpu/src/host.rsView command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.Claimed in the coordination issue: D3D12-HOST-GPU-ADAPTER-STARTUP-DIAGNOSTIC
What and why
After creating the host D3D12 device, identify its adapter by the device LUID and log the adapter name, hardware/software classification, vendor and device IDs, and dedicated video memory. Log DXGI errors if adapter lookup or description fails. This improves startup diagnostics for reports such as #2914; it does not fix or close that issue.
Tested
d3d12/:cargo test -p leonida-gpu host::tests::adapter_details_report_name_class_ids_and_video_memory --locked— passed (1 test).python -I scripts/check_no_game_data.py— passed.git diff --check origin/main...HEAD— passed.python -I scripts/red_green.py HEAD --base origin/main --no-fetch --crate leonida-gpu --json— returnedgreen fails: the red test-only build cannot compile becauseAdapterDetailsdoes not exist onorigin/main; the green full-crate run failed the alias-cast integration test during parallel execution. That test passed in isolation on currentorigin/mainand the feature branch withcargo test -p leonida-gpu --locked committed_and_placed_r32_uint_textures_cast_to_r9g9b9e5_under_legacy_barriers(1 test each).d3d12/:cargo fmt --all -- --check— failed on pre-existing workspace formatting differences; no unrelated formatting changes are included.GPUs tested: n/a (synthetic DXGI descriptor test only; no GPU or game-copy test was run).
AI-assisted: yes — Copilot Auto (underlying model unavailable); reviewer model not surfaced.
Checklist
mainand merges cleanly.Could an independent maintainer please approve the pending GitHub Actions runs for this PR? The D3D12 runtime, No Game Data, and CI runs are all ction_required with no jobs started, and no checks are reported yet. I have not attempted to approve or bypass these workflow gates.
Live selected-adapter diagnostic check on Wine on
5284c6eamerged intobc332322e. I captured the original tracing events around actual D3D12 host creation. Thirty successful hardware starts across control and PR checked that the selected DXGI descriptor LUID matched the D3D12 device LUID. In all 15 PR hardware starts, the new event occurred once before device-ready and its name, class, IDs and dedicated-memory field matched a direct DXGI query. Control emitted the existing ready event only.With both Vulkan ICDs exposed,
LEONIDA_ADAPTERselected the requested device on both trees. The PR printedRTX 4070 SUPER,10de:2783, 12,282 MiB for NVIDIA, andAMD Radeon(TM) Graphics,1002:164e, 512 MiB for the iGPU. With DXVK NVIDIA hiding enabled, the physical card was still the RTX 4070 SUPER and the event correctly reflected DXGI’s1002:73dfdescriptor. These are DXGI-reported fields. The six no-ICD starts produced no adapter event, and the stock formatter test passed including the simulated software flag. A working WARP device and post-creation query errors were outside this run.MEASURED with Win64 Wine 11.22, VKD3D-Proton 3.1.0, NVIDIA 620.73.4 and RADV 26.3.1. Synthetic inputs, OpenAI Codex and a separate read-only review.
Verified the selected-adapter diagnostic on native Windows with NVIDIA driver 616.92. I built base
1e3e316c5and PR head5284c6eaewith the same diagnostics profile. On each I ranleonida.exe warm --limit 0with an empty cache, once on the default device and once withLEONIDA_D3D12_WARP=1. All four processes initialized D3D12 and exited successfully. The base emitted zero structured adapter reports. The PR emitted exactly one per process.The hardware name and PCI IDs agree with nvidia-smi. Its memory total was 12,227 MiB, so the logged field should be read as the DXGI descriptor value. The PR's exact
host::tests::adapter_details_report_name_class_ids_and_video_memorytest also passed (1/1). This covers both device selections with no game files. I did not exercise DXGI lookup failures.Coordination claim. AI-assisted with OpenAI Codex (GPT-6).
Run the workflows @KelboLive
This pull request touches the render path, so it needs an in-game run before it can be merged: unit tests and CI do not catch rendering regressions (a device loss after an earlier merge is why this gate exists).
Could you, or anyone with a working setup, post a run report on the current head merged onto current
main:mainSHA it was merged onto;mainalone for comparison, if you can.Please do not attach logs or screenshots that show game content. If a run on this exact head is already posted, a link to it in a reply is enough.
AI-assisted (Claude Code).
Verification of #2948 (third party, code review on Linux; not built: Windows-only
leonida-gpu)5284c6eae7f765930ebab18dc5e929036a2a3bc6(1 file,d3d12/crates/leonida-gpu/src/host.rs, +77/-3).1e3e316c5.git merge-tree --write-tree origin/main pr/2948againstmain45dc41f95is clean(340 commits behind).
action_required).python -I scripts/check_no_game_data.py d3d12/crates/leonida-gpu/src/host.rs: exit 0.Review
host.rs:1565-1573: the adapter is found by the device's LUID, as before, and only the logging is new. Onfailure,
adapteris stillNoneas onmain, so behaviour is unchanged. Startup cost: oneGetDesc1and onetracing::info!, called once.adapter_details(:1606-1621) trimsDescriptionat the first NUL, classifies withDXGI_ADAPTER_FLAG_SOFTWARE, and reports MiB. This is correct. The unit test (:1834-1855) covers name, ids,memory and the software flag.
mainalready logs the chosen card whenLEONIDA_ADAPTERis set(
host.rs:1632, "host device on the card LEONIDA_ADAPTER names"). This PR adds the line for the default-adaptercase, which is what #2914 and #3011 need. That is fine, but with
LEONIDA_ADAPTERset there are now two adapterlines. Not blocking.
the event fires once and the LUID matches.
Process
the specific models, including the reviewer agent, from the list for new code. This does not meet it.
Verdict: ready on review (not built here). It is blocked on CI that a maintainer needs to approve, on the
in-game gate run, and on a model disclosure that meets CONTRIBUTING.md.
AI-assisted verification: Claude Opus (Claude Code), separate agent per batch.
Generated by Claude Code
RUN (in game, batch of seventeen render-path pull requests), each head merged with
git merge --no-ffonto main3c106eb2f, in one build: #311115b579756, #29485284c6eae, #26981f188c4f7, #294644bf554fe, #3001d924cbb65, #28320c861595a, #291558e8535cf, #2822d359a2f85, #2896c9c6b103d, #29838278ef1b9, #3115ba5121192, #2945d2c08c14f, #297574512d658, #295126da88e8e, #2800b6ebcedd4, #28937c7e99b48, #3113fa1460b6b(and #30970d7a451ab, merged since). RTX 4060 8 GB, driver 610.88, Windows 11. Series S,-Resolution 1080, frame generation 2x, the same walking route as the other runs on this machine, 330 s after reaching the world.The drops under 5 fps line up with shaders being translated while walking (about 500 translations in the last 330 s): this batch changes the shader translation, so the shader cache built by earlier runs did not apply and the pipeline precompile alone took about 45 minutes. The batch-5 run on the same machine and route had no sample under 5 fps (median 16.4). I read this as cold-cache stutter, not as a regression of a single pull request, but this run cannot tell them apart.
Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) for this batch, on the heads listed above. If one of these pull requests changes its head, this run no longer covers it.
Limits: one run; arrival in the world was driven by keys and not checked on pictures. A first attempt of this batch is not counted: the run script gave up waiting for the game window after 40 minutes of precompile.
AI-assisted (Claude Code).
VERIFY-2948 — cherry-pick sobre
mainy 716/1, donde el 1 es el rojo de esta máquinaUn fichero,
host.rs+77, con un conflicto declarado contramain. Pero el conflicto es de merge, no del parche, así que lo medí como elAGENTS.mddel repositorio manda: cherry-pick del commit sobreorigin/main—El 1 es
descriptor::host::tests::views_are_made_beside_the_heap_and_copied_in, el de la iGPU, que enmainsin esta PR también falla. Y 716 contra los 715 demaines el test que este PR añade.Así que: aplica limpio, no rompe nada, y añade un test. Lo que el conflicto de
git merge-treedecía era cierto y era sobre el otro fichero del mismo tema —host.rstambién lo toca#3286, y por eso dos PRs que se llevan bien por separado chocan entre sí.Y el cambio es el que más falta hacía en una máquina como esta: registra en el log el adaptador que el dispositivo eligió — lo que convierte «los tests fallan en mi portátil» en un número que se puede leer. Es exactamente la información que me faltó durante media noche con el rojo de la iGPU, y por eso lo digo sin ironía: esto habría ahorrado una hora.
Lo que no verifiqué: el log de verdad en una máquina con dos adaptadores, porque el test comprueba la función que formatea la elección, no que se escriba en el
tracingdel proceso.Corrección de una frase mía en el comentario de arriba:
#2948no tiene conflictoEscribí «con un conflicto declarado contra
main» y era falso. Medido ahora:Y el único de los 32 viejos que choca es
#2958, no este. Confundí el fichero (host.rs, que también toca#3286) con un conflicto real, y son dos cosas distintas: dos PRs que tocan el mismo fichero chocan entre sí, no conmain.Lo que queda en pie del comentario: el cherry-pick aplica limpio, 716/1, el 1 es el de la iGPU, y el log del adaptador es la información que me faltó media noche.
Lo que se cae: la frase «pero el conflicto es de merge, no del parche» — no había tal conflicto que explicar. Y es el mismo error de forma que cometí con
#3209hace unas horas: describir el fichero que toqué, no el que choca.Integration check on
main516c9eaa, #29485284c6ea, and #32868c56cb6b. #2948 merges cleanly withmain. With #3286 there is one content conflict inHost::create, in the startup log block just afterdsv_size.I kept #2948’s LUID lookup and structured diagnostic there and #3286’s high-performance selection and fallback earlier in
create. The resulting code queries the device’s actual LUID regardless of how its adapter was selected. It passescargo xwin check -p leonida-gpu --testsforx86_64-pc-windows-msvcwith Rust 1.98.1. The Windows test binary’sadapter_details_report_name_class_ids_and_video_memoryalso passed under Wine.That was a local integration check with a synthetic descriptor. Adapter selection on hybrid hardware was outside this run. AI-assisted with OpenAI Codex.