feat(kubernetes): default gpu-operator to an OS-provided driver on Talos - #3585
feat(kubernetes): default gpu-operator to an OS-provided driver on Talos#3585mattia-eleuteri wants to merge 2 commits into
Conversation
Closes the gpu-operator half of cozystack#3563. Tenant clusters have run Talos workers since 1.6.0, where the NVIDIA driver comes from a system extension baked into the worker image rather than from the operator's driver container. The addon default still described the Ubuntu shape, so a GPU node group came up with the operator fighting the OS for the driver and no path at all for CUDA libraries to reach a tenant pod. Three things change, each fixing one silent failure: driver.enabled and toolkit.enabled go false. The driver container would load its own module and clash with the extension's; the toolkit container would rewrite /etc/containerd/config.toml, which Talos owns and which already registers the nvidia runtime with enable_cdi = true and cdi_spec_dirs = ['/run/cdi']. validator.driver.env points DRIVER_ROOT and NVIDIA_DRIVER_ROOT at / and disables /dev/char symlink creation. The driver validator otherwise looks for a driver container install, finds none, never writes its sentinel, and leaves the device plugin blocked behind toolkit-validation — the loop on "Attempting to validate a driver container installation". devicePlugin.env selects cdi-annotations and points NVIDIA_CTK_PATH at the host's nvidia-ctk. Tenant pods carry no runtimeClassName and did not need one on Ubuntu, where the toolkit made nvidia the default containerd runtime; Talos does not, so CDI is the only route for the CUDA libraries. The previous default fed NVreg_NvLinkDisable=1 to the driver container through the nvidia-kernel-module-params ConfigMap. With that container off the ConfigMap is mounted by nothing, so the default is removed and the parameter travels through the worker machine config instead. The wrapper chart keeps the ConfigMap feature for an operator who re-enables the driver container, with its comment corrected to say nothing uses it by default any more. Every value here is the configuration validated on a production Talos GPU node group, minus the parts that only mattered while the driver container was in play. Not covered: HAMi. When addons.hami.enabled the operator's device plugin stays off and HAMi serves the GPUs, and HAMi's own plugin needs equivalent CDI wiring on Talos that this default does not attempt. Refs: cozystack#3563 Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughGPU Operator defaults now use Talos host-installed NVIDIA drivers instead of operator-managed driver containers. Validator and CDI settings were updated, HAMi integration was preserved, and tests cover disabled resources and environment override behavior. ChangesTalos GPU Operator integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
End-to-end run done, on hardware, and it holds. Reporting it as promised rather than leaving the claim on unit tests alone. Setup: a fresh single-node tenant cluster, one node group with an L40S (
The last row matters because a Talos node whose extension services cannot start reboots at roughly 70 minutes of uptime while still reporting The L40S is the point: everything behind this configuration was previously only exercised on Blackwell (GB202). It works unchanged on Ada, so the set is not GPU-generation-specific. What this run does not establish, stated plainly:
Taking this out of draft on the strength of the above. |
There was a problem hiding this comment.
Actionable comments posted: 1
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
packages/system/gpu-operator/values.yaml (1)
37-48: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick winRemove the stale
NVreg_NvLinkDisable=1default.Lines 37-43 state that this parameter is no longer a default. However, Lines 47-48 still supply it when an operator sets
driver.enabled: trueandkernelModuleConfig.create: true.Leave
contentempty by default. Require an operator to set the parameter explicitly when it is required.Proposed fix
name: nvidia-kernel-module-params - content: | - NVreg_NvLinkDisable=1 + content: ""🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@packages/system/gpu-operator/values.yaml` around lines 37 - 48, Update the kernelModuleConfig default in values.yaml so its content is empty instead of supplying NVreg_NvLinkDisable=1. Preserve the existing create and name settings, requiring operators to explicitly provide the parameter when enabling this configuration.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@packages/apps/kubernetes/tests/gpu_operator_hami_test.yaml`:
- Around line 46-66: Add contains assertions in the gpu-operator test for
NVIDIA_DRIVER_ROOT, DEVICE_ID_STRATEGY set to uuid, and CDI_ANNOTATION_PREFIX
set to cdi.k8s.io/. Place them alongside the existing validator.driver and
devicePlugin environment assertions, preserving the exact expected paths and
values.
---
Outside diff comments:
In `@packages/system/gpu-operator/values.yaml`:
- Around line 37-48: Update the kernelModuleConfig default in values.yaml so its
content is empty instead of supplying NVreg_NvLinkDisable=1. Preserve the
existing create and name settings, requiring operators to explicitly provide the
parameter when enabling this configuration.
🪄 Autofix
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: 9efeb3d5-ea76-4de7-b09e-3bc34d570290
📒 Files selected for processing (3)
packages/apps/kubernetes/templates/helmreleases/gpu-operator.yamlpackages/apps/kubernetes/tests/gpu_operator_hami_test.yamlpackages/system/gpu-operator/values.yaml
Review feedback on the addon default: the suite checked DEVICE_LIST_STRATEGY and NVIDIA_CTK_PATH but not NVIDIA_DRIVER_ROOT, DEVICE_ID_STRATEGY or CDI_ANNOTATION_PREFIX, so a regression in any of those three could break CDI device resolution while the assertions still passed. CDI device names key on the UUID strategy, the plugin resolves the driver from NVIDIA_DRIVER_ROOT, and the annotation prefix has to be the one containerd reads. Pin all of them, plus the validator's own NVIDIA_DRIVER_ROOT alongside DRIVER_ROOT. Assisted-By: Claude <noreply@anthropic.com> Signed-off-by: Mattia Eleuteri <mattia@hidora.io>
|
Two findings from the review: one taken, one I disagree with. Taken — the missing assertions. 48007bd pins Not taken — emptying That content is only read when an operator sets both There is also no contradiction to resolve. "No variant enables it any more" and "the content is right when it is enabled" are both true at once: The comment above it was updated in this PR to say precisely that nothing enables it by default and that it is kept for an operator who re-enables the driver container, who then also has to set |
What this PR does
Closes the gpu-operator half of #3563 — gap 3 (the operator cannot validate a driver it did not install) and gap 4 (nothing routes CUDA libraries to a tenant pod).
Tenant clusters have run Talos workers since 1.6.0, where the NVIDIA driver comes from a system extension baked into the worker image rather than from the operator's driver container. The addon default still described the Ubuntu shape, so a GPU node group came up with the operator fighting the OS for the driver and no path at all for the CUDA libraries.
Three changes, each closing one silent failure:
driver.enabled: false,toolkit.enabled: false/etc/containerd/config.toml, which Talos owns and which already registers thenvidiaruntime withenable_cdi = trueandcdi_spec_dirs = ['/run/cdi']validator.driver.env:DRIVER_ROOT=/,NVIDIA_DRIVER_ROOT=/,DISABLE_DEV_CHAR_SYMLINK_CREATION=truetoolkit-validation— the loop onAttempting to validate a driver container installation(gap 3)devicePlugin.env:DEVICE_LIST_STRATEGY=cdi-annotations,NVIDIA_CTK_PATH=/usr/local/bin/nvidia-ctk, plusDEVICE_ID_STRATEGY,NVIDIA_DRIVER_ROOT,CDI_ANNOTATION_PREFIXruntimeClassNameand did not need one on Ubuntu, where the toolkit madenvidiathe default containerd runtime. Talos does not, so CDI is the only route: the pod gets the device and no CUDA libraries (gap 4)Every value is the configuration validated on a production Talos GPU node group, minus the parts that only mattered while the driver container was in play. No DaemonSet, no new image, no new package — the fix is values.
The removed default
The previous default fed
NVreg_NvLinkDisable=1to the driver container through thenvidia-kernel-module-paramsConfigMap. With that container off the ConfigMap is mounted by nothing, so this removes the default and the parameter travels through the worker machine config instead, asnodeGroups.<name>.kernelModules(#3571). The wrapper chart keeps the ConfigMap feature for an operator who re-enables the driver container throughvaluesOverride, with its comment corrected to say nothing uses it by default any more. A test pins the absence so the dead default cannot come back and offer a second, inert source for the same setting.Relationship to #3571
Independent files, no conflict, but only useful together: this makes
driver.enabled: falsecorrect, and #3571 is what actually loads the modules the extension ships. Merged alone, this changes a GPU node group from "operator fights the OS" to "operator stays out of the way and the modules still are not loaded" — better, but not yet working. #3571 alone leaves the operator fighting for the driver. Either order is safe; both are needed for a GPU node group to work.What is verified, and what is not
Verified here: the rendered HelmRelease values, that
valuesOverridestill wins over each new key, and that the removed default is gone. The individual values are the ones running in production today, applied by hand throughaddons.gpuOperator.valuesOverride.Not verified here: this exact default exercised end-to-end as the chart's own output. That needs a Talos GPU node group whose modules load, which needs #3571 released. I would rather say so than imply a green e2e that does not exist — happy to hold this as draft until I have run a single-node L40S cluster against the chart default, and I will report the result on this PR either way.
Not covered
HAMi. When
addons.hami.enabledthe operator's device plugin stays off and HAMi serves the GPUs; HAMi's own plugin needs equivalent CDI wiring on Talos, which this default does not attempt. Flagging rather than guessing — the production cluster this was derived from runs HAMi disabled, so I have no validated configuration for that path. Worth its own issue if a maintainer confirms the shape.Also not in scope, and unchanged from the merge base:
talos.installerRepositoryandtalos.versionreach the worker machine config unvalidated (being tracked separately by Aleksei Sviridkin (@lexfrei)), and thenvidia-operator-validatorchain for the management cluster's own passthrough/vgpu variants, which never load the host driver at all.Screenshots
No UI changes.
Screenshots
Downstream repositories
Release note
Summary by CodeRabbit
New Features
Bug Fixes
Documentation