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()