Packaging templates for yum
and dnf
based Linux distros for Python plugin to manage NVIDIA driver precompiled kernel module packages.
The main
branch contains this README and a sample build script. The .spec
and nvidia.py
files can be found in the appropriate rhel7, rhel8, and fedora branches.
- Overview
- Deliverables
- Prerequisites
- Demo
- Building with script
- Building Manually
- Blocking kernel updates
- Other NVIDIA driver packages
- Contributing
This repo contains the .spec
file used to build the following RPM packages:
-
RHEL8 or Fedora
dnf-plugin-nvidia-${version}-${rel}.${dist}.noarch.rpm > ex: dnf-plugin-nvidia-2.0-1.el8.noarch.rpm
-
RHEL7
yum-plugin-nvidia-${version}-${rel}.${dist}.noarch.rpm > ex: yum-plugin-nvidia-0.5-1.el7.noarch.rpm
Supported branches: rhel7
, rhel8
& fedora
git clone -b ${branch} https://github.com/NVIDIA/yum-packaging-nvidia-plugin
> ex: git clone -b rhel8 https://github.com/NVIDIA/yum-packaging-nvidia-plugin
note: these are only needed for building not installation
# Python
yum install python36
# Packaging
yum install rpm-build
cd yum-packaging-nvidia-plugin
git checkout remotes/origin/main -- build.sh
./build.sh
mkdir BUILD BUILDROOT RPMS SRPMS SOURCES SPECS
cp nvidia-dnf.py SOURCES/
cp dnf-plugin-nvidia.spec SPECS/
rpmbuild \
--define "%_topdir $(pwd)" \
--define "debug_package %{nil}" \
--define "_python_sitelib $pythonLocation" \
-v -bb SPECS/dnf-plugin-nvidia.spec
> ex: rpmbuild \
--define "%_topdir $(pwd)" \
--define "debug_package %{nil}" \
--define "_python_sitelib /usr/lib/python3.6/site-packages" \
-v -bb SPECS/dnf-plugin-nvidia.spec
mkdir BUILD BUILDROOT RPMS SRPMS SOURCES SPECS
cp nvidia.conf SOURCES/
cp nvidia-yum.py SOURCES/
cp yum-plugin-nvidia.spec SPECS/
rpmbuild \
--define "%_topdir $(pwd)" \
--define "debug_package %{nil}" \
-v -bb SPECS/yum-plugin-nvidia.spec
If one does not already exist, generate a GPG key pair
gpg --generate-key
Set $gpgKey
to secret key ID.
gpgArgs="/usr/bin/gpg --force-v3-sigs --digest-algo=sha512 --no-verbose --no-armor --no-secmem-warning"
for package in RPMS/noarch/*-plugin-nvidia*.rpm; do
rpm \
--define "%_signature gpg" \
--define "%_gpg_name $gpgKey" \
--define "%__gpg /usr/bin/gpg" \
--define "%_gpg_digest_algo sha512" \
--define "%_binary_filedigest_algorithm 10" \
--define "%__gpg_sign_cmd %{__gpg} $gpgArgs -u %{_gpg_name} \
-sbo %{__signature_filename} %{__plaintext_filename}" \
--addsign "$package";
done
-
RHEL8 or Fedora
Kernel updates will be blocked in the absence of the availability of a compatible kmod package for that kernel and driver combination.The
kernel
andkernel-core
packages will be removed from suchdnf
transactions and an error message will be printed, ex:NOTE: Skipping kernel installation since no kernel module package kmod-nvidia-450.51.06-4.18.0-193.19.1 for kernel 4.18.0-193.19.1 and NVIDIA driver 450.51.06-1.el8.x86_64 could be found
-
RHEL8 or Fedora
Heuristic information can be printed via CLI, such as installed kernel, installed kmod packages, available kernels, available drivers, and available kmod packages.dnf nvidia-plugin
ex:
installed kernel: kernel-4.18.0-193.14.3.el8_2.x86_64
installed kmod(s): kmod-nvidia-450.51.06-4.18.0-193.14.3-3:450.51.06-2.el8_2.x86_64
available kernel(s): kernel-4.18.0-80.el8.x86_64 kernel-4.18.0-80.1.2.el8_0.x86_64 kernel-4.18.0-80.4.2.el8_0.x86_64 kernel-4.18.0-80.11.2.el8_0.x86_64 kernel-4.18.0-80.7.1.el8_0.x86_64 kernel-4.18.0-80.7.2.el8_0.x86_64 kernel-4.18.0-80.11.1.el8_0.x86_64 kernel-4.18.0-147.0.2.el8_1.x86_64 kernel-4.18.0-147.5.1.el8_1.x86_64 kernel-4.18.0-147.8.1.el8_1.x86_64 kernel-4.18.0-147.3.1.el8_1.x86_64 kernel-4.18.0-147.el8.x86_64 kernel-4.18.0-147.0.3.el8_1.x86_64 kernel-4.18.0-193.el8.x86_64 kernel-4.18.0-193.1.2.el8_2.x86_64 kernel-4.18.0-193.6.3.el8_2.x86_64 kernel-4.18.0-193.13.2.el8_2.x86_64 kernel-4.18.0-193.14.3.el8_2.x86_64 kernel-4.18.0-193.19.1.el8_2.x86_64
available kernel-core(s): kernel-core-4.18.0-80.el8.x86_64 kernel-core-4.18.0-80.4.2.el8_0.x86_64 kernel-core-4.18.0-80.1.2.el8_0.x86_64 kernel-core-4.18.0-80.11.2.el8_0.x86_64 kernel-core-4.18.0-147.el8.x86_64 kernel-core-4.18.0-80.11.1.el8_0.x86_64 kernel-core-4.18.0-80.7.2.el8_0.x86_64 kernel-core-4.18.0-80.7.1.el8_0.x86_64 kernel-core-4.18.0-147.8.1.el8_1.x86_64 kernel-core-4.18.0-147.5.1.el8_1.x86_64 kernel-core-4.18.0-147.0.3.el8_1.x86_64 kernel-core-4.18.0-147.3.1.el8_1.x86_64 kernel-core-4.18.0-147.0.2.el8_1.x86_64 kernel-core-4.18.0-193.el8.x86_64 kernel-core-4.18.0-193.1.2.el8_2.x86_64 kernel-core-4.18.0-193.6.3.el8_2.x86_64 kernel-core-4.18.0-193.13.2.el8_2.x86_64 kernel-core-4.18.0-193.14.3.el8_2.x86_64 kernel-core-4.18.0-193.19.1.el8_2.x86_64
available driver(s): nvidia-driver-3:455.23.05-1.el8.x86_64
available kmod(s): kmod-nvidia-455.23.05-4.18.0-193.19.1-3:455.23.05-2.el8_2.x86_64
note: more
git
repos with various.spec
files coming soon!
See CONTRIBUTING.md