From c8e87d1153241017e4ded2167092aa3963bd2522 Mon Sep 17 00:00:00 2001 From: felipecode Date: Wed, 24 Jan 2018 15:30:54 +0100 Subject: [PATCH 1/4] Adding tutorial to run carla headless --- Docs/carla_on_server.md | 79 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+) create mode 100644 Docs/carla_on_server.md diff --git a/Docs/carla_on_server.md b/Docs/carla_on_server.md new file mode 100644 index 000000000..843db5a9e --- /dev/null +++ b/Docs/carla_on_server.md @@ -0,0 +1,79 @@ +Running CARLA Remotely and without Display +------ + + +This tutorial is designed for: +- Remote server users that have several nvidia graphical cards and want to effectively use CARLA on all GPUs. +- Desktop users who want to use the GPU that is not plugged on the screen for rendering CARLA. + + +On this tutorial you will learn. +- How to configure your server to have nvidia working on rendering without a display attached. +- How to use VNC + VGL to simulate a display connected to any GPU you have in your machine. +- And Finally, how to run CARLA in this environment + +This tutorial was tested in Ubuntu 16.04 and using NVIDIA 384.11 drivers. +## Preliminaries + +A few things need to be working in your server before. + Latest NVIDIA Drivers, OpenGL, VirtualGL(VGL), TurboVNC 2.11, , +#### NVIDIA Drivers +Download and install NVIDIA-drivers with typical tutorials +http://www.nvidia.es/Download/index.aspx +### OpenGL +Openg GL is necessary for Virtual GL. Normally OpenGL +can be installed through apt. + + sudo apt-get install freeglut3-dev mesa-utils +#### VGL +Follow this tutorial and install vgl +https://virtualgl.org/vgldoc/2_2_1/#hd004001 + +### TurboVNC +Follow the tutorial below to install TurboVNC 2.11 +https://cdn.rawgit.com/TurboVNC/turbovnc/2.1.1/doc/index.html#hd005001 + +WARNING: Take care on which VNC you install as it may not be compatible with Unreal. The one above was the only one that worked for me. +#### Extra Packages +These extra packages were necessary to make unreal to work. + sudo apt install 11-xserver-utils libxrandr-dev + + + + +### Configure your X + +You must generate a X compatible with your nvdia and compatible to run without display. For that, the following command worked: + + sudo nvidia-xconfig -a --use-display-device=None --virtual=1280x1024 + + + +## Emulating The Virtual Display + +Start by killing all Xorg servers. This command could change depending on your system. + + sudo service lightdm stop + +Run our own X server. Here I use number 7, but in theory it could be labeled with any number. + + sudo nohup Xorg :7 & + +Run an auxiliary remote VNC-Xserver. This will create a +virtual display "8". + + /opt/TurboVNC/bin/vncserver :8 + +If everything is working fine the following command +should run smoothly. + + DISPLAY=:8 vglrun -d :7.0 glxinfo +Note. This will run glx info on Xserver 7, device 0. This means you are selecting the GPU 0 on your machine. To run on other GPU such as GPU 1 run: + + DISPLAY=:8 vglrun -d :7.1 glxinfo + +## Running CARLA + +Now, finally, to run CARLA on a certain gpu_number placed in a certain $CARLA_PATH basiclly run. + + DISPLAY=:8 vglrun -d :7. $CARLA_PATH/CarlaUE4/Binaries/Linux/CarlaUE4 From a4622a4c5a737deba9c1d509939b30b92e19e56c Mon Sep 17 00:00:00 2001 From: felipecode Date: Wed, 24 Jan 2018 15:34:11 +0100 Subject: [PATCH 2/4] Some details on format --- Docs/carla_on_server.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Docs/carla_on_server.md b/Docs/carla_on_server.md index 843db5a9e..69918eb36 100644 --- a/Docs/carla_on_server.md +++ b/Docs/carla_on_server.md @@ -20,7 +20,7 @@ A few things need to be working in your server before. #### NVIDIA Drivers Download and install NVIDIA-drivers with typical tutorials http://www.nvidia.es/Download/index.aspx -### OpenGL +#### OpenGL Openg GL is necessary for Virtual GL. Normally OpenGL can be installed through apt. @@ -29,7 +29,7 @@ can be installed through apt. Follow this tutorial and install vgl https://virtualgl.org/vgldoc/2_2_1/#hd004001 -### TurboVNC +#### TurboVNC Follow the tutorial below to install TurboVNC 2.11 https://cdn.rawgit.com/TurboVNC/turbovnc/2.1.1/doc/index.html#hd005001 @@ -41,7 +41,7 @@ These extra packages were necessary to make unreal to work. -### Configure your X +#### Configure your X You must generate a X compatible with your nvdia and compatible to run without display. For that, the following command worked: From 2f4d3579f9e030e656faa7790909e0e2a952a786 Mon Sep 17 00:00:00 2001 From: felipecode Date: Mon, 29 Jan 2018 14:23:28 +0100 Subject: [PATCH 3/4] quick fix on extra packages --- Docs/carla_on_server.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Docs/carla_on_server.md b/Docs/carla_on_server.md index 69918eb36..980837184 100644 --- a/Docs/carla_on_server.md +++ b/Docs/carla_on_server.md @@ -36,7 +36,8 @@ https://cdn.rawgit.com/TurboVNC/turbovnc/2.1.1/doc/index.html#hd005001 WARNING: Take care on which VNC you install as it may not be compatible with Unreal. The one above was the only one that worked for me. #### Extra Packages These extra packages were necessary to make unreal to work. - sudo apt install 11-xserver-utils libxrandr-dev + + sudo apt install x11-xserver-utils libxrandr-dev From 4ab41f0e778f30b33831887897f29dad17cef926 Mon Sep 17 00:00:00 2001 From: felipecode Date: Mon, 29 Jan 2018 17:45:26 +0100 Subject: [PATCH 4/4] Update carla_on_server.md --- Docs/carla_on_server.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Docs/carla_on_server.md b/Docs/carla_on_server.md index 980837184..279616bfb 100644 --- a/Docs/carla_on_server.md +++ b/Docs/carla_on_server.md @@ -56,7 +56,7 @@ Start by killing all Xorg servers. This command could change depending on your s sudo service lightdm stop -Run our own X server. Here I use number 7, but in theory it could be labeled with any number. +Run your own Xorg. Here I use number 7, but it could be labeled with any free number. sudo nohup Xorg :7 & @@ -69,12 +69,12 @@ If everything is working fine the following command should run smoothly. DISPLAY=:8 vglrun -d :7.0 glxinfo -Note. This will run glx info on Xserver 7, device 0. This means you are selecting the GPU 0 on your machine. To run on other GPU such as GPU 1 run: +Note. This will run glxinfo on Xserver 7, device 0. This means you are selecting the GPU 0 on your machine. To run on other GPU, such as GPU 1 run: DISPLAY=:8 vglrun -d :7.1 glxinfo ## Running CARLA -Now, finally, to run CARLA on a certain gpu_number placed in a certain $CARLA_PATH basiclly run. +Now, finally, to run CARLA on a certain gpu_number placed in a certain $CARLA_PATH, run. DISPLAY=:8 vglrun -d :7. $CARLA_PATH/CarlaUE4/Binaries/Linux/CarlaUE4