From 91cda402f011d41cfde555c6c3063e4d7f66ccec Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 15:20:33 +0700 Subject: [PATCH 01/23] add nvidia-kmod --- anda/system/nvidia/nvidia-kmod/anda.hcl | 5 + .../nvidia/nvidia-kmod/nvidia-kmod.spec | 202 ++++++++++++++++++ 2 files changed, 207 insertions(+) create mode 100644 anda/system/nvidia/nvidia-kmod/anda.hcl create mode 100644 anda/system/nvidia/nvidia-kmod/nvidia-kmod.spec diff --git a/anda/system/nvidia/nvidia-kmod/anda.hcl b/anda/system/nvidia/nvidia-kmod/anda.hcl new file mode 100644 index 0000000000..bc7f63b135 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod/anda.hcl @@ -0,0 +1,5 @@ +project "pkg" { + rpm { + spec = "nvidia-kmod.spec" + } +} \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-kmod/nvidia-kmod.spec b/anda/system/nvidia/nvidia-kmod/nvidia-kmod.spec new file mode 100644 index 0000000000..b3f00ffac3 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod/nvidia-kmod.spec @@ -0,0 +1,202 @@ +# Build only the akmod package and no kernel module packages: +%define buildforkernels akmod + +%global debug_package %{nil} + +Name: nvidia-kmod +Version: 565.77 +Release: 1%{?dist} +Summary: NVIDIA display driver kernel module +Epoch: 3 +License: NVIDIA License +URL: http://www.nvidia.com/object/unix.html +ExclusiveArch: x86_64 aarch64 + +Source0: http://download.nvidia.com/XFree86/Linux-%{_arch}/%{version}/NVIDIA-Linux-%{_arch}-%{version}.run + + +# Get the needed BuildRequires (in parts depending on what we build for): +BuildRequires: kmodtool + +# kmodtool does its magic here: +%{expand:%(kmodtool --target %{_target_cpu} --repo terra.fyralabs.com --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null) } + +%description +The NVidia %{version} display driver kernel module for kernel %{kversion}. + +%prep +# Error out if there was something wrong with kmodtool: +%{?kmodtool_check} +# Print kmodtool output for debugging purposes: +kmodtool --target %{_target_cpu} --repo terra.fyralabs.com --kmodname %{name} %{?buildforkernels:--%{buildforkernels}} %{?kernels:--for-kernels "%{?kernels}"} 2>/dev/null + +sh %{SOURCE0} -x --target nvidia-kmod-%{version}-%{_arch} +%setup -T -D -n nvidia-kmod-%{version}-%{_arch} + +rm -f */dkms.conf + +for kernel_version in %{?kernel_versions}; do + mkdir _kmod_build_${kernel_version%%___*} + cp -fr kernel* _kmod_build_${kernel_version%%___*} +done + +%build +if [ -f /etc/nvidia/kernel.conf ]; then + . /etc/nvidia/kernel.conf +fi +for kernel_version in %{?kernel_versions}; do + pushd _kmod_build_${kernel_version%%___*}/ + make %{?_smp_mflags} -C ${MODULE_VARIANT} \ + KERNEL_UNAME="${kernel_version%%___*}" modules + popd +done + +%install +if [ -f /etc/nvidia/kernel.conf ]; then + . /etc/nvidia/kernel.conf +fi +for kernel_version in %{?kernel_versions}; do + mkdir -p %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ + install -p -m 0755 _kmod_build_${kernel_version%%___*}/${MODULE_VARIANT}/*.ko \ + %{buildroot}/%{kmodinstdir_prefix}/${kernel_version%%___*}/%{kmodinstdir_postfix}/ +done +%{?akmod_install} + +%changelog +* Thu Dec 05 2024 Simone Caronni - 3:565.77-1 +- Update to 565.77. + +* Mon Nov 25 2024 Simone Caronni - 3:565.57.01-2 +- Add kernel 6.12 patch. + +* Wed Oct 23 2024 Simone Caronni - 3:565.57.01-1 +- Update to 565.57.01. + +* Fri Oct 11 2024 Simone Caronni - 3:560.35.03-2 +- Add kernel 6.11 patch. + +* Wed Aug 21 2024 Simone Caronni - 3:560.35.03-1 +- Update to 560.35.03. + +* Tue Aug 06 2024 Simone Caronni - 3:560.31.02-1 +- Update to 560.31.02. + +* Mon Aug 05 2024 Simone Caronni - 3:560.28.03-1 +- Update to 560.28.03. + +* Tue Jul 02 2024 Simone Caronni - 3:555.58.02-1 +- Update to 555.58.02. + +* Thu Jun 27 2024 Simone Caronni - 3:555.58-1 +- Update to 555.58. + +* Thu Jun 06 2024 Simone Caronni - 3:555.52.04-1 +- Update to 555.52.04. + +* Wed May 22 2024 Simone Caronni - 3:555.42.02-1 +- Update to 555.42.02. + +* Fri Apr 26 2024 Simone Caronni - 3:550.78-1 +- Update to 550.78. + +* Thu Apr 18 2024 Simone Caronni - 3:550.76-1 +- Update to 550.76. + +* Sun Mar 24 2024 Simone Caronni - 3:550.67-1 +- Update to 550.67. + +* Sat Mar 09 2024 Simone Caronni - 3:550.54.14-2 +- Enable aarch64. + +* Sun Mar 03 2024 Simone Caronni - 3:550.54.14-1 +- Update to 550.54.14. + +* Tue Feb 06 2024 Simone Caronni - 3:550.40.07-1 +- Update to 550.40.07. + +* Tue Feb 06 2024 Simone Caronni - 3:545.29.06-2 +- Add patch to fix build with the latest 6.6/6.7 kernels. + +* Fri Dec 01 2023 Simone Caronni - 3:545.29.06-1 +- Update to version 545.29.06. + +* Tue Nov 14 2023 Simone Caronni - 3:545.29.02-3 +- Update location of configuration file. + +* Mon Nov 13 2023 Simone Caronni - 3:545.29.02-2 +- Trim changelog. +- Drop custom signing and compressing in favour of kmodtool. +- Allow building proprietary or open source modules. +- Adjust compile command to match with what Nvidia ships nowadays. + +* Tue Oct 31 2023 Simone Caronni - 3:545.29.02-1 +- Update to 545.29.02. + +* Wed Oct 18 2023 Simone Caronni - 3:545.23.06-1 +- Update to 545.23.06. + +* Fri Sep 22 2023 Simone Caronni - 3:535.113.01-1 +- Update to 535.113.01. + +* Thu Aug 24 2023 Simone Caronni - 3:535.104.05-1 +- Update to 535.104.05. + +* Wed Aug 09 2023 Simone Caronni - 3:535.98-1 +- Update to 535.98. + +* Wed Jul 19 2023 Simone Caronni - 3:535.86.05-1 +- Update to 535.86.05. + +* Thu Jun 15 2023 Simone Caronni - 3:535.54.03-1 +- Update to 535.54.03. + +* Tue Jun 13 2023 Simone Caronni - 3:535.43.02-1 +- Update to 535.43.02. + +* Fri Mar 24 2023 Simone Caronni - 3:530.41.03-1 +- Update to 530.41.03. + +* Wed Mar 08 2023 Simone Caronni - 3:530.30.02-1 +- Update to 530.30.02. + +* Fri Feb 10 2023 Simone Caronni - 3:525.89.02-1 +- Update to 525.89.02. + +* Fri Jan 20 2023 Simone Caronni - 3:525.85.05-1 +- Update to 525.85.05. + +* Mon Jan 09 2023 Simone Caronni - 3:525.78.01-1 +- Update to 525.78.01. + +* Tue Nov 29 2022 Simone Caronni - 3:525.60.11-1 +- Update to 525.60.11. + +* Thu Oct 13 2022 Simone Caronni - 3:520.56.06-1 +- Update to 520.56.06. + +* Wed Sep 21 2022 Simone Caronni - 3:515.76-1 +- Update to 515.76. + +* Mon Aug 08 2022 Simone Caronni - 3:515.65.01-1 +- Update to 515.65.01. + +* Wed Jun 29 2022 Simone Caronni - 3:515.57-1 +- Update to 515.57. + +* Wed Jun 01 2022 Simone Caronni - 3:515.48.07-1 +- Update to 515.48.07. + +* Thu May 12 2022 Simone Caronni - 3:515.43.04-1 +- Update to 515.43.04. + +* Mon May 02 2022 Simone Caronni - 3:510.68.02-1 +- Update to 510.68.02. + +* Mon Mar 28 2022 Simone Caronni - 3:510.60.02-1 +- Update to 510.60.02. + +* Mon Feb 14 2022 Simone Caronni - 3:510.54-1 +- Update to 510.54. + +* Wed Feb 02 2022 Simone Caronni - 3:510.47.03-1 +- Update to 510.47.03. \ No newline at end of file From 0b04782867738e0fcb6d5c34b850079a39c8fe23 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 16:14:40 +0700 Subject: [PATCH 02/23] add settings, xsettings, mock label --- anda/system/nvidia/nvidia-kmod/anda.hcl | 3 + anda/system/nvidia/nvidia-settings/anda.hcl | 5 + .../nvidia-settings/nvidia-settings.spec | 409 ++++++++++++++++++ anda/system/nvidia/nvidia-xconfig/anda.hcl | 5 + .../nvidia/nvidia-xconfig/nvidia-xconfig.spec | 307 +++++++++++++ 5 files changed, 729 insertions(+) create mode 100644 anda/system/nvidia/nvidia-settings/anda.hcl create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings.spec create mode 100644 anda/system/nvidia/nvidia-xconfig/anda.hcl create mode 100644 anda/system/nvidia/nvidia-xconfig/nvidia-xconfig.spec diff --git a/anda/system/nvidia/nvidia-kmod/anda.hcl b/anda/system/nvidia/nvidia-kmod/anda.hcl index bc7f63b135..e03051a008 100644 --- a/anda/system/nvidia/nvidia-kmod/anda.hcl +++ b/anda/system/nvidia/nvidia-kmod/anda.hcl @@ -2,4 +2,7 @@ project "pkg" { rpm { spec = "nvidia-kmod.spec" } + labels { + mock = 1 + } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-settings/anda.hcl b/anda/system/nvidia/nvidia-settings/anda.hcl new file mode 100644 index 0000000000..0d936148e6 --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/anda.hcl @@ -0,0 +1,5 @@ +project "pkg" { + rpm { + spec = "nvidia-xconfig.spec" + } +} \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings.spec b/anda/system/nvidia/nvidia-settings/nvidia-settings.spec new file mode 100644 index 0000000000..b339593606 --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings.spec @@ -0,0 +1,409 @@ +Name: nvidia-settings +Version: 565.77 +Release: 1%{?dist} +Summary: Configure the NVIDIA graphics driver +Epoch: 3 +License: GPLv2+ +URL: http://www.nvidia.com/object/unix.html +ExclusiveArch: x86_64 aarch64 + +Source0: https://download.nvidia.com/XFree86/%{name}/%{name}-%{version}.tar.bz2 +Source1: %{name}-load.desktop +Source2: %{name}.appdata.xml +Patch0: %{name}-desktop.patch +Patch1: %{name}-lib-permissions.patch +Patch2: %{name}-link-order.patch +Patch3: %{name}-libXNVCtrl.patch +Patch4: %{name}-ld-dep-remove.patch + +BuildRequires: desktop-file-utils +BuildRequires: dbus-devel +BuildRequires: gcc +BuildRequires: jansson-devel +BuildRequires: libappstream-glib +BuildRequires: libvdpau-devel >= 1.0 +BuildRequires: libXxf86vm-devel +BuildRequires: libXext-devel +BuildRequires: libXrandr-devel +BuildRequires: libXv-devel +BuildRequires: m4 +BuildRequires: mesa-libEGL-devel +BuildRequires: mesa-libGL-devel +BuildRequires: pkgconfig(gtk+-3.0) +BuildRequires: pkgconfig(wayland-client) +BuildRequires: vulkan-headers + +Requires: nvidia-libXNVCtrl%{?_isa} = %{?epoch}:%{version}-%{release} +Requires: nvidia-driver%{?_isa} = %{?epoch}:%{version} +# Loaded at runtime +Requires: libvdpau%{?_isa} >= 0.9 + +%description +The %{name} utility is a tool for configuring the NVIDIA graphics +driver. It operates by communicating with the NVIDIA X driver, querying and +updating state as appropriate. + +This communication is done with the NV-CONTROL X extension. + +%package -n nvidia-libXNVCtrl +Summary: Library providing the NV-CONTROL API +Obsoletes: libXNVCtrl < %{?epoch}:%{version}-%{release} +Provides: libXNVCtrl = %{?epoch}:%{version}-%{release} + +%description -n nvidia-libXNVCtrl +This library provides the NV-CONTROL API for communicating with the proprietary +NVidia xorg driver. It is required for proper operation of the %{name} utility. + +%package -n nvidia-libXNVCtrl-devel +Summary: Development files for libXNVCtrl +Requires: nvidia-libXNVCtrl = %{?epoch}:%{version}-%{release} +Requires: libX11-devel + +%description -n nvidia-libXNVCtrl-devel +This devel package contains libraries and header files for +developing applications that use the NV-CONTROL API. + +%prep +%autosetup -p1 + +# Remove bundled jansson +rm -fr src/jansson + +# Remove additional CFLAGS added when enabling DEBUG +sed -i '/+= -O0 -g/d' utils.mk src/libXNVCtrl/utils.mk + +# Change all occurrences of destinations in each utils.mk. +sed -i -e 's|$(PREFIX)/lib|$(PREFIX)/%{_lib}|g' utils.mk src/libXNVCtrl/utils.mk + +%build +export CFLAGS="%{optflags} -fPIC" +export LDFLAGS="%{?__global_ldflags}" +make \ + DEBUG=1 \ + NV_USE_BUNDLED_LIBJANSSON=0 \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} \ + XNVCTRL_LDFLAGS="-L%{_libdir}" + +%install +# Install libXNVCtrl headers +mkdir -p %{buildroot}%{_includedir}/NVCtrl +cp -af src/libXNVCtrl/*.h %{buildroot}%{_includedir}/NVCtrl/ + +# Install main program +%make_install \ + DEBUG=1 \ + NV_USE_BUNDLED_LIBJANSSON=0 \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} + +# Install desktop file +mkdir -p %{buildroot}%{_datadir}/{applications,pixmaps} +desktop-file-install --dir %{buildroot}%{_datadir}/applications/ doc/%{name}.desktop +cp doc/%{name}.png %{buildroot}%{_datadir}/pixmaps/ + +# Install autostart file to load settings at login +install -p -D -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/xdg/autostart/%{name}-load.desktop + +# install AppData and add modalias provides +mkdir -p %{buildroot}%{_metainfodir}/ +install -p -m 0644 %{SOURCE2} %{buildroot}%{_metainfodir}/ + +%check +desktop-file-validate %{buildroot}/%{_datadir}/applications/%{name}.desktop +desktop-file-validate %{buildroot}%{_sysconfdir}/xdg/autostart/%{name}-load.desktop +appstream-util validate-relax --nonet %{buildroot}/%{_metainfodir}/%{name}.appdata.xml + +%files +%{_bindir}/%{name} +%{_metainfodir}/%{name}.appdata.xml +%{_datadir}/applications/%{name}.desktop +%{_datadir}/pixmaps/%{name}.png +%{_libdir}/libnvidia-gtk3.so.%{version} +%{_libdir}/libnvidia-wayland-client.so.%{version} +%{_mandir}/man1/%{name}.* +%{_sysconfdir}/xdg/autostart/%{name}-load.desktop + +%files -n nvidia-libXNVCtrl +%license COPYING +%{_libdir}/libXNVCtrl.so.* + +%files -n nvidia-libXNVCtrl-devel +%doc doc/NV-CONTROL-API.txt doc/FRAMELOCK.txt +%{_includedir}/NVCtrl +%{_libdir}/libXNVCtrl.so + +%changelog +* Thu Dec 05 2024 Simone Caronni - 3:565.77-1 +- Update to 565.77. + +* Wed Oct 23 2024 Simone Caronni - 3:565.57.01-1 +- Update to 565.57.01. + +* Wed Aug 21 2024 Simone Caronni - 3:560.35.03-1 +- Update to 560.35.03. + +* Tue Aug 06 2024 Simone Caronni - 3:560.31.02-1 +- Update to 560.31.02. + +* Mon Aug 05 2024 Simone Caronni - 3:560.28.03-1 +- Update to 560.28.03. + +* Tue Jul 02 2024 Simone Caronni - 3:555.58.02-1 +- Update to 555.58.02. + +* Thu Jun 27 2024 Simone Caronni - 3:555.58-1 +- Update to 555.58. + +* Thu Jun 06 2024 Simone Caronni - 3:555.52.04-1 +- Update to 555.52.04. + +* Wed May 22 2024 Simone Caronni - 3:555.42.02-1 +- Update to 555.42.02. + +* Tue Apr 30 2024 Simone Caronni - 3:550.78-2 +- Switch to Nvidia provided tarball. + +* Fri Apr 26 2024 Simone Caronni - 3:550.78-1 +- Update to 550.78. + +* Thu Apr 18 2024 Simone Caronni - 3:550.76-1 +- Update to 550.76. + +* Sun Mar 24 2024 Simone Caronni - 3:550.67-1 +- Update to 550.67. + +* Sat Mar 09 2024 Simone Caronni - 3:550.54.14-3 +- Enable aarch64. + +* Fri Mar 08 2024 Simone Caronni - 3:550.54.14-2 +- Add missing patch. + +* Sun Mar 03 2024 Simone Caronni - 3:550.54.14-1 +- Update to 550.54.14. + +* Tue Feb 06 2024 Simone Caronni - 3:550.40.07-1 +- Update to 550.40.07. + +* Fri Dec 01 2023 Simone Caronni - 3:545.29.06-1 +- Update to 545.29.06. + +* Tue Oct 31 2023 Simone Caronni - 3:545.29.02-1 +- Update to 545.29.02. + +* Wed Oct 18 2023 Simone Caronni - 3:545.23.06-1 +- Update to 545.23.06. + +* Fri Sep 22 2023 Simone Caronni - 3:535.113.01-1 +- Update to 535.113.01. + +* Thu Aug 24 2023 Simone Caronni - 3:535.104.05-1 +- Update to 535.104.05. + +* Wed Aug 09 2023 Simone Caronni - 3:535.98-1 +- Update to 535.98. + +* Wed Jul 19 2023 Simone Caronni - 3:535.86.05-1 +- Update to 535.86.05. + +* Thu Jun 15 2023 Simone Caronni - 3:535.54.03-1 +- Update to 535.54.03. + +* Tue Jun 13 2023 Simone Caronni - 3:535.43.02-1 +- Update to 535.43.02. + +* Fri Mar 24 2023 Simone Caronni - 3:530.41.03-1 +- Update to 530.41.03. + +* Wed Mar 08 2023 Simone Caronni - 3:530.30.02-1 +- Update to 530.30.02. + +* Fri Feb 10 2023 Simone Caronni - 3:525.89.02-1 +- Update to 525.89.02. + +* Fri Jan 20 2023 Simone Caronni - 3:525.85.05-1 +- Update to 525.85.05. + +* Mon Jan 09 2023 Simone Caronni - 3:525.78.01-1 +- Update to 525.78.01. + +* Tue Nov 29 2022 Simone Caronni - 3:525.60.11-1 +- Update to 525.60.11. +- Finally drop gtk2. + +* Thu Oct 13 2022 Simone Caronni - 3:520.56.06-1 +- Update to 520.56.06. + +* Wed Sep 21 2022 Simone Caronni - 3:515.76-1 +- Update to 515.76. + +* Mon Aug 08 2022 Simone Caronni - 3:515.65.01-1 +- Update to 515.65.01. + +* Wed Jun 29 2022 Simone Caronni - 3:515.57-1 +- Update to 515.57. + +* Wed Jun 01 2022 Simone Caronni - 3:515.48.07-1 +- Update to 515.48.07. + +* Thu May 12 2022 Simone Caronni - 3:515.43.04-1 +- Update to 515.43.04. +- Update SPEC file. +- Update patches from upstream. + +* Mon May 02 2022 Simone Caronni - 3:510.68.02-1 +- Update to 510.68.02. + +* Mon Mar 28 2022 Simone Caronni - 3:510.60.02-1 +- Update to 510.60.02. + +* Mon Feb 14 2022 Simone Caronni - 3:510.54-1 +- Update to 510.54. + +* Wed Feb 02 2022 Simone Caronni - 3:510.47.03-1 +- Update to 510.47.03. + +* Tue Dec 14 2021 Simone Caronni - 3:495.46-1 +- Update to 495.46. + +* Tue Nov 02 2021 Simone Caronni - 3:495.44-1 +- Update to 495.44. + +* Tue Nov 02 2021 Simone Caronni - 3:470.82.00-1 +- Update to 470.82.00. + +* Tue Sep 21 2021 Simone Caronni - 3:470.74-1 +- Update to 470.74. + +* Wed Aug 11 2021 Simone Caronni - 3:470.63.01-1 +- Update to 470.63.01. + +* Tue Jul 20 2021 Simone Caronni - 3:470.57.02-1 +- Update to 470.57.02. + +* Wed Jun 30 2021 Simone Caronni - 3:470.42.01-1 +- Update to 470.42.01. + +* Wed May 26 2021 Simone Caronni - 3:465.31-1 +- Update to 465.31. + +* Sat May 01 2021 Simone Caronni - 3:465.27-1 +- Update to 465.27. + +* Sun Apr 18 2021 Simone Caronni - 3:465.24.02-1 +- Update to 465.24.02. +- Switch to github sources. + +* Fri Apr 09 2021 Simone Caronni - 3:465.19.01-1 +- Update to 465.19.01. + +* Fri Mar 19 2021 Simone Caronni - 3:460.67-1 +- Update to 460.67. + +* Mon Mar 01 2021 Simone Caronni - 3:460.56-1 +- Update to 460.56. + +* Wed Jan 27 2021 Simone Caronni - 3:460.39-1 +- Update to 460.39. + +* Thu Jan 7 2021 Simone Caronni - 3:460.32.03-1 +- Update to 460.32.03. + +* Sun Dec 20 2020 Simone Caronni - 3:460.27.04-1 +- Update to 460.27.04. +- Trim changelog. + +* Mon Dec 07 2020 Simone Caronni - 3:455.45.01-2 +- Remove RHEL/CentOS 6 support. +- Do not generate AppData on CentOS/RHEL 7. + +* Wed Nov 18 2020 Simone Caronni - 3:455.45.01-1 +- Update to 455.45.01. + +* Mon Nov 02 2020 Simone Caronni - 3:455.38-1 +- Update to 455.38. + +* Mon Oct 12 2020 Simone Caronni - 3:455.28-1 +- Update to 455.28. + +* Tue Oct 06 2020 Simone Caronni - 3:450.80.02-1 +- Update to 450.80.02. + +* Thu Aug 20 2020 Simone Caronni - 3:450.66-1 +- Update to 450.66. + +* Fri Jul 10 2020 Simone Caronni - 3:450.57-1 +- Update to 450.57. + +* Thu Jun 25 2020 Simone Caronni - 3:440.100-1 +- Update to 440.100. + +* Thu Apr 09 2020 Simone Caronni - 3:440.82-1 +- Update to 440.82. + +* Sat Mar 14 2020 Simone Caronni - 3:440.64-2 +- Add patch for GCC 10. + +* Fri Feb 28 2020 Simone Caronni - 3:440.64-1 +- Update to 440.64. + +* Tue Feb 04 2020 Simone Caronni - 3:440.59-1 +- Update to 440.59. + +* Sat Dec 14 2019 Simone Caronni - 3:440.44-1 +- Update to 440.44. + +* Sat Nov 30 2019 Simone Caronni - 3:440.36-1 +- Update to 440.36. + +* Sun Nov 17 2019 Simone Caronni - 3:440.31-2 +- Fix full libXNVCtrl libraries instead of symlinks in CentOS/RHEL 6/7. + +* Sat Nov 09 2019 Simone Caronni - 3:440.31-1 +- Update to 440.31. + +* Thu Oct 17 2019 Simone Caronni - 3:440.26-1 +- Update to 440.26. + +* Mon Sep 02 2019 Simone Caronni - 3:435.21-1 +- Update to 435.21. + +* Thu Aug 22 2019 Simone Caronni - 3:435.17-1 +- Update to 435.17. + +* Wed Jul 31 2019 Simone Caronni - 3:430.40-1 +- Update to 430.40. +- Update AppData installation. + +* Fri Jul 12 2019 Simone Caronni - 3:430.34-1 +- Update to 430.34. + +* Tue Jun 18 2019 Simone Caronni - 3:430.26-3 +- Fix rpm message when upgrading from Fedora's libXNVCtrl. + +* Sun Jun 16 2019 Simone Caronni - 3:430.26-2 +- Revert libXNVCtrl soname to libXNVCtrl.so.0. + +* Wed Jun 12 2019 Simone Caronni - 3:430.26-1 +- Update to 430.26. +- Update patches. +- Update SPEC file. + +* Sat May 18 2019 Simone Caronni - 3:430.14-1 +- Update to 430.14. + +* Thu May 09 2019 Simone Caronni - 3:418.74-1 +- Update to 418.74. + +* Sun Mar 24 2019 Simone Caronni - 3:418.56-1 +- Update to 418.56. + +* Fri Feb 22 2019 Simone Caronni - 3:418.43-1 +- Update to 418.43. +- Trim changelog. + +* Wed Feb 06 2019 Simone Caronni - 3:418.30-1 +- Update to 418.30. + +* Thu Jan 17 2019 Simone Caronni - 3:415.27-1 +- Update to 415.27. \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-xconfig/anda.hcl b/anda/system/nvidia/nvidia-xconfig/anda.hcl new file mode 100644 index 0000000000..0d936148e6 --- /dev/null +++ b/anda/system/nvidia/nvidia-xconfig/anda.hcl @@ -0,0 +1,5 @@ +project "pkg" { + rpm { + spec = "nvidia-xconfig.spec" + } +} \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-xconfig/nvidia-xconfig.spec b/anda/system/nvidia/nvidia-xconfig/nvidia-xconfig.spec new file mode 100644 index 0000000000..d5d9f9fbda --- /dev/null +++ b/anda/system/nvidia/nvidia-xconfig/nvidia-xconfig.spec @@ -0,0 +1,307 @@ +Name: nvidia-xconfig +Version: 565.77 +Release: 1%{?dist} +Summary: NVIDIA X configuration file editor +Epoch: 3 +License: GPLv2+ +URL: http://www.nvidia.com/object/unix.html +ExclusiveArch: x86_64 aarch64 + +Source0: https://download.nvidia.com/XFree86/%{name}/%{name}-%{version}.tar.bz2 + +BuildRequires: gcc +BuildRequires: libpciaccess-devel +BuildRequires: m4 + +Requires: libnvidia-cfg%{?_isa} >= %{?epoch:%{epoch}:}%{version} +Requires: xorg-x11-nvidia%{?_isa} >= %{?epoch:%{epoch}:}%{version} + +%description +%{name} is a command line tool intended to provide basic control over +configuration options available in the NVIDIA X driver. + +%prep +%autosetup -p1 +# Remove additional CFLAGS added when enabling DEBUG +sed -i '/+= -O0 -g/d' utils.mk + +%build +export CFLAGS="%{optflags}" +export LDFLAGS="%{?__global_ldflags}" +make %{?_smp_mflags} \ + DEBUG=1 \ + MANPAGE_GZIP=0 \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} \ + STRIP_CMD=true + +%install +%make_install \ + MANPAGE_GZIP=0 \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} \ + STRIP_CMD=true + +%files +%license COPYING +%{_bindir}/%{name} +%{_mandir}/man1/%{name}.1* + +%changelog +* Thu Dec 05 2024 Simone Caronni - 3:565.77-1 +- Update to 565.77. + +* Wed Oct 23 2024 Simone Caronni - 3:565.57.01-1 +- Update to 565.57.01. + +* Sun Sep 01 2024 Simone Caronni - 3:560.35.03-2 +- Add requirement on xorg-x11-nvidia so package gets removed as well in case of + uninstallation of X.org components. + +* Wed Aug 21 2024 Simone Caronni - 3:560.35.03-1 +- Update to 560.35.03. + +* Tue Aug 06 2024 Simone Caronni - 3:560.31.02-1 +- Update to 560.31.02. + +* Mon Aug 05 2024 Simone Caronni - 3:560.28.03-1 +- Update to 560.28.03. + +* Tue Jul 02 2024 Simone Caronni - 3:555.58.02-1 +- Update to 555.58.02. +- Require dynamically loaded library libnvidia-cfg. + +* Thu Jun 27 2024 Simone Caronni - 3:555.58-1 +- Update to 555.58. + +* Thu Jun 06 2024 Simone Caronni - 3:555.52.04-1 +- Update to 555.52.04. + +* Wed May 22 2024 Simone Caronni - 3:555.42.02-1 +- Update to 555.42.02. + +* Tue Apr 30 2024 Simone Caronni - 3:550.78-2 +- Switch to Nvidia provided tarball. + +* Fri Apr 26 2024 Simone Caronni - 3:550.78-1 +- Update to 550.78. + +* Thu Apr 18 2024 Simone Caronni - 3:550.76-1 +- Update to 550.76. + +* Sun Mar 24 2024 Simone Caronni - 3:550.67-1 +- Update to 550.67. + +* Sat Mar 09 2024 Simone Caronni - 3:550.54.14-2 +- Enable aarch64. + +* Sun Mar 03 2024 Simone Caronni - 3:550.54.14-1 +- Update to 550.54.14. + +* Tue Feb 06 2024 Simone Caronni - 3:550.40.07-1 +- Update to 550.40.07. + +* Fri Dec 01 2023 Simone Caronni - 3:545.29.06-1 +- Update to 545.29.06. + +* Tue Oct 31 2023 Simone Caronni - 3:545.29.02-1 +- Update to 545.29.02. + +* Wed Oct 18 2023 Simone Caronni - 3:545.23.06-1 +- Update to 545.23.06. + +* Fri Sep 22 2023 Simone Caronni - 3:535.113.01-1 +- Update to 535.113.01. + +* Thu Aug 24 2023 Simone Caronni - 3:535.104.05-1 +- Update to 535.104.05. + +* Wed Aug 09 2023 Simone Caronni - 3:535.98-1 +- Update to 535.98. + +* Wed Jul 19 2023 Simone Caronni - 3:535.86.05-1 +- Update to 535.86.05. + +* Thu Jun 15 2023 Simone Caronni - 3:535.54.03-1 +- Update to 535.54.03. + +* Tue Jun 13 2023 Simone Caronni - 3:535.43.02-1 +- Update to 535.43.02. + +* Fri Mar 24 2023 Simone Caronni - 3:530.41.03-1 +- Update to 530.41.03. + +* Wed Mar 08 2023 Simone Caronni - 3:530.30.02-1 +- Update to 530.30.02. + +* Fri Feb 10 2023 Simone Caronni - 3:525.89.02-1 +- Update to 525.89.02. + +* Fri Jan 20 2023 Simone Caronni - 3:525.85.05-1 +- Update to 525.85.05. + +* Mon Jan 09 2023 Simone Caronni - 3:525.78.01-1 +- Update to 525.78.01. + +* Tue Nov 29 2022 Simone Caronni - 3:525.60.11-1 +- Update to 525.60.11. + +* Thu Oct 13 2022 Simone Caronni - 3:520.56.06-1 +- Update to 520.56.06. + +* Wed Sep 21 2022 Simone Caronni - 3:515.76-1 +- Update to 515.76. + +* Mon Aug 08 2022 Simone Caronni - 3:515.65.01-1 +- Update to 515.65.01. + +* Wed Jun 29 2022 Simone Caronni - 3:515.57-1 +- Update to 515.57. + +* Wed Jun 01 2022 Simone Caronni - 3:515.48.07-1 +- Update to 515.48.07. + +* Thu May 12 2022 Simone Caronni - 3:515.43.04-1 +- Update to 515.43.04. +- Add upstream patch. + +* Mon May 02 2022 Simone Caronni - 3:510.68.02-1 +- Update to 510.68.02. + +* Mon Mar 28 2022 Simone Caronni - 3:510.60.02-1 +- Update to 510.60.02. + +* Mon Feb 14 2022 Simone Caronni - 3:510.54-1 +- Update to 510.54. + +* Wed Feb 02 2022 Simone Caronni - 3:510.47.03-1 +- Update to 510.47.03. + +* Tue Dec 14 2021 Simone Caronni - 3:495.46-1 +- Update to 495.46. + +* Tue Nov 02 2021 Simone Caronni - 3:495.44-1 +- Update to 495.44. + +* Tue Nov 02 2021 Simone Caronni - 3:470.82.00-1 +- Update to 470.82.00. + +* Tue Sep 21 2021 Simone Caronni - 3:470.74-1 +- Update to 470.74. + +* Wed Aug 11 2021 Simone Caronni - 3:470.63.01-1 +- Update to 470.63.01. + +* Tue Jul 20 2021 Simone Caronni - 3:470.57.02-1 +- Update to 470.57.02. + +* Wed Jun 30 2021 Simone Caronni - 3:470.42.01-1 +- Update to 470.42.01. + +* Wed May 26 2021 Simone Caronni - 3:465.31-1 +- Update to 465.31. + +* Sat May 01 2021 Simone Caronni - 3:465.27-1 +- Update to 465.27. + +* Sun Apr 18 2021 Simone Caronni - 3:465.24.02-1 +- Update to 465.24.02. +- Switch to github sources. + +* Fri Apr 09 2021 Simone Caronni - 3:465.19.01-1 +- Update to 465.19.01. + +* Fri Mar 19 2021 Simone Caronni - 3:460.67-1 +- Update to 460.67. + +* Mon Mar 01 2021 Simone Caronni - 3:460.56-1 +- Update to 460.56. + +* Wed Jan 27 2021 Simone Caronni - 3:460.39-1 +- Update to 460.39. + +* Thu Jan 7 2021 Simone Caronni - 3:460.32.03-1 +- Update to 460.32.03. + +* Sun Dec 20 2020 Simone Caronni - 3:460.27.04-1 +- Update to 460.27.04. +- Trim changelog. + +* Mon Dec 07 2020 Simone Caronni - 3:455.45.01-2 +- Remove unused patch, use autoseptup macro. + +* Wed Nov 18 2020 Simone Caronni - 3:455.45.01-1 +- Update to 455.45.01. + +* Mon Nov 02 2020 Simone Caronni - 3:455.38-1 +- Update to 455.38. + +* Mon Oct 12 2020 Simone Caronni - 3:455.28-1 +- Update to 455.28. + +* Tue Oct 06 2020 Simone Caronni - 3:450.80.02-1 +- Update to 450.80.02. + +* Thu Aug 20 2020 Simone Caronni - 3:450.66-1 +- Update to 450.66. + +* Fri Jul 10 2020 Simone Caronni - 3:450.57-1 +- Update to 450.57. + +* Thu Jun 25 2020 Simone Caronni - 3:440.100-1 +- Update to 440.100. + +* Thu Apr 09 2020 Simone Caronni - 3:440.82-1 +- Update to 440.82. + +* Fri Feb 28 2020 Simone Caronni - 3:440.64-1 +- Update to 440.64. + +* Tue Feb 04 2020 Simone Caronni - 3:440.59-1 +- Update to 440.59. + +* Sat Dec 14 2019 Simone Caronni - 3:440.44-1 +- Update to 440.44. + +* Sat Nov 30 2019 Simone Caronni - 3:440.36-1 +- Update to 440.36. + +* Sat Nov 09 2019 Simone Caronni - 3:440.31-1 +- Update to 440.31. + +* Thu Oct 17 2019 Simone Caronni - 3:440.26-1 +- Update to 440.26. + +* Mon Sep 02 2019 Simone Caronni - 3:435.21-1 +- Update to 435.21. + +* Thu Aug 22 2019 Simone Caronni - 3:435.17-1 +- Update to 435.17. + +* Wed Jul 31 2019 Simone Caronni - 3:430.40-1 +- Update to 430.40. + +* Fri Jul 12 2019 Simone Caronni - 3:430.34-1 +- Update to 430.34. + +* Wed Jun 12 2019 Simone Caronni - 3:430.26-1 +- Update to 430.26. + +* Sat May 18 2019 Simone Caronni - 3:430.14-1 +- Update to 430.14. + +* Thu May 09 2019 Simone Caronni - 3:418.74-1 +- Update to 418.74. + +* Sun Mar 24 2019 Simone Caronni - 3:418.56-1 +- Update to 418.56. + +* Fri Feb 22 2019 Simone Caronni - 3:418.43-1 +- Update to 418.43. +- Trim changelog. + +* Wed Feb 06 2019 Simone Caronni - 3:418.30-1 +- Update to 418.30. + +* Thu Jan 17 2019 Simone Caronni - 3:415.27-1 +- Update to 415.27. \ No newline at end of file From d389d33aaf49a2696f876218eab14b12e92fe36a Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 16:16:25 +0700 Subject: [PATCH 03/23] oops --- anda/system/nvidia/nvidia-settings/anda.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/system/nvidia/nvidia-settings/anda.hcl b/anda/system/nvidia/nvidia-settings/anda.hcl index 0d936148e6..7ad058454f 100644 --- a/anda/system/nvidia/nvidia-settings/anda.hcl +++ b/anda/system/nvidia/nvidia-settings/anda.hcl @@ -1,5 +1,5 @@ project "pkg" { rpm { - spec = "nvidia-xconfig.spec" + spec = "nvidia-settings.spec" } } \ No newline at end of file From 9d0e2bc560ed092ce0f171eb12a3aeb2d5ff5b48 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 17:06:19 +0700 Subject: [PATCH 04/23] add nvidia setting assets --- .../nvidia-settings-desktop.patch | 18 ++++ .../nvidia-settings-ld-dep-remove.patch | 12 +++ .../nvidia-settings-lib-permissions.patch | 24 +++++ .../nvidia-settings-libXNVCtrl.patch | 97 +++++++++++++++++++ .../nvidia-settings-link-order.patch | 60 ++++++++++++ .../nvidia-settings-load.desktop | 8 ++ .../nvidia-settings.appdata.xml | 57 +++++++++++ 7 files changed, 276 insertions(+) create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings-desktop.patch create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings-ld-dep-remove.patch create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings-lib-permissions.patch create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings-libXNVCtrl.patch create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings-link-order.patch create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings-load.desktop create mode 100644 anda/system/nvidia/nvidia-settings/nvidia-settings.appdata.xml diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings-desktop.patch b/anda/system/nvidia/nvidia-settings/nvidia-settings-desktop.patch new file mode 100644 index 0000000000..9ea63a8c5e --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings-desktop.patch @@ -0,0 +1,18 @@ +diff -Naur nvidia-settings-530.30.02/doc/nvidia-settings.desktop nvidia-settings-530.30.02.old/doc/nvidia-settings.desktop +--- nvidia-settings-530.30.02/doc/nvidia-settings.desktop 2023-03-08 13:01:39.749406623 +0100 ++++ nvidia-settings-530.30.02.old/doc/nvidia-settings.desktop 2023-03-08 13:02:50.950572460 +0100 +@@ -1,11 +1,11 @@ + [Desktop Entry] + Type=Application +-Encoding=UTF-8 + Name=NVIDIA X Server Settings + Comment=Configure NVIDIA X Server Settings +-Exec=__UTILS_PATH__/nvidia-settings ++Exec=nvidia-settings + Icon=nvidia-settings +-Categories=__NVIDIA_SETTINGS_DESKTOP_CATEGORIES__ ++Categories=System;Settings ++Keywords=nvidia;vulkan;opengl;driver + + # Translation by Marcin Mikołajczak + Name[pl]=Ustawienia serwera X NVIDIA diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings-ld-dep-remove.patch b/anda/system/nvidia/nvidia-settings/nvidia-settings-ld-dep-remove.patch new file mode 100644 index 0000000000..3af69b6d21 --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings-ld-dep-remove.patch @@ -0,0 +1,12 @@ +Index: nvidia-settings-545.13/utils.mk +=================================================================== +--- nvidia-settings-545.13.orig/utils.mk ++++ nvidia-settings-545.13/utils.mk +@@ -584,7 +584,6 @@ define READ_ONLY_OBJECT_FROM_FILE_RULE + $(at_if_quiet)$$(MKDIR) $$(OUTPUTDIR) + $(at_if_quiet)cd $$(dir $(1)); \ + $$(call quiet_cmd_no_at,LD) -r -z noexecstack --format=binary \ +- $$(LD_TARGET_EMULATION_FLAG) \ + $$(notdir $(1)) -o $$(OUTPUTDIR_ABSOLUTE)/$$(notdir $$@) + $$(call quiet_cmd,OBJCOPY) \ + --rename-section .data=.rodata,contents,alloc,load,data,readonly \ diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings-lib-permissions.patch b/anda/system/nvidia/nvidia-settings/nvidia-settings-lib-permissions.patch new file mode 100644 index 0000000000..6f98c875bf --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings-lib-permissions.patch @@ -0,0 +1,24 @@ +diff -Naur nvidia-settings-525.60.11.old/src/libXNVCtrl/utils.mk nvidia-settings-525.60.11/src/libXNVCtrl/utils.mk +--- nvidia-settings-525.60.11.old/src/libXNVCtrl/utils.mk 2022-12-01 07:56:28.691047034 +0100 ++++ nvidia-settings-525.60.11/src/libXNVCtrl/utils.mk 2022-12-01 07:56:49.882413208 +0100 +@@ -92,7 +92,7 @@ + + INSTALL ?= install + INSTALL_BIN_ARGS ?= -m 755 +-INSTALL_LIB_ARGS ?= -m 644 ++INSTALL_LIB_ARGS ?= -m 755 + INSTALL_DOC_ARGS ?= -m 644 + + M4 ?= m4 +diff -Naur nvidia-settings-525.60.11.old/utils.mk nvidia-settings-525.60.11/utils.mk +--- nvidia-settings-525.60.11.old/utils.mk 2022-12-01 07:56:28.651046343 +0100 ++++ nvidia-settings-525.60.11/utils.mk 2022-12-01 07:56:49.883413225 +0100 +@@ -92,7 +92,7 @@ + + INSTALL ?= install + INSTALL_BIN_ARGS ?= -m 755 +-INSTALL_LIB_ARGS ?= -m 644 ++INSTALL_LIB_ARGS ?= -m 755 + INSTALL_DOC_ARGS ?= -m 644 + + M4 ?= m4 diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings-libXNVCtrl.patch b/anda/system/nvidia/nvidia-settings/nvidia-settings-libXNVCtrl.patch new file mode 100644 index 0000000000..3661d8c6f5 --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings-libXNVCtrl.patch @@ -0,0 +1,97 @@ +diff -Naur nvidia-settings-525.60.11.old/src/libXNVCtrl/Makefile nvidia-settings-525.60.11/src/libXNVCtrl/Makefile +--- nvidia-settings-525.60.11.old/src/libXNVCtrl/Makefile 2022-12-01 07:56:28.691047034 +0100 ++++ nvidia-settings-525.60.11/src/libXNVCtrl/Makefile 2022-12-01 08:02:18.889098255 +0100 +@@ -49,9 +49,10 @@ + ############################################################################## + + .PHONY: all +-all: $(LIBXNVCTRL) ++all: $(LIBXNVCTRL_SHARED) + + .PHONY: clean + clean: + rm -rf $(LIBXNVCTRL) *~ \ + $(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d ++ rm -f $(LIBXNVCTRL_SHARED) $(LIBXNVCTRL_SHARED).* +diff -Naur nvidia-settings-525.60.11.old/src/libXNVCtrl/xnvctrl.mk nvidia-settings-525.60.11/src/libXNVCtrl/xnvctrl.mk +--- nvidia-settings-525.60.11.old/src/libXNVCtrl/xnvctrl.mk 2022-12-01 07:56:28.691047034 +0100 ++++ nvidia-settings-525.60.11/src/libXNVCtrl/xnvctrl.mk 2022-12-01 08:02:18.934099033 +0100 +@@ -39,6 +39,8 @@ + + LIBXNVCTRL = $(OUTPUTDIR)/libXNVCtrl.a + ++LIBXNVCTRL_SHARED = $(OUTPUTDIR)/libXNVCtrl.so ++ + LIBXNVCTRL_SRC = $(XNVCTRL_DIR)/NVCtrl.c + + LIBXNVCTRL_OBJ = $(call BUILD_OBJECT_LIST,$(LIBXNVCTRL_SRC)) +@@ -47,3 +49,9 @@ + + $(LIBXNVCTRL) : $(LIBXNVCTRL_OBJ) + $(call quiet_cmd,AR) ru $@ $(LIBXNVCTRL_OBJ) ++ ++$(LIBXNVCTRL_SHARED): $(LIBXNVCTRL_OBJ) ++ $(RM) $@ $@.* ++ $(CC) -shared -Wl,-soname=$(@F).0 -o $@.0.0.0 $(LDFLAGS) $^ -lXext -lX11 ++ ln -s $(@F).0.0.0 $@.0 ++ ln -s $(@F).0 $@ +diff -Naur nvidia-settings-525.60.11.old/src/Makefile nvidia-settings-525.60.11/src/Makefile +--- nvidia-settings-525.60.11.old/src/Makefile 2022-12-01 08:02:11.280966791 +0100 ++++ nvidia-settings-525.60.11/src/Makefile 2022-12-01 08:02:59.233795388 +0100 +@@ -303,7 +303,11 @@ + all: $(NVIDIA_SETTINGS) $(GTK2LIB) $(GTK3LIB) $(WAYLANDLIB) + + .PHONY: install +-install: NVIDIA_SETTINGS_install NVIDIA_GTKLIB_install WAYLAND_LIB_install ++install: NVIDIA_SETTINGS_install NVIDIA_GTKLIB_install WAYLAND_LIB_install NVIDIA_XNVCTRL_install ++ ++NVIDIA_XNVCTRL_install: ++ $(MKDIR) $(LIBDIR) ++ cp -a $(LIBXNVCTRL_SHARED)* $(LIBDIR) + + .PHONY: NVIDIA_GTKLIB_install + NVIDIA_GTKLIB_install: $(GTK2LIB) $(GTK3LIB) +@@ -329,28 +333,28 @@ + $(INSTALL) $(INSTALL_BIN_ARGS) $< $(BINDIR)/$(notdir $<) + + $(eval $(call DEBUG_INFO_RULES, $(NVIDIA_SETTINGS))) +-$(NVIDIA_SETTINGS).unstripped: $(OBJS) $(LIBXNVCTRL) ++$(NVIDIA_SETTINGS).unstripped: $(OBJS) $(LIBXNVCTRL_SHARED) + $(call quiet_cmd,LINK) $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \ +- -rdynamic -o $@ $(OBJS) $(LIBXNVCTRL) $(LIBS) ++ -rdynamic -o $@ $(OBJS) $(LIBXNVCTRL_SHARED) $(LIBS) + + ifdef BUILD_GTK2LIB + $(eval $(call DEBUG_INFO_RULES, $(GTK2LIB))) +-$(GTK2LIB).unstripped: $(LIBXNVCTRL) $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK) ++$(GTK2LIB).unstripped: $(LIBXNVCTRL_SHARED) $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK) + $(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \ + -o $@ \ + -Wl,-soname -Wl,$(GTK2LIB_SONAME) \ + $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS) \ +- $(LIBXNVCTRL) $(LIBS) $(GTK2_LIBS) ++ $(LIBXNVCTRL_SHARED) $(LIBS) $(GTK2_LIBS) + endif + + ifdef BUILD_GTK3LIB + $(eval $(call DEBUG_INFO_RULES, $(GTK3LIB))) +-$(GTK3LIB).unstripped: $(LIBXNVCTRL) $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK) ++$(GTK3LIB).unstripped: $(LIBXNVCTRL_SHARED) $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK) + $(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \ + -o $@ \ + -Wl,-soname -Wl,$(GTK3LIB_SONAME) \ + $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) \ +- $(LIBXNVCTRL) $(LIBS) $(GTK3_LIBS) ++ $(LIBXNVCTRL_SHARED) $(LIBS) $(GTK3_LIBS) + endif + + ifdef BUILD_WAYLANDLIB +@@ -379,7 +383,7 @@ + $(OUTPUTDIR)/*.o $(OUTPUTDIR)/*.d \ + $(GTK2LIB) $(GTK3LIB) $(GTK2LIB_DIR) $(GTK3LIB_DIR) \ + $(WAYLANDLIB) $(WAYLANDLIB_DIR) \ +- $(IMAGE_HEADERS) $(LIBXNVCTRL) ++ $(IMAGE_HEADERS) $(LIBXNVCTRL_SHARED) + + ifdef BUILD_GTK2LIB + $(foreach src,$(GTK_SRC), \ diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings-link-order.patch b/anda/system/nvidia/nvidia-settings/nvidia-settings-link-order.patch new file mode 100644 index 0000000000..b8fffa9e45 --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings-link-order.patch @@ -0,0 +1,60 @@ +diff -Naur nvidia-settings-525.60.11.old/src/Makefile nvidia-settings-525.60.11/src/Makefile +--- nvidia-settings-525.60.11.old/src/Makefile 2022-12-01 07:56:28.657046446 +0100 ++++ nvidia-settings-525.60.11/src/Makefile 2022-12-01 08:01:09.920906524 +0100 +@@ -60,7 +60,7 @@ + endif + + ifndef GTK2_LDFLAGS +- GTK2_LDFLAGS := -Wl,--no-as-needed $(shell $(PKG_CONFIG) --libs gtk+-2.0) ++ GTK2_LDFLAGS := $(shell $(PKG_CONFIG) --libs gtk+-2.0) + endif + else + GTK2_CFLAGS ?= +@@ -82,7 +82,7 @@ + endif + + ifndef GTK3_LDFLAGS +- GTK3_LDFLAGS := -Wl,--no-as-needed $(shell $(PKG_CONFIG) --libs gtk+-3.0) ++ GTK3_LDFLAGS := $(shell $(PKG_CONFIG) --libs gtk+-3.0) + endif + else + GTK3_CFLAGS ?= +@@ -337,30 +337,29 @@ + $(eval $(call DEBUG_INFO_RULES, $(GTK2LIB))) + $(GTK2LIB).unstripped: $(LIBXNVCTRL) $(GTK2_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK) + $(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \ +- $(LIBXNVCTRL) $(LIBS) $(GTK2_LIBS) \ +- -Wl,--unresolved-symbols=ignore-all -o $@ \ ++ -o $@ \ + -Wl,-soname -Wl,$(GTK2LIB_SONAME) \ +- $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS) ++ $(GTK2_OBJS) $(IMAGE_OBJS) $(XCP_OBJS) \ ++ $(LIBXNVCTRL) $(LIBS) $(GTK2_LIBS) + endif + + ifdef BUILD_GTK3LIB + $(eval $(call DEBUG_INFO_RULES, $(GTK3LIB))) + $(GTK3LIB).unstripped: $(LIBXNVCTRL) $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) $(VERSION_MK) + $(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \ +- $(LIBXNVCTRL) $(LIBS) $(GTK3_LIBS) \ +- -Wl,--unresolved-symbols=ignore-all -o $@ \ ++ -o $@ \ + -Wl,-soname -Wl,$(GTK3LIB_SONAME) \ +- $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) ++ $(GTK3_OBJS) $(XCP_OBJS) $(IMAGE_OBJS) \ ++ $(LIBXNVCTRL) $(LIBS) $(GTK3_LIBS) + endif + + ifdef BUILD_WAYLANDLIB + $(eval $(call DEBUG_INFO_RULES, $(WAYLANDLIB))) + $(WAYLANDLIB).unstripped: $(WAYLAND_OBJS) + $(call quiet_cmd,LINK) -shared $(CFLAGS) $(LDFLAGS) $(BIN_LDFLAGS) \ +- $(LIBS) $(WAYLAND_LIBS) \ +- -Wl,--unresolved-symbols=ignore-all -o $@ \ ++ -o $@ \ + -Wl,-soname -Wl,$(WAYLANDLIB_SONAME) \ +- $(WAYLAND_OBJS) ++ $(WAYLAND_OBJS) $(LIBS) $(WAYLAND_LIBS) + + endif + diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings-load.desktop b/anda/system/nvidia/nvidia-settings/nvidia-settings-load.desktop new file mode 100644 index 0000000000..664e1f5e0e --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings-load.desktop @@ -0,0 +1,8 @@ +[Desktop Entry] +Type=Application +Name=NVIDIA X Server Settings +Comment=Configure NVIDIA X Server Settings +Exec=/usr/bin/nvidia-settings --load-config-only +Terminal=false +Icon=nvidia-settings +Categories=Settings; diff --git a/anda/system/nvidia/nvidia-settings/nvidia-settings.appdata.xml b/anda/system/nvidia/nvidia-settings/nvidia-settings.appdata.xml new file mode 100644 index 0000000000..0240ba817a --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/nvidia-settings.appdata.xml @@ -0,0 +1,57 @@ + + + nvidia-settings.desktop + NVIDIA Graphics Drivers Control Panel + Accelerated Linux Graphics Driver Control Panel + +

+ The NVIDIA Accelerated Linux Graphics Driver brings accelerated 2D + functionality and high-performance OpenGL support to Linux with the + use of NVIDIA graphics processing units. +

+

+ These drivers provide optimized hardware acceleration for OpenGL and X + applications and support nearly all recent NVIDIA GPU products. + The NVIDIA graphics driver uses a Unified Driver Architecture: the single + graphics driver supports all modern NVIDIA GPUs. +

+

+ The nvidia-settings utility is a tool for configuring the NVIDIA graphics + driver. It operates by communicating with the NVIDIA X driver, querying + and updating state as appropriate. This communication is done via the + NV-CONTROL, GLX, XVideo, and RandR X extensions. +

+

+ Values such as brightness and gamma, XVideo attributes, temperature, and + OpenGL settings can be queried and configured via nvidia-settings. +

+
+ + http://www.nvidia.com/ + CC0-1.0 + GPL-2.0+ + NVIDIA Corporation + + + The nvidia-settings utility main window + https://negativo17.org/appstream/nvidia-settings-0.png + + + Monitoring GPU status + https://negativo17.org/appstream/nvidia-settings-1.png + + + Application profiles creation + https://negativo17.org/appstream/nvidia-settings-2.png + + + + NVIDIA + driver + GeForce + Quadro + Vulkan + OpenGL + + negativo17@gmail.com +
From a49320b72839f10ac09de46e618bda1f85031602 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 17:25:30 +0700 Subject: [PATCH 05/23] add libva-nvidia-driver --- .../nvidia/libva-nvidia-driver/anda.hcl | 6 ++ .../libva-nvidia-driver.spec | 94 +++++++++++++++++++ 2 files changed, 100 insertions(+) create mode 100644 anda/system/nvidia/libva-nvidia-driver/anda.hcl create mode 100644 anda/system/nvidia/libva-nvidia-driver/libva-nvidia-driver.spec diff --git a/anda/system/nvidia/libva-nvidia-driver/anda.hcl b/anda/system/nvidia/libva-nvidia-driver/anda.hcl new file mode 100644 index 0000000000..e7d4425edb --- /dev/null +++ b/anda/system/nvidia/libva-nvidia-driver/anda.hcl @@ -0,0 +1,6 @@ +project "pkg" { + rpm { + spec = "libva-nvidia-driver.spec" + } + arches = ["x86_64", "aarch64", "i386"] +} \ No newline at end of file diff --git a/anda/system/nvidia/libva-nvidia-driver/libva-nvidia-driver.spec b/anda/system/nvidia/libva-nvidia-driver/libva-nvidia-driver.spec new file mode 100644 index 0000000000..8da945299a --- /dev/null +++ b/anda/system/nvidia/libva-nvidia-driver/libva-nvidia-driver.spec @@ -0,0 +1,94 @@ +%global commit0 259b7b7b7c6891805fbfb8f799d12ea03bd260f7 +%global date 20241108 +%global shortcommit0 %(c=%{commit0}; echo ${c:0:7}) + +%global upstream_name nvidia-vaapi-driver + +Name: libva-nvidia-driver +Epoch: 1 +Version: 0.0.13%{!?tag:^%{date}git%{shortcommit0}} +Release: 1%{?dist} +Summary: VA-API user mode driver for Nvidia GPUs +License: MIT +URL: https://github.com/elFarto/%{upstream_name} + +%if "%{?shortcommit0}" +Source0: %{url}/archive/%{commit0}/%{upstream_name}-%{commit0}.tar.gz#/%{upstream_name}-%{shortcommit0}.tar.gz +%else +Source0: %{url}/archive/v%{version}/%{upstream_name}-%{version}.tar.gz +%endif + +BuildRequires: gcc +BuildRequires: meson >= 0.58.0 +BuildRequires: pkgconfig(egl) +BuildRequires: pkgconfig(ffnvcodec) >= 11.1.5.1 +%if 0%{?fedora} || 0%{?rhel} >= 9 +BuildRequires: pkgconfig(gstreamer-codecparsers-1.0) +%endif +BuildRequires: pkgconfig(libdrm) >= 2.4.60 +BuildRequires: pkgconfig(libva) >= 1.8.0 + +Conflicts: libva-vdpau-driver%{?_isa} +Obsoletes: %{upstream_name} < 0.0.10-3 +Provides: %{upstream_name} = %{version}-%{release} +# Alternative name that better describes the API involved +Provides: nvdec-vaapi-driver = %{version}-%{release} + +Requires: mesa-filesystem + +%description +This is a VA-API implementation that uses NVDEC as a backend. This +implementation is specifically designed to be used by Firefox for accelerated +decode of web content, and may not operate correctly in other applications. + +%prep +%if "%{?shortcommit0}" +%autosetup -p1 -n %{upstream_name}-%{commit0} +%else +%autosetup -p1 -n %{upstream_name}-%{version} +%endif + +%build +%meson +%meson_build + +%install +%meson_install + +%check +%meson_test + +%files +%license COPYING +%doc README.md +%{_libdir}/dri/nvidia_drv_video.so + +%changelog +* Sun Nov 10 2024 Simone Caronni - 1:0.0.13^20241108git259b7b7-1 +- Update to latest snapshot. +- Drop no longer needed patch. + +* Fri Oct 04 2024 Simone Caronni - 1:0.0.12^20240909git68efa33-2 +- Update to latest snapshot. +- Add patch for 560/Wayland. + +* Mon May 06 2024 Simone Caronni - 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 - 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 - 0.0.10-1 +- Update to 0.0.10. + +* Mon Mar 20 2023 Simone Caronni - 0.0.9-1.20230319gitc0a7f54 +- Update to latest snapshot. + +* Mon Feb 06 2023 Simone Caronni - 0.0.8-2.20230205git17c62b8 +- Add latest fixes. + +* Sat Feb 04 2023 Simone Caronni - 0.0.8-1.20230131git2bb71a5 +- Rebase to latest snapshot. \ No newline at end of file From 718a5e00bf4cbaf81289ea4d085fe22c0c8d209a Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 17:47:05 +0700 Subject: [PATCH 06/23] add: nvidia-kmod-common w/ properietary defaults --- .../nvidia/nvidia-kmod-common/60-nvidia.rules | 13 + .../nvidia/nvidia-kmod-common/99-nvidia.conf | 3 + .../system/nvidia/nvidia-kmod-common/anda.hcl | 5 + .../nvidia/nvidia-kmod-common/kernel.conf | 20 + .../nvidia-kmod-common/nvidia-boot-update | 186 ++++++++ .../nvidia-kmod-common.spec | 420 ++++++++++++++++++ .../nvidia-kmod-common/nvidia-modeset.conf | 4 + .../nvidia/nvidia-kmod-common/nvidia.conf | 24 + 8 files changed, 675 insertions(+) create mode 100644 anda/system/nvidia/nvidia-kmod-common/60-nvidia.rules create mode 100644 anda/system/nvidia/nvidia-kmod-common/99-nvidia.conf create mode 100644 anda/system/nvidia/nvidia-kmod-common/anda.hcl create mode 100644 anda/system/nvidia/nvidia-kmod-common/kernel.conf create mode 100755 anda/system/nvidia/nvidia-kmod-common/nvidia-boot-update create mode 100644 anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec create mode 100644 anda/system/nvidia/nvidia-kmod-common/nvidia-modeset.conf create mode 100644 anda/system/nvidia/nvidia-kmod-common/nvidia.conf diff --git a/anda/system/nvidia/nvidia-kmod-common/60-nvidia.rules b/anda/system/nvidia/nvidia-kmod-common/60-nvidia.rules new file mode 100644 index 0000000000..40e532f346 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/60-nvidia.rules @@ -0,0 +1,13 @@ +# Device nodes are created by nvidia-modprobe, which is called by the nvidia DDX. +# In case the DDX is not started, the device nodes are never created, so call +# nvidia-modprobe in the udev rules to cover the Wayland/EGLStream and compute +# case without a started display. +ACTION=="add|bind", KERNEL=="nvidia", RUN+="/usr/bin/nvidia-modprobe" + +# Enable runtime PM for NVIDIA VGA/3D controller devices on driver bind +ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="auto" +ACTION=="bind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="auto" + +# Disable runtime PM for NVIDIA VGA/3D controller devices on driver unbind +ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030000", TEST=="power/control", ATTR{power/control}="on" +ACTION=="unbind", SUBSYSTEM=="pci", ATTR{vendor}=="0x10de", ATTR{class}=="0x030200", TEST=="power/control", ATTR{power/control}="on" diff --git a/anda/system/nvidia/nvidia-kmod-common/99-nvidia.conf b/anda/system/nvidia/nvidia-kmod-common/99-nvidia.conf new file mode 100644 index 0000000000..6d64aaeb34 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/99-nvidia.conf @@ -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 " diff --git a/anda/system/nvidia/nvidia-kmod-common/anda.hcl b/anda/system/nvidia/nvidia-kmod-common/anda.hcl new file mode 100644 index 0000000000..f77504c361 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/anda.hcl @@ -0,0 +1,5 @@ +project "pkg" { + rpm { + spec = "nvidia-kmod-common.spec" + } +} \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-kmod-common/kernel.conf b/anda/system/nvidia/nvidia-kmod-common/kernel.conf new file mode 100644 index 0000000000..34603d9738 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/kernel.conf @@ -0,0 +1,20 @@ +# This variable determines what kind of modules get installed on the system +# until the Nvidia driver provides only the open source variant. +# +# The name of the variable is the name of the folder that hosts the kernel +# module code inside the driver installer: +# +# +-------------+---------------------+----------------+ +# | Value | Type | License type | +# +-------------+---------------------+----------------+ +# | kernel | Proprietary drivers | NVIDIA license | +# +-------------+---------------------+----------------+ +# | kernel-open | Open source drivers | Dual MIT/GPL | +# +-------------+---------------------+----------------+ + +# TERRA-SPECIFIC NOTES: +# Since we are focused on HWE, we will use proprietary drivers for now. +# At least until Pascal/Maxwell support is added to the open source drivers, or until +# everyone stops using them in the near future. + +MODULE_VARIANT=kernel diff --git a/anda/system/nvidia/nvidia-kmod-common/nvidia-boot-update b/anda/system/nvidia/nvidia-kmod-common/nvidia-boot-update new file mode 100755 index 0000000000..46cad2f238 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/nvidia-boot-update @@ -0,0 +1,186 @@ +#!/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//grub.cfg +# - BIOS: /etc/grub2.cfg -> /boot/grub2/grub.cfg + + +# EL9 (grub2 with BootLoaderSpec patches) +# +# kernel options: grub.cfg + /etc/kernel/cmdline + /boot/loader/entries/*.conf +# manually update: /etc/default/grub + /etc/kernel/cmdline +# grub2-mkconfig does not update /boot/loader/entries/*.conf +# grub.cfg: +# - UEFI: /etc/grub2-efi.cfg -> /boot/efi/EFI//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 + /etc/kernel/cmdline +# grub2-mkconfig does not update /boot/loader/entries/*.conf +# 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_ADD="_dracutopts_in" +CMDLINE_ARGS_REMOVE="_dracutopts_rm" + +print_usage() { +cat <> /etc/default/grub + else + for param in $CMDLINE_ARGS_ADD; do + echo ${GRUB_CMDLINE_LINUX} | grep -q $param + [ $? -eq 1 ] && GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} ${param}" + done + for param in $CMDLINE_ARGS_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 + + if [ -v BLS_ENTRIES ]; then + + for config_file in $BLS_ENTRIES/*.conf; do + for param in $CMDLINE_ARGS_ADD; do + grep -q $param $config_file + [ $? -eq 1 ] && sed -i -e "s|^options.*|& $param|" $config_file + done + for param in $CMDLINE_ARGS_REMOVE; do + grep -q $param $config_file + [ $? -eq 0 ] && sed -i -e "s| $param||" $config_file + done + done + + fi + +} + +preun() { + + if [ -v GRUB_CFG ]; then + + for param in $CMDLINE_ARGS_ADD; 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 + + if [ -v BLS_ENTRIES ]; then + + for config_file in $BLS_ENTRIES/*.conf; do + for param in $CMDLINE_ARGS_ADD; do + grep -q $param $config_file + [ $? -eq 0 ] && sed -i -e "s| $param||" $config_file + done + done + + fi + +} + +case "$1" in + post) + check + post + exit 0 + ;; + preun) + check + preun + exit 0 + ;; + *) + print_usage + exit 0 + ;; +esac diff --git a/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec b/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec new file mode 100644 index 0000000000..a0d0b14772 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec @@ -0,0 +1,420 @@ +%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 +%global _binaries_in_noarch_packages_terminate_build 0 +%global __strip /bin/true + +Name: nvidia-kmod-common +Version: 565.77 +Release: 2%{?dist} +Summary: Common file for NVIDIA's proprietary driver kernel modules +Epoch: 3 +License: NVIDIA License +URL: http://www.nvidia.com/object/unix.html + +BuildArch: noarch + +Source0: http://download.nvidia.com/XFree86/Linux-%{_arch}/%{version}/NVIDIA-Linux-%{_arch}-%{version}.run +Source17: nvidia-boot-update +Source18: kernel.conf +Source19: nvidia-modeset.conf +Source20: nvidia.conf +Source21: 60-nvidia.rules +Source24: 99-nvidia.conf + +# UDev rule location (_udevrulesdir) and systemd macros: +BuildRequires: systemd-rpm-macros + +# Owns /usr/lib/firmware: +Requires: linux-firmware +Requires: nvidia-modprobe +Requires: nvidia-kmod = %{?epoch:%{epoch}:}%{version} +Provides: nvidia-kmod-common = %{?epoch:%{epoch}:}%{version} +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}-%{_arch} +%setup -T -D -n nvidia-kmod-%{version}-%{_arch} + +%install +# Script for post/preun tasks +install -p -m 0755 -D %{SOURCE17} %{buildroot}%{_sbindir}/nvidia-boot-update +sed -i \ + -e 's/_dracutopts_in/%{_dracutopts_in}/g' \ + -e 's/_dracutopts_rm/%{_dracutopts_rm}/g' \ + %{buildroot}%{_sbindir}/nvidia-boot-update + +# Choice of kernel module type: +install -p -m 0644 -D %{SOURCE18} %{buildroot}%{_sysconfdir}/nvidia/kernel.conf + +# Nvidia modesetting support: +install -p -m 0644 -D %{SOURCE19} %{buildroot}%{_sysconfdir}/modprobe.d/nvidia-modeset.conf + +# Load nvidia-uvm, enable complete power management: +install -p -m 0644 -D %{SOURCE20} %{buildroot}%{_modprobedir}/nvidia.conf + +# Avoid Nvidia modules getting in the initrd: +install -p -m 0644 -D %{SOURCE24} %{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 + +# Firmware files: +mkdir -p %{buildroot}%{_prefix}/lib/firmware/nvidia/%{version}/ +install -p -m 644 firmware/* %{buildroot}%{_prefix}/lib/firmware/nvidia/%{version} + +%post +%{_sbindir}/nvidia-boot-update post + +%preun +if [ "$1" -eq "0" ]; then + %{_sbindir}/nvidia-boot-update preun +fi ||: + +%files +%{_dracut_conf_d}/99-nvidia.conf +%{_modprobedir}/nvidia.conf +%{_prefix}/lib/firmware/nvidia/%{version} +%{_sbindir}/nvidia-boot-update +%config(noreplace) %{_sysconfdir}/modprobe.d/nvidia-modeset.conf +%config(noreplace) %{_sysconfdir}/nvidia/kernel.conf +%{_udevrulesdir}/60-nvidia.rules + +%changelog +* Wed Dec 25 2024 Simone Caronni - 3:565.77-2 +- Run nvidia-modprobe only on add/bind (thanks os369510). + +* Thu Dec 05 2024 Simone Caronni - 3:565.77-1 +- Update to 565.77. + +* Tue Oct 29 2024 Simone Caronni - 3:565.57.01-2 +- Update power management configuration. + +* Wed Oct 23 2024 Simone Caronni - 3:565.57.01-1 +- Update to 565.57.01. + +* Fri Oct 11 2024 Simone Caronni - 3:560.35.03-2 +- Fix configuration file replacement (#14). + +* Wed Aug 21 2024 Simone Caronni - 3:560.35.03-1 +- Update to 560.35.03. + +* Tue Aug 06 2024 Simone Caronni - 3:560.31.02-1 +- Update to 560.31.02. + +* Mon Aug 05 2024 Simone Caronni - 3:560.28.03-1 +- Update to 560.28.03. + +* Tue Jul 02 2024 Simone Caronni - 3:555.58.02-1 +- Update to 555.58.02. + +* Thu Jun 27 2024 Simone Caronni - 3:555.58-1 +- Update to 555.58. + +* Thu Jun 06 2024 Simone Caronni - 3:555.52.04-1 +- Update to 555.52.04. + +* Fri May 31 2024 Simone Caronni - 3:555.42.02-2 +- Fix typo in preun scriptlet. + +* Wed May 22 2024 Simone Caronni - 3:555.42.02-1 +- Update to 555.42.02. + +* Fri Apr 26 2024 Simone Caronni - 3:550.78-1 +- Update to 550.78. + +* Thu Apr 18 2024 Simone Caronni - 3:550.76-1 +- Update to 550.76. + +* Sun Mar 24 2024 Simone Caronni - 3:550.67-1 +- Update to 550.67. + +* Mon Mar 11 2024 Simone Caronni - 3:550.54.14-2 +- Add support for installing drivers without a configured bootloader (i.e. + kickstart case). +- Add support for sdboot. + +* Sun Mar 03 2024 Simone Caronni - 3:550.54.14-1 +- Update to 550.54.14. + +* Tue Feb 06 2024 Simone Caronni - 3:550.40.07-1 +- Update to 550.40.07. + +* Fri Dec 01 2023 Simone Caronni - 3:545.29.06-1 +- Update to 545.29.06. + +* Tue Nov 14 2023 Simone Caronni - 3:545.29.02-5 +- Update location of configuration file for kernel module variant. + +* Mon Nov 13 2023 Simone Caronni - 3:545.29.02-4 +- Allow installing proprietary or open source kernel modules. + +* Sat Nov 04 2023 Simone Caronni - 3:545.29.02-3 +- Second part of the fix for issue + https://github.com/negativo17/nvidia-kmod-common/issues/11. + +* Sat Nov 04 2023 Simone Caronni - 3:545.29.02-2 +- First part of fix for issue + https://github.com/negativo17/nvidia-kmod-common/issues/11. + +* Tue Oct 31 2023 Simone Caronni - 3:545.29.02-1 +- Update to 545.29.02. + +* Thu Oct 19 2023 Simone Caronni - 3:545.23.06-2 +- Also remove old simpledrm workaround if still present. + +* Wed Oct 18 2023 Simone Caronni - 3:545.23.06-1 +- Update to 545.23.06. + +* Fri Sep 22 2023 Simone Caronni - 3:535.113.01-1 +- Update to 535.113.01. + +* Thu Aug 24 2023 Simone Caronni - 3:535.104.05-1 +- Update to 535.104.05. + +* Wed Aug 09 2023 Simone Caronni - 3:535.98-1 +- Update to 535.98. + +* Wed Jul 19 2023 Simone Caronni - 3:535.86.05-1 +- Update to 535.86.05. + +* Thu Jun 15 2023 Simone Caronni - 3:535.54.03-1 +- Update to 535.54.03. + +* Tue Jun 13 2023 Simone Caronni - 3:535.43.02-1 +- Update to 535.43.02. + +* Fri Mar 24 2023 Simone Caronni - 3:530.41.03-1 +- Update to 530.41.03. + +* Wed Mar 08 2023 Simone Caronni - 3:530.30.02-1 +- Update to 530.30.02. + +* Wed Mar 08 2023 Simone Caronni - 3:525.89.02-2 +- Drop workaround for simpledrm support (fixed in 525.60.11). + +* Fri Feb 10 2023 Simone Caronni - 3:525.89.02-1 +- Update to 525.89.02. + +* Fri Jan 20 2023 Simone Caronni - 3:525.85.05-1 +- Update to 525.85.05. + +* Mon Jan 09 2023 Simone Caronni - 3:525.78.01-1 +- Update to 525.78.01. + +* Tue Nov 29 2022 Simone Caronni - 3:525.60.11-1 +- Update to 525.60.11. + +* Thu Oct 13 2022 Simone Caronni - 3:520.56.06-1 +- Update to 520.56.06. + +* Wed Sep 21 2022 Simone Caronni - 3:515.76-1 +- Update to 515.76. + +* Mon Aug 08 2022 Simone Caronni - 3:515.65.01-1 +- Update to 515.65.01. + +* Wed Jun 29 2022 Simone Caronni - 3:515.57-1 +- Update to 515.57. + +* Thu Jun 09 2022 Simone Caronni - 3:515.48.07-2 +- Adjust conditionals. +- Drop removal of nvidia-drm.modeset=1 from the kernel command line. +- Add nvidia-drm.modeset=1 to the configuration file also on RHEL/CentOS. + +* Wed Jun 01 2022 Simone Caronni - 3:515.48.07-1 +- Update to 515.48.07. + +* Tue May 31 2022 Simone Caronni - 3:515.43.04-2 +- Blacklist nouveau for modprobe. + +* Thu May 12 2022 Simone Caronni - 3:515.43.04-1 +- Update to 515.43.04. + +* Mon May 02 2022 Simone Caronni - 3:510.68.02-1 +- Update to 510.68.02. + +* Mon Mar 28 2022 Simone Caronni - 3:510.60.02-1 +- Update to 510.60.02. + +* Mon Feb 14 2022 Simone Caronni - 3:510.54-1 +- Update to 510.54. + +* Wed Feb 02 2022 Simone Caronni - 3:510.47.03-1 +- Update to 510.47.03. + +* Tue Dec 14 2021 Simone Caronni - 3:495.46-1 +- Update to 495.46. + +* Fri Dec 10 2021 Jamie Nguyen - 3:495.44-4 +- Source grub file before rewriting GRUB_CMDLINE_LINUX in preun. Without this, + we are clearing out GRUB_CMDLINE_LINUX when this package gets removed. + +* Sun Nov 07 2021 Simone Caronni - 3:495.44-3 +- Avoid duplication on modprobe configuration file names (second file in + /usr/lib/modprobe.d gets ignored). Thanks Jens Peters. +- Fix issue with missing quotes in /etc/default/grub and multiple parameters. + Thanks Roshan Shariff. + +* Sat Nov 06 2021 Simone Caronni - 3:495.44-2 +- Update configuration files and boot options. + +* Tue Nov 02 2021 Simone Caronni - 3:495.44-1 +- Update to 495.44. +- Also disable bundling nvidia-peermem in initrd. + +* Tue Nov 02 2021 Simone Caronni - 3:470.82.00-1 +- Update to 470.82.00. + +* Tue Sep 21 2021 Simone Caronni - 3:470.74-1 +- Update to 470.74. + +* Fri Aug 20 2021 Simone Caronni - 3:470.63.01-3 +- SPEC file cleanup. +- Enable modesetting by default for Fedora 35+ + +* Fri Aug 20 2021 Simone Caronni - 3:470.63.01-2 +- Enable complete power management. + +* Wed Aug 11 2021 Simone Caronni - 3:470.63.01-1 +- Update to 470.63.01. + +* Tue Jul 20 2021 Simone Caronni - 3:470.57.02-1 +- Update to 470.57.02. + +* Wed Jun 30 2021 Simone Caronni - 3:470.42.01-1 +- Update to 470.42.01. + +* Wed May 26 2021 Simone Caronni - 3:465.31-1 +- Update to 465.31. + +* Sat May 01 2021 Simone Caronni - 3:465.27-1 +- Update to 465.27. + +* Sun Apr 18 2021 Simone Caronni - 3:465.24.02-1 +- Update to 465.24.02. + +* Fri Apr 09 2021 Simone Caronni - 3:465.19.01-1 +- Update to 465.19.01. + +* Fri Mar 19 2021 Simone Caronni - 3:460.67-1 +- Update to 460.67. + +* Mon Mar 01 2021 Simone Caronni - 3:460.56-1 +- Update to 460.56. + +* Wed Jan 27 2021 Simone Caronni - 3:460.39-1 +- Update to 460.39. + +* Thu Jan 7 2021 Simone Caronni - 3:460.32.03-1 +- Update to 460.32.03. + +* Sun Dec 20 2020 Simone Caronni - 3:460.27.04-1 +- Update to 460.27.04. +- Update comments in modprobe file. + +* Mon Dec 07 2020 Simone Caronni - 3:455.45.01-2 +- Remove CentOS/RHEL 6 support. + +* Wed Nov 18 2020 Simone Caronni - 3:455.45.01-1 +- Update to 455.45.01. + +* Mon Nov 02 2020 Simone Caronni - 3:455.38-1 +- Update to 455.38. + +* Mon Oct 12 2020 Simone Caronni - 3:455.28-1 +- Update to 455.28. + +* Tue Oct 06 2020 Simone Caronni - 3:450.80.02-1 +- Update to 450.80.02. + +* Thu Aug 20 2020 Simone Caronni - 3:450.66-1 +- Update to 450.66. + +* Fri Jul 10 2020 Simone Caronni - 3:450.57-1 +- Update to 450.57. + +* Thu Jun 25 2020 Simone Caronni - 3:440.100-1 +- Update to 440.100. + +* Thu Apr 09 2020 Simone Caronni - 3:440.82-1 +- Update to 440.82. + +* Fri Feb 28 2020 Simone Caronni - 3:440.64-1 +- Update to 440.64. + +* Tue Feb 04 2020 Simone Caronni - 3:440.59-1 +- Update to 440.59. + +* Sat Dec 14 2019 Simone Caronni - 3:440.44-1 +- Update to 440.44. + +* Sat Nov 30 2019 Simone Caronni - 3:440.36-1 +- Update to 440.36. + +* Mon Nov 11 2019 Simone Caronni - 3:440.31-2 +- Fix udev rules synax (thanks Leigh) + +* Sat Nov 09 2019 Simone Caronni - 3:440.31-1 +- Update to 440.31. + +* Thu Oct 17 2019 Simone Caronni - 3:440.26-1 +- Update to 440.26. + +* Tue Oct 01 2019 Simone Caronni - 3:435.21-3 +- Remove workaround for onboard GPU devices. +- Fix typo on udev character device rules (thanks tbaederr). + +* Tue Oct 01 2019 Simone Caronni - 3:435.21-2 +- Fix build on CentOS/RHEL 8 + +* Tue Sep 03 2019 Simone Caronni - 3:435.21-1 +- Update to 435.21. + +* Thu Aug 22 2019 Simone Caronni - 3:435.17-1 +- Update to 435.17. +- Add power management functions as per documentation. +- Require systemd-rpm-macros instead of systemd on Fedora/RHEL 8+. + +* Wed Jul 31 2019 Simone Caronni - 3:430.40-1 +- Update to 430.40. + +* Fri Jul 12 2019 Simone Caronni - 3:430.34-1 +- Update to 430.34. + +* Wed Jun 12 2019 Simone Caronni - 3:430.26-1 +- Update to 430.26. + +* Thu Jun 06 2019 Simone Caronni - 3:430.14-2 +- Do not run post/preun scriptlets on Atomic/Silverblue. + +* Sat May 18 2019 Simone Caronni - 3:430.14-1 +- Update to 430.14. + +* Thu May 09 2019 Simone Caronni - 3:418.74-1 +- Update to 418.74. +- Remove fallback scenario (thanks Karol Herbst). + +* Thu Apr 18 2019 Simone Caronni - 3:418.56-2 +- Obsoletes cuda-nvidia-kmod-common (thanks Timm). + +* Sun Mar 24 2019 Simone Caronni - 3:418.56-1 +- Update to 418.56. + +* Fri Feb 22 2019 Simone Caronni - 3:418.43-1 +- Update to 418.43. + +* Wed Feb 06 2019 Simone Caronni - 3:418.30-1 +- Update to 418.30. + +* Sun Feb 03 2019 Simone Caronni - 3:415.27-1 +- First build. diff --git a/anda/system/nvidia/nvidia-kmod-common/nvidia-modeset.conf b/anda/system/nvidia/nvidia-kmod-common/nvidia-modeset.conf new file mode 100644 index 0000000000..c4e6e744e5 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/nvidia-modeset.conf @@ -0,0 +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 diff --git a/anda/system/nvidia/nvidia-kmod-common/nvidia.conf b/anda/system/nvidia/nvidia-kmod-common/nvidia.conf new file mode 100644 index 0000000000..bb90a99750 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/nvidia.conf @@ -0,0 +1,24 @@ +# 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). + +blacklist nouveau + +# 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 +# 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 +# included in the initrd, so use this configuration file to specify the +# dependency. + +softdep nvidia post: nvidia-uvm + +# Enable complete power management. From: +# file:///usr/share/doc/nvidia-driver/html/powermanagement.html + +options nvidia NVreg_TemporaryFilePath=/var/tmp +options nvidia NVreg_EnableS0ixPowerManagement=1 +options nvidia NVreg_PreserveVideoMemoryAllocations=1 From c23301771bf3fc06d168176cf034a686146c2e1a Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 17:52:49 +0700 Subject: [PATCH 07/23] download the x86 version of the driver package when running common --- anda/system/nvidia/nvidia-kmod-common/anda.hcl | 1 + anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/anda/system/nvidia/nvidia-kmod-common/anda.hcl b/anda/system/nvidia/nvidia-kmod-common/anda.hcl index f77504c361..fbed87f861 100644 --- a/anda/system/nvidia/nvidia-kmod-common/anda.hcl +++ b/anda/system/nvidia/nvidia-kmod-common/anda.hcl @@ -2,4 +2,5 @@ project "pkg" { rpm { spec = "nvidia-kmod-common.spec" } + arches = ["x86_64"] } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec b/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec index a0d0b14772..466d31a5fd 100644 --- a/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec +++ b/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec @@ -16,7 +16,7 @@ URL: http://www.nvidia.com/object/unix.html BuildArch: noarch -Source0: http://download.nvidia.com/XFree86/Linux-%{_arch}/%{version}/NVIDIA-Linux-%{_arch}-%{version}.run +Source0: http://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-%{_arch}-%{version}.run Source17: nvidia-boot-update Source18: kernel.conf Source19: nvidia-modeset.conf From f5b310e2c4d45897c72d47e2c614b86c3d79f34f Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 18:39:06 +0700 Subject: [PATCH 08/23] add nvidia-driver package --- .../nvidia/nvidia-driver/10-nvidia.conf | 8 + .../70-nvidia-driver-cuda.preset | 4 + .../nvidia-driver/70-nvidia-driver.preset | 11 + .../nvidia-driver/alternate-install-present | 7 + anda/system/nvidia/nvidia-driver/anda.hcl | 6 + .../com.nvidia.driver.metainfo.xml | 46 ++ .../nvidia-driver/com.nvidia.driver.png | Bin 0 -> 6881 bytes .../nvidia/nvidia-driver/nvidia-driver.spec | 708 ++++++++++++++++++ .../nvidia-driver/nvidia-generate-tarballs.sh | 107 +++ .../nvidia-driver/parse-supported-gpus.py | 43 ++ 10 files changed, 940 insertions(+) create mode 100644 anda/system/nvidia/nvidia-driver/10-nvidia.conf create mode 100644 anda/system/nvidia/nvidia-driver/70-nvidia-driver-cuda.preset create mode 100644 anda/system/nvidia/nvidia-driver/70-nvidia-driver.preset create mode 100644 anda/system/nvidia/nvidia-driver/alternate-install-present create mode 100644 anda/system/nvidia/nvidia-driver/anda.hcl create mode 100644 anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml create mode 100644 anda/system/nvidia/nvidia-driver/com.nvidia.driver.png create mode 100644 anda/system/nvidia/nvidia-driver/nvidia-driver.spec create mode 100755 anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh create mode 100755 anda/system/nvidia/nvidia-driver/parse-supported-gpus.py diff --git a/anda/system/nvidia/nvidia-driver/10-nvidia.conf b/anda/system/nvidia/nvidia-driver/10-nvidia.conf new file mode 100644 index 0000000000..b9db1a9928 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/10-nvidia.conf @@ -0,0 +1,8 @@ +Section "OutputClass" + Identifier "nvidia" + MatchDriver "nvidia-drm" + Driver "nvidia" + Option "AllowEmptyInitialConfiguration" + Option "SLI" "Auto" + Option "BaseMosaic" "on" +EndSection diff --git a/anda/system/nvidia/nvidia-driver/70-nvidia-driver-cuda.preset b/anda/system/nvidia/nvidia-driver/70-nvidia-driver-cuda.preset new file mode 100644 index 0000000000..ef728bd1e8 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/70-nvidia-driver-cuda.preset @@ -0,0 +1,4 @@ +# Enable persistence state. From: +# file:///usr/share/doc/nvidia-driver/html/nvidia-persistenced.html + +enable nvidia-persistenced.service diff --git a/anda/system/nvidia/nvidia-driver/70-nvidia-driver.preset b/anda/system/nvidia/nvidia-driver/70-nvidia-driver.preset new file mode 100644 index 0000000000..4d7eeef038 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/70-nvidia-driver.preset @@ -0,0 +1,11 @@ +# Enable complete power management. From: +# file:///usr/share/doc/nvidia-driver/html/powermanagement.html + +enable nvidia-hibernate.service +enable nvidia-resume.service +enable nvidia-suspend.service + +# Enable Dynamic Boost. From: +# file:///usr/share/doc/nvidia-driver/html/dynamicboost.html + +enable nvidia-powerd.service diff --git a/anda/system/nvidia/nvidia-driver/alternate-install-present b/anda/system/nvidia/nvidia-driver/alternate-install-present new file mode 100644 index 0000000000..4f8206e1ef --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/alternate-install-present @@ -0,0 +1,7 @@ +The NVIDIA proprietary driver is already installed in this system. It was +installed through a 3d party repository. + +Please refer to the following page for additional information and to install +optional driver components: + + https://negativo17.org/nvidia-driver/ diff --git a/anda/system/nvidia/nvidia-driver/anda.hcl b/anda/system/nvidia/nvidia-driver/anda.hcl new file mode 100644 index 0000000000..faf50fcdbc --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/anda.hcl @@ -0,0 +1,6 @@ +project "pkg" { + rpm { + spec = "nvidia-driver.spec" + } + arches = ["x86_64", "aarch64", "i386"] +} \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml b/anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml new file mode 100644 index 0000000000..9b81ba96a6 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml @@ -0,0 +1,46 @@ + + + com.nvidia.driver + + nvidia-settings.desktop + + NVIDIA Graphics Driver + /usr/share/pixmaps/com.nvidia.driver.png + NVIDIA Accelerated Graphics Driver + + NVIDIA Corporation + + +

The NVIDIA Accelerated Linux Graphics Driver brings accelerated 2D functionality and high-performance OpenGL support to Linux with the use of NVIDIA graphics processing units.

+

These drivers provide optimized hardware acceleration for OpenGL and X applications and support nearly all recent NVIDIA GPU products. The NVIDIA graphics driver uses a Unified Driver Architecture: the single graphics driver supports all modern NVIDIA GPUs.

+
+ + CUDA + GeForce + NVIDIA + OpenGL + Quadro + Tesla + Video + Vulkan + av1 + avc + driver + h264 + h265 + hevc + jpeg + mpeg2 + vaapi + vc-1 + vp8 + vp9 + + CC0-1.0 + LicenseRef-proprietary:NVIDIA + https://www.nvidia.com/ + negativo17@gmail.com + + True + +
diff --git a/anda/system/nvidia/nvidia-driver/com.nvidia.driver.png b/anda/system/nvidia/nvidia-driver/com.nvidia.driver.png new file mode 100644 index 0000000000000000000000000000000000000000..ff023b8b1b8ee56018b5e0d3232ac7337262ab4e GIT binary patch literal 6881 zcmbt(c{J2t`2Twr%#3X?*+X_EYt}4d-!%xMEHm~sgR&*wma&Uc_GOTzs7Q-7(8Is`uos%;4>n(FK7O#-pqX8-EUeol)V1$iy8hwsG93;|C|)lT`=H@gdgeo`eJRs| zP2By#p%s=-$xc4inm!N0S~Vvggtcq3*Kamy#tBvdB=A94o2FxZSgmGo{ia9mSHA6y z7ui|Cb*(m~CLjJTsWX5K52CCyFYH|Z@V71TE8i0lH8*eDQsxhZ4$D#3V$VB32>B1f z!nGc#efZnnf9$U4&|9y3(dVINm*69y@y~*Wed&jln8}5&e4&8%h0rIO6ZM;e5N1H2 z;C-{wVR>BByWH4#2)<**xxv+EImR^*)vbQm+A<;Q{YqMZ+w_)Sp6aAb^{4mxlPtEj zzr{XpcCLDQaGO3M21!&74Ez(avQ_OHrI~x+`Xm-jSjGYe;}n)lG~;=t6$U7!c&gec zr18B?+S0hK4IgGEcaAZXhIPH0$=48Twv+jDI~wAx{4P^MCXrzRai!;a0vbDUs@Z(0 zU?6btRovMyiRkFmz+bXyFzV-h6T`43XYZ)Se_bxa;Ecw2K-O`z*ljvIuoV@%RZJ| zv9wPj3ur7(Q|Y{C*)n=yPKnFhX_|>EeyRDvA%AG4hM853%%&O~jj%i6STLfV*wxy0oE=s`$03>78C4l5&&*$>OtmwJf7!R3S78jL@%JhmvJWa)* zY%ku?!;Z6wv9Kgq`i6aMJ$siTqHk1YH^RYWQ&NeoCNDKi-w~0o*D`;TexvHn%Wp8* z@AoR+?TYQE{4AI%*(@y%3*Ihj?OGf7yk8c)er@|u=!XR}#=3ID+jgOKj(1%JqNtmx zz;BEo!=%q$hi)hs;jk*?Y1WdMAk6Q0oc*Ge+w$8V?kF{zf~CdI!CDd{*=}a1)eosr6 z1gLj;NH_d})0^BVBvmpiqwyXySy92zAnCMY-}G&)0m0n-o|DC?3&dg@?nTz*u=52p z+hg{hMe$%P#+%=3^IuH`2#d&-MgP4xuqPPY#`IIh@@7vKN(|S zO#XgvqqFDlTR!r$WSsB4#?Em}ymW~#M(Lk6bDe6D-C45HF=K!UC54Ne{x%uSz(SSW zieP*Duv!-RQG`dwN{%#zK_s#i7s~#I(;+C1;~%7fShVqWyv{+%avC(_l%4x z0$-cdoLv=#TmWuhh{}5!Hd)qH@8jZMNoo|()-!qfuAtV{nI;3QEf;^gicTwH^285x zhnz~`35Z1L4my&O9k0(yZZ%GxG$KBERr1p7>QHbkS_AonD*^hT-Hc)On<%nbI;N0D z7uDIX)l}JrbWN-LMVEEm26BO*(TQkjr5Y^!`jqq9&5{pAi*@IZ<4;+~z+` z=JSz9`~Q*y7JN~cwIFw7q)Xfb>E}5Imy42Qo}RRhuam3xr&^;TQe*Zg9uRM4H@Wp<*bivEDevXQ4S83hhfmK~aNzH(A_li!gP z7QOk8vzZl4`lWhr{lZ=AzDeliFpL%9h=I9gj9zbE@W20RiYo44r&#I{Gi@RYP0%n# zGpQ^-9K7u_iEV;^vg%!>waB-0Xv1$CP|3tLC3k<7f)nsqjY9TxXo%e=oHVm2E@fYg z%~&%fLJU~T-YB4gceOwr09CFMz3bS+yI-u>yLY+g9AvIqK~|4wm-}jSjvrydCn3?f zstnmjXYTcPayFxaOa?rwM)PYALJS8zmF)Enuc|+?0uq-U9x5FLEZ8 zTK5rrD6Q9{_Dt*|-)!ux2M6lO&6mdUlHa(VnDk)B6--;yf*I~NPk235ndF%<7BHE2 zOYS;k24HH)`TU7_q3Kv zk?yG6k%3&r)u}apXXvTr@bQ?rc%&4HVI!p*mzDv207gzt;cfYf*kZK$TCeoM`I?=7 z-;~5aRa8FzB@wn0e*tj6?6 zKK-0}=iK2Og@k8Em9E_zUP4j~^@v6BM4|Ni_KjzkI=4nSB|(i$T<)-UxtZC>P8zl@ zO|iUNM$5cnj0>9<&v9D1!>gR;n&(Rkk%?3)e=LADL;AHV>kH)DblU*TYZi*Y!$}p|H;vASCzbS z2SH#Z^U2bIs@V7mjo(jZcYk7N_lGFLN>HDC)e8WhF}gyRyv+Kg-wq99WnekC;@9|& z%)iWg@R1RvTdgn>BwhbvK0v1PkE5+RADlvQrGPL~*h`W5mKH8a9?BNWO3U zIjcs2hDSNtM!pSdyKzF|S=*h@ZmsUc3)}X)o~7D8*bZIhq$!q%)fa5>E2W@>w1_)B z$G=+P6tQ^os~_ep11*OFHeqzE=JEL$m5xKNMO#!x7G+}rv$;Ic+UP5Z#taW}_|~(- z^1>r391=Gs@2949;1*N|O&H<0tN+!?7bB&bw$VRy1rgm!4uK!PaK-nTIK<@ZO?{6{ z)Gsiq)(0?bRV2qt0&_P$+7={bimdiQS!7nX?o++sC^was>^R?%=`z}140kanc%v@B zT5YI*v^&m6WZcs?%kp0101xc$i`&B{jLZ?~^9jW!#E4)nfSg!5_WPlzr=X6-{AA|I zo$`&Z)Emb)vu5}T$){60bAaaOAw4jeQX6HSUVO-pI{SI4eOh>@EAN!l90Ik2^W97k zxq-mQom1L7!14M!kCC2kY7JF2zP}CV6ARj7XY}U(h^Bj9sinpwLHI^))m4#{$?P5C z_~X~JIjiJyfON@icit5)4FBilP^rKuLurWR*2d1`x*aZN$Oz{1Lp+Z*b;!atymvXKZ&omS?DdEUeNNDSNR+sI zo_t=PND>wWpJ7&DMAPIxnsD{-+U3NkRi2vXA|}M-dBtdLa(x2ybpIVdvqW%;M*vla zm9NtKwjLuS|92J?YSNpRMG0iqPt}~m;Or&gjR~{?D%OD7sPLT$qq?_55t2l-J*Af^ zx&rGhI*i>GIe>#*fziC7C-4`#*Pi#2gUmK}a+IWB@xqfbk#FOy=2w#uC-@}5 zaMV!ynUP;_5z?7eBzf{q%ym+>yO84D(aOnh;~A35`c^E^M)7JMmxN)4cpMXqms^~S znLSw7IBr&@PfN#?(vt7AuXkYQQ{?P^HPU4kGm(@;+B61*S*sy2kVBkPA7pC(7{NRW z8>(8+T`djvb+8xg)xA6>XzhjY4sd9GTIY?gs3xQ<4d=P1@p&c}+2Fj3d~z#2DSo`w zFHKQg2L`^z6-wDghsdj9L4K)t!!&O)p1*ZqX61c+=vvhCuyEms^5t0Fjq9gc=GIqd zN{6&}%EH!F9{uA4zg^6%UOsV1S#zzBq_keR;E^m-V*G+T7*Ob}{QM z&3`j`l-}cwhhDHWJh_??GMCqOcDVi0qt~W@r~|J>VN*kAf={iV##DAh%l8{D{Xu=4 zV5;_-y|X}8wHefRqF=SGHNUyz!;~6E9JuvRl-E~wo!_Dgz9Ag8eS2A4qZj}D*{U!S zyI6$SYpHG)zI__-_#P}fmgUtM!hT6c95l2EdZ(6$^7urMT@JMeK3s0?!!z>rkM%qm z#NP~{SO8z*E;_Xd^kX6((=An*DSe|8_#Od^tjp$F_3>vRsoU(7M?Fe?cy0lU&L-#7 zD&T>x#2lWn<>zzeEU%2FgE~D~NGjs~gX*_<osyR@}RS+z5E-%!h&{tNTw_l(~X&P_L-~ZD-kFzhP-j#Q+aM>g_m3*Y!0Ss9XF}!u3T=dViWtW}v%P|8)O&BN;aR>s5J@x;f zQX4p_&K~#eJtGF@jN=cB$Y_1Usiglq#kbJT(qltcAOVxeKt>1XCTLEN)-+aW)D_v| zIBNi#YE1a(v{1MlHX0`1s9Rabv<+zoFA>BVQFRb+hzH22)IADrZ;LBCFYHx3N(>QD zq?cRYT%h_B1aYA70xUqs?5Ql$x4ZeNb*WF8uIU9MDZ#N^Yqkr(8^i7;FdUQ1XKDCv zs|HSLWm$rfpJrd7u0yWrh+ks6{xO)*yxAO>4-vvMvGj3379n%S<7&0>S2(F(e`(|N z_9Jygj+`jWBg49sLsu{fL1nPIQZsSBpF!dDm)IyvsOgP7XT;*IvUl-+O*mPH7{<%; zxuA&hudMy}KAmq7bUC9Sfy0 zbU|QGOo0^TarRoUUIN^*$zO`aDw0l#EL&>!tbj!?Oo4nuZIV4Vg3#jg)1&O@$OcLI zStqWdDl+Fyd&d;J-LRtq!s(~J>>}ve*~i^MT3OIPOQ`R8+53gp$oa4o#_{Va7H|bt zXj(onuLkX~EriO^ENt$6BBvhJV zzfZm{x21e)9;|fc0T-<4SLx;#LRc6`**@=`oclQD3UN?4eU(?$OIP22kAY>to342f zd7AP$LP`&~$prnXBa;lpf3_*_GR2mxeu)_Z9nl6z1z~thv+ay8%l-vPF zg4FBKeh*1dbSUNh$1n{wz^Y8@Uh!>F@Kn4{`jb@Q4>N}QGH`x_@MsB3AQ85*mQe_J zM}8DA__4Y*(5x;4eG9W@d^)dVt1Kci$Cv$;+6NwV-m+fg{pdfYYX=j zWkAPf`#7_}ao<|YiR?kjs&t0aUiaqbw%5+SezXEEY^W8QjruzCPoQOUp-ZB&X^~a~K+7^f0Xa!GZ0FLL1R$k~1|sjfYmzG7l{$ua^b%5F zq{ug|6MnitoV?bM?$0^&ten=`k{p~6WdLb;`lZEZ>u-OQ_EmKt#a=sQI2H)U#2%)o zE99SedH9*PXbqxXQvnD%hRg)LoQ+wP(V8_o$xclul7d}kqbicsazC$9|8;!PJ_u=J zqQ6asD&Ruee_hYT>|~~&aPtY*0!*GA3S&2wdAj@}{kIOk3xRJ~834J*>f7l$F5qR# z0tD|AcAk_0DIiCnZgw%l`bzA7!B@Y)DRRJ>(>HH4JuY%-I--)GxM#-Q54d3)6SM_4 z$_y>thahJTn8R>g{zJ+)b~$f=pOE0$6U(ks?tswg5|vApgNY|B?z2k*5|FyCuwX%E z%d1}VidPbEG7%a@UoNP(R0FcF${t8`6qS3g&a)%2Ep)# z7t$?)fH44@nUBKHU)2JN&&dD2l?NrEqU{Ko;y^W|ZqE3?5j3%wh**yV4#~gzm}9&w zAT7b^aQZct|HXOEI7WHNy@52;Zg8F-6#k+)zRvl2fE(Ia=X>eVza~it{o>cPy2?le=&?I{(0$DX{W_0ut%=Jh7#`t7D=>~k9Gu{nVst|Xv%iVvH&jsQjbknEMew- zE$#Z#9Uzzp%dhl`Kql9De6_u0hKJ*T&C@lBNA*$lr*)_2pmcOhs!PE$M}U4hCg}}6 zL+H^Df8cPeH)B5zNlj8rmkJS6r6VMY*r|mlbT{O1k7EBN?MXS#>u-^?50l0qn~lgH zO#;FTro3{3Qr{l0J9Z?KDYJqsJAMNn+1in1F$os!WZvslb z*XI$hz1n>iJQUg>Cs=QJE-C2SykbLl6aJ= 3.9 +%else +BuildRequires: python3 +%endif +BuildRequires: systemd-rpm-macros +%endif + +Requires: nvidia-driver-libs%{?_isa} = %{?epoch:%{epoch}:}%{version} +Requires: nvidia-kmod-common = %{?epoch:%{epoch}:}%{version} + +Conflicts: nvidia-x11-drv +Conflicts: nvidia-x11-drv-470xx +Conflicts: xorg-x11-drv-nvidia +Conflicts: xorg-x11-drv-nvidia-470xx + +%description +This package provides the most recent NVIDIA display driver which allows for +hardware accelerated rendering with recent NVIDIA chipsets. + +For the full product support list, please consult the release notes for driver +version %{version}. + +%package libs +Summary: Libraries for %{name} +Requires: egl-gbm%{?_isa} >= 2:1.1.2 +Requires: egl-wayland%{?_isa} >= 1.1.13.1 +Requires: egl-x11%{?_isa} +Requires: libvdpau%{?_isa} >= 0.5 +Requires: libglvnd%{?_isa} >= 1.0 +Requires: libglvnd-egl%{?_isa} >= 1.0 +Requires: libglvnd-gles%{?_isa} >= 1.0 +Requires: libglvnd-glx%{?_isa} >= 1.0 +Requires: libglvnd-opengl%{?_isa} >= 1.0 +Requires: libnvidia-ml%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Requires: vulkan-loader + +Conflicts: nvidia-x11-drv-libs +Conflicts: nvidia-x11-drv-470xx-libs +Conflicts: xorg-x11-drv-nvidia-libs +Conflicts: xorg-x11-drv-nvidia-470xx-libs + +%description libs +This package provides the shared libraries for %{name}. + +%package cuda-libs +Summary: Libraries for %{name}-cuda +Provides: %{name}-devel = %{?epoch:%{epoch}:}%{version}-%{release} +Obsoletes: %{name}-devel < %{?epoch:%{epoch}:}%{version}-%{release} +Requires: libnvidia-ml = %{?epoch:%{epoch}:}%{version}-%{release} + +%ifarch x86_64 aarch64 +Requires: libnvidia-cfg = %{?epoch:%{epoch}:}%{version}-%{release} +%endif + +Conflicts: xorg-x11-drv-nvidia-cuda-libs +Conflicts: xorg-x11-drv-nvidia-470xx-cuda-libs + +%description cuda-libs +This package provides the CUDA libraries for %{name}-cuda. + +%package -n libnvidia-fbc +Summary: NVIDIA OpenGL-based Framebuffer Capture libraries +Provides: nvidia-driver-NvFBCOpenGL = %{?epoch:%{epoch}:}%{version}-%{release} +Obsoletes: nvidia-driver-NvFBCOpenGL < %{?epoch:%{epoch}:}%{version}-%{release} +# Loads libnvidia-encode.so at runtime +Requires: %{name}-cuda-libs%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} + +%description -n libnvidia-fbc +This library provides a high performance, low latency interface to capture and +optionally encode the composited framebuffer of an X screen. NvFBC are private +APIs that are only available to NVIDIA approved partners for use in remote +graphics scenarios. + +%package -n libnvidia-ml +Summary: NVIDIA Management Library (NVML) +Provides: cuda-nvml%{?_isa} = %{?epoch:%{epoch}:}%{version}-%{release} +Provides: nvidia-driver-NVML = %{?epoch:%{epoch}:}%{version}-%{release} +Obsoletes: nvidia-driver-NVML < %{?epoch:%{epoch}:}%{version}-%{release} + +%description -n libnvidia-ml +A C-based API for monitoring and managing various states of the NVIDIA GPU +devices. It provides a direct access to the queries and commands exposed via +nvidia-smi. The run-time version of NVML ships with the NVIDIA display driver, +and the SDK provides the appropriate header, stub libraries and sample +applications. Each new version of NVML is backwards compatible and is intended +to be a platform for building 3rd party applications. + +%ifarch x86_64 aarch64 + +%package -n libnvidia-cfg +Summary: NVIDIA Config public interface (nvcfg) + +%description -n libnvidia-cfg +This package contains the private libnvidia-cfg runtime library which is used by +other driver components. + +%package cuda +Summary: CUDA integration for %{name} +Requires: %{name}-cuda-libs%{?_isa} = %{?epoch:%{epoch}:}%{version} +Requires: nvidia-kmod-common = %{?epoch:%{epoch}:}%{version} +Requires: nvidia-persistenced = %{?epoch:%{epoch}:}%{version} +Requires: opencl-filesystem +Requires: ocl-icd + +Conflicts: xorg-x11-drv-nvidia-cuda +Conflicts: xorg-x11-drv-nvidia-470xx-cuda + +%description cuda +This package provides the CUDA integration components for %{name}. + +%package -n xorg-x11-nvidia +Summary: X.org X11 NVIDIA driver and extensions +Requires: %{name}%{?_isa} = %{?epoch:%{epoch}:}%{version} +Requires: xorg-x11-server-Xorg%{?_isa} +Supplements: (nvidia-driver and xorg-x11-server-Xorg) + +Conflicts: xorg-x11-drv-nvidia +Conflicts: xorg-x11-drv-nvidia-470xx + +%description -n xorg-x11-nvidia +The NVIDIA X.org X11 driver and associated components. + +%endif + +%prep +sh %{SOURCE0} -x --target nvidia-driver-%{version}-%{_target_cpu} +%setup -T -D -n nvidia-driver-%{version}-%{_target_cpu} + +# Stuff not needed for packages: +# - Compiled from source +# - Interactive installer files +# - GLVND GL libraries +# - Internal development only libraries +rm -fr \ + nvidia-xconfig* \ + nvidia-persistenced* \ + nvidia-modprobe* \ + libnvidia-gtk* libnvidia-wayland-client* nvidia-settings* \ + libGLESv1_CM.so.* libGLESv2.so.* libGLdispatch.so.* libOpenGL.so.* libGLX.so.* libGL.so.1* libEGL.so.1* \ + libnvidia-egl-wayland.so.* libnvidia-egl-gbm.so.* libnvidia-egl-xcb.so.* libnvidia-egl-xlib.so.* \ + libOpenCL.so.1* \ + libEGL.so.${VERSION} \ + nvidia-installer* .manifest make* mk* tls_test* libglvnd_install_checker + +if [ "%{_arch}" == x86_64 ]; then + rm -fr \ + 32/libGLESv1_CM.so.* 32/libGLESv2.so.* 32/libGLdispatch.so.* 32/libOpenGL.so.* 32/libGLX.so.* 32/libGL.so.1* 32/libEGL.so.1* \ + 32/libOpenCL.so.1* \ + 32/libGL.so.${VERSION} 32/libEGL.so.${VERSION} \ + 32/libnvidia-egl-wayland.so.* 32/libnvidia-egl-gbm.so.* 32/libnvidia-egl-xcb.so.* 32/libnvidia-egl-xlib.so.* + + cp -f *.json* 32/ +fi + + +%ifarch x86_64 +%if 0%{?rhel} == 8 +rm -f libnvidia-pkcs11-openssl3.so.%{version} +%else +rm -f libnvidia-pkcs11.so.%{version} +%endif +%endif + +# Create symlinks for shared objects +ldconfig -vn . + +# Required for building gstreamer 1.0 NVENC plugins +ln -sf libnvidia-encode.so.%{version} libnvidia-encode.so + +# Required for building ffmpeg 3.1 Nvidia CUVID +ln -sf libnvcuvid.so.%{version} libnvcuvid.so + +# Required for building against CUDA +ln -sf libcuda.so.%{version} libcuda.so + +%build + +%install +# EGL loader +install -p -m 0644 -D 10_nvidia.json %{buildroot}%{_datadir}/glvnd/egl_vendor.d/10_nvidia.json + +# Vulkan loader +install -p -m 0644 -D nvidia_icd.json %{buildroot}%{_datadir}/vulkan/icd.d/nvidia_icd.%{_target_cpu}.json +sed -i -e 's|libGLX_nvidia|%{_libdir}/libGLX_nvidia|g' %{buildroot}%{_datadir}/vulkan/icd.d/nvidia_icd.%{_target_cpu}.json + +%ifarch x86_64 +# Vulkan SC loader and compiler +install -p -m 0644 -D nvidia_icd_vksc.json %{buildroot}%{_datadir}/vulkansc/icd.d/nvidia_icd.%{_target_cpu}.json +sed -i -e 's|libnvidia-vksc-core|%{_libdir}/libnvidia-vksc-core|g' %{buildroot}%{_datadir}/vulkansc/icd.d/nvidia_icd.%{_target_cpu}.json +install -p -m 0755 -D nvidia-pcc %{buildroot}%{_bindir}/nvidia-pcc +%endif + +# Unique libraries +mkdir -p %{buildroot}%{_libdir}/vdpau/ +cp -a lib*GL*_nvidia.so* libcuda*.so* libnv*.so* %{buildroot}%{_libdir}/ +cp -a libvdpau_nvidia.so* %{buildroot}%{_libdir}/vdpau/ + +%if 0%{?fedora} || 0%{?rhel} >= 9 +# GBM loader +mkdir -p %{buildroot}%{_libdir}/gbm/ +ln -sf ../libnvidia-allocator.so.%{version} %{buildroot}%{_libdir}/gbm/nvidia-drm_gbm.so +%endif + +%ifarch x86_64 + +# NGX Proton/Wine library +mkdir -p %{buildroot}%{_libdir}/nvidia/wine/ +cp -a *.dll %{buildroot}%{_libdir}/nvidia/wine/ + +%endif + +%ifarch x86_64 aarch64 + +# alternate-install-present file triggers runfile warning +install -m 0755 -d %{buildroot}/usr/lib/nvidia/ +install -p -m 0644 %{SOURCE13} %{buildroot}/usr/lib/nvidia/ + +# Empty? +mkdir -p %{buildroot}%{_sysconfdir}/nvidia/ + +# OpenCL config +install -p -m 0755 -D nvidia.icd %{buildroot}%{_sysconfdir}/OpenCL/vendors/nvidia.icd + +# Binaries +mkdir -p %{buildroot}%{_bindir} +install -p -m 0755 nvidia-{debugdump,smi,cuda-mps-control,cuda-mps-server,bug-report.sh,ngx-updater,powerd} %{buildroot}%{_bindir} + +# Man pages +mkdir -p %{buildroot}%{_mandir}/man1/ +install -p -m 0644 nvidia-{smi,cuda-mps-control}*.gz %{buildroot}%{_mandir}/man1/ + +# X stuff +install -p -m 0644 -D %{SOURCE10} %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/10-nvidia.conf +install -p -m 0755 -D nvidia_drv.so %{buildroot}%{_libdir}/xorg/modules/drivers/nvidia_drv.so +install -p -m 0755 -D libglxserver_nvidia.so.%{version} %{buildroot}%{_libdir}/xorg/modules/extensions/libglxserver_nvidia.so + +# NVIDIA specific configuration files +mkdir -p %{buildroot}%{_datadir}/nvidia/ +install -p -m 0644 nvidia-application-profiles-%{version}-key-documentation \ + %{buildroot}%{_datadir}/nvidia/ +install -p -m 0644 nvidia-application-profiles-%{version}-rc \ + %{buildroot}%{_datadir}/nvidia/ + +# OptiX +install -p -m 0644 nvoptix.bin %{buildroot}%{_datadir}/nvidia/ + +# Systemd units and script for suspending/resuming +mkdir -p %{buildroot}%{_systemd_util_dir}/system-preset/ +install -p -m 0644 %{SOURCE8} %{SOURCE9} %{buildroot}%{_systemd_util_dir}/system-preset/ +mkdir -p %{buildroot}%{_unitdir}/ +install -p -m 0644 systemd/system/*.service %{buildroot}%{_unitdir}/ +install -p -m 0755 systemd/nvidia-sleep.sh %{buildroot}%{_bindir}/ +install -p -m 0755 -D systemd/system-sleep/nvidia %{buildroot}%{_systemd_util_dir}/system-sleep/nvidia +install -p -m 0644 -D nvidia-dbus.conf %{buildroot}%{_datadir}/dbus-1/system.d/nvidia-dbus.conf + +%if 0%{?fedora} >= 41 +mkdir -p %{buildroot}%{_unitdir}/systemd-suspend.service.d/ +cat > %{buildroot}%{_unitdir}/systemd-suspend.service.d/10-nvidia.conf << EOF +[Service] +Environment="SYSTEMD_SLEEP_FREEZE_USER_SESSIONS=false" +EOF +mkdir -p %{buildroot}%{_unitdir}/systemd-homed.service.d/ +cat > %{buildroot}%{_unitdir}/systemd-homed.service.d/10-nvidia.conf << EOF +[Service] +Environment="SYSTEMD_HOME_LOCK_FREEZE_SESSION=false" +EOF +%endif + +# Ignore powerd binary exiting if hardware is not present +# We should check for information in the DMI table +sed -i -e 's/ExecStart=/ExecStart=-/g' %{buildroot}%{_unitdir}/nvidia-powerd.service + +# Vulkan layer +install -p -m 0644 -D nvidia_layers.json %{buildroot}%{_datadir}/vulkan/implicit_layer.d/nvidia_layers.json + +# Install AppData and add modalias provides, do not use appstream-util add-provide as it mangles the xml +install -p -m 0644 -D %{SOURCE40} %{buildroot}%{_metainfodir}/com.nvidia.driver.metainfo.xml +%{SOURCE41} supported-gpus/supported-gpus.json %{buildroot}%{_metainfodir}/com.nvidia.driver.metainfo.xml +mkdir -p %{buildroot}%{_datadir}/pixmaps/ +cp %{SOURCE42} %{buildroot}%{_datadir}/pixmaps/ + +%check +# Using appstreamcli: appstreamcli validate --strict +# Icon type local is not supported by appstreamcli for drivers +appstream-util validate --nonet %{buildroot}%{_metainfodir}/com.nvidia.driver.metainfo.xml + +%endif + +%ifarch x86_64 aarch64 + +%post +%systemd_post nvidia-hibernate.service +%systemd_post nvidia-powerd.service +%systemd_post nvidia-resume.service +%systemd_post nvidia-suspend.service + +%preun +%systemd_preun nvidia-hibernate.service +%systemd_preun nvidia-powerd.service +%systemd_preun nvidia-resume.service +%systemd_preun nvidia-suspend.service + +%postun +%systemd_postun nvidia-hibernate.service +%systemd_postun nvidia-powerd.service +%systemd_postun nvidia-resume.service +%systemd_postun nvidia-suspend.service + +%endif + +%ifarch x86_64 aarch64 + +%files +%license LICENSE +%doc NVIDIA_Changelog README.txt html supported-gpus/supported-gpus.json +%dir %{_sysconfdir}/nvidia +%{_bindir}/nvidia-bug-report.sh +%{_bindir}/nvidia-ngx-updater +%ifarch x86_64 +%{_bindir}/nvidia-pcc +%endif +%{_bindir}/nvidia-powerd +%{_bindir}/nvidia-sleep.sh +%{_metainfodir}/com.nvidia.driver.metainfo.xml +%{_datadir}/dbus-1/system.d/nvidia-dbus.conf +%{_datadir}/nvidia/nvidia-application-profiles* +%{_datadir}/pixmaps/com.nvidia.driver.png +%{_systemd_util_dir}/system-preset/70-nvidia-driver.preset +%{_systemd_util_dir}/system-sleep/nvidia +%{_unitdir}/nvidia-hibernate.service +%{_unitdir}/nvidia-powerd.service +%{_unitdir}/nvidia-resume.service +%{_unitdir}/nvidia-suspend.service +%if 0%{?fedora} >= 41 +%{_unitdir}/systemd-suspend.service.d/10-nvidia.conf +%{_unitdir}/systemd-homed.service.d/10-nvidia.conf +%endif + +%files -n xorg-x11-nvidia +%config(noreplace) %{_sysconfdir}/X11/xorg.conf.d/10-nvidia.conf +%{_libdir}/xorg/modules/extensions/libglxserver_nvidia.so +%{_libdir}/xorg/modules/drivers/nvidia_drv.so + +%files -n libnvidia-cfg +%{_libdir}/libnvidia-cfg.so.1 +%{_libdir}/libnvidia-cfg.so.%{version} + +%files cuda +%{_sysconfdir}/OpenCL/vendors/* +%{_bindir}/nvidia-cuda-mps-control +%{_bindir}/nvidia-cuda-mps-server +%{_bindir}/nvidia-debugdump +%{_bindir}/nvidia-smi +%{_mandir}/man1/nvidia-cuda-mps-control.1.* +%{_mandir}/man1/nvidia-smi.* +%{_prefix}/lib/nvidia/alternate-install-present +%{_systemd_util_dir}/system-preset/70-nvidia-driver-cuda.preset + +%endif + +%files libs +%{_datadir}/glvnd/egl_vendor.d/10_nvidia.json +%{_datadir}/vulkan/icd.d/nvidia_icd.%{_target_cpu}.json +%if 0%{?fedora} || 0%{?rhel} >= 9 +%dir %{_libdir}/gbm +%{_libdir}/gbm/nvidia-drm_gbm.so +%endif +%{_libdir}/libEGL_nvidia.so.0 +%{_libdir}/libEGL_nvidia.so.%{version} +%{_libdir}/libGLESv1_CM_nvidia.so.1 +%{_libdir}/libGLESv1_CM_nvidia.so.%{version} +%{_libdir}/libGLESv2_nvidia.so.2 +%{_libdir}/libGLESv2_nvidia.so.%{version} +%{_libdir}/libGLX_nvidia.so.0 +%{_libdir}/libGLX_nvidia.so.%{version} +%{_libdir}/libnvidia-allocator.so.1 +%{_libdir}/libnvidia-allocator.so.%{version} +%{_libdir}/libnvidia-eglcore.so.%{version} +%{_libdir}/libnvidia-glcore.so.%{version} +%{_libdir}/libnvidia-glsi.so.%{version} +%{_libdir}/libnvidia-glvkspirv.so.%{version} +%{_libdir}/libnvidia-gpucomp.so.%{version} +%{_libdir}/libnvidia-tls.so.%{version} +%{_libdir}/vdpau/libvdpau_nvidia.so.1 +%{_libdir}/vdpau/libvdpau_nvidia.so.%{version} +%ifarch x86_64 aarch64 +%{_datadir}/nvidia/nvoptix.bin +%{_datadir}/vulkan/implicit_layer.d/nvidia_layers.json +%{_libdir}/libnvidia-api.so.1 +%{_libdir}/libnvidia-ngx.so.1 +%{_libdir}/libnvidia-ngx.so.%{version} +%{_libdir}/libnvidia-rtcore.so.%{version} +%{_libdir}/libnvoptix.so.1 +%{_libdir}/libnvoptix.so.%{version} +%endif +%ifarch x86_64 +%{_datadir}/vulkansc/icd.d/nvidia_icd.%{_target_cpu}.json +%{_libdir}/libnvidia-vksc-core.so.1 +%{_libdir}/libnvidia-vksc-core.so.%{version} +%dir %{_libdir}/nvidia +%dir %{_libdir}/nvidia/wine +%{_libdir}/nvidia/wine/*.dll +%endif + +%files cuda-libs +%{_libdir}/libcuda.so +%{_libdir}/libcuda.so.1 +%{_libdir}/libcuda.so.%{version} +%{_libdir}/libnvcuvid.so +%{_libdir}/libnvcuvid.so.1 +%{_libdir}/libnvcuvid.so.%{version} +%{_libdir}/libnvidia-encode.so +%{_libdir}/libnvidia-encode.so.1 +%{_libdir}/libnvidia-encode.so.%{version} +%{_libdir}/libnvidia-nvvm.so.4 +%{_libdir}/libnvidia-nvvm.so.%{version} +%{_libdir}/libnvidia-opencl.so.1 +%{_libdir}/libnvidia-opencl.so.%{version} +%{_libdir}/libnvidia-opticalflow.so.1 +%{_libdir}/libnvidia-opticalflow.so.%{version} +%{_libdir}/libnvidia-ptxjitcompiler.so.1 +%{_libdir}/libnvidia-ptxjitcompiler.so.%{version} +%ifarch x86_64 aarch64 +%{_libdir}/libcudadebugger.so.1 +%{_libdir}/libcudadebugger.so.%{version} +%endif +%ifarch x86_64 +%if 0%{?rhel} == 8 +%{_libdir}/libnvidia-pkcs11.so.%{version} +%else +%{_libdir}/libnvidia-pkcs11-openssl3.so.%{version} +%endif +%{_libdir}/libnvidia-sandboxutils.so.1 +%{_libdir}/libnvidia-sandboxutils.so.%{version} +%endif + +%files -n libnvidia-fbc +%{_libdir}/libnvidia-fbc.so.1 +%{_libdir}/libnvidia-fbc.so.%{version} + +%files -n libnvidia-ml +%{_libdir}/libnvidia-ml.so.1 +%{_libdir}/libnvidia-ml.so.%{version} + +%changelog +* Thu Dec 05 2024 Simone Caronni - 3:565.77-1 +- Update to 565.77. + +* Mon Nov 25 2024 Simone Caronni - 3:565.57.01-5 +- Switch back to local icon. + +* Fri Nov 15 2024 Simone Caronni - 3:565.57.01-4 +- Do not manipulate appstream metadata using libappstream-glib. + +* Sat Nov 09 2024 Simone Caronni - 3:565.57.01-3 +- Switch to remote icon for Appstream metadata. "appstremcli validate", instead + of "appstream-util validate", prints out that local is not a valid icon type, + even if the documentation says so. + +* Sun Oct 27 2024 Simone Caronni - 3:565.57.01-2 +- Add workaround for system sleep on systemd 256+. + +* Wed Oct 23 2024 Simone Caronni - 3:565.57.01-1 +- Update to 565.57.01. + +* Thu Oct 10 2024 Simone Caronni - 3:560.35.03-4 +- Enable nvidia-persistenced by default if installed through a systemd preset. + +* Wed Sep 04 2024 Simone Caronni - 3:560.35.03-3 +- Unbundle nvidia-egl-platform-base. + +* Fri Aug 30 2024 Simone Caronni - 3:560.35.03-2 +- Split out X.org components. + +* Wed Aug 21 2024 Simone Caronni - 3:560.35.03-1 +- Update to 560.35.03. + +* Tue Aug 06 2024 Simone Caronni - 3:560.31.02-1 +- Update to 560.31.02. +- Update EGL requirements. + +* Mon Aug 05 2024 Simone Caronni - 3:560.28.03-1 +- Update to 560.28.03. +- Add Vulkan Safety Critical library and offline Pipeline Cache Compiler. +- Temporarily add new EGL libraries. + +* Mon Jul 15 2024 Simone Caronni - 3:555.58.02-3 +- Provider of cuda-nvml still needs _isa. + +* Sat Jul 13 2024 Simone Caronni - 3:555.58.02-2 +- Remove isa Provides/Requires. + +* Tue Jul 02 2024 Simone Caronni - 3:555.58.02-1 +- Update to 555.58.02. +- Reorganize some libraries that get dynamically opened by other components. + +* Sat Jun 29 2024 Simone Caronni - 3:555.58-4 +- Adjust Appstream icon path. + +* Fri Jun 28 2024 Simone Caronni - 3:555.58-3 +- Switch to local icon for Appstream metadata before madness takes over. + +* Fri Jun 28 2024 Simone Caronni - 3:555.58-2 +- Make sure there are no redirects in the Appstream metadata URLs. + +* Thu Jun 27 2024 Simone Caronni - 3:555.58-1 +- Update to 555.58. + +* Wed Jun 26 2024 Simone Caronni - 3:555.52.04-2 +- Update AppData metadata, add new custom key entry: + https://gitlab.gnome.org/GNOME/gnome-software/-/merge_requests/2034 + +* Thu Jun 06 2024 Simone Caronni +- Update to 555.52.04. + +* Fri May 31 2024 Simone Caronni - 3:555.42.02-3 +- Fix file format specification for Vulkan layers. + +* Mon May 27 2024 Simone Caronni - 3:555.42.02-2 +- Add GBM loader library symlink also for i686 libraries (#156). +- Also own the %%_libdir/gbm directory. + +* Wed May 22 2024 Simone Caronni - 3:555.42.02-1 +- Update to 555.42.02. + +* Fri Apr 26 2024 Simone Caronni - 3:550.78-1 +- Update to 550.78. + +* Fri Apr 26 2024 Simone Caronni - 3:550.76-2 +- Install Vulkan loader in a more similar way to Mesa packages. + +* Thu Apr 18 2024 Simone Caronni - 3:550.76-1 +- Update to 550.76. + +* Mon Apr 15 2024 Simone Caronni - 3:550.67-2 +- Fix egl requirements. + +* Sun Mar 24 2024 Simone Caronni - 3:550.67-1 +- Update to 550.67. + +* Thu Mar 14 2024 Simone Caronni - 3:550.54.14-3 +- Clean up SPEC file. + +* Fri Mar 08 2024 Simone Caronni - 3:550.54.14-2 +- Add support for aarch64. +- Clean up SPEC file. + +* Sun Mar 03 2024 Simone Caronni - 3:550.54.14-1 +- Update to 550.54.14. + +* Thu Feb 22 2024 Simone Caronni - 3:550.40.07-1 +- Update to 550.40.07. + +* Fri Feb 16 2024 Simone Caronni - 3:545.29.06-3 +- Re-add explicit egl-wayland dependency (reverts + cd6f2b9044d90f71f94fa91be1cc0cad343a1560). + +* Mon Dec 18 2023 Simone Caronni - 3:545.29.06-2 +- Do not mark nvidia-powerd unit as failed if the binary exits. + +* Fri Dec 01 2023 Simone Caronni - 3:545.29.06-1 +- Update to 545.29.06. + +* Mon Nov 13 2023 Simone Caronni - 3:545.29.02-2 +- Create kernel module tarball with proprietary and open source modules. + +* Tue Oct 31 2023 Simone Caronni - 3:545.29.02-1 +- Update to 545.29.02. + +* Wed Oct 18 2023 Simone Caronni - 3:545.23.06-1 +- Update to 545.23.06. + +* Fri Sep 22 2023 Simone Caronni - 3:535.113.01-1 +- Update to 535.113.01. + +* Thu Aug 24 2023 Simone Caronni - 3:535.104.05-1 +- Update to 535.104.05. + +* Wed Aug 09 2023 Simone Caronni - 3:535.98-1 +- Update to 535.98. + +* Wed Jul 19 2023 Simone Caronni - 3:535.86.05-1 +- Update to 535.86.05. + +* Thu Jun 15 2023 Simone Caronni - 3:535.54.03-1 +- Update to 535.54.03. + +* Tue Jun 13 2023 Simone Caronni - 3:535.43.02-1 +- Update to 535.43.02. + +* Fri Mar 24 2023 Simone Caronni - 3:530.41.03-1 +- Update to 530.41.03. + +* Wed Mar 08 2023 Simone Caronni - 3:530.30.02-1 +- Update to 530.30.02. + +* Fri Feb 10 2023 Simone Caronni - 3:525.89.02-1 +- Update to 525.89.02. + +* Fri Jan 20 2023 Simone Caronni - 3:525.85.05-1 +- Update to 525.85.05. + +* Mon Jan 09 2023 Simone Caronni - 3:525.78.01-1 +- Update to 525.78.01. + +* Tue Dec 13 2022 Simone Caronni - 3:525.60.11-2 +- Drop nvidia-driver-devel subpackage. +- Trim changelog. + +* Tue Nov 29 2022 Simone Caronni - 3:525.60.11-1 +- Update to 525.60.11. + +* Thu Oct 13 2022 Simone Caronni - 3:520.56.06-1 +- Update to 520.56.06. + +* Wed Sep 21 2022 Simone Caronni - 3:515.76-1 +- Update to 515.76. + +* Mon Aug 08 2022 Simone Caronni - 3:515.65.01-1 +- Update to 515.65.01. + +* Wed Jun 29 2022 Simone Caronni - 3:515.57-1 +- Update to 515.57. + +* Wed Jun 01 2022 Simone Caronni - 3:515.48.07-1 +- Update to 515.48.07. + +* Sun May 15 2022 Simone Caronni - 3:515.43.04-2 +- Rename libnvidia-vulkan-producer.so versioned library (#128). + +* Thu May 12 2022 Simone Caronni - 3:515.43.04-1 +- Update to 515.43.04. + +* Mon May 02 2022 Simone Caronni - 3:510.68.02-1 +- Update to 510.68.02. + +* Mon Mar 28 2022 Simone Caronni - 3:510.60.02-1 +- Update to 510.60.02. + +* Thu Mar 03 2022 Simone Caronni - 3:510.54-3 +- nvidia-resume is no longer triggered by nvidia-sleep.sh. + +* Fri Feb 25 2022 Simone Caronni - 3:510.54-2 +- nvidia-smi dlopens NVML, add explicit dependency to cuda subpackage. + +* Mon Feb 14 2022 Simone Caronni - 3:510.54-1 +- Update to 510.54. + +* Sat Feb 12 2022 Simone Caronni - 3:510.47.03-4 +- Drop libva-vdpau-driver hard dependency. + +* Mon Feb 07 2022 Simone Caronni - 3:510.47.03-3 +- Fix GBM condition. + +* Sat Feb 05 2022 Simone Caronni - 3:510.47.03-2 +- Drop explicit dependency on egl-wayland, it's auto generated and not needed on + i686 libs. Minimum version 1.1.7 required. + +* Wed Feb 02 2022 Simone Caronni - 3:510.47.03-1 +- Update to 510.47.03. +- Use external GBM library. +- Install GBM only on CentOS/RHEL 9+ and Fedora 35. It's also supported in + CentOS Stream 8 (8.6+/Mesa 21.2), but there's no easy way to check for Stream + in the SPEC file. diff --git a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh new file mode 100755 index 0000000000..dc53fd3c16 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh @@ -0,0 +1,107 @@ +#!/bin/sh +set -e + +set_vars() { + export VERSION=${VERSION:-565.77} + export DL_SITE=${DL_SITE:-http://download.nvidia.com/XFree86} + export TEMP_UNPACK=${ARCH} + export PLATFORM=Linux-${ARCH} + export RUN_FILE=NVIDIA-${PLATFORM}-${VERSION}.run +} + +run_file_get() { + printf "Downloading installer ${RUN_FILE}... " + [[ -f $RUN_FILE ]] || wget -c -q ${DL_SITE}/${PLATFORM}/${VERSION}/$RUN_FILE + printf "OK\n" +} + +run_file_extract() { + rm -fr ${TEMP_UNPACK} + sh ${RUN_FILE} --extract-only --target ${TEMP_UNPACK} +} + +cleanup_folder() { + + printf "Cleaning up binaries... " + + cd ${TEMP_UNPACK} + + # Stuff not needed for packages: + # - Compiled from source + # - Interactive installer files + # - GLVND GL libraries + # - Internal development only libraries + rm -fr \ + nvidia-xconfig* \ + nvidia-persistenced* \ + nvidia-modprobe* \ + libnvidia-gtk* libnvidia-wayland-client* nvidia-settings* \ + libGLESv1_CM.so.* libGLESv2.so.* libGLdispatch.so.* libOpenGL.so.* libGLX.so.* libGL.so.1* libEGL.so.1* \ + libnvidia-egl-wayland.so.* libnvidia-egl-gbm.so.* libnvidia-egl-xcb.so.* libnvidia-egl-xlib.so.* \ + libOpenCL.so.1* \ + libEGL.so.${VERSION} \ + nvidia-installer* .manifest make* mk* tls_test* libglvnd_install_checker + + if [ "${ARCH}" == x86_64 ]; then + rm -fr \ + 32/libGLESv1_CM.so.* 32/libGLESv2.so.* 32/libGLdispatch.so.* 32/libOpenGL.so.* 32/libGLX.so.* 32/libGL.so.1* 32/libEGL.so.1* \ + 32/libOpenCL.so.1* \ + 32/libGL.so.${VERSION} 32/libEGL.so.${VERSION} \ + 32/libnvidia-egl-wayland.so.* 32/libnvidia-egl-gbm.so.* 32/libnvidia-egl-xcb.so.* 32/libnvidia-egl-xlib.so.* + + cp -f *.json* 32/ + fi + + cd .. + + printf "OK\n" +} + +create_tarball() { + + KMOD=nvidia-kmod-${VERSION}-${ARCH} + KMOD_COMMON=nvidia-kmod-common-${VERSION} + USR_64=nvidia-driver-${VERSION}-${ARCH} + + mkdir ${KMOD} ${KMOD_COMMON} ${USR_64} + mv ${TEMP_UNPACK}/kernel* ${KMOD}/ + mv ${TEMP_UNPACK}/firmware ${KMOD_COMMON}/ + + if [ "$ARCH" == x86_64 ]; then + + USR_32=nvidia-driver-${VERSION}-i386 + + mkdir ${USR_32} + mv ${TEMP_UNPACK}/32/* ${USR_32}/ + rm -fr ${TEMP_UNPACK}/32 + + fi + + mv ${TEMP_UNPACK}/* ${USR_64}/ + + rm -fr ${TEMP_UNPACK} + + for tarball in ${KMOD} ${KMOD_COMMON} ${USR_64} ${USR_32}; do + + printf "Creating tarball $tarball... " + + XZ_OPT='-T0' tar --remove-files -cJf $tarball.tar.xz $tarball + + printf "OK\n" + + done +} + +ARCH=aarch64 +set_vars +run_file_get +run_file_extract +cleanup_folder +create_tarball + +ARCH=x86_64 +set_vars +run_file_get +run_file_extract +cleanup_folder +create_tarball diff --git a/anda/system/nvidia/nvidia-driver/parse-supported-gpus.py b/anda/system/nvidia/nvidia-driver/parse-supported-gpus.py new file mode 100755 index 0000000000..cb2feef6c3 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/parse-supported-gpus.py @@ -0,0 +1,43 @@ +#!/usr/bin/python3 +# -*- coding: utf-8 -*- +# +# Copyright (C) 2021-2024 Simone Caronni +# Licensed under the GNU General Public License Version or later + +import json +import sys +import xml.etree.ElementTree as ElementTree + +def main(): + if len(sys.argv) != 3: + print("usage: %s supported-gpus.json com.nvidia.driver.metainfo.xml" % sys.argv[0]) + return 1 + + json_input = open(sys.argv[1]) + gpus_raw = json.load(json_input) + legacy = 'legacybranch' + devids = [] + + for product in gpus_raw["chips"]: + + if legacy not in product.keys(): + + devid = int(product["devid"], 16) + if not devid in devids: + devids.append(devid) + + appstream_xml = ElementTree.parse(sys.argv[2]) + root = appstream_xml.getroot() + provides = ElementTree.Element('provides') + root.append(provides) + + for devid in devids: + modalias = ElementTree.SubElement(provides, "modalias") + modalias.text = "pci:v000010DEd%08Xsv*sd*bc*sc*i*" % (devid) + + ElementTree.indent(root, space=" ", level=0) + # appstream-util validate requires the xml header + appstream_xml.write(sys.argv[2], encoding="utf-8", xml_declaration=True) + +if __name__ == "__main__": + main() From 08cd2e5316231b38170c7a069b551689d3d13eb2 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 18:40:19 +0700 Subject: [PATCH 09/23] I don't think we actually need i386 --- anda/system/nvidia/nvidia-driver/anda.hcl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/system/nvidia/nvidia-driver/anda.hcl b/anda/system/nvidia/nvidia-driver/anda.hcl index faf50fcdbc..9a6fa84649 100644 --- a/anda/system/nvidia/nvidia-driver/anda.hcl +++ b/anda/system/nvidia/nvidia-driver/anda.hcl @@ -2,5 +2,5 @@ project "pkg" { rpm { spec = "nvidia-driver.spec" } - arches = ["x86_64", "aarch64", "i386"] + arches = ["x86_64", "aarch64"] } \ No newline at end of file From 7310882dc75122883795b6a242357218d0a9b827 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Fri, 3 Jan 2025 19:04:02 +0700 Subject: [PATCH 10/23] add a readme, fix build error and clean up script --- anda/system/nvidia/README.md | 43 +++++++ .../nvidia/nvidia-driver/nvidia-driver.spec | 1 - .../nvidia-driver/nvidia-generate-tarballs.sh | 107 ------------------ .../nvidia-kmod-common.spec | 6 +- 4 files changed, 46 insertions(+), 111 deletions(-) create mode 100644 anda/system/nvidia/README.md delete mode 100755 anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh diff --git a/anda/system/nvidia/README.md b/anda/system/nvidia/README.md new file mode 100644 index 0000000000..c0fe5a7a8a --- /dev/null +++ b/anda/system/nvidia/README.md @@ -0,0 +1,43 @@ +# The Terra NVIDIA Driver tree + +This directory contains the Terra distribution of NVIDIA drivers. + +These driver packages are based on negativo17's NVIDIA driver packages for Fedora, with very slight modifications for hardware compatibility, and conforming to the Terra packaging guidelines. + +Unlike negativo17 and Nobara, we do not manually generate a tarball of the NVIDIA drivers, but directly generate them +on-the-fly from the NVIDIA installer. This ensures that the packages can be easily maintained and updated, as long as the +self-extracting NVIDIA installer still has the same command-line options. + +One major difference for Terra's distro is that we install the closed-source kernel modules by default, instead of the newer open-source kernel modules. This is because the open-source modules only support GPUs that have a GSP (GPU System Processor), which only includes Turing (RTX 20 series) and newer GPUs. As we would like to still support older GPUs, we install the closed-source modules by default. + +## How Terra unpacks the self-extracting archive + +Instead of pre-generating the tarball, we run the NVIDIA installer with the `-x` flag to extract the contents directly to the build directory. We then make use of an RPM macro to set the new build directory as that tree. + +```rpmspec +Source0: http://download.nvidia.com/XFree86/Linux-%{_arch}/%{version}/NVIDIA-Linux-%{_arch}-%{version}.run + + +... skip to the %prep section ... + +%prep +sh %{SOURCE0} -x --target nvidia-driver-%{version} +%setup -T -D -n nvidia-driver-%{version} + +%build + +... Build the package as usual ... + +``` + +This is simpler than manually generating the tarball, but comes with a slight cost of having to download the NVIDIA installer every time we build any package that relies on that archive. + +## Support + +If you have any issues with the NVIDIA drivers, please file an issue on the [Terra Monorepo](https://github.com/terrapkg/packages/issues). We will try to help you as best as we can. + +## License + +The NVIDIA drivers are licensed under the NVIDIA Software License. Please refer to the [NVIDIA Software License](https://www.nvidia.com/content/DriverDownload-March2009/licence.php?lang=us) for more information. + +We do not modify the actual NVIDIA drivers in any way, only providing a re-packaged version compatible with Ultramarine and Fedora. diff --git a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec index 4052572764..08556a25ce 100644 --- a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec +++ b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec @@ -36,7 +36,6 @@ Source40: com.nvidia.driver.metainfo.xml Source41: parse-supported-gpus.py Source42: com.nvidia.driver.png -Source99: nvidia-generate-tarballs.sh %ifarch x86_64 aarch64 BuildRequires: libappstream-glib diff --git a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh deleted file mode 100755 index dc53fd3c16..0000000000 --- a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh +++ /dev/null @@ -1,107 +0,0 @@ -#!/bin/sh -set -e - -set_vars() { - export VERSION=${VERSION:-565.77} - export DL_SITE=${DL_SITE:-http://download.nvidia.com/XFree86} - export TEMP_UNPACK=${ARCH} - export PLATFORM=Linux-${ARCH} - export RUN_FILE=NVIDIA-${PLATFORM}-${VERSION}.run -} - -run_file_get() { - printf "Downloading installer ${RUN_FILE}... " - [[ -f $RUN_FILE ]] || wget -c -q ${DL_SITE}/${PLATFORM}/${VERSION}/$RUN_FILE - printf "OK\n" -} - -run_file_extract() { - rm -fr ${TEMP_UNPACK} - sh ${RUN_FILE} --extract-only --target ${TEMP_UNPACK} -} - -cleanup_folder() { - - printf "Cleaning up binaries... " - - cd ${TEMP_UNPACK} - - # Stuff not needed for packages: - # - Compiled from source - # - Interactive installer files - # - GLVND GL libraries - # - Internal development only libraries - rm -fr \ - nvidia-xconfig* \ - nvidia-persistenced* \ - nvidia-modprobe* \ - libnvidia-gtk* libnvidia-wayland-client* nvidia-settings* \ - libGLESv1_CM.so.* libGLESv2.so.* libGLdispatch.so.* libOpenGL.so.* libGLX.so.* libGL.so.1* libEGL.so.1* \ - libnvidia-egl-wayland.so.* libnvidia-egl-gbm.so.* libnvidia-egl-xcb.so.* libnvidia-egl-xlib.so.* \ - libOpenCL.so.1* \ - libEGL.so.${VERSION} \ - nvidia-installer* .manifest make* mk* tls_test* libglvnd_install_checker - - if [ "${ARCH}" == x86_64 ]; then - rm -fr \ - 32/libGLESv1_CM.so.* 32/libGLESv2.so.* 32/libGLdispatch.so.* 32/libOpenGL.so.* 32/libGLX.so.* 32/libGL.so.1* 32/libEGL.so.1* \ - 32/libOpenCL.so.1* \ - 32/libGL.so.${VERSION} 32/libEGL.so.${VERSION} \ - 32/libnvidia-egl-wayland.so.* 32/libnvidia-egl-gbm.so.* 32/libnvidia-egl-xcb.so.* 32/libnvidia-egl-xlib.so.* - - cp -f *.json* 32/ - fi - - cd .. - - printf "OK\n" -} - -create_tarball() { - - KMOD=nvidia-kmod-${VERSION}-${ARCH} - KMOD_COMMON=nvidia-kmod-common-${VERSION} - USR_64=nvidia-driver-${VERSION}-${ARCH} - - mkdir ${KMOD} ${KMOD_COMMON} ${USR_64} - mv ${TEMP_UNPACK}/kernel* ${KMOD}/ - mv ${TEMP_UNPACK}/firmware ${KMOD_COMMON}/ - - if [ "$ARCH" == x86_64 ]; then - - USR_32=nvidia-driver-${VERSION}-i386 - - mkdir ${USR_32} - mv ${TEMP_UNPACK}/32/* ${USR_32}/ - rm -fr ${TEMP_UNPACK}/32 - - fi - - mv ${TEMP_UNPACK}/* ${USR_64}/ - - rm -fr ${TEMP_UNPACK} - - for tarball in ${KMOD} ${KMOD_COMMON} ${USR_64} ${USR_32}; do - - printf "Creating tarball $tarball... " - - XZ_OPT='-T0' tar --remove-files -cJf $tarball.tar.xz $tarball - - printf "OK\n" - - done -} - -ARCH=aarch64 -set_vars -run_file_get -run_file_extract -cleanup_folder -create_tarball - -ARCH=x86_64 -set_vars -run_file_get -run_file_extract -cleanup_folder -create_tarball diff --git a/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec b/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec index 466d31a5fd..43371a07c5 100644 --- a/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec +++ b/anda/system/nvidia/nvidia-kmod-common/nvidia-kmod-common.spec @@ -16,7 +16,7 @@ URL: http://www.nvidia.com/object/unix.html BuildArch: noarch -Source0: http://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-%{_arch}-%{version}.run +Source0: http://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run Source17: nvidia-boot-update Source18: kernel.conf Source19: nvidia-modeset.conf @@ -39,8 +39,8 @@ This package provides the common files required by all NVIDIA kernel module package variants. %prep -sh %{SOURCE0} -x --target nvidia-kmod-%{version}-%{_arch} -%setup -T -D -n nvidia-kmod-%{version}-%{_arch} +sh %{SOURCE0} -x --target nvidia-kmod-%{version}-x86_64 +%setup -T -D -n nvidia-kmod-%{version}-x86_64 %install # Script for post/preun tasks From 0ed6da2895fea690a6f04e68e1f9004dcc648304 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 02:57:32 +0700 Subject: [PATCH 11/23] add back the accursed tarball script, we can port the thing later --- anda/system/nvidia/nvidia-driver/.gitignore | 4 + anda/system/nvidia/nvidia-driver/anda.hcl | 5 +- .../nvidia/nvidia-driver/nvidia-driver.spec | 52 +++----- .../nvidia-driver/nvidia-generate-tarballs.sh | 111 ++++++++++++++++++ 4 files changed, 133 insertions(+), 39 deletions(-) create mode 100644 anda/system/nvidia/nvidia-driver/.gitignore create mode 100755 anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh diff --git a/anda/system/nvidia/nvidia-driver/.gitignore b/anda/system/nvidia/nvidia-driver/.gitignore new file mode 100644 index 0000000000..cfb0b7a5cd --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/.gitignore @@ -0,0 +1,4 @@ +nvidia*/ +NVIDIA*/ +*.tar.* +*.run \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-driver/anda.hcl b/anda/system/nvidia/nvidia-driver/anda.hcl index 9a6fa84649..bf45a257bf 100644 --- a/anda/system/nvidia/nvidia-driver/anda.hcl +++ b/anda/system/nvidia/nvidia-driver/anda.hcl @@ -1,6 +1,9 @@ project "pkg" { rpm { spec = "nvidia-driver.spec" + # We run the negativo17 generator script here because I genuinely tried fixing the spec file with our fancy patch and it didn't work + # TODO: Port it inside the specfile scripts + pre_script = "nvidia-generate-tarballs.sh" } - arches = ["x86_64", "aarch64"] + arches = ["x86_64", "aarch64", "i386"] } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec index 08556a25ce..96e237c79d 100644 --- a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec +++ b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec @@ -3,15 +3,6 @@ %global __brp_ldconfig %{nil} %define _build_id_links none -# We're gonna assume for now that we only build for -# x86_64 + x86 and aarch64 - -%ifarch x86_64 aarch64 -%global _target_cpu %{_arch} -%else -%global _target_cpu x86 -%endif - # systemd 248+ %if 0%{?rhel} == 8 %global _systemd_util_dir %{_prefix}/lib/systemd @@ -26,7 +17,9 @@ License: NVIDIA License URL: http://www.nvidia.com/object/unix.html ExclusiveArch: %{ix86} x86_64 aarch64 -Source0: http://download.nvidia.com/XFree86/Linux-%{_target_cpu}/%{version}/NVIDIA-Linux-%{_target_cpu}-%{version}.run +Source0: %{name}-%{version}-i386.tar.xz +Source1: %{name}-%{version}-x86_64.tar.xz +Source2: %{name}-%{version}-aarch64.tar.xz Source8: 70-nvidia-driver.preset Source9: 70-nvidia-driver-cuda.preset Source10: 10-nvidia.conf @@ -36,6 +29,7 @@ Source40: com.nvidia.driver.metainfo.xml Source41: parse-supported-gpus.py Source42: com.nvidia.driver.png +Source99: nvidia-generate-tarballs.sh %ifarch x86_64 aarch64 BuildRequires: libappstream-glib @@ -166,35 +160,17 @@ The NVIDIA X.org X11 driver and associated components. %endif %prep -sh %{SOURCE0} -x --target nvidia-driver-%{version}-%{_target_cpu} -%setup -T -D -n nvidia-driver-%{version}-%{_target_cpu} - -# Stuff not needed for packages: -# - Compiled from source -# - Interactive installer files -# - GLVND GL libraries -# - Internal development only libraries -rm -fr \ - nvidia-xconfig* \ - nvidia-persistenced* \ - nvidia-modprobe* \ - libnvidia-gtk* libnvidia-wayland-client* nvidia-settings* \ - libGLESv1_CM.so.* libGLESv2.so.* libGLdispatch.so.* libOpenGL.so.* libGLX.so.* libGL.so.1* libEGL.so.1* \ - libnvidia-egl-wayland.so.* libnvidia-egl-gbm.so.* libnvidia-egl-xcb.so.* libnvidia-egl-xlib.so.* \ - libOpenCL.so.1* \ - libEGL.so.${VERSION} \ - nvidia-installer* .manifest make* mk* tls_test* libglvnd_install_checker - -if [ "%{_arch}" == x86_64 ]; then - rm -fr \ - 32/libGLESv1_CM.so.* 32/libGLESv2.so.* 32/libGLdispatch.so.* 32/libOpenGL.so.* 32/libGLX.so.* 32/libGL.so.1* 32/libEGL.so.1* \ - 32/libOpenCL.so.1* \ - 32/libGL.so.${VERSION} 32/libEGL.so.${VERSION} \ - 32/libnvidia-egl-wayland.so.* 32/libnvidia-egl-gbm.so.* 32/libnvidia-egl-xcb.so.* 32/libnvidia-egl-xlib.so.* - - cp -f *.json* 32/ -fi +%ifarch %{ix86} +%setup -q -n %{name}-%{version}-i386 +%endif +%ifarch x86_64 +%setup -q -T -b 1 -n %{name}-%{version}-x86_64 +%endif + +%ifarch aarch64 +%setup -q -T -b 2 -n %{name}-%{version}-aarch64 +%endif %ifarch x86_64 %if 0%{?rhel} == 8 diff --git a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh new file mode 100755 index 0000000000..45c36ab41a --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh @@ -0,0 +1,111 @@ +#!/bin/sh +CONTEXT=$(realpath $(dirname $0)) +set -e + +set_vars() { + export VERSION=${VERSION:-565.77} + export DL_SITE=${DL_SITE:-http://download.nvidia.com/XFree86} + export TEMP_UNPACK=${ARCH} + export PLATFORM=Linux-${ARCH} + export RUN_FILE=NVIDIA-${PLATFORM}-${VERSION}.run +} + +run_file_get() { + printf "Downloading installer ${RUN_FILE}... " + [[ -f $RUN_FILE ]] || wget -c -q ${DL_SITE}/${PLATFORM}/${VERSION}/$RUN_FILE + printf "OK\n" +} + +run_file_extract() { + rm -fr ${TEMP_UNPACK} + sh ${RUN_FILE} --extract-only --target ${TEMP_UNPACK} +} + +cleanup_folder() { + + printf "Cleaning up binaries... " + + cd ${TEMP_UNPACK} + + # Stuff not needed for packages: + # - Compiled from source + # - Interactive installer files + # - GLVND GL libraries + # - Internal development only libraries + rm -fr \ + nvidia-xconfig* \ + nvidia-persistenced* \ + nvidia-modprobe* \ + libnvidia-gtk* libnvidia-wayland-client* nvidia-settings* \ + libGLESv1_CM.so.* libGLESv2.so.* libGLdispatch.so.* libOpenGL.so.* libGLX.so.* libGL.so.1* libEGL.so.1* \ + libnvidia-egl-wayland.so.* libnvidia-egl-gbm.so.* libnvidia-egl-xcb.so.* libnvidia-egl-xlib.so.* \ + libOpenCL.so.1* \ + libEGL.so.${VERSION} \ + nvidia-installer* .manifest make* mk* tls_test* libglvnd_install_checker + + if [ "${ARCH}" == x86_64 ]; then + rm -fr \ + 32/libGLESv1_CM.so.* 32/libGLESv2.so.* 32/libGLdispatch.so.* 32/libOpenGL.so.* 32/libGLX.so.* 32/libGL.so.1* 32/libEGL.so.1* \ + 32/libOpenCL.so.1* \ + 32/libGL.so.${VERSION} 32/libEGL.so.${VERSION} \ + 32/libnvidia-egl-wayland.so.* 32/libnvidia-egl-gbm.so.* 32/libnvidia-egl-xcb.so.* 32/libnvidia-egl-xlib.so.* + + cp -f *.json* 32/ + fi + + cd .. + + printf "OK\n" +} + +create_tarball() { + + KMOD=nvidia-kmod-${VERSION}-${ARCH} + KMOD_COMMON=nvidia-kmod-common-${VERSION} + USR_64=nvidia-driver-${VERSION}-${ARCH} + + mkdir ${KMOD} ${KMOD_COMMON} ${USR_64} + mv ${TEMP_UNPACK}/kernel* ${KMOD}/ + mv ${TEMP_UNPACK}/firmware ${KMOD_COMMON}/ + + if [ "$ARCH" == x86_64 ]; then + + USR_32=nvidia-driver-${VERSION}-i386 + + mkdir ${USR_32} + mv ${TEMP_UNPACK}/32/* ${USR_32}/ + rm -fr ${TEMP_UNPACK}/32 + + fi + + mv ${TEMP_UNPACK}/* ${USR_64}/ + + rm -fr ${TEMP_UNPACK} + + for tarball in ${KMOD} ${KMOD_COMMON} ${USR_64} ${USR_32}; do + + printf "Creating tarball $tarball... " + + XZ_OPT='-T0' tar --remove-files -cJf $tarball.tar.xz $tarball + + printf "OK\n" + + done +} +pushd $CONTEXT + +ARCH=aarch64 +set_vars +run_file_get +run_file_extract +cleanup_folder +create_tarball + +ARCH=x86_64 +set_vars +run_file_get +run_file_extract +cleanup_folder +create_tarball + +popd \ No newline at end of file From 61e2888abb3c595af05b5e340ef83c9427221a08 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 03:21:28 +0700 Subject: [PATCH 12/23] add nvidia-modprobe --- anda/system/nvidia/nvidia-modprobe/anda.hcl | 5 + ...nvidia-modprobe-man-page-permissions.patch | 12 + .../nvidia-modprobe/nvidia-modprobe.spec | 297 ++++++++++++++++++ 3 files changed, 314 insertions(+) create mode 100644 anda/system/nvidia/nvidia-modprobe/anda.hcl create mode 100644 anda/system/nvidia/nvidia-modprobe/nvidia-modprobe-man-page-permissions.patch create mode 100644 anda/system/nvidia/nvidia-modprobe/nvidia-modprobe.spec diff --git a/anda/system/nvidia/nvidia-modprobe/anda.hcl b/anda/system/nvidia/nvidia-modprobe/anda.hcl new file mode 100644 index 0000000000..749e7da4dd --- /dev/null +++ b/anda/system/nvidia/nvidia-modprobe/anda.hcl @@ -0,0 +1,5 @@ +project "pkg" { + rpm { + spec = "nvidia-modprobe.spec" + } +} \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-modprobe/nvidia-modprobe-man-page-permissions.patch b/anda/system/nvidia/nvidia-modprobe/nvidia-modprobe-man-page-permissions.patch new file mode 100644 index 0000000000..96d073cda3 --- /dev/null +++ b/anda/system/nvidia/nvidia-modprobe/nvidia-modprobe-man-page-permissions.patch @@ -0,0 +1,12 @@ +diff -Naur nvidia-modprobe-525.60.11.old/Makefile nvidia-modprobe-525.60.11/Makefile +--- nvidia-modprobe-525.60.11.old/Makefile 2022-11-28 20:15:22.000000000 +0100 ++++ nvidia-modprobe-525.60.11/Makefile 2022-11-30 07:56:18.751429168 +0100 +@@ -110,7 +110,7 @@ + .PHONY: MANPAGE_install + MANPAGE_install: $(MANPAGE) + $(MKDIR) $(MANDIR) +- $(INSTALL) $(INSTALL_BIN_ARGS) $< $(MANDIR)/$(notdir $<) ++ $(INSTALL) $(INSTALL_DOC_ARGS) $< $(MANDIR)/$(notdir $<) + + $(eval $(call DEBUG_INFO_RULES, $(NVIDIA_MODPROBE))) + $(NVIDIA_MODPROBE).unstripped: $(OBJS) diff --git a/anda/system/nvidia/nvidia-modprobe/nvidia-modprobe.spec b/anda/system/nvidia/nvidia-modprobe/nvidia-modprobe.spec new file mode 100644 index 0000000000..4f6233ccd6 --- /dev/null +++ b/anda/system/nvidia/nvidia-modprobe/nvidia-modprobe.spec @@ -0,0 +1,297 @@ +Name: nvidia-modprobe +Version: 565.77 +Release: 1%{?dist} +Summary: NVIDIA kernel module loader +Epoch: 3 +License: GPLv2+ +URL: http://www.nvidia.com/object/unix.html +ExclusiveArch: x86_64 aarch64 + +Source0: https://download.nvidia.com/XFree86/%{name}/%{name}-%{version}.tar.bz2 +Patch0: %{name}-man-page-permissions.patch + +BuildRequires: gcc +BuildRequires: m4 + +%description +This utility is used by user-space NVIDIA driver components to make sure the +NVIDIA kernel modules are loaded and that the NVIDIA character device files are +present. + +%prep +%autosetup -p1 +# Remove additional CFLAGS added when enabling DEBUG +sed -i '/+= -O0 -g/d' utils.mk + +%build +export CFLAGS="%{optflags}" +export LDFLAGS="%{?__global_ldflags}" +make %{?_smp_mflags} \ + DEBUG=1 \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} \ + STRIP_CMD=true + +%install +%make_install \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} \ + STRIP_CMD=true + +%files +%license COPYING +%attr(4755, root, root) %{_bindir}/%{name} +%{_mandir}/man1/%{name}.1.* + +%changelog +* Thu Dec 05 2024 Simone Caronni - 3:565.77-1 +- Update to 565.77. + +* Wed Oct 23 2024 Simone Caronni - 3:565.57.01-1 +- Update to 565.57.01. + +* Wed Aug 21 2024 Simone Caronni - 3:560.35.03-1 +- Update to 560.35.03. + +* Tue Aug 06 2024 Simone Caronni - 3:560.31.02-1 +- Update to 560.31.02. + +* Mon Aug 05 2024 Simone Caronni - 3:560.28.03-1 +- Update to 560.28.03. + +* Tue Jul 02 2024 Simone Caronni - 3:555.58.02-1 +- Update to 555.58.02. + +* Thu Jun 27 2024 Simone Caronni - 3:555.58-1 +- Update to 555.58. + +* Thu Jun 06 2024 Simone Caronni - 3:555.52.04-1 +- Update to 555.52.04. + +* Wed May 22 2024 Simone Caronni - 3:555.42.02-1 +- Update to 555.42.02. + +* Tue Apr 30 2024 Simone Caronni - 3:550.78-2 +- Switch to Nvidia provided tarball. + +* Fri Apr 26 2024 Simone Caronni - 3:550.78-1 +- Update to 550.78. + +* Thu Apr 18 2024 Simone Caronni - 3:550.76-1 +- Update to 550.76. + +* Sun Mar 24 2024 Simone Caronni - 3:550.67-1 +- Update to 550.67. + +* Sat Mar 09 2024 Simone Caronni - 3:550.54.14-2 +- Enable aarch64. + +* Sun Mar 03 2024 Simone Caronni - 3:550.54.14-1 +- Update to 550.54.14. + +* Tue Feb 06 2024 Simone Caronni - 3:550.40.07-1 +- Update to 550.40.07. + +* Fri Dec 01 2023 Simone Caronni - 3:545.29.06-1 +- Update to 545.29.06. + +* Tue Oct 31 2023 Simone Caronni - 3:545.29.02-1 +- Update to 545.29.02. + +* Wed Oct 18 2023 Simone Caronni - 3:545.23.06-1 +- Update to 545.23.06. + +* Fri Sep 22 2023 Simone Caronni - 3:535.113.01-1 +- Update to 535.113.01. + +* Thu Aug 24 2023 Simone Caronni - 3:535.104.05-1 +- Update to 535.104.05. + +* Wed Aug 09 2023 Simone Caronni - 3:535.98-1 +- Update to 535.98. + +* Wed Jul 19 2023 Simone Caronni - 3:535.86.05-1 +- Update to 535.86.05. + +* Thu Jun 15 2023 Simone Caronni - 3:535.54.03-1 +- Update to 535.54.03. + +* Tue Jun 13 2023 Simone Caronni - 3:535.43.02-1 +- Update to 535.43.02. + +* Fri Mar 24 2023 Simone Caronni - 3:530.41.03-1 +- Update to 530.41.03. + +* Wed Mar 08 2023 Simone Caronni - 3:530.30.02-1 +- Update to 530.30.02. + +* Fri Feb 10 2023 Simone Caronni - 3:525.89.02-1 +- Update to 525.89.02. + +* Fri Jan 20 2023 Simone Caronni - 3:525.85.05-1 +- Update to 525.85.05. + +* Mon Jan 09 2023 Simone Caronni - 3:525.78.01-1 +- Update to 525.78.01. + +* Tue Nov 29 2022 Simone Caronni - 3:525.60.11-1 +- Update to 525.60.11. + +* Thu Oct 13 2022 Simone Caronni - 3:520.56.06-1 +- Update to 520.56.06. + +* Wed Sep 21 2022 Simone Caronni - 3:515.76-1 +- Update to 515.76. + +* Mon Aug 08 2022 Simone Caronni - 3:515.65.01-1 +- Update to 515.65.01. + +* Wed Jun 29 2022 Simone Caronni - 3:515.57-1 +- Update to 515.57. + +* Wed Jun 01 2022 Simone Caronni - 3:515.48.07-1 +- Update to 515.48.07. + +* Thu May 12 2022 Simone Caronni - 3:515.43.04-1 +- Update to 515.43.04. + +* Mon May 02 2022 Simone Caronni - 3:510.68.02-1 +- Update to 510.68.02. + +* Mon Mar 28 2022 Simone Caronni - 3:510.60.02-1 +- Update to 510.60.02. + +* Mon Feb 14 2022 Simone Caronni - 3:510.54-1 +- Update to 510.54. + +* Wed Feb 02 2022 Simone Caronni - 3:510.47.03-1 +- Update to 510.47.03. + +* Tue Dec 14 2021 Simone Caronni - 3:495.46-1 +- Update to 495.46. + +* Tue Nov 02 2021 Simone Caronni - 3:495.44-1 +- Update to 495.44. + +* Tue Nov 02 2021 Simone Caronni - 3:470.82.00-1 +- Update to 470.82.00. + +* Tue Sep 21 2021 Simone Caronni - 3:470.74-1 +- Update to 470.74. + +* Wed Aug 11 2021 Simone Caronni - 3:470.63.01-1 +- Update to 470.63.01. + +* Tue Jul 20 2021 Simone Caronni - 3:470.57.02-1 +- Update to 470.57.02. + +* Wed Jun 30 2021 Simone Caronni - 3:470.42.01-1 +- Update to 470.42.01. + +* Wed May 26 2021 Simone Caronni - 3:465.31-1 +- Update to 465.31. + +* Sat May 01 2021 Simone Caronni - 3:465.27-1 +- Update to 465.27. + +* Sun Apr 18 2021 Simone Caronni - 3:465.24.02-1 +- Update to 465.24.02. +- Switch to github sources. + +* Fri Apr 09 2021 Simone Caronni - 3:465.19.01-1 +- Update to 465.19.01. + +* Fri Mar 19 2021 Simone Caronni - 3:460.67-1 +- Update to 460.67. + +* Mon Mar 01 2021 Simone Caronni - 3:460.56-1 +- Update to 460.56. + +* Wed Jan 27 2021 Simone Caronni - 3:460.39-1 +- Update to 460.39. + +* Thu Jan 7 2021 Simone Caronni - 3:460.32.03-1 +- Update to 460.32.03. + +* Sun Dec 20 2020 Simone Caronni - 3:460.27.04-1 +- Update to 460.27.04. +- Trim changelog. + +* Mon Dec 07 2020 Simone Caronni - 3:455.45.01-2 +- Use autoseptup macro. + +* Wed Nov 18 2020 Simone Caronni - 3:455.45.01-1 +- Update to 455.45.01. + +* Mon Nov 02 2020 Simone Caronni - 3:455.38-1 +- Update to 455.38. + +* Mon Oct 12 2020 Simone Caronni - 3:455.28-1 +- Update to 455.28. + +* Tue Oct 06 2020 Simone Caronni - 3:450.80.02-1 +- Update to 450.80.02. + +* Thu Aug 20 2020 Simone Caronni - 3:450.66-1 +- Update to 450.66. + +* Fri Jul 10 2020 Simone Caronni - 3:450.57-1 +- Update to 450.57. + +* Thu Jun 25 2020 Simone Caronni - 3:440.100-1 +- Update to 440.100. + +* Thu Apr 09 2020 Simone Caronni - 3:440.82-1 +- Update to 440.82. + +* Fri Feb 28 2020 Simone Caronni - 3:440.64-1 +- Update to 440.64. + +* Tue Feb 04 2020 Simone Caronni - 3:440.59-1 +- Update to 440.59. + +* Sat Dec 14 2019 Simone Caronni - 3:440.44-1 +- Update to 440.44. + +* Sat Nov 30 2019 Simone Caronni - 3:440.36-1 +- Update to 440.36. + +* Sat Nov 09 2019 Simone Caronni - 3:440.31-1 +- Update to 440.31. + +* Thu Oct 17 2019 Simone Caronni - 3:440.26-1 +- Update to 440.26. + +* Mon Sep 02 2019 Simone Caronni - 3:435.21-1 +- Update to 435.21. + +* Thu Aug 22 2019 Simone Caronni - 3:435.17-1 +- Update to 435.17. + +* Wed Jul 31 2019 Simone Caronni - 3:430.40-1 +- Update to 430.40. + +* Fri Jul 12 2019 Simone Caronni - 3:430.34-1 +- Update to 430.34. + +* Wed Jun 12 2019 Simone Caronni - 3:430.26-1 +- Update to 430.26. + +* Sat May 18 2019 Simone Caronni - 3:430.14-1 +- Update to 430.14. + +* Thu May 09 2019 Simone Caronni - 3:418.74-1 +- Update to 418.74. + +* Sun Mar 24 2019 Simone Caronni - 3:418.56-1 +- Update to 418.56. + +* Fri Feb 22 2019 Simone Caronni - 3:418.43-1 +- Update to 418.43. +- Trim changelog. + +* Wed Feb 06 2019 Simone Caronni - 3:418.30-1 +- Update to 418.30. + +* Thu Jan 17 2019 Simone Caronni - 3:415.27-1 +- Update to 415.27. From 973613f14f3c6eb88b5736a22a1e8560c18c06df Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 04:06:40 +0700 Subject: [PATCH 13/23] update metadata, add nvidia-persistenced --- .../com.nvidia.driver.metainfo.xml | 3 +- .../nvidia/nvidia-persistenced/anda.hcl | 5 + .../nvidia-persistenced.service | 14 + .../nvidia-persistenced.spec | 336 ++++++++++++++++++ 4 files changed, 357 insertions(+), 1 deletion(-) create mode 100644 anda/system/nvidia/nvidia-persistenced/anda.hcl create mode 100644 anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.service create mode 100644 anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.spec diff --git a/anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml b/anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml index 9b81ba96a6..ccc42a3963 100644 --- a/anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml +++ b/anda/system/nvidia/nvidia-driver/com.nvidia.driver.metainfo.xml @@ -39,7 +39,8 @@ CC0-1.0 LicenseRef-proprietary:NVIDIA https://www.nvidia.com/ - negativo17@gmail.com + https://github.com/terrapkg/packages/issues + https://github.com/terrapkg/packages True diff --git a/anda/system/nvidia/nvidia-persistenced/anda.hcl b/anda/system/nvidia/nvidia-persistenced/anda.hcl new file mode 100644 index 0000000000..b173dd8053 --- /dev/null +++ b/anda/system/nvidia/nvidia-persistenced/anda.hcl @@ -0,0 +1,5 @@ +project "pkg" { + rpm { + spec = "nvidia-persistenced.spec" + } +} \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.service b/anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.service new file mode 100644 index 0000000000..0d83758660 --- /dev/null +++ b/anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.service @@ -0,0 +1,14 @@ +[Unit] +Description=NVIDIA Persistence Daemon +After=syslog.target + +[Service] +Type=forking +PIDFile=/var/run/nvidia-persistenced/nvidia-persistenced.pid +Restart=always +ExecStart=/usr/sbin/nvidia-persistenced --verbose +ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced/* +TimeoutSec=300 + +[Install] +WantedBy=multi-user.target diff --git a/anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.spec b/anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.spec new file mode 100644 index 0000000000..0b6c00d0b2 --- /dev/null +++ b/anda/system/nvidia/nvidia-persistenced/nvidia-persistenced.spec @@ -0,0 +1,336 @@ +Name: nvidia-persistenced +Version: 565.77 +Release: 1%{?dist} +Summary: A daemon to maintain persistent software state in the NVIDIA driver +Epoch: 3 +License: GPLv2+ +URL: http://www.nvidia.com/object/unix.html +ExclusiveArch: x86_64 aarch64 + +Source0: https://download.nvidia.com/XFree86/%{name}/%{name}-%{version}.tar.bz2 +Source1: %{name}.service + +BuildRequires: gcc +BuildRequires: libtirpc-devel +BuildRequires: m4 + +# For Fedora systemd-rpm-macros would be enough: +BuildRequires: systemd-devel +Requires(post): systemd +Requires(preun): systemd +Requires(postun): systemd +Requires: libnvidia-cfg%{?_isa} >= %{?epoch:%{epoch}:}%{version} + +%description +The %{name} utility is used to enable persistent software state in the NVIDIA +driver. When persistence mode is enabled, the daemon prevents the driver from +releasing device state when the device is not in use. This can improve the +startup time of new clients in this scenario. + +%prep +%autosetup +# Remove additional CFLAGS added when enabling DEBUG +sed -i -e '/+= -O0 -g/d' utils.mk + +%build +export CFLAGS="%{optflags} -I%{_includedir}/tirpc" +make %{?_smp_mflags} \ + DEBUG=1 \ + LIBS="-ldl -ltirpc" \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} \ + STRIP_CMD=true + +%install +%make_install \ + NV_VERBOSE=1 \ + PREFIX=%{_prefix} \ + STRIP_CMD=true + +mv %{buildroot}%{_bindir} %{buildroot}%{_sbindir} +mkdir -p %{buildroot}%{_sharedstatedir}/%{name} + +# Systemd unit files +install -p -m 644 -D %{SOURCE1} %{buildroot}%{_unitdir}/%{name}.service + +%post +%systemd_post %{name}.service + +%preun +%systemd_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service + +%files +%license COPYING +%{_mandir}/man1/%{name}.1.* +%{_sbindir}/%{name} +%{_unitdir}/%{name}.service +%{_sharedstatedir}/%{name} + +%changelog +* Thu Dec 05 2024 Simone Caronni - 3:565.77-1 +- Update to 565.77. + +* Wed Oct 23 2024 Simone Caronni - 3:565.57.01-1 +- Update to 565.57.01. + +* Wed Aug 21 2024 Simone Caronni - 3:560.35.03-1 +- Update to 560.35.03. + +* Tue Aug 06 2024 Simone Caronni - 3:560.31.02-1 +- Update to 560.31.02. + +* Mon Aug 05 2024 Simone Caronni - 3:560.28.03-1 +- Update to 560.28.03. + +* Tue Jul 02 2024 Simone Caronni - 3:555.58.02-1 +- Update to 555.58.02. +- Require dynamically loaded library libnvidia-cfg. + +* Thu Jun 27 2024 Simone Caronni - 3:555.58-1 +- Update to 555.58. + +* Thu Jun 06 2024 Simone Caronni - 3:555.52.04-1 +- Update to 555.52.04. + +* Wed May 22 2024 Simone Caronni - 3:555.42.02-1 +- Update to 555.42.02. + +* Tue Apr 30 2024 Simone Caronni - 3:550.78-2 +- Switch to Nvidia provided tarball. + +* Fri Apr 26 2024 Simone Caronni - 3:550.78-1 +- Update to 550.78. + +* Thu Apr 18 2024 Simone Caronni - 3:550.76-1 +- Update to 550.76. + +* Sun Mar 24 2024 Simone Caronni - 3:550.67-1 +- Update to 550.67. + +* Mon Mar 18 2024 Simone Caronni - 3:550.54.14-4 +- Clean up build requirements. + +* Sat Mar 09 2024 Simone Caronni - 3:550.54.14-3 +- Enable aarch64. + +* Thu Mar 07 2024 Simone Caronni - 3:550.54.14-2 +- Run nvidia-persistenced as root as Nvidia does. + +* Sun Mar 03 2024 Simone Caronni - 3:550.54.14-1 +- Update to 550.54.14. + +* Tue Feb 06 2024 Simone Caronni - 3:550.40.07-1 +- Update to 550.40.07. + +* Fri Dec 01 2023 Simone Caronni - 3:545.29.06-1 +- Update to 545.29.06. + +* Tue Oct 31 2023 Simone Caronni - 3:545.29.02-1 +- Update to 545.29.02. + +* Wed Oct 18 2023 Simone Caronni - 3:545.23.06-1 +- Update to 545.23.06. + +* Fri Sep 22 2023 Simone Caronni - 3:535.113.01-1 +- Update to 535.113.01. + +* Thu Aug 24 2023 Simone Caronni - 3:535.104.05-1 +- Update to 535.104.05. + +* Wed Aug 09 2023 Simone Caronni - 3:535.98-1 +- Update to 535.98. + +* Wed Jul 19 2023 Simone Caronni - 3:535.86.05-1 +- Update to 535.86.05. + +* Thu Jun 15 2023 Simone Caronni - 3:535.54.03-1 +- Update to 535.54.03. + +* Tue Jun 13 2023 Simone Caronni - 3:535.43.02-1 +- Update to 535.43.02. + +* Fri Mar 24 2023 Simone Caronni - 3:530.41.03-1 +- Update to 530.41.03. + +* Wed Mar 08 2023 Simone Caronni - 3:530.30.02-1 +- Update to 530.30.02. + +* Fri Feb 10 2023 Simone Caronni - 3:525.89.02-1 +- Update to 525.89.02. + +* Fri Jan 20 2023 Simone Caronni - 3:525.85.05-1 +- Update to 525.85.05. + +* Mon Jan 09 2023 Simone Caronni - 3:525.78.01-1 +- Update to 525.78.01. + +* Tue Nov 29 2022 Simone Caronni - 3:525.60.11-1 +- Update to 525.60.11. + +* Thu Oct 13 2022 Simone Caronni - 3:520.56.06-1 +- Update to 520.56.06. + +* Wed Sep 21 2022 Simone Caronni - 3:515.76-1 +- Update to 515.76. + +* Mon Aug 08 2022 Simone Caronni - 3:515.65.01-1 +- Update to 515.65.01. + +* Wed Jun 29 2022 Simone Caronni - 3:515.57-1 +- Update to 515.57. + +* Wed Jun 01 2022 Simone Caronni - 3:515.48.07-1 +- Update to 515.48.07. + +* Thu May 12 2022 Simone Caronni - 3:515.43.04-1 +- Update to 515.43.04. + +* Mon May 02 2022 Simone Caronni - 3:510.68.02-1 +- Update to 510.68.02. + +* Mon Mar 28 2022 Simone Caronni - 3:510.60.02-1 +- Update to 510.60.02. + +* Mon Feb 14 2022 Simone Caronni - 3:510.54-1 +- Update to 510.54. + +* Wed Feb 02 2022 Simone Caronni - 3:510.47.03-1 +- Update to 510.47.03. + +* Tue Dec 14 2021 Simone Caronni - 3:495.46-1 +- Update to 495.46. + +* Tue Nov 02 2021 Simone Caronni - 3:495.44-1 +- Update to 495.44. + +* Tue Nov 02 2021 Simone Caronni - 3:470.82.00-1 +- Update to 470.82.00. + +* Tue Sep 21 2021 Simone Caronni - 3:470.74-1 +- Update to 470.74. + +* Wed Aug 11 2021 Simone Caronni - 3:470.63.01-1 +- Update to 470.63.01. + +* Tue Jul 20 2021 Simone Caronni - 3:470.57.02-1 +- Update to 470.57.02. + +* Wed Jun 30 2021 Simone Caronni - 3:470.42.01-1 +- Update to 470.42.01. + +* Wed May 26 2021 Simone Caronni - 3:465.31-1 +- Update to 465.31. + +* Sat May 01 2021 Simone Caronni - 3:465.27-1 +- Update to 465.27. + +* Sun Apr 18 2021 Simone Caronni - 3:465.24.02-1 +- Update to 465.24.02. +- Switch to github sources. + +* Fri Apr 09 2021 Simone Caronni - 3:465.19.01-1 +- Update to 465.19.01. + +* Fri Mar 19 2021 Simone Caronni - 3:460.67-1 +- Update to 460.67. + +* Mon Mar 01 2021 Simone Caronni - 3:460.56-1 +- Update to 460.56. + +* Wed Jan 27 2021 Simone Caronni - 3:460.39-1 +- Update to 460.39. + +* Thu Jan 7 2021 Simone Caronni - 3:460.32.03-1 +- Update to 460.32.03. + +* Sun Dec 20 2020 Simone Caronni - 3:460.27.04-1 +- Update to 460.27.04. +- Trim changelog. + +* Mon Dec 07 2020 Simone Caronni - 3:455.45.01-2 +- Remove RHEL/CentOS 6 support. + +* Wed Nov 18 2020 Simone Caronni - 3:455.45.01-1 +- Update to 455.45.01. + +* Mon Nov 02 2020 Simone Caronni - 3:455.38-1 +- Update to 455.38. + +* Mon Oct 12 2020 Simone Caronni - 3:455.28-1 +- Update to 455.28. + +* Tue Oct 06 2020 Simone Caronni - 3:450.80.02-1 +- Update to 450.80.02. + +* Thu Aug 20 2020 Simone Caronni - 3:450.66-1 +- Update to 450.66. + +* Fri Jul 10 2020 Simone Caronni - 3:450.57-1 +- Update to 450.57. + +* Thu Jun 25 2020 Simone Caronni - 3:440.100-1 +- Update to 440.100. + +* Tue Apr 14 2020 Simone Caronni - 3:440.82-2 +- Update requirements according to package guidelines. + +* Thu Apr 09 2020 Simone Caronni - 3:440.82-1 +- Update to 440.82. + +* Fri Feb 28 2020 Simone Caronni - 3:440.64-1 +- Update to 440.64. + +* Tue Feb 04 2020 Simone Caronni - 3:440.59-1 +- Update to 440.59. + +* Sat Dec 14 2019 Simone Caronni - 3:440.44-1 +- Update to 440.44. + +* Sat Nov 30 2019 Simone Caronni - 3:440.36-1 +- Update to 440.36. + +* Sat Nov 09 2019 Simone Caronni - 3:440.31-1 +- Update to 440.31. + +* Thu Oct 17 2019 Simone Caronni - 3:440.26-1 +- Update to 440.26. + +* Mon Sep 02 2019 Simone Caronni - 3:435.21-1 +- Update to 435.21. + +* Thu Aug 22 2019 Simone Caronni - 3:435.17-1 +- Update to 435.17. + +* Wed Jul 31 2019 Simone Caronni - 3:430.40-1 +- Update to 430.40. + +* Fri Jul 12 2019 Simone Caronni - 3:430.34-1 +- Update to 430.34. + +* Wed Jun 12 2019 Simone Caronni - 3:430.26-1 +- Update to 430.26. + +* Sat May 18 2019 Simone Caronni - 3:430.14-1 +- Update to 430.14. + +* Thu May 09 2019 Simone Caronni - 3:418.74-1 +- Update to 418.74. + +* Sun Mar 24 2019 Simone Caronni - 3:418.56-1 +- Update to 418.56. + +* Fri Feb 22 2019 Simone Caronni - 3:418.43-1 +- Update to 418.43. +- Trim changelog. + +* Wed Feb 06 2019 Simone Caronni - 3:418.30-1 +- Update to 418.30. + +* Sun Feb 03 2019 Simone Caronni - 3:415.27-2 +- Do not require nvidia-kmod-common, already required by nvidia-driver-cuda. + +* Thu Jan 17 2019 Simone Caronni - 3:415.27-1 +- Update to 415.27. From bac85d3ab2d43dd260c3dc82e020b183a5af9c94 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 14:26:58 +0700 Subject: [PATCH 14/23] add update scripts to nvidia drivers --- .../nvidia-driver/nvidia-generate-tarballs.sh | 2 +- anda/system/nvidia/nvidia-driver/pre.sh | 9 +++++++++ anda/system/nvidia/nvidia-driver/update.rhai | 3 +++ anda/system/nvidia/nvidia-kmod-common/update.rhai | 3 +++ anda/system/nvidia/nvidia-kmod/update.rhai | 3 +++ anda/system/nvidia/nvidia-modprobe/update.rhai | 3 +++ .../system/nvidia/nvidia-persistenced/update.rhai | 3 +++ anda/system/nvidia/nvidia-settings/update.rhai | 3 +++ anda/system/nvidia/nvidia-xconfig/update.rhai | 3 +++ andax/nvidia.rhai | 15 +++++++++++++++ andax/nvidia_driver_print.rhai | 3 +++ 11 files changed, 49 insertions(+), 1 deletion(-) create mode 100755 anda/system/nvidia/nvidia-driver/pre.sh create mode 100644 anda/system/nvidia/nvidia-driver/update.rhai create mode 100644 anda/system/nvidia/nvidia-kmod-common/update.rhai create mode 100644 anda/system/nvidia/nvidia-kmod/update.rhai create mode 100644 anda/system/nvidia/nvidia-modprobe/update.rhai create mode 100644 anda/system/nvidia/nvidia-persistenced/update.rhai create mode 100644 anda/system/nvidia/nvidia-settings/update.rhai create mode 100644 anda/system/nvidia/nvidia-xconfig/update.rhai create mode 100644 andax/nvidia.rhai create mode 100644 andax/nvidia_driver_print.rhai diff --git a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh index 45c36ab41a..bd3d25605f 100755 --- a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh +++ b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh @@ -3,7 +3,7 @@ CONTEXT=$(realpath $(dirname $0)) set -e set_vars() { - export VERSION=${VERSION:-565.77} + export VERSION=${VERSION:?"VERSION not set"} export DL_SITE=${DL_SITE:-http://download.nvidia.com/XFree86} export TEMP_UNPACK=${ARCH} export PLATFORM=Linux-${ARCH} diff --git a/anda/system/nvidia/nvidia-driver/pre.sh b/anda/system/nvidia/nvidia-driver/pre.sh new file mode 100755 index 0000000000..24f660da43 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/pre.sh @@ -0,0 +1,9 @@ +#!/bin/bash -x + +# We are going to assume we already have andax installed + +export VERSION=$(anda run andax/nvidia_driver_print.rhai) + +SCRIPT_DIR=$(realpath $(dirname $0)) + +$SCRIPT_DIR/nvidia-generate-tarballs.sh \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-driver/update.rhai b/anda/system/nvidia/nvidia-driver/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/system/nvidia/nvidia-driver/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/anda/system/nvidia/nvidia-kmod-common/update.rhai b/anda/system/nvidia/nvidia-kmod-common/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod-common/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/anda/system/nvidia/nvidia-kmod/update.rhai b/anda/system/nvidia/nvidia-kmod/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/system/nvidia/nvidia-kmod/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/anda/system/nvidia/nvidia-modprobe/update.rhai b/anda/system/nvidia/nvidia-modprobe/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/system/nvidia/nvidia-modprobe/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/anda/system/nvidia/nvidia-persistenced/update.rhai b/anda/system/nvidia/nvidia-persistenced/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/system/nvidia/nvidia-persistenced/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/anda/system/nvidia/nvidia-settings/update.rhai b/anda/system/nvidia/nvidia-settings/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/system/nvidia/nvidia-settings/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/anda/system/nvidia/nvidia-xconfig/update.rhai b/anda/system/nvidia/nvidia-xconfig/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/system/nvidia/nvidia-xconfig/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/andax/nvidia.rhai b/andax/nvidia.rhai new file mode 100644 index 0000000000..7c0d4c9759 --- /dev/null +++ b/andax/nvidia.rhai @@ -0,0 +1,15 @@ +// NVIDIA website parser module +// This module is used to parse the NVIDIA website for the latest driver version + + +fn nvidia_component_version(component) { + let series = "12.6.3"; + let url = `https://developer.download.nvidia.com/compute/cuda/redist/redistrib_${series}.json`; + let json = get(url).json(); + return json[component]["version"]; +} + +fn nvidia_driver_version() { + let matches = find_all(`(?m)^\s+[\d.]+/`, get("https://download.nvidia.com/XFree86/Linux-x86_64/")); + return(matches[matches.len() - 1][1]); +} diff --git a/andax/nvidia_driver_print.rhai b/andax/nvidia_driver_print.rhai new file mode 100644 index 0000000000..4882ab2bc3 --- /dev/null +++ b/andax/nvidia_driver_print.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +print(nvidia::nvidia_driver_version()); \ No newline at end of file From 242f6220d2c1b131aad9710ddf243ea92155413d Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 14:43:43 +0700 Subject: [PATCH 15/23] add update scripts for every cuda package --- anda/lib/nvidia/compat-nvidia-repo/update.rhai | 3 +++ anda/lib/nvidia/cuda-cccl/update.rhai | 3 +++ anda/lib/nvidia/cuda-cudart/update.rhai | 3 +++ anda/lib/nvidia/cuda-cudnn/update.rhai | 5 +++++ anda/lib/nvidia/cuda-cuobjdump/update.rhai | 3 +++ anda/lib/nvidia/cuda-cupti/update.rhai | 3 +++ anda/lib/nvidia/cuda-cuxxfilt/update.rhai | 3 +++ anda/lib/nvidia/cuda-gcc/anda.hcl | 3 +++ anda/lib/nvidia/cuda-gcc/update.rhai | 3 +++ anda/lib/nvidia/cuda-gdb/update.rhai | 3 +++ anda/lib/nvidia/cuda-nvdisasm/update.rhai | 3 +++ anda/lib/nvidia/cuda-nvml/update.rhai | 3 +++ anda/lib/nvidia/cuda-nvprof/update.rhai | 3 +++ anda/lib/nvidia/cuda-nvprune/update.rhai | 3 +++ anda/lib/nvidia/cuda-nvrtc/update.rhai | 3 +++ anda/lib/nvidia/cuda-nvtx/update.rhai | 3 +++ anda/lib/nvidia/cuda-profiler/update.rhai | 3 +++ anda/lib/nvidia/cuda-sanitizer/update.rhai | 3 +++ anda/lib/nvidia/cuda/update.rhai | 3 +++ anda/lib/nvidia/libcublas/update.rhai | 3 +++ anda/lib/nvidia/libcudla/update.rhai | 3 +++ anda/lib/nvidia/libcufft/update.rhai | 3 +++ anda/lib/nvidia/libcurand/update.rhai | 3 +++ anda/lib/nvidia/libcusparse/update.rhai | 3 +++ anda/lib/nvidia/libcusparselt/update.rhai | 3 +++ anda/lib/nvidia/libnvfatbin/update.rhai | 3 +++ anda/lib/nvidia/libnvjpeg/update.rhai | 3 +++ 27 files changed, 83 insertions(+) create mode 100644 anda/lib/nvidia/compat-nvidia-repo/update.rhai create mode 100644 anda/lib/nvidia/cuda-cccl/update.rhai create mode 100644 anda/lib/nvidia/cuda-cudart/update.rhai create mode 100644 anda/lib/nvidia/cuda-cudnn/update.rhai create mode 100644 anda/lib/nvidia/cuda-cuobjdump/update.rhai create mode 100644 anda/lib/nvidia/cuda-cupti/update.rhai create mode 100644 anda/lib/nvidia/cuda-cuxxfilt/update.rhai create mode 100644 anda/lib/nvidia/cuda-gcc/update.rhai create mode 100644 anda/lib/nvidia/cuda-gdb/update.rhai create mode 100644 anda/lib/nvidia/cuda-nvdisasm/update.rhai create mode 100644 anda/lib/nvidia/cuda-nvml/update.rhai create mode 100644 anda/lib/nvidia/cuda-nvprof/update.rhai create mode 100644 anda/lib/nvidia/cuda-nvprune/update.rhai create mode 100644 anda/lib/nvidia/cuda-nvrtc/update.rhai create mode 100644 anda/lib/nvidia/cuda-nvtx/update.rhai create mode 100644 anda/lib/nvidia/cuda-profiler/update.rhai create mode 100644 anda/lib/nvidia/cuda-sanitizer/update.rhai create mode 100644 anda/lib/nvidia/cuda/update.rhai create mode 100644 anda/lib/nvidia/libcublas/update.rhai create mode 100644 anda/lib/nvidia/libcudla/update.rhai create mode 100644 anda/lib/nvidia/libcufft/update.rhai create mode 100644 anda/lib/nvidia/libcurand/update.rhai create mode 100644 anda/lib/nvidia/libcusparse/update.rhai create mode 100644 anda/lib/nvidia/libcusparselt/update.rhai create mode 100644 anda/lib/nvidia/libnvfatbin/update.rhai create mode 100644 anda/lib/nvidia/libnvjpeg/update.rhai diff --git a/anda/lib/nvidia/compat-nvidia-repo/update.rhai b/anda/lib/nvidia/compat-nvidia-repo/update.rhai new file mode 100644 index 0000000000..e5eff132c0 --- /dev/null +++ b/anda/lib/nvidia/compat-nvidia-repo/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_driver_version()); diff --git a/anda/lib/nvidia/cuda-cccl/update.rhai b/anda/lib/nvidia/cuda-cccl/update.rhai new file mode 100644 index 0000000000..0ccb93d4c5 --- /dev/null +++ b/anda/lib/nvidia/cuda-cccl/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_cccl")); diff --git a/anda/lib/nvidia/cuda-cudart/update.rhai b/anda/lib/nvidia/cuda-cudart/update.rhai new file mode 100644 index 0000000000..58575801f8 --- /dev/null +++ b/anda/lib/nvidia/cuda-cudart/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_cudart")); diff --git a/anda/lib/nvidia/cuda-cudnn/update.rhai b/anda/lib/nvidia/cuda-cudnn/update.rhai new file mode 100644 index 0000000000..8b758874bd --- /dev/null +++ b/anda/lib/nvidia/cuda-cudnn/update.rhai @@ -0,0 +1,5 @@ +import "andax/nvidia.rhai" as nvidia; +let series = "9.6.0" +let url = `https://developer.download.nvidia.com/compute/cudnn/redist/redistrib_${series}.json`; +let json = get(url).json(); +rpm.version(json["cudnn"]["version"]); diff --git a/anda/lib/nvidia/cuda-cuobjdump/update.rhai b/anda/lib/nvidia/cuda-cuobjdump/update.rhai new file mode 100644 index 0000000000..1b01e079fc --- /dev/null +++ b/anda/lib/nvidia/cuda-cuobjdump/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_cuobjdump")); diff --git a/anda/lib/nvidia/cuda-cupti/update.rhai b/anda/lib/nvidia/cuda-cupti/update.rhai new file mode 100644 index 0000000000..fbeed07228 --- /dev/null +++ b/anda/lib/nvidia/cuda-cupti/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_cupti")); diff --git a/anda/lib/nvidia/cuda-cuxxfilt/update.rhai b/anda/lib/nvidia/cuda-cuxxfilt/update.rhai new file mode 100644 index 0000000000..cc20c1000d --- /dev/null +++ b/anda/lib/nvidia/cuda-cuxxfilt/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_cuxxfilt")); diff --git a/anda/lib/nvidia/cuda-gcc/anda.hcl b/anda/lib/nvidia/cuda-gcc/anda.hcl index aaf0294b75..48ea127f9d 100644 --- a/anda/lib/nvidia/cuda-gcc/anda.hcl +++ b/anda/lib/nvidia/cuda-gcc/anda.hcl @@ -3,4 +3,7 @@ project pkg { rpm { spec = "cuda-gcc.spec" } + labels { + updbranch = 1 + } } diff --git a/anda/lib/nvidia/cuda-gcc/update.rhai b/anda/lib/nvidia/cuda-gcc/update.rhai new file mode 100644 index 0000000000..6a220733c0 --- /dev/null +++ b/anda/lib/nvidia/cuda-gcc/update.rhai @@ -0,0 +1,3 @@ +import "andax/bump_extras.rhai" as bump; + +rpm.version(bump::bodhi("gcc13", labels.branch.as_bodhi_ver())); diff --git a/anda/lib/nvidia/cuda-gdb/update.rhai b/anda/lib/nvidia/cuda-gdb/update.rhai new file mode 100644 index 0000000000..292e3e6c5f --- /dev/null +++ b/anda/lib/nvidia/cuda-gdb/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_gdb")); diff --git a/anda/lib/nvidia/cuda-nvdisasm/update.rhai b/anda/lib/nvidia/cuda-nvdisasm/update.rhai new file mode 100644 index 0000000000..b5cc5153bc --- /dev/null +++ b/anda/lib/nvidia/cuda-nvdisasm/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_nvdisasm")); diff --git a/anda/lib/nvidia/cuda-nvml/update.rhai b/anda/lib/nvidia/cuda-nvml/update.rhai new file mode 100644 index 0000000000..30eaad60da --- /dev/null +++ b/anda/lib/nvidia/cuda-nvml/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_nvml_dev")); diff --git a/anda/lib/nvidia/cuda-nvprof/update.rhai b/anda/lib/nvidia/cuda-nvprof/update.rhai new file mode 100644 index 0000000000..fabef23107 --- /dev/null +++ b/anda/lib/nvidia/cuda-nvprof/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_nvprof")); diff --git a/anda/lib/nvidia/cuda-nvprune/update.rhai b/anda/lib/nvidia/cuda-nvprune/update.rhai new file mode 100644 index 0000000000..1f03bcd07c --- /dev/null +++ b/anda/lib/nvidia/cuda-nvprune/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_nvprune")); diff --git a/anda/lib/nvidia/cuda-nvrtc/update.rhai b/anda/lib/nvidia/cuda-nvrtc/update.rhai new file mode 100644 index 0000000000..a50d4f21c6 --- /dev/null +++ b/anda/lib/nvidia/cuda-nvrtc/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_nvrtc")); diff --git a/anda/lib/nvidia/cuda-nvtx/update.rhai b/anda/lib/nvidia/cuda-nvtx/update.rhai new file mode 100644 index 0000000000..5e5fe5fedb --- /dev/null +++ b/anda/lib/nvidia/cuda-nvtx/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_nvtx")); diff --git a/anda/lib/nvidia/cuda-profiler/update.rhai b/anda/lib/nvidia/cuda-profiler/update.rhai new file mode 100644 index 0000000000..97a31c6e2a --- /dev/null +++ b/anda/lib/nvidia/cuda-profiler/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_profiler_api")); diff --git a/anda/lib/nvidia/cuda-sanitizer/update.rhai b/anda/lib/nvidia/cuda-sanitizer/update.rhai new file mode 100644 index 0000000000..6e0f6d36b0 --- /dev/null +++ b/anda/lib/nvidia/cuda-sanitizer/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_sanitizer_api")); diff --git a/anda/lib/nvidia/cuda/update.rhai b/anda/lib/nvidia/cuda/update.rhai new file mode 100644 index 0000000000..ca958ccd5f --- /dev/null +++ b/anda/lib/nvidia/cuda/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("cuda_documentation")); diff --git a/anda/lib/nvidia/libcublas/update.rhai b/anda/lib/nvidia/libcublas/update.rhai new file mode 100644 index 0000000000..75ba820983 --- /dev/null +++ b/anda/lib/nvidia/libcublas/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libcublas")); diff --git a/anda/lib/nvidia/libcudla/update.rhai b/anda/lib/nvidia/libcudla/update.rhai new file mode 100644 index 0000000000..3531b98301 --- /dev/null +++ b/anda/lib/nvidia/libcudla/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libcudla")); diff --git a/anda/lib/nvidia/libcufft/update.rhai b/anda/lib/nvidia/libcufft/update.rhai new file mode 100644 index 0000000000..4e40086137 --- /dev/null +++ b/anda/lib/nvidia/libcufft/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libcufft")); diff --git a/anda/lib/nvidia/libcurand/update.rhai b/anda/lib/nvidia/libcurand/update.rhai new file mode 100644 index 0000000000..02b3f0a95f --- /dev/null +++ b/anda/lib/nvidia/libcurand/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libcurand")); diff --git a/anda/lib/nvidia/libcusparse/update.rhai b/anda/lib/nvidia/libcusparse/update.rhai new file mode 100644 index 0000000000..ca0407fbbe --- /dev/null +++ b/anda/lib/nvidia/libcusparse/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libcusparse")); diff --git a/anda/lib/nvidia/libcusparselt/update.rhai b/anda/lib/nvidia/libcusparselt/update.rhai new file mode 100644 index 0000000000..b56bb493a5 --- /dev/null +++ b/anda/lib/nvidia/libcusparselt/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libcusparselt")); diff --git a/anda/lib/nvidia/libnvfatbin/update.rhai b/anda/lib/nvidia/libnvfatbin/update.rhai new file mode 100644 index 0000000000..2b38928c70 --- /dev/null +++ b/anda/lib/nvidia/libnvfatbin/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libnvfatbin")); diff --git a/anda/lib/nvidia/libnvjpeg/update.rhai b/anda/lib/nvidia/libnvjpeg/update.rhai new file mode 100644 index 0000000000..79772901d0 --- /dev/null +++ b/anda/lib/nvidia/libnvjpeg/update.rhai @@ -0,0 +1,3 @@ +import "andax/nvidia.rhai" as nvidia; + +rpm.version(nvidia::nvidia_component_version("libnvjpeg")); From 1bc73550e59fc9787b34c593d298e5a6f0f90087 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 14:46:20 +0700 Subject: [PATCH 16/23] make the component fetch a separate function for memoization --- andax/nvidia.rhai | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/andax/nvidia.rhai b/andax/nvidia.rhai index 7c0d4c9759..9dcb4d0b6b 100644 --- a/andax/nvidia.rhai +++ b/andax/nvidia.rhai @@ -1,12 +1,14 @@ // NVIDIA website parser module // This module is used to parse the NVIDIA website for the latest driver version - -fn nvidia_component_version(component) { +fn nvidia_component_list() { let series = "12.6.3"; let url = `https://developer.download.nvidia.com/compute/cuda/redist/redistrib_${series}.json`; - let json = get(url).json(); - return json[component]["version"]; + return get(url).json(); +} +fn nvidia_component_version(component) { + let components = nvidia_component_list(); + return components[component]["version"]; } fn nvidia_driver_version() { From c686eeb401d5c930531b69975f52fc1ab327e1fc Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 14:47:22 +0700 Subject: [PATCH 17/23] cusparse --- anda/lib/nvidia/libcusparselt/update.rhai | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/lib/nvidia/libcusparselt/update.rhai b/anda/lib/nvidia/libcusparselt/update.rhai index b56bb493a5..ca0407fbbe 100644 --- a/anda/lib/nvidia/libcusparselt/update.rhai +++ b/anda/lib/nvidia/libcusparselt/update.rhai @@ -1,3 +1,3 @@ import "andax/nvidia.rhai" as nvidia; -rpm.version(nvidia::nvidia_component_version("libcusparselt")); +rpm.version(nvidia::nvidia_component_version("libcusparse")); From f3574b0f5d04a0434c6763695d4d27db10b3881a Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 5 Jan 2025 14:50:59 +0700 Subject: [PATCH 18/23] cusparselt is not from cuda toolkit --- anda/lib/nvidia/libcusparselt/update.rhai | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/anda/lib/nvidia/libcusparselt/update.rhai b/anda/lib/nvidia/libcusparselt/update.rhai index ca0407fbbe..fd9a042cee 100644 --- a/anda/lib/nvidia/libcusparselt/update.rhai +++ b/anda/lib/nvidia/libcusparselt/update.rhai @@ -1,3 +1,5 @@ -import "andax/nvidia.rhai" as nvidia; +let series = "0.6.3" +let url = `https://developer.download.nvidia.com/compute/cusparselt/redist/redistrib_${series}.json`; +let json = get(url).json(); -rpm.version(nvidia::nvidia_component_version("libcusparse")); +rpm.version(json["libcusparse_lt"]["version"]); From ea25852ed7d1220ad27e9ceb4493ef7b30678f3a Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Tue, 7 Jan 2025 18:35:14 +0700 Subject: [PATCH 19/23] add nvidia subrepo label for multirepo --- anda/system/nvidia/libva-nvidia-driver/anda.hcl | 3 +++ anda/system/nvidia/nvidia-driver/anda.hcl | 3 +++ anda/system/nvidia/nvidia-kmod-common/anda.hcl | 3 +++ anda/system/nvidia/nvidia-kmod/anda.hcl | 1 + anda/system/nvidia/nvidia-modprobe/anda.hcl | 3 +++ anda/system/nvidia/nvidia-persistenced/anda.hcl | 3 +++ anda/system/nvidia/nvidia-settings/anda.hcl | 3 +++ anda/system/nvidia/nvidia-xconfig/anda.hcl | 3 +++ 8 files changed, 22 insertions(+) diff --git a/anda/system/nvidia/libva-nvidia-driver/anda.hcl b/anda/system/nvidia/libva-nvidia-driver/anda.hcl index e7d4425edb..c64229793a 100644 --- a/anda/system/nvidia/libva-nvidia-driver/anda.hcl +++ b/anda/system/nvidia/libva-nvidia-driver/anda.hcl @@ -3,4 +3,7 @@ project "pkg" { spec = "libva-nvidia-driver.spec" } arches = ["x86_64", "aarch64", "i386"] + labels = { + subrepo = "nvidia" + } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-driver/anda.hcl b/anda/system/nvidia/nvidia-driver/anda.hcl index bf45a257bf..87c3e05431 100644 --- a/anda/system/nvidia/nvidia-driver/anda.hcl +++ b/anda/system/nvidia/nvidia-driver/anda.hcl @@ -6,4 +6,7 @@ project "pkg" { pre_script = "nvidia-generate-tarballs.sh" } arches = ["x86_64", "aarch64", "i386"] + labels = { + subrepo = "nvidia" + } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-kmod-common/anda.hcl b/anda/system/nvidia/nvidia-kmod-common/anda.hcl index fbed87f861..915b62fb8f 100644 --- a/anda/system/nvidia/nvidia-kmod-common/anda.hcl +++ b/anda/system/nvidia/nvidia-kmod-common/anda.hcl @@ -3,4 +3,7 @@ project "pkg" { spec = "nvidia-kmod-common.spec" } arches = ["x86_64"] + labels = { + subrepo = "nvidia" + } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-kmod/anda.hcl b/anda/system/nvidia/nvidia-kmod/anda.hcl index e03051a008..b5ccca3615 100644 --- a/anda/system/nvidia/nvidia-kmod/anda.hcl +++ b/anda/system/nvidia/nvidia-kmod/anda.hcl @@ -4,5 +4,6 @@ project "pkg" { } labels { mock = 1 + subrepo = "nvidia" } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-modprobe/anda.hcl b/anda/system/nvidia/nvidia-modprobe/anda.hcl index 749e7da4dd..12fa43ca14 100644 --- a/anda/system/nvidia/nvidia-modprobe/anda.hcl +++ b/anda/system/nvidia/nvidia-modprobe/anda.hcl @@ -2,4 +2,7 @@ project "pkg" { rpm { spec = "nvidia-modprobe.spec" } + labels = { + subrepo = "nvidia" + } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-persistenced/anda.hcl b/anda/system/nvidia/nvidia-persistenced/anda.hcl index b173dd8053..94fb3ebc91 100644 --- a/anda/system/nvidia/nvidia-persistenced/anda.hcl +++ b/anda/system/nvidia/nvidia-persistenced/anda.hcl @@ -2,4 +2,7 @@ project "pkg" { rpm { spec = "nvidia-persistenced.spec" } + labels = { + subrepo = "nvidia" + } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-settings/anda.hcl b/anda/system/nvidia/nvidia-settings/anda.hcl index 7ad058454f..bfec503ed7 100644 --- a/anda/system/nvidia/nvidia-settings/anda.hcl +++ b/anda/system/nvidia/nvidia-settings/anda.hcl @@ -2,4 +2,7 @@ project "pkg" { rpm { spec = "nvidia-settings.spec" } + labels = { + subrepo = "nvidia" + } } \ No newline at end of file diff --git a/anda/system/nvidia/nvidia-xconfig/anda.hcl b/anda/system/nvidia/nvidia-xconfig/anda.hcl index 0d936148e6..0008900a30 100644 --- a/anda/system/nvidia/nvidia-xconfig/anda.hcl +++ b/anda/system/nvidia/nvidia-xconfig/anda.hcl @@ -2,4 +2,7 @@ project "pkg" { rpm { spec = "nvidia-xconfig.spec" } + labels = { + subrepo = "nvidia" + } } \ No newline at end of file From 5fd41fa56237838be93fba806a2a97603e975bd1 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 12 Jan 2025 15:55:42 +0700 Subject: [PATCH 20/23] set version for nvidia tarball --- anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh index bd3d25605f..5d66abe16b 100755 --- a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh +++ b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh @@ -3,7 +3,7 @@ CONTEXT=$(realpath $(dirname $0)) set -e set_vars() { - export VERSION=${VERSION:?"VERSION not set"} + export VERSION=${VERSION:-"565.77"} export DL_SITE=${DL_SITE:-http://download.nvidia.com/XFree86} export TEMP_UNPACK=${ARCH} export PLATFORM=Linux-${ARCH} From f408ae1eeab1a854c312b4bd1692d2ab973385e6 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 12 Jan 2025 16:08:11 +0700 Subject: [PATCH 21/23] nvidia-driver: download tarballs on build time --- anda/system/nvidia/nvidia-driver/anda.hcl | 2 +- .../nvidia/nvidia-driver/nvidia-driver.spec | 36 ++++++++++++--- .../nvidia-driver/nvidia-generate-tarballs.sh | 44 +++++++++++-------- 3 files changed, 56 insertions(+), 26 deletions(-) diff --git a/anda/system/nvidia/nvidia-driver/anda.hcl b/anda/system/nvidia/nvidia-driver/anda.hcl index 87c3e05431..8bc8244a71 100644 --- a/anda/system/nvidia/nvidia-driver/anda.hcl +++ b/anda/system/nvidia/nvidia-driver/anda.hcl @@ -3,7 +3,7 @@ project "pkg" { spec = "nvidia-driver.spec" # We run the negativo17 generator script here because I genuinely tried fixing the spec file with our fancy patch and it didn't work # TODO: Port it inside the specfile scripts - pre_script = "nvidia-generate-tarballs.sh" + # pre_script = "nvidia-generate-tarballs.sh" } arches = ["x86_64", "aarch64", "i386"] labels = { diff --git a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec index 96e237c79d..805f43661c 100644 --- a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec +++ b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec @@ -17,9 +17,9 @@ License: NVIDIA License URL: http://www.nvidia.com/object/unix.html ExclusiveArch: %{ix86} x86_64 aarch64 -Source0: %{name}-%{version}-i386.tar.xz -Source1: %{name}-%{version}-x86_64.tar.xz -Source2: %{name}-%{version}-aarch64.tar.xz +%dnl Source0: %{name}-%{version}-i386.tar.xz +%dnl Source1: %{name}-%{version}-x86_64.tar.xz +%dnl Source2: %{name}-%{version}-aarch64.tar.xz Source8: 70-nvidia-driver.preset Source9: 70-nvidia-driver-cuda.preset Source10: 10-nvidia.conf @@ -42,6 +42,9 @@ BuildRequires: python3 BuildRequires: systemd-rpm-macros %endif +BuildRequires: wget +BuildRequires: coreutils + Requires: nvidia-driver-libs%{?_isa} = %{?epoch:%{epoch}:}%{version} Requires: nvidia-kmod-common = %{?epoch:%{epoch}:}%{version} @@ -160,16 +163,37 @@ The NVIDIA X.org X11 driver and associated components. %endif %prep +source %{SOURCE99} +export VERSION=%{version} + %ifarch %{ix86} -%setup -q -n %{name}-%{version}-i386 +ARCH=x86_64 +set_vars +run_file_get +run_file_extract +cleanup_folder +create_tarball +%setup -D -T -n %{name}-%{version}-i386 %endif %ifarch x86_64 -%setup -q -T -b 1 -n %{name}-%{version}-x86_64 +export ARCH=x86_64 +set_vars +run_file_get +run_file_extract +cleanup_folder +create_tarball +%setup -D -T -n %{name}-%{version}-x86_64 %endif %ifarch aarch64 -%setup -q -T -b 2 -n %{name}-%{version}-aarch64 +export ARCH=aarch64 +set_vars +run_file_get +run_file_extract +cleanup_folder +create_tarball +%setup -D -T -n %{name}-%{version}-aarch64 %endif %ifarch x86_64 diff --git a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh index 5d66abe16b..37a41b0bc3 100755 --- a/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh +++ b/anda/system/nvidia/nvidia-driver/nvidia-generate-tarballs.sh @@ -1,9 +1,14 @@ #!/bin/sh +# Slightly modified from negativo's tarball generator script + +# instead of generating tarballs, we just make this script export +# the functions + CONTEXT=$(realpath $(dirname $0)) set -e set_vars() { - export VERSION=${VERSION:-"565.77"} + export VERSION=${VERSION:?"VERSION not set"} export DL_SITE=${DL_SITE:-http://download.nvidia.com/XFree86} export TEMP_UNPACK=${ARCH} export PLATFORM=Linux-${ARCH} @@ -86,26 +91,27 @@ create_tarball() { printf "Creating tarball $tarball... " - XZ_OPT='-T0' tar --remove-files -cJf $tarball.tar.xz $tarball + # XZ_OPT='-T0' tar --remove-files -cJf $tarball.tar.xz $tarball printf "OK\n" done } -pushd $CONTEXT - -ARCH=aarch64 -set_vars -run_file_get -run_file_extract -cleanup_folder -create_tarball - -ARCH=x86_64 -set_vars -run_file_get -run_file_extract -cleanup_folder -create_tarball - -popd \ No newline at end of file + +# pushd $CONTEXT + +# ARCH=aarch64 +# set_vars +# run_file_get +# run_file_extract +# cleanup_folder +# create_tarball + +# ARCH=x86_64 +# set_vars +# run_file_get +# run_file_extract +# cleanup_folder +# create_tarball + +# popd \ No newline at end of file From 1f4108040ee1e34ddfd5995c8a658f0ad7c89657 Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 12 Jan 2025 16:10:17 +0700 Subject: [PATCH 22/23] clean up inline prep script --- .../nvidia/nvidia-driver/nvidia-driver.spec | 28 ++++++++----------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec index 805f43661c..627e59259a 100644 --- a/anda/system/nvidia/nvidia-driver/nvidia-driver.spec +++ b/anda/system/nvidia/nvidia-driver/nvidia-driver.spec @@ -166,33 +166,29 @@ The NVIDIA X.org X11 driver and associated components. source %{SOURCE99} export VERSION=%{version} +unpack() { + set_vars + run_file_get + run_file_extract + cleanup_folder + create_tarball +} + %ifarch %{ix86} -ARCH=x86_64 -set_vars -run_file_get -run_file_extract -cleanup_folder -create_tarball +export ARCH=x86_64 +unpack %setup -D -T -n %{name}-%{version}-i386 %endif %ifarch x86_64 export ARCH=x86_64 -set_vars -run_file_get -run_file_extract -cleanup_folder -create_tarball +unpack %setup -D -T -n %{name}-%{version}-x86_64 %endif %ifarch aarch64 export ARCH=aarch64 -set_vars -run_file_get -run_file_extract -cleanup_folder -create_tarball +unpack %setup -D -T -n %{name}-%{version}-aarch64 %endif From 0469f61ae1977d55b66bc39e49118d1383a5ff8a Mon Sep 17 00:00:00 2001 From: Cappy Ishihara Date: Sun, 12 Jan 2025 16:16:08 +0700 Subject: [PATCH 23/23] NVProf is dropped in Jetpack 5, so there's no ARM version of it. --- anda/lib/nvidia/cuda-nvprof/anda.hcl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/anda/lib/nvidia/cuda-nvprof/anda.hcl b/anda/lib/nvidia/cuda-nvprof/anda.hcl index 8ea4e6fdf0..5cb745d7b2 100644 --- a/anda/lib/nvidia/cuda-nvprof/anda.hcl +++ b/anda/lib/nvidia/cuda-nvprof/anda.hcl @@ -2,4 +2,6 @@ project pkg { rpm { spec = "cuda-nvprof.spec" } + + arches = ["x86_64"] }