Deploy on Azure

Felix Abecassis edited this page Nov 14, 2017 · 6 revisions

This page hasn't been updated for 2.0 yet


  1. Azure subscription ID
  2. GPU instance creation
  3. Container deployment

Azure Subscription ID

Connect to your Microsoft Azure Dashboard and find your Subscription ID: This image was kindly provided by the Azure support team.

GPU instance creation

Before deploying GPU containers, we first need to provision a VM of the N-Series type.
Using Docker machine and your subscription ID:

docker-machine create --driver azure \
                      --azure-subscription-id ********-****-****-****-************ \
                      --azure-location southcentralus \
                      --azure-size Standard_NV6 \
                      --azure-image canonical:UbuntuServer:16.04.0-LTS:latest \

The first time you run this command, you will be asked to open a webpage and enter an authentication code, after you do, provisioning will resume.

(azure01) Microsoft Azure: To sign in, use a web browser to open the page and enter the code ********* to authenticate.

Once the provisioning is completed, we must install the NVIDIA driver and nvidia-docker.

# SSH into the machine
docker-machine ssh azure01

# Install official NVIDIA driver package
sudo apt-key adv --fetch-keys
sudo sh -c 'echo "deb /" > /etc/apt/sources.list.d/cuda.list'
sudo apt-get update && sudo apt-get install -y --no-install-recommends cuda-drivers

# Unload nouveau
sudo rmmod nouveau

# Install nvidia-docker and nvidia-docker-plugin
wget -P /tmp
sudo dpkg -i /tmp/nvidia-docker*.deb && rm /tmp/nvidia-docker*.deb

Container deployment

First, setup your environment:

eval `docker-machine env azure01`
export NV_HOST="ssh://docker-user@$(docker-machine ip azure01):"
ssh-add ~/.docker/machine/machines/azure01/id_rsa

Using nvidia-docker remotely you can now deploy your containers in the Azure cloud:

nvidia-docker run --rm nvidia/cuda nvidia-smi
| NVIDIA-SMI 367.57                 Driver Version: 367.57                    |
| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |
|   0  Tesla M60           Off  | A527:00:00.0     Off |                  Off |
| N/A   39C    P8    14W / 150W |      0MiB /  8123MiB |      0%      Default |

When you're done, remember to cleanup your instance with docker-machine rm -f azure01.

You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.