Skip to content

Update daemonset for when CONFIG_MEMORY_HOTPLUG is not Present#2517

Open
JunAr7112 wants to merge 1 commit into
NVIDIA:mainfrom
JunAr7112:config_host
Open

Update daemonset for when CONFIG_MEMORY_HOTPLUG is not Present#2517
JunAr7112 wants to merge 1 commit into
NVIDIA:mainfrom
JunAr7112:config_host

Conversation

@JunAr7112
Copy link
Copy Markdown
Contributor

@JunAr7112 JunAr7112 commented Jun 4, 2026

Description

This PR is created in response to this bug, essentially the driver DaemonSet can fail before the container starts because it always mounts /sys/devices/system/memory/auto_online_blocks, but that sysfs file only exists when the node kernel has CONFIG_MEMORY_HOTPLUG=y; kubelet then tries to create it under sysfs and gets operation not permitted. The MR changes will first discover whether GPU nodes have CONFIG_MEMORY_HOTPLUG, carry that boolean into driver rendering, and only mount /sys/devices/system/memory/auto_online_blocks when it exists.

- name: sysfs-memory-online
  mountPath: /sys/devices/system/memory/auto_online_blocks

...we will remove the mount that causes the error by requiring the auto_online_blocks

kernel:
  configOpts:
  - "MEMORY_HOTPLUG"

This tells Node Feature Discovery to report the kernel config option as a node label

if labels[nfdKernelConfigMemoryHotplugLabelKey] != "true" {
    memoryHotplugAutoOnline = false
}

If any GPU node lacks the label or has anything other than "true", the feature is treated as unavailable.

applyMemoryHotplugAutoOnlineMount(&obj.Spec.Template.Spec, n.memoryHotplugAutoOnline)
Applies the mount decision during driver DaemonSet transformation.
The func applyMemoryHotplugAutoOnlineMount(podSpec *corev1.PodSpec, enabled bool) {...} will add the volume mount and hostpath volume if missing when enabled. If not enabled, it removes any existing sysfs-memory-online mount from all containers and removes the matching volume.

if existing, exists := nodePoolMap[nodePool.name]; exists {
    existing.memoryHotplugAutoOnline = existing.memoryHotplugAutoOnline && nodePool.memoryHotplugAutoOnline
    nodePoolMap[nodePool.name] = existing
    continue
}

The memory-hotplug status is merged across all nodes in that pool. The pool supports the mount only if every node in the pool supports it.

Checklist

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

Testing

The driver render test sets MemoryHotplugAutoOnline=false, renders the driver DaemonSet, and checks that /sys/devices/system/memory/auto_online_blocks is not present in the output. If memory hotplug is unsupported, the driver manifest does not include the problematic mount.

The node-pool tests create fake Kubernetes nodes with NFD labels. One test confirms that a node with MEMORY_HOTPLUG=true enables the flag. The other confirms that if nodes in the same pool are mixed, one with the label and one without, the pool disables the flag.

Also verified with a Starling system:

sysadmin@controller-0:~$ sudo KUBECONFIG=/etc/kubernetes/admin.conf kubectl get cm -n test-operator \
  -l app.kubernetes.io/name=node-feature-discovery -o yaml \
  | grep -A8 -B3 MEMORY_HOTPLUG || true
      sources:
        kernel:
          configOpts:
          - MEMORY_HOTPLUG
        .....
sysadmin@controller-0:~$ sudo KUBECONFIG=/etc/kubernetes/admin.conf kubectl get ds -n te
st-operator nvidia-driver-daemonset -o yaml   | grep -n "auto_online_blocks" || true
sysadmin@controller-0:~$ 

Signed-off-by: Arjun <agadiyar@nvidia.com>
@JunAr7112 JunAr7112 marked this pull request as ready for review June 4, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant