Pulling and running NGC containers
# Login (for private/org registries)
docker login nvcr.io
# Username: $oauthtoken
# Password: <your NGC API key>
# Pull a container
docker pull nvcr.io/nvidia/pytorch:24.01-py3
# Run with all GPUs
docker run --gpus all -it --rm nvcr.io/nvidia/pytorch:24.01-py3
# Run with a specific GPU
docker run --gpus '"device=0"' -it --rm nvcr.io/nvidia/pytorch:24.01-py3
# Mount a data directory
docker run --gpus all -it --rm \
-v /data:/workspace/data \
nvcr.io/nvidia/pytorch:24.01-py3
In Kubernetes:
# Create NGC pull secret
kubectl create secret docker-registry ngc-secret \
--docker-server=nvcr.io \
--docker-username='$oauthtoken' \
--docker-password=<NGC_API_KEY>
spec:
containers:
- name: trainer
image: nvcr.io/nvidia/pytorch:24.01-py3
resources:
limits:
nvidia.com/gpu: 4
imagePullSecrets:
- name: ngc-secret
NGC also provides: pre-trained models, NIM inference containers, Helm charts, SDKs (TensorRT, Triton, Riva).
