Repository navigation
Conversation
|
Thanks. Getting 766 MiB back for 2 MiB bound is a clear win, and this is a good fix to have now. (Longer term, the page table goes away: device addresses would be served from a sparse mirror of guest memory. That work is paused, so this PR is worth having.) A few changes first:
On GPU cost: the table is read on every device-address access, but each lookup is a random 8-byte read, and in our measurements of sparse buffers, random reads cost the same however the 64 KiB blocks were placed. No objection there. |
simnJS
left a comment
There was a problem hiding this comment.
Please rebase the sparse page table directly onto AnyKyty so it can land independently of #312. Gate it on sparse binding, a sparse-capable queue, sparseResidencyBuffer and residencyNonResidentStrict, with a dense fallback. A bind currently exposes backing before the zero fill is recorded. Order every reader before the bind or after initialization. Please cover unbound lookups, untouched entries in newly bound blocks, registration and removal, and the dense fallback under validation. Include the heap budget in allocation failures.
e92a88b to
a733a97
Compare
|
Thanks for the review. Updated; the branch is now one commit on
Tested on Windows (RTX 2070 SUPER) in two runs of the same scene, with no device loss or stop in either. The run with a block counter bound 48 blocks (3 MiB of 768 MiB), each zeroed before its bind. |
|
Your review crossed my push by a few seconds: the rebase onto
Run on Windows, RTX 2070 SUPER 617.42, with |
simnJS
left a comment
There was a problem hiding this comment.
The split from #312, strict-residency gate, dense fallback, zero-before-bind ordering and heap diagnostics are in this revision. The sparse and dense fixture results also cover the requested cases. GitHub now reports a conflict with AnyKyty. Please rebase, retain both test registrations and test friend declarations, and rerun both CI workflows. Please confirm the sparse and dense cases under validation on the rebased head.
…registered The page table holds an entry for every 16 KiB page of the guest address space and took 768 MiB of VRAM. It is now a sparse-resident buffer whose 64 KiB blocks are zeroed and then bound on first write, on devices with strict non-resident reads; elsewhere it stays a plain buffer.
…se residency Checks that unbound and untouched entries read 0, registered pages hold their device addresses and removed ones read 0 again, on a sparse-resident table and on the dense fallback.
|
Rebased onto On the rebased head, Windows, RTX 2070 SUPER 617.42, with |
2bcd370 to
6b2320a
Compare
|
I closed the companion PR I mistakenly opened against the contributor fork. The focused fixture fix remains available as one commit based on this PR's current head |
What
m_bda_pagetable_buffer= 8 B per 16 KiB page of the whole guest range = 768 MiB of VRAM, almost all zero.Buffer(…, Buffer::SparseResident, flags, size): sparse binding + residency buffer without memory whengraphics.partial_buffers_enabled, else a normal buffer.partial_buffers_enabledneedssparseBinding,sparseResidencyBuffer,residencyNonResidentStrictand a sparse-binding queue; it enables onlysparseBindingandsparseResidencyBuffer.Buffer::Commit(offset, size): for each missing 64 KiB block, allocates memory (one VMA allocation each), binds it to a plain transfer buffer and zero-fills it in its own submit;vkQueueBindSparsewaits on that submit's semaphore, then on a fence. A block is never visible before it holds zeros. A failed allocation logs each heap's usage and budget.Tested
Windows 10, RTX 2070 SUPER 617.42, 3D scene of a title that streams textures:
Buffer:stop. Both ended at ~3 min on my 7800 MiB VRAM guard, from streamed textures (kyty: device memory cap does not bound VRAM on NVIDIA/Windows; heap-pinned textures are never freed #315), not from this buffer.kyty_shim_bda_page_table_sparseandkyty_shim_bda_page_table_dense(unbound entries, untouched entries of a newly backed block, registration, removal) andkyty_shim_buffer_cache_pagespass withVK_LAYER_KHRONOS_validation1.4.363 inserted, with noVUID-messages.check_conventions.pyandcheck_kyty_settings.pypass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)