rt README: after quiesce answers false, a runtime thread can still be in the driver
The planner ruled that reims's exit contract needs no new form: Device::quiesce(timeout) is that form. What the README did not say is what a false answer leaves behind. Read from the code (halt, finish, complete::run, submit::run, reaper::run, memory::run): - The GPU never goes idle. halt's wait_progress times out on the calling thread. done.stop wakes the completion thread, but its flight is not empty, so it goes back into vkWaitSemaphores(ANY, u64::MAX). It stays there until the GPU completes or the device is lost. On NVIDIA's driver a fault's semaphore never signals until a later submission, and after quiesce the runtime makes none. - A consumer callback holds the completion thread. Once the handler or listener returns, the thread goes on retiring: vkResetCommandPool, vkResetQueryPool, vkGetQueryPoolResults, the calibration read, vkWaitSemaphores and vkGetSemaphoreCounterValue. Then it ends. The submit thread held in a scheduled handler likewise goes on to vkQueueSubmit2. - In either case, the reaper drains its jobs before it ends, and the block-maker finishes its current call, so either can be past the deadline inside a pipeline creation or vkAllocateMemory/vkFreeMemory. After a true answer, every runtime thread ended and was joined, and the GPU reached the last progress value, so none is in the driver. Docs only.
This commit is contained in:
1 parent
c14df7724c
commit
0071f33d2c
1 file changed
+6
-1
@@ -829,7 +829,12 @@ every allocation still mapped. It frees nothing: every block's memory and mappin
|
||||
the process ends. After it, no runtime thread touches a block; later calls that need a thread
|
||||
return `Error::Quiesced`. It answers true once the GPU went idle and every thread ended in time,
|
||||
and false at once in a handler or a listener, whose thread cannot wait for itself. A second call
|
||||
returns at once.
|
||||
returns at once. After a false answer a runtime thread can still be in the driver (the completion
|
||||
thread in `vkWaitSemaphores` with no timeout where the GPU did not go idle, which on NVIDIA's
|
||||
driver lasts until a later submission that after quiesce the runtime never makes, or in its
|
||||
retirement calls once a handler that held it returns, and the reaper or the block-maker in a
|
||||
pipeline creation or a memory call that outlasted the timeout), so a process that gets false ends
|
||||
without running exit handlers (`_exit`): a known gap on NVIDIA.
|
||||
|
||||
The consumer quiesces before it calls `exit()`. Quiesce can also run in an `atexit` handler, on
|
||||
whichever thread calls `exit()`: it joins a thread only once that thread has ended, reads no
|
||||
|
||||
Reference in new issue
Block a user