Member-only story

Add NVIDIA drivers to Kubernetes using Image Factory

Luca Berton
6 min readOct 30, 2024

Adding NVIDIA drivers to an image in a Kubernetes environment, especially when using a tool like Image Factory (or another image-building tool), requires careful planning to ensure compatibility between the drivers, the container runtime (such as Docker or containerd), and the hardware that will be running the workload.

Here’s a general process for adding NVIDIA drivers to a base image using an image factory, along with details for configuring it within Kubernetes clusters:

Steps for Adding NVIDIA Drivers on an Image Factory

  1. Base Image Selection: Start with a base image that is compatible with NVIDIA’s GPU drivers. If you’re using an operating system like Ubuntu or CentOS, NVIDIA provides pre-built CUDA images, which are often a good starting point.
  2. You can also start with a standard base image (like ubuntu:20.04 or centos:8) and install the drivers yourself.
  3. Install CUDA Toolkit and NVIDIA Drivers: If you are starting from a non-CUDA base image, you will need to install the NVIDIA drivers and CUDA toolkit manually in the Dockerfile or image build configuration.
  4. Here’s an example Dockerfile that installs the NVIDIA drivers and CUDA toolkit in a Ubuntu base image:

--

--

Luca Berton
Luca Berton

Written by Luca Berton

I help creative Automation DevOps, Cloud Engineer, System Administrator, and IT Professional to succeed with Ansible Technology to automate more things everyday

No responses yet