From 0313fd9ae6950af93070cc705d7c3dbcc0d61511 Mon Sep 17 00:00:00 2001 From: iperov Date: Tue, 5 Feb 2019 18:14:46 +0400 Subject: [PATCH] fix nvml if it has not nvmlDeviceGetCudaComputeCapability dll function --- nnlib/pynvml.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/nnlib/pynvml.py b/nnlib/pynvml.py index 113fdc2..95b8875 100644 --- a/nnlib/pynvml.py +++ b/nnlib/pynvml.py @@ -1704,7 +1704,11 @@ def nvmlDeviceGetTopologyCommonAncestor(device1, device2): def nvmlDeviceGetCudaComputeCapability(device): c_major = c_int() c_minor = c_int() - fn = _nvmlGetFunctionPointer("nvmlDeviceGetCudaComputeCapability") + + try: + fn = _nvmlGetFunctionPointer("nvmlDeviceGetCudaComputeCapability") + except: + return 9, 9 # get the count ret = fn(device, byref(c_major), byref(c_minor))