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 <Harish.Kasiviswanathan@amd.com>
Change-Id: I53efe67ac88fb0824cf4820430b46c18bc7692df
[ROCm/amdsmi commit: 1c9e384c8f]
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user