Skip to content

d3d12 launcher: title memory windows stay off cards under 12 GB on PCs of 20 GB or more - #3035

Open
Krashgamer wants to merge 3 commits into
ProjectLeonida:mainfrom
Krashgamer:d3d12-launcher-windows-small-card
Open

Krashgamer wants to merge 3 commits into
ProjectLeonida:mainfrom
Krashgamer:d3d12-launcher-windows-small-card

Conversation

@Krashgamer

Copy link
Copy Markdown
Contributor

Claimed in the coordination issue as: D3D12-LAUNCHER-WINDOWS-SMALL-CARD (claimed with this pull request, in #2570)

Depends on: #3031. The PC-memory headroom this needs comes from shared command allocators. Without #3031 a 32 GB PC with this change would be back near the 2026-11-27 case that brought the windows to PCs under 48 GB. Merge after #3031.

Conflicts with: #3002 (D3D12-16GB-WINDOWS-BAR-LINE).

Whichever merges second needs a rebase. If #3002 lands first, I'll port these cases to its harness and flip that assertion.

What and why

play-nvidia.ps1 puts up to 3 GB of title memory windows in the card's CPU-mapped memory (LEONIDA_WINDOWS_BAR_MB=3072) on every PC with under 48 GB of RAM. Cards under 6 GB are the only exception. The windows are there for the PC's memory.

On an RTX 3080 10 GB with 32 GB of RAM, the windows take about 2 GB of the card in the world's first seconds, before most textures arrive. The process's 32 MB write-combined regions (the mapped card memory) go from 27 to 90 there and stay. The device census has 732 card buffers the CPU maps, 2,054 MB. Textures then find the card at its line.

Game gate, Series X, 2560x1440, 300 s in the world from the same save, with #3031:

Runs Textures alive at the end Made again after being let go Passes turned down for room
windows on the card (as now) 7 1,313-1,441 MB 27,607-30,566 609-1,008
LEONIDA_WINDOWS_BAR_MB=0 2 2,608-2,755 MB 12,793-13,212 40-89
Frames a second, median p5 Private bytes at most
windows on the card 23.5-25.2 14.0-14.7 25.4-25.8 GB
LEONIDA_WINDOWS_BAR_MB=0 23.8, 23.9 13.7, 14.2 26.8, 26.9 GB

So on a 10 GB card the windows cost the textures half their room. The frame rate stays within the spread, at its low end, and the PC's memory takes 1.1 GB more.

The change:

  • New rule. A card reported under 11.5 GB, on a PC reported at 20 GB or more, keeps the windows in the PC's memory, and the launcher says so in one line. Drivers and Windows report a little under the nominal size, hence 11.5 and 20.
  • Unchanged. Under 20 GB the PC's memory runs out first, so the windows stay on the card. Cards of 12 GB and more keep them too. Cards under 6 GB, PCs of 48 GB and more, an unknown card size, and a typed -WindowsBarMB all behave as before.
  • Docs. The header's -WindowsBarMB help, d3d12/README.md and a new d3d12/docs/findings.md section are updated. The findings section has the tables above.

Not measured: 12 GB cards, and 8 GB cards on 32 GB PCs. The rule assumes they lack card memory more.

Tested

  • tests/test_win_launchers.py: new test_nvidia_windows_in_card_memory_by_ram_and_card. It fakes the PC's RAM (CIM) and the card's memory (driver key) in MiB as reported, runs the launcher with -DryRun and checks the cap, the one message line, and that a typed cap wins. Cases:
    • 16 GB PC + 10 GB card
    • 32 GB PC with a 10, 8, 12, 16 or 4 GB card
    • 24 GB PC + 10 GB card
    • 64 GB PC + 16 GB card
    • 32 GB PC + 10 GB card with -WindowsBarMB 3072 typed
  • All 6 tests in the file pass.
  • Red/green: with origin/main's play-nvidia.ps1, exactly the three new cases fail (32 GB + 10 GB, 32 GB + 8 GB, 24 GB + 10 GB: the cap is still set). With the change they pass.
  • Docs tests (test_docs_*.py): passed.
  • check_no_game_data.py: passed.
  • Game runs: as in the tables above.

The change was reviewed by an independent reviewer agent before this pull request. What it found, now fixed:

GPUs tested: NVIDIA GeForce RTX 3080 10 GB, driver 32.0.16.1088 (610.88), resizable BAR, Windows 11 Pro 26200; Intel i7-10700K, 32 GB RAM

AI-assisted: yes, Claude Code (Claude Opus 5.5)

Checklist

  • Based on current main and merges cleanly (a conflicting pull request is labeled needs rebase).
  • One topic; follow-up work goes in a new pull request.
  • No game data, keys or decryption (CONTRIBUTING.md), including in logs or reports quoted here.
  • A new translator rule is in the contract table of docs/design.md, with how it was confirmed. (n/a)

🤖 Generated with Claude Code

…s of 20 GB or more

The launcher put up to 3 GB of title memory windows in the card's CPU-mapped
memory on every PC with under 48 GB of RAM (for the PC's memory). On an RTX
3080 10 GB with 32 GB they took 2 GB of the card in the world's first seconds,
and textures then lacked room: 1.3-1.4 GB of textures alive, 28,000-30,000
made again and 600-1,000 passes turned down for room in 300 s (seven runs),
against 2.6-2.8 GB, 13,000 and 40-89 without the windows (two runs), frames
within the spread, the PC's memory 1.1 GB more (rests on ProjectLeonida#3031).

Now a card reported under 11.5 GB on a PC reported at 20 GB or more keeps them
in the PC's memory; under 20 GB the PC's memory runs out first and they stay
on the card. A test fakes the PC's and the card's memory (in MiB as reported)
and checks the rule, the message and that a typed cap wins.

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

Copy link
Copy Markdown
Contributor

Independent Windows dry-run check at base 8422def75 and head d2e2188f0. I mocked 32 GB RAM and an 8 GB selected adapter (-Adapter 5060), then added a separate 16 GB registry entry. Windows PowerShell 5.1 and PowerShell 7 both gave the same result.

Registry entries Base PR
Selected 8 GB only 3072 MiB unset
Selected 8 GB + other 16 GB 3072 MiB 3072 MiB
Same two entries, explicit -WindowsBarMB 0 0 MiB 0 MiB

LEONIDA_ADAPTER=5060 was passed in all cases. The existing probe takes the largest registry entry, so the new rule protects the 8 GB card in the single-adapter case and can still leave the cap on when the same card is selected on a mixed-adapter PC. This is a scope limitation of the existing probe. It may be worth documenting the manual override for that case.

AI-assisted validation. Synthetic registry and CIM inputs, no game files or GPU activity.

…t the largest adapter's

On a PC with two cards, -Adapter picking an 8 GB card beside a 16 GB one left
the windows rule (and the under-6 GB rule) with the 16 GB card's size: the
probe took the largest adapter's. Now the largest of the cards whose name
-Adapter is part of (any case, as the runtime picks), else the largest.
Found by ecox982745's dry runs on ProjectLeonida#3035.

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

Copy link
Copy Markdown
Contributor Author

Thanks, @ecox982745 - fixed in b0cf557 rather than documented: with -Adapter the probe now takes the memory of the card(s) whose name it is part of (any case, as the runtime picks), else the largest as before. That also corrects the under-6 GB rule on such PCs. The test got two-card cases (8 GB 5060 beside a 16 GB card: picked 8 GB -> no cap; picked rtx 4080 -> 3072; none picked or a name matching none -> the largest, 3072). The picked-8 GB case fails with the previous head's script and passes now; all 6 launcher tests pass.

A value with [ made -like throw inside the probe, which the try swallowed,
leaving the card's size half found; * and ? matched more than the runtime's
plain part-of-the-name. Now the trimmed value as plain text, any case; #N
(the runtime's N-th card) is not mapped, as the driver keys are not in its
order, and gets the largest card as before. Tests for both.

Co-Authored-By: Claude Opus 5.5 <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.

2 participants