Repository navigation
video_core, service: avoid eager host allocations for descriptors, page tables, and shared fonts - #929
Open
nowhere02 wants to merge 3 commits into
Open
video_core, service: avoid eager host allocations for descriptors, page tables, and shared fonts#929nowhere02 wants to merge 3 commits into
nowhere02 wants to merge 3 commits into
Conversation
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.
…ge tables, and shared fonts Allocating large descriptor queues, full GPU page table vectors, oversized descriptor table buffers, and all system shared fonts upfront faulted ~288 MiB of anonymous host pages during boot even when titles barely touched them: - Make DescriptorUpdateEntry trivially default constructible and omit eager zero-initialization in UpdateDescriptorQueue (avoids faulting the full 120 MiB in-flight entry buffer upfront). - Back Tegra::MemoryManager::entries with Common::SparseLargeVector<u64> using write-if-changed updates (~64 MiB vector reserved lazily). - Grow VideoCommon::DescriptorTable::Refresh by powers of two starting at 4096 entries instead of jumping straight to 512K (~16 MiB), while preserving the 32-bit sentinel wrap behavior tested by descriptor_table tests. - Lazy-load ns::IPlatformServiceManager shared_font backing memory on first font service request via std::call_once (~34 MiB avoided when unused). Assisted-by: Antigravity (RAM profiling, implementation, and verification)
|
Retargeted to |
Contributor
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Avoids eagerly faulting ~288 MiB of anonymous host pages at title startup by switching large descriptor, page-table, and shared-font buffers to trivial/lazy/sparse initialization. This PR is standalone and safe on all host RAM sizes without runtime tuning tradeoffs.
Files changed:
src/video_core/renderer_vulkan/vk_update_descriptor.h: makeDescriptorUpdateEntrytrivially default constructible and explicitly zero.pad = 0inAddBuffer/AddTexelBuffersostd::make_unique_for_overwritedoes not fault the entire 120 MiB entry array upfront.src/video_core/memory_manager.h,src/video_core/memory_manager.cpp: switchTegra::MemoryManager::entries(~64 MiB) toCommon::SparseLargeVector<u64>with write-if-changedGetAndFault.src/video_core/texture_cache/descriptor_table.h: growRefreshgeometrically by powers of two from 4096 entries instead of pre-allocating ~16 MiB on tiny limits, preserving the 32-bit wrap-around for near-UINT32_MAXsentinels.src/core/hle/service/ns/platform_service_manager.cpp: lazy-loadshared_fonton first font request viaEnsureFontsLoaded(std::once_flag).Part 1 of a 4-PR series reducing host RAM footprint on Switch 2 titles.
Assisted-by: Antigravity (RAM profiling, implementation, and verification)
Type of change
Related issues
N/A
Testing
Standalone branch build & unit tests:
ninja -C build -j10 yuzu eden-cli tests: passed cleanly../build/bin/tests "[descriptor_table]": 81,566 assertions in 3 test cases passed../build/bin/tests "[memory_manager]": 480,090 assertions in 2 test cases passed.Games tested:
Checklist
Screenshots / logs
Eliminated the eager
120.01 MiBUpdateDescriptorQueueanonymous VMA from top-20 process VMAs in runtime/proc/<pid>/smapssnapshots; combined with the other 3 PRs in the series, OoT 240s non-JIT host RAM (heap_brk+anon_*) dropped from 3,141 MiB to 1,362 MiB (-56.6%) and system swap delta dropped from +5,570 MiB to +525 MiB (-90.6%).Summary by CodeRabbit