Skip to content

Planning and validating NVIDIA device plugin upgrades on Amazon EKS

8 minute read
Content level: Intermediate
0

This article shows you how to safely upgrade the NVIDIA device plugin on Amazon Elastic Kubernetes Service (Amazon EKS) graphics processing unit (GPU) node groups that run the Kubernetes static CPU management policy.

Introduction

To manage GPU resources on Amazon EKS, the kubelet and the NVIDIA device plugin must coordinate closely. The plugin allocates GPUs to containers. Static CPU management policies pin CPUs to Guaranteed Quality of Service (QoS) pods, and plugin upgrades can silently break that interaction on static-policy clusters.

Newer plugin versions respond differently to kubelet allocation requests. This difference exposes CPU-manager incompatibilities in certain version and configuration combinations. A change that looks healthy in staging without the static policy can break GPU access in production.

Solution overview

Understanding the failure mode

Before you plan an upgrade, understand the failure this guide prevents.

In one example use case, a global enterprise customer worked with their AWS Technical Account Manager (TAM) to upgrade their plugin from 0.12.x to 0.17.4, only on cpu-manager-policy=static nodes. That customer’s AI/ML training pods lost GPU access after the upgrade. For more information, see CPU Management Policies on the Kubernetes website. Each node gets its NVIDIA Container Toolkit version from its EKS optimized GPU Amazon Machine Image (AMI) release.

Symptoms and error signatures

After the customer reported the issue, their AWS TAM team tested GPU behavior across toolkit versions, and discovered the following consistent pattern:

  • The GPU allocation succeeded during the initial pod scheduling but failed on subsequent GetPreferredAllocation remote procedure calls (RPC).

  • The NVIDIA Management Library (NVML) couldn’t initialize inside containers, even though the NVIDIA driver functioned correctly on the host.

  • The failures occurred only on nodes that ran with cpu-manager-policy=static.

The training pods that lost access produced the following error signature:

“Failed to initialize NVML: Unknown Error

Warning UnexpectedAdmissionError 28m kubeletAllocate failed due to device plugin GetPreferredAllocation rpc failed with err: rpc error: code = Unknown desc = error getting list of preferred allocation devices: unable to get device link information: error calling nvml.Init: Unknown Error, which is unexpected”

Important: It’s a best practice to set up an alert for this error during and after an upgrade.

Restarting affected pods temporarily restored GPU access, but failures recurred, which prevents long-running training jobs.

Using the structured investigation approach

When you qualify a plugin upgrade, use the following approach that the AWS TAM team used:

  • Controlled reproduction: Recreate the conditions in an isolated EKS cluster to confirm the trigger, instead of guessing in production.

  • Version matrix testing: Systematically test the plugin and toolkit version combinations that you want to run, with and without the CPU manager activated.

  • Fix validation: Confirm the specific configuration change or version target that eliminates the failure before you roll it out.

This investigative approach traced the failure to the following privilege gap related to the compatWithCPUManager flag.

Understanding the gap

If the kubelet runs a static CPU management policy, then you must activate the compatWithCPUManager flag for NVIDIA Container Toolkit 1.17.8. The compatWithCPUManager flag is deactivated by default, and NVIDIA Container Toolkit 1.17.8 comes bundled with some GPU-based EKS AMIs.

If you deactivate the compatWithCPUManager flag, then the plugin doesn’t have the privileges to query GPU topology during GetPreferredAllocation Remote Procedure Call (RPC). The CPU manager uses RPCs to trigger the placement of pinned CPUs. If the flag remains deactivated, then the plugin can’t respond. NVML doesn’t initialize, and the failure appears only on static-policy nodes.

For more information on this privilege gap, see the following community threads:

Solution implementation

To prevent this issue before production, treat a plugin upgrade as a planned change. Apply the following best practices before you upgrade a cpu-manager-policy=static cluster:

  • Inventory versions.

  • Validate the upgrade in a controlled environment.

  • Monitor the upgrade.

Then, resolve the error.

Pre-flight version inventory

Perform the following checks before you begin the update:

  • Record the plugin version currently deployed and the version you plan to upgrade to.

  • Map each node group's AMI release to the version of its toolkit. The toolkit comes baked into the EKS optimized GPU AMI. For more information on the toolkit version that ships with your AMI release, see Amazon EKS optimized AMI release notes on the GitHub website.

  • Confirm the node groups that run cpu-manager-policy=static.

Validating compatibility in a controlled environment

Before you begin the update, reproduce your intended configuration in an isolated cluster. Stand up a test EKS cluster with GPU-backed node groups and cpu-manager-policy=static.

Note: If the static policy isn’t present, then the failure won’t surface.

Then, to run a version-matrix test rather than a single combination, complete the following steps:

  1. Deploy a representative GPU workload against each plugin and toolkit version combination you plan to run.

  2. To test each flag’s effect, exercise each combination both with and without compatWithCPUManager=true.

  3. Confirm that the GPU access holds across repeated pod scheduling cycles, not just first admission.

Ongoing monitoring and early detection

Monitor for the following GPU access errors on static-policy nodes:

  • Set up alerts on the following error signatures in pod events and kubelet logs
    “Failed to initialize NVML: Unknown Error”
    “GetPreferredAllocation rpc failed”

  • On GPU pods, watch for “UnexpectedAdmissionError” events. “UnexpectedAdmissionError” events show that the plugin can’t satisfy an allocation request.

  • Track GPU workload restart rates on static-policy node groups. Increasing GPU workload restart rates show intermittent GPU access loss.

  • Run a periodic canary GPU pod that initializes NVML. Monitoring catches regressions before a training job fails.

Use your results to test the plugin and toolkit version combinations that apply to your environment, with and without the static CPU policy.

Resolving the error

Complete one of the following two resolutions, based on your requirements.

Note: Option 1 avoids a node group rollout, but it adds a configuration value you must carry forward. Option 2 requires a node group rollout up front, but it leaves no lingering dependency.

Option 1: Activate compatWithCPUManager

For clusters that run NVIDIA Container Toolkit 1.17.8 with plugin 0.17.x, change the compatWithCPUManager setting to true to activate the compatibility flag in your device plugin configuration. The compatibility flag grants the plugin the privileges it needs and resolves the issue.

If any of the following conditions are true, then it’s a best practice to choose this resolution option:

  • You must quickly resolve the issue a single time.

  • You can’t immediately re-image node groups.

  • You can’t yet leave your current AMI release.

Option 2: Update to an EKS optimized AMI with toolkit version 1.18.0+

If you can’t manage toolkit versions independently, then update your GPU node groups to an EKS optimized AMI release with NVIDIA Container Toolkit 1.18.0 or later. Plugin versions 0.18.0 and later with toolkit 1.18.0 don’t need the flag, because the newer toolkit resolves the privilege gap internally.

If any of the following conditions are true, then it’s a best practice to choose this resolution option:

  • You need a durable long-term fix.

  • You can’t carry a plugin-level flag

  • You regularly refresh AMIs.

Option 3: Combined approach

First, apply Option 1 to restore service immediately. Then apply Option 2 on your normal AMI refresh cadence to retire the flag.

Conclusion

If you plan ahead, then you can prevent GPU access failures related to the interaction between the NVIDIA device plugin and the static CPU management policy. When you plan your upgrade, check whether your plugin and NVIDIA Container Toolkit versions are compatible, rather than discovering problems in production. Before you upgrade cpu-manager-policy=static clusters, inventory your versions, confirm your version in a controlled environment, and monitor your upgrade.

To get the most out of your AWS environment, contact AWS Cloud Support Engineers and TAMs for guidance, best practices, and troubleshooting. For plans and offerings, see AWS Support.

Related information

How to Resolve NVML Library Loading Errors When Installing NVIDIA Device Plugin on Amazon EKS

About the authors

Kuntal Shah

Kuntal Shah is a Senior Technical Account Manager at AWS, specializing in containers and Amazon EKS. He works closely with strategic enterprise customers to architect, scale, and operate containerized workloads, including driving operational excellence, optimizing cloud-native architectures, and accelerating their container modernization journeys. He’s passionate about helping customers use the full capabilities of Kubernetes and AWS container products and services.

Sid Sharma

Sid Sharma is a Senior TAM at AWS who specializes in High Performance Computing (HPC) for the HPC training program team. He helps enterprise customers optimize machine learning training pipelines and maximize GPU cluster performance. With expertise in ML and distributed systems, Sid advises organizations that are scaling their AI workloads and implementing best practices for large-scale machine learning infrastructure.

AWS OFFICIALUpdated a month ago303 views