Skip to content

Commit

Permalink
[rocm_smi.py]: fix fan 255% error
Browse files Browse the repository at this point in the history
signed-off-by: Elena Sakhnovitch
Change-Id: I265ba32bc3777db5f04f1924547fe432ba78c3d0
(cherry picked from commit 2f84906)
  • Loading branch information
Elena Sakhnovitch authored and Elena Sakhnovitch committed Oct 4, 2021
1 parent 1447c83 commit 98635ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python_smi_tools/rocm_smi.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def getFanSpeed(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
return (fl, 0) # to prevent division by zero crash

return (fl, round((float(fl) / float(fm)) * 100, 2))

Expand Down

0 comments on commit 98635ec

Please sign in to comment.