To install cuda compatible pytorch, we need to install:

  1. CUDA Toolkit
  2. cuDNN
  3. Pytorch

Before installing CUDA Toolkit and cuDNN, please double check if you have already installed it previously. If you have please skip! If you have, skip straight to installing Pytorch-CUDA version!

To check CUDA version:

nvidia-smi
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 536.45                 Driver Version: 536.45       CUDA Version: 12.2     |
|-----------------------------------------+----------------------+----------------------+

Installing CUDA Toolkit:

Based on your CUDA Version, download appropriate CUDA Toolkit from: https://developer.nvidia.com/cuda-toolkit

image.png

Follow the installation instructions in the page.

Install cuDNN:

Make sure you do this step AFTER installing CUDA Toolkit.

For Downloading cuDNN we need to register our account on the NVIDIA website: