improve gpu plugin install
@@ -14,6 +14,17 @@ gpu: build
@if hash nvidia-docker 2>/dev/null; then \
echo "nvidia-docker found"; \
docker pull nvidia/cuda:8.0-runtime; \
+ if [ "${OS}" = "Linux" ] ; then \
+ if [ -f /etc/redhat-release ] ; then \
+ sudo sed -i '/ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR/c\ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR -l :3476' /usr/lib/systemd/system/nvidia-docker.service; \
+ sudo systemctl daemon-reload; \
+ sudo systemctl start nvidia-docker; \
+ elif [ -f /etc/debian_version ] ; then \
+ sudo sed -i '/ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR/c\ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR -l :3476' /lib/systemd/system/nvidia-docker.service; \
+ sudo systemctl daemon-reload; \
+ sudo systemctl restart nvidia-docker; \
+ fi \
+ fi \
else \
if [ "${OS}" = "Linux" ] ; then \
docker pull nvidia/cuda:8.0-runtime; \
@@ -26,13 +37,14 @@ gpu: build
elif [ -f /etc/debian_version ] ; then \
wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1-1_amd64.deb && \
sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb; \
- sudo sed -i '/ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR/c\ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR -l :3476' /etc/systemd/system/multi-user.target.wants/nvidia-docker.service; \
+ sudo sed -i '/ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR/c\ExecStart=/usr/bin/nvidia-docker-plugin -s $$SOCK_DIR -l :3476' /lib/systemd/system/nvidia-docker.service; \
sudo systemctl daemon-reload; \
- sudo service nvidia-docker restart; \
+ sudo systemctl restart nvidia-docker; \
else \
wget -P /tmp https://github.com/NVIDIA/nvidia-docker/releases/download/v1.0.1/nvidia-docker_1.0.1_amd64.tar.xz && \
sudo tar --strip-components=1 -C /usr/bin -xvf /tmp/nvidia-docker*.tar.xz && rm /tmp/nvidia-docker*.tar.xz && \
sudo -b nohup nvidia-docker-plugin > /tmp/nvidia-docker.log; \
+ echo "!!! Nvidia-docker-plugin needs to be configured to bind to all interfaces !!!"; \
fi \
else \
echo "unable to install nvidia-docker on this host"; \
