Step by step instruction to install Cuda, Cudnn , Tensorflow and Pytorch for GPU environment

To install CUDA, CUDNN, TensorFlow, and PyTorch for GPU, you will need to follow the steps below:

  1. Install NVIDIA drivers:

  • Check if you have an NVIDIA GPU in your system by running the command lspci | grep -i nvidia in the terminal.
  • If you do not have an NVIDIA GPU, you will not be able to use CUDA and CUDNN.
  • If you do have an NVIDIA GPU, you will need to install the appropriate NVIDIA drivers for your GPU. You can find the latest drivers on the NVIDIA website (https://www.nvidia.com/Download/index.aspx).
  • Follow the instructions provided on the NVIDIA website to install the drivers.
  1. Check the version here:

     3. Microsoft Visual Studio:

      4. Install CUDA:

  1. Install CUDNN:

  1. Install TensorFlow:

  • Install TensorFlow with GPU support by using the following command:
conda create --name tf_2.4 python==3.8
activate tf_2.4
pip install tensorflow-gpu
  1. Install PyTorch:

#CUDA 11.3
pip install torch==1.12.1+cu113 torchvision==0.13.1+cu113 torchaudio==0.12.1 --extra-index-url https://download.pytorch.org/whl/cu113

oR

#CUDA 11.6 conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia

Note: These instructions are for installing the latest versions of CUDA, CUDNN, TensorFlow, and PyTorch. If you want to install specific versions, you will need to specify the version numbers in the relevant commands.

 

Read more about:   Classification model with Python code from Scratch

Add a Comment

Your email address will not be published. Required fields are marked *