百度Apollo安装说明

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

  1. 程序版本:
  • 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/1DoEpRBPNxjyfILrf5ekxrA 密码:s99l

  • 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(也在百度网盘里),直接按照官网教程安装就好。
  1. 安装:
  • Ubuntu系统,这里就不废话了,没啥说的,拿我在百度网盘里共享的安装就好。安装完成后,最好弄个源(个人用阿里的源):

备份源:

$ sudo mv /etc/apt/sources.list /etc/apt/source.list.bak

 编辑源列表:

$ sudo vim /etc/apt/source.list

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

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

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

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

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

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

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

安装驱动:

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

查看nvidia版本

$ nvidia-smi 

如果版本号显示为375.39,那么安装成功。

  • CDUA安装。这部分百度省略了,但是为了安装cuDNN还是需要安装CUDA。在我的百度网盘里也有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。

$ sudo apt-get install \
    apt-transport-https \
    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

 建立仓库

$ sudo add-apt-repository \
   "deb [arch=amd64] https://download.docker.com/linux/ubuntu \
   $(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替换为自己的用户名。

 验证没有通过管理员访问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

 到此应该全部结束了。

提示:在https://github.com/ApolloAuto/apollo/blob/master/docs/howto/how_to_run_perception_module_on_your_local_computer.md 下面提示可以运行

$ ./apollo.sh build_gpu

 或者

$ ./apollo.sh build_opt_gpu

安装perception模块,但./apollo.sh build_gpu编译过了,所以应该不需要在次执行了。

吐槽:真心不知道Apollo怎样单个模块调试呀。

猜你喜欢

转载自www.cnblogs.com/hgl0417/p/9124760.html
今日推荐