Ubuntu 16.04 + Opencv3.0 + gtx1080 + caffe(SSD) + ROS(Kinetic)

this part records the process of installing opencv and caffe on ubuntu 16.04 with gtx1080 gpu.


  • Installing ubuntu16.04
    since we didn’t succeed in installing ubuntu14.04 on this server, so we installed the ubuntu16.04.
  • Installing the nvidia driver
    • check what driver should we install sudo ubuntu-drivers devices
    • add the repository sudo add-apt-repository ppa:graphics-drivers
    • install driver (change the driver num according to your own server)

      sudo apt-get update
      sudo apt-get install nvidia-367 mesa-common-dev freeglut3-dev

    • reboot to effect the driver
    • test the driver by nvidia-smi
  • Installing cuda8.0

    • download the cuda8.0 from the NVIDIA official website, recommend the run file instead of deb
    • install the cuda, e.g. sh cuda_8.0.27_linux.run, notice that:
      • DON’T INSTALL THE DRIVER IN THE RUN FILE, it will overide the driver we installed just now.
      • DON’T INSTALL THE OPENGL LIB, you cannot log in even with the correct password.
    • add the cuda/bin and lib to the PATH AND PROFILE

      sudo vim /etc/profile
      export PATH=/usr/local/cuda/bin:$PATH

      sudo vim /etc/ld.so.conf.d/cuda.conf
      /usr/local/cuda/lib64

    • test the example in ~/NVIDIA *. note that the gcc/g++ version in ubuntu 16.04 is >=5.3, maybe cause some errors, so we modified the /usr/local/cuda/include/host_config.h to support 5.3 version gcc/g++.

      sudo vim /usr/local/cuda/include/host_config.h
      find the if _GNUC_ > 5, change the 5 to 6
      cd ~/Nvidia(tab)
      make -j16
      cd bin/…/
      ./deviceQuery

    if you get the pass result, install corectly.

  • Installing Opencv3.0
    there are two things we need to pay attention to in installing opencv3.0:

    • build opencv without rebuilding the tiff lib
    • modified src file to support cuda8.0

    Installing steps are summarized below:

    • download the installing shell script from private cloud disk(code: wysa)
    • install dependencies sudo sh dependencies.sh
    • run the opencv3_0_0.sh to get src file sudo sh opencv3_0_0.sh, note that maybe we will stop at the downloading ippcv, we can pre-download this file from here and put it in OpenCV-master/3rdparty/ippicv/downloads/Linux-xxxx/
    • since in ubuntu16.04, the libtiff version is 5, not 4. so we need to modified the opencv3_0_0.sh to ignore the installation of libtiff4-dev as follows. simply delete the libtiff4-dev and add -D WITH_TIFF=ON in cmake command

    original opencv3_0_0.sh

    arch=$(uname -m)
    if [ "$arch" == "i686" -o "$arch" == "i386" -o "$arch" == "i486" -o "$arch" == "i586" ]; then
    flag=1
    else
    flag=0
    fi
    echo "Installing OpenCV 3.0.0"
    mkdir OpenCV
    cd OpenCV
    echo "Removing any pre-installed ffmpeg and x264"
    sudo 
  • 3
    点赞
  • 6
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值