VOOZH about

URL: https://thenewstack.io/tutorial-deploy-the-nvidia-gpu-operator-on-kubernetes-based-on-containerd-runtime/

⇱ Tutorial: Deploy the Nvidia GPU Operator on Kubernetes Based on containerd Runtime - The New Stack


TNS
SUBSCRIBE
Join our community of software engineering leaders and aspirational developers. Always stay in-the-know by getting the most important news and exclusive content delivered fresh to your inbox to learn more about at-scale software development.
REQUIRED
It seems that you've previously unsubscribed from our newsletter in the past. Click the button below to open the re-subscribe form in a new tab. When you're done, simply close that tab and continue with this form to complete your subscription.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.
Welcome and thank you for joining The New Stack community!
Please answer a few simple questions to help us deliver the news and resources you are interested in.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Great to meet you!
Tell us a bit about your job so we can cover the topics you find most relevant.
REQUIRED
REQUIRED
REQUIRED
REQUIRED
REQUIRED
Welcome!

We’re so glad you’re here. You can expect all the best TNS content to arrive Monday through Friday to keep you on top of the news and at the top of your game.

What’s next?

Check your inbox for a confirmation email where you can adjust your preferences and even join additional groups.

Follow TNS on your favorite social media networks.

Become a TNS follower on LinkedIn.

Check out the latest featured and trending stories while you wait for your first TNS newsletter.

PREV
1 of 2
NEXT
VOXPOP
As a JavaScript developer, what non-React tools do you use most often?
Angular
0%
Astro
0%
Svelte
0%
Vue.js
0%
Other
0%
I only use React
0%
I don't use JavaScript
0%
Thanks for your opinion! Subscribe below to get the final results, published exclusively in our TNS Update newsletter:
NEW! Try Stackie AI
From clobbered drafts to real-time sync
Apr 14th 2026 10:00am, by David Moore
TypeScript 6.0 RC arrives as a bridge to a faster future
Mar 14th 2026 9:00am, by Darryl K. Taft
Mastra empowers web devs to build AI agents in TypeScript
Jan 28th 2026 11:00am, by Loraine Lawson
2021-06-03 03:00:34
Tutorial: Deploy the Nvidia GPU Operator on Kubernetes Based on containerd Runtime
tutorial,
Edge Computing / Kubernetes

Tutorial: Deploy the Nvidia GPU Operator on Kubernetes Based on containerd Runtime

Here are the steps to install containerd, Kubernetes, and NVIDIA GPU Operator. Towards the end of the installation, we will test the GPU access by running the popular nvidia-smi command within the pod.
Jun 3rd, 2021 3:00am by Janakiram MSV
👁 Featued image for: Tutorial: Deploy the Nvidia GPU Operator on Kubernetes Based on containerd Runtime

This tutorial will explore the steps to install Nvidia GPU Operator on a Kubernetes cluster with GPU hosts based on the containerd runtime instead of Docker Engine.

In a typical GPU-based Kubernetes installation, each node needs to be configured with the correct version of Nvidia graphics driver, CUDA runtime, and cuDNN libraries followed by a container runtime such as Docker Engine, containerd, podman, or CRI-O. Then, the Nvidia Container Toolkit is deployed to provide GPU access to the containerized applications. Finally, Kubernetes is installed, which will interact with the chosen container runtime to manage the lifecycle of workloads.

Nvidia GPU Operator dramatically simplifies the process without installing the drivers, CUDA runtime, cuDNN libraries, or the Container Toolkit. It can be installed on any Kubernetes cluster that meets specific hardware and software requirements.

Below are the steps to install containerd, Kubernetes, and Nvidia GPU Operator. Towards the end of the installation, we will test the GPU access by running the popular nvidia-smi command within the pod.

Environment

Operating system: Ubuntu 18.04 LTS Server
GPU: Nvidia GeForce RTX 3090
CPU: AMD Ryzen ThreadRipper 3990X
RAM: 128GB
HDD: 4TB NVMe SSD

Step 1: Install Containerd Runtime

Load the required modules and ensure they are persisted during reboots.

sudo modprobe overlay
sudo modprobe br_netfilter
cat <
cat <

Load the sysctl parameters without rebooting the system.

sudo sysctl --system

Finally, install the containerd runtime.

sudo apt-get update
sudo apt-get install -y containerd

Let’s create the default containerd configuration file.

sudo mkdir -p /etc/containerd
sudo containerd config default | sudo tee /etc/containerd/config.toml

Set the cgroup driver for runc to systemd, which is required for the kubelet.

Within the [plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc] section, add the following lines:

[plugins."io.containerd.grpc.v1.cri".containerd.runtimes.runc.options]
 SystemdCgroup = true

Your config.toml should look like this:

👁 Image

Restart containerd with the new configuration.

sudo systemctl restart containerd

Check the status of containerd runtime.

systemctl status containerd

👁 Image

Step 2: Install Kubernetes 1.21

Start by disabling swap memory.

sudo swapoff -a
sudo sed -i '/ swap / s/^\(.*\)$/#\1/g' /etc/fstab

Install the required tools.

sudo apt-get update
sudo apt-get install -y apt-transport-https
curl -s https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add -
echo "deb http://apt.kubernetes.io/ kubernetes-xenial main" | sudo tee -a /etc/apt/sources.list.d/kubernetes.list
sudo apt-get update sudo apt install -y kubeadm kubelet kubernetes-cni

Let’s initialize the control plane.

sudo kubeadm init --pod-network-cidr=10.244.0.0/16 --apiserver-advertise-address=10.0.0.54

Make sure you replace the IP address of 10.0.0.54 with the appropriate address of your host.

It’s time to configure kubectl CLI.

mkdir $HOME/.kube
sudo cp /etc/kubernetes/admin.conf $HOME/.kube/
sudo chown $(id -u):$(id -g) $HOME/.kube/admin.conf
export KUBECONFIG=$HOME/.kube/admin.conf
echo "export KUBECONFIG=$HOME/.kube/admin.conf" | tee -a ~/.bashrc

Before we can access the cluster, we need to install the CNI addon. For this tutorial, we are using Weave Net from Weave Works.

kubectl apply -f "https://cloud.weave.works/k8s/net?k8s-version=$(kubectl version | base64 | tr -d '\n')"

Since we only have one node, let’s remove the taint to enable scheduling.

kubectl taint nodes --all node-role.kubernetes.io/master-

Finally, check the status of the cluster.

kubectl get nodes

👁 Image

Step 3 – Install Nvidia GPU Operator

Start by installing the binary of Helm3.

curl -fsSL -o get_helm.sh https://raw.githubusercontent.com/helm/helm/master/scripts/get-helm-3 
chmod 700 get_helm.sh
./get_helm.sh

Add the Nvidia Helm Repository.

helm repo add nvidia https://nvidia.github.io/gpu-operator
helm repo update

Since we are using the containerd runtime, let’s set that as the default.

helm install --wait --generate-name \
 nvidia/gpu-operator \
 --set operator.defaultRuntime=containerd

Within a few minutes, you should see the pods in the gpu-operator-resources namespace running.

kubectl get pods -n gpu-operator-resources

👁 Image

It’s time to test the GPU access from a pod. Run the below command to launch a test pod.

kubectl run gpu-test \
 --rm -t -i \
 --restart=Never \
 --image=nvcr.io/nvidia/cuda:10.1-base-ubuntu18.04 nvidia-smi

👁 Image

Congratulations! In less than 10 minutes, we configured a Kubernetes cluster based on containerd powered by a GPU.

TRENDING STORIES
Janakiram MSV (Jani) is a practicing architect, research analyst, and advisor to Silicon Valley startups. He focuses on the convergence of modern infrastructure powered by cloud-native technology and machine intelligence driven by generative AI. Before becoming an entrepreneur, he spent...
Read more from Janakiram MSV
SHARE THIS STORY
TRENDING STORIES
TNS owner Insight Partners is an investor in: Docker.
SHARE THIS STORY
TRENDING STORIES
TNS DAILY NEWSLETTER Receive a free roundup of the most recent TNS articles in your inbox each day.
The New Stack does not sell your information or share it with unaffiliated third parties. By continuing, you agree to our Terms of Use and Privacy Policy.