Skip to main content

require_gpu_preflight

Function require_gpu_preflight 

Source
pub fn require_gpu_preflight() -> Result<(), String>
Expand description

Require-GPU preflight, independent of backend routing.

When the policy is not GpuRuntimePolicy::Required this is a no-op and returns Ok(()). When it is required, the contract is to refuse to run when no usable GPU adapter is detected. This check fires on the no-GPU path the flag exists for; it does not depend on select_backend having chosen GPU first.

Returns Err(diagnostic) when no acquired CUDA or WGPU peer passes the production region-presence parity self-test. The caller maps that to the documented exit code 12. Returning an Err here - rather than calling std::process::exit from the library - keeps embedders alive (finding M12).