Skip to main content

try_shared_gpu

Function try_shared_gpu 

Source
pub fn try_shared_gpu() -> Option<&'static SharedGpuContext>
Expand description

Process-wide wgpu device + queue, or None when no usable GPU adapter exists (headless / integrated-only / GPU-less machine, or the tokio runtime can’t start).

Callers that can degrade to CPU MUST use this and fall back on None, rather than shared_gpu() which aborts the process. The None result is cached, so a GPU-less machine probes once. (Init is lazy and reused by QTensorEngine + render.)