笔记本型号:战神Z7-KP7D1(配置:Intel core i7-7700HQ四核处理器+nvidia gtx1060 6G显卡)
笔记本系统:win10+ubuntu16.04双系统
硬件:kinect v1
配置环境参考网址:
【1】Github-Kintinuous/README.md:https://github.com/mp3guy/Kintinuous/blob/master/README.md
【2】Github-Kintinuous/build.sh:https://github.com/mp3guy/Kintinuous/blob/master/build.sh
【3】Kintinuous + Elastic Fusion 配置运行方法:http://blog.csdn.net/cattylsy/article/details/52239590
【4】NVIDIA 367.44 Officially Support for TITAN X (Pascal), GTX 1060:http://tipsonubuntu.com/2016/08/24/nvidia-367-44-support-titan-x-pascal-gtx-1060/#prettyPhoto
【5】深度学习主机环境配置: Ubuntu16.04+Nvidia GTX 1080+CUDA8.0:http://www.tuicool.com/articles/JvUvQjZ
【6】[框架安装趟雷指南]Ubuntu+1060+cuda+cudnn+Keras+TH+TF+MXnet:https://zhuanlan.zhihu.com/p/23480983
【7】ubuntu16.04+gtx1060+cuda8.0+caffe安装、测试经历:http://blog.csdn.net/wopawn/article/details/52302164
【8】cuda安装包下载网址:https://developer.nvidia.com/cuda-downloads
【9】Github-Openni2:https://github.com/occipital/OpenNI2
【10】安装kinect drivers:http://www.cc.gatech.edu/grads/a/ahuaman3/docs/tutorials/software/build/perception.html
【11】opencv 2.4.13下载网址:http://opencv.org/downloads.html
【12】pcl 1.7.2 下载网址: https://github.com/PointCloudLibrary/pcl/releases/tag/pcl-1.7.2
【13】loop.klg下载网址:http://www.cs.nuim.ie/research/vision/data/loop.klg
【14】Github-Kintinuous-Problem:https://github.com/mp3guy/Kintinuous/issues/15
安装NVIDIA 驱动
换aliyun源:打开setting–Software&Updates–Ubuntu Software–Download from,选择other,选择China–mirrors.aliyun.com–Choose Server,选择Close–Reload。
命令:
$ sudo add-apt-repository ppa:graphics-drivers/ppa
$ sudo apt update
打开setting–Software&Updates–Additional Drivers,选择 “Using NVIDIA … 378.13 from nvidia-378(open source)”,选择Apply Changes,待下载并安装后重启电脑。
查看驱动版本:$ nvidia-smi
查询结果: “… NVIDIA-SMI 378.13 Driver Version: 378.13 …”
配置CUDA
准备安装包:进入网址【8】,在Select Target Platform 选择Linux–x86_64–Ubuntu–16.04–runfile(local),下载文件名:cuda_8.0.61_375.26_linux.run(迅雷下载速度快)
命令:$ sudo sh cuda_8.0.61_375.26_linux.run
出现”more(0%)”,按ctrl+c继续,除了问是否安装驱动时选择不安装,其他y/n选择y,显示default的按回车键就好了,最后会显示Driver not selected, Toolkit和Samples已安装。
添加环境路径: $ sudo gedit ~/.bashrc
在最后fi下一行添加语句:
export PATH=/usr/local/cuda-8.0/bin${PATH:+:${PATH}}export LD_LIBRARY_PATH=/usr/local/cuda-8.0/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
保存关闭后输入命令:$ source ~/.bashrc
重新启动,输入命令:$ nvcc -V
查询CUDA版本结果:”…Cuda compilation tools, release 8.0, V8.0.61”
安装依赖项
命令:(安装openjdk-7-jdk显示”E: Package ‘openjdk-7-jdk’ has no installation candidate”,因此换成安装openjdk-8-jdk)
$ sudo apt-get install -y cmake-qt-gui git build-essential libusb-1.0-0-dev libudev-dev openjdk-8-jdk freeglut3-dev python-vtk libvtk-java libglew-dev cuda-7-5 libsuitesparse-dev openexr
配置CMake
命令:$ sudo apt-get install build-essential cmake
查询cmake 版本:$ cmake -version
查询CMake结果:cmake version 3.5.1
配置OpenNI2
命令:(因为我的电脑处理器是四核,所以输入make时后面跟的是-j4)
$ sudo apt-get install git g++ python libusb-1.0-0-dev libudev-dev openjdk-8-jdk freeglut3-dev graphviz doxygen
$ git clone https://github.com/occipital/OpenNI2
$ cd OpenNI2
$ make -j4
$ sudo gedit /etc/udev/rules.d/51-kinect.rules
添加:
UBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02b0", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ad", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02ae", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02c2", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02be", MODE:="0666", OWNER:="root", GROUP:="video"
SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="02bf", MODE:="0666", OWNER:="root", GROUP:="video"
保存关闭。
配置libfreenet
命令:(${OPENNI2_DIR}需要改成openni2对应安装目录)
$ git clone https://github.com/OpenKinect/libfreenect.git
$ cd libfreenect
$ mkdir build; cd build
$ cmake .. -DBUILD_OPENNI2_DRIVER=ON
$ make -j4
$ cp -L lib/OpenNI2-FreenectDriver/libFreenectDriver.so ${OPENNI2_DIR}/Bin/x64-Release/OpenNI2/Drivers
测试安装是否成功
– 连上kinect,输入命令:$ lsusb
– 显示:”…Xbox NUI Camera…Xbox NUI Motor…Xbox NUI Audio…”
– 命令:$ cd ${OPENNI2_DIR}/Bin/x64-Release/
– 命令:$ ./NiViewer
– 正常显示深度图及彩色图。
配置OpenGL:
命令:
$ sudo apt-get install build-essential
$ sudo apt-get install libgl1-mesa-dev
$ sudo apt-get install libgl1-mesa-dev
配置OpenCV 2.4.13
从参考网址【11】下载解压到opencv-2.4.13文件夹。
命令:
$ sudo apt-get install build-essential libgtk2.0-dev libjpeg-dev libtiff4-dev libjasper-dev libopenexr-dev cmake python-dev python-numpy python-tk libtbb-dev libeigen2-dev yasm libfaac-dev libopencore-amrnb-dev libopencore-amrwb-dev libtheora-dev libvorbis-dev libxvidcore-dev libx264-dev libqt4-dev libqt4-opengl-dev sphinx-common texlive-latex-extra libv4l-dev libdc1394-22-dev libavcodec-dev libavformat-dev libswscale-dev
$ cd opencv-2.4.13
$ mkdir build
$ cd build
$ cmake -D BUILD_NEW_PYTHON_SUPPORT=OFF -D WITH_OPENCL=OFF -D WITH_OPENMP=ON -D INSTALL_C_EXAMPLES=OFF -D BUILD_DOCS=OFF -D BUILD_EXAMPLES=OFF -D WITH_QT=OFF -D WITH_OPENGL=OFF -D WITH_VTK=OFF -D BUILD_PERF_TESTS=OFF -D BUILD_TESTS=OFF -D WITH_CUDA=OFF -D BUILD_opencv_gpu=OFF ..
$ make -j4
$ sudo make install
安装opencv成功后,配置DLib时出现OPENCV_DIR没有配置,需要手动设置的错误,我把opencv-2.4.13文件夹删除之后再配置DLib就没有这个错误了。
配置DLib
命令:
$ git clone https://github.com/dorian3d/DLib.git
$ cd DLib
$ git reset --hard 330bdc10576f6bcb55e0bd85cd5296f39ba8811a
$ mkdir build
$ cd build
$ cmake ../
$ make -j4
$ sudo make install
配置DBow2
命令:
$ git clone https://github.com/dorian3d/DBoW2.git
$ cd DBoW2
$ git reset --hard 4a6eed2b3ae35ed6837c8ba226b55b30faaf419d
$ mkdir build
$ cd build
$ cmake ../
$ make -j4
$ sudo make install
配置DLoopDetector
命令:
$ git clone https://github.com/dorian3d/DLoopDetector.git
$ cd DLoopDetector
$ git reset --hard 84bfc56320371bed97cab8aad3aa9561ca931d3f
$ mkdir build
$ cd build
$ cmake ../
$ make -j4
$ sudo make install
配置iSAM
命令:
$ wget http://people.csail.mit.edu/kaess/isam/isam_v1_7.tgz
$ tar -xvf isam_v1_7.tgz
$ rm isam_v1_7.tgz
$ cd isam_v1_7
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ sudo make install
配置PCL
从参考网址【12】下载并解压到pcl-1.7.2。
命令:
$ cd pcl-1.7.2
$ mkdir build
$ cd build
$ cmake ..
$ make -j4
$ sudo make install
配置Pangolin
命令:
$ sudo apt-get install libglew-dev
$ sudo apt-get install libboost-dev libboost-thread-dev libboost-filesystem-dev
$ sudo apt-get install libpython2.7-dev
$ sudo apt-get install ffmpeg libavcodec-dev libavutil-dev libavformat-dev libswscale-dev
$ sudo apt-get install libdc1394-22-dev libraw1394-dev
$ sudo apt-get install libjpeg-dev libpng12-dev libtiff5-dev libopenexr-dev
$ git clone https://github.com/stevenlovegrove/Pangolin
$ cd Pangolin/build
$ cmake -DCPP11_NO_BOOST=1 ..
$ make -j
编译并运行Kintinuous
编译命令:
$ git clone https://github.com/mp3guy/Kintinuous
$ cd Kintinuous
$ mkdir build
$ cd build
$ cmake ../src
$ make -j4
运行测试:
– 从参考网址【13】下载loop.klg,保存至/Kintinuous/build文件夹下,输入命令:
$ ./Kintinuous -s 7 -v ../vocab.yml.gz -l loop.klg -ri -fl -od
– 运行出现错误:”…Error: invalid device function /home/luhaiyan/share/Kintinuous/src/frontend/cuda/tsdf_volume.cu:477”。
– 解决方案:根据参考网址【14】,将/Kintinuous/src/CMakeLists.txt文件中第39行中CUDA_ARCH_BIN “20 30 35 50 52 “中52后添加一项61,即改为”20 30 35 50 52 61”,保存退出。删除/Kintinuous的/build文件夹,重新输入命令mkdir及编译运行,运行成功。