Repository navigation
d3d12: LEONIDA_WINDOWS_BAR_MB says once that it does nothing without resizable BAR (D3D12-BAR-WINDOWS-WARNING) - #2612
Conversation
…resizable BAR (D3D12-BAR-WINDOWS-WARNING) Title memory windows can only go to card memory the CPU maps when the card has GPU upload heaps (resizable BAR, and a system and driver that offer it). Without them the launcher still set 3072 on PCs under 48 GB of RAM and printed "up to 3 GB", and every window asked the card's budget (two QueryVideoMemoryInfo calls) before finding out the heap was not there. window_mapped_for now checks for that memory first and logs once that the cap does nothing. The launcher's line says the cap needs resizable BAR, and its header and the README give the real default (under 48 GB of RAM, a card of 6 GB or more) instead of "under 24 GB".
…e decision covers the off case (review) - The note is info, not a warning: the launcher sets the cap by default on PCs under 48 GB, so it shows on every one without resizable BAR. - It names the real condition (GPU upload heaps: resizable BAR, and a Windows and driver that offer them), as the doc comments do. - mapped_windows asks for support only when a cap is set, so its "off" case is the one the code takes, and the test checks that support is not asked. - The launcher's history comment and the README say "unless the card has under 6 GB" (an unknown size counts as large).
|
Independent device check of
Every case without mapped allocations also successfully made a buffer with the system-memory helper. The PR's The RTX 4070 SUPER control did not reach the test because DXVK could not initialize a Vulkan instance in this headless setup. I did not exercise native Windows or the PowerShell launcher. AI-assisted with OpenAI Codex (GPT-6). |
|
Independent native Windows 11 + AMD Radeon RX 7900 XTX (
AI-assisted: Antigravity (Gemini 4 Neon). |
|
Partial verification, the part that can be checked without a Rust toolchain: the wiring and the script. I cannot build
Not verified: that the flag actually says once that it does nothing without resizable BAR, which is the behaviour the title claims; that needs the Rust build and a card, and this machine has Written with an AI assistant. |
|
RUN (independent run, #2612 head 877c0d1 on main 878b024; merged locally with Commands, in
No runtime/ C++ or Python in this PR, so no link or import check applies. |
|
Tested
AI-assisted (Claude Code). |
|
RUN - in-game gate (Verified by OreoFR), PROVISIONAL - RTX 4070 Laptop 8 GB, NVIDIA 621.40, Windows 11.
Result: PASS - 0 device loss, 0 panics, every run alive at the end.
This run was AI-assisted (Claude Code, oreofr-agent). |
|
Merging. Head AI-assisted (Claude Code). |
Claimed in the coordination issue as: D3D12-BAR-WINDOWS-WARNING (#2570 (comment))
What and why
LEONIDA_WINDOWS_BAR_MBputs title memory windows in card memory the CPU maps (D3D12_HEAP_TYPE_GPU_UPLOAD). That memory exists only with resizable BAR, and a system and driver that offer it. Without it, the cap did nothing, and nothing said so:video_memory(), twoQueryVideoMemoryInfocalls) and took room in the cap's counter, beforemapped_card_bufferfound that the heap type is not there.This change:
shadow.rs:window_mapped_forchecksmapped_card_memory()before anything else. Without that memory, it logs once, at info level, that the cap does nothing (LEONIDA_WINDOWS_BAR_MB is set, but the card has no GPU upload heap (it needs resizable BAR, and a Windows and driver that offer it): title memory windows stay in the PC's memory and the setting does nothing) and returns. The decision is a small pure function,mapped_windows(most, supported), that asks for support only when a cap is set; its unit test covers the three cases, not the logging or the skippedvideo_memory()call, which need a device.play-nvidia.ps1: the default's line says the cap applies "if the card has resizable BAR". The-WindowsBarMBhelp gives the real default (under 48 GB of RAM and a card of 6 GB or more, since d3d12: on a card under 6 GB the launcher leaves buffer copies to the runtime and keeps windows out of VRAM #2583) instead of "under 24 GB" (an unknown card size counts as 6 GB or more).d3d12/README.md: the same correction.Behaviour with resizable BAR is unchanged. It only skips work that could not succeed.
After an independent review: the note is info rather than a warning (the launcher sets the cap by default on every PC under 48 GB), and it names GPU upload heaps rather than only resizable BAR.
Tested
On Windows 11, from
d3d12\:cargo test -p leonida-gpu --locked mapped_windows: the newshadow::mapped_windows_tests::a_cap_does_nothing_on_a_card_without_memory_the_cpu_mapspasses. Onmainit does not build, becausemapped_windowsdoes not exist there.cargo test --workspace --locked: every suite passes exceptxtaskpolicy::tests::repository_passes_policy. That test fails the same way onmain(51d343b):crates/leonida-gpu/src/host.rs(664,368 bytes) andcrates/leonida-shader/src/emit/lower.rs(676,599 bytes) are over the 655,360-byte limit. This change touches neither file.cargo fmt --all --checkandcargo clippy --workspace --all-targets --locked -- -D warningsare already red onmain, in files this change does not touch: formatting diffs across the workspace, and clippy errors inleonida-luaandleonida-shaderthat stop the build. In the changed lines,cargo fmt --checkreports no diff, andcargo clippy -p leonida-gpu --all-targets --lockedreports nothing.git diff --checkis clean, and so ispython -I scripts/check_no_game_data.pyon the three files.leonida.exe(diag build) ran with the launcher's default (LEONIDA_WINDOWS_BAR_MB=3072):card memory the CPU maps supported=false, then the new line, once (checked with the first version of the wording; a review then changed its level to info and its text);GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.2140, Windows 11 Pro 10.0.26300 (resizable BAR off).
AI-assisted: yes
Checklist
mainand merges cleanly (checked against the open pull requests that touch the same files: runtime, d3d12: memory leak fixes from one sweep (RT-LEAK-SWEEP) #2569, fix(gpu): present to the title's window, not a pseudoconsole's 0x0 window #2587, GPU: pipeline workers get a 64 MB stack for the driver's compiler #2588, Render-target reserve expires once the targets settle (LEONIDA_CARD_ROOM_FOR_TARGETS_SETTLE_MS, off by default) #2589).docs/design.md, with how it was confirmed. (Not applicable: no translator change.)