diff --git a/10-nvidia.conf b/10-nvidia.conf new file mode 100644 index 0000000000000000000000000000000000000000..98fc7f187a70412193947a29609e6079c533f942 --- /dev/null +++ b/10-nvidia.conf @@ -0,0 +1,9 @@ +Section "OutputClass" + Identifier "nvidia" + MatchDriver "nvidia-drm" + Driver "nvidia" + Option "AllowEmptyInitialConfiguration" + Option "PrimaryGPU" "yes" + Option "SLI" "Auto" + Option "BaseMosaic" "on" +EndSection diff --git a/60-nvidia.rules b/60-nvidia.rules new file mode 100644 index 0000000000000000000000000000000000000000..7a0f524aa46fad64f45eba2ef2f76032c39189df --- /dev/null +++ b/60-nvidia.rules @@ -0,0 +1,15 @@ +# Device nodes are created by nvidia-modprobe, which is called by the nvidia +# DDX or other components. +# In case the DDX is not started, the device nodes are never created, so call +# nvidia-modprobe in the udev rules to cover various cases like Wayland, compute +# node without a started display or Optimus laptop. +ACTION=="add|bind", KERNEL=="nvidia", RUN+="/usr/bin/nvidia-modprobe" +ACTION=="add|bind", KERNEL=="nvidia_uvm", RUN+="/usr/bin/nvidia-modprobe -c0 -u" + +# 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/70-nvidia-driver-cuda.preset b/70-nvidia-driver-cuda.preset new file mode 100644 index 0000000000000000000000000000000000000000..04aec513f68b416d17a55de501754c2b99556478 --- /dev/null +++ b/70-nvidia-driver-cuda.preset @@ -0,0 +1,10 @@ +# Enable persistence state. From: +# file:///usr/share/doc/nvidia-driver/html/nvidia-persistenced.html + +enable nvidia-persistenced.service + +# Enable Fabric Manager: +enable nvidia-fabricmanager.service + +# Enable IMEX: +enable nvidia-imex.service diff --git a/70-nvidia-driver.preset b/70-nvidia-driver.preset new file mode 100644 index 0000000000000000000000000000000000000000..f897d23a61704230adf61efad345acd3b8e0a860 --- /dev/null +++ b/70-nvidia-driver.preset @@ -0,0 +1,12 @@ +# 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 nvidia-suspend-then-hibernate.service + +# Enable Dynamic Boost. From: +# file:///usr/share/doc/nvidia-driver/html/dynamicboost.html + +enable nvidia-powerd.service diff --git a/99-nvidia.conf b/99-nvidia.conf new file mode 100644 index 0000000000000000000000000000000000000000..a4af5e32dd990bcfc5ec0106a47c9cd1b6977dcd --- /dev/null +++ b/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-uvm nvidia-peermem " diff --git a/README.en.md b/README.en.md index 48918b1dc614e3f6809212cf43b63504c25e3ea9..57687c5c489ef795ab3fd698b0b56ad4b018619f 100644 --- a/README.en.md +++ b/README.en.md @@ -1,4 +1,4 @@ -# nvidia-595 +# nvidia #### Description {**When you're done, you can delete the content in this README and update the file with details for others getting started with your repository**} diff --git a/README.md b/README.md index 2ced9b837ef7fc42b01c15bf1b4aa277f3934e45..1aa55929924f4baa985bc6365184500366be6af5 100644 --- a/README.md +++ b/README.md @@ -1,39 +1 @@ -# nvidia-595 - -#### 介绍 -{**以下是 Gitee 平台说明,您可以替换此简介** -Gitee 是 OSCHINA 推出的基于 Git 的代码托管平台(同时支持 SVN)。专为开发者提供稳定、高效、安全的云端软件开发协作平台 -无论是个人、团队、或是企业,都能够用 Gitee 实现代码托管、项目管理、协作开发。企业项目请看 [https://gitee.com/enterprises](https://gitee.com/enterprises)} - -#### 软件架构 -软件架构说明 - - -#### 安装教程 - -1. xxxx -2. xxxx -3. xxxx - -#### 使用说明 - -1. xxxx -2. xxxx -3. xxxx - -#### 参与贡献 - -1. Fork 本仓库 -2. 新建 Feat_xxx 分支 -3. 提交代码 -4. 新建 Pull Request - - -#### 特技 - -1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md -2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com) -3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目 -4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目 -5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help) -6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/) +nvidia-driver-server is the driver for Nvidia DataCenter GPU. \ No newline at end of file diff --git a/alternate-install-present b/alternate-install-present new file mode 100644 index 0000000000000000000000000000000000000000..594dc21c228a37683a28cac65546dfe34ba64987 --- /dev/null +++ b/alternate-install-present @@ -0,0 +1,2 @@ +The NVIDIA proprietary driver is already installed in this system. +It was installed through packages and not with the self extracting executable. diff --git a/com.nvidia.driver.metainfo.xml b/com.nvidia.driver.metainfo.xml new file mode 100644 index 0000000000000000000000000000000000000000..fd652e7ae8cbd5aa1abf04f4ea0d96ac19a537d9 --- /dev/null +++ b/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/ + cudatools@nvidia.com + + True + +
diff --git a/com.nvidia.driver.png b/com.nvidia.driver.png new file mode 100644 index 0000000000000000000000000000000000000000..ff023b8b1b8ee56018b5e0d3232ac7337262ab4e Binary files /dev/null and b/com.nvidia.driver.png differ diff --git a/dkms-nvidia.conf b/dkms-nvidia.conf new file mode 100644 index 0000000000000000000000000000000000000000..8f2bd7311d3d773a46beb7c77a9574a609064700 --- /dev/null +++ b/dkms-nvidia.conf @@ -0,0 +1,20 @@ +PACKAGE_NAME="nvidia" +PACKAGE_VERSION="__VERSION_STRING" +AUTOINSTALL="yes" + +MAKE[0]="'make' -j2 module SYSSRC=${kernel_source_dir} IGNORE_XEN_PRESENCE=1 IGNORE_PREEMPT_RT_PRESENCE=1 IGNORE_CC_MISMATCH=1" + +BUILT_MODULE_NAME[0]="nvidia" +DEST_MODULE_LOCATION[0]="/extra" + +BUILT_MODULE_NAME[1]="nvidia-modeset" +DEST_MODULE_LOCATION[1]="/extra" + +BUILT_MODULE_NAME[2]="nvidia-drm" +DEST_MODULE_LOCATION[2]="/extra" + +BUILT_MODULE_NAME[3]="nvidia-uvm" +DEST_MODULE_LOCATION[3]="/extra" + +BUILT_MODULE_NAME[4]="nvidia-peermem" +DEST_MODULE_LOCATION[4]="/extra" diff --git a/nvidia-595.spec b/nvidia-595.spec new file mode 100644 index 0000000000000000000000000000000000000000..60746692192c2f14da09bc78961c3c9a8409a6a9 --- /dev/null +++ b/nvidia-595.spec @@ -0,0 +1,729 @@ +# This is for both geforce and datacenter GPUs. +# merged specfile +# dkms-nvidia https://github.com/NVIDIA/yum-packaging-dkms-nvidia +## related specfile +# nvidia-kmod-common https://github.com/NVIDIA/yum-packaging-nvidia-kmod-common +%global pkg_ver 595.58.03 +%global pkg_main_ver %(echo %{pkg_ver} | cut -d. -f1) +%global pkg_release 1 +# 最新版本驱动,包名不含版本号 +%global default_driver 0 + +# for package name +%if %{default_driver} == 0 + %global src_pkg_name nvidia-%{pkg_main_ver} + %global pkg_name nvidia-driver-%{pkg_main_ver} + %global pkg_open_name nvidia-driver-%{pkg_main_ver}-open + %global kmod_pkg_name kmod-nvidia-%{pkg_main_ver}-dkms + %global kmod_open_pkg_name kmod-nvidia-%{pkg_main_ver}-dkms-open +%else + %global src_pkg_name nvidia + %global pkg_name nvidia-driver + %global pkg_open_name nvidia-driver-open + %global kmod_pkg_name kmod-nvidia-latest-dkms + %global kmod_open_pkg_name kmod-nvidia-latest-dkms-open +%endif + +# for build option +%bcond_with kernel_sign +%global debug_package %{nil} +%global __strip /bin/true +%global __os_install_post %{nil} +%global __brp_ldconfig %{nil} +%global _build_id_links none + + +%if ! %{defined _systemd_util_dir} +%global _systemd_util_dir /usr/lib/systemd +%endif + + +Name: %{src_pkg_name} +Version: %{pkg_ver} +Release: %{pkg_release}%{?dist} +Epoch: 3 +Summary: NVIDIA's display driver for NVIDIA graphic cards +License: NVIDIA License and GPLv2 and MIT +URL: http://www.nvidia.com/object/unix.html +ExclusiveArch: x86_64 aarch64 + +Source0: https://cn.download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run +Source1: https://cn.download.nvidia.com/XFree86/aarch64/%{version}/NVIDIA-Linux-aarch64-%{version}.run +# Source2 i386 +Source3: https://github.com/NVIDIA/open-gpu-kernel-modules/archive/refs/tags/%{version}.tar.gz +Source4: 10-nvidia.conf +Source5: alternate-install-present +Source6: com.nvidia.driver.metainfo.xml +Source7: parse-supported-gpus.py +# Due to some bugs with the switch from libappstream-glib to appstream, the icon must also be local: +Source8: com.nvidia.driver.png +Source9: 70-nvidia-driver.preset +Source10: 70-nvidia-driver-cuda.preset +# non root user can access GPU +Source11: nvidia-profiling.conf +# nvidia-kmod-common +Source101: nvidia-boot-update +Source119: nvidia-modeset.conf +Source120: nvidia.conf +Source121: 60-nvidia.rules +Source124: 99-nvidia.conf +# nvidia-persistenced +Source201: nvidia-persistenced.service +# dkms-nvidia +Source301: dkms-nvidia.conf + +%if 0%{?tencentos} == 3 || 0%{?opencloudos} == 8 +# xml.etree.ElementTree has indent only from 3.9+: +BuildRequires: python(abi) >= 3.9 +%else +BuildRequires: python3 +%endif +BuildRequires: systemd-rpm-macros +BuildRequires: libappstream-glib +# for building sign-file +%if %{with kernel_sign} +BuildRequires: kernel-devel +BuildRequires: glibc-devel, glibc-static, libstdc++-static +BuildRequires: gcc +BuildRequires: openssl-devel +%endif + +AutoReqProv: no +# for runtime dependencies +## from orignal nvidia-driver +Conflicts: nvidia-x11-drv +Conflicts: nvidia-x11-drv-470xx +Conflicts: xorg-x11-drv-nvidia +Conflicts: xorg-x11-drv-nvidia-470xx +# from orignal nvidia-driver-libs +Requires: libvdpau >= 0.5 +Requires: libglvnd >= 1.0 +Requires: libglvnd-egl >= 1.0 +Requires: libglvnd-gles >= 1.0 +Requires: libglvnd-glx >= 1.0 +Requires: libglvnd-opengl >= 1.0 +Requires: vulkan-loader +Obsoletes: nvidia-driver-libs < %{epoch}:%{version}-%{release} +Conflicts: nvidia-x11-drv-libs +Conflicts: nvidia-x11-drv-470xx-libs +Conflicts: xorg-x11-drv-nvidia-libs +Conflicts: xorg-x11-drv-nvidia-470xx-libs +# from orignal libnvidia-fbc +Obsoletes: libnvidia-fbc < %{epoch}:%{version}-%{release} +# from orignal libnvidia-ml +Obsoletes: libnvidia-ml < %{epoch}:%{version}-%{release} +Obsoletes: nvidia-driver-NVML < %{epoch}:%{version}-%{release} +# from orignal libnvidia-cfg +Obsoletes: libnvidia-cfg < %{epoch}:%{version}-%{release} +# from orignal cuda +Requires: opencl-filesystem +Requires: ocl-icd +Obsoletes: nvidia-driver-cuda < %{epoch}:%{version}-%{release} +Conflicts: xorg-x11-drv-nvidia-cuda +Conflicts: xorg-x11-drv-nvidia-470xx-cuda +# from orignal nvidia-driver-cuda-libs +Obsoletes: nvidia-driver-cuda-libs < %{epoch}:%{version}-%{release} +Conflicts: xorg-x11-drv-nvidia-cuda-libs +Conflicts: xorg-x11-drv-nvidia-470xx-cuda-libs +# from orignal xorg-x11-nvidia +Requires: xorg-x11-server-Xorg +Obsoletes: xorg-x11-nvidia < %{epoch}:%{version}-%{release} +# nvidia-modprobe +Obsoletes: nvidia-modprobe < %{epoch}:%{version}-%{release} + +%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 -n nvidia +Summary: NVIDIA's display driver for NVIDIA graphic cards +Requires: %{name} = %{epoch}:%{version}-%{release} +AutoReqProv: no + +%description -n nvidia +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 -n nvidia-driver +Summary: NVIDIA's proprietary display driver for NVIDIA graphic cards +Requires: %{pkg_name} = %{epoch}:%{version}-%{release} +AutoReqProv: no + +%description -n nvidia-driver +This package provides the 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 -n nvidia-driver-open +Summary: NVIDIA's opensource display driver for NVIDIA graphic cards +Requires: %{pkg_open_name} = %{epoch}:%{version}-%{release} +AutoReqProv: no + +%description -n nvidia-driver-open +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 -n kmod-nvidia-latest-dkms +Summary: DKMS packaging source for NVIDIA proprietary kernel modules +Requires: %{kmod_pkg_name} = %{epoch}:%{version}-%{release} +AutoReqProv: no + +%description -n kmod-nvidia-latest-dkms +DKMS packaging source for NVIDIA kernel modules + + +%package -n kmod-nvidia-latest-dkms-open +Summary: DKMS packaging source for NVIDIA opensource kernel modules +Requires: %{kmod_open_pkg_name} = %{epoch}:%{version}-%{release} +AutoReqProv: no + +%description -n kmod-nvidia-latest-dkms-open +DKMS packaging source for NVIDIA opensource kernel modules + + +%package -n %{pkg_name} +Summary: NVIDIA's proprietary display driver for NVIDIA graphic cards +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{kmod_pkg_name} = %{epoch}:%{version}-%{release} +Conflicts: %{pkg_open_name} +AutoReqProv: no + +%description -n %{pkg_name} +This package provides the 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}. + +# some new device can only be supported by opensource driver +%package -n %{pkg_open_name} +Summary: NVIDIA's opensource display driver for NVIDIA graphic cards +Requires: %{name} = %{epoch}:%{version}-%{release} +Requires: %{kmod_open_pkg_name} = %{epoch}:%{version}-%{release} +Conflicts: %{pkg_name} +AutoReqProv: no + +%description -n %{pkg_open_name} +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 -n %{kmod_pkg_name} +# merged nvidia-kmod-headers +Summary: DKMS packaging source for NVIDIA proprietary kernel modules +AutoReqProv: no +Requires: dkms +Requires: gcc +%if %{with kernel_sign} +# for sign kmod +Recommends: kernel-signing-keys +Recommends: openssl +%endif +Conflicts: kmod-nvidia-latest-dkms-open +Conflicts: %{kmod_open_pkg_name} + +%description -n %{kmod_pkg_name} +DKMS packaging source for NVIDIA kernel modules + +%package -n %{kmod_open_pkg_name} +# merged nvidia-kmod-source +Summary: DKMS packaging source for NVIDIA opensource kernel modules +AutoReqProv: no +Requires: dkms +Requires: gcc +%if %{with kernel_sign} +# for sign kmod +Recommends: kernel-signing-keys +Recommends: openssl +%endif +Conflicts: kmod-nvidia-latest-dkms +Conflicts: %{kmod_pkg_name} + +%description -n %{kmod_open_pkg_name} +DKMS packaging source for NVIDIA opensource kernel modules + + + +%prep +%setup -q -T -b 3 -n open-gpu-kernel-modules-%{version} +rm -rf kernel-open + +%setup -q -T -c %{name}-%{version} +# nvidia-driver +# .run will forcely create a subdirectory +rm -rf nvidia-tmp +%ifarch x86_64 +chmod +x %{SOURCE0} +bash %{SOURCE0} --extract-only --target nvidia-tmp +mv -v nvidia-tmp/{.,}* . || true +rmdir nvidia-tmp + +%if 0%{?tencentos} == 3 || 0%{?opencloudos} == 8 +rm -f libnvidia-pkcs11-openssl3.so.* +%else +rm -f libnvidia-pkcs11.so.* +%endif + +%endif + +%ifarch aarch64 +chmod +x %{SOURCE1} +bash %{SOURCE1} --extract-only --target nvidia-tmp +mv -v nvidia-tmp/{.,}* . || true +rmdir nvidia-tmp +%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 + +# kmod +rm -f kernel/dkms.conf kernel-open/dkms.conf +cp -a %{SOURCE301} kernel/dkms.conf +chmod +x kernel/dkms.conf +cp -a %{SOURCE301} kernel-open/dkms.conf +chmod +x kernel-open/dkms.conf +sed -i -e 's/__VERSION_STRING/%{version}/g' kernel/dkms.conf +sed -i -e 's/__VERSION_STRING/%{version}/g' kernel-open/dkms.conf +# open module +mv ../open-gpu-kernel-modules-%{version} kernel-source + + + +%build +%if %{with kernel_sign} +# because /usr/src/kernels//scripts/sign-file is an error elf, +# so we need compile it temply +if ! [ -d "/usr/src/kernels/$(uname -r)/scripts" ]; +then + echo "can not find /usr/src/kernels/$(uname -r)/ for kernel version $(uname -r)" + exit 1 +fi + +gcc -Wall -O2 -lcrypto -o sign-file-%{name} /usr/src/kernels/$(uname -r)/scripts/sign-file.c +%endif + + +%install +# EGL loader +install -p -m 0644 -D 10_nvidia.json %{buildroot}%{_datadir}/glvnd/egl_vendor.d/10_nvidia.json + +# Vulkan loader +%if %{pkg_main_ver} >= 560 +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 +%endif + +%if %{pkg_main_ver} >= 560 +%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 +%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/ + +# GBM loader +mkdir -p %{buildroot}%{_libdir}/gbm/ +ln -sf ../libnvidia-allocator.so.%{version} %{buildroot}%{_libdir}/gbm/nvidia-drm_gbm.so + +%ifarch x86_64 +# NGX Proton/Wine library +mkdir -p %{buildroot}%{_libdir}/nvidia/wine/ +cp -a *.dll %{buildroot}%{_libdir}/nvidia/wine/ +%if %{pkg_main_ver} >= 570 +# nvsandboxutils configuration +install -p -m 0644 -D sandboxutils-filelist.json %{buildroot}%{_datadir}/nvidia/files.d/sandboxutils-filelist.json +%endif +%endif + +# alternate-install-present file triggers runfile warning +install -m 0755 -d %{buildroot}/usr/lib/nvidia/ +install -p -m 0644 %{SOURCE5} %{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} +for file in nvidia-{debugdump,smi,cuda-mps-control,cuda-mps-server,bug-report.sh,ngx-updater,powerd,xconfig,modprobe,pcc,persistenced,settings}; do + if [[ -f "$file" ]]; then + cp -pv "$file" "%{buildroot}%{_bindir}/" && + chmod 0755 "%{buildroot}%{_bindir}/$file" + else + echo "Warning: file $file is not existing, skip it" >&2 + fi +done + +# Man pages +mkdir -p %{buildroot}%{_mandir}/man1/ +install -p -m 0644 nvidia-*.gz %{buildroot}%{_mandir}/man1/ + +# X stuff +install -p -m 0644 -D %{SOURCE4} %{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 +%if %{pkg_main_ver} >= 535 +install -p -m 0644 nvoptix.bin %{buildroot}%{_datadir}/nvidia/ +%endif + +# Systemd units and script for suspending/resuming +mkdir -p %{buildroot}%{_systemd_util_dir}/system-preset/ +install -p -m 0644 %{SOURCE9} %{SOURCE10} %{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 +%if (%{pkg_main_ver} >= 550) || (%{pkg_main_ver} < 550 && "%{_arch}" == "x86_64") +install -p -m 0644 -D nvidia-dbus.conf %{buildroot}%{_datadir}/dbus-1/system.d/nvidia-dbus.conf +%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 %{SOURCE6} %{buildroot}%{_metainfodir}/com.nvidia.driver.metainfo.xml +mkdir -p %{buildroot}%{_datadir}/pixmaps/ +cp %{SOURCE8} %{buildroot}%{_datadir}/pixmaps/ + +# non root user can access GPU +install -p -m 0644 -D %{SOURCE11} %{buildroot}%{_sysconfdir}/modprobe.d/nvidia-profiling.conf + +#### +# kmod +#### +# close module +mkdir -p %{buildroot}%{_usrsrc}/nvidia-%{version}/ +cp -fr kernel/* %{buildroot}%{_usrsrc}/nvidia-%{version}/ + +# open module +# Create empty tree +mkdir -p %{buildroot}%{_usrsrc}/nvidia-open-%{version}/src +cp -fr kernel-open/* %{buildroot}%{_usrsrc}/nvidia-open-%{version}/ +cp -fr kernel-source/* %{buildroot}%{_usrsrc}/nvidia-open-%{version}/src/ +# Add symlink +cd %{buildroot}%{_usrsrc}/nvidia-open-%{version}/src/ && +ln -sf ../../nvidia-open-%{version}/ kernel-open && +cd - >/dev/null + +#### +# kmod-common +#### +# Script for post/preun tasks +install -p -m 0755 -D %{SOURCE101} %{buildroot}%{_sbindir}/nvidia-boot-update + +# Nvidia modesetting support: +install -p -m 0644 -D %{SOURCE119} %{buildroot}%{_sysconfdir}/modprobe.d/nvidia-modeset.conf + +# Load nvidia-uvm, enable complete power management: +install -p -m 0644 -D %{SOURCE120} %{buildroot}%{_modprobedir}/nvidia.conf + +# Avoid Nvidia modules getting in the initrd: +install -p -m 0644 -D %{SOURCE124} %{buildroot}%{_prefix}/lib/dracut/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 %{SOURCE121} %{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} + +#### +# nvidia-persistenced +#### +install -p -m 644 -D %{SOURCE201} %{buildroot}%{_unitdir}/nvidia-persistenced.service + +%if %{with kernel_sign} +#### +# kmod sign-file +#### +install -p -m 755 -D sign-file-%{name} %{buildroot}%{_bindir}/sign-file-%{name} +%endif + + + + +%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 + + + +%post -n %{pkg_name} +%systemd_post nvidia-hibernate.service +%if (%{pkg_main_ver} >= 560) || (%{pkg_main_ver} < 560 && "%{_arch}" == "x86_64") +%systemd_post nvidia-powerd.service +%endif +%systemd_post nvidia-resume.service +%systemd_post nvidia-suspend.service +%systemd_post nvidia-suspend-then-hibernate.service +%systemd_post nvidia-persistenced.service + +%preun -n %{pkg_name} +%systemd_preun nvidia-hibernate.service +%if (%{pkg_main_ver} >= 560) || (%{pkg_main_ver} < 560 && "%{_arch}" == "x86_64") +%systemd_preun nvidia-powerd.service +%endif +%systemd_preun nvidia-resume.service +%systemd_preun nvidia-suspend.service +%systemd_preun nvidia-suspend-then-hibernate.service +%systemd_preun nvidia-persistenced.service + +%postun -n %{pkg_name} +%systemd_postun nvidia-hibernate.service +%if (%{pkg_main_ver} >= 560) || (%{pkg_main_ver} < 560 && "%{_arch}" == "x86_64") +%systemd_postun nvidia-powerd.service +%endif +%systemd_postun nvidia-resume.service +%systemd_postun nvidia-suspend.service +%systemd_postun nvidia-suspend-then-hibernate.service +%systemd_postun nvidia-persistenced.service + +%post -n %{pkg_open_name} +%systemd_post nvidia-hibernate.service +%if (%{pkg_main_ver} >= 560) || (%{pkg_main_ver} < 560 && "%{_arch}" == "x86_64") +%systemd_post nvidia-powerd.service +%endif +%systemd_post nvidia-resume.service +%systemd_post nvidia-suspend.service +%systemd_post nvidia-suspend-then-hibernate.service +%systemd_post nvidia-persistenced.service + +%preun -n %{pkg_open_name} +%systemd_preun nvidia-hibernate.service +%if (%{pkg_main_ver} >= 560) || (%{pkg_main_ver} < 560 && "%{_arch}" == "x86_64") +%systemd_preun nvidia-powerd.service +%endif +%systemd_preun nvidia-resume.service +%systemd_preun nvidia-suspend.service +%systemd_preun nvidia-suspend-then-hibernate.service +%systemd_preun nvidia-persistenced.service + +%postun -n %{pkg_open_name} +%systemd_postun nvidia-hibernate.service +%if (%{pkg_main_ver} >= 560) || (%{pkg_main_ver} < 560 && "%{_arch}" == "x86_64") +%systemd_postun nvidia-powerd.service +%endif +%systemd_postun nvidia-resume.service +%systemd_postun nvidia-suspend.service +%systemd_postun nvidia-suspend-then-hibernate.service +%systemd_postun nvidia-persistenced.service + +%post -n %{kmod_pkg_name} +%if %{with kernel_sign} +if grep -q "module.sig_enforce=1" /proc/cmdline || grep "CONFIG_MODULE_SIG_FORCE" /boot/config-$(uname -r); then + echo "✅ module.sig_enforce is enabled" + if ! [ -d "/usr/share/doc/kernel-keys/$(uname -r)" ]; + then + echo "missing kernel-signing-keys, failing sign kmod." + exit 1 + fi + if ! [ -f "/usr/share/doc/kernel-keys/$(uname -r)/signing_key.x509" ]; + then + openssl x509 -in /usr/share/doc/kernel-keys/$(uname -r)/kernel-signing-ca.pem -out /usr/share/doc/kernel-keys/$(uname -r)/signing_key.x509 + fi + export mok_signing_key=/usr/share/doc/kernel-keys/$(uname -r)/kernel-signing-ca.pem + export mok_certificate=/usr/share/doc/kernel-keys/$(uname -r)/signing_key.x509 + export sign_file=/usr/bin/sign-file-nvidia-driver +else + echo "❌ module.sig_enforce is disabled, dkms will not sign kernel module" +fi +%endif +dkms remove -m nvidia-open -q --all || : +dkms add -m nvidia -v %{version} +# Rebuild and make available for the currently running kernel +dkms build -m nvidia -v %{version} +dkms install -m nvidia -v %{version} --force +# kmod-common +%{_sbindir}/nvidia-boot-update post + +%preun -n %{kmod_pkg_name} +# Remove all versions from DKMS registry +dkms remove -m nvidia -v %{version} -q --all || : +# cannot remove nvidia_uvm.ko by default +modprobe -r nvidia_uvm || true +find /lib/modules/$(uname -r) -name "nvidia_uvm.ko*" -delete || true +depmod -a +# kmod-common +if [ "$1" -eq "0" ]; then + %{_sbindir}/nvidia-boot-update preun +fi ||: + +%post -n %{kmod_open_pkg_name} +%if %{with kernel_sign} +if grep -q "module.sig_enforce=1" /proc/cmdline || grep "CONFIG_MODULE_SIG_FORCE" /boot/config-$(uname -r); then + echo "✅ module.sig_enforce is enabled" + if ! [ -d "/usr/share/doc/kernel-keys/$(uname -r)" ]; + then + echo "missing kernel-signing-keys, failing sign kmod." + exit 1 + fi + if ! [ -f "/usr/share/doc/kernel-keys/$(uname -r)/signing_key.x509" ]; + then + openssl x509 -in /usr/share/doc/kernel-keys/$(uname -r)/kernel-signing-ca.pem -out /usr/share/doc/kernel-keys/$(uname -r)/signing_key.x509 + fi + export mok_signing_key=/usr/share/doc/kernel-keys/$(uname -r)/kernel-signing-ca.pem + export mok_certificate=/usr/share/doc/kernel-keys/$(uname -r)/signing_key.x509 + export sign_file=/usr/bin/sign-file-nvidia-driver +else + echo "❌ module.sig_enforce is disabled, dkms will not sign kernel module" +fi +%endif +dkms remove -m nvidia -q --all || : +dkms add -m nvidia-open -v %{version} +# Rebuild and make available for the currently running kernel +dkms build -m nvidia-open -v %{version} +dkms install -m nvidia-open -v %{version} --force +# kmod-common +%{_sbindir}/nvidia-boot-update post + +%preun -n %{kmod_open_pkg_name} +# Remove all versions from DKMS registry +dkms remove -m nvidia-open -v %{version} -q --all || : +# cannot remove nvidia_uvm.ko by default +modprobe -r nvidia_uvm || true +find /lib/modules/$(uname -r) -name "nvidia_uvm.ko*" -delete || true +depmod -a +# kmod-common +if [ "$1" -eq "0" ]; then + %{_sbindir}/nvidia-boot-update preun +fi ||: + + + +%files +%license LICENSE +%doc NVIDIA_Changelog README.txt html supported-gpus/supported-gpus.json +%dir %{_sysconfdir}/nvidia +%{_bindir}/* +%{_libdir}/*.so* +%dir %{_libdir}/gbm +%{_libdir}/gbm/nvidia-drm_gbm.so +%ifarch x86_64 +%dir %{_libdir}/nvidia +%dir %{_libdir}/nvidia/wine +%{_libdir}/nvidia/wine/*.dll +%endif +%{_libdir}/xorg/modules/extensions/libglxserver_nvidia.so +%{_libdir}/xorg/modules/drivers/nvidia_drv.so +%{_libdir}/vdpau/*.so.* +%if (%{pkg_main_ver} >= 550) || (%{pkg_main_ver} < 550 && "%{_arch}" == "x86_64") +%{_datadir}/dbus-1/system.d/nvidia-dbus.conf +%endif +%{_datadir}/nvidia/ +%{_datadir}/pixmaps/com.nvidia.driver.png +%{_datadir}/glvnd/egl_vendor.d/10_nvidia.json +%if %{pkg_main_ver} >= 560 +%{_datadir}/vulkan/icd.d/nvidia_icd.%{_target_cpu}.json +%endif +%{_datadir}/vulkan/implicit_layer.d/nvidia_layers.json +%ifarch x86_64 +%if %{pkg_main_ver} >= 560 +%{_datadir}/vulkansc/icd.d/nvidia_icd.%{_target_cpu}.json +%endif +%endif +%{_prefix}/lib/nvidia/alternate-install-present +%{_systemd_util_dir}/system-preset/70-nvidia-driver.preset +%{_systemd_util_dir}/system-preset/70-nvidia-driver-cuda.preset +%{_systemd_util_dir}/system-sleep/nvidia +%{_unitdir}/nvidia-*.service +%{_metainfodir}/com.nvidia.driver.metainfo.xml +%config(noreplace) %{_sysconfdir}/X11/xorg.conf.d/10-nvidia.conf +%{_sysconfdir}/OpenCL/vendors/* +%{_mandir}/man1/ +%{_sysconfdir}/modprobe.d/nvidia-profiling.conf + +%files -n %{pkg_name} +%license LICENSE +%doc NVIDIA_Changelog README.txt html supported-gpus/supported-gpus.json + +%files -n %{pkg_open_name} +%license LICENSE +%doc NVIDIA_Changelog README.txt html supported-gpus/supported-gpus.json + +%files -n %{kmod_pkg_name} +%{_usrsrc}/nvidia-%{version}/ +# kmod-common +%{_prefix}/lib/dracut/dracut.conf.d/99-nvidia.conf +%{_modprobedir}/nvidia.conf +%{_prefix}/lib/firmware/nvidia/%{version} +%{_sbindir}/nvidia-boot-update +%config %{_sysconfdir}/modprobe.d/nvidia-modeset.conf +%{_udevrulesdir}/60-nvidia.rules + +%files -n %{kmod_open_pkg_name} +%{_usrsrc}/nvidia-open-%{version}/ +# kmod-common +%{_prefix}/lib/dracut/dracut.conf.d/99-nvidia.conf +%{_modprobedir}/nvidia.conf +%{_prefix}/lib/firmware/nvidia/%{version} +%{_sbindir}/nvidia-boot-update +%config %{_sysconfdir}/modprobe.d/nvidia-modeset.conf +%{_udevrulesdir}/60-nvidia.rules + +%files -n nvidia + +%files -n nvidia-driver + +%files -n nvidia-driver-open + +%files -n kmod-nvidia-latest-dkms + +%files -n kmod-nvidia-latest-dkms-open + + + +%changelog +* Tue Apr 28 2026 shouhuanxiaoji <345865759@163.com> - 3:595.58.03-1 +- [Type] sync +- [DESC] Update driver version to 595.58.03. \ No newline at end of file diff --git a/nvidia-boot-update b/nvidia-boot-update new file mode 100644 index 0000000000000000000000000000000000000000..327fb5d757c95cea4429b0c2a68c8d7c41af7aae --- /dev/null +++ b/nvidia-boot-update @@ -0,0 +1,163 @@ +#!/usr/bin/sh + + +# Complete use case coverage, regardless of boot loaders: +# +# - update options in /etc/default/grub +# - regenerate grub.cfg/grubenv +# - update options in /boot/{efi/}loader/entries/*.conf entries +# - update options in /etc/kernel/cmdline +# - cover both UEFI and BIOS case + +CMDLINE_ARGS_NVIDIA="rd.driver.blacklist=nouveau" +CMDLINE_ARGS_ALWAYS_REMOVE="nomodeset gfxpayload=vga=normal nouveau.modeset=0 nvidia-drm.modeset=1 nvidia-drm.fbdev=1 modprobe.blacklist=nouveau initcall_blacklist=simpledrm_platform_driver_init" + +print_usage() { +cat <> /etc/default/grub + else + for param in $CMDLINE_ARGS_NVIDIA; do + echo ${GRUB_CMDLINE_LINUX} | grep -q $param + [ $? -eq 1 ] && GRUB_CMDLINE_LINUX="${GRUB_CMDLINE_LINUX} ${param}" + done + for param in $CMDLINE_ARGS_ALWAYS_REMOVE; do + echo ${GRUB_CMDLINE_LINUX} | grep -q $param + [ $? -eq 0 ] && GRUB_CMDLINE_LINUX="$(echo ${GRUB_CMDLINE_LINUX} | sed -e "s/ $param//g")" + done + sed -i -e "s|^GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX=\"${GRUB_CMDLINE_LINUX}\"|g" /etc/default/grub + fi + + grub2-mkconfig -o $GRUB_CFG &>/dev/null + + fi + + # Edit BootLoaderSpec entries + if [ -v BLS_ENTRIES ]; then + + for config_file in $BLS_ENTRIES/*.conf; do + for param in $CMDLINE_ARGS_NVIDIA; do + grep -q $param $config_file + [ $? -eq 1 ] && sed -i -e "s|^options.*|& $param|" $config_file + done + for param in $CMDLINE_ARGS_ALWAYS_REMOVE; do + grep -q $param $config_file + [ $? -eq 0 ] && sed -i -e "s| $param||" $config_file + done + done + + fi + + # Edit /etc/kernel/cmdline + for param in $CMDLINE_ARGS_NVIDIA; do + grep -q $param /etc/kernel/cmdline + [ $? -eq 1 ] && sed -i -e "s|^.*|& $param|" /etc/kernel/cmdline + done + for param in $CMDLINE_ARGS_ALWAYS_REMOVE; do + grep -q $param /etc/kernel/cmdline + [ $? -eq 0 ] && sed -i -e "s| $param||" /etc/kernel/cmdline + done + +} + +preun() { + + # Edit GRUB configuration file + if [ -v GRUB_CFG ]; then + + for param in $CMDLINE_ARGS_NVIDIA; do + echo ${GRUB_CMDLINE_LINUX} | grep -q $param + [ $? -eq 0 ] && GRUB_CMDLINE_LINUX="$(echo ${GRUB_CMDLINE_LINUX} | sed -e "s/ $param//g")" + done + sed -i -e "s|^GRUB_CMDLINE_LINUX=.*|GRUB_CMDLINE_LINUX=\"${GRUB_CMDLINE_LINUX}\"|g" /etc/default/grub + + grub2-mkconfig -o $GRUB_CFG &>/dev/null + + fi + + # Edit BootLoaderSpec entries + if [ -v BLS_ENTRIES ]; then + + for config_file in $BLS_ENTRIES/*.conf; do + for param in $CMDLINE_ARGS_NVIDIA; do + grep -q $param $config_file + [ $? -eq 0 ] && sed -i -e "s| $param||" $config_file + done + done + + fi + + # Edit /etc/kernel/cmdline + for param in $CMDLINE_ARGS_NVIDIA; do + grep -q $param /etc/kernel/cmdline + [ $? -eq 0 ] && sed -i -e "s| $param||" /etc/kernel/cmdline + done + +} + +case "$1" in + post) + check + post + exit 0 + ;; + preun) + check + preun + exit 0 + ;; + *) + print_usage + exit 0 + ;; +esac diff --git a/nvidia-modeset.conf b/nvidia-modeset.conf new file mode 100644 index 0000000000000000000000000000000000000000..8645dabcee222d3e473cdea1fe5f715a411cc99a --- /dev/null +++ b/nvidia-modeset.conf @@ -0,0 +1,4 @@ +# Nvidia modesetting support. Set to 0 or comment to disable kernel modesetting +# and framebuffer console support. This must be disabled in case of Mosaic or SLI. + +options nvidia-drm modeset=1 diff --git a/nvidia-persistenced.service b/nvidia-persistenced.service new file mode 100644 index 0000000000000000000000000000000000000000..8a461edc2c1cb6040e67173b8324dd0ca38515b4 --- /dev/null +++ b/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/bin/nvidia-persistenced --verbose +ExecStopPost=/bin/rm -rf /var/run/nvidia-persistenced/* +TimeoutSec=300 + +[Install] +WantedBy=multi-user.target diff --git a/nvidia-profiling.conf b/nvidia-profiling.conf new file mode 100644 index 0000000000000000000000000000000000000000..acf5fa404b4a9deca6a88a5a505e3b4a8921bbe4 --- /dev/null +++ b/nvidia-profiling.conf @@ -0,0 +1 @@ +options nvidia NVreg_RestrictProfilingToAdminUsers=0 diff --git a/nvidia.conf b/nvidia.conf new file mode 100644 index 0000000000000000000000000000000000000000..788e69821d87f067d8c8b09da835c37a3064118c --- /dev/null +++ b/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 + +# Add soft dependencies for extra modules as adding the module loading to +# /usr/lib/modules-load.d/*.conf for systemd consumption, makes the +# configuration file to be added to the initrd but not the module, throwing an +# error on plymouth about not being able to find the module. +# Ref: /usr/lib/dracut/modules.d/00systemd/module-setup.sh + +# Even adding the modules is not the correct thing, as we don't want it to be +# included in the initrd, so use this configuration file to specify the +# dependency. + +softdep nvidia post: nvidia-uvm nvidia-drm + +# 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 diff --git a/parse-supported-gpus.py b/parse-supported-gpus.py new file mode 100644 index 0000000000000000000000000000000000000000..cb2feef6c34b6c93a70f37d31d338a5591851e07 --- /dev/null +++ b/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() diff --git a/sources b/sources new file mode 100644 index 0000000000000000000000000000000000000000..3516a83d011c8fa2e7881038338b0832ea05553f --- /dev/null +++ b/sources @@ -0,0 +1,3 @@ +SHA512 (NVIDIA-Linux-aarch64-595.58.03.run) = 4dd1544019df01bbb6e7640aeab32b32801e45f36604eee4143992c3b1710960927d55f05ee831058c4a8af861f698c450f7d2f93077fcb652b48f53743acd2b +SHA512 (NVIDIA-Linux-x86_64-595.58.03.run) = d38e184805230ab1dc7065c49814d92c7033cf0e078e2cec919baef05d8ea297d061fb45a8fec608e7b2823f756568df3cbe1b08d75e8581c55a380413018499 +SHA512 (595.58.03.tar.gz) = a422b6935209d590f57fa6766f59bb207d9130f8a6777af9245c4ff8cd0f4c4ccef4602a0b26d543e1e8efba24241180992fdb749ea4e5d2aa5218a584b85101