neuralib.util.gpu

Get basic GPU info table and verbose

  • cuda driver (Windows/Linux)

  • metal backend support (MacOS)

from neuralib.util.gpu import print_gpu_table
print_gpu_table()
neuralib.util.gpu.print_gpu_table(backend, *, check_smi=False)[source]

Print GPU info table and check the compatibility with backend package

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

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

Returns:

Return type:

None

neuralib.util.gpu.gpu_available(backend, *, check_smi=False)[source]
Parameters:
  • backend (Literal['tensorflow', 'torch']) – {‘torch’, ‘tensorflow’}

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

Returns:

Return type:

bool

neuralib.util.gpu.check_mps_available(backend)[source]

Check if metal is available

Parameters:

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

Returns:

bool

Return type:

bool

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