File tree Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Expand file tree Collapse file tree 1 file changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -347,8 +347,21 @@ 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 (CC)
352+ Use cu126 for CC <= 7.2, cu128 for CC > 7.2
353+ PyTorch have dropped support for older GPUs on their cu128 and above wheels,
354+ For Nvidia 10 series and older GPUs (CC < 7.0) should use cu126 wheels
355+ Since GPUs with CC <= 7.2 are considered legacy by Nvidia
356+ ref 2025-11-07 https://developer.nvidia.com/cuda-legacy-gpus
357+ """
358+ if get_cuda_comp_cap () <= 7.2 :
359+ return "https://download.pytorch.org/whl/cu126"
360+ return "https://download.pytorch.org/whl/cu128"
361+
362+
350363def prepare_environment ():
351- torch_index_url = os .environ .get ('TORCH_INDEX_URL' , "https://download.pytorch.org/whl/cu128" )
364+ torch_index_url = os .environ .get ('TORCH_INDEX_URL' , get_default_torch_index_url () )
352365 torch_command = os .environ .get ('TORCH_COMMAND' , f"pip install torch==2.7.0 torchvision==0.22.0 --extra-index-url { torch_index_url } " )
353366 if args .use_ipex :
354367 if platform .system () == "Windows" :
You can’t perform that action at this time.
0 commit comments