Skip to main content

is_gpu_available

Function is_gpu_available 

Source
pub async fn is_gpu_available() -> bool
Expand description

Check if GPU is available on the current system.

This is a convenience function that attempts to create a GPU context and returns whether it succeeded.

ยงExamples

use oxigdal_gpu::is_gpu_available;

if is_gpu_available().await {
    println!("GPU acceleration available!");
} else {
    println!("GPU not available, falling back to CPU");
}