Skip to content

video_core: tighten Vulkan iGPU/low-RAM budgets and buffer, staging, pipeline, and ASTC caches - #932

Open
nowhere02 wants to merge 3 commits into
nx2-experimentalfrom
perf/nx2-low-ram-vulkan-budgets
Open

nowhere02 wants to merge 3 commits into
nx2-experimentalfrom
perf/nx2-low-ram-vulkan-budgets

Conversation

@nowhere02

@nowhere02 nowhere02 commented Nov 22, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Tightens Vulkan memory budgets and cache retention on integrated GPUs and hosts with 18 GiB of RAM or less so UMA video memory allocations do not push the host OS into heavy swap. Standalone; no dependency on the other PRs in this series (part 4 of 4).

Files changed:

  • src/video_core/vulkan_common/vulkan_device.cpp: cap integrated GPU device_access_memory to 2304 MiB (3 GiB aggressive) on <= 18 GiB hosts and 1536 MiB (2 GiB aggressive) on <= 10 GiB hosts.
  • src/video_core/renderer_vulkan/vk_pipeline_cache.cpp: bound pipeline worker and background compile thread counts on iGPUs / <= 18 GiB hosts, evict pipelines unused for 3600 frames (instead of 9000), and trim glibc heap after eviction / every 1800 frames.
  • src/video_core/buffer_cache/buffer_cache.h: use 192 MiB / 384 MiB GC thresholds when GetDeviceLocalMemory() <= 3 GiB.
  • src/video_core/renderer_vulkan/vk_staging_buffer_pool.{h,cpp}: cap integrated stream buffer to 64 MiB on <= 18 GiB hosts, use quarter-step size classes above 1 MiB, and release staging buffers unused for 60 frames (largest first).
  • src/video_core/renderer_vulkan/vk_multi_range_buffer.{h,cpp}: evict entries unused for 300 frames during TickFrame without synchronous waits during draw buffer binding.
  • src/video_core/renderer_vulkan/vk_texture_cache.{h,cpp}: lower SparseLayersCap (192 MiB) and TrimmedAstcArrayLimit (128 MiB) when GetDeviceLocalMemory() <= 3 GiB, and bound ASTC transcode scratch to 32 MiB free / 128 MiB in-flight on integrated or <= 4 GiB GPUs.

Assisted-by: Antigravity (RAM profiling, implementation, and verification)

Type of change

  • Bug fix
  • Game compatibility / game-support
  • Performance
  • New feature
  • Refactor / cleanup
  • CI / build
  • Documentation

Related issues

N/A

Testing

  • Tested on Windows
  • Tested on Linux
  • Tested on macOS
  • Tested on NVIDIA
  • Tested on AMD
  • Tested on Intel

Standalone branch: ninja -C build -j10 yuzu eden-cli tests built cleanly ([41/41]).

Games tested:

  • The Legend of Zelda: Ocarina of Time (NX2) & Mario Kart World on Linux (AMD Ryzen 5, Radeon Vega iGPU, 15.4 GiB RAM), tested with the 4-PR series applied together.

Checklist

  • I built it locally and it compiles without new warnings
  • I did not add any copyrighted game data, keys or firmware
  • Docs updated if needed
  • I added AI Disclosure if one was used

Screenshots / logs

Measured on the 15.4 GiB Radeon Vega APU with the full 4-PR series:

  • Mario Kart World: peak GTT_delta dropped from 4,603 MiB to 3,353-3,416 MiB; 120s system swap delta dropped from +6,281 MiB to +1,522 MiB.
  • Ocarina of Time (240s in-game): final GTT_delta dropped from 3,397 MiB to 2,395 MiB (-29.5%) and system swap delta dropped from +5,570 MiB to +525 MiB (-90.6%).

Summary by CodeRabbit

  • Performance
    • Improved graphics memory management on lower-memory systems and integrated GPUs, helping reduce memory pressure during gameplay.
    • Updated background graphics processing to better adapt to available hardware and system memory.
    • Refined reuse and cleanup of graphics buffers and textures to limit long-lived unused resources.

PastaLaPate and others added 3 commits November 22, 2026 00:19
A manual dispatch gains a linux_arch choice (both, x86_64 or aarch64) that narrows the base Linux legs and the Nix linux systems, and a build_nix tick that skips the Nix job entirely. Defaults keep pushes, dailies, PR builds and untouched manual runs building both architectures with Nix on.

Cherry-picked verbatim onto nx2 and nx2-experimental so a rebase of nx2-experimental onto nx2 drops it as already applied.
`no` keeps the skip the boolean could express. `only` runs the Nix job for
the systems the Linux/macOS ticks (and linux_arch) select, and skips the
Linux, Windows and macOS jobs -- plus the release job, whose assets all come
from those legs, so publishing there would only fail on an empty artifact
set. Default stays `yes`: pushes, dailies, PR builds and untouched manual
runs are unchanged.
…pipeline, and ASTC caches

On integrated GPUs and hosts with 18 GiB of RAM or less, guest RAM, host heap,
and UMA video memory share the same physical RAM:

- Cap integrated GPU device_access_memory on <= 18 GiB (2304 MiB conservative,
  3 GiB aggressive) and <= 10 GiB (1536 MiB / 2 GiB) hosts so TextureCache GC
  runs before pushing the OS into swap.
- Bound pipeline translation/background threads on iGPUs and <= 18 GiB hosts,
  evict unused graphics pipelines after 3600 frames instead of 9000, and call
  malloc_trim(0) on glibc after eviction and every 1800 frames.
- Lower BufferCache GC thresholds to 192/384 MiB when device_local <= 3 GiB.
- Cap the iGPU stream buffer to 64 MiB on <= 18 GiB hosts, use quarter-step
  staging buffer size classes above 1 MiB, and free staging buffers idle for
  60 frames (largest first).
- Evict MultiRangeBufferCache entries unused for 300 frames without waiting on
  in-flight ticks mid-draw.
- Lower SparseLayersCap and TrimmedAstcArrayLimit on <= 3 GiB device-local
  memory and bound ASTC transcode scratch to 32 MiB free / 128 MiB in-flight on
  integrated or <= 4 GiB GPUs.

Assisted-by: Antigravity (RAM profiling, implementation, and verification)
@github-actions
github-actions Bot changed the base branch from nx2 to nx2-experimental November 22, 2026 03:40
@github-actions

Copy link
Copy Markdown

Retargeted to nx2-experimental for pre-build testing. It will be promoted to nx2 after validation.

@coderabbitai

coderabbitai Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 19798e96-5d4f-4e64-8268-3ef738404848

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

3 participants