百度Apollo安装说明

前言:最近在和百度Apollo合做,Apollo的人很nice,你们都在全力帮助咱们解决问题。但Apollo系统有点难搞,安装起来很费劲,为了不再次踩坑,留下笔记,流传后人,O(∩_∩)O。linux

1. 程序版本:git

  • Ubuntu:14.04.3:apollo github主页推荐了Ubuntu16.04,但在测试过程当中,发现Apollo推荐的摄像头驱动在Ubuntu16.04下的驱动(USB_CAM)有问题,所以我浪费了整整一天的时间,最后在一位长沙大神"哲"的指引下发如今Ubuntu14.04下摄像头驱动编译没有问题,因此选择Ubuntu14.04。这里还要说明一下,百度在 https://github.com/ApolloAuto/apollo/blob/master/docs/quickstart/apollo_2_5_hardware_system_installation_guide_v1.md里面推荐了ubuntu14.04.3,但在安装过程当中,须要upgrade,版本变为了Ubuntu14.04.5,因此我的认为,找一个Ubuntu14.04就好,我在百度网盘中将Apollo须要的 所有(是所有呀,包含系统的呀)安装文件共享出来,省着去下载了。

    百度网盘:连接: https://pan.baidu.com/s/1z86gFcDqRyUpnzAc7q5K3g 提取码: b8i2github

  • cuDNN:在https://github.com/ApolloAuto/apollo/blob/master/docs/howto/how_to_run_perception_module_on_your_local_computer.md上,百度推荐了cuDNN v7.1.1 Developer Library for Ubuntu14.04 (Deb),在安装过程当中就是提示出现依赖错误,安不上呀,因此我去官网下载了一个cudnn-8.0-linux-x64-v7.tgz(也在百度网盘里),直接按照官网教程安装就好。

2. 安装:docker

  • Ubuntu系统,这里就不废话了,没啥说的,拿我在百度网盘里共享的安装就好。安装完成后,最好弄个源(我的用阿里的源):

备份源:ubuntu

$ sudo cp /etc/apt/sources.list /etc/apt/sources.list.bak 

 编辑源列表:vim

$ sudo vim /etc/apt/sources.list 

 复制源列表到source.list(如下是ubuntu14.04的源):bash

deb http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-security main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-updates main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-proposed main restricted universe multiverse 
deb-src http://mirrors.aliyun.com/ubuntu/ trusty-backports main restricted universe multiverse 

 更新网络

$ sudo apt-get update; sudo apt-get upgrade 

 

  • 更新内核,将内核版本更新到4.4.32:

安装内核:curl

$ sudo apt-get install linux-generic-lts-xenial 

 在个人百度网盘中下载linux-4.4.32-apollo-1.5.0.tar.gz,运行:ide

$ tar zxvf linux-4.4.32-apollo-1.5.0.tar.gz 
$ cd install 
$ sudo bash install_kernel.sh 
$ sudo reboot 

 重启后,应该是安装ESDCAN卡驱动,但我没有,因此就略过去了。

提示:我在安装过程当中,没有去弄blacklist.conf,应该没有问题。

安装驱动:这里笔记本和台式机、工控机有些不同,笔记本须要在最后加上--no-opengl-files,防止无限登录 ;台式机与工控机不须要。

$ sudo chmod a+x NVIDIA-Linux-x86_64-375.39.run 
$ sudo bash ./NVIDIA-Linux-x86_64-375.39.run --no-x-check -a -s --no-kernel-module --no-opengl-files

查看nvidia版本

$ nvidia-smi 

 若是版本号显示为375.39,那么安装成功。

  • CDUA安装。这部分百度省略了,可是为了安装cuDNN仍是须要安装CUDA。在个人百度网盘里也有cuda_8.0.61_375.26_linux.run,自行下载。若是严格安装上面的步骤来,应该不须要检查版本,直接安装。
$ sudo chmod a+x cuda_8.0.61_375.26_linux.run 
$ sudo sh cuda_8.0.61_375.26_linux.run 

 安装过程当中,会有若干选项,请留意,若是遇到是否安装驱动,请选择n。最后应该回让你选择是否安装CUDA_sample,为了节约安装时间,我选择了n。

解压cudnn-8.0-linux-x64-v7.tgz

$ tar -xzvf cudnn-8.0-linux-x64-v7.tgz 

 拷贝cuDNN下的.h与.so到CUDA目录下

$ sudo cp cuda/include/cudnn.h /usr/local/cuda/include 
$ sudo cp cuda/lib64/libcudnn* /usr/local/cuda/lib64 
$ sudo chmod a+r /usr/local/cuda/include/cudnn.h 
$ sudo chmod a+r /usr/local/cuda/lib64/libcudnn*

 到此,系统应该配置完了。

 

  • 安装docker-ce,安装docker须要访问外网,最好是有翻那啥的工具,或者是能够访问外网的网络。

更新

$ sudo apt-get update 

 安装一个包,容许apt访问https。

apt-transport-https $ sudo apt-get install ca-certificates curl software-properties-common

 添加docker官方GPG key:

$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - 

 验证

$ sudo apt-key fingerprint 0EBFCD88 

 创建仓库。

"deb [arch=amd64] https://download.docker.com/linux/ubuntu $ sudo add-apt-repository $(lsb_release -cs) stable"

 更新

$ sudo apt-get update 

 安装最新的docker-ce

$ sudo apt-get install docker-ce 

 验证docker是否安装成功

$ sudo docker run hello-world 

 为了让docker运行在非管理员权限下,创建docker group

$ sudo groupadd docker 

 添加用户到docker group

$ sudo usermod -aG docker $USER #这里的$USER替换为本身的用户名。 
$ sudo reboot 

 验证没有经过管理员访问docker

$ docker run hello-world 

 

  • 安装Apollo

下载Apollo

$ git clone https://github.com/ApolloAuto/apollo.git 
$ cd apollo/ #这里根据你选择的下载文件夹进入apollo 

 进入docker

$ bash docker/scripts/dev_start.sh -C 
$ bash docker/scripts/dev_into.sh 

 获取build command列表

$ ./apollo.sh 

 开始清理

$ ./apollo.sh clean 

 开始build

$ bash apollo.sh build or $bash apollo.sh build_gpu(若是你带nvidia显卡,且在gtx1050ti版本之上)

到此应该所有结束了。

 

提示:若是上面执行过了,下面不须要执行。

提示:在https://github.com/ApolloAuto/apollo/blob/master/docs/howto/how_to_run_perception_module_on_your_local_computer.md 下面在编译perception模块时,能够运行

$ ./apollo.sh build_gpu 

 或者

$ ./apollo.sh build_opt_gpu
相关文章
相关标签/搜索