Skip to main content

Module exit

Module exit 

Source
Expand description

Leaving: no GPU work may be in flight when the process ends (issue #620). Adapted from Ember crates/gpu.

The devices are statics that are never dropped, and the threads that render (preview workers, export, denoise, the device warm-up) are not the one that ends the process. Exiting runs the driver’s own teardown while those threads keep running: a render that is inside the driver at that moment crashes there (seen as a SIGSEGV in the NVIDIA Vulkan driver), where neither the panic hook nor catch_unwind can help.

So every entry into a device goes through enter, and the host ends the process with begin_shutdown (nothing new enters) and wait_idle (what is in flight finishes, up to a deadline).

Structs§

GpuGate
Work
GPU work in flight (until dropped).

Functions§

begin_shutdown
enter
Start GPU work, or None when the process is ending: the caller then does without the GPU. Work may nest (a render that creates the device).
shutting_down
wait_idle