File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed
Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff 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+
350359def 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" :
You can’t perform that action at this time.
0 commit comments