Closed haikuoyao closed 5 years ago
In C/C++ you can use the function get_gpus(). But this function is not part of the caffe library. This needs to be explicitly implemented.
@ravibanger Thanks a lot. I just do this in my python code
def is_available():
"""
Check NVIDIA with nvidia-smi command
Returning code 0 if no error, it means NVIDIA is installed
Other codes mean not installed
"""
code = os.system('nvidia-smi')
return code == 0
Anyone knows, how can I check if GPU or CUDA exists before setting gpu model
Thanks.