This repository provides scripts and tools for verifying the DRA Driver for NVIDIA GPUs on OpenShift.
- OpenShift 4.21+ cluster with GPU nodes
- Cluster administrator privileges (
cluster-adminrole) ocCLI tool- Helm 3.x (for DRA driver installation)
Verify that the DRA API is available on your cluster:
oc api-resources --api-group='resource.k8s.io'- Install the NVIDIA GPU operator for NVIDIA drivers and GPU allocation:
- Install the Node Feature Discovery (NFD) operator and create a
NodeFeatureDiscoveryCR. - Install the NVIDIA GPU Operator and create a
ClusterPolicyCR.
- Install the Node Feature Discovery (NFD) operator and create a
- Install the NVIDIA DRA driver (version 0.4.0 or later) for DRA features.
Follow these steps in order to get the NVIDIA DRA driver up and running in your cluster:
First, install the Node Feature Discovery (NFD) Operator:
./install-nfd-operator.shThen install the NVIDIA GPU Operator. Choose one of the following installation methods:
./install-gpu-operator-olm.sh# Set the bundle image (required)
export BUNDLE_IMAGE="your-bundle-image:tag"
./install-gpu-operator-bundle.sh
# Example with pre-release version:
export BUNDLE_IMAGE="ghcr.io/nvidia/gpu-operator/gpu-operator-bundle:main-latest"
./install-gpu-operator-bundle.shNote: The BUNDLE_IMAGE environment variable is required for bundle installation.
When using DRA for GPU allocation (including dynamic MIG), there is a known issue where the NVIDIA Driver Manager will not correctly evict the DRA driver kubelet plugin during GPU Operator driver upgrades. Without the configuration below, a GPU Operator upgrade will cause the driver daemonset pod to crash because the DRA driver holds the GPU, even when no workloads are running.
To avoid this, perform the following steps after installing the GPU Operator:
-
Label the GPU nodes that will use DRA GPU allocation:
oc label node <gpu-node> nvidia.com/dra-kubelet-plugin=true
-
Configure the GPU Operator's
ClusterPolicyto evict the DRA kubelet plugin during driver upgrades:oc patch clusterpolicy gpu-cluster-policy --type=merge -p '{ "spec": {"driver": {"manager": {"env": [{"name": "NODE_LABEL_FOR_GPU_POD_EVICTION", "value": "nvidia.com/dra-kubelet-plugin"}]}}} }'
Choose one of the following installation methods:
# Use default version (0.4.0)
./install-dra-driver-from-repo.sh
# Or explicitly specify a version
export DRA_DRIVER_VERSION="0.4.0"
./install-dra-driver-from-repo.sh# First build the driver image
export DRA_DRIVER_DIR="/path/to/dra-driver-nvidia-gpu"
export REGISTRY="your-registry.com/username"
export TAG="your-tag"
./build-dra-driver-image.sh
# Then install from local image
./install-dra-driver-from-local.shAfter installation, verify that the DRA driver is working:
# Check DRA driver pods
oc get pods -n dra-driver-nvidia-gpu
# Check for available GPU resource classes
oc get resourceclassSee dynamic-mig.md for instructions on setting up and verifying dynamic MIG with the DRA driver.
The imex-test-jobs directory contains validation tests for multi-node NVLink communication using NVIDIA IMEX channels.