vkback: wait on our own queue at teardown, not the whole device #56
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/vktory6--VKtory!56
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-56"
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?
@TheRifai on GitHub · 2026-12-01 08:43 UTC · original
TheRifai:vkback-queue-wait-idle→main· +26 −6 · 2 files · 2 commits · merged 2026-12-01 09:13 UTCWhat
Issue #38:
vkDeviceWaitIdleonvkback-live(presenter recreate, presenter drop, backend drop) racesvkQueueBindSparseon umem's bind thread. The spec requires every queue of the device to be externally synchronized forvkDeviceWaitIdle.Replace the three calls with
queue_wait_idleon vkback's own queue (Presenter now storesd.queue). This waits for the blits/presents the code was waiting for, while leaving the sparse queue free to progress — so work held behind binds cannot deadlock the wait (making the bind thread wait for device idle could). umem's own drop waits for its binds before freeing the memory they name.Evidence
cargo check -p vkbackandcargo test -p vkbackpass (no teardown hang in the native tests).@vktory6 on GitHub · 2026-12-01 09:13 UTC · original
Merged, thanks! Waiting for our own queue is the right fix. umem's binds run on a queue of their own (a non-graphics family with sparse binding), so the wait no longer touches the queue the bind thread uses, and nothing behind the binds can hold it up.
One commit of mine on top (
b554c36): vkback's queue is also the submission thread's, so the waits must not run beside itsvkQueueSubmiteither (external sync). All three now holddev::queue_lock()while they wait, asdev.rsalready does for its own wait.Check on the reference system (RX 9070 XT): tests and policy pass, and the house-scene validation run shows no new error and no threading report. The thread-safety line from #38 is off the validation list.