AMD cards: windows in card memory the CPU maps share the windows' own room (RX 9070 XT: no longer over its budget) #4190

Closed
github-bot wants to merge 11 commits from github-bot/gh-4189 into main AGit
Owner

@⁠RustyTheDalek on GitHub · 2026-11-30 17:16 UTC · original
RustyTheDalek:fix/amd-window-room → main · +840 −828 · 32 files · 11 commits · closed without merging

What it changes

ae8fa941 puts windows of title memory in card memory the CPU maps on cards with a budget of 14 GiB or more (window_mapped_default, 4096 MB, measured on an RTX 5080 16 GB: shared GPU memory 1.6-2.4 GB lower, the card's own 1.9-2.2 GB higher). Those mapped windows have a room of their own (WINDOW_MAPPED_BYTES against window_mapped_most), next to the 2,560 MB the card sides of windows with two sides already have (WINDOW_CARD_BYTES against window_card_most). So on a 16 GB card windows can take up to about 6.5 GB of the card.

On an RTX 5080 that fits. AMD's driver gives the process less of the same 16 GB once the world loads: a Radeon RX 9070 XT's budget went from 15,419 MB at the start to between 13,160 and 14,120 MB in the world, in each of five play runs over two days, against the RTX 5080's 15,209. There the windows' extra room came out of the textures' room.

This makes the two kinds of window share one room, window_card_most, on AMD cards: a mapped window counts the card sides already made, and a card side counts the mapped windows. The PC's memory keeps the gain (a mapped window has no CPU's side). The card holds no more windows than it did before ae8fa941.

  • Only where the big-card default would put windows there (not on the small hosts, which keep their 3072 / 4096 MB, and not with VICTORY_WINDOWS_BAR_MB set).
  • VICTORY_WINDOWS_SHARE_ROOM: unset on AMD cards (vendor 0x1002); 1 on any card; 0 never, which gives back ae8fa941's 4096 MB of their own.
  • The start logs the choice: windows in card memory the CPU maps share the windows' own room on the card (VICTORY_WINDOWS_SHARE_ROOM=0: 4096 MB of their own) room_mb=2560.

How it was tested

  • GPU and profile: Radeon RX 9070 XT 16 GB (Smart Access Memory on), Ryzen 9 5900X, 32 GB RAM, 32 GB page file, Windows 11; Series S, PC FidelityFX upscaling (FSR 4), no frame generation, ray tracing off. Play in the world after the prologue: driving in the city and missions.
  • The layer's copies of title memory on the card (buffer mirror span, at most), with the card's own memory against its budget:
Play log (2026-11-30) Base Mapped windows Copies on the card Card over its budget
14:02, 33 min 41adb551 a room of their own (3072 MB) 3,995 MB 72 % of the samples; the texture queue without room 88 % of the time, textures pale
15:00, 59 min 41adb551 sharing the room 3,320 MB 48 % (this run also had a texture eviction change, since dropped, so not all of the difference is this)
16:26, 34 min c71899d9 with #3859 and #3717 sharing the room (this branch's code) 3,368 MB never (card at most 13,082 MB of 13,669)

In all three the PC's own memory held: 1.2-5.8 GB free, against 0.3-2 GB and frames of 5 to 9 s in a run before windows were mapped (13:04, 41adb551).

  • Not measured: ae8fa941's own 4096 MB on this card on current main; the 14:02 run's own room was 3072 MB on the older base.
  • New test mapped_windows_share_the_room_on_big_amd_cards.
  • cargo test passed for the crates it touches: yes, cargo test -p victory-gpu --lib -- shadow::. Clippy reports no warning on the lines this changes.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #3889 changes window_mapped_for's line (80 % of the budget to the windows' percent) and lets idle mapped windows go; it touches the same function, a different question. #3965 is about VICTORY_SEND_BAR (now off unless set, 1a4c66ca).

🤖 Generated with Claude Code

**@⁠RustyTheDalek** on GitHub · 2026-11-30 17:16 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4189) `RustyTheDalek:fix/amd-window-room` → `main` · +840 −828 · 32 files · 11 commits · closed without merging ## What it changes ae8fa941 puts windows of title memory in card memory the CPU maps on cards with a budget of 14 GiB or more (`window_mapped_default`, 4096 MB, measured on an RTX 5080 16 GB: shared GPU memory 1.6-2.4 GB lower, the card's own 1.9-2.2 GB higher). Those mapped windows have a room of their own (`WINDOW_MAPPED_BYTES` against `window_mapped_most`), next to the 2,560 MB the card sides of windows with two sides already have (`WINDOW_CARD_BYTES` against `window_card_most`). So on a 16 GB card windows can take up to about 6.5 GB of the card. On an RTX 5080 that fits. AMD's driver gives the process less of the same 16 GB once the world loads: a Radeon RX 9070 XT's budget went from 15,419 MB at the start to between 13,160 and 14,120 MB in the world, in each of five play runs over two days, against the RTX 5080's 15,209. There the windows' extra room came out of the textures' room. This makes the two kinds of window share one room, `window_card_most`, on AMD cards: a mapped window counts the card sides already made, and a card side counts the mapped windows. The PC's memory keeps the gain (a mapped window has no CPU's side). The card holds no more windows than it did before ae8fa941. - Only where the big-card default would put windows there (not on the small hosts, which keep their 3072 / 4096 MB, and not with `VICTORY_WINDOWS_BAR_MB` set). - `VICTORY_WINDOWS_SHARE_ROOM`: unset on AMD cards (vendor `0x1002`); `1` on any card; `0` never, which gives back ae8fa941's 4096 MB of their own. - The start logs the choice: `windows in card memory the CPU maps share the windows' own room on the card (VICTORY_WINDOWS_SHARE_ROOM=0: 4096 MB of their own) room_mb=2560`. ## How it was tested - GPU and profile: Radeon RX 9070 XT 16 GB (Smart Access Memory on), Ryzen 9 5900X, 32 GB RAM, 32 GB page file, Windows 11; Series S, PC FidelityFX upscaling (FSR 4), no frame generation, ray tracing off. Play in the world after the prologue: driving in the city and missions. - The layer's copies of title memory on the card (`buffer mirror span`, at most), with the card's own memory against its budget: | Play log (2026-11-30) | Base | Mapped windows | Copies on the card | Card over its budget | |---|---|---|---|---| | 14:02, 33 min | 41adb551 | a room of their own (3072 MB) | 3,995 MB | 72 % of the samples; the texture queue without room 88 % of the time, textures pale | | 15:00, 59 min | 41adb551 | sharing the room | 3,320 MB | 48 % (this run also had a texture eviction change, since dropped, so not all of the difference is this) | | 16:26, 34 min | c71899d9 with #3859 and #3717 | sharing the room (this branch's code) | 3,368 MB | never (card at most 13,082 MB of 13,669) | In all three the PC's own memory held: 1.2-5.8 GB free, against 0.3-2 GB and frames of 5 to 9 s in a run before windows were mapped (13:04, 41adb551). - Not measured: ae8fa941's own 4096 MB on this card on current main; the 14:02 run's own room was 3072 MB on the older base. - New test `mapped_windows_share_the_room_on_big_amd_cards`. - `cargo test` passed for the crates it touches: yes, `cargo test -p victory-gpu --lib -- shadow::`. Clippy reports no warning on the lines this changes. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #3889 changes `window_mapped_for`'s line (80 % of the budget to the windows' percent) and lets idle mapped windows go; it touches the same function, a different question. #3965 is about `VICTORY_SEND_BAR` (now off unless set, 1a4c66ca). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
On a card with a budget of 14 GiB or more, mapped windows had 4096 MB of
their own (ae8fa941) beside the 2,560 MB of the card sides of windows with
two. AMD's driver gives the process 13.2 to 14.1 GB of a 16 GB card once the
world loads (an RTX 5080: 15.2), and there the extra room came out of the
textures': a Radeon RX 9070 XT was over its budget in 72 % of a run, textures
pale. Sharing one room (window_card_most), the copies of title memory on the
card went from 4.0 to 3.3 GB and the card stayed under its budget; the PC's
memory keeps the gain. VICTORY_WINDOWS_SHARE_ROOM: unset on AMD cards, 1 any
card, 0 never.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:08:16 +00:00
github-bot closed this pull request 2026-12-01 18:50:35 +00:00
Author
Owner

@⁠trustno1-coder on GitHub · 2026-12-01 18:46 UTC · original

Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

**@⁠trustno1-coder** on GitHub · 2026-12-01 18:46 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4189#issuecomment-7321505935) Closing this as part of moving main to the texture and video-memory rework (v2026.12.01.01-test). A lot of the code changed, and this pull request no longer applies cleanly to it; it would need to be rewritten against the new main rather than rebased. Thank you for the work. If the change is still needed, please open a new pull request based on the current main.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!4190
No description provided.