Repository navigation
D3D12.X: XCL_SPARSE_LAZY=1 gives a committed sparse-window tile video memory at its first use - #2897
Conversation
…rote A title that commits a pool up front gets a video-memory tile for every page at once (Series S profile of a retail title: 70,724 tiles in 2 s). The line says how many of the windows' own tiles never had a CPU write sent to them, so the cost of mapping at commit can be read from a log. No behaviour change. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
… memory at its first use A tile the title commits in a sparse window got a pool tile at the commit (State::commit_range -> ensure_mapped). A retail title on the Series S profile commits a page pool of 63,632 pages of 64 KiB in a sparse window up front: 4.3 GB of video memory at once, 3,751 MB of it in tiles the CPU never wrote, on an 8 GB card. With XCL_SPARSE_LAZY=1 a committed tile is listed with no pool tile (LAZY) and gets one when it is first used: - the CPU's first bytes for it at an upload (upload_dirty); a pool tile used before is cleared right behind its mapping, before those bytes go up; - a memory write recorded on a list (immediates, fills, copies, timestamps: will_write), before the list runs; - a buffer placed on it (buffer_tiles); a tile that finds no video memory is left out of the buffer's mapping instead of naming pool u32::MAX; - bytes that found no video memory at an upload are owed (starved) and go up whole once there is some. A copy back of a tile with no memory copies nothing. The switch is left out on a device whose unmapped tiles do not read zeros (tiled resources tier under 2). Off by default. Measured on an RTX 3060 Ti 8 GB, 60 s with no input, Series S profile: local video memory 7,503 MB without the switch, 3,022 MB with it; 542 frames against 376; 0 draws skipped either way. Tests (sparse::tests, real GPU, skipped without tiled resources tier 2): a tile's first bytes reach the GPU and are still there two submits later; bytes that found no memory go up once there is some; a recorded write gives memory and a buffer never maps the sentinel; a decommitted tile frees and parks nothing, and with the switch off a commit maps at once. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Tested and reviewed commit Tested
Review notes
Not tested
AI use
|
|
Test report from a 10 GB card: RTX 3080 10 GB, 31 GB RAM + 64 GB page file, Windows 11. Your #2893–#2897 are cherry-picked onto Austin's Build 16 (≈ nvidia-dev eae0150) plus #2815–#2817 and a page-placement fix (#2905). Settings: Series S profile,
Series X profile,
Happy to run a variant if you want something specific. |
|
The sparse tests with
My guess is that these four assume a tile gets its video memory at commit, so they would need the lazy mode turned off for the test, like the Lib suite, Not tested: retail title. AI-assisted (Claude Code, Claude Sonnet 5.5 ran the tests; Claude Opus 5.5 checked and posted). |
|
Thanks for keeping this opt-in behind the tier check. Two questions and a test note, all by reading at
AI-assisted (Claude Code, Claude Opus 5.5): read the code at |
…st and version Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Requested by Prime · project thread
Stacked on #2895; only the top commit belongs here.
With
XCL_SPARSE_LAZY=1, a tile the title commits in a sparse window is listed with no pool tile and gets video memory when it is first used: the CPU's first bytes at an upload (a used pool tile is cleared right behind its mapping, before those bytes go up), a memory write recorded on a list (immediates, fills, copies, timestamps) before the list runs, or a buffer placed on it. Bytes that find no video memory are owed and go up whole once there is some. Off by default; left out on a device whose unmapped tiles do not read zeros (tiled resources tier under 2).Part of #2688 (workstream 4).
Why
On the Series S profile a retail title commits a page pool of 4.3 GB in a sparse window up front, 3,751 MB of it in tiles the CPU never writes, on an 8 GB card. In a 60 s run with no input (RTX 3060 Ti 8 GB, Series S profile) local video memory went from 7,503 MB to 3,022 MB with the switch, 542 frames against 376, 0 draws skipped either way.
What is in it
crates/xcl/src/hle/d3d12x/sparse.rs: theLAZYpool sentinel,lazy_commits/lazy_asked/ the tier check,ensure_listed(commit),materialize(first use),give_memoryandwill_write(recorded writes), thestarvedlist,runs_where;buffer_tilesleaves a tile with no memory out; copies back and zero runs pass a tile with no memory by.crates/xcl/src/hle/d3d12x/list_x.rs:note_write/note_immtellwill_write.sparse::tests(real GPU, skipped without tiled resources tier 2): a tile's first bytes reach the GPU and are still there two submits later; bytes that found no memory go up once there is some; a recorded write gives memory and a buffer never maps the sentinel; a decommitted tile frees and parks nothing, and with the switch off a commit maps at once.Tested
cargo test --locked --workspace --no-fail-fast -- --test-threads=4withXCL_DXC_DIRset to DXC 1.9.2609.5: 1820 passed, 9 failed, 48 ignored. The 9 failures are the same tests that fail onnvidia-deveae01502itself (1816passed,9failed,48ignored there, same command):async_compute_pso_registers_real_pso_and_not_standin,console_ms_in_as_slot_and_ms_with_as_are_refused_cleanly,gpu::recomp::tests::gpu_compute_thread_limits_leave_the_lanes_past_them_out,hle::d3d12x::texture_upload::tests::gpu_parts_of_a_texture_go_up_and_the_rest_stays,hle::d3d12x::texture_upload::tests::pieces_hold_the_texels_of_their_levels,split_compute_prefers_the_offline_whole_pipeline,two_pass_driver_cache_reuses_both_passes_and_recovers_corrupt_blobs.Build and test (Windows, no GPU)fails here onhle::d3d12x::sparse::tests::a_gpu_write_into_a_gpu_view_lands_in_its_cpu_view(the WARP device is removed, 0x887a0005). That test passes on the card above, on this branch and oneae01502, and fails the same way on the other open pull requests againstnvidia-dev(kernelx: physical page homes in window 0 first, from the top, keeping 64 MB free (#2867) #2905, for one).Regression run
A commit of
main(b49be183, the last one before the shader preparation screen of #2555, which prepares every record before the title and so does not fit a 60 s run):The base of this PR,
nvidia-deveae01502:This PR's head:
Not tested
AI use
Claude Code (Claude Fable 5.2 and Claude Opus 5.5) wrote the code, ran the suite and the regression runs on the hardware above, and wrote this description; Prime asked for it and owns the account. We coordinate the 8 GB work on the XCL Discord too: https://discord.gg/gK3y7WRRY
🤖 Generated with Claude Code