基本はこれ。
https://doraemonkokoro.blogspot.com/2016/
今回はコレ。ただし、これは上とは違ってchainer用ではありません。pytorch用です。下記環境ではchainerはすでに動かないと思われます。
sudo apt install python3
sudo apt install python3-pip
sudo pip3 install -U setuptools
sudo pip3 install -U cython
sudo pip3 install -U filelock
https://developer.nvidia.com/cuda-toolkit
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/cuda-ubuntu2004.pin
sudo mv cuda-ubuntu2004.pin /etc/apt/preferences.d/cuda-repository-pin-600
wget https://developer.download.nvidia.com/compute/cuda/11.1.0/local_installers/cuda-repo-ubuntu2004-11-1-local_11.1.0-455.23.05-1_amd64.deb
sudo dpkg -i cuda-repo-ubuntu2004-11-1-local_11.1.0-455.23.05-1_amd64.deb
sudo apt-key add /var/cuda-repo-ubuntu2004-11-1-local/7fa2af80.pub
sudo apt-get update
sudo apt-get -y install cuda
sudo reboot
https://medium.com/analytics-vidhya/installing-tensorflow-with-cuda-cudnn-gpu-support-on-ubuntu-20-04-f6f67745750a
cd ###
sudo cp -P cuda/lib64/* /usr/local/cuda/lib64/
sudo cp cuda/include/* /usr/local/cuda/include/
sudo chmod 644 /usr/local/cuda/include/cudnn.h /usr/local/cuda/lib64/libcudnn*
sudo vi ~/.bashrcで以下を一番下に付け加える。copy & paste
export CUDA_ROOT=/usr/local/cuda
export PATH=$PATH:/usr/local/cuda/bin
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib64:
export CPATH=$CPATH:/usr/local/cuda/include
export CUDA_INC_DIR=/usr/local/cuda/bin:$CUDA_INC_DIR
sudo reboot
sudo apt-get install git