Skip to content

Package Nvidia Open GPU Kernel Modules#16971

Open
ellie-di wants to merge 4 commits intotomls/base/mainfrom
edehghani/kmod-framework-for-kernel
Open

Package Nvidia Open GPU Kernel Modules#16971
ellie-di wants to merge 4 commits intotomls/base/mainfrom
edehghani/kmod-framework-for-kernel

Conversation

@ellie-di
Copy link
Copy Markdown
Contributor

Merge Checklist

All boxes should be checked before merging the PR (just tick any boxes which don't apply to this PR)

  • The toolchain has been rebuilt successfully (or no changes were made to it)
  • The toolchain/worker package manifests are up-to-date
  • Any updated packages successfully build (or no packages were changed)
  • Packages depending on static components modified in this PR (Golang, *-static subpackages, etc.) have had their Release tag incremented.
  • Package tests (%check section) have been verified with RUN_CHECK=y for existing SPEC files, or added to new SPEC files
  • All package sources are available
  • cgmanifest files are up-to-date and sorted (./cgmanifest.json, ./toolkit/scripts/toolchain/cgmanifest.json, .github/workflows/cgmanifest.json)
  • LICENSE-MAP files are up-to-date (./LICENSES-AND-NOTICES/SPECS/data/licenses.json, ./LICENSES-AND-NOTICES/SPECS/LICENSES-MAP.md, ./LICENSES-AND-NOTICES/SPECS/LICENSE-EXCEPTIONS.PHOTON)
  • All source files have up-to-date hashes in the *.signatures.json files
  • sudo make go-tidy-all and sudo make go-test-coverage pass
  • Documentation has been updated to match any changes to the build system
  • Ready to merge

Summary

This PR introduces the first set of open-source kernel modules for Nvidia GPUs.

Change Log
  • Change
  • Change
  • Change
Does this affect the toolchain?

NO

Associated issues
  • #xxxx
Links to CVEs
Test Methodology
  • Pipeline build id: xxxx

Copilot AI review requested due to automatic review settings April 30, 2026 17:49
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 a kmod-nvidia-open implementation (kmod-nvidia-open.inc + modprobe config).
  • Updates kernel.comp.toml to 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.

Comment thread docs/oss-kmod-packaging-strategy.md
Comment thread docs/oss-kmod-packaging-strategy.md
Comment thread docs/oss-kmod-packaging-strategy.md
Comment thread docs/oss-kmod-packaging-strategy.md
Comment thread base/comps/kernel/kmod-nvidia-open.inc Outdated
# 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
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
# Activated by: %{run_kmod_phase <phase>} from kmod-macros.inc
# Activated by: injecting %global _kmod_phase <phase> and directly %include-ing
# this .inc file

Copilot uses AI. Check for mistakes.
Comment thread base/comps/kernel/kmod-nvidia-open.inc Outdated
Comment on lines +91 to +102
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'
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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'

Copilot uses AI. Check for mistakes.
Comment thread base/comps/kernel/kmod-nvidia-open.inc Outdated
Comment on lines +99 to +102
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'
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread base/comps/kernel/kmod-nvidia-open.inc Outdated
Comment on lines +122 to +126
%post -n kmod-%{_kmod_name}
/usr/sbin/depmod -a %{KVERREL} || :

%postun -n kmod-%{_kmod_name}
/usr/sbin/depmod -a %{KVERREL} || :
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copilot uses AI. Check for mistakes.
Comment thread base/comps/kernel/kernel.comp.toml
Comment on lines +25 to +30
# 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" }
Copy link

Copilot AI Apr 30, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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).

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 30, 2026

📄❌ Rendered specs are out of date

🚧🚧🚧🚧🚧

Warning

Disregard this comment.

Spec rendering is still under development and checked-in specs
should not be updated in PRs yet.
Please ignore this comment for now unless you are actively
working on the render pipeline.

🚧🚧🚧🚧🚧

FIX: — run this and commit the result:

azldev component render -a --clean-stale

Or download the fix patch and apply it:

gh run download 25240248336 -R microsoft/azurelinux -n rendered-specs-patch
git apply rendered-specs.patch
Category Count
Content diffs 5
Extra files (untracked) 3
Missing files (deleted) 0

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 add

These files are produced by azldev component render but are missing from your branch. Add them.

  • specs/k/kernel/kmod-macros.inc
  • specs/k/kernel/kmod-nvidia-open-modprobe.conf
  • specs/k/kernel/kmod-nvidia-open.inc

@ellie-di ellie-di force-pushed the edehghani/kmod-framework-for-kernel branch from c6d2e72 to 6b5ecc5 Compare May 2, 2026 01:22
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 2, 2026

🔒❌ Lock files are out of date

🚧🚧🚧🚧🚧

Warning

Disregard this comment.

Lock-file generation is still under development and checked-in
lock files should not be updated in PRs yet.
Please ignore this comment for now unless you are actively
working on the update pipeline.

🚧🚧🚧🚧🚧

FIX: — run this and commit the result:

azldev component update -p kernel -p mod_md -p systemtap

Or download the fix patch and apply it:

gh run download 25240248336 -R microsoft/azurelinux -n locks-patch
git apply locks.patch

Changed components (3)

Component New upstream commit
kernel 5271a1b047ef402ddee40242e02eda23fc273044
mod_md fa660f75f0bfc0e0da238fb5c2ec2e51566b2426
systemtap a5c5bd1293b3c1d39c7f9a1c39370d7d7bd1e374

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants