V-antena and Tanimoto's page

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

>

カテゴリー: linux ubuntu

CATEGORY ARCHIVE

CUPY INSTALLATION ON UBUNTU18.04 MEMO

s I had encountered errors when I tried to install cupy,on Ubuntu 18.04

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/cudn
    n-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-10.0/bin:$PATH
export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH

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’

so I did the following
pip3 uninstall cupy

set $CUDA_PATH as /usr/local/cuda

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

python3
import cupy
import cupy.cudnn

No error.

cupy installation on ubuntu18.04 memo

As I had encountered errors when I tried to install cupy, 
 on Ubuntu 18.04

 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
 install a recent cuda-toolkit 

 2-0. You should insatll nvidia-drivers first. the followings.
 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

3.0 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-10.0/bin:$PATH
 export LD_LIBRARY_PATH=/usr/local/cuda-10.0/lib64:$LD_LIBRARY_PATH
 source ~/.bashrc
 echo $PATH |grep cuda
 install cupy 
 pip3 install --user cupy
 python3
   import cupy
   import cupy.cudnn
 failed. 
    modulenotfounderror: no module named 'cupy.cudnn' 
 so I did the following

 4.0 pip3 uninstall cupy

 set $CUDA_PATH as /usr/local/cuda
 pip3 -v install --user cupy --no-cache-dir
 python3
   import cupy
   import cupy.cudnn

 No error.

 additional
 sudo cp /usr/local/cuda/include/cuda_fp16.hpp /usr/include
 sudo cp /usr/local/cuda/include/cuda_fp16.h   /usr/include

LLVMのインストール(UBUNTU 18.04)

LLVMのインストール(Ubuntu 18.04)

メモリーが3GB以上ないと長い時間がかかったあげく、outofmemoryで失敗するので注意。

1.最初にSVNをインストールしておく
  (下記のサイトを参考にした)
 How to Install SVN Server on Ubuntu 18.04 & 16.04 LTS
 
 但し、libapache2-svn がインストール出来なかった
 また、sudo service apache2 restart の位置は/etc/apache2/mods-enabled/dav_svn.c$
 変更が必要
 203 sudo apt update
 204 sudo apt upgrade
 205 sudo apt autoremove
 208 sudo apt install texinfo
 211 sudo apt install perl
 212 sudo apt install m4
 213 sudo apt install autoconf
 214 sudo apt install automake
 215 sudo apt install libtool
 216 sudo apt install apache2
 218 sudo apt-get install subversion libapache2-mod-svn libsvn-dev
 223 sudo a2enmod dav
 224 sudo a2enmod dav_svn
 226 sudo nano /etc/apache2/mods-enabled/dav_svn.conf
 Alias /svn /var/lib/svn
 
 DAV svn
 SVNParentPath /var/lib/svn
 AuthType Basic
 AuthName “Subversion Repository”
 AuthUserFile /etc/apache2/dav_svn.passwd
 Require valid-user
 
 225 sudo service apache2 restart
 228 sudo apt install graphviz xdot
 233 sudo mkdir -p /var/lib/svn/
 234 sudo svnadmin create /var/lib/svn/myrepo
 235 sudo chown -R www-data:www-data /var/lib/svn
 236 sudo chmod -R 775 /var/lib/svn
 237 sudo nano /etc/apache2/dav_svn.passwd
 238 sudo htpasswd -cm /etc/apache2/dav_svn.passwd admin
 2. llvm installation 
 229 mkdir llvm
 230 cd llvm
 svn co http://llvm.org/svn/llvm-project/llvm/trunk llvm
 cd llvm/tools
 svn co http://llvm.org/svn/llvm-project/cfe/trunk clang
 cd ../projects
 svn co http://llvm.org/svn/llvm-project/compiler-rt/trunk compiler-rt
 mkdir ~/llvm/llvm-build
 cd ~/llvm/llvm-build
 ここから、http://llvm.org/docs/CMake.html を参考にした。
 cmake ~/llvm/llvm
 cmake ?build .
 sudo cmake -DCMAKE_INSTALL_PREFIX=/usr/local/llvm -P cmake_install.cmake
 cmake ?build . ?target install
 nano ~/.bashrc
 export PATH=$PATH:/usr/local/llvm/bin
 source ~/.bashrc

BLACK SCREEN WHEN LOGIN AFTER UBUNTU UPGRADE FROM 17.10 TO 18.04

I encountered black screen when login after ubuntu upgrade from 17.10 to 18.04

My tentative solution has been the following.

sudo apt install nvidia-cuda-toolkit
sudo apt install clinfo
sudo apt-add-repository ppa:graphics-drivers/ppa
sudo apt update
sudo apt upgrade
sudo reboot
nvidia-smi
clinfo

sudo apt install lightdm
(choose lightdm)
; countermeasurea black screen
sudo reboot

UBUNTU 17.10でCUDA8.0, NVIDIA-284でGNUバージョンエラーと/USR/BIN/LD: CANNOT FIND
-LNVCUVIDエラー

ubuntu 17.10でcuda8.0, nvidia-284でGNUバージョンエラーと/usr/bin/ld: cannot find-lnvcuvidエラー

NVIDIA_CUDA-8.0_Samplesでsampleをmakeしようとすると2種類のエラー発生したのでその対策

1.GNUバージョンエラー対策

$ sudo apt-get install gcc-4.8
$ sudo apt-get install g++-4.8
$ sudo update-alternatives ?install /usr/bin/gcc gcc /usr/bin/gcc-4.8 20
$ sudo update-alternatives ?install /usr/bin/g++ g++ /usr/bin/g++-4.8 20

  1. /usr/bin/ld: cannot find -lnvcuvidエラー対策

$ sudo cp /usr/lib/nvidia-384/libnvcuvid.so /usr/local/cuda-8.0/lib64
$ sudo cp /usr/lib/nvidia-384/libnvcuvid.so.1 /usr/local/cuda-8.0/lib64

これでsampleがmakeできる様になり動かせた。