Skip to content

i3pystatus.utils.gpu: fix nvidia-smi support - be ready for [Unknown Error] #850

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: current
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions i3pystatus/utils/gpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down