From 8eb4b15b2d193430f667921eed079f6088c69860 Mon Sep 17 00:00:00 2001 From: Iordanis Fostiropoulos Date: Thu, 27 Jul 2023 00:04:17 +0000 Subject: [PATCH] The NVML does not return the correct strut for latest CUDA. --- pynvml/nvml.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/pynvml/nvml.py b/pynvml/nvml.py index d09894b..329241b 100644 --- a/pynvml/nvml.py +++ b/pynvml/nvml.py @@ -1099,6 +1099,7 @@ class c_nvmlProcessInfo_t(_PrintableStructure): ('usedGpuMemory', c_ulonglong), ('gpuInstanceId', c_uint), ('computeInstanceId', c_uint), + ("index", c_ssize_t), ] _fmt_ = {'usedGpuMemory': "%d B", } @@ -1566,7 +1567,7 @@ class c_nvmlGpuInstanceProfileInfo_v2_t(_PrintableStructure): ("memorySizeMB", c_ulonglong), ("name", c_char * NVML_DEVICE_NAME_V2_BUFFER_SIZE) ] - + def __init__(self): super(c_nvmlGpuInstanceProfileInfo_v2_t, self).__init__(version=nvmlGpuInstanceProfileInfo_v2) @@ -4024,7 +4025,7 @@ def nvmlGpuInstanceGetComputeInstanceProfileInfo(device, profile, engProfile, ve c_info = c_nvmlComputeInstanceProfileInfo_t() fn = _nvmlGetFunctionPointer("nvmlGpuInstanceGetComputeInstanceProfileInfo") else: - raise NVMLError(NVML_ERROR_FUNCTION_NOT_FOUND) + raise NVMLError(NVML_ERROR_FUNCTION_NOT_FOUND) ret = fn(device, profile, engProfile, byref(c_info)) _nvmlCheckReturn(ret) return c_info @@ -4508,7 +4509,7 @@ def nvmlDeviceSetNvLinkDeviceLowPowerThreshold(device, l1threshold): fn = _nvmlGetFunctionPointer("nvmlDeviceSetNvLinkDeviceLowPowerThreshold") ret = fn(device, byref(c_info)) _nvmlCheckReturn(ret) - return ret + return ret _nvmlGpuFabricState_t = c_uint NVML_GPU_FABRIC_STATE_NOT_SUPPORTED = 0