mirror of
https://github.com/vladmandic/automatic
synced 2026-09-20 01:31:13 +02:00
+2
-2
@@ -104,8 +104,8 @@ def get_gpu_info():
|
||||
elif torch.cuda.is_available() and torch.version.cuda:
|
||||
try:
|
||||
import subprocess
|
||||
result = subprocess.run('nvidia-smi --query-gpu=driver_version --format=csv,noheader', shell=True, check=False, env=os.environ, capture_output=True)
|
||||
version = result.stdout.decode(encoding="utf8", errors="ignore").strip()
|
||||
result = subprocess.run('nvidia-smi --query-gpu=driver_version --format=csv,noheader', shell=True, check=False, env=os.environ, capture_output=True, text=True)
|
||||
version = result.stdout.strip()
|
||||
return version
|
||||
except Exception:
|
||||
return ''
|
||||
|
||||
+2
-2
@@ -31,8 +31,8 @@ def dirname(path_: str, r: int = 1) -> str:
|
||||
|
||||
|
||||
def spawn(command: str | list[str], cwd: os.PathLike = '.') -> str:
|
||||
process = subprocess.run(command, cwd=cwd, shell=True, check=False, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL)
|
||||
return process.stdout.decode(encoding="utf8", errors="ignore")
|
||||
process = subprocess.run(command, cwd=cwd, shell=True, check=False, capture_output=True, text=True)
|
||||
return process.stdout
|
||||
|
||||
|
||||
def load_library_global(path_: str):
|
||||
|
||||
Reference in New Issue
Block a user