Is a CUDA Device Usable?
gpuAvailable.RdReports 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.
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.
Examples
if (gpuAvailable()) getGpuId()