Skip to content

Commit

Permalink
Merge branch 'mount_sysfs_memory_online' into 'master'
Browse files Browse the repository at this point in the history
Add sysfs mount to enable auto-onlining of memory

See merge request nvidia/kubernetes/gpu-operator!952
  • Loading branch information
shivamerla committed Nov 16, 2023
2 parents ace6403 + 54befe3 commit f49e1ab
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 12 deletions.
6 changes: 5 additions & 1 deletion assets/state-driver/0500_daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ spec:
- name: run-mellanox-drivers
mountPath: /run/mellanox/drivers
mountPropagation: HostToContainer
- name: sysfs-memory-online
mountPath: /sys/devices/system/memory/auto_online_blocks
- name: firmware-search-path
mountPath: /sys/module/firmware_class/parameters/path
- name: nv-firmware
Expand Down Expand Up @@ -305,7 +307,9 @@ spec:
- name: firmware-search-path
hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
- name: sysfs-memory-online
hostPath:
path: /sys/devices/system/memory/auto_online_blocks
- name: nv-firmware
hostPath:
path: /run/nvidia/driver/lib/firmware
Expand Down
9 changes: 8 additions & 1 deletion internal/state/driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -733,7 +733,14 @@ func getDriverVolumes() []corev1.Volume {
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/sys/module/firmware_class/parameters/path",
Type: newHostPathType(corev1.HostPathFileOrCreate),
},
},
},
{
Name: "sysfs-memory-online",
VolumeSource: corev1.VolumeSource{
HostPath: &corev1.HostPathVolumeSource{
Path: "/sys/devices/system/memory/auto_online_blocks",
},
},
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
- mountPath: /opt/config/test-file
Expand Down Expand Up @@ -306,8 +308,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion internal/state/testdata/golden/driver-full-spec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
hostPID: true
Expand Down Expand Up @@ -332,8 +334,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion internal/state/testdata/golden/driver-gds.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
- args:
Expand Down Expand Up @@ -349,8 +351,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion internal/state/testdata/golden/driver-minimal.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
hostPID: true
Expand Down Expand Up @@ -302,8 +304,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
- mountPath: /mnt/shared-nvidia-driver-toolkit
Expand Down Expand Up @@ -408,8 +410,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion internal/state/testdata/golden/driver-precompiled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
hostPID: true
Expand Down Expand Up @@ -305,8 +307,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion internal/state/testdata/golden/driver-rdma-hostmofed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
- args:
Expand Down Expand Up @@ -360,8 +362,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion internal/state/testdata/golden/driver-rdma.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
- args:
Expand Down Expand Up @@ -354,8 +356,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion internal/state/testdata/golden/driver-vgpu-host-manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,8 @@ spec:
name: run-mellanox-drivers
- mountPath: /sys/module/firmware_class/parameters/path
name: firmware-search-path
- mountPath: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- mountPath: /lib/firmware
name: nv-firmware
hostPID: true
Expand Down Expand Up @@ -294,8 +296,10 @@ spec:
name: host-sys
- hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
name: firmware-search-path
- hostPath:
path: /sys/devices/system/memory/auto_online_blocks
name: sysfs-memory-online
- hostPath:
path: /run/nvidia/driver/lib/firmware
type: DirectoryOrCreate
Expand Down
6 changes: 5 additions & 1 deletion manifests/state-driver/0500_daemonset.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,8 @@ spec:
mountPropagation: HostToContainer
- name: firmware-search-path
mountPath: /sys/module/firmware_class/parameters/path
- name: sysfs-memory-online
mountPath: /sys/devices/system/memory/auto_online_blocks
- name: nv-firmware
mountPath: /lib/firmware
{{- if and .AdditionalConfigs .AdditionalConfigs.VolumeMounts }}
Expand Down Expand Up @@ -529,7 +531,9 @@ spec:
- name: firmware-search-path
hostPath:
path: /sys/module/firmware_class/parameters/path
type: FileOrCreate
- name: sysfs-memory-online
hostPath:
path: /sys/devices/system/memory/auto_online_blocks
- name: nv-firmware
hostPath:
path: /run/nvidia/driver/lib/firmware
Expand Down

0 comments on commit f49e1ab

Please sign in to comment.