While installing PyTorch with GPU support on Ubuntu (22.04 LTS), I ran into a few unknowns.
First of all, I checked that I have installed NVIDIA drivers using nvidia-smi command.
What I got as a result was a table in which I found: NVIDIA-SMI 535.154.05 / Driver Version: 535.154.05 / CUDA Version 12.2.
It shows that I have installed the drivers for the GPU.
Then, I checked that I have CUDA installed using nvcc --version command and I got: Build cuda_11.5.r11.5/compiler, so it also means that I have CUDA installed.
Now I want to install PyTorch using the instructions on the official site and here is the first question:
- Which Compute Platform should I choose? On the official PyTorch site I can choose 11.8 and 12.1, but I have CUDA 11.5 installed. What is the relation between CUDA Version (12.2) obtained from nvidia-smi, CUDA 11.5 obtained from nvcc --version and CUDA version given in PyTorch installation website?
And I have few question about general PyTorch installation:
- Installing PyTorch from the command below will make me have PyTorch installed along with the CUDA drivers? Can I use this command without having CUDA drivers installed before?
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch -c nvidia
-
Assuming I don’t have NVIDIA and CUDA drivers installed what steps should I follow before installing PyTorch? What are the correct steps to follow in general to install PyTorch correctly? Should I install NVIDIA GPU Drivers, then install cuDNN, then install CUDA Toolkt and then finally install PyTorch?
-
What we need cuDNN and CUDA Toolkit for in terms of using PyTorch?
-
What is the difference between installing PyTorch using conda and pip? Both can install drivers for my local computer?
-
After installing PyTorch I found that I have different version of CUDA in my computer. nvcc --version shows 11.5, but torch.version.cuda shows 12.1. What does this difference come from and what I can do with that issue? Does PyTorch use locally installed CUDA?