Skip to content

Update Memory Hotplug hostvolume to /sys/devices/system - #2517

Merged
JunAr7112 merged 1 commit into
NVIDIA:mainfrom
JunAr7112:config_host
Jul 6, 2026
Merged

Update Memory Hotplug hostvolume to /sys/devices/system#2517
JunAr7112 merged 1 commit into
NVIDIA:mainfrom
JunAr7112:config_host

Conversation

@JunAr7112

@JunAr7112 JunAr7112 commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Description

This PR is created in response to this bug. Essentially, on some systems the /sys/devices/system/memory/auto_online_blocks files is not present and cannot be mounted as a hostvolume for systems that don't have CONFIG_MEMORY_HOTPLUG=y. auto_online_blocks is a Linux sysfs knob for memory hotplug.

Solution:

In manifests/state-driver/0500_daemonset.yaml and assets/state-driver/0500_daemonset.yaml switch to using a wider mountpath on /sys/devices/system rather than directly mounting /sys/devices/system/memory/auto_online_blocks.

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

Added TestDriverSysfsMemoryOnlineVolumeUsesStableParentDirectory, which verifies the rendered driver DaemonSet has the /sys/devices/system mount. It finds the volume named sysfs-memory-online and checks:

HostPath.Path == "/sys/devices/system"
HostPath.Type == corev1.HostPathDirectory
Finds the nvidia-driver-ctr container.

Finds that container’s sysfs-memory-online volume mount and checks:

MountPath == "/sys/devices/system"
SubPath == ""
So the test protects the exact behavior we want: the operator should mount the stable parent directory, not the optional /sys/devices/system/memory/auto_online_blocks file.

@tariq1890

Copy link
Copy Markdown
Contributor

@JunAr7112 Have you tested this on a system where CONFIG_MEMORY_HOTPLUG is unset?

@JunAr7112

JunAr7112 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor Author

@JunAr7112 Have you tested this on a system where CONFIG_MEMORY_HOTPLUG is unset?

Yes I setup a StarlingX system without CONFIG_MEMORY_HOTPLUG=y and verified that it could create the mount on the pod without any errors:

sysadmin@localhost:~$ grep CONFIG_MEMORY_HOTPLUG /boot/config-$(uname -r)
grep: /boot/config-6.12.0-1-amd64: No such file or directory

sysadmin@localhost:~ $ POD=$(kubectl get pod -n gpu-operator -l app=nvidia-driver-daemonset -o jsonpath='{.items[0].metadata.name}')
sysadmin@localhost:~ $ kubectl describe pod -n gpu-operator "$POD"
| awk '/^ sysfs-memory-online:/,/^ nv-firmware:/'
sysfs-memory-online:
Type: HostPath (bare host directory volume)
Path: /sys/devices/system
HostPathType: Directory

sysadmin@localhost:~$ kubectl describe pod -n gpu-operator "$POD"
| awk '/^Events:/,0'
| grep -nE 'Created container: nvidia-driver-ctr|Started container nvidia-driver-ctr|failed to mkdir|CreateContainerError|auto_online_blocks'
9: Normal Created 79s (x6 over 5m57s) kubelet Created container: nvidia-driver-ctr
10: Normal Started 79s (x6 over 5m57s) kubelet Started container nvidia-driver-ctr

@JunAr7112
JunAr7112 force-pushed the config_host branch 2 times, most recently from a060ca7 to 61232f7 Compare July 6, 2026 17:42
@tariq1890

Copy link
Copy Markdown
Contributor

Can you retitle this PR according to the latest changes you've made in this commit?

@JunAr7112 JunAr7112 changed the title Update daemonset for when CONFIG_MEMORY_HOTPLUG is not Present Swiched hostvolume to /sys/devices/system Jul 6, 2026
@JunAr7112

Copy link
Copy Markdown
Contributor Author

Can you retitle this PR according to the latest changes you've made in this commit?

Updated to match the commit

@JunAr7112 JunAr7112 changed the title Swiched hostvolume to /sys/devices/system Updated hostvolume to /sys/devices/system Jul 6, 2026
@JunAr7112 JunAr7112 changed the title Updated hostvolume to /sys/devices/system Updated memory hotplug hostvolume to /sys/devices/system Jul 6, 2026
@JunAr7112 JunAr7112 changed the title Updated memory hotplug hostvolume to /sys/devices/system Updated Memory Hotplug hostvolume to /sys/devices/system Jul 6, 2026
@JunAr7112 JunAr7112 changed the title Updated Memory Hotplug hostvolume to /sys/devices/system Update Memory Hotplug hostvolume to /sys/devices/system Jul 6, 2026
@copy-pr-bot

copy-pr-bot Bot commented Jul 6, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

Signed-off-by: Arjun <agadiyar@nvidia.com>
@JunAr7112

Copy link
Copy Markdown
Contributor Author

/ok-to-test f048f1e

@JunAr7112
JunAr7112 merged commit 92aceef into NVIDIA:main Jul 6, 2026
19 checks passed
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.

2 participants