digits 5.0 with nvidia caffe 0.15.14 on ubuntu 20.04 with RTX 2070 Super

An install log for nvidia caffe 0.15.14 on ubuntu 20.04 with RTX 2070 Super. The main difficulty is that the gpu requires a newer version of CUDA while digits and caffe requires older versions. The version of python is 2.7.

  • Install Ubuntu 20.04 LTS
    • Install the OS from an ISO image.

 

  • Sudo update
    • On 2020/11/3, apt update is terribly slow due to poor repository servers. You can use alternative servers by the command below:
    • sudo sed -i.bak -r ‘s!deb \S+!deb mirror://mirrors.ubuntu.com/mirrors.txt!’ /etc/apt/sources.list
    • sudo apt update && sudo apt -y upgrade && sudo apt -y upgrade
    • sudo reboot

 

  • Install some tools
    • sudo apt install -y vim sl git

 

  • Install Cuda 10.2 and Cudnn 7.6.5
    • To install cuda, you need gcc9 and 7. What’s important is the latter must be the default.
    • sudo apt -y install build-essential #=> gcc-9 is installed.
    • sudo apt -y install gcc-7 g++-7 #=> gcc-7 is installed.
    • sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-7 100
    • sudo update-alternatives –install /usr/bin/gcc gcc /usr/bin/gcc-9 50
    • sudo update-alternatives –config gcc #<= press enter if you are asked something
    • Download a .run file for Cuda 10.2 and a .tar.gz file for Cudnn 7.6.5 from nvidia.com. Install them by the command below:
    • sudo sh ~/Downloads/cuda_10.2.89_440.33.01_linux.run –silent
    • sudo tar -xzvf ~/Downloads/cudnn-10.2-linux-x64-v7.6.5.32.tgz -C /usr/local
    • sudo reboot
    • nvidia-smi #=> this may return like “Driver Version: 440.33.01 CUDA Version: 10.2”
    • echo ‘export CUDA_HOME=/usr/local/cuda’ >> ~/.bashrc
    • echo ‘export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${CUDA_HOME}/lib64’ >> ~/.bashrc
    • echo ‘export PATH=$PATH:${CUDA_HOME}/bin’ >> ~/.bashrc
      source ~/.bashrc
    • nvcc –version #=> this may return like “release 10.2, V10.2.89”

 

  • Install tools for build
    • sudo apt install -y python-is-python2 libprotobuf-dev libleveldb-dev libsnappy-dev libopencv-dev libhdf5-serial-dev protobuf-compiler libgflags-dev libgoogle-glog-dev liblmdb-dev libatlas-base-dev git cmake libboost-all-dev python-numpy curl python-dev
    • sudo apt install -y python-is-python3 python3-pip #<= Python3 may not be needed… This note is a log from a trial.
    • curl https://bootstrap.pypa.io/get-pip.py –output get-pip.py
    • sudo python2 get-pip.py
    • rm get-pip.py

 

  • Install boost-1.72.0
    • cd ~
    • mkdir boost && cd boost
    • wget https://dl.bintray.com/boostorg/release/1.72.0/source/boost_1_72_0.zip
    • unzip boost_1_72_0.zip
    • cd boost_1_72_0
    • ./bootstrap.sh –with-python-version=2.7
    • sudo b2 -j8 –cmakedir=/usr/local/lib/cmake -a install #=> the command may return “– The C compiler identification is GNU 7.5.0” and “– The CXX compiler identification is GNU 7.5.0”

 

  • Install caffe
    • cd ~
    • git clone -b v0.15.14 https://github.com/NVIDIA/caffe.git caffe.nvidia-0.15.14
    • cd caffe.nvidia-0.15.14
    • sudo pip install –use-feature=2020-resolver -r python/requirements.txt
    • vim cmake/Dependencies.cmake #=> Edit “Boost 1.46” to “Boost 1.72”.
    • vim cmake/Cuda.cmake #=> according to https://github.com/NVIDIA/nvidia-docker/issues/797, please modify at L.95 “caffe_detect_installed_gpus(__cuda_arch_bin)” to “set(__cuda_arch_bin “75”)”.
    • vim src/caffe/layers/window_data_layer.cpp #=> the cpp requires to replace the opencv constants of ver.1 to ver.2
      • CV_LOAD_IMAGE_COLOR => cv::IMREAD_COLOR
    • vim src/caffe/util/io.cpp #=> the cpp requires to replace the opencv constants of ver.1 to ver.2
      • CV_LOAD_IMAGE_COLOR => cv::IMREAD_COLOR
      • CV_LOAD_IMAGE_GRAYSCALE => cv::IMREAD_GRAYSCALE
    • mkdir build && cd build
    • CXX=g++-7 CC=gcc-7 cmake ..
    • make all -j8 && make all -j8 && make all -j8
    • make install

 

  • Install digits
    • cd ~
    • git clone -b v5.0.0 https://github.com/NVIDIA/DIGITS.git digits-5.0
    • cd digits-5.0
    • sudo pip install –use-feature=2020-resolver -r requirements.txt
    • sudo apt install -y libfreetype6-dev
    • CAFFE_HOME=~/caffe.nvidia-0.15.14 PYTHONPATH=~/caffe.nvidia-0.15.14 ./digits-devserver

 

  • Search key
    • ubuntu install digits linux
    • 2080 2070 2060 GTX  nvidia
    • dospara garellia SF
    • ubuntu 20.04 LTS, 18.04, 16.04
    • ubuntu 古いcaffe 古いdigits
    • ubuntu 新しいgpu インストールできない

コメント

タイトルとURLをコピーしました