diff --git a/frigate/util.py b/frigate/util.py index 5d0858170..02433b358 100755 --- a/frigate/util.py +++ b/frigate/util.py @@ -927,15 +927,15 @@ def get_nvidia_gpu_stats() -> dict[str, str]: ] if ( - "CUDA_VISIBLE_DEVICES" in os.environ + "CUDA_VISIBLE_DEVICES" in os.environ and os.environ["CUDA_VISIBLE_DEVICES"].isdigit() ): - nvidia_smi_command.extend(["--id", os.environ['CUDA_VISIBLE_DEVICES']]) + nvidia_smi_command.extend(["--id", os.environ["CUDA_VISIBLE_DEVICES"]]) elif ( - "NVIDIA_VISIBLE_DEVICES" in os.environ + "NVIDIA_VISIBLE_DEVICES" in os.environ and os.environ["NVIDIA_VISIBLE_DEVICES"].isdigit() ): - nvidia_smi_command.extend(["--id", os.environ['NVIDIA_VISIBLE_DEVICES']]) + nvidia_smi_command.extend(["--id", os.environ["NVIDIA_VISIBLE_DEVICES"]]) p = sp.run( nvidia_smi_command,