前段时间在搭建一个比较高效的自动驾驶开发软硬件环境,大家都比较清楚开发自动驾驶的软件,经常需要到实车去调试和验证。显然笔记本比较合适,但是在Nvidia Dirve PX2的计算平台上开发,需要笔记本具有Nvidia GPU显卡功能,而且需要能安装DriveWorks开发软件,显存最好能大于2G(可以运行深度学习算法模型)。所以我们选择了一款Dell的Alienware笔记本带GeForce GTX 1070(预算有限不能1080Ti,不过已有一台带1080Ti的台式机供深度学习)。
cuDNN安装(https://developer.nvidia.com/rdp/cudnn-download)
$tar -zxvfcudnn-8.0-linux-x64-v5.1-prod.tgz
$cd cuda
$sudocp lib64/lib*/usr/local/cuda/lib64/
$sudocp include/cudnn.h/usr/local/cuda/include/
更新软连接:
$cd /usr/local/cuda/lib64/
$sudochmod +r libcudnn.so.5.1.5
$sudo ln -sf libcudnn.so.5.1.5libcudnn.so.5
$sudo ln -sf libcudnn.so.5libcudnn.so
在 /etc/ld.so.conf.d/加入文件cuda.conf, 内容如下
$ cd /etc/ld.so.conf.d/
$ geditcuda.conf
sudo service lightdm stop 重启。
4) DriveWorks
https://developer.nvidia.com/nvidia-drive-downloads下载,然后按照提示安装,下载大约30G,下载完成后自动安装,中途terminal需要提示输入密码。
三、安装各种基础依赖
安装通用依赖项
安装blas
sudo apt-getinstall libatlas-base-dev
安装pip
sudo apt-getinstall python-pip
安装其他依赖库
sudo apt-get install libprotobuf-devlibleveldb-dev libsnappy-dev libopencv-dev libboost-all-dev libhdf5-serial-devprotobuf-compiler liblmdb-dev libgflags-dev libgoogle-glog-dev liblmdb-dev
sudo apt-getinstall python-dev
sudo apt-getinstall python-opencv
安装Python模块
sudo apt-get install python-numpy python-scipy python-matplotlib python-sklearn python-skimage python-h5py python-protobuf python-leveldb python-networkx python-nose python-pandas python-gflagsCythonipython
四、 安装Opencv
OpenCV3.2需要安装低于3.0的ffmpeg,否则opencv3.2的video会有问题(配置ffmpeg为no导致的)
最新版本FFmpeg 2.5.1 已经发布,Ubuntu 14.04、16.04用户可通过PPA进行安装,打开终端,输入命令:
sudo add-apt-repositoryppa:kirillshkrogalev/ffmpeg-next
sudo apt-get update
sudo apt-get install ffmpeg
卸载ffmpeg命令:
sudo apt-get remove ffmpeg
安装opencv其他依赖
sudo apt install -y build-essential
cmake # GUI (if you want to use GTK instead of Qt, replace'qt5-default' with 'libgtkglext1-dev' and remove '-DWITH_QT=ON' option inCMake):
sudo apt install -y qt5-default libvtk6-dev
# Media I/O:
sudo apt install -y zlib1g-dev libjpeg-dev libwebp-devlibpng-dev libtiff5-dev libjasper-dev libopenexr-dev libgdal-dev
# Video I/O:
sudo apt install -y libdc1394-22-dev libavcodec-devlibavformat-dev libswscale-dev libtheora-dev libvorbis-dev libxvidcore-devlibx264-dev yasmlibopencore-amrnb-dev libopencore-amrwb-dev libv4l-devlibxine2-dev
# Parallelism and linear algebra libraries:
sudo apt install -y libtbb-dev libeigen3-dev
安装gstreamer:
apt-get 命令方式安装
sudo apt-get installlibgstreamer0.10-dev gstreamer-tools gstreamer0.10-tools gstreamer0.10-doc
sudo apt-get installgstreamer0.10-plugins-base gstreamer0.10-plugins-goodgstreamer0.10-plugins-ugly gstreamer0.10-plugins-badgstreamer0.10-plugins-bad-multiverse
apt-get install libgstreamer* // 该命令的目的是安装头文件;注意’*’
下载OpenCV3.2 :https://github.com/opencv/opencv/releases/tag/3.2.0
在Ubuntu14.04放置OpenCV3.2解压目录下,在/usr/local/目录下创建opencv320目录,存放安装后的opencv。
sudomkdir -p build
cd ./build
cmake -DCMAKE_INSTALL_PREFIX=/usr/local/opencv320
先安装各种依赖项:
sudo apt-get update
sudo apt-get update
下载源码: git clone https://github.com/PointCloudLibrary/pcl.git
-DBUILD_GPU=ON -DBUILD_examples=ON \
6. make & make install
六、 ROS 安装
参照其官网wiki安装Kinetic: http://wiki.ros.org/kinetic/Installation/Ubuntu
七、VirtualBox按照虚拟Win10
自己制作一个iso,这个参照网上经验安装即可,注意把安装选择在HDD机械硬盘中。
Now enjoy your self-driving development!