Skip to content

Configure CDI annotation prefixes in toolkit container when CDI is enabled - #3088

Merged
cdesiniotis merged 1 commit into
NVIDIA:mainfrom
cdesiniotis:add-cdi-annotation-prefix-to-toolkit-ctr
Oct 23, 2026
Merged

cdesiniotis merged 1 commit into
NVIDIA:mainfrom
cdesiniotis:add-cdi-annotation-prefix-to-toolkit-ctr

Conversation

@cdesiniotis

@cdesiniotis cdesiniotis commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

Description

This aligns the transformToolkitCtrForCDI() method with the transformDevicePluginCtrForCDI() to ensure the same prefixes are configured with both components.

Without explicitly configuring the CDI annotation prefixes in the toolkit container, the nvidia-ctk-installer was NOT adding these annotation prefixes to containerd's (or crio's) container_annotations allowlist. As a consequence, any container annotations set by the k8s-device-plugin, in its AllocateResponse, were not making it into the OCI runtime spec for the container.

Checklist

  • No secrets, sensitive information, or unrelated changes
  • Lint checks passing (make lint)
  • Generated assets in-sync (make validate-generated-assets)
  • Go mod artifacts in-sync (make validate-modules)
  • Test cases are added for new code paths

Testing

Ran a sanity test on both k8s + containerd and OpenShift. I verified that #3077 is no longer an issue with this change. This is because the container annotation added by the k8s-device-plugin actually makes its way to the nvidia runtime. The problematic volume mount is never processed and the container runs as expected with access to one GPU. As a follow-up, NVIDIA/nvidia-container-toolkit#2146 aims to provide a more robust solution to handle scenarios where CDI is used AND the volume-mounts strategy is configured with the toolkit / plugin.


Devin Review

@tariq1890 tariq1890 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thanks @cdesiniotis !

…abled

This aligns the transformToolkitCtrForCDI() method with the
transformDevicePluginCtrForCDI() to ensure the same prefixes are
configured with both components.

Without explicitly configuring the CDI annotation prefixes in the
toolkit container, the nvidia-ctk-installer was NOT adding these
annotation prefixes to containerd's (or crio's) container_annotations
allowlist. As a consequence, any container annotations set by the
k8s-device-plugin, in its AllocateResponse, were not making it
into the OCI runtime spec for the container.

Signed-off-by: Christopher Desiniotis <cdesiniotis@nvidia.com>
@cdesiniotis
cdesiniotis force-pushed the add-cdi-annotation-prefix-to-toolkit-ctr branch from bd2191e to e616961 Compare October 21, 2026 22:12

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@cdesiniotis
cdesiniotis marked this pull request as ready for review October 21, 2026 22:13
@cdesiniotis
cdesiniotis requested a review from a team as a code owner October 21, 2026 22:13
@coderabbitai

coderabbitai Bot commented Oct 21, 2026

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Repository: NVIDIA/gpu-operator/.coderabbit.yaml
  • Review profile: QUIET
  • Plan: Enterprise
  • Run ID: bf67e763-3159-4be8-977b-1423aa1bacfb
📥 Commits

Reviewing files that changed from the base of the PR and between 02ee32a and e616961.

📒 Files selected for processing: 2
  • controllers/object_controls.go
  • controllers/transforms_test.go

Included review availability: This review used your included allowance. Your plan provides up to 12 included reviews per hour; 11 remain after this review.

📝 Walkthrough

The toolkit transformation now sets NVIDIA_CONTAINER_RUNTIME_MODES_CDI_ANNOTATION_PREFIXES to cdi.k8s.io/ for CDI configuration. Tests expect this value for containerd and CRI-O configurations, including NRI-enabled cases.

Priority: ⬇️ Low

Merge Risk: ⚪ Minimal · up to e6169

The change is consistent with its stated purpose and introduces no actionable merge-blocking risk.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@cdesiniotis

Copy link
Copy Markdown
Contributor Author

/cherry-pick release-26.7

@cdesiniotis
cdesiniotis merged commit f05f4f7 into NVIDIA:main Oct 23, 2026
21 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🤖 Backport PR created for release-26.7: #3118 ✅

@rahulait rahulait added this to the v26.7.3 milestone Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants