Member-only story
Add NVIDIA drivers to Kubernetes using Image Factory
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
- 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.
- You can also start with a standard base image (like
ubuntu:20.04
orcentos:8
) and install the drivers yourself. - 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.
- Here’s an example Dockerfile that installs the NVIDIA drivers and CUDA toolkit in a Ubuntu base image: