Repository navigation
texture_cache: let large cards fill 5/8 of their memory budget before collecting - #268
Conversation
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
… collecting From upstream PR zortos293#268 (4262a99). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUZ8rZ57CNjfLaMPNXV3UU
From upstream PR zortos293#268 (4262a99). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUZ8rZ57CNjfLaMPNXV3UU
… collecting From upstream PR zortos293#268 (4262a99). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUZ8rZ57CNjfLaMPNXV3UU (cherry picked from commit b67c4b7)
From upstream PR zortos293#268 (4262a99). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QUZ8rZ57CNjfLaMPNXV3UU (cherry picked from commit 9d32141)
… collecting (zortos293#268) Port of zortos293#268 by atk3001. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ortos293#268, zortos293#313, unbacked image fix)
…293#268, zortos293#313 and the unbacked image fix
… collecting 4d8a962 capped the collector's critical threshold at 5 GiB on every GPU. On a 16 GB card Mario Kart World's races then sit at the cap: the collector evicts render targets every frame, which are recreated and uploaded from guest memory again (~4100 uploads, 5 GiB per 600 frames). The cap is now 5/8 of the driver's memory budget, at least 5 GiB, so cards up to 8 GB are unchanged. GetDeviceLocalMemory is not used: it is capped near 7 GiB. Mario Kart World, Wario Stadium staff ghost replay, RTX 5080 (16 GB, critical 9.3 GiB), 2 runs: 53.0 -> 58.7 fps, p90 26.7 -> 18.4 ms, p99 45 -> 30 ms, GPU back thread 13.1 -> 11.0 ms a frame. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
4262a99 to
33c51d2
Compare
… collecting (zortos293#268) 4d8a962 capped the collector's critical threshold at 5 GiB on every GPU. On a 16 GB card Mario Kart World's races then sit at the cap: the collector evicts render targets every frame, which are recreated and uploaded from guest memory again (~4100 uploads, 5 GiB per 600 frames). The cap is now 5/8 of the driver's memory budget, at least 5 GiB, so cards up to 8 GB are unchanged. GetDeviceLocalMemory is not used: it is capped near 7 GiB. Mario Kart World, Wario Stadium staff ghost replay, RTX 5080 (16 GB, critical 9.3 GiB), 2 runs: 53.0 -> 58.7 fps, p90 26.7 -> 18.4 ms, p99 45 -> 30 ms, GPU back thread 13.1 -> 11.0 ms a frame. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 69695aa)
… collecting (zortos293#268) 4d8a962 capped the collector's critical threshold at 5 GiB on every GPU. On a 16 GB card Mario Kart World's races then sit at the cap: the collector evicts render targets every frame, which are recreated and uploaded from guest memory again (~4100 uploads, 5 GiB per 600 frames). The cap is now 5/8 of the driver's memory budget, at least 5 GiB, so cards up to 8 GB are unchanged. GetDeviceLocalMemory is not used: it is capped near 7 GiB. Mario Kart World, Wario Stadium staff ghost replay, RTX 5080 (16 GB, critical 9.3 GiB), 2 runs: 53.0 -> 58.7 fps, p90 26.7 -> 18.4 ms, p99 45 -> 30 ms, GPU back thread 13.1 -> 11.0 ms a frame. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 69695aa)
Three upstream changes trade memory for speed on PCs. On a phone the GPU shares RAM with the game and Android's low-memory killer, so keep the previous behaviour there: - Cold guest memory is still paged out with MADV_PAGEOUT (zram only) instead of MADV_COLD (zortos293#756). - Idle upload staging buffers of 16 MiB and up are still freed (zortos293#778 keeps two per level up to 32 MiB). - The texture cache's collect threshold stays capped at 5 GiB instead of 5/8 of the driver's budget (zortos293#268). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Upstream's final versions replace the earlier copies tuned4 carried: zortos293#816 (store extent; the Cap64K mark mode goes), zortos293#815 and zortos293#591 (pipeline cache: a key's first record is built, exact duplicates and incomplete records are removed from the file, which replaces round 16's newest-record retry and failed-record set), zortos293#817 and zortos293#818 (join copies that write a whole image; StalePages), zortos293#778 (Fritchii v4 imports: storage-pointer texture handles and idle staging buffers without a switch, per-engine switch reads), zortos293#268 (collect from 5/8 of the VRAM budget), zortos293#621, zortos293#687, zortos293#488. Kept from tuned4: the record conversions for other drivers and dynamic state forms, the vertex attribute keys (zortos293#408), now deduplicated in memory only so the file keeps every record other builds key apart, EXP8's copy-overwrite skip, banded untiles and no cold hints, batched collector downloads, the front's write tracking and mixed macro reads, the host pacer's genlock beside zortos293#655's timer pacing, and the raw Dynamic FPS step, applied now to zortos293#655's FPS Unlock patch too (it shares the routine's head). Upstream zortos293#841 builds task/mesh records without VK_EXT_mesh_shader, so their drop goes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RqR9236AYzEMch9rerR4iU
… collecting The collector's critical threshold was capped at 5 GiB on every GPU. On a 16 GB card Mario Kart World's races then sit at the cap: the collector evicts render targets every frame, which are recreated and uploaded from guest memory again (~4100 uploads, 5 GiB per 600 frames). The cap is now 5/8 of the driver's memory budget, at least 5 GiB, so cards up to 8 GB are unchanged. GetDeviceLocalMemory is not used: it is capped near 7 GiB. Cherry-picked from Lichii's 69695aa53e (zortos293/Lichii#268), authorship kept. Its measured result, Mario Kart World, Wario Stadium staff ghost replay, RTX 5080 (16 GB, critical 9.3 GiB), 2 runs: 53.0 -> 58.7 fps, p90 26.7 -> 18.4 ms, p99 45 -> 30 ms, GPU back thread 13.1 -> 11.0 ms a frame. Verified against our tree before taking: runtime.GetDeviceMemoryBudget() is already what TickFrame follows the driver's budget with, through the same `if constexpr (requires ...)` guard, so the null-runtime instantiations are unaffected. Our ApplyThresholdOverrides has no budget_critical/budget_expected locals the upstream context shows; nothing else in the hunk depended on them. Not covered by a test: TextureCache<P> needs a full runtime, image and framebuffer trait set to instantiate, and a mock built for this would only restate the two lines of arithmetic. Builds clean and 919 test cases pass. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
… collecting (zortos293#268) 4d8a962 capped the collector's critical threshold at 5 GiB on every GPU. On a 16 GB card Mario Kart World's races then sit at the cap: the collector evicts render targets every frame, which are recreated and uploaded from guest memory again (~4100 uploads, 5 GiB per 600 frames). The cap is now 5/8 of the driver's memory budget, at least 5 GiB, so cards up to 8 GB are unchanged. GetDeviceLocalMemory is not used: it is capped near 7 GiB. Mario Kart World, Wario Stadium staff ghost replay, RTX 5080 (16 GB, critical 9.3 GiB), 2 runs: 53.0 -> 58.7 fps, p90 26.7 -> 18.4 ms, p99 45 -> 30 ms, GPU back thread 13.1 -> 11.0 ms a frame. Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com> (cherry picked from commit 69695aa)
… collecting Hand port of zortos293#268 (squash merge 69695aa on zortos nx2), by atk3001. 4d8a962 capped the collector's critical threshold at 5 GiB on every GPU. On a 16 GB card Mario Kart World's races then sit at the cap: the collector evicts render targets every frame, which are recreated and uploaded from guest memory again (~4100 uploads, 5 GiB per 600 frames). The cap is now 5/8 of the driver's memory budget, at least 5 GiB, so cards up to 8 GB are unchanged. GetDeviceLocalMemory is not used: it is capped near 7 GiB. Upstream: Mario Kart World, Wario Stadium staff ghost replay, RTX 5080 (16 GB, critical 9.3 GiB), 2 runs: 53.0 -> 58.7 fps, p90 26.7 -> 18.4 ms, p99 45 -> 30 ms. Port notes: only the cap changed. Upstream's function also clamps the EDEN_NX2_TC_*_MIB overrides to the device budget (a separate change we don't have); ours keep setting the thresholds outright after the cap, as before. The new cap only differs from 5 GiB when budget * 5/8 > 5 GiB (budget above 8 GiB), so cards up to 8 GB and integrated GPUs (budget capped at 4-6 GiB) keep today's behaviour. (cherry picked from commit 69695aa, hand-applied) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…zortos293#268 (5/8 VRAM budget on >8 GiB cards), zortos293#337 (fence-flagged reports, EXP33 off), zortos293#779 (HMMA on Intel Xe2) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Changes
texture_cache: on GPUs with a large memory budget, the collector's critical threshold is now 5/8 of the driver's budget instead of a fixed 5 GiB. It never goes below 5 GiB.4d8a962 capped the threshold at 5 GiB on every GPU so that Mario Kart World (
0400C3F00006E000) would stop filling 8 GB cards. On a 16 GB card, its races then sit at that cap. In every 600 frames the collector evicts ~4400 images, ~4100 are created again and uploaded from guest memory (5 GiB, almost all screen-sized render targets such as 1688×948 and 834×468), andtexture uploadtakes ~120 ms of each second on the GPU back thread (218 µs per upload).max(5 GiB, budget * 5/8). With an 8 GB card (budget ~7 GB) it stays at 5 GiB, so the case 4d8a962 fixed is unchanged.GetDeviceMemoryBudget(), notGetDeviceLocalMemory(): the latter is capped near 6 GiB plus the resolution scaler's share, so 5/8 of it never exceeds 5 GiB.EDEN_NX2_TC_*_MIBoverrides work as before.Testing
Build checks:
git diff --check: clean.YUZU_TESTS=OFF), clang or Linux builds.Gameplay (Mario Kart World, Time Trial → Wario Stadium → watching the staff ghost, 37 s of the race; RTX 5080 16 GB, driver 616.64; 2 runs each):
EDEN_NX2_TC_CRITICAL_MIB=10240EDEN_NX2_VRAM_LIMIT_MIB=8192)🤖 Generated with Claude Code
Summary by CodeRabbit