Snakepit.Hardware.CUDADetector (Snakepit v0.8.7)

View Source

CUDA GPU hardware detection.

Detects NVIDIA CUDA-capable GPUs using nvidia-smi when available.

Summary

Functions

Detects CUDA GPU information.

Types

cuda_device()

@type cuda_device() :: %{
  id: non_neg_integer(),
  name: String.t(),
  memory_total_mb: non_neg_integer(),
  memory_free_mb: non_neg_integer(),
  compute_capability: String.t() | nil
}

cuda_info()

@type cuda_info() :: %{
  version: String.t(),
  driver_version: String.t(),
  devices: [cuda_device()],
  cudnn_version: String.t() | nil
}

Functions

detect()

@spec detect() :: cuda_info() | nil

Detects CUDA GPU information.

Returns nil if CUDA is not available, or a map with:

  • :version - CUDA runtime version (e.g., "12.1")
  • :driver_version - NVIDIA driver version
  • :devices - List of CUDA device maps
  • :cudnn_version - cuDNN version if available, nil otherwise