diff --git a/Dockerfile b/Dockerfile index 33e294f..31e8c83 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ # FROM ubuntu:16.04 -FROM ubuntu:18.04 - +# FROM ubuntu:18.04 +FROM autoware/autoware:1.13.0-melodic-cuda # Make all NVIDIA GPUS visible, but I want to manually install drivers ARG NVIDIA_VISIBLE_DEVICES=all @@ -121,6 +121,9 @@ alsa pulseaudio libgtk2.0-0 && \ rm -rf /var/lib/apt/lists/* +USER root +WORKDIR / + # novnc # download websockify as well RUN wget https://github.com/novnc/noVNC/archive/v1.1.0.zip && \ diff --git a/run.sh b/run.sh index cf6d4e6..e3309bc 100644 --- a/run.sh +++ b/run.sh @@ -5,22 +5,22 @@ # nvidia-xconfig -a --virtual=800x600 --allow-empty-initial-configuration --enable-all-gpus --busid 0:4:0 BUS_ID=$(nvidia-xconfig --query-gpu-info | grep 'PCI BusID' | sed -r 's/\s*PCI BusID : PCI:(.*)/\1/') echo $BUS_ID -nvidia-xconfig -a --virtual=1280x720 --allow-empty-initial-configuration --enable-all-gpus --busid $BUS_ID +sudo nvidia-xconfig -a --virtual=1280x720 --allow-empty-initial-configuration --enable-all-gpus --busid $BUS_ID # 1. launch X server -Xorg :0 & +sudo Xorg :0 & sleep 2 # wait for the server gets ready # 2. start x11 and vnc connection -x11vnc -display :0 -passwd pass -forever -rfbport 5900 --verbose & +sudo x11vnc -display :0 -passwd pass -forever -rfbport 5900 --verbose & sleep 2 # wait for the server gets ready # 2.5 start audio -pulseaudio --start +sudo pulseaudio --start sleep 2 # 3. start noVNC -/noVNC-1.1.0/utils/launch.sh --vnc localhost:5900 --listen 8081 & +sudo /noVNC-1.1.0/utils/launch.sh --vnc localhost:5900 --listen 8081 & sleep 2 echo 'running noVNC at http://localhost:8081/vnc.html?host=localhost&port=8081' diff --git a/server.sh b/server.sh index dd2714e..08e8db2 100644 --- a/server.sh +++ b/server.sh @@ -1,4 +1,5 @@ docker build -t sim . + docker run --privileged -it --rm --gpus all \ -v $HOME/lgsvlsimulator-linux64-2019.11:/lg \ -v $HOME/container-unity3d:/root/.config/unity3d \