From e272f8885fa6940bc4bd1fff54f363bc026d8ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Silva?= Date: Sun, 7 Jun 2026 12:10:51 +0200 Subject: [PATCH] fix auto-installer on windows by updating pip on virtual env --- setup.py | 91 ++++++++++++++++++++++++++++++-------------------------- 1 file changed, 48 insertions(+), 43 deletions(-) diff --git a/setup.py b/setup.py index 9fba80f89..77b220482 100644 --- a/setup.py +++ b/setup.py @@ -179,32 +179,32 @@ def load_config(): sys.exit(1) with open(CONFIG_PATH, 'r') as f: return json.load(f) -def get_gpu_info(): - if sys.platform == "darwin": - try: - out = subprocess.check_output( - ["system_profiler", "SPDisplaysDataType"], - encoding="utf-8", - stderr=subprocess.DEVNULL - ) - for line in out.split("\n"): - if "Chip" in line: - name = line.split(":", 1)[1].strip() - return name, "APPLE" - except: - pass - return "Apple Silicon (MPS)", "APPLE" - - try: - name = subprocess.check_output( - ["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"], - encoding='utf-8', - stderr=subprocess.DEVNULL - ).strip() - return name, "NVIDIA" - except: pass - - if IS_WIN: +def get_gpu_info(): + if sys.platform == "darwin": + try: + out = subprocess.check_output( + ["system_profiler", "SPDisplaysDataType"], + encoding="utf-8", + stderr=subprocess.DEVNULL + ) + for line in out.split("\n"): + if "Chip" in line: + name = line.split(":", 1)[1].strip() + return name, "APPLE" + except: + pass + return "Apple Silicon (MPS)", "APPLE" + + try: + name = subprocess.check_output( + ["nvidia-smi", "--query-gpu=name", "--format=csv,noheader"], + encoding='utf-8', + stderr=subprocess.DEVNULL + ).strip() + return name, "NVIDIA" + except: pass + + if IS_WIN: try: name = subprocess.check_output( "wmic path win32_VideoController get name", @@ -230,11 +230,11 @@ def get_gpu_info(): return "Unknown", "UNKNOWN" -def get_profile_key(gpu_name, vendor): - g = gpu_name.upper() - if vendor == "APPLE": - return "MPS" - if vendor == "NVIDIA": +def get_profile_key(gpu_name, vendor): + g = gpu_name.upper() + if vendor == "APPLE": + return "MPS" + if vendor == "NVIDIA": if "50" in g: return "RTX_50" if "40" in g: return "RTX_40" if "30" in g: return "RTX_30" @@ -247,10 +247,10 @@ def get_profile_key(gpu_name, vendor): return "AMD_GFX110X" return "RTX_40" -def get_os_key(): - if sys.platform == "darwin": - return "macos" - return "win" if IS_WIN else "linux" +def get_os_key(): + if sys.platform == "darwin": + return "macos" + return "win" if IS_WIN else "linux" def resolve_cmd(cmd_entry): if isinstance(cmd_entry, dict): @@ -370,6 +370,11 @@ def install_logic(env_name, env_type, env_path, py_k, torch_k, triton_k, sage_k, pip = template["install"].format(dir=env_path) + # Upgrade pip in the freshly-created environment + if env_type in ["venv", "uv"]: + py_exec = template["run"].format(dir=env_path) + run_cmd(f"{py_exec} -m pip install --upgrade pip setuptools wheel") + print(f"\n[2/3] Installing Torch: {config['components']['torch'][torch_k]['label']}...") torch_cmd = resolve_cmd(config['components']['torch'][torch_k]['cmd']) run_cmd(f"{pip} {torch_cmd}") @@ -935,12 +940,12 @@ def create_wgp_config(profile_key, config_data): prof_settings = config_data['gpu_profiles'].get(profile_key, {}) - attn_mode = prof_settings.get("attention", "") - if not attn_mode: - if "50" in profile_key or "40" in profile_key or "30" in profile_key: - attn_mode = "sage2" - elif "20" in profile_key: - attn_mode = "sage" + attn_mode = prof_settings.get("attention", "") + if not attn_mode: + if "50" in profile_key or "40" in profile_key or "30" in profile_key: + attn_mode = "sage2" + elif "20" in profile_key: + attn_mode = "sage" compile_mode = "" triton_key = prof_settings.get('triton') @@ -1094,5 +1099,5 @@ def repair_git_repo(): else: print("\n[*] Code is already up to date. Skipping requirements installation.") - elif args.mode == "upgrade": - do_upgrade(cfg) + elif args.mode == "upgrade": + do_upgrade(cfg)