V-antena and Tanimoto's page

谷本の備忘録・雑記帳・work

>

CUPY INSTALLATION AFTER UPGARDE OF PIP AND CUDNN

As I had encountered errors when I tried to install cupy,
I upgrade cudnn. Then I succeeded installation of cupy.

The following is a notes on the procedure.

  1. after uninstallation of existing pip, reinstall pip

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py -user -vv
python get-pip.py -user -vv

  1. install a recent cuda-toolkit

2-1. download the cuda toolkit from https://developer.nvidia.com/cuda-toolkit-archive

2.2 install cuda-toolkit
sudo dpkg -i cuda-repo-ubuntu1804-10-0-local-10.0.130-410.48_1.0-1_amd64.deb
sudo apt-key add /var/cuda-repo-10-0-local-10.0.130-410.48/7fa2af80.pub
sudo apt-get update
sudo apt-get install cuda

  1. install cudnn

3-1 download packages for ubuntu18.04 from https://developer.nvidia.com/rdp/cudnn-download
3-2. install cudnn packages
sudo dpkg -i libcudnn7_7.3.1.20-1+cuda10.0_amd64.deb
sudo dpkg -i libcudnn7-dev_7.3.1.20-1+cuda10.0_amd64.deb
sudo dpkg -i libcudnn7-doc_7.3.1.20-1+cuda10.0_amd64.deb

3-3. replace the old cuda path with cuda-10.0 path
nano ~/.bashrc

NVIDIA CUDA Toolkit

export PATH=/usr/local/cuda/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH
export CPATH=/usr/local/cuda/include:$CPATH

source ~/.bashrc
echo $PATH |grep cuda

  1. install cupy

pip3 install -user cupy

python3
import cupy
import cupy.cudnn

failed.
modulenotfounderror: no module named ‘cupy.cudnn’

I don’t know why CPATH didn’t work well, but I did the following

pip3 uninstall cupy

set $CUDA_PATH as /usr/local/cuda
(export CUDA_PATH=/usr/local/cuda:$CUDA_PATH on .bashrc)

pip3 -v install -user cupy -no-cache-dir

python3
import cupy
import cupy.cudnn

No error.

Leave a Comment

入力エリアすべてが必須項目です。メールアドレスが公開されることはありません。

内容をご確認の上、送信してください。