From 608afb879b34752d965815c4fbcb6976a05da491 Mon Sep 17 00:00:00 2001 From: Harish Kasiviswanathan Date: Tue, 20 Apr 2021 13:39:33 -0400 Subject: [PATCH] Suppress warning message in getFanSpeed function Many data center cards are fanless. Don't show warning if unable to get fan speed. The fan speed will be reported as 0 Signed-off-by: Harish Kasiviswanathan Change-Id: I53efe67ac88fb0824cf4820430b46c18bc7692df [ROCm/amdsmi commit: 1c9e384c8f96d7fdd83f9a82ba1bab632b6e1c30] --- projects/amdsmi/python_smi_tools/rocm_smi.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/amdsmi/python_smi_tools/rocm_smi.py b/projects/amdsmi/python_smi_tools/rocm_smi.py index 16241be58c..37fbc081fb 100755 --- a/projects/amdsmi/python_smi_tools/rocm_smi.py +++ b/projects/amdsmi/python_smi_tools/rocm_smi.py @@ -179,10 +179,10 @@ def getFanSpeed(device): fm = 0 ret = rocmsmi.rsmi_dev_fan_speed_get(device, sensor_ind, byref(fanLevel)) - if rsmi_ret_ok(ret, device): + if rsmi_ret_ok(ret, device, None, True): fl = fanLevel.value ret = rocmsmi.rsmi_dev_fan_speed_max_get(device, sensor_ind, byref(fanMax)) - if rsmi_ret_ok(ret, device): + if rsmi_ret_ok(ret, device, None, True): fm = fanMax.value if fl == 0 or fm == 0: return (fl, fm) # to prevent division by zero crash