you don’t need to download a full CUDA toolkit and would only need to install a compatible NVIDIA driver, since PyTorch binaries ship with their own CUDA dependencies.
That means you do not need to install cuda toolkit system-wide. You only need to install cuda drivers in step 2 then proceed to step 3 to install pytorch.
Refer to this official guide from nvidia.
Select suitable settings and install cuda toolkit, then look below and install proper cuda drivers if you have not done so.
nvcc
Refer to this guide from stackoverflow, there are instruction that recommend using apt to install the toolkit
sudo apt install nvidia-cuda-toolkit but for Pytorch users, you may want to start from step 2 first.
nvcc might have been already installed during cuda toolkit installation, make sure to find it first in /usr/local/cuda/bin/nvcc before reinstalling a new one. Normally nvcc is not in the PATH.
2. cuda drivers
See the official guide from NVIDIA
Note that Driver Installer section only shows up after you have selected your settings for cuda toolkit
Of use these commands
For 535sudo aptitude install nvidia-driver-535 nvidia-dkms-535
Refer to this official URL from pytorch.
You do not need to find a pytorch version compatible with the cuda toolkit version in step 1. pytorch installation will find and install the compatible cuda toolkit itself locally (in conda environment, for example).
Note: for a complete guide, refer to this https://github.com/nguyenvulong/QA/issues/75 If you just want it to work, read on
1. cuda toolkit
If you are a
pytorch
user (Source).That means you do not need to install
cuda toolkit
system-wide. You only need to installcuda drivers
in step 2 then proceed to step 3 to installpytorch
.Refer to this official guide from nvidia. Select suitable settings and install
cuda toolkit
, then look below and install propercuda drivers
if you have not done so.nvcc Refer to this guide from stackoverflow, there are instruction that recommend using
apt
to install the toolkitsudo apt install nvidia-cuda-toolkit
but for Pytorch users, you may want to start from step 2 first.nvcc
might have been already installed during cuda toolkit installation, make sure to find it first in/usr/local/cuda/bin/nvcc
before reinstalling a new one. Normallynvcc
is not in thePATH
.2. cuda drivers
See the official guide from NVIDIA Note that
Driver Installer
section only shows up after you have selected your settings forcuda toolkit
Of use these commands For 535
sudo aptitude install nvidia-driver-535 nvidia-dkms-535
For 555
3. pytorch
Refer to this official URL from pytorch. You do not need to find a
pytorch
version compatible with thecuda toolkit
version in step 1.pytorch
installation will find and install the compatiblecuda toolkit
itself locally (inconda
environment, for example).4. read more
Compatibility Matrix (official URL from nvidia)
nvidia ecosystem https://docs.nvidia.com/datacenter/tesla/drivers/index.html