carla icon indicating copy to clipboard operation
carla copied to clipboard

CARLA simulator container using Docker

Open pennyfea opened this issue 1 year ago • 3 comments

CARLA version: 0.9.15 Platform/OS: Windows 11 Home Problem You Have Experienced: When running the CARLA simulator container using Docker, the container exits with the following error:

[+] Running 1/0
✔ Container carla-vss-carla-1  Created 0.0s 
Attaching to carla-1
carla-1  | 4.26.2-0+++UE4+Release-4.26 522 0
carla-1  | Disabling core dumps.
carla-1  | sh: 1: xdg-user-dir: not found
carla-1 exited with code 1

What You Expected to Happen: The container should start and run the CARLA simulator without errors.

Steps to Reproduce:

  1. Compose.yaml
services:
  carla:
    image: carlasim/carla:0.9.15
    command: ["/bin/bash", "./CarlaUE4.sh", "-vulkan"]
    runtime: nvidia
    ports:
      - "2000-2002:2000-2002"
    environment:
      - DISPLAY=:0
      - NVIDIA_VISIBLE_DEVICES=all
      - NVIDIA_DRIVER_CAPABILITIES=all
      - SDL_VIDEODRIVER=x11
    volumes:
      - /tmp/.X11-unix:/tmp/.X11-unix:rw
      - ${HOME}/.Xauthority:/root/.Xauthority:rw
      - /usr/share/vulkan/icd.d:/usr/share/vulkan/icd.d:ro
    privileged: true
    network_mode: "host"
    stdin_open: true
    tty: true

pennyfea avatar Jul 03 '24 04:07 pennyfea

@pennyfea @joel-mb Is there a solution already here to run Carla Simulator using Docker ?

Apoorvgarg-creator avatar Jul 15 '24 20:07 Apoorvgarg-creator

@joel-mb No, sorry I couldn't figure it out and abandoned this approach.

pennyfea avatar Jul 17 '24 00:07 pennyfea

Hi, there are some parts that doesn't look right.

"/tmp/.X11unit" u"/usr/share/vulkan/icd.d" looks like linux paths and not a windows path.

Do you use a x11 server on your windows machine? If you try to use X11 on widows, you need a software to show a window (or you use "-RenderOffScreen" for no window)

On an ubuntu system, it looks like this

sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
xhost +
sudo docker run --privileged --gpus all --net=host -e DISPLAY=$DISPLAY -e SDL_VIDEODRIVER=x11 -v /tmp/.X11-unix:/tmp/.X11-unix:rw carlasim/carla:0.9.13 /bin/bash ./CarlaUE4.sh -vulkan

PatrickPromitzer avatar Jul 26 '24 11:07 PatrickPromitzer

i have the same problem and have found no solution !! i am using wsl on windows

Spyridonidis98 avatar Feb 11 '25 21:02 Spyridonidis98

I'm having the exact same issue, it just exits with exit code 1 but without any error

rui-rocha-42 avatar Feb 12 '25 11:02 rui-rocha-42

Please write down everything you tried.

Did you open a command line in the docker container and check if nvidia-smi works? Did you use "-RenderOffScreen"? Did you follow the documentation?

PatrickPromitzer avatar Feb 18 '25 08:02 PatrickPromitzer