Repository navigation
Conversation
With XCL_COHERENT_HEAPS=sparse the title's GPU heaps (committed memory with a PAGE_GRAPHICS_* protection, ~4.5 GB in a retail title) live in the sparse windows. Those are the data the title's shaders read and write every frame; in the coherent window (system memory, read over PCIe) one retail compute program took 1,364 ms a frame on an RTX 3080, under 33 ms in video memory. With them in video memory the windows hold ~7.5 GB of tiles and the device ran out of its budget (19 GB in use against 8.9 GB, removed at 659 s). XCL_SPARSE_SYSMEM=1 (off by default): kernelx registers a GPU heap's range as hot before its commit maps its tiles (sparse::alloc_as); every other sparse-window tile takes a pool tile in system-memory pool heaps (custom heaps, L0, write-back), which the GPU reads over PCIe. A pool tile of those heaps has SYS in its pool index; freed ones cool in their own lists, kept by the heap's number without SYS (the free table is indexed by heap number). RTX 3080, retail title, 400 s of its world after the menus: heaps in video memory alone 0.98 presents/s and 19 GB of video memory; with this and the texture-level counterpart 1.70 presents/s, 12.7 GB, no device removal in 900 s. An RTX 4080 report on xcl-dev#2688 found the same with a port of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ll free The system-memory pools of XCL_SPARSE_SYSMEM only grew: unlike the video pools they had no retirement path, so the process kept its peak (about 3.8 GB in our world runs). Review point on xcl-dev#2987: xcl-dev#2987 (comment) A heap whose 64 tiles are all free or cooled (COOL) is released, and kept alive in a retired list until the sparse queue's fence is past the value it got, as State::retired does for video memory (the tiles' unmaps were already quarantined behind the fences before they cooled). Heap slots become Option so the indexes encoded in tile handles of live heaps do not move; the next heap takes the free slot, and a retired heap is taken back before a new one is created (xcl-dev#913). State::retire_free_pools_with runs it, and the submit path's retire_due also looks at the system pools' cooling queue. Test: a_system_memory_heap_with_all_tiles_free_is_given_back fails with retirement disabled and passes with it. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
|
merge-check AI-written and posted by Foniass without a human check of each point. |
|
merge-check claim |
|
merge-check |
Carries #2987 (treybertram06's commit unchanged, rebased on main) and adds the system-pool retirement asked for in its review; supersedes #2987 if its author does not return.
The system-memory pools of
XCL_SPARSE_SYSMEM=1only grew: unlike the video pools they had no way to give back a heap whose tiles are all free, so the process kept its peak (about 3.8 GB in our world runs). Review point: #2987 (comment)What is in it
D3D12.X: sparse tiles outside the GPU heaps can live in system memory- treybertram06's commit, unchanged (sparse.rs,kernelx.rs); default off.D3D12.X: system-memory sparse pools give back heaps whose tiles are all free(crates/xcl/src/hle/d3d12x/sparse.rs):SysPools::retirereleases a heap whose 64 tiles are all free or cooled (COOL), keeps it in a retired list until the sparse queue's fence is past its mark (asState::retireddoes), and a retired heap is taken back before a new one is made. Heap slots areOptionso the indexes in live tile handles never move; the next heap takes a free slot.State::retire_free_pools_withcalls it, and the submit path'sretire_duealso looks at the system pools' cooling queue. Test:a_system_memory_heap_with_all_tiles_free_is_given_back(checksbytes()drops, live heap keeps its index, retired heap waits for the fence, a later heap reuses the slot); it fails with the retirement disabled.Tested
cargo build --workspace && cargo test --workspace --no-fail-fast -- --test-threads=4on head a6e50f1b (same tree as the head 24a84ca, only the commit message changed) (no other GPU work running): 2908 passed, 0 failed, 51 ignored (sum over the 43 test binaries; the lib: 2760 passed, 0 failed, 31 ignored).SKIPPEDlines in the log: 25 (gpu, hle, shaders andheap_window_out_of_memory_falls_back_to_the_switch_form); not counted as coverage.retiredisabled (panic at the firstbytes()assertion after retirement).Regression run
main:xcl-smoke v1
commit: 6bfb5c5
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 120
exit: 0x0
frames shown: 3425 (PresentX 3425)
presents per 2 s (last 3): 60 60 60
device removals: 0
crashes: 0
peak commit: 23525 MB
xcl-smoke v1
commit: 24a84ca
gpu: NVIDIA GeForce RTX 4080
title: 21222967
seconds: 120
exit: 0x0
frames shown: 3404 (PresentX 3404)
presents per 2 s (last 3): 61 60 60
device removals: 0
crashes: 0
peak commit: 19704 MB
Not tested
AI use
🤖 Generated with Claude Code