在docker中运行carla

参考carla文档
ubuntu18.04
carla0.9.9
docker19.03.12

Docker Installation

Docker CE

For our tests we used the Docker CE version. To install Docker CE we recommend using this tutorial

NVIDIA-Docker2

To install nvidia-docker-2 we recommend using the “Quick Start” section from the nvidia-dockers github.
转到nvidia-dockers github后可以发现已经不推荐安装NVIDIA-Docker2了,变为NVIDIA Container Toolkit了。
在这里插入图片描述

对于ubuntu18.04:

Add the package repositories
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 update && sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker

这里失败很多次,因为网络问题。建议多尝试几次,更换一下网络。
安装成功:
在这里插入图片描述
在这里插入图片描述

Running CARLA container

Pull the CARLA image.

docker pull carlasim/carla:0.9.9

Running CARLA under docker.

docker run -p 2000-2002:2000-2002 --runtime=nvidia --gpus all carlasim/carla:0.9.9

The -p 2000-2002:2000-2002 argument is to redirect host ports for the docker container. Use --gpus ‘“device=<gpu_01>,<gpu_02>”’ to specify which GPUs should run CARLA. Take a look at this NVIDIA documentation to learn other syntax options.

You can also pass parameters to the CARLA executable. With this you can chose the town and select the port that is going to be used.

docker run -p 2000-2002:2000-2002 --runtime=nvidia -e NVIDIA_VISIBLE_DEVICES=0 carlasim/carla:0.8.4 /bin/bash CarlaUE4.sh  < Your list of parameters >

At the list of parameters do not forget to add -world-port=<port_number> so that CARLA runs on server mode listening to the <port_number>.

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值