Examples of Running Containers

This chapter walks you through the process of logging in to the NGC container registry, pulling and running a container, and using file storage and data disks for storage.

Logging Into the NGC Container Registry

You need to log in to the NGC container registry only if you want to access locked containers from the registry. Most of the NGC containers are freely available (unlocked) and do not require an NGC account or NGC API key.

If necessary, log in to the NGC container registry manually by running the following script from the VMI.

ngc-login.sh <your-NGC-API-key>

From this point you can run Docker commands and access locked NGC containers from the VM instance.

Example: MNIST Training Run Using TensorFlow Container

Once logged in to the NVIDIA GPU Cloud VM, you can run the MNIST example under TensorFlow.

Note that the TesnsorFlow built-in example will pull the MNIST dataset from the web.

  1. Pull and run the TensorFlow container.
    docker pull nvcr.io/nvidia/tensorflow:18.08-py3
    docker run --runtime=nvidia --rm -it nvcr.io/nvidia/tensorflow:18.08-py3
  2. Following this tutorial: https://www.tensorflow.org/get_started/mnist/beginners, run the MNIST_with_summaries example.
    cd /opt/tensorflow/tensorflow/examples/tutorials/mnist
    python mnist_with_summaries.py