"examples/vscode:/vscode.git/clone" did not exist on "d675d2218e5b271e8434cd03bb3384a2641f12b1"
Commit 5820c750 authored by Tim O'Donnell's avatar Tim O'Donnell
Browse files

Fix get_nvidia_cc to handle cases where cuda.cuGetErrorString gives a None result

parent baf15f8f
......@@ -82,13 +82,16 @@ def get_nvidia_cc():
result = cuda.cuInit(0)
if result != CUDA_SUCCESS:
cuda.cuGetErrorString(result, ctypes.byref(error_str))
return None, error_str.value.decode()
if error_str.value:
return None, error_str.value.decode()
else:
return None, "Unknown error: cuInit returned %d" % result
result = cuda.cuDeviceGetCount(ctypes.byref(nGpus))
if result != CUDA_SUCCESS:
cuda.cuGetErrorString(result, ctypes.byref(error_str))
return None, error_str.value.decode()
if(nGpus.value < 1):
if nGpus.value < 1:
return None, "No GPUs detected"
result = cuda.cuDeviceGet(ctypes.byref(device), 0)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment