[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
This commit is contained in:
pre-commit-ci[bot] 2026-07-27 23:19:34 +00:00
commit 534ba3bfa2

View file

@ -1175,6 +1175,7 @@ def _has_usable_nvidia_gpu() -> bool:
cvd = os.environ.get("CUDA_VISIBLE_DEVICES") cvd = os.environ.get("CUDA_VISIBLE_DEVICES")
if cvd is not None and cvd.strip() in ("", "-1"): if cvd is not None and cvd.strip() in ("", "-1"):
return False return False
def _lists_a_gpu(exe: str) -> bool: def _lists_a_gpu(exe: str) -> bool:
try: try:
result = subprocess.run( result = subprocess.run(
@ -1200,19 +1201,21 @@ def _has_usable_nvidia_gpu() -> bool:
if _path_exe: if _path_exe:
candidates.append(_path_exe) candidates.append(_path_exe)
if IS_WINDOWS: if IS_WINDOWS:
candidates.extend(( candidates.extend(
os.path.join( (
os.environ.get("ProgramFiles", r"C:\Program Files"), os.path.join(
"NVIDIA Corporation", os.environ.get("ProgramFiles", r"C:\Program Files"),
"NVSMI", "NVIDIA Corporation",
"nvidia-smi.exe", "NVSMI",
), "nvidia-smi.exe",
os.path.join( ),
os.environ.get("SystemRoot", r"C:\Windows"), os.path.join(
"System32", os.environ.get("SystemRoot", r"C:\Windows"),
"nvidia-smi.exe", "System32",
), "nvidia-smi.exe",
)) ),
)
)
for _candidate in candidates: for _candidate in candidates:
if _candidate != _path_exe and not os.path.isfile(_candidate): if _candidate != _path_exe and not os.path.isfile(_candidate):
continue continue