Skip to contents

Returns information about available GPU devices including name, memory, compute capability, and backend (CUDA or OpenCL).

Usage

gpu_info()

Value

A list with GPU information, or NULL if no GPU is available.

available

Logical; whether GPU is available

backend

Character; "cuda", "opencl", or "none"

device_count

Integer; number of GPU devices

devices

List of device info (name, memory, compute capability)

Examples

info <- gpu_info()
if (!is.null(info) && info$available) {
  cat("GPU backend:", info$backend, "\n")
  cat("Devices:", info$device_count, "\n")
}