Skip to content

Commit 26d1a8f

Browse files
Fix docker launch command
1 parent b7bcbc2 commit 26d1a8f

1 file changed

Lines changed: 22 additions & 15 deletions

File tree

carla launch manager/CARLA_manager.py

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,19 @@
11
import subprocess
2+
import time
23

34
class CARLAManager(object):
45
container_id = None
5-
run_command = """
6-
docker run -d --rm \
7-
--gpus all \
8-
-e NVIDIA_DRIVER_CAPABILITIES=all \
9-
-e NVIDIA_VISIBLE_DEVICES=all \
10-
-e SQL_LVDELDRIVER=x11 \
11-
-e DISPLAY=:1 \
12-
-e XDG_RUNTIME_DIR=/tmp \
13-
-e NVIDIA_REQUIRE_CUDA="cuda>=10.1 brand=tesla,driver>=384 driver>=384 brand=tesla,driver>=396 driver>=396 brand=tesla,driver>=410 driver>=410" \
14-
--network host \
15-
-v /tmp/.X11-unix:/tmp/.X11-unix:rw \
16-
carlasim/carla:0.9.15 \
17-
/bin/bash -c "/home/carla/CarlaUE4.sh"
18-
"""
6+
run_command = (
7+
"docker run -d --rm"
8+
"--gpus all"
9+
"-e NVIDIA_VISIBLE_DEVICES=all"
10+
"-e DISPLAY=:0"
11+
"-v /tmp/.X11-unix:/tmp/.X11-unix:rw"
12+
"-e XDG_RUNTIME_DIR=/tmp"
13+
"--network host"
14+
"carlasim/carla:0.9.15"
15+
"/bin/bash -c '/home/carla/CarlaUE4.sh'"
16+
)
1917

2018
@staticmethod
2119
def start_carla():
@@ -39,4 +37,13 @@ def stop_carla():
3937
@staticmethod
4038
def restart_carla():
4139
CARLAManager.stop_carla()
42-
CARLAManager.start_carla()
40+
CARLAManager.start_carla()
41+
42+
43+
def main():
44+
CARLAManager.start_carla()
45+
time.sleep(15)
46+
CARLAManager.stop_carla()
47+
48+
if __name__ == "__main__":
49+
main()

0 commit comments

Comments
 (0)