Package Nvidia Open GPU Kernel Modules#16971
Package Nvidia Open GPU Kernel Modules#16971ellie-di wants to merge 4 commits intotomls/base/mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Adds packaging and build integration for NVIDIA’s open GPU kernel modules as kernel subpackages in Azure Linux 4.0, along with documentation of the kmod framework and workflow.
Changes:
- Introduces a phase-gated kmod subpackage framework (
kmod-macros.inc) and akmod-nvidia-openimplementation (kmod-nvidia-open.inc+ modprobe config). - Updates
kernel.comp.tomlto fetch NVIDIA sources and inject spec overlays for kmod build/install/%files/scriptlets. - Adds a packaging strategy document describing the architecture and onboarding steps for new kmods.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 12 comments.
Show a summary per file
| File | Description |
|---|---|
| docs/oss-kmod-packaging-strategy.md | Documents the kmod-as-kernel-subpackage design and onboarding workflow. |
| base/comps/kernel/kmod-nvidia-open.inc | Defines the kmod-nvidia-open subpackage using phase-gated %include sections. |
| base/comps/kernel/kmod-nvidia-open-modprobe.conf | Adds modprobe configuration to avoid nouveau conflicts. |
| base/comps/kernel/kmod-macros.inc | Provides a small framework/registry for kmod subpackages included by the kernel spec. |
| base/comps/kernel/kernel.comp.toml | Downloads NVIDIA sources and injects the necessary spec overlays to build/package the kmod. |
| # kmod-nvidia-open.inc — NVIDIA open GPU kernel module subpackage | ||
| # | ||
| # Phases: package, prep, build, install, files | ||
| # Activated by: %{run_kmod_phase <phase>} from kmod-macros.inc |
There was a problem hiding this comment.
This comment references %{run_kmod_phase ...}, but the implementation shown in this PR injects %global _kmod_phase ... and then directly %includes the .inc file (and kmod-macros.inc doesn’t define run_kmod_phase). Update the comment to match the actual activation mechanism to avoid misleading future maintainers.
| # Activated by: %{run_kmod_phase <phase>} from kmod-macros.inc | |
| # Activated by: injecting %global _kmod_phase <phase> and directly %include-ing | |
| # this .inc file |
| install -d $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/extra/nvidia | ||
| for mod in nvidia nvidia-modeset nvidia-drm nvidia-uvm nvidia-peermem; do | ||
| ko="%{_builddir}/open-gpu-kernel-modules-%{nvidia_open_version}/kernel-open/${mod}.ko" | ||
| if [ -f "${ko}" ]; then | ||
| install -m 0644 "${ko}" $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/extra/nvidia/ | ||
| fi | ||
| done | ||
| # Install modprobe config to blacklist conflicting modules | ||
| install -D -m 0644 %{SOURCE6001} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/kmod-%{_kmod_name}.conf | ||
| # Install depmod override config | ||
| install -d $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d | ||
| cat > $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/kmod-%{_kmod_name}.conf << 'DEPMOD_EOF' |
There was a problem hiding this comment.
Using $RPM_BUILD_ROOT and hardcoding /usr/sbin/depmod reduces portability across RPM build environments. Prefer %{buildroot} for paths under the buildroot and %{_sbindir}/depmod (or an appropriate macro) for the depmod executable path.
| install -d $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/extra/nvidia | |
| for mod in nvidia nvidia-modeset nvidia-drm nvidia-uvm nvidia-peermem; do | |
| ko="%{_builddir}/open-gpu-kernel-modules-%{nvidia_open_version}/kernel-open/${mod}.ko" | |
| if [ -f "${ko}" ]; then | |
| install -m 0644 "${ko}" $RPM_BUILD_ROOT/lib/modules/%{KVERREL}/extra/nvidia/ | |
| fi | |
| done | |
| # Install modprobe config to blacklist conflicting modules | |
| install -D -m 0644 %{SOURCE6001} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/kmod-%{_kmod_name}.conf | |
| # Install depmod override config | |
| install -d $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d | |
| cat > $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/kmod-%{_kmod_name}.conf << 'DEPMOD_EOF' | |
| install -d %{buildroot}/lib/modules/%{KVERREL}/extra/nvidia | |
| for mod in nvidia nvidia-modeset nvidia-drm nvidia-uvm nvidia-peermem; do | |
| ko="%{_builddir}/open-gpu-kernel-modules-%{nvidia_open_version}/kernel-open/${mod}.ko" | |
| if [ -f "${ko}" ]; then | |
| install -m 0644 "${ko}" %{buildroot}/lib/modules/%{KVERREL}/extra/nvidia/ | |
| fi | |
| done | |
| # Install modprobe config to blacklist conflicting modules | |
| install -D -m 0644 %{SOURCE6001} %{buildroot}%{_sysconfdir}/modprobe.d/kmod-%{_kmod_name}.conf | |
| # Install depmod override config | |
| install -d %{buildroot}%{_sysconfdir}/depmod.d | |
| cat > %{buildroot}%{_sysconfdir}/depmod.d/kmod-%{_kmod_name}.conf << 'DEPMOD_EOF' |
| install -D -m 0644 %{SOURCE6001} $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/kmod-%{_kmod_name}.conf | ||
| # Install depmod override config | ||
| install -d $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d | ||
| cat > $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/kmod-%{_kmod_name}.conf << 'DEPMOD_EOF' |
There was a problem hiding this comment.
Using $RPM_BUILD_ROOT and hardcoding /usr/sbin/depmod reduces portability across RPM build environments. Prefer %{buildroot} for paths under the buildroot and %{_sbindir}/depmod (or an appropriate macro) for the depmod executable path.
| %post -n kmod-%{_kmod_name} | ||
| /usr/sbin/depmod -a %{KVERREL} || : | ||
|
|
||
| %postun -n kmod-%{_kmod_name} | ||
| /usr/sbin/depmod -a %{KVERREL} || : |
There was a problem hiding this comment.
Using $RPM_BUILD_ROOT and hardcoding /usr/sbin/depmod reduces portability across RPM build environments. Prefer %{buildroot} for paths under the buildroot and %{_sbindir}/depmod (or an appropriate macro) for the depmod executable path.
| # Download the NVIDIA open GPU kernel module source tarball | ||
| [[components.kernel.source-files]] | ||
| filename = "open-gpu-kernel-modules-595.58.03.tar.gz" | ||
| hash = "e0c4659ddf15e4f4e19cee05b49f88c9ba08ef3add0dfe08249798f58d0fe75e" | ||
| hash-type = "SHA256" | ||
| origin = { type = "download", uri = "https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/595.58.03.tar.gz" } |
There was a problem hiding this comment.
The NVIDIA version is defined in nvidia_open_version, but the filename and uri repeat the version string literally. This creates a multi-place update requirement for version bumps. If the component system supports substitution, derive filename/uri from nvidia_open_version; otherwise, add a short comment noting that these must be kept in sync (and consider consolidating the version string in one place where possible).
📄❌ Rendered specs are out of date🚧🚧🚧🚧🚧 Warning Disregard this comment. Spec rendering is still under development and checked-in specs 🚧🚧🚧🚧🚧 FIX: — run this and commit the result: azldev component render -a --clean-staleOr download the fix patch and apply it: gh run download 25240248336 -R microsoft/azurelinux -n rendered-specs-patch
git apply rendered-specs.patch
Content diffs`specs/e/erlang/erlang.spec`--- committed/specs/e/erlang/erlang.spec
+++ rendered/specs/e/erlang/erlang.spec
@@ -75,7 +75,7 @@
Name: erlang
Version: 26.2.5.17
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: General-purpose programming language and runtime environment
License: Apache-2.0
`specs/k/kernel/kernel.azl.macros`--- committed/specs/k/kernel/kernel.azl.macros
+++ rendered/specs/k/kernel/kernel.azl.macros
@@ -4,3 +4,4 @@
%azl_pkgrelease 8
%azurelinux_version 3
%kextraversion 1
+%nvidia_open_version 595.58.03
`specs/k/kernel/kernel.spec`--- committed/specs/k/kernel/kernel.spec
+++ rendered/specs/k/kernel/kernel.spec
@@ -198,6 +198,9 @@
#
# End of genspec.sh variables
+
+# AZL: kmod subpackage framework
+%include %{_sourcedir}/kmod-macros.inc
#
%define pkg_release %{specrelease}
@@ -1174,6 +1177,10 @@
Source5000: 6.18-x86_64-azl.config
Source5001: 6.18-aarch64-azl.config
Source5002: azurelinux-ca-20230216.pem
+Source5999: kmod-macros.inc
+Source6000: open-gpu-kernel-modules-%{nvidia_open_version}.tar.gz
+Source6001: kmod-nvidia-open-modprobe.conf
+Source6002: kmod-nvidia-open.inc
## Patches needed for building this package
@@ -1224,6 +1231,11 @@
%{nil}
+
+# AZL: kmod subpackage declarations
+%global _kmod_phase package
+%global _kmod_name nvidia-open
+%include %{_sourcedir}/kmod-nvidia-open.inc
%package doc
Summary: Various documentation bits found in the kernel source
Group: Documentation
@@ -2245,6 +2257,11 @@
RHJOBS=$RPM_BUILD_NCPUS SPECPACKAGE_NAME=%{name} ./process_configs.sh $OPTS %{specrpmversion}
cd ../..
%endif
+
+# AZL: Prepare kmod subpackage sources
+%global _kmod_phase prep
+%global _kmod_name nvidia-open
+%include %{_sourcedir}/kmod-nvidia-open.inc
%build
%{log_msg "Start of build stage"}
@@ -3412,6 +3429,11 @@
%ifnarch noarch %{nobuildarches}
%global __debug_package 1
+
+# AZL: Build kmod subpackage modules
+%global _kmod_phase build
+%global _kmod_name nvidia-open
+%include %{_sourcedir}/kmod-nvidia-open.inc
%files -f debugfiles.list debuginfo-common-%{_target_cpu}
%endif
@@ -3886,6 +3908,11 @@
###
%if %{with_tools}
+
+# AZL: Install kmod subpackage files
+%global _kmod_phase install
+%global _kmod_name nvidia-open
+%include %{_sourcedir}/kmod-nvidia-open.inc
%post -n %{package_name}-tools-libs
/sbin/ldconfig
@@ -4538,6 +4565,11 @@
# and build.
#
#
+
+# AZL: kmod subpackage file lists and scriptlets
+%global _kmod_phase files
+%global _kmod_name nvidia-open
+%include %{_sourcedir}/kmod-nvidia-open.inc
%changelog
* Thu Feb 19 2026 Augusto Caringi <acaringi@redhat.com> [6.18.13-0]
- Linux v6.18.13
`specs/k/kernel/sources`--- committed/specs/k/kernel/sources
+++ rendered/specs/k/kernel/sources
@@ -2,3 +2,4 @@
SHA512 (kernel-abi-stablelists-6.18.13.tar.xz) = 69bbcdd86ae7999b19de306c29bc5cef442e309a8b033900c10a206a97d61b8b4e6d7c6baf6d356daf14e85766bd6a31120b54cfd1eb1c773450e44bae5d2d9b
SHA512 (kernel-kabi-dw-6.18.13.tar.xz) = 6473ea636d813e602a59d7332255c4b4597032501a2ed0507985800500451065618a0b6909663e3dc8db2b75c6f4ba10d498dbc41a3b42758cae38f30ca13115
SHA512 (kernel-6.18.5.1.tar.gz) = 0d8c755e02857704eb4c4396657ad30b22b474296233b8681365aeaa2fc16926afe31f551e80f565e0d73318f2b7941051ec44f85ccbabaa28ba5a56022f9f4a
+SHA256 (open-gpu-kernel-modules-595.58.03.tar.gz) = e0c4659ddf15e4f4e19cee05b49f88c9ba08ef3add0dfe08249798f58d0fe75e
`specs/m/m17n-lib/m17n-lib.spec`--- committed/specs/m/m17n-lib/m17n-lib.spec
+++ rendered/specs/m/m17n-lib/m17n-lib.spec
@@ -2,7 +2,7 @@
## (rpmautospec version 0.8.3)
## RPMAUTOSPEC: autorelease, autochangelog
%define autorelease(e:s:pb:n) %{?-p:0.}%{lua:
- release_number = 3;
+ release_number = 4;
base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}"));
print(release_number + base_release_number - 1);
}%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}}
@@ -144,6 +144,9 @@
%changelog
## START: Generated by rpmautospec
+* Thu Apr 30 2026 reuben olinsky <reubeno@users.noreply.github.com> - 1.8.6-4
+- fix(m17n-lib): disable optional Anthy IME module
+
* Thu Apr 30 2026 Daniel McIlvaney <damcilva@microsoft.com> - 1.8.6-3
- feat: introduce deterministic commit resolution via Azure Linux lock file
Files to addThese files are produced by
|
c6d2e72 to
6b5ecc5
Compare
🔒❌ Lock files are out of date🚧🚧🚧🚧🚧 Warning Disregard this comment. Lock-file generation is still under development and checked-in 🚧🚧🚧🚧🚧 FIX: — run this and commit the result: azldev component update -p kernel -p mod_md -p systemtapOr download the fix patch and apply it: gh run download 25240248336 -R microsoft/azurelinux -n locks-patch
git apply locks.patchChanged components (3)
|
Merge Checklist
All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)
*-staticsubpackages, etc.) have had theirReleasetag incremented../cgmanifest.json,./toolkit/scripts/toolchain/cgmanifest.json,.github/workflows/cgmanifest.json)./LICENSES-AND-NOTICES/SPECS/data/licenses.json,./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md,./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)*.signatures.jsonfilessudo make go-tidy-allandsudo make go-test-coveragepassSummary
This PR introduces the first set of open-source kernel modules for Nvidia GPUs.
Change Log
Does this affect the toolchain?
NO
Associated issues
Links to CVEs
Test Methodology