-
Notifications
You must be signed in to change notification settings - Fork 39
Move kmod-6.18 nvidia drivers to use overlayfs at boot #536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
vigh-m
merged 3 commits into
bottlerocket-os:develop
from
vigh-m:nvidia-multi-driver/kernel-kit
Sep 18, 2026
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
726 changes: 395 additions & 331 deletions
726
packages/kmod-6.18-nvidia-r580/kmod-6.18-nvidia-r580.spec
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
packages/kmod-6.18-nvidia-r580/nvidia-gdrcopy-lts-tmpfiles.conf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| C /etc/drivers/nvidia-lts-gdrcopy-open-gpu.toml |
4 changes: 2 additions & 2 deletions
4
...95/nvidia-gdrcopy-open-gpu-config.toml.in → ...vidia-gdrcopy-open-gpu-lts-config.toml.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| [nvidia-gdrcopy-open-gpu] | ||
| [nvidia-lts-gdrcopy-open-gpu] | ||
| lib-modules-path = "kernel/drivers/extra/video/nvidia/gdrcopy/open-gpu" | ||
|
|
||
| [nvidia-gdrcopy-open-gpu.kernel-modules."gdrdrv.ko"] | ||
| [nvidia-lts-gdrcopy-open-gpu.kernel-modules."gdrdrv.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" |
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
packages/kmod-6.18-nvidia-r580/nvidia-grid-copy-only-config.toml.in
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/kmod-6.18-nvidia-r580/nvidia-grid-copy-only-lts-config.toml.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [nvidia-lts-grid-copy-only] | ||
| lib-modules-path = "kernel/drivers/extra/video/nvidia/grid" | ||
|
|
||
| [nvidia-lts-grid-copy-only.kernel-modules."nvidia-drm.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" | ||
|
|
||
| [nvidia-lts-grid-copy-only.kernel-modules."nvidia-peermem.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" |
8 changes: 4 additions & 4 deletions
8
...18-nvidia-r595/nvidia-grid-config.toml.in → ...vidia-r580/nvidia-grid-lts-config.toml.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,11 @@ | ||
| [nvidia-grid] | ||
| [nvidia-lts-grid] | ||
| lib-modules-path = "kernel/drivers/extra/video/nvidia/grid" | ||
|
|
||
| [nvidia-grid.kernel-modules."nvidia.ko"] | ||
| [nvidia-lts-grid.kernel-modules."nvidia.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" | ||
|
|
||
| [nvidia-grid.kernel-modules."nvidia-modeset.ko"] | ||
| [nvidia-lts-grid.kernel-modules."nvidia-modeset.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" | ||
|
|
||
| [nvidia-grid.kernel-modules."nvidia-uvm.ko"] | ||
| [nvidia-lts-grid.kernel-modules."nvidia-uvm.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1 @@ | ||
| d /etc/nvidia-imex 0755 root root - | ||
| C /etc/nvidia-imex/config.cfg 0644 root root - |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
packages/kmod-6.18-nvidia-r580/nvidia-lts-overlay-config.service.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| [Unit] | ||
| Description=NVIDIA lts branch /etc config overlays | ||
| DefaultDependencies=no | ||
| Before=drivers.target | ||
| # Upper/workdir live on the /etc tmpfs | ||
| RequiresMountsFor=/etc | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| RemainAfterExit=true | ||
| StandardError=journal+console | ||
| # Project the branch's /etc/nvidia config onto the canonical path. Used by | ||
| # nvidia-fabricmanager, nvidia-gridd and nvlsm | ||
| ExecStart=/usr/bin/mkdir -p \ | ||
| /etc/nvidia \ | ||
| /etc/nvidia-imex \ | ||
| /etc/.nvidia-config-overlay/upper \ | ||
| /etc/.nvidia-config-overlay/work \ | ||
| /etc/.nvidia-imex-config-overlay/upper \ | ||
| /etc/.nvidia-imex-config-overlay/work | ||
| ExecStart=/usr/bin/mount -t overlay nvidia-etc --options rw,nosuid,nodev,noexec,noatime,context=system_u:object_r:etc_t:s0,lowerdir=__NVIDIA_ROOT__/etc/nvidia:/etc/nvidia,upperdir=/etc/.nvidia-config-overlay/upper,workdir=/etc/.nvidia-config-overlay/work /etc/nvidia | ||
|
|
||
| # Writable so downstreams can supply the IMEX node list (nodes_config.cfg). | ||
| ExecStart=/usr/bin/mount -t overlay nvidia-imex-etc --options rw,nosuid,nodev,noexec,noatime,context=system_u:object_r:etc_t:s0,lowerdir=__NVIDIA_ROOT__/etc/nvidia-imex:/etc/nvidia-imex,upperdir=/etc/.nvidia-imex-config-overlay/upper,workdir=/etc/.nvidia-imex-config-overlay/work /etc/nvidia-imex | ||
|
|
||
| [Install] | ||
| RequiredBy=drivers.target |
42 changes: 42 additions & 0 deletions
42
packages/kmod-6.18-nvidia-r580/nvidia-lts-overlay-driver.service.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,42 @@ | ||
| [Unit] | ||
| Description=NVIDIA lts branch driver library/binary and kernel-module overlays | ||
| DefaultDependencies=no | ||
| Before=drivers.target | ||
| # The modules re-layer's upper/work live under /var/lib/kernel-modules, which | ||
| # prepare-var.service creates | ||
| Wants=prepare-var.service | ||
| After=prepare-var.service | ||
| # systemd-tmpfiles-setup creates the kernel-module destination directories under | ||
| # /usr/lib/modules, which the bind below captures into our lowerdir. Order after | ||
| # it so the /usr/lib64 overlay never masks /usr/lib/modules while tmpfiles is | ||
| # still creating those directories. | ||
| Wants=systemd-tmpfiles-setup.service | ||
| After=systemd-tmpfiles-setup.service | ||
| RequiresMountsFor=/var /usr/lib/modules | ||
|
|
||
| [Service] | ||
| Type=oneshot | ||
| RemainAfterExit=true | ||
| StandardError=journal+console | ||
|
|
||
| # The /usr/lib64 overlay shadows the /usr/lib/modules mount. | ||
| # To preserve /usr/lib/modules, we bind the lib-modules | ||
| # overlay to a second path and then re-layer it as a lowerdir | ||
| ExecStart=/usr/bin/mkdir -p \ | ||
| /run/nvidia/base-modules \ | ||
| /var/lib/kernel-modules/.nvidia/upper \ | ||
| /var/lib/kernel-modules/.nvidia/work | ||
| ExecStart=/usr/bin/mount --bind /usr/lib/modules /run/nvidia/base-modules | ||
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nodev,noatime,lowerdir=__NVIDIA_ROOT__/lib64:/usr/lib64 /usr/lib64 | ||
| # Remount /run/nvidia/base-modules on /usr/lib/modules bringing back the original | ||
| # /lib/modules as the lowerdir with new upperdir and workdir for write access | ||
| ExecStart=/usr/bin/mount -t overlay nvidia-modules --options rw,nosuid,nodev,noexec,noatime,context=system_u:object_r:state_t:s0,lowerdir=/run/nvidia/base-modules,upperdir=/var/lib/kernel-modules/.nvidia/upper,workdir=/var/lib/kernel-modules/.nvidia/work /usr/lib/modules | ||
|
|
||
| ExecStart=/usr/bin/mount -t overlay overlay --options ro,nosuid,nodev,noexec,noatime,lowerdir=__NVIDIA_ROOT__/share/nvidia:/usr/share/nvidia /usr/share/nvidia | ||
| 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 | ||
|
|
||
| [Install] | ||
| RequiredBy=drivers.target | ||
11 changes: 0 additions & 11 deletions
11
packages/kmod-6.18-nvidia-r580/nvidia-open-gpu-config.toml.in
This file was deleted.
Oops, something went wrong.
8 changes: 0 additions & 8 deletions
8
packages/kmod-6.18-nvidia-r580/nvidia-open-gpu-copy-only-config.toml.in
This file was deleted.
Oops, something went wrong.
8 changes: 8 additions & 0 deletions
8
packages/kmod-6.18-nvidia-r580/nvidia-open-gpu-copy-only-lts-config.toml.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| [nvidia-lts-open-gpu-copy-only] | ||
| lib-modules-path = "kernel/drivers/extra/video/nvidia/open-gpu" | ||
|
|
||
| [nvidia-lts-open-gpu-copy-only.kernel-modules."nvidia-drm.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" | ||
|
|
||
| [nvidia-lts-open-gpu-copy-only.kernel-modules."nvidia-peermem.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" |
11 changes: 11 additions & 0 deletions
11
packages/kmod-6.18-nvidia-r580/nvidia-open-gpu-lts-config.toml.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| [nvidia-lts-open-gpu] | ||
| lib-modules-path = "kernel/drivers/extra/video/nvidia/open-gpu" | ||
|
|
||
| [nvidia-lts-open-gpu.kernel-modules."nvidia.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" | ||
|
|
||
| [nvidia-lts-open-gpu.kernel-modules."nvidia-modeset.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" | ||
|
|
||
| [nvidia-lts-open-gpu.kernel-modules."nvidia-uvm.ko"] | ||
| copy-source = "__NVIDIA_MODULES__" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 6 additions & 6 deletions
12
...ia-r595/nvidia-tesla-build-config.toml.in → ...580/nvidia-tesla-lts-build-config.toml.in
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,18 @@ | ||
| [nvidia-tesla] | ||
| [nvidia-lts-tesla] | ||
| lib-modules-path = "kernel/drivers/extra/video/nvidia/tesla" | ||
| objects-source = "__NVIDIA_MODULES__" | ||
|
|
||
| [nvidia-tesla.object-files."nvidia.o"] | ||
| [nvidia-lts-tesla.object-files."nvidia.o"] | ||
| link-objects = ["nv-interface.o", "nv-kernel.o"] | ||
|
|
||
| [nvidia-tesla.kernel-modules."nvidia.ko"] | ||
| [nvidia-lts-tesla.kernel-modules."nvidia.ko"] | ||
| link-objects = ["nvidia.o", "nvidia.mod.o", ".module-common.o"] | ||
|
|
||
| [nvidia-tesla.object-files."nvidia-modeset.o"] | ||
| [nvidia-lts-tesla.object-files."nvidia-modeset.o"] | ||
| link-objects = ["nv-modeset-interface.o", "nv-modeset-kernel.o"] | ||
|
|
||
| [nvidia-tesla.kernel-modules."nvidia-modeset.ko"] | ||
| [nvidia-lts-tesla.kernel-modules."nvidia-modeset.ko"] | ||
| link-objects = ["nvidia-modeset.o", "nvidia-modeset.mod.o", ".module-common.o"] | ||
|
|
||
| [nvidia-tesla.kernel-modules."nvidia-uvm.ko"] | ||
| [nvidia-lts-tesla.kernel-modules."nvidia-uvm.ko"] | ||
| link-objects = ["nvidia-uvm.o", "nvidia-uvm.mod.o", ".module-common.o"] |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. This isn't really needed. Since we overlay the
.sofiles into/usr/lib64glibc will fallback to that. Runningldconfigonly populates theldconf.so.cachewhich 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.