mirror of
https://github.com/XuehaiPan/nvitop.git
synced 2026-05-15 14:15:55 -06:00
device: replace is_available() in _nvml_probe() with shutil.which check
Agent-Logs-Url: https://github.com/mhson-kyle/nvitop/sessions/e5fd1e19-5d52-4ab0-ac60-5b545ffb9632 Co-authored-by: mhson-kyle <72399227+mhson-kyle@users.noreply.github.com>
This commit is contained in:
parent
dd9aeb7bca
commit
7336642d29
1 changed files with 2 additions and 1 deletions
|
|
@ -109,6 +109,7 @@ import functools
|
|||
import multiprocessing as mp
|
||||
import os
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import textwrap
|
||||
|
|
@ -262,7 +263,7 @@ def _should_use_mxsmi_backend() -> bool:
|
|||
|
||||
@contextlib.contextmanager
|
||||
def _nvml_probe() -> Generator[None]:
|
||||
suppress_logs = libmxsmi.is_available()
|
||||
suppress_logs = libmxsmi.is_forced() or shutil.which('mx-smi') is not None
|
||||
logger_disabled = libnvml.LOGGER.disabled
|
||||
if suppress_logs:
|
||||
libnvml.LOGGER.disabled = True
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue