Skip to main content

detect_gpu

Function detect_gpu 

Source
pub fn detect_gpu() -> Result<Device, RuntimeError>
Expand description

Detect the best available GPU on the system.

Checks in order: Metal (macOS), CUDA (nvidia-smi), ROCm (rocminfo), oneAPI (sycl-ls). Falls back to the WAVE emulator if no GPU is found.

ยงErrors

Returns RuntimeError::Device if detection encounters an unrecoverable error.