diff --git a/AWS.md b/AWS.md new file mode 100644 index 0000000..395baaf --- /dev/null +++ b/AWS.md @@ -0,0 +1,15 @@ +# AWSでやる場合の手順書 + +## インスタンス起動 +g4dn.2xlargeの立ち上げ +ベースAMIは素のubuntu18.04 + +## インスタンス内準備 + +- ドライバインストール + https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/install-nvidia-driver.html + https://docs.aws.amazon.com/ja_jp/AWSEC2/latest/UserGuide/optimize_gpu.html + など参照 +- dockerのインストール + utils/install-docker.sh参照 + diff --git a/Dockerfile b/Dockerfile index 693624f..716eb35 100644 --- a/Dockerfile +++ b/Dockerfile @@ -38,10 +38,9 @@ # Same command as nvidia/driver, except --x-{prefix,module-path,library-path,sysconfig-path} are omitted in order to make use default path and enable X drivers. # 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 +ENV DRIVER_VERSION=418.87.01 RUN cd /tmp && \ - curl -fSsl -O https://us.download.nvidia.com/tesla/$DRIVER_VERSION/NVIDIA-Linux-x86_64-$DRIVER_VERSION.run && \ + curl -fSsl -O https://us.download.nvidia.com/tesla/418.87/NVIDIA-Linux-x86_64-418.87.01.run && \ sh NVIDIA-Linux-x86_64-$DRIVER_VERSION.run -x && \ cd NVIDIA-Linux-x86_64-$DRIVER_VERSION* && \ ./nvidia-installer --silent \ @@ -60,9 +59,9 @@ mv LICENSE mkprecompiled kernel /usr/src/nvidia-$DRIVER_VERSION && \ sed '9,${/^\(kernel\|LICENSE\)/!d}' .manifest > /usr/src/nvidia-$DRIVER_VERSION/.manifest && \ rm -rf /tmp/* + # this option cannot be used on newer driver # --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 @@ -101,10 +100,6 @@ 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 - # (3) Run Xorg server + x11vnc + X applications # see run.sh for details COPY run.sh /run.sh diff --git a/run.sh b/run.sh index b719c8a..421a032 100644 --- a/run.sh +++ b/run.sh @@ -3,7 +3,9 @@ # 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 # 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 +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 # 1. launch X server Xorg :0 & diff --git a/server.sh b/server.sh index 688705c..dd2714e 100644 --- a/server.sh +++ b/server.sh @@ -1,12 +1,10 @@ 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/lgsvlsimulator-linux64-2019.11:/lg \ -v $HOME/container-unity3d:/root/.config/unity3d \ -p 8081:8081 \ -p 8082:8082 \ --name sim sim - # 8081: noVNC port # 8082: simulator