Packaging templates for yum
and dnf
based Linux distros to build NVIDIA driver packages.
The main
branch contains this README. The .spec
, .conf
, and .sh
files can be found in the rhel7, rhel8, and fedora virtual branches.
note: Virtual branches point to the highest available driver branch. Please use the appropriate
XXX-rhel7
(RHEL7-like) orXXX
(Fedora/RHEL8-like) git branch to package older driver major versions.
- Overview
- Deliverables
- Packaging Guide
- Demo
- Prerequisites
- Building with script
- Building Manually
- Related
- See also
- Contributing
This repo contains the .spec
file used to build the following RPM packages:
note:
XXX
is the first.
delimited field in the driver version, ex:460
in460.32.03
- RHEL8 or Fedora streams:
XXX
,XXX-dkms
,latest
, andlatest-dkms
- nvidia-driver
- nvidia-driver-cuda
- nvidia-driver-cuda-libs
- nvidia-driver-devel
- nvidia-driver-libs
- nvidia-driver-NvFBCOpenGL
- nvidia-driver-NVML
For RHEL7 and derivatives, there are three sets of packages with different package dependencies.
The latest
and latest-dkms
flavors always update to the highest versioned driver, while the branch-XXX
flavor locks driver updates to the specified driver branch.
- RHEL7 flavor:
latest-dkms
- nvidia-driver-latest-dkms
- nvidia-driver-latest-dkms-cuda
- nvidia-driver-latest-dkms-cuda-libs
- nvidia-driver-latest-dkms-devel
- nvidia-driver-latest-dkms-libs
- nvidia-driver-latest-dkms-NvFBCOpenGL
- nvidia-driver-latest-dkms-NVML
note:
XXX-dkms
is not supported for RHEL7
To use the precompiled flavors latest
and branch-XXX
, use yum-packaging-precompiled-kmod to build kmod-nvidia-latest
or kmod-nvidia-branch-XXX
kernel modules for a specific kernel and driver combination.
- RHEL7 flavor:
latest
- nvidia-driver-latest
- nvidia-driver-latest-cuda
- nvidia-driver-latest-cuda-libs
- nvidia-driver-latest-devel
- nvidia-driver-latest-libs
- nvidia-driver-latest-NvFBCOpenGL
- nvidia-driver-latest-NVML
- RHEL7 flavor:
branch-XXX
- nvidia-driver-branch-XXX
- nvidia-driver-branch-XXX-cuda
- nvidia-driver-branch-XXX-cuda-libs
- nvidia-driver-branch-XXX-devel
- nvidia-driver-branch-XXX-libs
- nvidia-driver-branch-XXX-NvFBCOpenGL
- nvidia-driver-branch-XXX-NVML
note: this guide covers building all of the
yum-packaging
NVIDIA driver packages. To build only the deliverables in this repository, see Prerequisites and Building Manually sections.
Virtual branches: rhel7
, rhel8
& fedora
point to the latest branch
Supported branches: XXX-rhel7
(RHEL7-like) and XXX
(Fedora/RHEL8-like)
git clone -b ${branch} https://github.com/NVIDIA/yum-packaging-nvidia-driver
> ex: git clone -b 510 https://github.com/NVIDIA/yum-packaging-nvidia-driver
> ex: git clone -b 470-rhel7 https://github.com/NVIDIA/yum-packaging-nvidia-driver
# Misc
yum install libappstream-glib
# Packaging
yum install rpm-build
cd yum-packaging-nvidia-driver
git checkout remotes/origin/main -- build.sh
note: distro is
fedora33
,rhel7
,rhel8
./build.sh path/to/*.run ${distro}
> ex: time ./build.sh ~/Downloads/NVIDIA-Linux-x86_64-460.32.03.run rhel7
version="460.32.03"
export RUN_FILE="/path/to/NVIDIA-Linux-${arch}-${version}.run"
export VERSION="$version"
rm -rf temp
nvidia-generate-tarballs-${arch}.sh
ls *.tar.xz
> nvidia-driver-${version}-${arch}.tar.xz # x86_64 script does not have -${arch} suffix
> nvidia-driver-${version}-i386.tar.xz # 32-bit libraries for x86_64 only
> nvidia-kmod-${version}-${arch}.tar.xz # not used here
note:
fedora
&rhel8
-based distros
mkdir BUILD BUILDROOT RPMS SRPMS SOURCES SPECS
cp *.conf SOURCES/
cp nvidia-driver-${version}-${arch}.tar.xz SOURCES/
cp nvidia-driver.spec SPECS/
rpmbuild \
--define "%_topdir $(pwd)" \
--define "debug_package %{nil}" \
--define "version $version" \
--define "epoch 3" \
--target "${arch}" \
-v -bb SPECS/nvidia-driver.spec
note:
rhel7
-based distros
mkdir BUILD BUILDROOT RPMS SRPMS SOURCES SPECS
cp *.rules SOURCES/
cp *.conf SOURCES/
cp nvidia-driver-${version}-${arch}.tar.xz SOURCES/
cp nvidia-driver.spec SPECS/
# latest-dkms
rpmbuild \
--define "%_topdir $(pwd)" \
--define "debug_package %{nil}" \
--define "version $version" \
--define "driver_branch latest-dkms" \
--define "is_dkms 1" \
--define "is_latest 1" \
--define "epoch 3" \
--target "${arch}" \
-v -bb SPECS/nvidia-driver.spec
# latest
rpmbuild \
--define "%_topdir $(pwd)" \
--define "debug_package %{nil}" \
--define "version $version" \
--define "driver_branch latest" \
--define "is_dkms 0" \
--define "is_latest 1" \
--define "epoch 3" \
--target "${arch}" \
-v -bb SPECS/nvidia-driver.spec
# branch-460
rpmbuild \
--define "%_topdir $(pwd)" \
--define "debug_package %{nil}" \
--define "version $version" \
--define "driver_branch branch-460" \
--define "is_dkms 0" \
--define "is_latest 0" \
--define "epoch 3" \
--target "${arch}" \
-v -bb SPECS/nvidia-driver.spec
- nvidia-modprobe
- nvidia-persistenced
- dnf-plugin-nvidia & yum-plugin-nvidia
- Precompiled kernel modules
- nvidia-settings
- nvidia-xconfig
- negativo17
See CONTRIBUTING.md