'Upgrade CUDNN to 8.2 in google colab

I wan to use upgrade the CUDNN version from 8.0 to 8.1 and CUDA version to 11.2, but I am not sure how we can do this on colab. Below is the script I wrote to run on google colab,but it changes nothing. What changes do I need to make here ? or is there any other way to do it ?

!sudo apt install cuda-toolkit-11-2
!wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/cuda-ubuntu1604.pin
!sudo mv cuda-ubuntu1604.pin /etc/apt/preferences.d/cuda-repository-pin-600
!sudo apt-key adv --fetch-keys http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/7fa2af80.pub
!sudo add-apt-repository "deb http://developer.download.nvidia.com/compute/cuda/repos/ubuntu1604/x86_64/ /"
!sudo apt-get update
!sudo apt-get -y install cuda
!sudo apt --fix-broken install
!sudo apt install cuda-cudart-11-2
import os
os.environ['PATH'] = '/usr/local/cuda-11.2/bin:/usr/local/nvidia/bin:/usr/local/cuda/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/tools/node/bin:/tools/google-cloud-sdk/bin:/opt/bin'
os.environ['LD_LIBRARY_PATH'] = '/usr/local/cuda-11.2/lib64:/usr/local/cuda-11.2/lib64:/usr/lib64-nvidia'
!cp "/content/drive/My Drive/cudnn-11.2-linux-x64-v8.1.0.0.tgz" "/content/cudnn-11.2.tgz"
!mkdir cudnn
!tar -C cudnn/ -zxvf cudnn-11.2.tgz
%cd cudnn/
!sudo cp cuda/include/cudnn*.h /usr/local/cuda-11.2/include
!sudo cp cuda/lib64/libcudnn* /usr/local/cuda-11.2/lib64
!sudo chmod a+r /usr/local/cuda-11.2/include/cudnn*.h /usr/local/cuda-11.2/lib64/libcudnn*
!sudo ldconfig
%cd /content/

Check CUDA and CUDNN version

! nvcc --version
!nvidia-smi

import chainer

print("-----------------SYSTEM INFO----------------------")
chainer.print_runtime_info()

I am trying to use Tensorflow object detection and following this link for checking the compatible versions of cuda and cudann : link



Solution 1:[1]

Just change the runtime type to a TPU. This worked for me

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ukachi Osisiogu