Skip to main content

detect/
detect.rs

1// SPDX-License-Identifier: Apache-2.0
2//! Print every GPU detected on this host: `cargo run --example detect`.
3
4fn main() {
5    let gpus = gpu_probe::detect();
6    if gpus.is_empty() {
7        println!("No GPUs detected.");
8        return;
9    }
10    for (index, gpu) in gpus.iter().enumerate() {
11        println!("GPU {index}: {gpu}");
12    }
13}