From 100e3318129fa86153d5c3bca09d1133a6588968 Mon Sep 17 00:00:00 2001 From: Divya Shikre Date: Tue, 31 May 2022 16:17:42 -0400 Subject: [PATCH] Print log when PIDs dont use any GPU device. showpidgpus prints 'none' when no GPU devices are being used by the running process. Adding a fix to print a relevant message. Signed-off-by: Divya Shikre Change-Id: I165a6644a76c8e1c3c3cad676dcfd41eb1c4724f [ROCm/rocm_smi_lib commit: dcab8863946f902b41b07a1bfc4b0f835c3d1bb5] --- projects/rocm-smi-lib/python_smi_tools/rocm_smi.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py b/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py index 2224edd8ec..04dc643019 100755 --- a/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py +++ b/projects/rocm-smi-lib/python_smi_tools/rocm_smi.py @@ -1613,7 +1613,10 @@ def showGpusByPid(pidList): if rsmi_ret_ok(ret): metricName = 'PID %s is using %s DRM device(s)' % (pid, str(num_devices.value)) - printListLog(metricName, list(dv_indices)) + if (num_devices.value): + printListLog(metricName, list(dv_indices)) + else: + printLog(None, metricName, None) else: print(None, 'Unable to get list of KFD PIDs. A kernel update may be needed', None) printLogSpacer()