Skip to content

Commit

Permalink
handle when cuda devices in powered down state
Browse files Browse the repository at this point in the history
  • Loading branch information
tobybreckon committed Jan 13, 2025
1 parent 73cc61c commit bd9fa53
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions version.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]")

#####################################################################

Expand Down

0 comments on commit bd9fa53

Please sign in to comment.