k8s-device-plugin
AGENTS.md3.9k starsChanged 3 months agoApache-2.0View on GitHub
Guidance for AI coding agents working in this repository. Human contributors should also read CONTRIBUTING.md. The NVIDIA device plugin for Kubernetes is a DaemonSet that advertises NVIDIA GPUs to the kubelet through the Kubernetes device plugin framework, so that the kubelet can allocate those GPUs to containers. It also tracks GPU health. As of v0.15.0 this repository additionally holds the implementation of GPU Feature Discovery (GFD), which labels nodes with GPU properties. The repository builds four binaries, each with its…
Trending
Quiet since July.about the whole repository
Who's talking about NVIDIA/k8s-device-plugin
- kubernetes-sigs/karpenter“karpenter doesn't scaleout when using time-slicing for GPUs”GitHub · Feb 9, 2023 · 102 reactions
- NVIDIA/nvidia-container-toolkit“Automatically provisioning X11 and Wayland devices of GPU inside container?”GitHub · Nov 28, 2020 · 9 reactions
- kubernetes/kubernetes“kubernetes GPU device plugin for Ubuntu and Debian images”GitHub · Oct 16, 2017 · 8 reactions
- volcano-sh/volcano“[LFX 2026 Term 3] Support Generic xPU Topology-Aware Scheduling”GitHub · Jul 27, 2026 · 7 reactions
- kubernetes/kubernetes“Suggest to make kubelet retry UnexpectedAdmissionError with an exponential delay”GitHub · Oct 19, 2018 · 7 reactions
The biggest 5 of 16 mentions linking to the repository that our crawl found. Each line is their own headline.
See all 16
Talked about on GitHub and Bluesky (16 times).
On GitHub · 14
- Feb 9, 2023karpenter doesn't scaleout when using time-slicing for GPUs — kubernetes-sigs/karpenter102 reactions · 26 comments
- Nov 28, 2020Automatically provisioning X11 and Wayland devices of GPU inside container? — NVIDIA/nvidia-container-toolkit9 reactions · 39 comments
- Oct 16, 2017kubernetes GPU device plugin for Ubuntu and Debian images — kubernetes/kubernetes8 reactions · 61 comments
- Jul 27, 2026[LFX 2026 Term 3] Support Generic xPU Topology-Aware Scheduling — volcano-sh/volcano7 reactions · 11 comments
- Oct 19, 2018Suggest to make kubelet retry UnexpectedAdmissionError with an exponential delay — kubernetes/kubernetes7 reactions · 26 comments
9 more on GitHub
- Apr 2, 2024libnvidia-ml library not found in GPU AMIs — awslabs/amazon-eks-ami6 reactions · 10 comments
- Aug 26, 2023Latest NVIDIA Container Runtime Support not working anymore with K3S — k3s-io/k3s6 reactions · 11 comments
- Feb 26, 2023container-runtime: add nvidia-docker — kubernetes/minikube5 reactions · 27 comments
- Apr 3, 2024Containerd nondeterministic misconfiguration on a GPU nodes — aws/karpenter-provider-aws4 reactions · 3 comments
- Jul 24, 2026feat(apps): deploy NVIDIA k8s-device-plugin to Hetzner GPU nodes via ArgoCD — ADORSYS-GIS/ai-helm2 reactions
- Jul 1, 2026pr commit rules — Project-HAMi/HAMi2 reactions · 5 comments
- Oct 29, 2025NVIDIA device plugin 0.15.0 and newer don't run on Talos nodes by default — siderolabs/talos2 reactions · 1 comment
- May 8, 2024DCGM exporter doesn't work on the latest version of Bottlerocket AMI — aws-observability/helm-charts2 reactions · 12 comments
- Jun 29, 2023Partitioner renders malformed device-plugin ConfigMap value which breaks GFD, causing Pods to be Pending forever — nebuly-ai/nos2 reactions
On Bluesky · 2
- Nov 22, 2025i ended up going for a slightly less headache inducing method by using the device plugin instead of the operator but I'm not working with… — @espkitty.bsky.social2 likes and reposts · 1 reply
- Dec 15, 2024The NVIDIA device plugin for Kubernetes is a Daemonset that allows you to automatically: - Expose the number of GPUs on each node of your… — @kube.builders2 likes and reposts
Where files are headingNew AGENTS.md files have more rules about keeping secrets out of the code, and fewer about checking a change actually works.
Of the AGENTS.md files we read, the 11,773 first seen in the last six months, against the older ones: the kind of rule that gained most share, and the kind that lost most. About files like this in general, not this one, and an estimate, since a kind is a pattern in the words.
The file
Show its rules and text
We split this AGENTS.md into the rules it gives an agent
15 rules. About 1 is common, 5 are distinctive, and 9 are very specific to this project.
≈1
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- could be automatic: a setting could enforce it
- Distinctive: line 47
All standard tasks go through the Makefile.
- Very specific: line 69
Always run make fmt, make check, and make test before considering Go changes complete.
- Very specific: line 71
After changing a dependency, run make check-modules and make check-third-party-notices, then commit the regenerated vendor/ tree and …
- Very specific: line 73
After changing an interface that carries a //go:generate moq directive, run make generate and commit the regenerated mock.
- Very specific: line 78
Write idiomatic Go and follow the existing patterns in internal/ for logging, error wrapping, and NVML access rather than introducing new …
- Distinctive: line 81
Keep changes scoped to the task.
- Very specific: line 83
Every .go file should start with the Apache-2.0 boilerplate header.
- Distinctive: line 98
When fixing a bug, add a regression test that fails without the fix.
- Very specific: line 106
All commits must be signed off for DCO using git commit -s, which appends a Signed-off-by: Name <email> line.
- Distinctive: line 109
Do not open, push to, or comment on GitHub issues or pull requests without explicit user confirmation.
- Very specific: line 111
Keep pull request titles short and imperative.
- Common: line 117
Never commit credentials, API keys, tokens, passwords, kubeconfigs, or private keys.
- Distinctive: line 118
Never hand-edit a generated file.
- Very specific: line 119
Never commit built binaries, coverage.out, or anything that .gitignore already excludes.
- Very specific: line 121
Never modify GOVERNANCE.md or CODE_OF_CONDUCT.md unless the task is explicitly about those files.
≈ “Common” is an estimate: at least 1 in 5 of the 16,595 AGENTS.md files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
AGENTS.md
Guidance for AI coding agents working in this repository. Human contributors should also read CONTRIBUTING.md.
Project Summary
The NVIDIA device plugin for Kubernetes is a DaemonSet that advertises NVIDIA GPUs to the kubelet through the Kubernetes device plugin framework, so that the kubelet can allocate those GPUs to containers. It also tracks GPU health. As of v0.15.0 this repository additionally holds the implementation of GPU Feature Discovery (GFD), which labels nodes with GPU properties.
The repository builds four binaries, each with its own entrypoint under cmd/:
nvidia-device-pluginis the device plugin itself.gpu-feature-discoveryis the GFD node labeler, which can be deployed alongside the plugin or on its own.mps-control-daemonis the control daemon for CUDA MPS-based GPU sharing.config-managerapplies the per-node configuration selected by a node label.
The Go module is github.com/NVIDIA/k8s-device-plugin and the configuration API types live in
api/config/v1.
Repository layout
api/config/v1/holds the plugin configuration API types, covering sharing, MIG, IMEX, and flags.cmd/holds one directory per binary, as listed under Project Summary.internal/holds the supporting packages. The most important areinternal/rm(resource managers for full GPUs and MIG devices),internal/plugin(the device plugin server),internal/lm(label management for GFD),internal/cdi(Container Device Interface spec generation),internal/vgpu(vGPU detection), andinternal/resource(device discovery through NVML, sysfs, and CUDA).deployments/helm/holds the Helm chart for the plugin and GFD.deployments/container/holds the Dockerfile for the plugin image.deployments/devel/holds the pinned development toolchain used bymake.docs/holds additional documentation, includingdocs/cdi.mdanddocs/gpu-feature-discovery/.tests/holds the end-to-end and Helm test suites and is a separate Go module.testdata/holds fixtures used by the end-to-end tests.hack/holds the development and release scripts for the changelog, third-party notices, and release preparation.demo/holds scripts that build and run a kind-based demo cluster.
Build, test, and lint
All standard tasks go through the Makefile. Prefer make targets over invoking tools directly so that CI and local runs stay consistent.
make buildcompiles every package in the module, andmake cmdsbuilds each binary undercmd/.make testruns the unit tests overcmd/...,internal/..., andapi/...with coverage.make checkruns the full check suite, which at present contains onlymake lint.make lintrunsgolangci-lint run ./...using the configuration in.golangci.yml.make fmtappliesgofmt -sto the codebase and writes the files in place.make goimportsrunsgoimports -local github.com/NVIDIA/k8s-device-pluginand writes the files in place.make generaterunsgo generate ./..., which regenerates themoqmocks.make check-modulestidies, verifies, and vendors every module, then fails ifgo.mod,go.sum, orvendor/turn out to be stale. CI runs the same check.make third-party-noticesregeneratesTHIRD_PARTY_NOTICES.mdandmake check-third-party-noticesfails if that file is out of date. CI runs the same check.make coverageruns the unit tests and then prints a per-function coverage report that excludes mocks.make test-e2eruns a Ginkgo suite that requires a live Kubernetes cluster with real GPUs. Do not report it as passing when it was not run.make test-helmrenders the Helm chart templates and asserts on the result. It needs no cluster.
Always run make fmt, make check, and make test before considering Go changes complete.
After changing a dependency, run make check-modules and make check-third-party-notices, then
commit the regenerated vendor/ tree and THIRD_PARTY_NOTICES.md alongside the source change.
After changing an interface that carries a //go:generate moq directive, run make generate and
commit the regenerated mock.
Coding Conventions
- Write idiomatic Go and follow the existing patterns in
internal/for logging, error wrapping, and NVML access rather than introducing new libraries. - Comments explain why, not what. Identifier names should carry the what.
- Keep changes scoped to the task. Avoid drive-by refactors, speculative abstractions, and unrelated formatting churn, and keep each pull request to one concern.
- Every
.gofile should start with the Apache-2.0 boilerplate header. Match the header in neighboring files exactly rather than inventing a variant. - The
vendor/directory is checked in. Rungo mod tidyandgo mod vendorafter any dependency change and never hand-edit vendored code. - The
*_mock.gofiles are generated bymoqfrom//go:generatedirectives, so regenerate them withmake generaterather than editing them by hand.
Testing Conventions
- Unit tests live in co-located
*_test.gofiles and usetestifythroughrequireandassert. Most of them group cases as subtests witht.Run. Run them withmake test. Add tests that cover new behavior. - The end-to-end tests under
tests/e2euse Ginkgo and Gomega and live in a separate Go module. They need a real cluster with GPUs, so treat them as unavailable unless that environment is present. The Helm tests undertests/helmare plain Go tests and need no cluster. - When fixing a bug, add a regression test that fails without the fix.
Contribution process (see CONTRIBUTING.md)
- Any significant change needs an issue describing the problem or proposal before implementation begins. This covers architectural changes, new features, breaking changes to API or behavior, and non-trivial bug fixes. Check for a linked issue, or ask for one, rather than assuming a pull request on its own is sufficient.
- All commits must be signed off for DCO using
git commit -s, which appends aSigned-off-by: Name <email>line. DCO is a required status check. Never fabricate a sign-off identity. Use the configured git user's identity. - Do not open, push to, or comment on GitHub issues or pull requests without explicit user confirmation.
- Keep pull request titles short and imperative. Fill in the sections in .github/PULL_REQUEST_TEMPLATE.md and explain the motivation rather than restating the diff.
Things to avoid
- Never commit credentials, API keys, tokens, passwords, kubeconfigs, or private keys.
- Never hand-edit a generated file. Regenerate it instead, as described under Coding Conventions.
- Never commit built binaries,
coverage.out, or anything that .gitignore already excludes. - Never modify GOVERNANCE.md or CODE_OF_CONDUCT.md unless the task is explicitly about those files.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

