mirror of
https://github.com/blakeblackshear/frigate.git
synced 2026-01-26 05:58:30 +03:00
Fix jetson stats reading
This commit is contained in:
parent
2c34e1ec10
commit
2b31c53614
@ -540,9 +540,14 @@ def get_jetson_stats() -> Optional[dict[int, dict]]:
|
|||||||
try:
|
try:
|
||||||
results["mem"] = "-" # no discrete gpu memory
|
results["mem"] = "-" # no discrete gpu memory
|
||||||
|
|
||||||
with open("/sys/devices/gpu.0/load", "r") as f:
|
if os.path.exists("/sys/devices/gpu.0/load"):
|
||||||
gpuload = float(f.readline()) / 10
|
with open("/sys/devices/gpu.0/load", "r") as f:
|
||||||
results["gpu"] = f"{gpuload}%"
|
gpuload = float(f.readline()) / 10
|
||||||
|
results["gpu"] = f"{gpuload}%"
|
||||||
|
elif os.path.exists("/sys/devices/platform/gpu.0/load"):
|
||||||
|
with open("/sys/devices/platform/gpu.0/load", "r") as f:
|
||||||
|
gpuload = float(f.readline()) / 10
|
||||||
|
results["gpu"] = f"{gpuload}%"
|
||||||
except Exception:
|
except Exception:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user