Skip to contents

Reports whether gputools can use a CUDA device: the package was built with CUDA, the NVIDIA driver is installed and at least one GPU is visible. The GPU functions stop with an error when it is FALSE.

Usage

gpuAvailable()

Details

A gputools installed where configure could not find the CUDA toolkit (for example a binary built on a server without CUDA) loads, but its GPU functions cannot run; it says so when attached. Install the NVIDIA CUDA toolkit (11.7 or later), make it findable – set CUDA_HOME to its directory, or put nvcc on the PATH – and reinstall gputools from source.

Value

TRUE, or FALSE with a "reason" attribute saying why no device can be used.

See also

Examples

if (gpuAvailable()) getGpuId()