

 **Help improve this page** 

To contribute to this user guide, choose the **Edit this page on GitHub** link that is located in the right pane of every page.

# Use the NVIDIA DRA driver or device plugin on Amazon EKS

Amazon EKS supports two mechanisms for managing NVIDIA GPU devices in your EKS clusters: the *NVIDIA DRA driver for GPUs* and the *NVIDIA Kubernetes device plugin*.

We recommend using the NVIDIA DRA driver for new deployments with Kubernetes versions 1.34 and later. The NVIDIA DRA driver is supported with EKS Auto Mode, Karpenter, EKS managed node groups, and self-managed nodes. The [NVIDIA device plugin](#eks-nvidia-device-plugin) remains fully supported on all of these for all Kubernetes versions.

EKS Auto Mode includes the NVIDIA DRA driver in the node runtime on Kubernetes version 1.36 and later. You do not install or manage the driver, and EKS Auto Mode prevents the DRA driver and the device plugin from managing GPUs on the same node. For more information, see [Using DRA with EKS Auto Mode](device-management.md#dra-auto-mode). With Karpenter, EKS managed node groups, or self-managed nodes, you install the driver as described in [Install the NVIDIA DRA driver](#eks-nvidia-dra-driver). Karpenter supports DRA with both dynamic and static capacity provisioning as of Karpenter version 1.15. Dynamic provisioning requires enabling Karpenter feature gates. For more information, see [Using DRA with Karpenter](device-management.md#dra-karpenter).

If you are using GPU sharing features such as multi-instance GPUs (MIG) or time-slicing, we recommend using static configuration with the DRA driver or using the NVIDIA device plugin. Dynamic MIG and user-mediated time-slicing are in alpha state in the NVIDIA DRA driver, and are not available in EKS Auto Mode. See the [NVIDIA DRA driver releases](https://github.com/kubernetes-sigs/dra-driver-nvidia-gpu/releases) on GitHub for the latest updates.

## NVIDIA DRA driver vs. NVIDIA device plugin
<a name="eks-nvidia-dra-vs-plugin"></a>


| Feature | NVIDIA DRA driver | NVIDIA device plugin | 
| --- | --- | --- | 
| Minimum Kubernetes version | 1.34 | All EKS-supported Kubernetes versions | 
| EKS Compute | EKS Auto Mode (Kubernetes 1.36 and later), Karpenter, managed node groups, self-managed nodes | EKS Auto Mode, Karpenter, managed node groups, self-managed nodes | 
| EKS-optimized AMIs | AL2023 (NVIDIA), Bottlerocket | AL2023 (NVIDIA), Bottlerocket | 
| Device advertisement | Rich attributes via `ResourceSlice` objects including GPU model, memory, driver version, and topology | Integer count of `nvidia.com/gpu` extended resources | 
| GPU sharing | (Alpha) Dynamic MIG, MPS, time-slicing. Not available in EKS Auto Mode. | (GA) Static MIG, MPS, time-slicing. Not configurable in EKS Auto Mode. | 
| ComputeDomains | Manages Multi-Node NVLink (MNNVL) through `ComputeDomain` resources for secure multi-node GPU communication | Not supported | 
| Attribute-based selection | Filter GPUs by model, memory, or other attributes using CEL expressions | Not supported | 
| Topology-aware EFA allocation | DRA-native topology-awareness | Automatic topology-awareness (EKS-optimized AL2023 AMIs only) | 

## NVIDIA GPU node labels
<a name="eks-nvidia-gpu-labels"></a>

NVIDIA GPU nodes carry a set of `nvidia.com/*` Kubernetes node labels that describe the GPU hardware and how it is configured. Different components apply different labels. A label is present only when the component that writes it runs on the node. Understanding which component applies each label helps you write reliable node selectors and interpret what a node reports.

A node that runs only the NVIDIA device plugin, without GPU Feature Discovery, has no `nvidia.com/*` labels except `nvidia.com/gpu.present=true` on the nodes that get it automatically. EKS Auto Mode applies `nvidia.com/gpu.present=true` to every node with NVIDIA GPUs, and the EKS AL2023 and Bottlerocket NVIDIA AMIs apply it when the node starts. You can select `nvidia.com/gpu.present=true` in a Pod’s `nodeSelector` or node affinity to schedule the Pod onto nodes with NVIDIA GPUs.

The labels are informational and are used for node targeting. To run a workload on a GPU, request the GPU *resource* (for example, `nvidia.com/gpu` or `nvidia.com/mig-1g.10gb`) in the Pod spec. Use the labels in a `nodeSelector` or node affinity to constrain *which* GPU nodes a workload lands on.

The `nvidia.com/*` labels are only one family of labels on a GPU node. Amazon EKS and the AWS cloud controller manager apply labels that describe the instance type, capacity type, provisioning path, Availability Zone, and network position, all of which are also available for targeting. For the full set, see [Target AI/ML workloads to specific nodes with labels](ml-workload-placement.md).

### GPU Feature Discovery (GFD)
<a name="_gpu_feature_discovery_gfd"></a>

GPU Feature Discovery (GFD) is a component of the NVIDIA device plugin project (the `gpu-feature-discovery` deployment) that runs either standalone or as part of the NVIDIA GPU Operator. It depends on [Node Feature Discovery (NFD)](https://github.com/kubernetes-sigs/node-feature-discovery) on the GitHub website, and it writes all of the descriptive `nvidia.com/*` *feature* labels, including the following.


| Label | Description | 
| --- | --- | 
|  `nvidia.com/gpu.product`  | GPU model, for example, `NVIDIA-A100-SXM4-40GB`. With single-strategy MIG, GFD appends the active MIG profile as a `-MIG-<profile>` suffix, for example, `NVIDIA-A100-SXM4-40GB-MIG-1g.5gb`. | 
|  `nvidia.com/gpu.count`  | Number of schedulable GPU devices that the device plugin advertises. With single-strategy MIG this is the number of MIG instances, not the number of physical GPUs. | 
|  `nvidia.com/gpu.memory`  | GPU memory per device, in MiB. | 
|  `nvidia.com/gpu.family`, `nvidia.com/gpu.compute.major`, `nvidia.com/gpu.compute.minor`  | GPU architecture family (such as `ampere`, `hopper`, or `blackwell`) and CUDA compute capability. | 
|  `nvidia.com/mig.capable`  |  `true` if the GPU hardware supports MIG. This reflects hardware capability only, not whether MIG is enabled. | 
|  `nvidia.com/mig.strategy`  | The device plugin MIG strategy in effect, `single` or `mixed`. See [MIG strategies](device-management-nvidia-mig.md#eks-mig-strategies). | 
|  `nvidia.com/gpu.sharing-strategy`  | The GPU sharing strategy, `none`, `time-slicing`, or `mps`. | 
|  `nvidia.com/mig-<profile>.*`  | With mixed-strategy MIG, per-profile labels such as `nvidia.com/mig-1g.10gb.count` and `nvidia.com/mig-1g.10gb.product` for each MIG profile present on the node. | 
|  `nvidia.com/cuda.driver-version. `, `nvidia.com/cuda.runtime-version.`  | Installed NVIDIA driver and CUDA runtime versions. | 

### MIG Manager (NVIDIA GPU Operator only)
<a name="_mig_manager_nvidia_gpu_operator_only"></a>

The MIG Manager is an operand of the NVIDIA GPU Operator. It applies the following labels and is not present unless you install the GPU Operator.


| Label | Description | 
| --- | --- | 
|  `nvidia.com/mig.config`  | The MIG layout that the MIG Manager is *requested* to apply, for example, `all-disabled` or a named profile such as `all-1g.5gb`. You set this label to select or change a layout; the MIG Manager watches for changes and partitions the GPUs to match, rebooting the node when required. | 
|  `nvidia.com/mig.config.state`  | The reconciliation state of the requested layout, such as `success`, `pending`, or `failed`. | 

**Important**  
 `nvidia.com/mig.config` reflects the layout the MIG Manager was last *asked* to apply, not a live readback of the GPU. The MIG Manager reconciles only when this label changes. So, if MIG mode is enabled or partitioned outside the MIG Manager (for example, with `nvidia-smi`), the GPUs can be actively partitioned while the label still reads `all-disabled`. Treat the resources advertised in the node’s `Allocatable` (and `nvidia-smi` on the host) as the source of truth for what is schedulable, and use the `nvidia.com/mig.config` label only to *drive* the MIG Manager.

## Install the NVIDIA DRA driver
<a name="eks-nvidia-dra-driver"></a>

The NVIDIA DRA driver for GPUs manages two types of resources: GPUs and ComputeDomains. It runs two DRA kubelet plugins: `gpu-kubelet-plugin` and `compute-domain-kubelet-plugin`. Each can be enabled or disabled separately during installation. This guide focuses on GPU allocation. For using ComputeDomains, see [Use P6e-GB200 UltraServers with Amazon EKS](ml-eks-nvidia-ultraserver.md).

**EKS Auto Mode includes this driver**  
Skip this section if you use EKS Auto Mode. EKS Auto Mode includes the NVIDIA DRA driver in the node runtime on Kubernetes version 1.36 and later. You do need to create the `DeviceClass` object, as described in [Create the NVIDIA GPU DeviceClass](#eks-nvidia-dra-deviceclass). For more information, see [Using DRA with EKS Auto Mode](device-management.md#dra-auto-mode).

### Prerequisites
<a name="_prerequisites"></a>
+ An Amazon EKS cluster running Kubernetes version 1.34 or later with static capacity provisioned by Karpenter, EKS managed node groups, or self-managed node groups.
+ Nodes with NVIDIA GPU instance types (such as `P` or `G` instances).
+ Nodes with host-level components installed for NVIDIA GPUs. When using the EKS-optimized AL2023 or Bottlerocket NVIDIA AMIs, the host-level NVIDIA driver, CUDA user mode driver, and container toolkit are pre-installed.
+ Helm installed in your command-line environment, see the [Setup Helm instructions](helm.md) for more information.
+  `kubectl` configured to communicate with your cluster, see [Install or update `kubectl`](install-kubectl.md#kubectl-install-update) for more information.

### Procedure
<a name="_procedure"></a>

**Important**  
When using the NVIDIA DRA driver for GPU device management, do not deploy it alongside the NVIDIA device plugin on the same node. Doing so can cause silent oversubscription of the underlying devices to multiple pods on the same node.

**Disable the built-in NVIDIA device plugin on Bottlerocket**  
The EKS-optimized Bottlerocket NVIDIA variants include the NVIDIA device plugin and enable it by default. The DRA driver cannot run alongside the device plugin on the same node. Before you use the DRA driver, disable the built-in device plugin on your Bottlerocket GPU nodes. Set `settings.kubelet-device-plugins.nvidia.enabled` to `false` in the Bottlerocket node user data.  

```toml
[settings.kubelet-device-plugins.nvidia]
enabled = false
```
The `settings.kubelet-device-plugins.nvidia.enabled` setting is available in Bottlerocket version 1.63.0 and later. On earlier versions, the built-in NVIDIA device plugin cannot be disabled. For more information, see [bottlerocket-os/bottlerocket pull request \#4856](https://github.com/bottlerocket-os/bottlerocket/pull/4856) on GitHub.

1. Install the NVIDIA DRA driver directly from the Kubernetes SIG OCI registry. To find available versions, see the [NVIDIA DRA driver releases](https://github.com/kubernetes-sigs/dra-driver-nvidia-gpu/releases) on GitHub.

   ```bash
   helm install dra-driver-nvidia-gpu \
       oci://registry.k8s.io/dra-driver-nvidia/charts/dra-driver-nvidia-gpu \
       --version {{0.4.1}} \
       --create-namespace \
       --namespace nvidia \
       --set resources.computeDomains.enabled=false \
       --set gpuResourcesEnabledOverride=true
   ```

   For advanced configuration options, see the [NVIDIA DRA driver Helm chart values](https://dra-driver-nvidia-gpu.sigs.k8s.io/docs/reference/helm-values/) on the Kubernetes SIG website. To see the values available for a specific chart version, run `helm show values oci://registry.k8s.io/dra-driver-nvidia/charts/dra-driver-nvidia-gpu --version 0.4.1`.

1. (Optional) To use time-slicing through the DRA driver, add the `TimeSlicingSettings` feature gate to the `helm install` command in the previous step. This is an alpha feature that is disabled by default. For more information, see [Use GPU time-slicing with the NVIDIA DRA driver](device-management-nvidia-time-slicing.md#eks-time-slicing-dra).

   ```bash
   --set featureGates.TimeSlicingSettings=true
   ```

1. (Optional) To use dynamic MIG through the DRA driver, add the `DynamicMIG` feature gate to the `helm install` command in the previous step. This is an alpha feature that is disabled by default. You cannot combine the `DynamicMIG` feature gate with the `PassthroughSupport`, `NVMLDeviceHealthCheck`, or `MPSSupport` feature gates. For more information, see [Use MIG with the NVIDIA DRA driver](device-management-nvidia-mig.md#eks-mig-dra-driver).

   ```bash
   --set featureGates.DynamicMIG=true
   ```

1. Verify that the DRA driver pods are running.

   ```bash
   kubectl get pods -n nvidia
   ```

1. Verify that the `DeviceClass` objects were created.

   ```bash
   kubectl get deviceclass
   ```

   ```bash
   NAME            AGE
   gpu.nvidia.com  60s
   ```

1. Verify that `ResourceSlice` objects are published for your GPU nodes.

   ```bash
   kubectl get resourceslice
   ```

   To request NVIDIA GPUs using the DRA driver, create a `ResourceClaimTemplate` that references the `gpu.nvidia.com` `DeviceClass` and reference it in your Pod specification. The following example requests a single GPU. See [Topology-aware EFA and GPU/Neuron device allocation](device-management-efa.md#efa-dra-topology-aware) for steps to allocate NVIDIA GPUs with topology-aligned EFA interfaces.

   ```yaml
   apiVersion: resource.k8s.io/v1
   kind: ResourceClaimTemplate
   metadata:
     name: single-gpu
   spec:
     spec:
       devices:
         requests:
         - name: gpu
           exactly:
             deviceClassName: gpu.nvidia.com
             count: 1
   ---
   apiVersion: v1
   kind: Pod
   metadata:
     name: gpu-workload
   spec:
     containers:
     - name: gpu-demo
       image: public.ecr.aws/amazonlinux/amazonlinux:2023-minimal
       command: ["/bin/sh", "-c"]
       args: ["nvidia-smi && tail -f /dev/null"]
       resources:
         claims:
         - name: gpu
     resourceClaims:
     - name: gpu
       resourceClaimTemplateName: single-gpu
     tolerations:
     - key: "nvidia.com/gpu"
       operator: "Exists"
       effect: "NoSchedule"
   ```

## Create the NVIDIA GPU DeviceClass
<a name="eks-nvidia-dra-deviceclass"></a>

A `DeviceClass` names a category of devices and defines the expression that selects them. Every `ResourceClaim` and `ResourceClaimTemplate` references one by name, so the `gpu.nvidia.com` `DeviceClass` must exist before a GPU claim can be allocated. A claim that references a `DeviceClass` that does not exist is never allocated, and the Pod stays in the `Pending` state.

When you install the NVIDIA DRA driver with Helm, as described in [Install the NVIDIA DRA driver](#eks-nvidia-dra-driver), the chart creates this object for you and there is nothing more to do. EKS Auto Mode runs the driver from the node runtime rather than from a Helm chart, so on EKS Auto Mode you create it yourself.

```bash
cat <<EOF | kubectl apply -f -
apiVersion: resource.k8s.io/v1
kind: DeviceClass
metadata:
  name: gpu.nvidia.com
spec:
  selectors:
  - cel:
      expression: "device.driver == 'gpu.nvidia.com' && device.attributes['gpu.nvidia.com'].type == 'gpu'"
EOF
```

Confirm that it exists.

```bash
kubectl get deviceclass
```

An example output is as follows.

```bash
NAME             AGE
gpu.nvidia.com   5s
```

The name and selector match the `DeviceClass` that the driver’s Helm chart installs, so the same claims work on EKS Auto Mode and on clusters where you manage the driver yourself.

**Requesting GPUs as an extended resource through DRA**  
On Kubernetes version 1.34 and later, the driver’s Helm chart also sets `extendedResourceName: nvidia.com/gpu` on this `DeviceClass`. That field makes DRA satisfy plain `nvidia.com/gpu` extended resource requests, so existing Pods can use DRA without changing their specifications. For more information, see [KEP-5004](https://github.com/kubernetes/enhancements/tree/master/keps/sig-scheduling/5004-dra-extended-resource) on GitHub.  
The preceding definition omits that field, because adding it changes how every GPU Pod in the cluster is treated, not only the Pods you migrate. A Pod that requests `nvidia.com/gpu` becomes a DRA Pod, and on EKS Auto Mode that also determines whether a node becomes a DRA node or a device plugin node. Add `extendedResourceName` only when you intend to move all of your `nvidia.com/gpu` workloads to DRA at once, and review [How EKS Auto Mode keeps DRA and device plugins apart](device-management.md#dra-auto-mode-exclusivity) first.  
Karpenter doesn’t support this field. Karpenter doesn’t treat a plain `nvidia.com/gpu` request as a DRA request, even when the `DeviceClass` sets `extendedResourceName`, so dynamic capacity provisioning doesn’t launch nodes for those Pods as DRA Pods. For more information, see [Using DRA with Karpenter](device-management.md#dra-karpenter).

For more information about DRA on EKS Auto Mode, see [Using DRA with EKS Auto Mode](device-management.md#dra-auto-mode).

## Install the NVIDIA Kubernetes device plugin
<a name="eks-nvidia-device-plugin"></a>

The NVIDIA Kubernetes device plugin advertises NVIDIA GPUs as `nvidia.com/gpu` extended resources. You request GPUs in container resource requests and limits.

### Prerequisites
<a name="_prerequisites_2"></a>
+ An Amazon EKS cluster.
+ Nodes with NVIDIA GPU instance types (such as `P` or `G` instances).
+ Nodes with NVIDIA GPU instance types using the EKS-optimized AL2023 NVIDIA AMI. The EKS-optimized Bottlerocket AMIs include the NVIDIA device plugin. You do not need to install it separately.
+ Nodes with host-level components installed for NVIDIA GPUs. When using the EKS-optimized AL2023 or Bottlerocket NVIDIA AMIs, the host-level NVIDIA driver, CUDA user mode driver, and container toolkit are pre-installed.
+ Helm installed in your command-line environment, see the [Setup Helm instructions](helm.md) for more information.
+  `kubectl` configured to communicate with your cluster, see [Install or update `kubectl`](install-kubectl.md#kubectl-install-update) for more information.

### Procedure
<a name="_procedure_2"></a>

1. Add the NVIDIA device plugin Helm chart repository.

   ```bash
   helm repo add nvdp https://nvidia.github.io/k8s-device-plugin
   ```

1. Update your local Helm repository.

   ```bash
   helm repo update
   ```

1. Install the NVIDIA Kubernetes device plugin.

   ```bash
   helm install nvdp nvdp/nvidia-device-plugin \
       --create-namespace \
       --namespace nvidia
   ```
**Optional: enable GPU Feature Discovery (GFD)**  
The device plugin advertises `nvidia.com/gpu` extended resources and schedules GPU Pods on its own. On the EKS-optimized AL2023 NVIDIA AMI, the `nvidia.com/gpu.present=true` node label is already applied at boot by `nodeadm`, so GPU Feature Discovery (GFD) is not required for basic GPU scheduling.  
Enable GFD with `--set gfd.enabled=true` if you want the node labeled with detailed GPU attributes—such as `nvidia.com/gpu.product`, `nvidia.com/gpu.memory`, `nvidia.com/gpu.count`, MIG profile labels, and driver/CUDA versions. With these labels, you can target specific GPU types with `nodeSelector` or node affinity (for example, scheduling a workload only onto A10G GPUs or onto a particular MIG profile). GPU sharing configurations such as time-slicing and MIG also use these labels. If you don’t need attribute-based node selection or GPU sharing, you can omit the flag.  

   ```bash
   helm install nvdp nvdp/nvidia-device-plugin \
       --create-namespace \
       --namespace nvidia \
       --set gfd.enabled=true
   ```
**Enable GDRCopy if your workloads use it**  
 `k8s-device-plugin` v0.19.0 through v0.19.2 enabled the GDRCopy and MOFED features by default. This default enablement was reverted in `k8s-device-plugin` v0.19.3. As a result of the revert, GDRCopy (`gdrdrv`) can no longer be enabled per-container with the `NVIDIA_GDRCOPY=enabled` environment variable in a Pod spec, that variable is now ignored.  
If your workloads use GDRCopy (GPUDirect RDMA copy), you must enable it on the device plugin at install time by setting `gdrcopyEnabled=true`:  

   ```bash
   helm upgrade --install nvdp nvdp/nvidia-device-plugin \
       --namespace nvidia \
       --create-namespace \
       --set gdrcopyEnabled=true
   ```
(Add `--set gfd.enabled=true` as well if you also want GPU Feature Discovery labels, as described previously.)  
If you manage the NVIDIA device plugin through the [NVIDIA GPU Operator](https://github.com/NVIDIA/gpu-operator) on GitHub, the operator dynamically sets `GDRCOPY_ENABLED=true` when the `gdrdrv` kernel module is loaded on the node.  
For more information, see [NVIDIA k8s-device-plugin issue \#1692](https://github.com/NVIDIA/k8s-device-plugin/issues/1692) on GitHub.
**Note**  
You can also install and manage the NVIDIA Kubernetes device plugin using the [NVIDIA GPU Operator](https://github.com/NVIDIA/gpu-operator) on GitHub, which automates the management of all NVIDIA software components needed to provision GPUs.

1. Verify the NVIDIA device plugin DaemonSet is running.

   ```bash
   kubectl get ds -n nvidia nvdp-nvidia-device-plugin
   ```

   ```bash
   NAME                        DESIRED   CURRENT   READY   UP-TO-DATE   AVAILABLE   NODE SELECTOR   AGE
   nvdp-nvidia-device-plugin   2         2         2       2            2           <none>          60s
   ```

1. Verify that your nodes have allocatable GPUs.

   ```bash
   kubectl get nodes "-o=custom-columns=NAME:.metadata.name,GPU:.status.allocatable.nvidia\.com/gpu"
   ```

   An example output is as follows.

   ```bash
   NAME                                           GPU
   ip-192-168-11-225.us-west-2.compute.internal   1
   ip-192-168-24-96.us-west-2.compute.internal    1
   ```

### Request NVIDIA GPUs in a Pod
<a name="_request_nvidia_gpus_in_a_pod"></a>

To request NVIDIA GPUs using the device plugin, specify the `nvidia.com/gpu` resource in your container resource requests and limits.

```yaml
apiVersion: v1
kind: Pod
metadata:
  name: nvidia-smi
spec:
  restartPolicy: OnFailure
  containers:
  - name: gpu-demo
    image: public.ecr.aws/amazonlinux/amazonlinux:2023-minimal
    command: ["/bin/sh", "-c"]
    args: ["nvidia-smi && tail -f /dev/null"]
    resources:
      limits:
        nvidia.com/gpu: 1
      requests:
        nvidia.com/gpu: 1
  tolerations:
  - key: "nvidia.com/gpu"
    operator: "Equal"
    value: "true"
    effect: "NoSchedule"
```

To run this test, apply the manifest and view the logs:

```bash
kubectl apply -f nvidia-smi.yaml
kubectl logs nvidia-smi
```

An example output is as follows.

```bash
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI XXX.XXX.XX            Driver Version: XXX.XXX.XX     CUDA Version: XX.X      |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA L4                      On  |   00000000:31:00.0 Off |                    0 |
| N/A   27C    P8             11W /   72W |       0MiB /  23034MiB |      0%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+

+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI              PID   Type   Process name                        GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|  No running processes found                                                             |
+-----------------------------------------------------------------------------------------+
```