From eb08cc3e077bff64a794eecaa70e6b67ba07d7de Mon Sep 17 00:00:00 2001 From: w-e-w <40751091+w-e-w@users.noreply.github.com> Date: Fri, 7 Nov 2025 19:14:39 +0900 Subject: [PATCH] use cu126 for 10 series and older GPUs --- modules/launch_utils.py | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/modules/launch_utils.py b/modules/launch_utils.py index 394804f67..175d7611f 100644 --- a/modules/launch_utils.py +++ b/modules/launch_utils.py @@ -347,8 +347,21 @@ def early_access_blackwell_wheels(): return f'pip install {ea_whl.get(sys.version_info.minor)}' +def get_default_torch_index_url(): + """Choose default torch index url based on GPU CUDA Compute Capability (CC) + Use cu126 for CC <= 7.2, cu128 for CC > 7.2 + PyTorch have dropped support for older GPUs on their cu128 and above wheels, + For Nvidia 10 series and older GPUs (CC < 7.0) should use cu126 wheels + Since GPUs with CC <= 7.2 are considered legacy by Nvidia + ref 2025-11-07 https://developer.nvidia.com/cuda-legacy-gpus + """ + if get_cuda_comp_cap() <= 7.2: + return "https://download.pytorch.org/whl/cu126" + return "https://download.pytorch.org/whl/cu128" + + def prepare_environment(): - torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu128") + torch_index_url = os.environ.get('TORCH_INDEX_URL', get_default_torch_index_url()) torch_command = os.environ.get('TORCH_COMMAND', f"pip install torch==2.7.0 torchvision==0.22.0 --extra-index-url {torch_index_url}") if args.use_ipex: if platform.system() == "Windows":