From 9b17ca17b5e4a7e8bd620b494b9ef5ee7184e3f5 Mon Sep 17 00:00:00 2001 From: jvrobert Date: Thu, 2 Feb 2023 12:59:50 -0700 Subject: [PATCH] ignore non digit GPU indexes --- frigate/util.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frigate/util.py b/frigate/util.py index 734ec6d31..e63f31387 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -926,9 +926,9 @@ def get_nvidia_gpu_stats() -> dict[str, str]: "--format=csv", ] - if ("CUDA_VISIBLE_DEVICES" in os.environ): + if ("CUDA_VISIBLE_DEVICES" in os.environ and os.environ["CUDA_VISIBLE_DEVICES"].isdigit()): nvidia_smi_command.extend(["--id", os.environ['CUDA_VISIBLE_DEVICES']]) - elif ("NVIDIA_VISIBLE_DEVICES" in os.environ): + elif ("NVIDIA_VISIBLE_DEVICES" in os.environ and os.environ["NVIDIA_VISIBLE_DEVICES"].isdigit()): nvidia_smi_command.extend(["--id", os.environ['NVIDIA_VISIBLE_DEVICES']]) p = sp.run(