Skip to content

Commit

Permalink
feat: support lts and production nvidia modules
Browse files Browse the repository at this point in the history
Support LTS and production versions of NVIDIA kernel modules as per https://docs.nvidia.com/datacenter/tesla/drivers/index.html#lifecycle

Part of: siderolabs/talos#9086

Signed-off-by: Noel Georgi <git@frezbo.dev>
  • Loading branch information
frezbo committed Aug 2, 2024
1 parent a97d58f commit 75adbde
Show file tree
Hide file tree
Showing 10 changed files with 165 additions and 72 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-07-03T10:20:21Z by kres 2c4ff8a.
# Generated on 2024-07-31T18:33:29Z by kres faf91e3.

name: default
concurrency:
Expand Down Expand Up @@ -33,7 +33,7 @@ jobs:
labels: ${{ steps.retrieve-pr-labels.outputs.result }}
services:
buildkitd:
image: moby/buildkit:v0.14.1
image: moby/buildkit:v0.15.0
options: --privileged
ports:
- 1234:1234
Expand Down Expand Up @@ -85,6 +85,7 @@ jobs:
run: |
make
- name: Build nonfree
if: github.event_name == 'pull_request'
run: |
make nonfree
- name: Login to registry
Expand Down Expand Up @@ -136,7 +137,7 @@ jobs:
- default
services:
buildkitd:
image: moby/buildkit:v0.14.1
image: moby/buildkit:v0.15.0
options: --privileged
ports:
- 1234:1234
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/weekly.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-07-02T13:34:14Z by kres 582671e.
# Generated on 2024-07-31T18:33:29Z by kres faf91e3.

name: weekly
concurrency:
Expand All @@ -16,7 +16,7 @@ jobs:
- pkgs
services:
buildkitd:
image: moby/buildkit:v0.14.1
image: moby/buildkit:v0.15.0
options: --privileged
ports:
- 1234:1234
Expand Down
6 changes: 4 additions & 2 deletions .kres.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ spec:
- kernel
- drbd-pkg
- gasket-driver-pkg
- nvidia-open-gpu-kernel-modules-pkg
- nvidia-open-gpu-kernel-modules-lts-pkg
- nvidia-open-gpu-kernel-modules-production-pkg
- zfs-pkg
additionalTargets:
nonfree:
- nonfree-kmod-nvidia-pkg
- nonfree-kmod-nvidia-lts-pkg
- nonfree-kmod-nvidia-production-pkg
reproducibleTargetName: reproducibility
---
kind: auto.CustomSteps
Expand Down
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# THIS FILE WAS AUTOMATICALLY GENERATED, PLEASE DO NOT EDIT.
#
# Generated on 2024-06-25T05:52:46Z by kres 4c9f215.
# Generated on 2024-08-02T11:55:34Z by kres faf91e3.

# common variables

Expand Down Expand Up @@ -79,9 +79,11 @@ TARGETS += xfsprogs
TARGETS += kernel
TARGETS += drbd-pkg
TARGETS += gasket-driver-pkg
TARGETS += nvidia-open-gpu-kernel-modules-pkg
TARGETS += nvidia-open-gpu-kernel-modules-lts-pkg
TARGETS += nvidia-open-gpu-kernel-modules-production-pkg
TARGETS += zfs-pkg
NONFREE_TARGETS = nonfree-kmod-nvidia-pkg
NONFREE_TARGETS = nonfree-kmod-nvidia-lts-pkg
NONFREE_TARGETS += nonfree-kmod-nvidia-production-pkg

# help menu

Expand Down
11 changes: 7 additions & 4 deletions Pkgfile
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,13 @@ vars:
musl_sha256: a9a118bbe84d8764da0ea0d28b3ab3fae8477fc7e4085d90102b8596fc7c75e4
musl_sha512: 7bb7f7833923cd69c7a1a9b8a5f1784bfd5289663eb6061dcd43d583e45987df8a68a1be05d75cc1c88a3f5b610653d1a70f4a9cff4d8f7fd41ae73ee058c17c

# renovate: datasource=github-releases depName=nvidia/open-gpu-kernel-modules
nvidia_driver_version: 535.129.03
nvidia_driver_sha256: 170ee91b6cd6c801bba0de91e0d62af8e574adde38120bc762784755b5a9821d
nvidia_driver_sha512: c8104103f34365b7a20dcebb64e1eb2e64a7b056b44329fa305f81e267759f2b1bb1c09923e617d4f5f4af3be01c3b8e2e6d739f03d4d0f129b31331fec3a4d8
# renovate: datasource=github-releases extractVersion=^\d+\.(?<version>\d+\.\d+)$ depName=nvidia/open-gpu-kernel-modules
# NOTE: Use the version that's also available under fabricmanager at https://developer.download.nvidia.com/compute/cuda/redist/fabricmanager/linux-x86_64/
nvidia_driver_version_lts: 535.104.05

# renovate: datasource=github-releases extractVersion=^\d+\.(?<version>\d+\.\d+)$ depName=nvidia/open-gpu-kernel-modules
# NOTE: Use the version that's also available under fabricmanager at https://developer.download.nvidia.com/compute/cuda/redist/fabricmanager/linux-x86_64/
nvidia_driver_version_production: 550.54.15

# renovate: datasource=git-tags extractVersion=^openssl-(?<version>.*)$ depName=git://git.openssl.org/openssl.git
openssl_version: 3.3.0
Expand Down
30 changes: 12 additions & 18 deletions nonfree/kmod-nvidia/pkg.yaml → nonfree/kmod-nvidia/lts/pkg.yaml
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
name: nonfree-kmod-nvidia-pkg
name: nonfree-kmod-nvidia-lts-pkg
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: kernel-build
steps:
- sources:
# {{ if eq .ARCH "aarch64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://download.nvidia.com/XFree86/Linux-aarch64/{{ .nvidia_driver_version }}/NVIDIA-Linux-aarch64-{{ .nvidia_driver_version }}.run
destination: nvidia.run
sha256: 8ba8d961457a241bcdf91b76d6fe2f36cb473c8bbdb02fb6650a622ce2e85b33
sha512: 706de7e53b81f909d8bc6a12a39c594754a164c49f5d23c7939dc3abcfc04f5d5b12b7d65762ae574582149a098f06ee5fe95be4f8ad1056a3307a6ce93f3c00
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-sbsa/nvidia_driver-linux-sbsa-{{ .nvidia_driver_version_lts }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: eb089f52ddda09f4b2bcf0eb661d0bb7881a3d63cbca558c9530ab50b4ef84ee
sha512: cbc575b8f72211c54b962c3c12a671d4b993436f5c292181c5db098a5b5fe909ca3e001e679430dfa393cd63a626d4c2cee1c2dd3e2b79464eea4d72fc06a3ff
# {{ else }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://download.nvidia.com/XFree86/Linux-x86_64/{{ .nvidia_driver_version }}/NVIDIA-Linux-x86_64-{{ .nvidia_driver_version }}.run
destination: nvidia.run
sha256: e6dca5626a2608c6bb2a046cfcb7c1af338b9e961a7dd90ac09bb8a126ff002e
sha512: 3d7142658fe836e1debf7786857bdb293490ef33351e9b7d39face245fe8596b0f46052b86fae08350fcda1e2a9fd68d7309b94e107d1b016bd529d8fc37e31f
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-x86_64/nvidia_driver-linux-x86_64-{{ .nvidia_driver_version_lts }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: f19c11dfda9e1e5c3e0a2ca775cdaa851431648540f4e8e2916c53735debd450
sha512: 7505eda598719325b757375e25a98b17fb0e31d355e42277c32897648f63769222ac32a50f7ae89998fea52bd858160c83114e473e36cd36cfef17d57f8fdde6
# {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
env:
ARCH: {{ if eq .ARCH "aarch64"}}arm64{{ else if eq .ARCH "x86_64" }}x86_64{{ else }}unsupported{{ end }}
prepare:
- |
export PATH=/toolchain/bin:$PATH
export GUESS_MD5_PATH=/toolchain/bin
rm -f /dev/tty && ln -s /dev/stdout /dev/tty
ln -s /toolchain/bin/echo /toolchain/bin/which
/toolchain/bin/bash nvidia.run --extract-only
tar xf nvidia.tar.xz --strip-components=1
build:
- |
cd NVIDIA-Linux-*/kernel
cd kernel
make -j $(nproc) SYSSRC=/src
install:
- |
cd NVIDIA-Linux-*/kernel
cd kernel
mkdir -p /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.order /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
Expand Down
41 changes: 41 additions & 0 deletions nonfree/kmod-nvidia/production/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: nonfree-kmod-nvidia-production-pkg
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: kernel-build
steps:
- sources:
# {{ if eq .ARCH "aarch64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-sbsa/nvidia_driver-linux-sbsa-{{ .nvidia_driver_version_production }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: b39a8cb837fe3846284d89ab2202e93b14804349d3fc9aa8a8384fd2759ec2f5
sha512: 164636addea50d4d28c4630bf7eaf6060c6392b4aac670c0f5e43996fb309203efc1fa95d464eed8a9d3a22fa2aa5f446195c0f3e4dafa9e32a532447810a2d7
# {{ else }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-x86_64/nvidia_driver-linux-x86_64-{{ .nvidia_driver_version_production }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: e1416ebc1e7b4a14d393ca584e3f9c5e22f9750f4ba502a8ba2c5c5ad943bbb5
sha512: 188e742796ace5a48b6cdbedae0943c2be593f9e48fb3107ac9f844ed443369cbe977aa084abf17604dd789f475633cd419ad80d63c27429d2760a4018c57586
# {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
env:
ARCH: {{ if eq .ARCH "aarch64"}}arm64{{ else if eq .ARCH "x86_64" }}x86_64{{ else }}unsupported{{ end }}
prepare:
- |
tar xf nvidia.tar.xz --strip-components=1
build:
- |
cd kernel
make -j $(nproc) SYSSRC=/src
install:
- |
cd kernel
mkdir -p /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.order /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.builtin /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.builtin.modinfo /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
make -j $(nproc) modules_install SYSSRC=/src DEPMOD=/toolchain/bin/depmod INSTALL_MOD_PATH=/rootfs INSTALL_MOD_DIR=extras INSTALL_MOD_STRIP=1
finalize:
- from: /rootfs
to: /
45 changes: 45 additions & 0 deletions nvidia-open-gpu-kernel-modules/lts/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: nvidia-open-gpu-kernel-modules-lts-pkg
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: kernel-build
steps:
- sources:
# {{ if eq .ARCH "aarch64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-sbsa/nvidia_driver-linux-sbsa-{{ .nvidia_driver_version_lts }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: eb089f52ddda09f4b2bcf0eb661d0bb7881a3d63cbca558c9530ab50b4ef84ee
sha512: cbc575b8f72211c54b962c3c12a671d4b993436f5c292181c5db098a5b5fe909ca3e001e679430dfa393cd63a626d4c2cee1c2dd3e2b79464eea4d72fc06a3ff
# {{ else }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-x86_64/nvidia_driver-linux-x86_64-{{ .nvidia_driver_version_lts }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: f19c11dfda9e1e5c3e0a2ca775cdaa851431648540f4e8e2916c53735debd450
sha512: 7505eda598719325b757375e25a98b17fb0e31d355e42277c32897648f63769222ac32a50f7ae89998fea52bd858160c83114e473e36cd36cfef17d57f8fdde6
# {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
env:
ARCH: {{ if eq .ARCH "aarch64"}}arm64{{ else if eq .ARCH "x86_64" }}x86_64{{ else }}unsupported{{ end }}
prepare:
- |
tar xf nvidia.tar.xz --strip-components=1
build:
- |
cd kernel-open
make -j $(nproc) SYSSRC=/src
install:
- |
cd kernel-open
mkdir -p /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.order /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.builtin /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.builtin.modinfo /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
make -j $(nproc) modules_install SYSSRC=/src DEPMOD=/toolchain/bin/depmod INSTALL_MOD_PATH=/rootfs INSTALL_MOD_STRIP=1
test:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
finalize:
- from: /rootfs
to: /
40 changes: 0 additions & 40 deletions nvidia-open-gpu-kernel-modules/pkg.yaml

This file was deleted.

45 changes: 45 additions & 0 deletions nvidia-open-gpu-kernel-modules/production/pkg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: nvidia-open-gpu-kernel-modules-production-pkg
variant: scratch
shell: /toolchain/bin/bash
dependencies:
- stage: kernel-build
steps:
- sources:
# {{ if eq .ARCH "aarch64" }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-sbsa/nvidia_driver-linux-sbsa-{{ .nvidia_driver_version_production }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: b39a8cb837fe3846284d89ab2202e93b14804349d3fc9aa8a8384fd2759ec2f5
sha512: 164636addea50d4d28c4630bf7eaf6060c6392b4aac670c0f5e43996fb309203efc1fa95d464eed8a9d3a22fa2aa5f446195c0f3e4dafa9e32a532447810a2d7
# {{ else }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
- url: https://developer.download.nvidia.com/compute/cuda/redist/nvidia_driver/linux-x86_64/nvidia_driver-linux-x86_64-{{ .nvidia_driver_version_production }}-archive.tar.xz
destination: nvidia.tar.xz
sha256: e1416ebc1e7b4a14d393ca584e3f9c5e22f9750f4ba502a8ba2c5c5ad943bbb5
sha512: 188e742796ace5a48b6cdbedae0943c2be593f9e48fb3107ac9f844ed443369cbe977aa084abf17604dd789f475633cd419ad80d63c27429d2760a4018c57586
# {{ end }} This in fact is YAML comment, but Go templating instruction is evaluated by bldr
env:
ARCH: {{ if eq .ARCH "aarch64"}}arm64{{ else if eq .ARCH "x86_64" }}x86_64{{ else }}unsupported{{ end }}
prepare:
- |
tar xf nvidia.tar.xz --strip-components=1
build:
- |
cd kernel-open
make -j $(nproc) SYSSRC=/src
install:
- |
cd kernel-open
mkdir -p /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.order /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.builtin /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
cp /src/modules.builtin.modinfo /rootfs/lib/modules/$(cat /src/include/config/kernel.release)/
make -j $(nproc) modules_install SYSSRC=/src DEPMOD=/toolchain/bin/depmod INSTALL_MOD_PATH=/rootfs INSTALL_MOD_STRIP=1
test:
- |
# https://www.kernel.org/doc/html/v4.15/admin-guide/module-signing.html#signed-modules-and-stripping
find /rootfs/lib/modules -name '*.ko' -exec grep -FL '~Module signature appended~' {} \+
finalize:
- from: /rootfs
to: /

0 comments on commit 75adbde

Please sign in to comment.