mahmoodn
(Mahmood Naderan)
April 11, 2025, 11:54am
1
Hi
The following set of commands, according to the official page, to install PyTorch 2.6 in a virtual environment fail.
[m@login02 llama2-70b]$ python3 -m venv pt26-cu124
[m@login02 llama2-70b]$ source ./pt26-cu124/bin/activate
(pt26-cu124) [m@login02 llama2-70b]$ export CUDA_HOME=/scratch/m/cuda-toolkit/12.4.0
(pt26-cu124) [m@login02 llama2-70b]$ export PATH=$CUDA_HOME/bin:$PATH
(pt26-cu124) [m@login02 llama2-70b]$ export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
(pt26-cu124) [m@login02 llama2-70b]$ pip3 install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu124
Collecting torch
Could not find a version that satisfies the requirement torch (from versions: )
No matching distribution found for torch
Any way to fix that?
Our install instructions for PyTorch 2.6 with CUDA 12.4 on Linux show a simple pip install torch
command. I don’t know where you have found the wrong instructions you have posted as no env variable manipulation or index-url is needed for this build.
mahmoodn
(Mahmood Naderan)
April 11, 2025, 3:26pm
3
I am sorry. I selected Windows. Thank you.
mahmoodn
(Mahmood Naderan)
April 11, 2025, 3:51pm
4
Sorry for bothering again. According to the figure below, the pip command should install 2.6 version.
I have created an empty virtual env for that, and ran the following commands.
[m@login03 ~]$ python3 -m venv pt26-cu124
[m@login03 ~]$ source ./pt26-cu124/bin/activate
(pt26-cu124) [m@login03 ~]$ export CUDA_HOME=/scratch/m/cuda-toolkit/12.4.0
(pt26-cu124) [m@login03 ~]$ export PATH=$CUDA_HOME/bin:$PATH
(pt26-cu124) [m@login03 ~]$ export LD_LIBRARY_PATH=$CUDA_HOME/lib64:$LD_LIBRARY_PATH
(pt26-cu124) [m@login03 ~]$ pip3 install torch torchvision torchaudio
Collecting torch
Using cached torch-1.10.2-cp36-cp36m-manylinux1_x86_64.whl (881.9 MB)
Collecting torchvision
Using cached torchvision-0.11.2-cp36-cp36m-manylinux1_x86_64.whl (23.3 MB)
Collecting torchaudio
Using cached torchaudio-0.10.1-cp36-cp36m-manylinux1_x86_64.whl (2.9 MB)
Collecting dataclasses
Using cached dataclasses-0.8-py3-none-any.whl (19 kB)
Collecting typing-extensions
Using cached typing_extensions-4.1.1-py3-none-any.whl (26 kB)
Collecting torch
Downloading torch-1.10.1-cp36-cp36m-manylinux1_x86_64.whl (881.9 MB)
|████████████████████████████████| 881.9 MB 17 kB/s
Collecting pillow!=8.3.0,>=5.3.0
Downloading Pillow-8.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.1 MB)
|████████████████████████████████| 3.1 MB 136.6 MB/s
Collecting numpy
Downloading numpy-1.19.5-cp36-cp36m-manylinux2010_x86_64.whl (14.8 MB)
|████████████████████████████████| 14.8 MB 133.5 MB/s
Installing collected packages: typing-extensions, dataclasses, torch, pillow, numpy, torchvision, torchaudio
Successfully installed dataclasses-0.8 numpy-1.19.5 pillow-8.4.0 torch-1.10.1 torchaudio-0.10.1 torchvision-0.11.2 typing-extensions-4.1.1
(pt26-cu124) [m@login03 ~]$ pip3 list
Package Version
----------------- -------
dataclasses 0.8
numpy 1.19.5
Pillow 8.4.0
pip 21.3.1
torch 1.10.1
torchaudio 0.10.1
torchvision 0.11.2
typing_extensions 4.1.1
As you can see torch 1.10.1
has been installed.
Would you please clarify what to do?
Python 3.6 is not supported anymore as our current binaries require Python >= 3.9.
From the install instructions:
NOTE: Latest PyTorch requires Python 3.9 or later.