ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • How to install ROS, CUDA, Caffe on Nvidia Jetson TK1 board
    나름 전문가/Vision for Robotics 2016. 3. 3. 21:18
    글로벌 사람들과 공유를 위해 간단히 영어로 설명 되있는점.. 양해부탁드립니다 ^^
    Jetson TK1을 우연히 구하게 되었는데, 원래 Raspberry Pi로 만들고 있던 로봇의 메인보드를
    Jetson TK1으로 교체하면서, ROS와 CUDA, Caffe를 동시에 Setting 하면서 기록한 History입니다.

    혹시 Jetson TK1으로 세팅을 시도하시는 분이 있다면... 참고하시길.. 
    (나중에.. 보드를 다시 세팅할때 참고하기위한 셀프 기록이기도하고요....ㅎㅎ) 

    1. R21.4 Version Import from HOST ubuntu (VMWare Ubuntu14.04 on OSX)
    2. CUDA + OpenCV Install
    when you have error when install : sudo apt-add-repository universe

    #install Cuda in Jetso TK1 Directly
       $ sudo dpkg -i cuda-repo-<distro>_<version>_<architecture>.deb
       $ sudo apt-get update
       $ sudo apt-get install cuda-toolkit-6-5
    #install Opencv4Tegra
       $ sudo dpkg -i libopencv4tegra-repo_l4t-r21_2.4.10.1_armhf.deb
       $ sudo apt-get update
       $ sudo apt-get install libopencv4tegra libopencv4tegra-dev
     
    3. Grinch Kernel Install (Described in ROS Wiki) - prior to install ROS on Jetson Tk1
      - git install (maybe already installed)
         $sudo apt-get install git
       - install Grinch Kernel (for Jetson 21.X version)
         $git clone https://github.com/jetsonhacks/installGrinch.git
         $cd installGrinch
         $./installGrinch.sh
       - very easy ha!?, just reboot the jetson

    3. Cudnn install
     tar -zxvf cudnn-6.5-linux-ARMv7-R2-rc1.tgz
     cd cudnn-6.5-linux-ARMv7-R2-rc1 
     # copy the include file
     cp cudnn.h /usr/local/cuda-6.5/include
     cp libcudnn* /usr/local/cuda-6.5/lib

      # Makefile.config for Caffe (After Procedure 4) (only relevant cuDNN configuration items shown)
       USE_CUDNN := 1
       INCLUDE_DIRS := /usr/local/cuda-6.5/include
       LIBRARY_DIRS := /usr/local/cuda-6.5/lib
     - CuDNN is optional for jetson TK1 board (only support cuDNNv2)
     - When you have problem with using cud, comment the USE_CUDNN :=1 statement 

    4. Install Caffe
    -This is for Jetson Tk1 - Fllow this procedure
     - Install Dependencies
         $sudo add-apt-repository universe
         $sudo apt-get update
         $sudo apt-get install libprotobuf-dev protobuf-compiler gfortran \
         $libboost-dev cmake libleveldb-dev libsnappy-dev \
         $libboost-thread-dev libboost-system-dev \
         $libatlas-base-dev libhdf5-serial-dev libgflags-dev \
         $libgoogle-glog-dev liblmdb-dev -y
         $sudo usermod -a -G video $USER
    - Git clone Caffe
         $sudo apt-get install -y git
         $git clone https://github.com/BVLC/caffe.git
         $cd caffe && git checkout dev
         $cp Makefile.config.example Makefile.config
         $make -j 4 all
         $make -j 4 runtest
         $build/tools/caffe time --model=models/bvlc_alexnet/deploy.prototxt --gpu=0
           or
         
         $run build/tools/caffe time --model=models/bvlc_alexnet/deploy.prototxt --gpu=0
     
     
     - Erros Tip
       “error while loading shared libraries: libcudart.so.6.5: cannot open shared object file: No such file or directory"
       There is no proper PATH setting for cuds —> Export it!
        $export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/cuda/lib
        You can add the statement in ~/.profile

    if all things are going good, you can see these test result (make -j 4 runtest)



    5. Install ROS
         $sudo update-locale LANG=C LANGUAGE=C LC_ALL=C LC_MESSAGES=POSIX
         $sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'
         $wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -
         $sudo apt-get update
         $sudo apt-get install ros-indigo-ros-base
           (maybe ros-indigo-desktop can be okay, roe-indigo-navigation can be good alternatives)
         $apt-cache search ros-indigo (when you want find row packages)
    # initialize rosdep
         $sudo apt-get install python-rosdep
         $sudo rosdep init
         $rosdep update
     #Environment setting
         $echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
         $source ~/.bashrc
         $sudo apt-get install python-rosinstall
         add   "unset GTK_IM_MODULE” in “~/.bashrc” for using RVIZ




Designed by Tistory.