From 6ac518a7758a0da67ade8c3075ae1c022fdd77d3 Mon Sep 17 00:00:00 2001 From: Xuehai Pan Date: Sat, 26 Aug 2023 10:35:18 +0000 Subject: [PATCH] fix(api/libnvml): fix upstream changes for process info v3 APIs on 535.104.05 driver --- nvitop/api/libnvml.py | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/nvitop/api/libnvml.py b/nvitop/api/libnvml.py index a613891..8bbc702 100644 --- a/nvitop/api/libnvml.py +++ b/nvitop/api/libnvml.py @@ -606,9 +606,15 @@ if not _pynvml_installation_corrupted: if lookup('nvmlDeviceGetConfComputeMemSizeInfo'): if lookup('nvmlDeviceGetComputeRunningProcesses_v3'): - LOGGER.debug( - 'NVML get running process version 3 API with v3 type struct is available.', - ) + if lookup('nvmlDeviceGetRunningProcessDetailList'): + c_nvmlProcessInfo_t = c_nvmlProcessInfo_v2_t + LOGGER.debug( + 'NVML get running process version 3 API with v2 type struct is available.', + ) + else: + LOGGER.debug( + 'NVML get running process version 3 API with v3 type struct is available.', + ) else: c_nvmlProcessInfo_t = c_nvmlProcessInfo_v2_t __get_running_processes_version_suffix = '_v2'