feat: Change all NVIDIA driver specs to weekly to offset NVIDIA server issues (#6304) (#6305)

* feat: Change all NVIDIA driver specs to weekly to offset NVIDIA server issues

* fix: Aaaaa

* fix: AaaaaAAAAAAAA

* fix: AaaaaAAAAAAAAAAAAAAAAAAAA

* Delete anda/system/nvidia/nvidia-kmod-common/kernel.conf



* fix: AAAAAAAAAAAAAAAAAAAAAAAA

* fix: I'm losing it I tell ya

---------


(cherry picked from commit 7e6c617bd1)

Signed-off-by: Gilver <rockgrub@disroot.org>
Co-authored-by: Gilver <rockgrub@disroot.org>
This commit is contained in:
Raboneko
2025-09-03 23:15:18 -07:00
committed by GitHub
parent 11060ca3f7
commit 18e83f719e
19 changed files with 257 additions and 58 deletions
@@ -5,5 +5,6 @@ project pkg {
}
labels {
subrepo = "nvidia"
weekly = 1
}
}
@@ -4,5 +4,6 @@ project pkg {
}
labels {
subrepo = "nvidia"
weekly = 1
}
}
@@ -6,6 +6,6 @@ project "pkg" {
labels = {
subrepo = "nvidia"
mock = 1
nightly = 1
weekly = 1
}
}
@@ -41,7 +41,7 @@ Provides: nvdec-vaapi-driver = %{version}-%{release}
Requires: mesa-filesystem
%if 0%{?fedora}
%ifarch x86_64
Requires: %{name}(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
Requires: (%{name}(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release} if steam(x86-32))
%endif
%endif
@@ -73,31 +73,4 @@ decode of web content, and may not operate correctly in other applications.
%{_libdir}/dri/nvidia_drv_video.so
%changelog
* Sun Nov 10 2024 Simone Caronni <negativo17@gmail.com> - 1:0.0.13^20241108git259b7b7-1
- Update to latest snapshot.
- Drop no longer needed patch.
* Fri Oct 04 2024 Simone Caronni <negativo17@gmail.com> - 1:0.0.12^20240909git68efa33-2
- Update to latest snapshot.
- Add patch for 560/Wayland.
* Mon May 06 2024 Simone Caronni <negativo17@gmail.com> - 1:0.0.12-1
- Update to 0.0.12.
- Trim changelog.
- Clean up SPEC file, allow it to build for EL8.
* Wed Nov 08 2023 Simone Caronni <negativo17@gmail.com> - 0.0.11-1
- Update to 0.0.11.
- Rename to libva-nvidia-driver, as in main Fedora repository.
* Wed Jun 28 2023 Simone Caronni <negativo17@gmail.com> - 0.0.10-1
- Update to 0.0.10.
* Mon Mar 20 2023 Simone Caronni <negativo17@gmail.com> - 0.0.9-1.20230319gitc0a7f54
- Update to latest snapshot.
* Mon Feb 06 2023 Simone Caronni <negativo17@gmail.com> - 0.0.8-2.20230205git17c62b8
- Add latest fixes.
* Sat Feb 04 2023 Simone Caronni <negativo17@gmail.com> - 0.0.8-1.20230131git2bb71a5
- Rebase to latest snapshot.
%autochangelog
+2 -1
View File
@@ -9,5 +9,6 @@ project "pkg" {
labels = {
subrepo = "nvidia"
mock = 1
weekly = 1
}
}
}
@@ -0,0 +1,3 @@
# Omit the nvidia driver from the ramdisk, to avoid needing to regenerate
# the ramdisk on updates.
omit_drivers+=" nvidia nvidia_drm nvidia_modeset nvidia_peermem nvidia_uvm "
@@ -5,5 +5,6 @@ project "pkg" {
arches = ["x86_64"]
labels = {
subrepo = "nvidia"
weekly = 1
}
}
}
+207
View File
@@ -0,0 +1,207 @@
#!/usr/bin/sh
# EL8 (grub2 with BootLoaderSpec patches)
#
# kernel options: grub.cfg + grubenv + /etc/kernel/cmdline
# kernel options in /boot/loader/entries/*.conf use kernelopts from /boot/grub2/grubenv
# grubby
# - updates kernelopts in /boot/grub2/grubenv
# - does not update /etc/default/grub
# - does not update kernelopts in grub.cfg
# grub.cfg:
# - UEFI: /etc/grub2-efi.cfg -> /boot/efi/EFI/<os>/grub.cfg
# - BIOS: /etc/grub2.cfg -> /boot/grub2/grub.cfg
# EL9 + EL10 (grub2 with BootLoaderSpec patches)
#
# kernel options: grub.cfg + /etc/kernel/cmdline + /boot/loader/entries/*.conf
# manually update: /etc/default/grub + /etc/kernel/cmdline
# /etc/kernel/cmdline is not really used
# grub2-mkconfig does not update /boot/loader/entries/*.conf
# grub.cfg:
# - UEFI: /etc/grub2-efi.cfg -> /boot/efi/EFI/<os>/grub.cfg
# - BIOS: /etc/grub2.cfg -> /boot/grub2/grub.cfg
# Fedora (grub2 with BootLoaderSpec patches)
#
# kernel options: grub.cfg + /etc/kernel/cmdline + /boot/loader/entries/*.conf
# manually update: /etc/default/grub
# grub2-mkconfig:
# - updates /boot/loader/entries/*.conf
# - updates /etc/kernel/cmdline
# grub.cfg:
# - UEFI/BIOS: /boot/grub2/grub.cfg
# Fedora (systemd-boot)
#
# kernel options: grub.cfg + /boot/efi/loader/entries/*.conf (UEFI only)
# grubby as an updateloaderentries alias:
# - updates all entries in /boot/efi/loader/entries/*.conf
# - does not work with multiple parameters at once
# - does not update /etc/kernel/cmdline
# Complete use case coverage, regardless of boot loaders:
#
# - update options in /etc/default/grub
# - regenerate grub.cfg/grubenv
# - update options in /boot/{efi/}loader/entries/*.conf entries
# - update options in /etc/kernel/cmdline
# - cover both UEFI and BIOS case
CMDLINE_ARGS_NVIDIA="rd.driver.blacklist=nouveau rd.driver.blacklist=nova-core"
CMDLINE_ARGS_ALWAYS_REMOVE="nomodeset gfxpayload=vga=normal nouveau.modeset=0 nvidia-drm.modeset=1 nvidia-drm.fbdev=1 modprobe.blacklist=nouveau initcall_blacklist=simpledrm_platform_driver_init"
print_usage() {
cat <<EOF
Tool to add or remove kernel command line options required for proper operation of the Nvidia driver.
Its main use is to be called from the %post/%preun scripts of the Nvidia driver packages, but it can also be used in other contexts, for example in a kickstart file after the drivers have been already installed.
Boot loaders supported:
- grub 2 with BootLoaderSpec patches (el8, el9, fedora)
- systemd-boot (fedora)
Usage: nvidia-update-boot post|preun
post Adjust necessary kernel command line options
preun Remove all kernel command line options
EOF
}
check() {
if [ ! -f /run/ostree-booted ]; then
if [ -f /etc/default/grub ]; then
# Grub 2 is installed
if [ -d /sys/firmware/efi ]; then
GRUB_CFG=/etc/grub2-efi.cfg
else
GRUB_CFG=/etc/grub2.cfg
fi
# Grub 2 with BootLoaderSpec patches, different path than systemd-boot
BLS_ENTRIES=/boot/loader/entries
. /etc/default/grub
elif [ ! -f /etc/default/grub ] && [ -f /etc/kernel/cmdline ]; then
# systemd-boot is installed, differnt path than Grub 2 with BootLoaderSpec patches
BLS_ENTRIES=/boot/efi/loader/entries
else
echo "Nvidia driver setup: no bootloader configured. Please run 'nvidia-boot-update post' manually."
fi
fi
}
post() {
# Edit GRUB configuration file
if [ -v GRUB_CFG ]; then
if [ -z "${GRUB_CMDLINE_LINUX}" ]; then
echo GRUB_CMDLINE_LINUX=\""$CMDLINE_ARGS_NVIDIA"\" >> /etc/default/grub
else
for param in $CMDLINE_ARGS_NVIDIA; do
echo ${GRUB_CMDLINE_LINUX} | grep -q $param
[ $? -eq 1 ] && GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} ${param}"
done
for param in $CMDLINE_ARGS_ALWAYS_REMOVE; do
echo ${GRUB_CMDLINE_LINUX} | grep -q $param
[ $? -eq 0 ] && GRUB_CMDLINE_LINUX="$(echo ${GRUB_CMDLINE_LINUX} | sed -e "s/ $param//g")"
done
sed -i -e "s|^GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX=\"${GRUB_CMDLINE_LINUX}\"|g" /etc/default/grub
fi
grub2-mkconfig -o $GRUB_CFG &>/dev/null
fi
# Edit BootLoaderSpec entries
if [ -v BLS_ENTRIES ]; then
for config_file in $BLS_ENTRIES/*.conf; do
for param in $CMDLINE_ARGS_NVIDIA; do
grep -q $param $config_file
[ $? -eq 1 ] && sed -i -e "s|^options.*|& $param|" $config_file
done
for param in $CMDLINE_ARGS_ALWAYS_REMOVE; do
grep -q $param $config_file
[ $? -eq 0 ] && sed -i -e "s| $param||" $config_file
done
done
fi
# Edit /etc/kernel/cmdline
for param in $CMDLINE_ARGS_NVIDIA; do
grep -q $param /etc/kernel/cmdline
[ $? -eq 1 ] && sed -i -e "s|^.*|& $param|" /etc/kernel/cmdline
done
for param in $CMDLINE_ARGS_ALWAYS_REMOVE; do
grep -q $param /etc/kernel/cmdline
[ $? -eq 0 ] && sed -i -e "s| $param||" /etc/kernel/cmdline
done
}
preun() {
# Edit GRUB configuration file
if [ -v GRUB_CFG ]; then
for param in $CMDLINE_ARGS_NVIDIA; do
echo ${GRUB_CMDLINE_LINUX} | grep -q $param
[ $? -eq 0 ] && GRUB_CMDLINE_LINUX="$(echo ${GRUB_CMDLINE_LINUX} | sed -e "s/ $param//g")"
done
sed -i -e "s|^GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX=\"${GRUB_CMDLINE_LINUX}\"|g" /etc/default/grub
grub2-mkconfig -o $GRUB_CFG &>/dev/null
fi
# Edit BootLoaderSpec entries
if [ -v BLS_ENTRIES ]; then
for config_file in $BLS_ENTRIES/*.conf; do
for param in $CMDLINE_ARGS_NVIDIA; do
grep -q $param $config_file
[ $? -eq 0 ] && sed -i -e "s| $param||" $config_file
done
done
fi
# Edit /etc/kernel/cmdline
for param in $CMDLINE_ARGS_NVIDIA; do
grep -q $param /etc/kernel/cmdline
[ $? -eq 0 ] && sed -i -e "s| $param||" /etc/kernel/cmdline
done
}
case "$1" in
post)
check
post
exit 0
;;
preun)
check
preun
exit 0
;;
*)
print_usage
exit 0
;;
esac
@@ -1,5 +1,3 @@
%global _dracutopts_in rd.driver.blacklist=nouveau modprobe.blacklist=nouveau
%global _dracutopts_rm nomodeset gfxpayload=vga=normal nouveau.modeset=0 nvidia-drm.modeset=1 initcall_blacklist=simpledrm_platform_driver_init
%global _dracut_conf_d %{_prefix}/lib/dracut/dracut.conf.d
# gsp_*.bin: ELF 64-bit LSB executable, UCB RISC-V
@@ -8,7 +6,7 @@
Name: nvidia-kmod-common
Version: 580.82.07
Release: 1%?dist
Release: 2%?dist
Summary: Common file for NVIDIA's proprietary driver kernel modules
Epoch: 3
License: NVIDIA License
@@ -17,12 +15,12 @@ URL: http://www.nvidia.com/object/unix.html
BuildArch: noarch
Source0: http://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run
Source18: MODULE_VARIANT.txt
Source19: nvidia-modeset.conf
Source20: nvidia.conf
Source21: 60-nvidia.rules
Source22: nvidia-fallback.service
Source23: 10-nvidia-fallback.rules
Source16: MODULE_VARIANT.txt
Source17: nvidia-boot-update
Source18: nvidia-modeset.conf
Source19: nvidia.conf
Source20: 60-nvidia.rules
Source21: 99-nvidia.conf
# UDev rule location (_udevrulesdir) and systemd macros:
BuildRequires: systemd-rpm-macros
@@ -39,28 +37,37 @@ Obsoletes: cuda-nvidia-kmod-common < %{?epoch:%{epoch}:}%{version}
%description
This package provides the common files required by all NVIDIA kernel module
package variants.
%prep
sh %{SOURCE0} -x --target nvidia-kmod-%{version}-x86_64
%setup -T -D -n nvidia-kmod-%{version}-x86_64
%install
# Script for post/preun tasks
install -p -m 0755 -D %{SOURCE17} %{buildroot}%{_bindir}/nvidia-boot-update
# Nvidia modesetting support:
install -p -m 0644 -D %{SOURCE19} %{buildroot}%{_sysconfdir}/modprobe.d/nvidia-modeset.conf
install -p -m 0644 -D %{SOURCE18} %{buildroot}%{_sysconfdir}/modprobe.d/nvidia-modeset.conf
# Load nvidia-uvm, enable complete power management:
install -p -m 0644 -D %{SOURCE20} %{buildroot}%{_modprobedir}/nvidia.conf
install -p -m 0644 -D %{SOURCE19} %{buildroot}%{_modprobedir}/nvidia.conf
# Avoid Nvidia modules getting in the initrd:
install -p -m 0644 -D %{SOURCE21} %{buildroot}%{_dracut_conf_d}/99-nvidia.conf
# UDev rules
# https://github.com/NVIDIA/nvidia-modprobe/blob/master/modprobe-utils/nvidia-modprobe-utils.h#L33-L46
# https://github.com/negativo17/nvidia-kmod-common/issues/11
# https://github.com/negativo17/nvidia-driver/issues/27
install -p -m 644 -D %{SOURCE21} %{buildroot}%{_udevrulesdir}/60-nvidia.rules
install -p -m 644 -D %{SOURCE20} %{buildroot}%{_udevrulesdir}/60-nvidia.rules
# Firmware files:
mkdir -p %{buildroot}%{_prefix}/lib/firmware/nvidia/%{version}/
install -p -m 644 firmware/* %{buildroot}%{_prefix}/lib/firmware/nvidia/%{version}
%post
%{_bindir}/nvidia-boot-update post
# Old kernel.conf rewritten as a doc file.
cp %{SOURCE18} .
@@ -81,15 +88,14 @@ fi ||:
dracut --regenerate-all --force
%files
%doc MODULE_VARIANT.txt
%{_dracut_conf_d}/99-nvidia.conf
%{_modprobedir}/nvidia.conf
%dir %{_prefix}/lib/firmware
%dir %{_prefix}/lib/firmware/nvidia
%{_prefix}/lib/firmware/nvidia/%{version}
%{_bindir}/nvidia-boot-update
%config(noreplace) %{_sysconfdir}/modprobe.d/nvidia-modeset.conf
%dnl %{_udevrulesdir}/10-nvidia-fallback.rules
%{_udevrulesdir}/60-nvidia.rules
%dnl %{_unitdir}/nvidia-fallback.service
%changelog
%autochangelog
@@ -1,4 +1,4 @@
# Nvidia modesetting support. Set to 0 or comment to disable kernel modesetting
# support. This must be disabled in case of SLI Mosaic.
options nvidia-drm modeset=1 fbdev=1
options nvidia-drm modeset=1
@@ -5,17 +5,17 @@
blacklist nouveau
blacklist nova-core
# Make a soft dependency for nvidia-uvm as adding the module loading to
# /usr/lib/modules-load.d/nvidia-uvm.conf for systemd consumption, makes the
# Add soft dependencies for extra modules as adding the module loading to
# /usr/lib/modules-load.d/*.conf for systemd consumption, makes the
# configuration file to be added to the initrd but not the module, throwing an
# error on plymouth about not being able to find the module.
# Ref: /usr/lib/dracut/modules.d/00systemd/module-setup.sh
# Even adding the module is not the correct thing, as we don't want it to be
# Even adding the modules is not the correct thing, as we don't want it to be
# included in the initrd, so use this configuration file to specify the
# dependency.
softdep nvidia post: nvidia-uvm
softdep nvidia post: nvidia-uvm nvidia-drm
# Enable complete power management. From:
# file:///usr/share/doc/nvidia-driver/html/powermanagement.html
@@ -5,5 +5,6 @@ project "pkg" {
labels {
mock = 1
subrepo = "nvidia"
weekly =1
}
}
}
@@ -5,5 +5,6 @@ project "pkg" {
labels {
mock = 1
subrepo = "nvidia"
weekly = 1
}
}
+2 -1
View File
@@ -4,5 +4,6 @@ project "pkg" {
}
labels = {
subrepo = "nvidia"
weekly = 1
}
}
}
@@ -4,5 +4,6 @@ project "pkg" {
}
labels = {
subrepo = "nvidia"
weekly = 1
}
}
}
+2 -1
View File
@@ -4,5 +4,6 @@ project "pkg" {
}
labels = {
subrepo = "nvidia"
weekly = 1
}
}
}
+2 -1
View File
@@ -4,5 +4,6 @@ project "pkg" {
}
labels = {
subrepo = "nvidia"
weekly = 1
}
}
}