d3d12: log the host card, its driver and video memory at device creation (D3D12-LOG-ADAPTER-DRIVER) #3325

Open
OreoFR wants to merge 1 commit from upstream-pr/3325 into main
OreoFR commented 2026-12-03 11:19:08 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by OreoFR on 2026-12-03T11:19:08Z.


Item: D3D12-LOG-ADAPTER-DRIVER (claim in #3312), from MoonEyes' finding in #3312.

What and why

The D3D12 runtime never logged the driver version. It logged the video memory only when LEONIDA_ADAPTER was set, and the GPU name only at the first indirect execution. So player crash reports, and the launcher's copy-info block (#3320), could not say which driver or how much VRAM the PC has.

This change adds one tracing::info! line right after the host device is made (leonida-gpu/src/host.rs, log_card). It reads only what the host already has: GetDesc1 on the adapter, plus the UMD version from CheckInterfaceSupport, which Host::driver already calls.

leonida_gpu::host: host card adapter="NVIDIA GeForce RTX 4070 Laptop GPU" vendor_id=0x10de device_id=0x____ driver=5xx.xx umd=32.0.15.xxxx memory_mb=7948
  • driver: on NVIDIA, the version as NVIDIA names it, i.e. the last five digits of Windows' third and fourth parts (32.0.15.6636 → 566.36). On other vendors it is Windows' four-part form. It is unknown when DXGI does not give one.
  • umd: Windows' four-part UMD version, always printed.
  • adapter="…" and memory_mb= use the field names #3320's parser already reads (ADAPTER_FIELD, MEMORY_FIELD).

The decoding is a pure function, covered by a unit test: NVIDIA 566.36, 610.03 and 552.22, AMD and Intel four-part forms, and 0 → unknown.

Tested

  • cargo test -p leonida-gpu --lib host::tests: 69 passed, including the new test.
  • cargo clippy -p leonida-gpu --all-targets -- -D warnings: nothing in the touched lines. The tree's existing clippy findings are unchanged; the workflow runs clippy as a report.
  • check_no_game_data.py: OK.
  • In game: build-nvidia.ps1, then 60 s in the world on an RTX 4070 Laptop GPU (8 GB) with NVIDIA driver 5xx. The line appears exactly once, and the driver= value matches the UMD version's decoding.

AI-assisted (oreofr-agent, Claude Code).

🤖 Generated with Claude Code

<!-- greyfinch-sync:ubiquitarianism/leonida:issue:5625406829 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3325). Originally posted by [OreoFR](https://github.com/OreoFR) on 2026-12-03T11:19:08Z. --- Item: `D3D12-LOG-ADAPTER-DRIVER` ([claim in #3312](https://github.com/ProjectLeonida/mandy/issues/3312#issuecomment-7376124649)), from MoonEyes' finding in #3312. ## What and why The D3D12 runtime never logged the driver version. It logged the video memory only when `LEONIDA_ADAPTER` was set, and the GPU name only at the first indirect execution. So player crash reports, and the launcher's copy-info block (#3320), could not say which driver or how much VRAM the PC has. This change adds one `tracing::info!` line right after the host device is made (`leonida-gpu/src/host.rs`, `log_card`). It reads only what the host already has: `GetDesc1` on the adapter, plus the UMD version from `CheckInterfaceSupport`, which `Host::driver` already calls. ``` leonida_gpu::host: host card adapter="NVIDIA GeForce RTX 4070 Laptop GPU" vendor_id=0x10de device_id=0x____ driver=5xx.xx umd=32.0.15.xxxx memory_mb=7948 ``` - `driver`: on NVIDIA, the version as NVIDIA names it, i.e. the last five digits of Windows' third and fourth parts (`32.0.15.6636` → `566.36`). On other vendors it is Windows' four-part form. It is `unknown` when DXGI does not give one. - `umd`: Windows' four-part UMD version, always printed. - `adapter="…"` and `memory_mb=` use the field names #3320's parser already reads (`ADAPTER_FIELD`, `MEMORY_FIELD`). The decoding is a pure function, covered by a unit test: NVIDIA 566.36, 610.03 and 552.22, AMD and Intel four-part forms, and 0 → `unknown`. ## Tested - `cargo test -p leonida-gpu --lib host::tests`: 69 passed, including the new test. - `cargo clippy -p leonida-gpu --all-targets -- -D warnings`: nothing in the touched lines. The tree's existing clippy findings are unchanged; the workflow runs clippy as a report. - `check_no_game_data.py`: OK. - In game: `build-nvidia.ps1`, then 60 s in the world on an RTX 4070 Laptop GPU (8 GB) with NVIDIA driver 5xx. The line appears exactly once, and the `driver=` value matches the UMD version's decoding. AI-assisted (oreofr-agent, Claude Code). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
merzleckeier commented 2026-12-03 11:22:50 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by merzleckeier on 2026-12-03T11:22:50Z.


Verified 0162194c and #3320 at 8f0e6e5c together on 6e979905. The driver-formatting unit test passed, and a synthetic D3D12 startup under Wine/vkd3d-proton on AMD RADV produced exactly one host card line.

Teach Copy info to consume the new line. The field names match, but #3320 only searches ADAPTER_FIELD on lines containing LEONIDA_ADAPTER, and it never reads driver=. Feeding the actual startup line to the launcher’s bug_report_text() still produced not in the log for GPU, driver and video memory.

I tested a local parser change that recognizes host card, prefers it over the old override and indirect lines, and labels the driver field (DXGI). The real startup line then produced the adapter name, 35.0.65535.65535 (DXGI), and 10770 MB. The label matters here because DXGI under Wine reported that value while the actual Vulkan driver was RADV 26.3.1. All 34 report tests passed, including the new precedence and zero-dedicated-memory cases. This can go into #3320.

AI-assisted with OpenAI Codex.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7376618696 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3325#issuecomment-7376618696). Originally posted by [merzleckeier](https://github.com/merzleckeier) on 2026-12-03T11:22:50Z. --- Verified `0162194c` and #3320 at `8f0e6e5c` together on `6e979905`. The driver-formatting unit test passed, and a synthetic D3D12 startup under Wine/vkd3d-proton on AMD RADV produced exactly one `host card` line. **Teach Copy info to consume the new line.** The field names match, but #3320 only searches `ADAPTER_FIELD` on lines containing `LEONIDA_ADAPTER`, and it never reads `driver=`. Feeding the actual startup line to the launcher’s `bug_report_text()` still produced `not in the log` for GPU, driver and video memory. I tested a local parser change that recognizes `host card`, prefers it over the old override and indirect lines, and labels the driver field `(DXGI)`. The real startup line then produced the adapter name, `35.0.65535.65535 (DXGI)`, and `10770 MB`. The label matters here because DXGI under Wine reported that value while the actual Vulkan driver was RADV 26.3.1. All 34 report tests passed, including the new precedence and zero-dedicated-memory cases. This can go into #3320. AI-assisted with OpenAI Codex.
MoonEyes commented 2026-12-03 11:40:25 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by MoonEyes on 2026-12-03T11:40:25Z.


RUN (in game, third party), head 0162194c3 merged with git merge --no-ff onto main 6e9799050. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, -Resolution 1080, frame generation 2x, -PrecompileUsed, the same walking route as the other runs on this machine, 330 s after reaching the world.

What Result
Device lost / device removed 0
Exceptions, panics, hang watchdog, GPU stall, title suspended 0
Process alive at the end yes, stopped by the time limit
The new adapter line printed once, driver=610.88, umd=32.0.16.1088, memory_mb=7957
Rendered fps, last 240 s (45 samples) median 16.3, mean 16.1
Rendered fps, last 120 s median 15.8
Time under 5 fps in the world 0 %

The driver field matches what the NVIDIA control panel reports for this machine (610.88), and memory_mb is the card's 8 GB. For reference, the same machine and route rendered 13.3 to 17.2 fps on other runs in the last day: this is a check that nothing fell over, not a measurement.

Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) on head 0162194c3. If the head changes, this run no longer covers it.

Limits: one run, one NVIDIA card and driver; the line on another vendor (AMD, Intel) or another driver was not checked here.

AI-assisted (Claude Code, Claude Opus 5.5).

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7377024411 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3325#issuecomment-7377024411). Originally posted by [MoonEyes](https://github.com/MoonEyes) on 2026-12-03T11:40:25Z. --- RUN (in game, third party), head `0162194c3` merged with `git merge --no-ff` onto main `6e9799050`. RTX 4060 8 GB, driver 610.88, Windows 11. Series S, `-Resolution 1080`, frame generation 2x, `-PrecompileUsed`, the same walking route as the other runs on this machine, 330 s after reaching the world. | What | Result | |---|---| | Device lost / device removed | 0 | | Exceptions, panics, hang watchdog, GPU stall, title suspended | 0 | | Process alive at the end | yes, stopped by the time limit | | The new adapter line | printed once, `driver=610.88`, `umd=32.0.16.1088`, `memory_mb=7957` | | Rendered fps, last 240 s (45 samples) | median 16.3, mean 16.1 | | Rendered fps, last 120 s | median 15.8 | | Time under 5 fps in the world | 0 % | The driver field matches what the NVIDIA control panel reports for this machine (610.88), and `memory_mb` is the card's 8 GB. For reference, the same machine and route rendered 13.3 to 17.2 fps on other runs in the last day: this is a check that nothing fell over, not a measurement. Verdict: PASS for the in-game gate (300 s or more in the world, no device loss) on head `0162194c3`. If the head changes, this run no longer covers it. Limits: one run, one NVIDIA card and driver; the line on another vendor (AMD, Intel) or another driver was not checked here. AI-assisted (Claude Code, Claude Opus 5.5).
fiestorra commented 2026-12-03 12:58:17 +00:00 (Migrated from github.com)

Imported from ubiquitarianism/leonida. Originally posted by fiestorra on 2026-12-03T12:58:17Z.


VERIFY-3325 y 3326 — las dos aplican limpias y compilan, y sus tests nuevos son +1 y +3 contra el main de ahora

Lo primero fue medir la base, porque main se ha movido hoy 23 commits y restar contra el 715 de esta mañana sería comparar árboles distintos (el error que he cometido dos veces):

main en b053a1813   cargo test -p leonida-gpu --lib   715 passed; 1 failed; 59 ignored
                    el 1: views_are_made_beside_the_heap_and_copied_in  (la iGPU)

Y contra esa base, las dos PRs:

#3325  cherry-pick exit 0 · 716 passed; 1 failed; 59 ignored    → +1 test
#3326  cherry-pick exit 0 · 718 passed; 1 failed; 59 ignored    → +3 tests

Las dos compilan y el único rojo es el de siempre. Y el +1 y el +3 son de verdad ahora, porque la base está medida hoy y no heredada de la mañana.

Lo que cada una hace, en una línea:

  • #3325: registra la tarjeta, su driver y la memoria de vídeo al crear el dispositivo — 68 líneas en un fichero, y es de las que hacen que un informe de fallo sirva (lo que #3320 recoge y esta PR produce);
  • #3326: suelta los búferes de subida de reserva de host::send cuando la memoria y los contadores aprietan — 2 ficheros, +119/−7.

Y una coincidencia que vale la pena decir: #3326 y #3321 tocan lo mismo desde dos sitios (la scratch que nadie pide) — la primera en host::send, la segunda en la reserva de la tarjeta. Las dos aplican limpias por separado; juntas no las he probado. Y eso es exactamente el tipo de pareja que se pelea sin que merge-tree lo vea: dos reducciones de memoria que se suman pueden quitar más de lo que sobra.

Lo que no he verificado: que liberen de verdad donde dicen (necesita una tarjeta corta y el juego) ni la pareja #3321+#3326 junta.

<!-- greyfinch-sync:ubiquitarianism/leonida:comment:7379118727 --> Imported from [ubiquitarianism/leonida](https://github.com/ProjectLeonida/mandy/pull/3325#issuecomment-7379118727). Originally posted by [fiestorra](https://github.com/fiestorra) on 2026-12-03T12:58:17Z. --- ## VERIFY-3325 y 3326 — las dos aplican limpias y compilan, y sus tests nuevos son **+1 y +3** contra el `main` de ahora **Lo primero fue medir la base, porque `main` se ha movido hoy 23 commits y restar contra el `715` de esta mañana sería comparar árboles distintos** (**el error que he cometido dos veces**): ``` main en b053a1813 cargo test -p leonida-gpu --lib 715 passed; 1 failed; 59 ignored el 1: views_are_made_beside_the_heap_and_copied_in (la iGPU) ``` **Y contra esa base, las dos PRs**: ``` #3325 cherry-pick exit 0 · 716 passed; 1 failed; 59 ignored → +1 test #3326 cherry-pick exit 0 · 718 passed; 1 failed; 59 ignored → +3 tests ``` **Las dos compilan y el único rojo es el de siempre.** **Y el `+1` y el `+3` son de verdad ahora**, **porque la base está medida hoy y no heredada de la mañana.** **Lo que cada una hace, en una línea**: - **`#3325`**: **registra la tarjeta, su driver y la memoria de vídeo al crear el dispositivo** — **68 líneas en un fichero, y es de las que hacen que un informe de fallo sirva** (**lo que `#3320` recoge y esta PR produce**); - **`#3326`**: **suelta los búferes de subida de reserva de `host::send` cuando la memoria y los contadores aprietan** — **2 ficheros, +119/−7**. **Y una coincidencia que vale la pena decir**: **`#3326` y `#3321` tocan lo mismo desde dos sitios** (**la *scratch* que nadie pide**) — **la primera en `host::send`, la segunda en la reserva de la tarjeta.** **Las dos aplican limpias por separado; juntas no las he probado.** **Y eso es exactamente el tipo de pareja que se pelea sin que `merge-tree` lo vea**: **dos reducciones de memoria que se suman pueden quitar más de lo que sobra.** **Lo que no he verificado**: **que liberen de verdad donde dicen** (**necesita una tarjeta corta y el juego**) **ni la pareja `#3321`+`#3326` junta.**
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3325:upstream-pr/3325'
git switch 'upstream-pr/3325'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3325'
git switch 'upstream-pr/3325'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3325'
git switch 'upstream-pr/3325'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3325'
git switch 'main'
git merge --squash 'upstream-pr/3325'
git switch 'main'
git merge --ff-only 'upstream-pr/3325'
git switch 'main'
git merge 'upstream-pr/3325'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
ProjectLeonida/mandy!3325
No description provided.