[pr-fix][memory] RESIDENT_LATER: sends and descriptor writes wait until the memory asked for is resident and mapped #57
Loading…
Reference in a new issue
No description provided.
Delete branch "Sobo/Darner:resident-later"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
With DARNER_RESIDENT_LATER=1, before_send() only made the queue wait on
the card for the residency fence. Being resident is not being mapped:
lists could start before new memory was mapped into the card's address
space, and the device was lost a second into the start (RTX 3090; not
with the debug layer). before_send() now waits on the sending thread as
settle() does, for the fence and then for the mapping, and only when
something asked is not settled yet.
before_send() is now called before every ExecuteCommandLists of ours in
darner-gpu that lacked it (execute_unwaited, the present copy, the
defrag counter readback, the readback engine, the upload queue, the
awake keeper, the bus rig, hwrt, and the tests), except mapped()'s own
aside queue, which is what it waits with. The stats line counts sends
that waited. Nothing changes with DARNER_RESIDENT_LATER off: nothing is
asked, and before_send() returns at once.
Co-Authored-By: Claude Opus 5.5 [email protected]
Fluxer-ID: 1577742832095989771
Contributor role (optional)
What it changes
Affects only
DARNER_RESIDENT_LATER=1(off by default).mainalready hasresident_soon,ASKED/SETTLED,settle(),wait_asked()(fence, then mapping) and abefore_send(queue)at most send sites, but thatbefore_sendonly makes the queue wait on the card for the residency fence (queue.Wait): the memory is resident then, not necessarily mapped, and that is the case that removed the device here.before_send(queue)returns at once when nothing is asked or everything asked is settled; otherwise it waits on the sending thread withwait_asked(asked)(fence and mapping), counted inLATER_STATS[5].before_sendadded at the send sites that still lacked it (host.rs: the unwaited execute, the present copy, the defrag counter read-back; alias_rt, draw, gpu_owned, gpudetile, hwrt, indirect, tiles, host/awake, host/bus, host/card_steps, host/stamps, host/upq).mapped()'s own aside queue saying why it has none (the wait itself uses it); log and doc wording "sends that waited".How it was tested
main4a92569fb(git.gtahub.st) with this patch applied. Build check:cargo clippy -p darner-gpu --all-targets --target x86_64-pc-windows-msvc --locked -- -D warnings: clean.cargo testwas not run (no Windows machine for the checks). The gameplay numbers below come from my own builds, which carried this change together with other local changes (same scene, settings and hardware before and after).darner warm --used --againwithDARNER_WARM_SHARED=1.DARNER_RESIDENT_LATER=1the device was removed at startup every time (two builds with only extra queue waits still lost it; a run with the D3D12 debug layer did not, the timing changed).Checklist
main.docs/asset-policy.md.Checked for overlap
WIP: RESIDENT_LATER: sends and descriptor writes wait until the memory asked for is resident and mappedto [pr-fix][memory] RESIDENT_LATER: sends and descriptor writes wait until the memory asked for is resident and mappedView command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.