Newer
Older
glx-docker-headless-gpu / startup.sh
@ikko ikko on 25 Apr 2021 1 KB Update startup.sh
# inside docker script
trap 'kill $(jobs -p)' EXIT

# 0. generate xorg.conf
BUS_ID=$(nvidia-xconfig --query-gpu-info | grep 'PCI BusID' | sed -r 's/\s*PCI BusID : PCI:(.*)/\1/')
nvidia-xconfig -a --virtual=$RESOLUTION --allow-empty-initial-configuration --enable-all-gpus --busid $BUS_ID --use-display-device="DFP-0" --connected-monitor="DFP-0"

# 1. launch X server
Xorg :0 &
sleep 1  # wait for the server gets ready

# 2. start x11 and vnc connection
# to inspect logs in detail, use --verbose
#x11vnc -display :0 -passwd $VNCPASS -forever -rfbport 5900 -noncache &
x11vnc  -display :0 -passwd $VNCPASS -forever -rfbport 5900 -bg -xkb -noxrecord -noxfixes -noxdamage -shared -norc -repeat  -ncache 10 &
sleep 2  # wait for the server gets ready

# 2.5 start audio
# this is not required.
# pulseaudio --start
# sleep 2

# 3. start noVNC
/noVNC-1.2.0/utils/launch.sh --vnc 172.17.0.2:5900 --listen 8081 &
sleep 2

echo 'running noVNC at http://docker_ip:6080/vnc_lite.html'

# 3. start simulator
export DISPLAY=:0
openbox