neuralib.util.gpu.check_nvidia_cuda_available

neuralib.util.gpu.check_nvidia_cuda_available(backend, check_smi=False)[source]

Checks if the GPU driver reacts and otherwise raises a custom error. Useful to check before long GPU-dependent processes.

Parameters:
  • backend (Literal['tensorflow', 'torch']) – {‘torch’, ‘tensorflow’}

  • check_smi (bool) – check if nvidia-smi is runnable

Return type:

bool