Move kmod-6.18 nvidia drivers to use overlayfs at boot - #536
Conversation
0774264 to
8f3da52
Compare
8f3da52 to
44fcd59
Compare
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nodev,noatime,lowerdir=__NVIDIA_ROOT__/bin:/usr/bin /usr/bin | ||
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nosuid,nodev,noexec,noatime,lowerdir=__NVIDIA_ROOT__/share/vulkan:/usr/share/vulkan /usr/share/vulkan | ||
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nosuid,nodev,noexec,noatime,lowerdir=__NVIDIA_ROOT__/share/glvnd:/usr/share/glvnd /usr/share/glvnd | ||
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nosuid,nodev,noexec,noatime,lowerdir=__NVIDIA_ROOT__/share/egl:/usr/share/egl /usr/share/egl |
There was a problem hiding this comment.
Could we refresh the host linker cache after mounting the selected driver's overlays?
On dual-branch boots, the existing ldconfig.service runs before branch selection, so its scan cannot see these NVIDIA libraries. The legacy NVIDIA runtime uses that host cache to discover libraries to mount into containers.
Appending the refresh here would keep the existing early ldconfig.service in place and update the cache after the overlays are mounted.
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nosuid,nodev,noexec,noatime,lowerdir=__NVIDIA_ROOT__/share/egl:/usr/share/egl /usr/share/egl | |
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nosuid,nodev,noexec,noatime,lowerdir=__NVIDIA_ROOT__/share/egl:/usr/share/egl /usr/share/egl | |
| ExecStart=/sbin/ldconfig -X |
The PB overlay service needs the same change. Could we also validate this with a legacy-mode GPU container test?
There was a problem hiding this comment.
Yeah. This isn't really needed. Since we overlay the .so files into /usr/lib64 glibc will fallback to that. Running ldconfig only populates the ldconf.so.cache which has almost no impact on a customers workflow.
When testing by calling nvidia-smi, the binary was discovered as expected so this is safe to omit.
44fcd59 to
e314dab
Compare
e314dab to
4580483
Compare
Install the driver's libraries, binaries, kernel-module objects, driverdog tomls and /etc configs under a per-branch storage root (/usr/nvidia/lts) instead of directly onto the canonical system paths, and overlay them into place at bootime. - Add nvidia-lts-overlay-driver.service: a oneshot that overlays lib64, bin, share-nvidia, share-vulkan, share-glvnd and share-egl from the storage root onto their canonical /usr and /usr/share paths - Add nvidia-lts-overlay-config.service: overlay etc-nvidia onto /etc/nvidia and etc-nvidia-imex onto /etc/nvidia-imex - Namespace the driverdog module sets and the link/load/copy unit filenames under the branch so the overlay wiring is unambiguous Signed-off-by: Vighnesh Maheshwari <vighmah@amazon.com>
Install the driver's libraries, binaries, kernel-module objects, driverdog tomls and /etc configs under a per-branch storage root (/usr/nvidia/fb) instead of directly onto the canonical system paths, and overlay them into place at bootime. - Add nvidia-fb-overlay-driver.service: a oneshot that overlays lib64, bin, share-nvidia, share-vulkan, share-glvnd and share-egl from the storage root onto their canonical /usr and /usr/share paths - Add nvidia-fb-overlay-config.service: overlay etc-nvidia onto /etc/nvidia and etc-nvidia-imex onto /etc/nvidia-imex - Namespace the driverdog module sets and the link/load/copy unit filenames under the branch so the overlay wiring is unambiguous Signed-off-by: Vighnesh Maheshwari <vighmah@amazon.com>
Adds the full IMEX support and a default-channel modprobe config - Add nvidia-imex.service, its config.cfg and tmpfiles to the imex subpackage. Signed-off-by: Vighnesh Maheshwari <vighmah@amazon.com>
4580483 to
617e99a
Compare
Description of changes:
Enables the NVIDIA
lts(r580) andpb(r595) driver branches to be co-installed on a single Bottlerocket image, with exactly one branch activated at boot. Single-driver images continue to work unchanged.Both branches previously installed their libraries, binaries, module objects and configs directly onto the canonical system paths (/usr/lib64, /usr/bin, /usr/share/nvidia, /etc/nvidia, ...). This PR moves each branch's files under a per-branch storage root and overlays the selected branch onto the canonical paths at boot.
usr/share/.nvidia/<branch>/(ltsorpb).nvidia-<branch>-overlay-driver.service: lib64, bin, share/nvidia, share/vulkan, share/glvnd, share/egl.nvidia-<branch>-overlay-config.service: /etc/nvidia, /etc/nvidia-imex.usr/lib64overlay would otherwise shadow the writable/usr/lib/modulesmount, so the base module tree is bound to a /run mount point and re-layered as a lowerdir with a writable upper under/var/lib/kernel-modules/.nvidia.nvidia-lts-*/nvidia-pb-*) so both branches' units coexist without collision. driverdog config tomls are also branch-named and installed normally into the flat/etc/drivers.New driver file layout
Each branch now lives under its own root, e.g.:
Backwards compatibility
Testing
lts(r580) image: boots, driver loads,nvidia-smiworkspb(r595) image: boots, driver loads,nvidia-smiworksTerms of contribution:
By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.