mirror of
https://github.com/terrapkg/packages.git
synced 2026-05-31 09:01:55 +00:00
fix(nvidia): UX improvements (#5648)
* fix(nvidia): Automatically pull necessary 32-bit deps * feat: Fallback service and more
This commit is contained in:
@@ -1,11 +1,13 @@
|
||||
## NVIDIA DKMS package, based on the work of Negativo17 with tweaks for Terra.
|
||||
|
||||
# RPM inexplicably thinks this package deps on a version of libcrypto it does not?
|
||||
%global __requires_exclude (libcrypto\\.so\\.1\\.1.*)$
|
||||
%global debug_package %{nil}
|
||||
%global modulename nvidia
|
||||
|
||||
Name: dkms-%{modulename}
|
||||
Version: 575.64
|
||||
Release: 1%?dist
|
||||
Release: 2%?dist
|
||||
Summary: NVIDIA display driver kernel module
|
||||
Epoch: 3
|
||||
License: NVIDIA License
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
Name: libva-nvidia-driver
|
||||
Epoch: 1
|
||||
Version: 0.0.14%{!?tag:^%{date}git%{shortcommit0}}
|
||||
Release: 1%?dist
|
||||
Release: 2%?dist
|
||||
Summary: VA-API user mode driver for Nvidia GPUs
|
||||
License: MIT
|
||||
URL: https://github.com/elFarto/%{upstream_name}
|
||||
@@ -39,6 +39,11 @@ Provides: %{upstream_name} = %{version}-%{release}
|
||||
Provides: nvdec-vaapi-driver = %{version}-%{release}
|
||||
|
||||
Requires: mesa-filesystem
|
||||
%if 0%{?fedora}
|
||||
%ifarch x86_64
|
||||
Requires: %{name}(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description
|
||||
This is a VA-API implementation that uses NVDEC as a backend. This
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
|
||||
Name: nvidia-driver
|
||||
Version: 575.64
|
||||
Release: 1%?dist
|
||||
Release: 2%?dist
|
||||
Summary: NVIDIA's proprietary display driver for NVIDIA graphic cards
|
||||
Epoch: 3
|
||||
License: NVIDIA License
|
||||
@@ -48,6 +48,11 @@ BuildRequires: coreutils
|
||||
|
||||
Requires: nvidia-driver-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: nvidia-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
%if 0%{?fedora}
|
||||
%ifarch x86_64
|
||||
Requires: %{name}(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
Conflicts: nvidia-x11-drv
|
||||
Conflicts: nvidia-x11-drv-470xx
|
||||
@@ -74,6 +79,11 @@ Requires: libglvnd-glx%{?_isa} >= 1.0
|
||||
Requires: libglvnd-opengl%{?_isa} >= 1.0
|
||||
Requires: libnvidia-ml%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: vulkan-loader
|
||||
%if 0%{?fedora}
|
||||
%ifarch x86_64
|
||||
Requires: %{name}-libs(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%endif
|
||||
# dlopened
|
||||
Requires: libnvidia-gpucomp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: libnvidia-ml%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
@@ -95,6 +105,11 @@ Requires: libnvidia-ml = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%ifarch x86_64 aarch64
|
||||
Requires: libnvidia-cfg = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%if 0%{?fedora}
|
||||
%ifarch x86_64
|
||||
Requires: %{name}-cuda-libs(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%endif
|
||||
# dlopened:
|
||||
Requires: libnvidia-gpucomp%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Requires: libnvidia-ml = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
@@ -109,6 +124,11 @@ This package provides the CUDA libraries for %{name}-cuda.
|
||||
Summary: NVIDIA OpenGL-based Framebuffer Capture libraries
|
||||
Provides: nvidia-driver-NvFBCOpenGL = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Obsoletes: nvidia-driver-NvFBCOpenGL < %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%if 0%{?fedora}
|
||||
%ifarch x86_64
|
||||
Requires: libnvidia-fbc(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%endif
|
||||
# dlopened:
|
||||
Requires: %{name}-cuda-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
@@ -120,6 +140,11 @@ graphics scenarios.
|
||||
|
||||
%package -n libnvidia-gpucomp
|
||||
Summary: NVIDIA library for shader compilation (nvgpucomp)
|
||||
%if 0%{?fedora}
|
||||
%ifarch x86_64
|
||||
Requires: libnvidia-gpucomp(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%endif
|
||||
|
||||
%description -n libnvidia-gpucomp
|
||||
This package contains the private libnvidia-gpucomp runtime library which is used by
|
||||
@@ -129,6 +154,11 @@ other driver components.
|
||||
Summary: NVIDIA Management Library (NVML)
|
||||
Provides: cuda-nvml%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
Provides: nvidia-driver-NVML = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%if 0%{?fedora}
|
||||
%ifarch x86_64
|
||||
Requires: libnvidia-ml(x86-32) = %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
%endif
|
||||
%endif
|
||||
Obsoletes: nvidia-driver-NVML < %{?epoch:%{epoch}:}%{version}-%{release}
|
||||
|
||||
%description -n libnvidia-ml
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
SUBSYSTEM=="pci", ATTRS{vendor}=="0x12d2", ATTRS{class}=="0x030000", TAG+="systemd", ENV{SYSTEMD_WANTS}="nvidia-fallback.service"
|
||||
SUBSYSTEM=="pci", ATTRS{vendor}=="0x10de", ATTRS{class}=="0x030[02]00", TAG+="systemd", ENV{SYSTEMD_WANTS}="nvidia-fallback.service"
|
||||
@@ -0,0 +1,17 @@
|
||||
[Unit]
|
||||
Description=Fallback to nouveau as nvidia did not load
|
||||
After=akmods.service
|
||||
Before=display-manager.service
|
||||
ConditionKernelCommandLine=rd.driver.blacklist=nouveau
|
||||
ConditionPathExists=!/sys/module/nvidia
|
||||
|
||||
|
||||
[Service]
|
||||
Type=oneshot
|
||||
RemainAfterExit=yes
|
||||
ExecStart=-/sbin/modprobe nouveau
|
||||
ExecStartPost=-/bin/plymouth message --text="NVIDIA kernel module missing. Falling back to Nouveau."
|
||||
|
||||
|
||||
[Install]
|
||||
WantedBy=graphical.target
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
Name: nvidia-kmod-common
|
||||
Version: 575.64
|
||||
Release: 1%?dist
|
||||
Release: 2%?dist
|
||||
Summary: Common file for NVIDIA's proprietary driver kernel modules
|
||||
Epoch: 3
|
||||
License: NVIDIA License
|
||||
@@ -21,14 +21,19 @@ Source18: MODULE_VARIANT.txt
|
||||
Source19: nvidia-modeset.conf
|
||||
Source20: nvidia.conf
|
||||
Source21: 60-nvidia.rules
|
||||
Source22: nvidia-fallback.service
|
||||
Source23: 10-nvidia-fallback.rules
|
||||
|
||||
# UDev rule location (_udevrulesdir) and systemd macros:
|
||||
BuildRequires: systemd-rpm-macros
|
||||
|
||||
Requires: dracut
|
||||
Requires: nvidia-modprobe
|
||||
Requires: nvidia-driver = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: nvidia-driver-libs = %{?epoch:%{epoch}:}%{version}
|
||||
Requires: (nvidia-open-kmod = %{?epoch:%{epoch}:}%{version} or nvidia-kmod = %{?epoch:%{epoch}:}%{version})
|
||||
Provides: nvidia-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Provides: nvidia-open-kmod-common = %{?epoch:%{epoch}:}%{version}
|
||||
Obsoletes: cuda-nvidia-kmod-common < %{?epoch:%{epoch}:}%{version}
|
||||
|
||||
%description
|
||||
@@ -59,6 +64,11 @@ install -p -m 644 firmware/* %{buildroot}%{_prefix}/lib/firmware/nvidia/%{versio
|
||||
# Old kernel.conf rewritten as a doc file.
|
||||
cp %{SOURCE18} .
|
||||
|
||||
# Fallback service. Fall back to Nouveau if NVIDIA drivers fail.
|
||||
# This is actually from RPM Fusion.
|
||||
install -Dm644 %{SOURCE22} -t %{buildroot}%{_unitdir}
|
||||
install -Dm644 %{SOURCE23} -t %{buildroot}%{_udevrulesdir}
|
||||
|
||||
%pre
|
||||
# Remove the kernel command line adjustments one last time when doing an upgrade
|
||||
# from a version that was still setting up the command line parameters:
|
||||
@@ -77,7 +87,9 @@ dracut --regenerate-all --force
|
||||
%dir %{_prefix}/lib/firmware/nvidia
|
||||
%{_prefix}/lib/firmware/nvidia/%{version}
|
||||
%config(noreplace) %{_sysconfdir}/modprobe.d/nvidia-modeset.conf
|
||||
%{_udevrulesdir}/10-nvidia-fallback.rules
|
||||
%{_udevrulesdir}/60-nvidia.rules
|
||||
%{_unitdir}/nvidia-fallback.service
|
||||
|
||||
%changelog
|
||||
%autochangelog
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
# Nouveau must be blacklisted here as well beside from the initrd to avoid a
|
||||
# delayed loading (for example on Optimus laptops where the Nvidia card is not
|
||||
# driving the main display).
|
||||
# NOVA must be blacklisted as it conflicts with both these drivers and Nouveau.
|
||||
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user