Apollo 5.0 升级OS到Ubuntu 18环境部署

百度自动驾驶开源代码平台Apollo最近升级了OS从Ubuntu 14到Ubuntu 18,导致一些开发者使用最新代码搭建环境失败。按照官方的说明需要操作的步骤如下:

[Attention] The Apollo team is proud to announce that the platform has been migrated to Ubuntu 18.04, one of the most requested upgrades from our developers. We do not expect a disruption to your current work with the Apollo platform, but for perception related code, you would need to:

(1)Upgrade host to ubuntu_16.04 and above (Ubuntu 18.04 is preferred)
(2)Update local host NVIDIA driver >=410.48. Website link
(3)Install NVIDIA-docker 2.0 - you can refer to this link for steps on installation, or use the install scripts we provide here
For those developers that would like to continue working with Ubuntu 14.04, please use the Ubuntu 14.04 branch instead of the master branch.

下面就上边提到的几点进行详细说明:

一. 安装 ubuntu-18.04.3 (可以自己下载ISO烧制安装盘安装)

二. 升级显卡驱动>=410.48:

      (1) 首先检查你是否有nvidia显卡:

    lspci | grep -i nvidia
    输出:NVIDIA Corporation GP104 [GeForce GTX 1080]

        

    (2) 运行以下命令,从默认的Ubuntu存储库中列出Nvidia卡的可用驱动程序:

sudo ubuntu-drivers devices

     Apollo 5.0 升级OS到Ubuntu 18环境部署_第1张图片

   (可以看出nvidia-driver-430是推荐安装的nvidia驱动)

   (3) 安装推荐的驱动:

  • 运行命令:sudo ubuntu-drivers autoinstall(自动安装所有推荐的驱动,将安装一些32位软件包,时间较长)
  • 运行命令安装特定的驱动程序:
    sudo apt install nvidia-driver-version-number(比如:sudo apt install nvidia-driver-430
  • 使用Ubuntu 18自带的界面安装:
    • system settings > details,检查计算机正在使用的图形卡(默认为集成显卡:Intel HD Graphics)
      • Apollo 5.0 升级OS到Ubuntu 18环境部署_第2张图片
    • 打开Software Updater,待下载更新完成后,选择Setting。
      • Apollo 5.0 升级OS到Ubuntu 18环境部署_第3张图片
    • 之后转到Additional Drivers,选择nvidia-driver-430(proprietary,tested)
      • Apollo 5.0 升级OS到Ubuntu 18环境部署_第4张图片
选择Apply Changes进行安装。

(4)  安装完成后查看NVIDIA显卡的驱动版本:cat /proc/driver/nvidia/version:

      

 (5)  校验: 运行 nvidia-smi 可以看到显卡相关信息则正常

          Apollo 5.0 升级OS到Ubuntu 18环境部署_第5张图片

三. 安装docker和nvidia-docker2:

1. 下载Apollo源码,进入apollo/docker/setup_host.

     

2. 运行如下命令:

(1) bash install_docker.sh
(2) bash install_nvidia_docker2.sh
(3) bash setup_host.sh
(4) 运行docker -v 和nvidia-docker -v 进行检查

你可能感兴趣的:(Apollo)