diff --git a/projects/amdsmi/python_smi_tools/rocm_smi.py b/projects/amdsmi/python_smi_tools/rocm_smi.py index b03e2f08bf..73ed8c8f99 100755 --- a/projects/amdsmi/python_smi_tools/rocm_smi.py +++ b/projects/amdsmi/python_smi_tools/rocm_smi.py @@ -186,6 +186,9 @@ def getFanSpeed(device): if rsmi_ret_ok(ret, device): fm = fanMax.value + if fm == 0: + return (fl, fm) # to prevent division by zero crash + return (fl, round((float(fl) / float(fm)) * 100, 2))