I want to download pytorch with cuda=11.7. I find not only pip install but also conda install will download the cudatoolkit.
The pip comand is
pip install torch==1.13.1+cu117 torchvision==0.14.1+cu117 torchaudio==0.13.1 --extra-index-url https://download.pytorch.org/whl/cu117
The conda comand is :
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.7 -c pytorch -c nvidia
Why does these two methods will all download the cudatoolkit?
I’m not sure I understand the question completely, but both binaries ship with their CUDA dependencies and allow you to execute PyTorch code directly without installing a full CUDA toolkit locally. You would only need to install the NVIDIA drivers.
2 Likes
That is what I need! Thanks so much. I find there is some slight difference between Pytorch versions. For example in v1.12.1 the download command is :
conda install pytorch==1.12.1 torchvision==0.13.1 torchaudio==0.12.1 cudatoolkit=11.6 -c pytorch -c conda-forge
And in Pytorch v1.13.1 it is :
conda install pytorch==1.13.1 torchvision==0.14.1 torchaudio==0.13.1 pytorch-cuda=11.6 -c pytorch -c nvidia
Does the v1.12.1 download the cudatoolkit while v1.13.1 only download CUDA runtime and other binaries such as cudnn and cublas rather than cudatoolkit?
The install commands can differ depending on our build process but both should install a PyTorch conda binary able to execute workloads on the GPU.
Thanks! An awesome reply.
Hi, I want to install pytorch with gpu on a machine with CUDA 12.3. I tried with a virtualenv with pip and a conda environment. In the conda environment torch.cuda.is_available yields true but in the virtualenv it yields false.
Is there a difference between the binaries sent or how the library is built between the two ?
(I tried installing the 2.3.1 version with cuda 12.1 in both cases for reference)
1 Like
I’m sorry I don’t use python virtual environment. In my opinion pytorch installation in conda environment only needs nvidia driver rather than nvcc. Maybe in your virtualenv you need to check your nvcc is installed.
1 Like
I checked with an install of nvcc on the virtualenv for cuda 12.3 but it didn’t work sadly.
The CUDA toolkit (including the compiler) is neither needed when installing the conda binaries nor the pip wheels.
The binaries themselves are build using different processes.