Running DGL
Before you can run an NGC deep learning framework container, your Docker environment must support NVIDIA GPUs. To run a container, issue the appropriate command as explained in Running A Container and specify the registry, repository, and tags. On a system with GPU support for NGC containers, when you run a container, the following occurs when running a container:
- The Docker engine loads the image into a container that runs the software.
- You define the container's runtime resources by including the additional flags and settings that are used with the command.
These flags and settings are described in Running A Container.
- The GPUs are explicitly defined for the Docker® container, which defaults to all GPUs, but can be specified by using the
NVIDIA_VISIBLE_DEVICES
environment variable.For more information, refer to the nvidia-docker documentation.
Note:Starting in Docker 19.03, complete the steps below.
The method implemented in your system depends on the DGX OS version installed (for DGX systems), the specific NGC Cloud Image provided by a Cloud Service Provider, or the software that you have installed in preparation for running NGC containers on TITAN PCs, Quadro PCs, or vGPUs.
-
Issue the command for the applicable release of the container that you want.
The following command assumes you want to pull the latest container:
docker pull nvcr.io/nvidia/dgl:<xx.xx>-py3
- Open a command prompt and paste the
pull
command.Ensure that the pull process completes successfully completes before proceeding to step 3.
- Run the container image.
To run the container, select one of the following modes:
- Interactive mode: If you have Docker 19.03 or later, a typical command to launch the container is:
docker run --gpus all -it --rm -v local_dir:container_dir nvcr.io/nvidia/dgl:<xx.xx>-py3
If you have Docker 19.02 or earlier, a typical command to launch the container is:nvidia-docker run -it --rm -v local_dir:container_dir nvcr.io/nvidia/dgl:<xx.xx>-py3
- Non-interactive mode: If you have Docker 19.03 or later, a typical command to launch the container is:
docker run --gpus all --rm -v local_dir:container_dir nvcr.io/nvidia/dgl:<xx.xx>-py3 <command>
If you have Docker 19.02 or earlier, a typical command to launch the container is:nvidia-docker run --rm -v local_dir:container_dir nvcr.io/nvidia/dgl:<xx.xx>-py3 <command>
- Interactive mode: If you have Docker 19.03 or later, a typical command to launch the container is:
If you use multiprocessing for multi-threaded data loaders, the default shared memory segment size that the container runs with might not be enough. To increase the shared memory size, run one of the following commands:
--ipc=host
or
--shm-size=<requested memory size>
in the command line to
docker run --gpus all
You might want to pull data and model descriptions from locations outside the container for use by DGL or save results to locations outside the container. The easiest method is to mount one or more host directories as Docker data volumes.