Hold freed memory for the program's own with_vk_queue submissions, and tear the device down on its own thread
On drivers that park freed memory (MoltenVK among them), memory freed while the program's own with_vk_queue submissions may still use it now waits for them, by a mark each use signals. The watch of those marks and the release of freed memory hold only the device parts they use, never the device, and teardown closes the parking first and waits for the handler threads: the program's last drop tears the device down on its own thread before it returns, as Metal's last release does (vkDestroyDevice needs external synchronization and every child object destroyed first). freed_memory.rs is listed among the modules that may keep the device's functions, with that reason. Verified: the freed-memory and teardown tests on ANV, lavapipe and the M3 through MoltenVK (14 of 14 each), the two teardown tests fail without the fix, and the presenting test that crashed in the batch passed 20 of 20 on the M3. Folds in: - Hold MoltenVK's freed memory for the program's own with_vk_queue submissions, by a mark each use signals - Hold nothing of the device in the watch of the program's marks and the releases of freed memory - List freed_memory.rs among the modules that keep the device's functions
This commit is contained in:
1 parent
8b5d74d9aa
commit
6898b52edf
11 files changed
+702
-81
No files matched your search
+3
-2
@@ -1992,8 +1992,9 @@ fast forms record, and each `PrecisionNote`'s rustdoc states its bound.
|
||||
unnamed holds a table of the live buffers that lists it (its first submission's and its host
|
||||
steps', until it completes; one a rebind encoded again before its first submission, until then);
|
||||
with no keep-alive on MoltenVK (`RuntimeDriverDefect::FreedAddressMemoryFailsPendingWork`), while
|
||||
the batches submitted before the import's memory went are in flight, as MoltenVK fails pending work
|
||||
that reads device addresses where such memory is freed. With a keep-alive the deallocator runs at
|
||||
the batches submitted before the import's memory went, and the program's own submissions through
|
||||
`CommandQueue::with_vk_queue` before it, are in flight, as MoltenVK fails pending work that reads
|
||||
device addresses where such memory is freed. With a keep-alive the deallocator runs at
|
||||
the release, as Metal's, and the import keeps the keep-alive, which keeps the pages mapped, until
|
||||
it is freed: not announced.
|
||||
Cost: the deallocator runs once every such command buffer lets go of the pages, or those batches
|
||||
|
||||
Reference in new issue
Block a user