From 1d7265f45349da8cc979754d2cabce871e910d7a Mon Sep 17 00:00:00 2001 From: Nick Mowen Date: Sat, 24 Sep 2022 18:54:15 -0600 Subject: [PATCH] Format AMD with space between percent --- frigate/util.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/frigate/util.py b/frigate/util.py index 23ad9a3c9..32bd5bcaf 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -806,9 +806,9 @@ def get_amd_gpu_stats() -> dict[str, str]: for hw in usages: if "gpu" in hw: - results["gpu_usage"] = hw.strip().split(" ")[1] + results["gpu_usage"] = f"{hw.strip().split(' ')[1].split(' ')[0]} %" elif "vram" in hw: - results["memory_usage"] = hw.strip().split(" ")[1] + results["memory_usage"] = f"{hw.strip().split(' ')[1].split(' ')[0]} %" return results @@ -831,7 +831,7 @@ def get_nvidia_gpu_stats() -> dict[str, str]: logger.error(p.stderr) return None else: - usages = p.stdout.split("\n")[1].split(",") + usages = p.stdout.split("\n")[1].strip() results: dict[str, str] = { "name": usages[0], "gpu_usage": usages[1],