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

Closed
RustyTheDalek wants to merge 11 commits from upstream-pr/4189 into main
RustyTheDalek commented 2026-11-30 17:16:02 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by RustyTheDalek on 2026-11-30T17:16:02Z.


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

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:5570119806 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4189). Originally posted by [RustyTheDalek](https://github.com/RustyTheDalek) on 2026-11-30T17:16:02Z. --- ## 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)
trustno1-coder commented 2026-12-01 18:46:07 +00:00 (Migrated from github.com)

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by trustno1-coder on 2026-12-01T18:46:07Z.


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.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7321505935 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4189#issuecomment-7321505935). Originally posted by [trustno1-coder](https://github.com/trustno1-coder) on 2026-12-01T18:46:07Z. --- 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

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
trustno1-coder/VIctory-NVIDIA!4189
No description provided.