Disable forced 4K rendering #203

Open
opened 2026-11-26 03:54:26 +00:00 by github-bot · 6 comments
Owner

@⁠ljm-233 on GitHub · 2026-11-24 01:24 UTC · original

Because of forced 4K rendering, 16 GB of RAM + 8 GB of VRAM will OOM on Windows, and tests should not use 4K.
Linux has not been tested yet.

**@⁠ljm-233** on GitHub · 2026-11-24 01:24 UTC · [original](https://github.com/Marvisak/VIctory/issues/203) Because of forced 4K rendering, 16 GB of RAM + 8 GB of VRAM will OOM on Windows, and tests should not use 4K. Linux has not been tested yet.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:54:26 +00:00
Author
Owner

@⁠desplmfao on GitHub · 2026-11-24 01:34 UTC · original

doesnt seem to be easy to solve unless you run the series s version instead of series x

**@⁠desplmfao** on GitHub · 2026-11-24 01:34 UTC · [original](https://github.com/Marvisak/VIctory/issues/203#issuecomment-7119230056) doesnt seem to be easy to solve unless you run the series s version instead of series x
Author
Owner

@⁠kykifox1337-source on GitHub · 2026-11-24 01:48 UTC · original

Some numbers on how much Series S mode saves, and one thing that does not work.

The reported display mode is not the lever. I changed the console's mode list (crates/victory-gpu/src/dxgi.rs, one 3840x2160 mode) to 1920x1080: the title still created a 3840x2160 window and swap chain. It creates its window before it asks for the mode list, so its output size comes from somewhere else, most likely the console type.

--console series-s lowers it, to a 1920x1080 scene with 1280x720 internal targets (Series X: 3840x2160 and 2560x1440). It needs #211 to show a picture; without it every frame is black.

Windows 10 22H2, RTX 2070 SUPER 8 GB, 32 GB RAM, diag build of main d2a4bae + #175 + #211, same build for both runs. Committed memory is victory.exe's private bytes; GPU memory is nvidia-smi for the whole system (about 0.8 GB at an idle desktop); sampled every 10 s.

Series X Series S saved
committed, menus and intro 12.0 to 12.2 GB 8.0 to 8.3 GB about 3.9 GB
GPU memory, menus and intro 5.3 GB 3.6 GB about 1.7 GB
committed, peak in the world 21.3 GB 17.7 GB about 3.6 GB
GPU memory, peak in the world 7.6 of 8 GB 7.3 of 8 GB little

So Series S is a partial workaround: about 4 GB less RAM, but the world still commits about 17.7 GB, more than 16 GB of RAM (it needs page file), and an 8 GB card still fills up. Both runs lost the device about 30 to 45 s into the world (the NVIDIA hang in #71), with GPU memory near full just before.

AI-assisted (Claude Code); I ran everything above myself.

**@⁠kykifox1337-source** on GitHub · 2026-11-24 01:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/203#issuecomment-7119463956) Some numbers on how much Series S mode saves, and one thing that does not work. **The reported display mode is not the lever.** I changed the console's mode list (`crates/victory-gpu/src/dxgi.rs`, one 3840x2160 mode) to 1920x1080: the title still created a 3840x2160 window and swap chain. It creates its window before it asks for the mode list, so its output size comes from somewhere else, most likely the console type. **`--console series-s` lowers it**, to a 1920x1080 scene with 1280x720 internal targets (Series X: 3840x2160 and 2560x1440). It needs #211 to show a picture; without it every frame is black. Windows 10 22H2, RTX 2070 SUPER 8 GB, 32 GB RAM, diag build of `main` `d2a4bae` + #175 + #211, same build for both runs. Committed memory is `victory.exe`'s private bytes; GPU memory is `nvidia-smi` for the whole system (about 0.8 GB at an idle desktop); sampled every 10 s. | | Series X | Series S | saved | |---|---|---|---| | committed, menus and intro | 12.0 to 12.2 GB | 8.0 to 8.3 GB | about 3.9 GB | | GPU memory, menus and intro | 5.3 GB | 3.6 GB | about 1.7 GB | | committed, peak in the world | 21.3 GB | 17.7 GB | about 3.6 GB | | GPU memory, peak in the world | 7.6 of 8 GB | 7.3 of 8 GB | little | So Series S is a partial workaround: about 4 GB less RAM, but the world still commits about 17.7 GB, more than 16 GB of RAM (it needs page file), and an 8 GB card still fills up. Both runs lost the device about 30 to 45 s into the world (the NVIDIA hang in #71), with GPU memory near full just before. AI-assisted (Claude Code); I ran everything above myself.
Author
Owner

@⁠ljm-233 on GitHub · 2026-11-24 09:48 UTC · original · edited 2026-11-24 09:49 UTC

We went at this from the "make the host run it at 1080p" side and ended up with a working 1920x1080 setup — menus at 30 fps, sharp picture, no OOM on an 8 GB card. Sharing the lever and the trap, because @⁠kykifox1337-source's finding is exactly right ("the mode list is not the lever; the title still creates a 3840x2160 window and swap chain") and the "somewhere else" is findable.

1. The output size is a resolution ladder in the image.

In our dump (game_scarlett_master.exe from the GTA6.Xbox.v1.0.2.1-CYBERLEEK files; prepared image hashes to b99f876b…) it sits at .rdata RVA 0x615c0c0 and is five entries of 16 bytes, width, height, 60, 1:

1280x720, 1664x936, 1920x1080, 2560x1440, 3840x2160

The title takes its window size, swap chain size and render-target sizes from this table. Capping every entry above 1920x1080 at 1920x1080 (two entries in our build) makes it create a 1920x1080 window and 1920x1080 render targets, with no --console series-s. We locate the table by those five entries rather than by the RVA, so no bytes of the title live in the tree.

2. Then an assert fires that has nothing to do with resolution.

Right after the cap, the title hits an int3 at +0x247af2d:

mov rax,[rsp+0x78]
sub rax,[rsp+0x70]
add rax,[rva 0x75e6ff0]
cmp rax,0x1fffff
jbe ok
int3

It compares a pool ring-buffer offset (0x2200000 in our run), not a size. Stepping over that one int3 from a vectored exception handler (Rip += 1, EXCEPTION_CONTINUE_EXECUTION) is enough to continue. Worth knowing before concluding that a capped ladder "makes the title crash".

3. The cap alone gives a blurry quarter, not a picture.

The title lays its picture out for a 2160-tall console: it draws into frame * (frame height / 2160), anchored top-left, and leaves the rest black. At 1920x1080 that picture is the top-left 960x540.

  • CopyResource of the whole frame (what we did at first) shows it in the corner.
  • Letting DXGI scale the whole frame into a smaller window only makes it smaller and blurrier.

What works: make the swap chain the size of the window's client area and CopyTextureRegion only that top-left corner into it, 1:1. The other three quarters of the presented frame are black, so the crop loses nothing. Two details matter for 1:1:

  • create the window at the content size (960x540 client) at CreateWindowExW time — resizing it afterwards makes the title run its own crash handler and upload a minidump (we have those);
  • on a scaled display, make the process per-monitor DPI aware first, or a 960x540 window becomes 1440x810 physical at 150% and the frame is stretched again.

4. Numbers (RTX 5060 Laptop 8 GB, 2560x1600 @⁠150%, 32 GB RAM):

4K, uncapped 1080p capped + cropped
menus OOM, TDR; host textures ~8.8 GB 30.0 fps, ~2.0 GB host textures
window 3840x2160 982x596 (960x540 client), swap chain 960x540
world not reached 0.1 fps, 280–540 draws/frame, ~6.4–7.0 GB host textures, 172 s up

The 172 s world run stayed up with no device loss, but its frames were still black and streaming at that point, so that is not evidence about the NVIDIA hang in #71 — only that the 1080p layout itself was stable on 8 GB.

The world remains the expensive part either way: this only makes the host survive the menus and the loading, and gives a sharp picture instead of a stretched one.

One interaction to keep in mind with #211: it reports the title presenting a separate 3840x2160 UI plane. We present only the first plane, so the crop above preserves what the title draws into that plane — in our menus the UI was inside it. If a configuration presents the UI in a second plane, compose the planes first and crop the composed frame; the crop is not a substitute for #211.

If a PR is welcome I can send the patching (both patches are byte-pattern searches; nothing is stored by offset). Our patch code lives in a fork's crates/victory-game, which upstream currently has as lib.rs + sgd5.rs, so tell me where such a patch belongs — a victory run --resolution/automatic cap, or under victory-game.

**@⁠ljm-233** on GitHub · 2026-11-24 09:48 UTC · [original](https://github.com/Marvisak/VIctory/issues/203#issuecomment-7127917824) · edited 2026-11-24 09:49 UTC We went at this from the "make the host run it at 1080p" side and ended up with a working 1920x1080 setup — menus at 30 fps, sharp picture, no OOM on an 8 GB card. Sharing the lever and the trap, because @⁠kykifox1337-source's finding is exactly right ("the mode list is not the lever; the title still creates a 3840x2160 window and swap chain") and the "somewhere else" is findable. **1. The output size is a resolution ladder in the image.** In our dump (`game_scarlett_master.exe` from the `GTA6.Xbox.v1.0.2.1-CYBERLEEK` files; prepared image hashes to `b99f876b…`) it sits at `.rdata` RVA `0x615c0c0` and is five entries of 16 bytes, `width, height, 60, 1`: ``` 1280x720, 1664x936, 1920x1080, 2560x1440, 3840x2160 ``` The title takes its window size, swap chain size *and* render-target sizes from this table. Capping every entry above 1920x1080 at 1920x1080 (two entries in our build) makes it create a 1920x1080 window and 1920x1080 render targets, with no `--console series-s`. We locate the table by those five entries rather than by the RVA, so no bytes of the title live in the tree. **2. Then an assert fires that has nothing to do with resolution.** Right after the cap, the title hits an `int3` at `+0x247af2d`: ``` mov rax,[rsp+0x78] sub rax,[rsp+0x70] add rax,[rva 0x75e6ff0] cmp rax,0x1fffff jbe ok int3 ``` It compares a pool ring-buffer offset (`0x2200000` in our run), not a size. Stepping over that one `int3` from a vectored exception handler (`Rip += 1`, `EXCEPTION_CONTINUE_EXECUTION`) is enough to continue. Worth knowing before concluding that a capped ladder "makes the title crash". **3. The cap alone gives a blurry quarter, not a picture.** The title lays its picture out for a 2160-tall console: it draws into `frame * (frame height / 2160)`, anchored top-left, and leaves the rest black. At 1920x1080 that picture is the top-left 960x540. - `CopyResource` of the whole frame (what we did at first) shows it in the corner. - Letting DXGI scale the whole frame into a smaller window only makes it smaller and blurrier. What works: make the swap chain the size of the window's **client area** and `CopyTextureRegion` only that top-left corner into it, 1:1. The other three quarters of the presented frame are black, so the crop loses nothing. Two details matter for 1:1: - create the window at the content size (960x540 client) **at `CreateWindowExW` time** — resizing it afterwards makes the title run its own crash handler and upload a minidump (we have those); - on a scaled display, make the process per-monitor DPI aware first, or a 960x540 window becomes 1440x810 physical at 150% and the frame is stretched again. **4. Numbers** (RTX 5060 Laptop 8 GB, 2560x1600 @⁠150%, 32 GB RAM): | | 4K, uncapped | 1080p capped + cropped | |---|---|---| | menus | OOM, TDR; host textures ~8.8 GB | 30.0 fps, ~2.0 GB host textures | | window | 3840x2160 | 982x596 (960x540 client), swap chain 960x540 | | world | not reached | 0.1 fps, 280–540 draws/frame, ~6.4–7.0 GB host textures, 172 s up | The 172 s world run stayed up with no device loss, but its frames were still black and streaming at that point, so that is not evidence about the NVIDIA hang in #71 — only that the 1080p layout itself was stable on 8 GB. The world remains the expensive part either way: this only makes the host survive the menus and the loading, and gives a sharp picture instead of a stretched one. One interaction to keep in mind with #211: it reports the title presenting a separate 3840x2160 UI plane. We present only the first plane, so the crop above preserves what the title draws into *that* plane — in our menus the UI was inside it. If a configuration presents the UI in a second plane, compose the planes first and crop the composed frame; the crop is not a substitute for #211. If a PR is welcome I can send the patching (both patches are byte-pattern searches; nothing is stored by offset). Our patch code lives in a fork's `crates/victory-game`, which upstream currently has as `lib.rs` + `sgd5.rs`, so tell me where such a patch belongs — a `victory run --resolution`/automatic cap, or under `victory-game`.
Author
Owner

@⁠ljm-233 on GitHub · 2026-11-24 10:26 UTC · original · edited 2026-11-24 10:31 UTC

An update: the change behind the comment above is on a branch, ready to become a PR.

What it does, in one line each:

  • caps the five-entry resolution ladder (crates/victory-game/src/output.rs, found by byte pattern, no offsets stored);
  • steps over the one int3 of the pool-offset self-check the capped ladder reaches (pattern-found address, Rip += 1 from the existing vector handler);
  • makes the process per-monitor DPI aware, creates the window at the picture's size (frame height / 2160, 960x540 at 1080p) and presents only that corner into a swap chain the size of the client, 1:1.

Measured on an 8 GB RTX 5060 Laptop (2560x1600 @⁠150%): menus 30.0 fps and ~2.0 GB of host textures, window 982x596 with a 960x540 client; the world loads and runs 0.1-0.8 fps, and its device removal after 1-2 min is the hang in #71 (the crop is already off by then — the title maximizes its own window for the world).

Checks: cargo clippy --workspace --all-targets -- -D warnings and --all-features pass; cargo test --workspace passes except load_probe, which needs the MSVC linker CI has.

Where it should live is still the open question: an environment switch is a first cut, and the mechanical part is ready for victory run --resolution 1920x1080 or an automatic cap based on available memory. Also, for a configuration that presents the UI in a second plane (#211), the planes have to be composed before cropping.

**@⁠ljm-233** on GitHub · 2026-11-24 10:26 UTC · [original](https://github.com/Marvisak/VIctory/issues/203#issuecomment-7128775276) · edited 2026-11-24 10:31 UTC An update: the change behind the comment above is on a branch, ready to become a PR. - branch: <https://github.com/ljm-233/VIctory/tree/feat/1080p-window> (one commit on top of `main` at `ffe310e`) - compare / one-click PR: <https://github.com/Marvisak/VIctory/compare/main...ljm-233:feat/1080p-window?expand=1> - 10 files: opt-in `VICTORY_RESOLUTION=1920x1080`, default behaviour unchanged. What it does, in one line each: - caps the five-entry resolution ladder (`crates/victory-game/src/output.rs`, found by byte pattern, no offsets stored); - steps over the one `int3` of the pool-offset self-check the capped ladder reaches (pattern-found address, `Rip += 1` from the existing vector handler); - makes the process per-monitor DPI aware, creates the window at the picture's size (`frame height / 2160`, 960x540 at 1080p) and presents only that corner into a swap chain the size of the client, 1:1. Measured on an 8 GB RTX 5060 Laptop (2560x1600 @⁠150%): menus 30.0 fps and ~2.0 GB of host textures, window 982x596 with a 960x540 client; the world loads and runs 0.1-0.8 fps, and its device removal after 1-2 min is the hang in #71 (the crop is already off by then — the title maximizes its own window for the world). Checks: `cargo clippy --workspace --all-targets -- -D warnings` and `--all-features` pass; `cargo test --workspace` passes except `load_probe`, which needs the MSVC linker CI has. Where it should live is still the open question: an environment switch is a first cut, and the mechanical part is ready for `victory run --resolution 1920x1080` or an automatic cap based on available memory. Also, for a configuration that presents the UI in a second plane (#211), the planes have to be composed before cropping.
Author
Owner

@⁠ljm-233 on GitHub · 2026-11-24 10:33 UTC · original

To set expectations about the branch above: this is an experimental exploration, for reference only — it has many problems and is not something to merge as it is.

Known problems:

  1. One build, one machine. Everything is found by byte pattern, but a build without the ladder or without that self-check does nothing useful, and nothing has been verified across builds. The numbers come from a single setup (the GTA6.Xbox.v1.0.2.1-CYBERLEEK files; 8 GB RTX 5060 Laptop; 2560x1600 at 150%).
  2. The int3 step-over is a workaround, not a fix. It skips a self-check we believe compares a pool ring-buffer offset rather than a size. If that reading is wrong on another build, the skip hides a real assertion.
  3. It does not fix the world. The GPU device is still removed one to two minutes in (the hang in #71), and in our runs the world frames were black before that. The world's cost is unchanged.
  4. 1:1 only lasts while the window is the picture's size. The title maximizes its own window when the world starts; after that the crop is off and the frame is stretched to the window again.
  5. The sharpness ceiling is 960x540 at this setting. The title draws only that region of the frame; the rest is black, so a larger window would only magnify it.
  6. Hard-coded console knowledge (the 2160 frame height, the five ladder entries), and only the first presented plane is cropped — the second UI plane from #211 still has to be composed first.
  7. An environment switch, not a supported option: process-wide DPI awareness, host-texture totals rather than measured VRAM, and only the GNU toolchain was exercised locally (the load_probe test needs the MSVC linker CI has).
  8. The world cannot be checked on WARP either: that device is removed too, while creating mesh pipelines.

So please take it as notes and code to look at — not as a feature.

**@⁠ljm-233** on GitHub · 2026-11-24 10:33 UTC · [original](https://github.com/Marvisak/VIctory/issues/203#issuecomment-7128936723) To set expectations about the branch above: **this is an experimental exploration, for reference only — it has many problems and is not something to merge as it is.** Known problems: 1. **One build, one machine.** Everything is found by byte pattern, but a build without the ladder or without that self-check does nothing useful, and nothing has been verified across builds. The numbers come from a single setup (the `GTA6.Xbox.v1.0.2.1-CYBERLEEK` files; 8 GB RTX 5060 Laptop; 2560x1600 at 150%). 2. **The `int3` step-over is a workaround, not a fix.** It skips a self-check we believe compares a pool ring-buffer offset rather than a size. If that reading is wrong on another build, the skip hides a real assertion. 3. **It does not fix the world.** The GPU device is still removed one to two minutes in (the hang in #71), and in our runs the world frames were black before that. The world's cost is unchanged. 4. **1:1 only lasts while the window is the picture's size.** The title maximizes its own window when the world starts; after that the crop is off and the frame is stretched to the window again. 5. **The sharpness ceiling is 960x540 at this setting.** The title draws only that region of the frame; the rest is black, so a larger window would only magnify it. 6. **Hard-coded console knowledge** (the 2160 frame height, the five ladder entries), and only the first presented plane is cropped — the second UI plane from #211 still has to be composed first. 7. **An environment switch, not a supported option**: process-wide DPI awareness, host-texture totals rather than measured VRAM, and only the GNU toolchain was exercised locally (the `load_probe` test needs the MSVC linker CI has). 8. **The world cannot be checked on WARP either**: that device is removed too, while creating mesh pipelines. So please take it as notes and code to look at — not as a feature.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 01:49 UTC · original

Automated triage for the maintainers.

This is a request for a lower output resolution to reduce memory use. That fits the project's scope (Windows hosts, the user's own files). On current main the console reports a single 3840x2160 mode (crates/victory-gpu/src/dxgi.rs). As measured above, the title's output size does not follow that mode, and victory run --console series-s (see the README) is the existing partial workaround, saving about 4 GB of RAM. The open PR #1701 (VICTORY_MODE overrides the reported display mode) is related, but by the measurement above it would not change the output size by itself.

The resolution-cap implementation is on a fork branch (feat/1080p-window), and its author describes it as experimental. Pull requests are open to everyone, so if you want it reviewed, please open one. Where such a switch should live is for the maintainers.

One request: please do not post the title's disassembly, addresses or byte contents, or the name of the copy the files came from. Material taken from the game must not be posted in this repository.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 01:49 UTC · [original](https://github.com/Marvisak/VIctory/issues/203#issuecomment-7150009337) <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-24T10:33:21Z at=2026-11-25T01:49:50Z --> Automated triage for the maintainers. This is a request for a lower output resolution to reduce memory use. That fits the project's scope (Windows hosts, the user's own files). On current `main` the console reports a single 3840x2160 mode (`crates/victory-gpu/src/dxgi.rs`). As measured above, the title's output size does not follow that mode, and `victory run --console series-s` (see the README) is the existing partial workaround, saving about 4 GB of RAM. The open PR #1701 (`VICTORY_MODE` overrides the reported display mode) is related, but by the measurement above it would not change the output size by itself. The resolution-cap implementation is on a fork branch (`feat/1080p-window`), and its author describes it as experimental. Pull requests are open to everyone, so if you want it reviewed, please open one. Where such a switch should live is for the maintainers. One request: please do not post the title's disassembly, addresses or byte contents, or the name of the copy the files came from. Material taken from the game must not be posted in this repository. --- _Generated by [Claude Code](https://claude.ai/code)_
This discussion has been locked. Commenting is limited to contributors.
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/Marvisak--VIctory#203
No description provided.