Apollo-environment configuration

Apollo Cyber ​​RT environment installation and configuration

Chapter 1 Apollo Cyber ​​RT Environment Installation and Configuration



foreword

Cyber ​​RT is configured based on the Linux system, involving the installation and configuration of the following environments:
1. Linux Ubuntu system installation
2. NVIDIA GPU installation
3. Docker environment configuration
4. NVIDIA Container Toolkit


1. Update the environment

We use the Apollo 6.0 version in the demonstration scene, and it is recommended to use Ubuntu 18.04 or Ubuntu 20.04 system.
To install the software under windows, we only need to have the EXE file, then double-click, and the next step is OK. But under LINUX, this is not the case. Each distribution of LINUX, such as UBUNTU, will maintain its own software repository, where almost all the software we commonly use is in it. The software inside is absolutely safe, and absolutely can be installed normally.
So how do we install it? Under UBUNTU, we maintain a source list, which contains some URL information. Each URL is a source, and the data pointed to by this address identifies which software can be installed and used on this source server.

1-1. Backup system files

First of all, make a backup of the file that comes with the system for the original system

sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup

1-2. Edit source command

sudo gedit /etc/apt/sources.list

After adding or commenting (add #) some sources in this file, save it.
At this time, the software pointed to in our source list will increase or decrease a part.
Generally, I will use Tsinghua source:

# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-updates main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-backports main restricted universe multiverse
deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-security main restricted universe multiverse
 
# 预发布软件源,不建议启用
# deb https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse
# deb-src https://mirrors.tuna.tsinghua.edu.cn/ubuntu/ bionic-proposed main restricted universe multiverse

1-3. Update software list and software

The next thing to do is:

sudo  apt-get update

This command will visit each URL in the source list, read the software list, and then save it on the local computer.
After the update, you may need to upgrade.

sudo  apt-get upgrade

This command will compare the locally installed software with the corresponding software in the newly downloaded software list. If the installed software version is found to be too low, it will prompt you to update. If your software is the latest version, it will prompt:

0 packages were upgraded, 0 packages were newly installed, 0 packages were to be uninstalled, and 0 packages were not upgraded.

All in all, update is to update the software list, and upgrade is to update the software.

2. System configuration steps required before Cyber ​​installation

2-1.Linux environment installation

Linux environment:
1. Linux system:
2. Windows virtual machine installation:

2-2. Install NVIDIA GPU driver

If you only use cyber in this part, you don’t need to install it. Before installing, we can check our graphics card as follows:

sudo lshw -C display

insert image description here
Then start installing the driver:

 sudo apt-get update
sudo apt-add-repository multiverse
 sudo apt-get update
sudo apt-get install nvidia-driver-455

You can use the following command to check whether the driver is normal:

nvidia-smi 

The result is displayed, as shown in the figure below:
insert image description hereNote: If it is just installed, it needs to be restarted to make the driver take effect.

2-3. Install Docker

1. Installation instructions

To install Docker, refer to the official link:
You can also install it directly through the official script:

curl https://get.docker.com | sh
sudo systemctl start docker && sudo systemctl enable docker

2. Test installation instructions

sudo docker run hello-world

insert image description here
Pull complete: It may take time to pull the image;

3. Optimize Docker

In general, sudopermissions are required, otherwise there will be exceptions;
we optimize this and add dockerpermissions to the current user, dockerwhich is not used when using them sudo. The specific operations are as follows:
1. Create a docker user group

sudo groupadd docker

2. Add the current user to the docker group

sudo usermod -aG docker $USER

3. Restart or execute the following command to make it take effect

newgrp docker

4. Test whether you can use sudo

docker run hello-world

At the same time, if you need docker to start automatically after booting, you can configure it as follows:

sudo systemctl enable docker.service
sudo systemctl enable containerd.service

2-4. Install NVIDIA Container Toolkit

The docker image based on Apollo's CUDA needs to rely on NVIDIA Container Toolkit, which is installed as follows:

distribution=$(. /etc/os-release; echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get -y update
sudo apt-get install -y nvidia-docker2 

After the installation is complete, restart docker to take effect:

sudo systemctl restart docker

3. Cyber ​​RT installation

Apollo installation requires the following operations:

  1. download source code
  2. Execute the script to start the docker environment
  3. Enter the docker container
  4. Construct

3-1. Download source code

Clone the Apollo source repository:

git clone https://github.com/ApolloAuto/apollo.git

or use Gitee:

git clone https://gitee.com/ApolloAuto/apollo.git

View the Apollo file space:
insert image description here

3-2. Start the Apollo Docker development container

Enter the apollo workspace:

 ./docker/scripts/dev_start.sh 

The result is as follows:
insert image description here

3-3. Enter the Apollo Docker development container

After starting the Apollo Docker development container, execute the following command to enter the container:

./docker/scripts/dev_into.sh

Summarize

提示:这里对文章进行总结:

For example: the above is what we will talk about today. This article only briefly introduces the use of pandas, and pandas provides a large number of functions and methods that allow us to process data quickly and easily.

Guess you like

Origin blog.csdn.net/yechen1/article/details/131467337
Recommended