diff --git a/version.py b/version.py index dce0f02..7e147da 100644 --- a/version.py +++ b/version.py @@ -88,10 +88,14 @@ def non_free_opencv_algorithms_present(): ##################################################################### -for gpu in range(cv2.cuda.getCudaEnabledDeviceCount()): - print("CUDA enabled GPU device index: " + str(gpu) + " ") - cv2.cuda.printShortCudaDeviceInfo(gpu) - print() +try: + for gpu in range(cv2.cuda.getCudaEnabledDeviceCount()): + print("CUDA enabled GPU device index: " + str(gpu) + " ") + cv2.cuda.printShortCudaDeviceInfo(gpu) + print() +except BaseException: + print("No CUDA enabled devices found : " + + "[none present or in powered down state]") #####################################################################