GPU Cloud Server

Deploy the NGC environment on a GPU instance.

2026-01-27 09:36:14

NVIDIA NGC is the hub for GPU-optimized software for deep learning, machine learning, and HPC that provides containers, models, model scripts, and industry solutions so data scientists, developers and researchers can focus on building solutions and gathering insights faster.

Before You Begin

· A user must register a NGC account at https://ngc.nvidia.com/signin.

· The GPU cloud server must be bound to the EIP.

Installation Steps

1. Create a GPU cloud server by referring to Create GPU Cloud Server Without GPU Driver.

2. Install the driver for the GPU cloud server. The latest OS driver version is recommended. For more information, see NVIDIA Driver Installation Guide.

3. Install Docker and Docker Utility Engine for NVIDIA GPU, that is, nvidia-docker.

For more information on how to install Docker, see Ubuntu and CentOS. Here we take CentOS as an example to describe the operation procedure.

a. Before installing a new Docker version, please uninstall all older versions and associated dependencies.

sudo yum remove   docker \
                  docker-client \
                  docker-client-latest \
                  docker-common \
                  docker-latest \
                  docker-latest-logrotate \
                  docker-logrotate \
                  docker-engine

b. Set the Docker repository.

sudo yum install -y yum-utils
sudo yum-config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo

c. Install the Docker engine.

sudo yum install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

d. Start Docker.

sudo systemctl start docker

e. Install nvidia-docker.

· Set the repository and GPG key.

distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
   && curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.repo | sudo tee /etc/yum.repos.d/nvidia-container-toolkit.repo

· Install the nvidia-container-toolkit package (and dependencies) after you update the package list.

sudo yum clean expire-cache
sudo yum install -y nvidia-container-toolkit

· Configure the Docker daemon to recognize the NVIDIA container runtime.

sudo nvidia-ctk runtime configure --runtime=docker
sudo systemctl restart docker

· Test the working setup by running the basic CUDA container.

sudo docker run --rm --runtime=nvidia --gpus all nvidia/cuda:11.6.2-base-ubuntu20.04 nvidia-smi

Use NVIDIA NGC

1. to generate the API key of NGC.

A. After successfully registering an NGC account at https://ngc.nvidia.com/signin, generate the API key for the account.

Log in to the NGC page, click Account Name, and select Setup. The Setup page is displayed. Then click Get API Key to go to the Generate API Key page.

    

b. On the API Key page, click Generate API Key. The confirm dialog box is displayed.

c. In the Confirm dialog box, click Confirm. A page similar to the following figure is displayed.

d. A series of passwords are displayed in the Password field. You can return to the shell interface of the GPU instance and follow the operations shown in the figure.

$ docker login nvcr.io
Username: $oauthtoken
Password: [Enter the generated key]

1. Use an image in NGC (PyTorch as an example).

a. Go to the NGC CATALOG, select the CONTAINERS branch, enter PyTorch in Query, and click PyTorch.

b. Click Get Container. The method of pulling an image for the container is displayed.

c. Use the command in the red box in the figure above to get the container image of the latest version. Run the following command on the command line interface of the GPU instance.

$ docker pull nvcr.io/nvidia/pytorch:23.07-py3

In this way, we can use the framework or software products in the way of docker containers.