From dc347164a2f26568355445213c444fd1d88ba305 Mon Sep 17 00:00:00 2001 From: Nikolai Poliarnyi Date: Sun, 13 Aug 2023 15:10:35 +0300 Subject: [PATCH] i3pystatus.utils.gpu: fix nvidia-smi support - be ready for [unknown error] output --- i3pystatus/utils/gpu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/i3pystatus/utils/gpu.py b/i3pystatus/utils/gpu.py index 3715cda7..832ef39f 100644 --- a/i3pystatus/utils/gpu.py +++ b/i3pystatus/utils/gpu.py @@ -10,8 +10,8 @@ def _convert_nvidia_smi_value(value) -> Optional[int]: value = value.lower() # If value contains 'not' or 'N/A' - it is not supported for this GPU - # (in fact, for now nvidia-smi returns '[Not Supported]' or '[N/A]' depending of its version) - if "not" in value or "n/a" in value: + # (in fact, for now nvidia-smi returns '[Not Supported]' or '[N/A]' or '[unknown error]' depending of its version) + if "not" in value or "n/a" in value or "error" in value: return None return int(value)