Skip to content

Commit c8fce79

Browse files
committed
use cu126 for 10 series and older GPUs
1 parent 6685e53 commit c8fce79

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

modules/launch_utils.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,17 @@ def early_access_blackwell_wheels():
347347
return f'pip install {ea_whl.get(sys.version_info.minor)}'
348348

349349

350+
def get_default_torch_index_url():
351+
"""Choose default torch index url based on GPU CUDA compute capability
352+
Nvidia 10 series and older GPUs (Compute Capability < 7.0) should use cu126 wheels
353+
"""
354+
if get_cuda_comp_cap() < 7.0:
355+
return "https://download.pytorch.org/whl/cu126"
356+
return "https://download.pytorch.org/whl/cu128"
357+
358+
350359
def prepare_environment():
351-
torch_index_url = os.environ.get('TORCH_INDEX_URL', "https://download.pytorch.org/whl/cu128")
360+
torch_index_url = os.environ.get('TORCH_INDEX_URL', get_default_torch_index_url())
352361
torch_command = os.environ.get('TORCH_COMMAND', f"pip install torch==2.7.0 torchvision==0.22.0 --extra-index-url {torch_index_url}")
353362
if args.use_ipex:
354363
if platform.system() == "Windows":

0 commit comments

Comments
 (0)