clamp gpu usage to fix thermald crash (#21548)

pull/20864/head
Adeeb Shihadeh 4 years ago committed by GitHub
parent eb37e409ee
commit 3adfd1d53b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      selfdrive/hardware/eon/hardware.py

@ -381,6 +381,7 @@ class Android(HardwareBase):
def get_gpu_usage_percent(self):
try:
used, total = open('/sys/devices/soc/b00000.qcom,kgsl-3d0/kgsl/kgsl-3d0/gpubusy').read().strip().split()
return 100.0 * int(used) / int(total)
perc = 100.0 * int(used) / int(total)
return min(max(perc, 0), 100)
except Exception:
return 0

Loading…
Cancel
Save