Skip to content

GPU: the console follows the adapter's memory (12 GiB or less: series-s) - #3112

Open
borosf wants to merge 6 commits into
Marvisak:mainfrom
borosf:vibe/series-s-by-memory-842ca5
Open

borosf wants to merge 6 commits into
Marvisak:mainfrom
borosf:vibe/series-s-by-memory-842ca5

Conversation

@borosf

@borosf borosf commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Summary

  • victory run now defaults --console to auto: the first adapter's dedicated video memory picks the console the title sees — 12 GiB or less runs series-s, anything larger (or an unanswered DXGI query) runs series-x, as before.
  • Why: the series-x profile sizes title memory at 13.5 GiB (10 of them GPU-optimal) and paces 4K targets — a card that size cannot hold it. The dossier measured roughly half the frame going to the series-s mode on a 10 GB RTX 3080 (2,699 → 1,898 ms; Black world after loading on NVIDIA: measurements, ranked hypotheses and a research dossier #1317 H-1.1), so cards in that class should take it by default, not by flag.
  • The emulated DXGI display mode follows the console (console::mode_size): 4K on series-x, the series-s target of 2560×1440, so titles that pace by the listed mode get the machine they were told they are on.
  • The rule is a pure function (console::profile_for), unit-tested at the boundaries (no answer, 10 GiB, 12 GiB, 12 GiB + 1, 16 GiB, 24 GiB); the adapter query (profile_by_adapter) runs once at startup before the device is created, matching the adapter D3D12CreateDevice(None, …) takes. --console series-x|series-s still chooses outright, and the console line prints the adapter's MiB when auto picked it.
  • Composes with gpu: select high-performance hardware adapter on multi-GPU systems #3073 (adapter selection) and GPU: the Xbox's shared CPU/GPU memory on PC GPUs: simulated in video memory on discrete cards, title memory itself on unified ones #3102 (shared memory): the decision is a pure function of a queried budget, taken before device creation.

Verification

  • CI (Windows clippy -D warnings, cargo test --workspace --locked).
  • Intel Arc B580 (12 GB, Xe2), Windows 11: cargo clippy -p victory-gpu --all-targets --locked -- -D warnings clean; cargo test -p victory-gpu --lib --locked — 232 passed, the only two failures being the known Intel heap-cap tests (Test report: RTX 5070 (Blackwell), Windows 11, 70564ae: 471 passed, 5 failed, 7 ignored (4 from the 1,000,000 view heap cap) #1744) that pristine main also fails on this card. The three new tests (console::tests::the_profile_follows_the_adapter_once_it_answers, console::tests::the_mode_matches_the_console, dxgi::tests::the_listed_mode_follows_the_console) pass on hardware.
  • Live run on the B580 picks series-s by the rule (the console line names the adapter's MiB); --console series-x|series-s override works.
  • No game data used. Synthetic tests only.

claiming: default the console profile to series-s on cards of at most 12 GB, with matching DXGI modes (#1317 H-1.1)

mistral-vibe and others added 2 commits November 26, 2026 08:24
…less

Co-authored-by: borosf <borosf@users.noreply.github.com>
Co-authored-by: borosf <borosf@users.noreply.github.com>

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified locally on Windows 11:

  • cargo clippy -p victory-gpu -p victory --all-targets -- -D warnings (default and --all-features): clean
  • victory-gpu console:: + dxgi:: (5/5), victory tests (18/18), and cargo xtask policy (191 files ok) all passed.
  • Confirmed victory_hle::console re-exports victory_gpu::console (so dxgi::modes sees the selected profile) and no stray hardcoded 3840/2160 remains in dxgi.rs.

Two small issues to fix before merging:

1. Misleading startup output when DXGI returns None (apps/victory/src/run.rs:84-92)

println!(
    "console        {} (auto: {} MiB of dedicated video memory)",
    chosen.name(),
    dedicated.map_or(0, |bytes| bytes >> 20)
);

When dedicated is None, profile_for(None) chooses SeriesX, so this prints console Xbox Series X (auto: 0 MiB of dedicated video memory) — which contradicts the <= 12 GiB => series-s rule and looks like a bug. Please branch on dedicated (e.g., (auto: {} MiB of dedicated video memory) for Some(bytes) vs (auto: adapter memory unavailable) for None).

2. Hardcoding EnumAdapters1(0) misclassifies hybrid / multi-GPU systems (crates/victory-gpu/src/console.rs:132-144)

On hybrid laptops and dual-GPU desktops where an integrated GPU is wired to the primary display as adapter 0 (DedicatedVideoMemory = 128-512 MiB) and a 16-32 GiB discrete GPU is adapter 1, EnumAdapters1(0) silently forces --console auto to series-s — which also causes it to disagree with #3073 (high-performance adapter selection) rather than composing with it. Querying IDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE) (skipping DXGI_ADAPTER_FLAG_SOFTWARE) with fallback to EnumAdapters1(0) avoids misclassifying hybrid systems (and can share the same helper once #3073 lands).

@Dukestar69 Dukestar69 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verified on RTX 5090 against origin/main (63bcca4):

  • cargo test -p victory-gpu --lib console:: -- --test-threads=1: passed.
  • cargo test -p victory-gpu --lib host::tests -- --test-threads=1 --skip dynamic_slots_are_held_until_released: 30/30 passed.
  • cargo test -p victory-hle --lib modules::xsystem:: -- --test-threads=1: 4/4 passed.
  • cargo clippy -p victory-gpu -p victory-hle -p victory --all-targets -- -D warnings: clean.
  • cargo xtask policy: 191 files ok.

Cleanly defaults the console profile to series-s when the host adapter has <= 12 GiB memory while keeping explicit overrides intact.

Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).

…line says when DXGI does not answer

Co-authored-by: borosf <borosf@users.noreply.github.com>
@borosf

borosf commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor Author

Both fixed in dd1d3bb. The auto line now prints adapter memory unavailable when DXGI gives no answer (no answer names series-x, as the rule says), and the memory query takes the high-performance adapter via IDXGIFactory6::EnumAdapterByGpuPreference(0, HIGH_PERFORMANCE), skipping the software adapter, with a fallback to EnumAdapters1(0) — the same selection #3073 makes, so hybrid machines profile their discrete card and the two compose. The selection helper can be shared into #3073 when it lands.

Co-authored-by: borosf <borosf@users.noreply.github.com>
@borosf
borosf force-pushed the vibe/series-s-by-memory-842ca5 branch from a5133db to 47bb41d Compare November 26, 2026 09:09
Co-authored-by: borosf <borosf@users.noreply.github.com>

Copy link
Copy Markdown
Owner

Automated triage for the maintainers.

Needs work: needs the maintainer's decision. This adds console::profile_for/profile_by_adapter (crates/victory-gpu/src/console.rs), makes --console auto the default (apps/victory/src/main.rs), and makes dxgi.rs::modes follow the console (2560x1440 on series-s). The explicit --console choices still work. What blocks it:

  1. Default change. Most consumer cards (12 GiB or less) would now run as series-s, so titles see a different device type and memory layout (title_memory, the xsystem console mode). That is for the maintainer to decide.
  2. Display mode. The listed mode is emulation behaviour. A Series S lists the mode of the display it is connected to, not a fixed 1440p. Please cite a reference for 2560x1440 or drop the mode_size change.
  3. Test. dxgi::tests::the_listed_mode_follows_the_console compares modes against mode_size(current()), so it only restates the implementation.
  4. README. The new paragraph contains rationale and a benchmark figure. Please cut it to one line saying what auto picks.

CI: check passing.


Generated by Claude Code

@HLVM04

HLVM04 commented Nov 26, 2026

Copy link
Copy Markdown

Data for the default decision. This is from the fork (fxceless/victory-fork at 9376fd6 with its PR #798, which keeps the title's own upscaler), not from upstream main. RTX 5070 Ti 16 GB, Windows 11, first gameplay scene, one run each:

Series X Series S
median frame 257 ms 169 ms
peak commit 27.4–28 GB 23.7 GB

So on that tree a 16 GB card also ran faster as Series S, and the 12 GiB rule would keep that card on series-x.

One thing to check before series-s becomes the default: on Series S the title presents 2 planes. Plane 0 is the 1920x1080 world. Plane 1 is a 3840x2160 RGBA8 layer that holds the menus, the intro video and the HUD's control hints. On Series X the title blends that layer into one plane itself. A host that shows only plane 0 gives a black intro video and missing menus on series-s (#1854).

@fuzeofficlal fuzeofficlal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed at 261527bc. Both issues from the previous review are cleanly resolved:

  • apps/victory/src/run.rs:121-125 now prints (auto: adapter memory unavailable) when dedicated is None instead of 0 MiB.
  • crates/victory-gpu/src/console.rs:51-92 queries IDXGIFactory6::EnumAdapterByGpuPreference(0, DXGI_GPU_PREFERENCE_HIGH_PERFORMANCE) first, skips DXGI_ADAPTER_FLAG_SOFTWARE, and falls back to EnumAdapters1(0).

Verified locally on Windows 11 in a dual-GPU setup (NVIDIA GeForce RTX 5090 32 GiB + AMD Radeon iGPU):

  • victory_gpu::console::profile_by_adapter() returns (Console::SeriesX, Some(33750515712)) (32187 MiB), correctly selecting the discrete RTX 5090 rather than the AMD iGPU.
  • cargo clippy --workspace --all-targets -- -D warnings: clean
  • cargo clippy --workspace --all-targets --all-features -- -D warnings: clean
  • cargo xtask policy: 191 files ok
  • victory-gpu: console:: 2/2 passed, dxgi:: 3/3 passed
  • victory: 14/14 unit tests + 4/4 integration tests passed

LGTM.

@FluffyCyanNova

Copy link
Copy Markdown

Data point for #3112: Series S on an RTX 3060 12 GB + 4-core i3 (1280x720 internal, 2.6 fps average, ~3.0 settled, CPU-bound)

This supports the rule: a 12 GiB card should not run the series-x profile by default.

Machine: RTX 3060 12 GB (32-lane waves), Core i3-12100F (4 cores), 32 GB RAM, game on an HDD, Windows 11. --console series-s.

Setup: fork 9376fd6 + our port stack + fork #798 (the title keeps its own upscaler, not FSR), VICTORY_RELAY=2, VICTORY_CARD_ROOM_FOR_BUFFERS=1, 17 min in the world after the opening.

Results (b43run1):

Comparison on the same machine, series-x profile on the same line: the same scene ran at about 1.3-1.8 fps with a larger target and a much higher GPU time (GPU 127-159 ms in the fast runs, and up to ~1.9 s in a slow combination of ports described in a fork issue). We do not claim a clean A/B for the profile alone: the series-s run is one change on top of the series-x run (b40run1 at 755 ms/frame, 1.33 fps).

So for this class of card the series-s profile is both what fits in memory and the faster one.

… line

Co-authored-by: borosf <borosf@users.noreply.github.com>
@borosf

borosf commented Nov 26, 2026

Copy link
Copy Markdown
Contributor Author

The three actionable items from the triage are fixed at the new head 5345e2f (CI green):

  • Display mode: dropped. dxgi::modes is back to the single fixed 4K mode — the diff against main for dxgi.rs is empty now. A real Series S lists the mode of the display it is connected to, so the fixed 1440p had no citable basis, and per HLVM04's note the two present planes also mean the listed mode is not what paces the title anyway.
  • Test: the_listed_mode_follows_the_console is removed with it. The remaining console test (the_profile_follows_the_adapter_once_it_answers) checks the ≤ 12 GiB boundary rule directly, independent of the query.
  • README: the paragraph is one line now — what auto picks and what the explicit flags do.

On the default itself, that is the maintainer's call; the data we have says a card that size both fits and runs better under series-s: a 12 GB RTX 3060 (i3-12100F, 17 min in the world) ran 389 ms/frame median as series-s — CPU-bound (GPU 85 ms), vs about 755 ms/frame as series-x on the same line — and on an RTX 5070 Ti 16 GB the series-s profile was also the faster one (169 ms vs 257 ms median). HLVM04's second-half note is well taken: a host that shows only plane 0 gives a black intro and missing menus on series-s (#1854), which is worth resolving before auto-on defaults everywhere.

Thanks @fuzeofficlal and @Dukestar69 for the re-reviews and the dual-GPU verifications — the selection helper here (EnumAdapterByGpuPreference + software skip + EnumAdapters1(0) fallback) is ready to be shared into #3073 when it lands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants