diff --git a/crates/reims-vgpu-c/include/reims_vgpu.h b/crates/reims-vgpu-c/include/reims_vgpu.h index 99155f9b4..c2758ac23 100644 --- a/crates/reims-vgpu-c/include/reims_vgpu.h +++ b/crates/reims-vgpu-c/include/reims_vgpu.h @@ -700,10 +700,10 @@ RvgStatus rvg_graphics_device_pool_removed(RvgGraphicsDevice *device, uint64_t p // Asks for at least `length` more bytes of the guest's Shared pool now, ahead of the guest's own // ask, as that ask does: the device's pool thread takes a block of at least `length` bytes (one -// metal2vulkan-runtime unit, 16 MiB, for each piece of the guest's headroom) and asks the host to map -// it (pool_add). QEMU calls it for its device's `x-pool-grow` property. RVG_ERR_INVALID_ARGUMENT -// for a device without a pool or a `length` of 0. On any thread: waits for nothing. Calls back: -// never. +// metal2vulkan-runtime unit, 16 MiB, for each piece of the guest's headroom) and asks the host to +// map it (pool_add). QEMU calls it for its device's `x-pool-grow` property. +// RVG_ERR_INVALID_ARGUMENT for a device without a pool or a `length` of 0. On any thread: waits +// for nothing. Calls back: never. // // # Safety // `device` is a live graphics device handle. @@ -745,20 +745,20 @@ void rvg_graphics_device_release(RvgGraphicsDevice *device); // no call made and a graphics device unreleased ends with `_exit` there instead. It takes no // handle: the GPU devices the library keeps are the process's. Its answer is whether the host may // then call `exit`. The library's threads park for good at their next call into it, and its calls -// in progress on other threads are waited for; on the platform over metal2vulkan-runtime, then, where a -// GPU device is still live, the runtime's threads end and the GPU completes what was submitted, -// and GPU work asked for on this thread after it is refused. Nothing is freed, and a call on -// another thread after it never returns. Every wait ends within `timeout_ms`. True where the calls -// ended in time and, on the Vulkan platform, the library never opened a GPU device in the process, -// or, on the platform over metal2vulkan-runtime, it keeps none (the release of the last graphics device -// let go of them). False otherwise, the device stopped or not, and where a call outlasted the -// wait: the library then writes its degradation counts, and the host runs its own exit work and -// ends with `_exit` rather than `exit`, since neither platform's runtime supports an `exit` with a -// device live (on NVIDIA's driver one can end in SIGSEGV inside the driver's exit handler), and on -// Linux the Vulkan platform's runtime can end the process with `_exit` inside its own exit -// handler, before the host's ran, while its work outlasts the let-go of its device (a pipeline's -// making in the driver). A second call on the same thread answers at once, with the first answer. -// Calls back: never. +// in progress on other threads are waited for; on the platform over metal2vulkan-runtime, then, +// where a GPU device is still live, the runtime's threads end and the GPU completes what was +// submitted, and GPU work asked for on this thread after it is refused. Nothing is freed, and a +// call on another thread after it never returns. Every wait ends within `timeout_ms`. True where +// the calls ended in time and, on the Vulkan platform, the library never opened a GPU device in +// the process, or, on the platform over metal2vulkan-runtime, it keeps none (the release of the +// last graphics device let go of them). False otherwise, the device stopped or not, and where a +// call outlasted the wait: the library then writes its degradation counts, and the host runs its +// own exit work and ends with `_exit` rather than `exit`, since neither platform's runtime +// supports an `exit` with a device live (on NVIDIA's driver one can end in SIGSEGV inside the +// driver's exit handler), and on Linux the Vulkan platform's runtime can end the process with +// `_exit` inside its own exit handler, before the host's ran, while its work outlasts the let-go +// of its device (a pipeline's making in the driver). A second call on the same thread answers at +// once, with the first answer. Calls back: never. bool rvg_quiesce_for_exit(uint64_t timeout_ms); // The device's region: its first byte, page-aligned, and, through `size` where it is not NULL, diff --git a/crates/reims-vgpu-c/src/graphics.rs b/crates/reims-vgpu-c/src/graphics.rs index 50955f067..af21fa572 100644 --- a/crates/reims-vgpu-c/src/graphics.rs +++ b/crates/reims-vgpu-c/src/graphics.rs @@ -712,10 +712,10 @@ pub unsafe extern "C" fn rvg_graphics_device_pool_removed( /// Asks for at least `length` more bytes of the guest's Shared pool now, ahead of the guest's own /// ask, as that ask does: the device's pool thread takes a block of at least `length` bytes (one -/// metal2vulkan-runtime unit, 16 MiB, for each piece of the guest's headroom) and asks the host to map -/// it (pool_add). QEMU calls it for its device's `x-pool-grow` property. RVG_ERR_INVALID_ARGUMENT -/// for a device without a pool or a `length` of 0. On any thread: waits for nothing. Calls back: -/// never. +/// metal2vulkan-runtime unit, 16 MiB, for each piece of the guest's headroom) and asks the host to +/// map it (pool_add). QEMU calls it for its device's `x-pool-grow` property. +/// RVG_ERR_INVALID_ARGUMENT for a device without a pool or a `length` of 0. On any thread: waits +/// for nothing. Calls back: never. /// /// # Safety /// `device` is a live graphics device handle. @@ -813,20 +813,20 @@ pub unsafe extern "C" fn rvg_graphics_device_release(device: *mut RvgGraphicsDev /// no call made and a graphics device unreleased ends with `_exit` there instead. It takes no /// handle: the GPU devices the library keeps are the process's. Its answer is whether the host may /// then call `exit`. The library's threads park for good at their next call into it, and its calls -/// in progress on other threads are waited for; on the platform over metal2vulkan-runtime, then, where a -/// GPU device is still live, the runtime's threads end and the GPU completes what was submitted, -/// and GPU work asked for on this thread after it is refused. Nothing is freed, and a call on -/// another thread after it never returns. Every wait ends within `timeout_ms`. True where the calls -/// ended in time and, on the Vulkan platform, the library never opened a GPU device in the process, -/// or, on the platform over metal2vulkan-runtime, it keeps none (the release of the last graphics device -/// let go of them). False otherwise, the device stopped or not, and where a call outlasted the -/// wait: the library then writes its degradation counts, and the host runs its own exit work and -/// ends with `_exit` rather than `exit`, since neither platform's runtime supports an `exit` with a -/// device live (on NVIDIA's driver one can end in SIGSEGV inside the driver's exit handler), and on -/// Linux the Vulkan platform's runtime can end the process with `_exit` inside its own exit -/// handler, before the host's ran, while its work outlasts the let-go of its device (a pipeline's -/// making in the driver). A second call on the same thread answers at once, with the first answer. -/// Calls back: never. +/// in progress on other threads are waited for; on the platform over metal2vulkan-runtime, then, +/// where a GPU device is still live, the runtime's threads end and the GPU completes what was +/// submitted, and GPU work asked for on this thread after it is refused. Nothing is freed, and a +/// call on another thread after it never returns. Every wait ends within `timeout_ms`. True where +/// the calls ended in time and, on the Vulkan platform, the library never opened a GPU device in +/// the process, or, on the platform over metal2vulkan-runtime, it keeps none (the release of the +/// last graphics device let go of them). False otherwise, the device stopped or not, and where a +/// call outlasted the wait: the library then writes its degradation counts, and the host runs its +/// own exit work and ends with `_exit` rather than `exit`, since neither platform's runtime +/// supports an `exit` with a device live (on NVIDIA's driver one can end in SIGSEGV inside the +/// driver's exit handler), and on Linux the Vulkan platform's runtime can end the process with +/// `_exit` inside its own exit handler, before the host's ran, while its work outlasts the let-go +/// of its device (a pipeline's making in the driver). A second call on the same thread answers at +/// once, with the first answer. Calls back: never. #[unsafe(no_mangle)] pub extern "C" fn rvg_quiesce_for_exit(timeout_ms: u64) -> bool { ffi::export(|| {