From b14d755faa800914676cf384a43da384bfceae01 Mon Sep 17 00:00:00 2001 From: jvrobert Date: Thu, 2 Feb 2023 12:03:06 -0700 Subject: [PATCH] Try to limit nvidia GPU queries to included GPUs --- frigate/util.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/frigate/util.py b/frigate/util.py index 69ead2a7a..734ec6d31 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -926,6 +926,11 @@ def get_nvidia_gpu_stats() -> dict[str, str]: "--format=csv", ] + if ("CUDA_VISIBLE_DEVICES" in os.environ): + nvidia_smi_command.extend(["--id", os.environ['CUDA_VISIBLE_DEVICES']]) + elif ("NVIDIA_VISIBLE_DEVICES" in os.environ): + nvidia_smi_command.extend(["--id", os.environ['NVIDIA_VISIBLE_DEVICES']]) + p = sp.run( nvidia_smi_command, encoding="ascii",