diff --git a/Dockerfile b/Dockerfile index f5f4bb3..693624f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,8 +18,13 @@ curl \ wget \ vim \ + zip \ + unzip \ + git \ + python \ kmod \ libc6:i386 \ + pkg-config \ libelf-dev && \ rm -rf /var/lib/apt/lists/* @@ -34,6 +39,7 @@ # Driver version must be equal to host's driver # Install the userspace components and copy the kernel module sources. ENV DRIVER_VERSION=410.104 +# ENV DRIVER_VERSION=440.33.01 RUN cd /tmp && \ curl -fSsl -O https://us.download.nvidia.com/tesla/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run && \ sh NVIDIA-Linux-x86_64-$DRIVER_VERSION.run -x && \ @@ -47,13 +53,16 @@ --no-backup \ --no-check-for-alternate-installs \ --no-libglx-indirect \ - --no-install-libglvnd \ --no-glvnd-egl-client \ - --no-glvnd-glx-client && \ + --no-glvnd-glx-client \ + --no-install-libglvnd && \ mkdir -p /usr/src/nvidia-$DRIVER_VERSION && \ mv LICENSE mkprecompiled kernel /usr/src/nvidia-$DRIVER_VERSION && \ sed '9,${/^\(kernel\|LICENSE\)/!d}' .manifest > /usr/src/nvidia-$DRIVER_VERSION/.manifest && \ rm -rf /tmp/* + # --no-glvnd-egl-client \ + # --no-glvnd-glx-client \ + # this option cannot be used on driver 440.33.01 # (2) Configurate Xorg # (2-1) Install some necessary softwares @@ -64,17 +73,34 @@ # x11-apps: xeyes can be used to make sure that X11 server is running. # RUN apt-get update && apt-get install -y --no-install-recommends \ - pkg-config \ mesa-utils \ x11vnc \ x11-apps && \ rm -rf /var/lib/apt/lists/* # (2-2) Optional vulkan support +# vulkan-utils includes vulkan-smoketest, benchmark software of vulkan API RUN apt-get update && apt-get install -y --no-install-recommends \ libvulkan1 vulkan-utils && \ rm -rf /var/lib/apt/lists/* +# for test +RUN apt-get update && apt-get install -y --no-install-recommends \ + firefox openbox && \ + rm -rf /var/lib/apt/lists/* + +# sound driver and GTK library +# ALSA系のエラーがでる時は、pulseaudioをインストールして +# X起動後にpulseaudio --start でdaemonを開始させる。 +RUN apt-get update && apt-get install -y --no-install-recommends \ + alsa pulseaudio libgtk2.0-0 && \ + rm -rf /var/lib/apt/lists/* + +# novnc +RUN wget https://github.com/novnc/noVNC/archive/v1.1.0.zip && \ + unzip -q v1.1.0.zip && \ + rm -rf v1.1.0.zip + # (2-3) Copy xorg.conf # use existing one COPY xorg.conf /etc/X11/xorg.conf diff --git a/docker-compose.yml b/docker-compose.yml index 1fc8268..704b8df 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,3 +12,5 @@ - SCREEN_RESOLUTION: 1280x1024 - VNC_PASSWORD: ryought privileged: true + autoware: + image: autoware/autoware:latest-kinetic diff --git a/run.sh b/run.sh index 7b9ddf5..b719c8a 100644 --- a/run.sh +++ b/run.sh @@ -1,16 +1,34 @@ # inside docker script # 0. generate xorg.conf if not copied -[ ! -e /etc/X11/xorg.conf ] && nvidia-xconfig -a --virtual=$SCREEN_RESOLUTION --allow-empty-initial-configuration --enable-all-gpus --busid $BUSID +# [ ! -e /etc/X11/xorg.conf ] && nvidia-xconfig -a --virtual=$SCREEN_RESOLUTION --allow-empty-initial-configuration --enable-all-gpus --busid $BUSID +# nvidia-xconfig -a --virtual=800x600 --allow-empty-initial-configuration --enable-all-gpus --busid 0:4:0 +nvidia-xconfig -a --virtual=1280x720 --allow-empty-initial-configuration --enable-all-gpus --busid 0:4:0 # 1. launch X server Xorg :0 & -sleep 3 # wait for the server gets ready +sleep 2 # wait for the server gets ready # 2. start x11 and vnc connection -x11vnc -display :0 -passwd $VNC_PASSWORD -forever & -sleep 3 # wait for the server gets ready +x11vnc -display :0 -passwd pass -forever -rfbport 5900 & +sleep 2 # wait for the server gets ready + +# 2.5 start audio +pulseaudio --start +sleep 2 + +# 3. start noVNC +/noVNC-1.1.0/utils/launch.sh --vnc localhost:5900 --listen 8081 & +sleep 2 # 3. start simulator export DISPLAY=:0 -./lg/simulator -screen-height 480 -screen-width 640 -screen-quality Beautiful -screen-fullscreen 0 +# ./lg/simulator -screen-height 480 -screen-width 640 -screen-quality Beautiful -screen-fullscreen 0 +# ./lg/simulator -p 8082 +# # xeyes +# glxgears +# glxinfo +# vulkan +# firefox +# xterm +openbox diff --git a/server.sh b/server.sh index c73a286..688705c 100644 --- a/server.sh +++ b/server.sh @@ -1,8 +1,12 @@ -nvidia-docker build -t x11-GL-docker . -docker run --runtime=nvidia --privileged -it --rm \ - -p 5900:5900 \ # or --net=host - -e BUSID=PCI:0:4:0 \ - -e SCREEN_RESOLUTION=1280x1024 \ - -e VNC_PASSWORD=passpass \ - -v $HOME/lgsvlsimulator-linux64-2019.05:/lg \ - --name x11-GL-docker x11-GL-docker +docker build -t sim . +docker run --privileged -it --rm --gpus all \ + --device=/dev/snd:/dev/snd \ + -v $HOME/lg/lgsvlsimulator-linux64-2019.10:/lg \ + -v $HOME/container-unity3d:/root/.config/unity3d \ + -p 8081:8081 \ + -p 8082:8082 \ + --name sim sim + + +# 8081: noVNC port +# 8082: simulator