nvidia 525.78.01-1 (x86_64) 2023-17119
0

Status rejected
Submitter bero [@T] lindev.ch
Platform rolling
Repository non-free
URL https://abf.openmandriva.org/build_lists/284970
Packages
nvidia-525.78.01-1.x86_64.source
nvidia-525.78.01-1.x86_64.binary
nvidia-32bit-525.78.01-1.x86_64.binary
nvidia-dkms-kmod-525.78.01-1.x86_64.binary
nvidia-kmod-common-525.78.01-1.x86_64.binary
nvidia-kmod-desktop-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-desktop-gcc-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-headers-525.78.01-1.x86_64.binary
nvidia-kmod-nvidia-open-dkms-525.78.01-1.x86_64.binary
nvidia-kmod-open-desktop-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-open-desktop-gcc-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-open-rc-desktop-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-open-rc-desktop-gcc-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-open-rc-server-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-open-rc-server-gcc-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-open-server-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-open-server-gcc-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-rc-desktop-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-rc-desktop-gcc-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-rc-server-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-rc-server-gcc-525.78.01-1_6.2.0_0.rc2.1.x86_64.binary
nvidia-kmod-server-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-server-gcc-525.78.01-1_6.1.2_1.x86_64.binary
nvidia-kmod-source-525.78.01-1.x86_64.binary
Build Date 2023-01-08 22:19:06 +0000 UTC
Last Updated 2023-01-09 00:15:29.880070872 +0000 UTC
$ git diff --patch-with-stat --summary 39eb5b33ccf9738261ade343e69ae5874aa5befd..72bce80a03a870592597dc4d2447663c80a816b9

 .abf.yml                          |   4 +-
 60-nvidia.rules                   |  14 +
 99-nvidia.conf                    |   3 +
 NaziVidia-kernel-6.0.patch        |  25 ++
 README.md                         |   3 +-
 dkms-nvidia.conf                  |  20 ++
 nvidia-525-aarch64-clang-15.patch |  42 +++
 nvidia-525-clang-15.patch         | 472 +++++++++++++++++++++++++++
 nvidia-fix-linux-5.10.patch       |  51 ---
 nvidia.spec                       | 648 ++++++++++++++++++++++++--------------
 10 files changed, 982 insertions(+), 300 deletions(-)
 create mode 100644 60-nvidia.rules
 create mode 100644 99-nvidia.conf
 create mode 100644 NaziVidia-kernel-6.0.patch
 create mode 100644 dkms-nvidia.conf
 create mode 100644 nvidia-525-aarch64-clang-15.patch
 create mode 100644 nvidia-525-clang-15.patch
 delete mode 100644 nvidia-fix-linux-5.10.patch

diff --git a/.abf.yml b/.abf.yml
index 1bf99b7..b9ea241 100644
--- a/.abf.yml
+++ b/.abf.yml
@@ -1,3 +1,3 @@
 sources:
-  NVIDIA-Linux-x86_64-470.103.01.run: d8f984e56d6d9e17af4916cdb75aa6fea8e9f6b8
-  NVIDIA-Linux-aarch64-470.103.01.run: 27c87174ad92346e003608f7c33ca3147599bdb1
+  NVIDIA-Linux-aarch64-525.78.01.run: e17473f8189e8da74cd959cda5b588f1bc81300b
+  NVIDIA-Linux-x86_64-525.78.01.run: 1144bdc9d368866c7c84fc56c5f0d39cf94fb0d0
diff --git a/60-nvidia.rules b/60-nvidia.rules
new file mode 100644
index 0000000..6d121bc
--- /dev/null
+++ b/60-nvidia.rules
@@ -0,0 +1,14 @@
+# Make sure device nodes are present even when the DDX is not started for the Wayland/EGLStream case
+KERNEL=="nvidia", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidiactl c $(grep nvidia-frontend /proc/devices | cut -d \  -f 1) 255'"
+KERNEL=="nvidia", RUN+="/usr/bin/bash -c 'for i in $(cat /proc/driver/nvidia/gpus/*/information | grep Minor | cut -d \  -f 4); do /usr/bin/mknod -Z -m 666 /dev/nvidia${i} c $(grep nvidia-frontend /proc/devices | cut -d \  -f 1) ${i}; done'"
+KERNEL=="nvidia_modeset", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidia-modeset c $(grep nvidia-frontend /proc/devices | cut -d \  -f 1) 254'"
+KERNEL=="nvidia_uvm", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidia-uvm c $(grep nvidia-uvm /proc/devices | cut -d \  -f 1) 0'"
+KERNEL=="nvidia_uvm", RUN+="/usr/bin/bash -c '/usr/bin/mknod -Z -m 666 /dev/nvidia-uvm-tools c $(grep nvidia-uvm /proc/devices | cut -d \  -f 1) 1'"
+
+# 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/99-nvidia.conf b/99-nvidia.conf
new file mode 100644
index 0000000..a4af5e3
--- /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/NaziVidia-kernel-6.0.patch b/NaziVidia-kernel-6.0.patch
new file mode 100644
index 0000000..0f21655
--- /dev/null
+++ b/NaziVidia-kernel-6.0.patch
@@ -0,0 +1,25 @@
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-drm/nvidia-drm-helper.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-drm/nvidia-drm-helper.c
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-drm/nvidia-drm-helper.h.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-drm/nvidia-drm-helper.h
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-drm/nvidia-drm-helper.h.omv~	2022-08-23 01:06:09.150920016 +0200
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-drm/nvidia-drm-helper.h	2022-08-23 01:06:29.190984061 +0200
+@@ -27,6 +27,8 @@
+ 
+ #if defined(NV_DRM_AVAILABLE)
+ 
++#include <drm/drm_framebuffer.h>
++
+ #if defined(NV_DRM_DRMP_H_PRESENT)
+ #include <drm/drmP.h>
+ #endif
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel-open/nvidia-drm/nvidia-drm-helper.h.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel-open/nvidia-drm/nvidia-drm-helper.h
+--- NVIDIA-Linux-x86_64-515.65.01/kernel-open/nvidia-drm/nvidia-drm-helper.h.omv~	2022-08-23 01:06:33.403997803 +0200
++++ NVIDIA-Linux-x86_64-515.65.01/kernel-open/nvidia-drm/nvidia-drm-helper.h	2022-08-23 01:06:43.931032547 +0200
+@@ -27,6 +27,8 @@
+ 
+ #if defined(NV_DRM_AVAILABLE)
+ 
++#include <drm/drm_framebuffer.h>
++
+ #if defined(NV_DRM_DRMP_H_PRESENT)
+ #include <drm/drmP.h>
+ #endif
diff --git a/README.md b/README.md
index b1bc78a..2b4d548 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,2 @@
 # nvidia
-This repository will alway contain the latest nvidia long lived driver. The legacy 390 driver is in nvidia-390
-The latest nvidia short lived driver lives in nvidia-latest.
+This repository contains the latest NVIDIA production driver. The legacy driver is in `nvidia-legacy`
diff --git a/dkms-nvidia.conf b/dkms-nvidia.conf
new file mode 100644
index 0000000..8f2bd73
--- /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-525-aarch64-clang-15.patch b/nvidia-525-aarch64-clang-15.patch
new file mode 100644
index 0000000..a3cd920
--- /dev/null
+++ b/nvidia-525-aarch64-clang-15.patch
@@ -0,0 +1,42 @@
+diff -up NVIDIA-Linux-aarch64-525.60.11/kernel/nvidia-uvm/uvm_migrate_pageable.c.omv~ NVIDIA-Linux-aarch64-525.60.11/kernel/nvidia-uvm/uvm_migrate_pageable.c
+--- NVIDIA-Linux-aarch64-525.60.11/kernel/nvidia-uvm/uvm_migrate_pageable.c.omv~	2022-11-28 19:03:54.727569245 +0000
++++ NVIDIA-Linux-aarch64-525.60.11/kernel/nvidia-uvm/uvm_migrate_pageable.c	2022-11-28 19:04:02.277587757 +0000
+@@ -1001,7 +1001,7 @@ NV_STATUS uvm_migrate_pageable(uvm_migra
+     return status;
+ }
+ 
+-NV_STATUS uvm_migrate_pageable_init()
++NV_STATUS uvm_migrate_pageable_init(void)
+ {
+     g_uvm_migrate_vma_state_cache = NV_KMEM_CACHE_CREATE("migrate_vma_state_t", migrate_vma_state_t);
+     if (!g_uvm_migrate_vma_state_cache)
+@@ -1010,7 +1010,7 @@ NV_STATUS uvm_migrate_pageable_init()
+     return NV_OK;
+ }
+ 
+-void uvm_migrate_pageable_exit()
++void uvm_migrate_pageable_exit(void)
+ {
+     kmem_cache_destroy_safe(&g_uvm_migrate_vma_state_cache);
+ }
+diff -up NVIDIA-Linux-aarch64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate_pageable.c.omv~ NVIDIA-Linux-aarch64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate_pageable.c
+--- NVIDIA-Linux-aarch64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate_pageable.c.omv~	2022-11-28 19:19:13.989964938 +0000
++++ NVIDIA-Linux-aarch64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate_pageable.c	2022-11-28 19:19:24.409995696 +0000
+@@ -1001,7 +1001,7 @@ NV_STATUS uvm_migrate_pageable(uvm_migra
+     return status;
+ }
+ 
+-NV_STATUS uvm_migrate_pageable_init()
++NV_STATUS uvm_migrate_pageable_init(void)
+ {
+     g_uvm_migrate_vma_state_cache = NV_KMEM_CACHE_CREATE("migrate_vma_state_t", migrate_vma_state_t);
+     if (!g_uvm_migrate_vma_state_cache)
+@@ -1010,7 +1010,7 @@ NV_STATUS uvm_migrate_pageable_init()
+     return NV_OK;
+ }
+ 
+-void uvm_migrate_pageable_exit()
++void uvm_migrate_pageable_exit(void)
+ {
+     kmem_cache_destroy_safe(&g_uvm_migrate_vma_state_cache);
+ }
diff --git a/nvidia-525-clang-15.patch b/nvidia-525-clang-15.patch
new file mode 100644
index 0000000..202d72f
--- /dev/null
+++ b/nvidia-525-clang-15.patch
@@ -0,0 +1,472 @@
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/nvlink_linux.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/nvlink_linux.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/nvlink_linux.c.omv~	2022-11-28 17:20:21.265426916 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/nvlink_linux.c	2022-11-28 17:20:25.029458794 +0100
+@@ -560,7 +560,7 @@ void nvlink_assert(int cond)
+     }
+ }
+ 
+-void * nvlink_allocLock()
++void * nvlink_allocLock(void)
+ {
+     struct semaphore *sema;
+ 
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/os-interface.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/os-interface.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/os-interface.c.omv~	2022-11-28 17:19:54.204196042 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia/os-interface.c	2022-11-28 17:20:05.747294893 +0100
+@@ -1166,14 +1166,14 @@ void NV_API_CALL os_dbg_breakpoint(void)
+ #endif // CONFIG_X86_REMOTE_DEBUG || CONFIG_KGDB || CONFIG_XMON
+ }
+ 
+-NvU32 NV_API_CALL os_get_cpu_number()
++NvU32 NV_API_CALL os_get_cpu_number(void)
+ {
+     NvU32 cpu_id = get_cpu();
+     put_cpu();
+     return cpu_id;
+ }
+ 
+-NvU32 NV_API_CALL os_get_cpu_count()
++NvU32 NV_API_CALL os_get_cpu_count(void)
+ {
+     return NV_NUM_CPUS();
+ }
+@@ -1269,7 +1269,7 @@ void NV_API_CALL os_get_screen_info(
+ #endif
+ }
+ 
+-void NV_API_CALL os_dump_stack()
++void NV_API_CALL os_dump_stack(void)
+ {
+     dump_stack();
+ }
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_common.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_common.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_common.c.omv~	2022-11-28 17:20:50.108669767 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_common.c	2022-11-28 17:20:54.188703862 +0100
+@@ -34,7 +34,7 @@ static int uvm_debug_prints = UVM_IS_DEB
+ module_param(uvm_debug_prints, int, S_IRUGO|S_IWUSR);
+ MODULE_PARM_DESC(uvm_debug_prints, "Enable uvm debug prints.");
+ 
+-bool uvm_debug_prints_enabled()
++bool uvm_debug_prints_enabled(void)
+ {
+     return uvm_debug_prints != 0;
+ }
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_gpu_access_counters.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_gpu_access_counters.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_gpu_access_counters.c.omv~	2022-11-28 17:22:36.246537657 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_gpu_access_counters.c	2022-11-28 17:22:43.815598138 +0100
+@@ -1718,7 +1718,7 @@ bool uvm_va_space_has_access_counter_mig
+     return atomic_read(&va_space_access_counters->params.enable_mimc_migrations);
+ }
+ 
+-NV_STATUS uvm_perf_access_counters_init()
++NV_STATUS uvm_perf_access_counters_init(void)
+ {
+     uvm_perf_module_init("perf_access_counters",
+                          UVM_PERF_MODULE_TYPE_ACCESS_COUNTERS,
+@@ -1729,7 +1729,7 @@ NV_STATUS uvm_perf_access_counters_init(
+     return NV_OK;
+ }
+ 
+-void uvm_perf_access_counters_exit()
++void uvm_perf_access_counters_exit(void)
+ {
+ }
+ 
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_lock.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_lock.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_lock.c.omv~	2022-11-28 17:22:10.079327196 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_lock.c	2022-11-28 17:22:13.484354705 +0100
+@@ -334,7 +334,7 @@ bool __uvm_check_all_unlocked(uvm_thread
+     return false;
+ }
+ 
+-bool __uvm_thread_check_all_unlocked()
++bool __uvm_thread_check_all_unlocked(void)
+ {
+     return __uvm_check_all_unlocked(uvm_thread_context_lock_get());
+ }
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_migrate.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_migrate.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_migrate.c.omv~	2022-11-28 17:24:41.451517363 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_migrate.c	2022-11-28 17:24:46.953559483 +0100
+@@ -795,7 +795,7 @@ static NV_STATUS semaphore_release(NvU64
+     return semaphore_release_from_gpu(gpu, semaphore_pool, semaphore_address, semaphore_payload, tracker_ptr);
+ }
+ 
+-NV_STATUS uvm_migrate_init()
++NV_STATUS uvm_migrate_init(void)
+ {
+     NV_STATUS status = uvm_migrate_pageable_init();
+     if (status != NV_OK)
+@@ -821,7 +821,7 @@ NV_STATUS uvm_migrate_init()
+     return NV_OK;
+ }
+ 
+-void uvm_migrate_exit()
++void uvm_migrate_exit(void)
+ {
+     uvm_migrate_pageable_exit();
+ }
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_heuristics.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_heuristics.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_heuristics.c.omv~	2022-11-28 17:25:00.286661247 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_heuristics.c	2022-11-28 17:25:05.379700009 +0100
+@@ -28,7 +28,7 @@
+ #include "uvm_gpu_access_counters.h"
+ #include "uvm_va_space.h"
+ 
+-NV_STATUS uvm_perf_heuristics_init()
++NV_STATUS uvm_perf_heuristics_init(void)
+ {
+     NV_STATUS status;
+ 
+@@ -47,7 +47,7 @@ NV_STATUS uvm_perf_heuristics_init()
+     return NV_OK;
+ }
+ 
+-void uvm_perf_heuristics_exit()
++void uvm_perf_heuristics_exit(void)
+ {
+     uvm_perf_access_counters_exit();
+     uvm_perf_thrashing_exit();
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_prefetch.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_prefetch.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_prefetch.c.omv~	2022-11-28 17:25:59.560108800 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_prefetch.c	2022-11-28 17:26:03.478138119 +0100
+@@ -425,7 +425,7 @@ void uvm_perf_prefetch_get_hint(uvm_va_b
+     }
+ }
+ 
+-NV_STATUS uvm_perf_prefetch_init()
++NV_STATUS uvm_perf_prefetch_init(void)
+ {
+     g_uvm_perf_prefetch_enable = uvm_perf_prefetch_enable != 0;
+ 
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_thrashing.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_thrashing.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_thrashing.c.omv~	2022-11-28 17:25:39.134955439 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_perf_thrashing.c	2022-11-28 17:25:46.717012471 +0100
+@@ -1943,7 +1943,7 @@ NV_STATUS uvm_perf_thrashing_register_gp
+     return NV_OK;
+ }
+ 
+-NV_STATUS uvm_perf_thrashing_init()
++NV_STATUS uvm_perf_thrashing_init(void)
+ {
+     NV_STATUS status;
+ 
+@@ -2002,7 +2002,7 @@ error:
+     return status;
+ }
+ 
+-void uvm_perf_thrashing_exit()
++void uvm_perf_thrashing_exit(void)
+ {
+     cpu_thrashing_stats_exit();
+ 
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_procfs.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_procfs.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_procfs.c.omv~	2022-11-28 17:21:41.149091927 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_procfs.c	2022-11-28 17:21:52.734186475 +0100
+@@ -46,7 +46,7 @@ static struct proc_dir_entry *uvm_proc_d
+ static struct proc_dir_entry *uvm_proc_gpus;
+ static struct proc_dir_entry *uvm_proc_cpu;
+ 
+-NV_STATUS uvm_procfs_init()
++NV_STATUS uvm_procfs_init(void)
+ {
+     if (!uvm_procfs_is_enabled())
+         return NV_OK;
+@@ -66,17 +66,17 @@ NV_STATUS uvm_procfs_init()
+     return NV_OK;
+ }
+ 
+-void uvm_procfs_exit()
++void uvm_procfs_exit(void)
+ {
+     proc_remove(uvm_proc_dir);
+ }
+ 
+-struct proc_dir_entry *uvm_procfs_get_gpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void)
+ {
+     return uvm_proc_gpus;
+ }
+ 
+-struct proc_dir_entry *uvm_procfs_get_cpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_cpu_base_dir(void)
+ {
+     return uvm_proc_cpu;
+ }
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_push.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_push.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_push.c.omv~	2022-11-28 17:23:02.477746524 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_push.c	2022-11-28 17:23:07.534786557 +0100
+@@ -289,12 +289,12 @@ NV_STATUS __uvm_push_begin_acquire_on_re
+     return status;
+ }
+ 
+-bool uvm_push_info_is_tracking_descriptions()
++bool uvm_push_info_is_tracking_descriptions(void)
+ {
+     return uvm_debug_enable_push_desc != 0;
+ }
+ 
+-bool uvm_push_info_is_tracking_acquires()
++bool uvm_push_info_is_tracking_acquires(void)
+ {
+     return uvm_debug_enable_push_acquire_info != 0;
+ }
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_thread_context.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_thread_context.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_thread_context.c.omv~	2022-11-28 17:23:49.074112665 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_thread_context.c	2022-11-28 17:23:52.108136301 +0100
+@@ -101,7 +101,7 @@ static DEFINE_PER_CPU(uvm_thread_context
+ static void thread_context_non_interrupt_remove(uvm_thread_context_t *thread_context,
+                                                 uvm_thread_context_table_entry_t *thread_context_entry);
+ 
+-bool uvm_thread_context_wrapper_is_used()
++bool uvm_thread_context_wrapper_is_used(void)
+ {
+     // The wrapper contains lock information. While uvm_record_lock_X
+     // routines are a no-op outside of debug mode, unit tests do invoke their
+diff -up NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_tools.c.omv~ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_tools.c
+--- NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_tools.c.omv~	2022-11-28 17:21:17.157894660 +0100
++++ NVIDIA-Linux-x86_64-515.65.01/kernel/nvidia-uvm/uvm_tools.c	2022-11-28 17:21:20.773924523 +0100
+@@ -2204,7 +2204,7 @@ NV_STATUS uvm_api_tools_get_processor_uu
+     return NV_OK;
+ }
+ 
+-void uvm_tools_flush_events()
++void uvm_tools_flush_events(void)
+ {
+     tools_schedule_completed_events();
+ 
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/nvlink_linux.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/nvlink_linux.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/nvlink_linux.c.omv~	2022-11-28 17:35:32.399156775 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/nvlink_linux.c	2022-11-28 17:35:35.396177079 +0100
+@@ -560,7 +560,7 @@ void nvlink_assert(int cond)
+     }
+ }
+ 
+-void * nvlink_allocLock()
++void * nvlink_allocLock(void)
+ {
+     struct semaphore *sema;
+ 
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/os-interface.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/os-interface.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/os-interface.c.omv~	2022-11-28 17:34:47.525852016 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia/os-interface.c	2022-11-28 17:35:00.136937807 +0100
+@@ -1170,14 +1170,14 @@ void NV_API_CALL os_dbg_breakpoint(void)
+ #endif // CONFIG_X86_REMOTE_DEBUG || CONFIG_KGDB || CONFIG_XMON
+ }
+ 
+-NvU32 NV_API_CALL os_get_cpu_number()
++NvU32 NV_API_CALL os_get_cpu_number(void)
+ {
+     NvU32 cpu_id = get_cpu();
+     put_cpu();
+     return cpu_id;
+ }
+ 
+-NvU32 NV_API_CALL os_get_cpu_count()
++NvU32 NV_API_CALL os_get_cpu_count(void)
+ {
+     return NV_NUM_CPUS();
+ }
+@@ -1273,7 +1273,7 @@ void NV_API_CALL os_get_screen_info(
+ #endif
+ }
+ 
+-void NV_API_CALL os_dump_stack()
++void NV_API_CALL os_dump_stack(void)
+ {
+     dump_stack();
+ }
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_common.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_common.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_common.c.omv~	2022-11-28 17:36:51.308689482 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_common.c	2022-11-28 17:36:54.776712807 +0100
+@@ -34,7 +34,7 @@ static int uvm_debug_prints = UVM_IS_DEB
+ module_param(uvm_debug_prints, int, S_IRUGO|S_IWUSR);
+ MODULE_PARM_DESC(uvm_debug_prints, "Enable uvm debug prints.");
+ 
+-bool uvm_debug_prints_enabled()
++bool uvm_debug_prints_enabled(void)
+ {
+     return uvm_debug_prints != 0;
+ }
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_gpu_access_counters.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_gpu_access_counters.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_gpu_access_counters.c.omv~	2022-11-28 17:38:14.419246659 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_gpu_access_counters.c	2022-11-28 17:38:20.871289764 +0100
+@@ -1718,7 +1718,7 @@ bool uvm_va_space_has_access_counter_mig
+     return atomic_read(&va_space_access_counters->params.enable_mimc_migrations);
+ }
+ 
+-NV_STATUS uvm_perf_access_counters_init()
++NV_STATUS uvm_perf_access_counters_init(void)
+ {
+     uvm_perf_module_init("perf_access_counters",
+                          UVM_PERF_MODULE_TYPE_ACCESS_COUNTERS,
+@@ -1729,7 +1729,7 @@ NV_STATUS uvm_perf_access_counters_init(
+     return NV_OK;
+ }
+ 
+-void uvm_perf_access_counters_exit()
++void uvm_perf_access_counters_exit(void)
+ {
+ }
+ 
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_lock.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_lock.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_lock.c.omv~	2022-11-28 17:37:45.752054885 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_lock.c	2022-11-28 17:37:48.877075812 +0100
+@@ -334,7 +334,7 @@ bool __uvm_check_all_unlocked(uvm_thread
+     return false;
+ }
+ 
+-bool __uvm_thread_check_all_unlocked()
++bool __uvm_thread_check_all_unlocked(void)
+ {
+     return __uvm_check_all_unlocked(uvm_thread_context_lock_get());
+ }
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate.c.omv~	2022-11-28 17:41:34.170572883 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_migrate.c	2022-11-28 17:41:40.564615085 +0100
+@@ -795,7 +795,7 @@ static NV_STATUS semaphore_release(NvU64
+     return semaphore_release_from_gpu(gpu, semaphore_pool, semaphore_address, semaphore_payload, tracker_ptr);
+ }
+ 
+-NV_STATUS uvm_migrate_init()
++NV_STATUS uvm_migrate_init(void)
+ {
+     NV_STATUS status = uvm_migrate_pageable_init();
+     if (status != NV_OK)
+@@ -821,7 +821,7 @@ NV_STATUS uvm_migrate_init()
+     return NV_OK;
+ }
+ 
+-void uvm_migrate_exit()
++void uvm_migrate_exit(void)
+ {
+     uvm_migrate_pageable_exit();
+ }
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_heuristics.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_heuristics.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_heuristics.c.omv~	2022-11-28 17:42:28.171928898 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_heuristics.c	2022-11-28 17:42:33.209962065 +0100
+@@ -28,7 +28,7 @@
+ #include "uvm_gpu_access_counters.h"
+ #include "uvm_va_space.h"
+ 
+-NV_STATUS uvm_perf_heuristics_init()
++NV_STATUS uvm_perf_heuristics_init(void)
+ {
+     NV_STATUS status;
+ 
+@@ -47,7 +47,7 @@ NV_STATUS uvm_perf_heuristics_init()
+     return NV_OK;
+ }
+ 
+-void uvm_perf_heuristics_exit()
++void uvm_perf_heuristics_exit(void)
+ {
+     uvm_perf_access_counters_exit();
+     uvm_perf_thrashing_exit();
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_prefetch.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_prefetch.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_prefetch.c.omv~	2022-11-28 17:43:57.525516115 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_prefetch.c	2022-11-28 17:44:01.683543389 +0100
+@@ -425,7 +425,7 @@ void uvm_perf_prefetch_get_hint(uvm_va_b
+     }
+ }
+ 
+-NV_STATUS uvm_perf_prefetch_init()
++NV_STATUS uvm_perf_prefetch_init(void)
+ {
+     g_uvm_perf_prefetch_enable = uvm_perf_prefetch_enable != 0;
+ 
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_thrashing.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_thrashing.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_thrashing.c.omv~	2022-11-28 17:42:46.382048751 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_perf_thrashing.c	2022-11-28 17:42:52.123086517 +0100
+@@ -1943,7 +1943,7 @@ NV_STATUS uvm_perf_thrashing_register_gp
+     return NV_OK;
+ }
+ 
+-NV_STATUS uvm_perf_thrashing_init()
++NV_STATUS uvm_perf_thrashing_init(void)
+ {
+     NV_STATUS status;
+ 
+@@ -2002,7 +2002,7 @@ error:
+     return status;
+ }
+ 
+-void uvm_perf_thrashing_exit()
++void uvm_perf_thrashing_exit(void)
+ {
+     cpu_thrashing_stats_exit();
+ 
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_procfs.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_procfs.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_procfs.c.omv~	2022-11-28 17:37:23.995909061 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_procfs.c	2022-11-28 17:37:33.742974424 +0100
+@@ -46,7 +46,7 @@ static struct proc_dir_entry *uvm_proc_d
+ static struct proc_dir_entry *uvm_proc_gpus;
+ static struct proc_dir_entry *uvm_proc_cpu;
+ 
+-NV_STATUS uvm_procfs_init()
++NV_STATUS uvm_procfs_init(void)
+ {
+     if (!uvm_procfs_is_enabled())
+         return NV_OK;
+@@ -66,17 +66,17 @@ NV_STATUS uvm_procfs_init()
+     return NV_OK;
+ }
+ 
+-void uvm_procfs_exit()
++void uvm_procfs_exit(void)
+ {
+     proc_remove(uvm_proc_dir);
+ }
+ 
+-struct proc_dir_entry *uvm_procfs_get_gpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_gpu_base_dir(void)
+ {
+     return uvm_proc_gpus;
+ }
+ 
+-struct proc_dir_entry *uvm_procfs_get_cpu_base_dir()
++struct proc_dir_entry *uvm_procfs_get_cpu_base_dir(void)
+ {
+     return uvm_proc_cpu;
+ }
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_push.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_push.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_push.c.omv~	2022-11-28 17:38:41.760429187 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_push.c	2022-11-28 17:38:46.465460562 +0100
+@@ -289,12 +289,12 @@ NV_STATUS __uvm_push_begin_acquire_on_re
+     return status;
+ }
+ 
+-bool uvm_push_info_is_tracking_descriptions()
++bool uvm_push_info_is_tracking_descriptions(void)
+ {
+     return uvm_debug_enable_push_desc != 0;
+ }
+ 
+-bool uvm_push_info_is_tracking_acquires()
++bool uvm_push_info_is_tracking_acquires(void)
+ {
+     return uvm_debug_enable_push_acquire_info != 0;
+ }
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_thread_context.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_thread_context.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_thread_context.c.omv~	2022-11-28 17:39:10.343619643 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_thread_context.c	2022-11-28 17:39:15.963657048 +0100
+@@ -101,7 +101,7 @@ static DEFINE_PER_CPU(uvm_thread_context
+ static void thread_context_non_interrupt_remove(uvm_thread_context_t *thread_context,
+                                                 uvm_thread_context_table_entry_t *thread_context_entry);
+ 
+-bool uvm_thread_context_wrapper_is_used()
++bool uvm_thread_context_wrapper_is_used(void)
+ {
+     // The wrapper contains lock information. While uvm_record_lock_X
+     // routines are a no-op outside of debug mode, unit tests do invoke their
+diff -up NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_tools.c.omv~ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_tools.c
+--- NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_tools.c.omv~	2022-11-28 17:37:06.274790091 +0100
++++ NVIDIA-Linux-x86_64-525.60.11/kernel-open/nvidia-uvm/uvm_tools.c	2022-11-28 17:37:09.545812064 +0100
+@@ -2204,7 +2204,7 @@ NV_STATUS uvm_api_tools_get_processor_uu
+     return NV_OK;
+ }
+ 
+-void uvm_tools_flush_events()
++void uvm_tools_flush_events(void)
+ {
+     tools_schedule_completed_events();
+ 
diff --git a/nvidia-fix-linux-5.10.patch b/nvidia-fix-linux-5.10.patch
deleted file mode 100644
index ec7fa72..0000000
--- a/nvidia-fix-linux-5.10.patch
+++ /dev/null
@@ -1,51 +0,0 @@
-diff --git a/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h b/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h
-index fb6597a..e2519b5 100644
---- a/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h
-+++ b/NVIDIA-Linux-x86_64-450.80.02/kernel/common/inc/nv-linux.h
-@@ -11,6 +11,7 @@
- #ifndef _NV_LINUX_H_
- #define _NV_LINUX_H_
- 
-+#include <linux/version.h>
- #include "nvstatus.h"
- #include "nv-misc.h"
- #include "nv.h"
-@@ -166,6 +167,11 @@ static inline uid_t __kuid_val(uid_t uid)
- 
- #include <linux/pagemap.h>
- #include <linux/dma-mapping.h>
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
-+// dma-mapping.h has been split on commit 0a0f0d8be76dcd4390ff538e7060fda34db79717,,
-+// so this needs to be incldued now for the build to work
-+#include <linux/dma-map-ops.h>
-+#endif
- 
- #if defined(CONFIG_SWIOTLB) && defined(NVCPU_AARCH64)
- #include <linux/swiotlb.h>
-diff --git a/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c b/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
-index 737d84c..082fc11 100644
---- a/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
-+++ b/NVIDIA-Linux-x86_64-450.80.02/kernel/nvidia-drm/nvidia-drm-gem-user-memory.c
-@@ -20,6 +20,7 @@
-  * DEALINGS IN THE SOFTWARE.
-  */
- 
-+#include <linux/version.h>
- #include "nvidia-drm-conftest.h"
- 
- #if defined(NV_DRM_AVAILABLE)
-@@ -60,8 +61,14 @@ static struct sg_table *__nv_drm_gem_user_memory_prime_get_sg_table(
- {
-     struct nv_drm_gem_user_memory *nv_user_memory = to_nv_user_memory(nv_gem);
- 
-+#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0))
-+    // New parameter to drm_prime_pages_to_sg (commit 707d561f77b5e2a6f90c9786bee44ee7a8dedc7e)
-+    return drm_prime_pages_to_sg(nv_gem->nv_dev->dev, nv_user_memory->pages,
-+                                 nv_user_memory->pages_count);
-+#else
-     return drm_prime_pages_to_sg(nv_user_memory->pages,
-                                  nv_user_memory->pages_count);
-+#endif
- }
- 
- static void *__nv_drm_gem_user_memory_prime_vmap(
diff --git a/nvidia.spec b/nvidia.spec
index f00c242..c29a2d5 100644
--- a/nvidia.spec
+++ b/nvidia.spec
@@ -1,23 +1,45 @@
-%define debug_package %{nil}
-%bcond_with kernel_rc
+%global debug_package %{nil}
+%global _dracut_conf_d  %{_prefix}/lib/dracut/dracut.conf.d
+%global _modprobe_d     %{_prefix}/lib/modprobe.d/
+%global kernel_source_dir %{_builddir}/linux-%{kversion}
+%global nvidia_driver_dir %{_builddir}/NVIDIA-Linux-%{_arch}-%{version}
+%global open_dkms_name nvidia-open
+%global open_kmod_source NVIDIA-kernel-module-source
+%global dkms_name nvidia
+
+%global kmod_o_dir		%{_libdir}/nvidia/%{_arch}/%{version}/
+
+%ifarch %{x86_64}
+%global kernels desktop server desktop-gcc server-gcc rc-desktop rc-server rc-desktop-gcc rc-server-gcc
+%else
+%global kernels desktop server rc-desktop rc-server
+%endif
 
 Summary:	Binary-only driver for nvidia graphics chips
 Name:		nvidia
-Version:	470.103.01
+Version:	525.78.01
 Release:	1
 ExclusiveArch:	%{x86_64} %{aarch64}
 Url:		http://www.nvidia.com/object/unix.html
 Source0:	http://download.nvidia.com/XFree86/Linux-x86_64/%{version}/NVIDIA-Linux-x86_64-%{version}.run
-Source1:	http://download.nvidia.com/XFree86/Linux-aarch64/NVIDIA-Linux-aarch64-%{version}.run
+Source1:	http://download.nvidia.com/XFree86/Linux-aarch64/%{version}/NVIDIA-Linux-aarch64-%{version}.run
 Source10:	https://gitweb.frugalware.org/frugalware-current/raw/master/source/x11-extra/nvidia/xorg-nvidia.conf
 Source11:	https://gitweb.frugalware.org/frugalware-current/raw/master/source/x11-extra/nvidia/modprobe-nvidia.conf
-Patch0:         nvidia-fix-linux-5.10.patch	
+Patch0:         NaziVidia-kernel-6.0.patch
+Patch1:		nvidia-525-clang-15.patch
+%ifarch %{aarch64}
+Patch2:		nvidia-525-aarch64-clang-15.patch
+%endif
 Group:		Hardware
 License:	distributable
 # Just to be on the safe side, it may not be wise
 # to load clang-built modules into a gcc-built kernel
 BuildRequires:	gcc
-Requires:	%{name}-kernel-modules = %{EVRD}
+Requires:	%{name}-kmod = %{EVRD}
+# Not really, the %{name}-kmod = %{EVRD} requirement is enough.
+# But we need to make sure dnf prefers the option most people
+# will want over something like dkms
+Requires:	%{name}-kmod-desktop = %{version}
 Requires:	libglvnd-egl
 Requires:	egl-wayland
 Requires:	vulkan-loader
@@ -41,6 +63,14 @@ This package should only be used as a last resort.
 %package 32bit
 Summary:	Binary-only 32-bit driver for nvidia graphics chips
 
+Requires:	%{name} = %{version}
+
+Provides:   libGLdispatch0
+Provides:   libGL1
+Provides:   libEGL1
+Provides:   libGLESv2_2
+Provides:   libOpenGL0
+
 %description 32bit
 This is a 32-bit binary-only driver for nvidia graphics chips.
 
@@ -57,165 +87,295 @@ installation.
 This package should only be used as a last resort.
 %endif
 
-%package kernel-modules-desktop
-%define kversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-release-desktop-devel |tail -n1)
-%define kdir %(rpm -q --qf '%%{VERSION}-desktop-%%{RELEASE}%%{DISTTAG}\\n' kernel-release-desktop-devel |tail -n1)
-Summary:	Kernel modules needed by the binary-only nvidia driver
-Provides:	%{name}-kernel-modules = %{EVRD}
-Requires:	kernel-release-desktop = %{kversion}
-#Conflicts:	kernel-release-desktop < %%{kversion}
-Conflicts:	kernel-release-desktop > %{kversion}
-#Conflicts:	%%{name}-kernel-modules < %%{kversion}
+%{expand:%(for i in %{kernels}; do
+	K=$(echo $i |sed -e 's,-,_,g')
+	echo "%%global kversion_$K $(rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' kernel-${i}-devel |sort -V |tail -n1)"
+	echo "%%global kdir_$K $(rpm -q --qf %%{VERSION}-$i-%%{RELEASE}%%{DISTTAG} kernel-${i}-devel |sort -V |tail -n1 |sed -e 's,-rc,,')"
+done)}
+%(
+for i in %{kernels}; do
+	K=$(echo $i |sed -e 's,-,_,g')
+	cat <<EOF
+%package kmod-$i
+Summary:	Kernel modules needed by the binary-only nvidia driver for kernel $i %%{kversion_$K}
+Release:	%{release}_$(rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' kernel-${i}-devel |tail -n1 |sed -e 's,-,_,g;s, ,_,g')
+Provides:	%{name}-kmod = %{EVRD}
+Requires:	%{name}-kmod-common = %{EVRD}
+Requires:	kernel-$i = $(rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' kernel-${i}-devel |tail -n1 |sed -e 's, ,_,g;s,^package.*,1.0,')
+Conflicts:	kernel-$i > $(rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' kernel-${i}-devel |tail -n1 |sed -e 's, ,_,g;s,^package.*,1.0,')
 Group:		Hardware
 Provides:	should-restart = system
 Requires(post,postun):	sed dracut grub2 kmod
-BuildRequires:	kernel-release-desktop-devel
+BuildRequires:	kernel-$i-devel
 
-%description kernel-modules-desktop
-Kernel modules needed by the binary-only nvidia driver
+%description kmod-$i
+Kernel modules needed by the binary-only nvidia driver for kernel $i %%{kversion_$K}
 
-%package kernel-modules-desktop-clang
-%define ckversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-release-desktop-clang-devel |tail -n1)
-%define ckdir %(rpm -q --qf '%%{VERSION}-desktop-clang-%%{RELEASE}%%{DISTTAG}\\n' kernel-release-desktop-clang-devel |tail -n1)
-Summary:	Kernel modules needed by the binary-only nvidia driver
-Provides:	%{name}-kernel-modules = %{EVRD}
-Requires:	kernel-release-desktop-clang = %{kversion}
-#Conflicts:	kernel-release-desktop < %%{kversion}
-Conflicts:	kernel-release-desktop-clang > %{kversion}
-#Conflicts:	%%{name}-kernel-modules < %%{kversion}
+%files kmod-$i
+/lib/modules/%%{kdir_$K}/kernel/drivers/video/nvidia
+
+%package kmod-open-$i
+Summary:	Open kernel modules needed by the binary-only nvidia driver for kernel $i %%{kversion_$K}
+Release:	%{release}_$(rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' kernel-${i}-devel |tail -n1 |sed -e 's,-,_,g;s, ,_,g')
+Provides:	%{name}-kmod = %{EVRD}
+Requires:	%{name}-kmod-common = %{EVRD}
+Requires:	kernel-$i = $(rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' kernel-${i}-devel |tail -n1 |sed -e 's, ,_,g;s,^package.*,1.0,')
+Conflicts:	kernel-$i > $(rpm -q --qf '%%{VERSION}-%%{RELEASE}\n' kernel-${i}-devel |tail -n1 |sed -e 's, ,_,g;s,^package.*,1.0,')
 Group:		Hardware
 Provides:	should-restart = system
 Requires(post,postun):	sed dracut grub2 kmod
-BuildRequires:	kernel-release-desktop-clang-devel
+BuildRequires:	kernel-$i-devel
 
-%description kernel-modules-desktop-clang
-Kernel modules needed by the binary-only nvidia driver
+%description kmod-open-$i
+Open kernel modules needed by the binary-only nvidia driver for kernel $i %%{kversion_$K}
 
-%package kernel-modules-server
-%define skversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-release-server-devel |tail -n1)
-%define skdir %(rpm -q --qf '%%{VERSION}-desktop-%%{RELEASE}%%{DISTTAG}\\n' kernel-release-server-devel |tail -n1)
+%files kmod-open-$i
+/lib/modules/%%{kdir_$K}/kernel/drivers/video/nvidia-open
+EOF
+done
+)
+
+%package kmod
+%define kversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-desktop-devel |sort -V |tail -n1)
+%define kdir %(rpm -q --qf '%%{VERSION}-desktop-%%{RELEASE}%%{DISTTAG}\\n' kernel-desktop-devel |sort -V |tail -n1)
 Summary:	Kernel modules needed by the binary-only nvidia driver
-Provides:	%{name}-kernel-modules = %{EVRD}
-Requires:	kernel-release-server = %{skversion}
-Conflicts:	kernel-release-server < %{skversion}
-#Conflicts:	kernel-release-server > %%{skversion}
-Conflicts:	%{name}-kernel-modules < %{skversion}
+Provides:	%{name}-kmod = %{EVRD}
+Requires: %{name}-kmod-common = %{version}
+Requires:	kernel = %{kversion}
+#Conflicts:	kernel-desktop < %%{kversion}
+Conflicts:	kernel > %{kversion}
+#Conflicts:	%%{name}-kmod < %%{kversion}
 Group:		Hardware
 Provides:	should-restart = system
 Requires(post,postun):	sed dracut grub2 kmod
-BuildRequires:	kernel-release-server-devel
-
-%description kernel-modules-server
+BuildRequires:	kernel-desktop-devel
+
+Obsoletes:	nvidia-current <= %{version}
+Obsoletes:	nvidia-kernel-modules-desktop <= %{version}
+Obsoletes:	nvidia-kernel-modules-server <= %{version}
+Obsoletes:	nvidia-kernel-modules-desktop-clang <= %{version}
+Obsoletes:	nvidia-kernel-modules-server-clang <= %{version}
+Obsoletes:	nvidia-kernel-modules-desktop-rc <= %{version}
+Obsoletes:	nvidia-kernel-modules-server-rc <= %{version}
+Obsoletes:	nvidia-kernel-modules-desktop-gcc <= %{version}
+Obsoletes:	nvidia-kernel-modules-server-gcc <= %{version}
+
+%description kmod
 Kernel modules needed by the binary-only nvidia driver
 
-%package kernel-modules-server-clang
-%define cskversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-release-server-clang-devel |tail -n1)
-%define cskdir %(rpm -q --qf '%%{VERSION}-desktop-clang-%%{RELEASE}%%{DISTTAG}\\n' kernel-release-server-clang-devel |tail -n1)
-Summary:	Kernel modules needed by the binary-only nvidia driver
-Provides:	%{name}-kernel-modules = %{EVRD}
-Requires:	kernel-release-server-clang = %{kversion}
-#Conflicts:	kernel-release-desktop < %%{kversion}
-Conflicts:	kernel-release-server-clang > %{kversion}
-#Conflicts:	%%{name}-kernel-modules < %%{kversion}
-Group:		Hardware
-Provides:	should-restart = system
-Requires(post,postun):	sed dracut grub2 kmod
-BuildRequires:	kernel-release-server-clang-devel
+# =======================================================================================#
+# dkms-nvidia - modified from https://github.com/NVIDIA/yum-packaging-dkms-nvidia
+# =======================================================================================#
 
-%description kernel-modules-server-clang
-Kernel modules needed by the binary-only nvidia driver
+%package dkms-kmod
+License:        NVIDIA License
+Summary:        NVIDIA display driver kernel module. **This is an unsupported proprietary driver. Use with caution!
+URL:            http://www.nvidia.com/object/unix.html
 
-%if %{with kernel_rc}
-%package kernel-modules-rc-desktop
-%define rkversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-rc-desktop-devel |tail -n1)
-%define rkdir %(rpm -q --qf '%%{VERSION}-desktop-%%{RELEASE}%%{DISTTAG}\\n' kernel-rc-desktop-devel |tail -n1)
-Summary:	Kernel modules needed by the binary-only nvidia driver
-Provides:	%{name}-kernel-modules = %{EVRD}
-Requires:	kernel-rc-desktop = %{rkversion}
-Conflicts:	kernel-rc-desktop < %{rkversion}
-Conflicts:	kernel-rc-desktop > %{rkversion}
-Group:		Hardware
-Provides:	should-restart = system
-Requires(post,postun):	sed dracut grub2 kmod
-BuildRequires:	kernel-rc-desktop-devel
+# Package is not noarch as it contains pre-compiled binary code
+ExclusiveArch:  %{x86_64} ppc64le %{aarch64}
+Source12:   dkms-%{dkms_name}.conf
 
-%description kernel-modules-rc-desktop
-Kernel modules needed by the binary-only nvidia driver
+BuildRequires:  sed
 
-%package kernel-modules-rc-server
-%define rskversion %(rpm -q --qf '%%{VERSION}-%%{RELEASE}\\n' kernel-rc-server-devel |tail -n1)
-%define rskdir %(rpm -q --qf '%%{VERSION}-server-%%{RELEASE}%%{DISTTAG}\\n' kernel-rc-server-devel |tail -n1)
-Summary:	Kernel modules needed by the binary-only nvidia driver
-Provides:	%{name}-kernel-modules = %{EVRD}
-Requires:	kernel-rc-server = %{rskversion}
-Conflicts:	kernel-rc-server < %{rskversion}
-Conflicts:	kernel-rc-server > %{rskversion}
-Group:		Hardware
-Provides:	should-restart = system
-Requires(post,postun):	sed dracut grub2 kmod
-BuildRequires:	kernel-rc-server-devel
+Provides:       %{name}-kmod = %{version}
+Requires:       %{name}-kmod-common = %{version}
+Requires:       %{name}-kmod-headers = %{version}
+Requires:       dkms
 
-%description kernel-modules-rc-server
-Kernel modules needed by the binary-only nvidia driver
-%endif
+Obsoletes:	nvidia-kernel-modules-desktop <= %{version}
+Obsoletes:	nvidia-kernel-modules-server <= %{version}
+Obsoletes:	nvidia-kernel-modules-desktop-clang <= %{version}
+Obsoletes:	nvidia-kernel-modules-server-clang <= %{version}
+Obsoletes:	nvidia-kernel-modules-desktop-rc <= %{version}
+Obsoletes:	nvidia-kernel-modules-server-rc <= %{version}
+Obsoletes:	nvidia-kernel-modules-desktop-gcc <= %{version}
+Obsoletes:	nvidia-kernel-modules-server-gcc <= %{version}
 
-%prep
-%setup -T -c %{name}-%{version}
-%ifarch %{x86_64}
-sh %{S:0} --extract-only
-%else
-%ifarch %{aarch64}
-sh %{S:1} --extract-only
-%endif
-%endif
-#%%patch0 -p1
+%description dkms-kmod
+This package provides the proprietary Nvidia kernel driver modules.
+The modules are rebuilt through the DKMS system when a new kernel or modules
+become available.
 
-%build
-%ifarch %{x86_64}
-cd NVIDIA-Linux-x86_64-%{version}
-%else
-%ifarch %{aarch64}
-cd NVIDIA-Linux-aarch64-%{version}
-%endif
-%endif
+# =======================================================================================#
+# dkms-open-nvidia - modified from https://github.com/NVIDIA/yum-packaging-dkms-nvidia
+# =======================================================================================#
 
-cp -a kernel kernel-server
-cp -a kernel kernel-clang
-cp -a kernel kernel-server-clang
+%package kmod-%{open_dkms_name}-dkms
 
-%if %{with kernel_rc}
-cp -a kernel kernel-rc
-cp -a kernel kernel-rc-server
-%endif
+Summary:        NVIDIA driver open kernel module flavor
+License: 			NVIDIA and GPL-2
+BuildRequires:  sed
 
-cd kernel
-make SYSSRC=%{_prefix}/src/linux-%{kdir} CC=%{_bindir}/gcc
+Conflicts:      kmod-nvidia-latest-dkms
+Provides:       %{name}-kmod = %{version}
+Requires:       %{name}-kmod-common = %{version}
+Requires:       dkms
 
-cd ../kernel-clang
-make SYSSRC=%{_prefix}/src/linux-%{ckdir} CC=%{_bindir}/clang IGNORE_CC_MISMATCH=1
+%description kmod-%{open_dkms_name}-dkms
+This package provides the open-source Nvidia kernel driver modules.
+The modules are rebuilt through the DKMS system when a new kernel or modules
+become available.
 
-cd ../kernel-server
-make SYSSRC=%{_prefix}/src/linux-%{skdir} CC=%{_bindir}/gcc
+%package -n nvidia-kmod-source
+Summary:        NVIDIA open kernel module source files
+AutoReq:        0
+Conflicts:      kmod-nvidia-latest-dkms
 
-cd ../kernel-server-clang
-make SYSSRC=%{_prefix}/src/linux-%{cskdir} CC=%{_bindir}/clang IGNORE_CC_MISMATCH=1
+%description -n nvidia-kmod-source
+NVIDIA kernel module source files for compiling open flavor of nvidia.o and nvidia-modeset.o kernel modules.
 
-%if %{with kernel_rc}
-cd ../kernel-rc
-make SYSSRC=%{_prefix}/src/linux-%{rkdir} CC=%{_bindir}/gcc IGNORE_CC_MISMATCH=1
+%package kmod-headers
+Summary:        NVIDIA header files for precompiled streams
+AutoReq:        0
+Conflicts:      kmod-nvidia-latest-dkms
 
-cd ../kernel-rc-server
-make SYSSRC=%{_prefix}/src/linux-%{rskdir} CC=%{_bindir}/gcc IGNORE_CC_MISMATCH=1
-%endif
+%description kmod-headers
+NVIDIA header files for precompiled streams
 
-%install
+# =======================================================================================#
+# nvidia-kmod-common - modified from https://github.com/NVIDIA/yum-packaging-nvidia-kmod-common
+# =======================================================================================#
+
+%package kmod-common
+Summary:        Common file for NVIDIA's proprietary driver kernel modules
+License:        NVIDIA Licensefile:///home/nreist/Development/Source/Repos/nvidia-legacy/nvidia-legacy.spec
+URL:            http://www.nvidia.com/object/unix.html
+
+BuildArch:      noarch
+Source4:	60-nvidia.rules
+Source6:	99-nvidia.conf
+
+BuildRequires:  systemd-rpm-macros
+
+Requires:       %{name}-kmod = %{version}
+Provides:       %{name}-kmod-common = %{version}
+Requires:       %{name} = %{version}
+Obsoletes:      cuda-nvidia-kmod-common <= %{version}
+
+%description kmod-common
+This package provides the common files required by all NVIDIA kernel module
+package variants.
+
+%prep
+rm -rf NV* linux* modules* *.list
 %ifarch %{x86_64}
-cd NVIDIA-Linux-x86_64-%{version}
+sh %{S:0} --extract-only
 %else
 %ifarch %{aarch64}
-cd NVIDIA-Linux-aarch64-%{version}
+sh %{S:1} --extract-only
 %endif
 %endif
+cd NV*
+%autopatch -p1
+cd ..
+
+# nvidia-settings
+# Install desktop file
+sed -i 's:__PIXMAP_PATH__:%{_datadir}/pixmaps:g' %{nvidia_driver_dir}/nvidia-settings.desktop
+sed -i 's:__UTILS_PATH__:%{_bindir}:g' %{nvidia_driver_dir}/nvidia-settings.desktop
+mkdir -p %{buildroot}%{_datadir}/{applications,pixmaps}
+desktop-file-install --dir %{buildroot}%{_datadir}/applications/ %{nvidia_driver_dir}/nvidia-settings.desktop
+cp %{nvidia_driver_dir}/nvidia-settings.png %{buildroot}%{_datadir}/pixmaps/
+
+# dkms kmod - closed and open
+cp -f %{SOURCE12} %{nvidia_driver_dir}/kernel/dkms.conf
+cp -f %{SOURCE12} %{nvidia_driver_dir}/kernel-open/dkms.conf
+sed -i -e 's/__VERSION_STRING/%{version}/g' %{nvidia_driver_dir}/kernel/dkms.conf
+sed -i -e 's/__VERSION_STRING/%{version}/g' %{nvidia_driver_dir}/kernel-open/dkms.conf
+cp -r %{nvidia_driver_dir}/kernel-open %{_builddir}/%{open_kmod_source}
+
+%build
+#cd NVIDIA-Linux-%%{_arch}-%%{version}
+
+# The IGNORE_CC_MISMATCH flags below are needed because for some
+# reason, the kernel appends the LLD version to clang kernels while
+# nvidia does not.
+
+# kmod
+for i in %{kernels}; do
+	K=$(echo $i |sed -e 's,-,_,g')
+	KD=$(rpm -q --qf "%%{VERSION}-$i-%%{RELEASE}%%{DISTTAG}\n" kernel-${i}-devel |tail -n1)
+	if echo $i |grep -q rc; then
+		KD=$(echo $KD |sed -e 's,-rc,,')
+	fi
+	# The IGNORE_CC_MISMATCH flags below are needed because for some
+	# reason, the kernel appends the LLD version to clang kernels while
+	# nvidia does not.
+
+	# kmod
+	cd %{nvidia_driver_dir}/kernel
+
+	cp -r /usr/src/linux-$KD %{kernel_source_dir}-$i
+	# A proper kernel module build uses /lib/modules/KVER/{source,build} respectively,
+	# but that creates a dependency on the 'kernel' package since those directories are
+	# not provided by kernel-devel. Both /source and /build in the mentioned directory
+	# just link to the sources directory in /usr/src however, which ddiskit defines
+	# as kmod_kernel_source.
+	KERNEL_SOURCES=%{kernel_source_dir}-$i
+	KERNEL_OUTPUT=%{kernel_source_dir}-$i
+
+	# These could affect the linking so we unset them both there and in %%post
+	unset LD_RUN_PATH
+	unset LD_LIBRARY_PATH
+
+	#
+	# Compile kernel modules
+	#
+	if echo $i |grep -q gcc; then
+		%{make_build} SYSSRC=${KERNEL_SOURCES} SYSOUT=${KERNEL_OUTPUT} CC=gcc CXX=g++
+	else
+		%{make_build} SYSSRC=${KERNEL_SOURCES} SYSOUT=${KERNEL_OUTPUT} IGNORE_CC_MISMATCH=1
+	fi
+
+	mkdir ../../modules-$i
+	mv *.ko ../../modules-$i
+
+	cd ../kernel-open
+	cp -r /usr/src/linux-$KD %{kernel_source_dir}-$i
+	# A proper kernel module build uses /lib/modules/KVER/{source,build} respectively,
+	# but that creates a dependency on the 'kernel' package since those directories are
+	# not provided by kernel-devel. Both /source and /build in the mentioned directory
+	# just link to the sources directory in /usr/src however, which ddiskit defines
+	# as kmod_kernel_source.
+	KERNEL_SOURCES=%{kernel_source_dir}-$i
+	KERNEL_OUTPUT=%{kernel_source_dir}-$i
+
+	# These could affect the linking so we unset them both there and in %%post
+	unset LD_RUN_PATH
+	unset LD_LIBRARY_PATH
+
+	#
+	# Compile kernel modules
+	#
+	if echo $i |grep -q gcc; then
+		%{make_build} SYSSRC=${KERNEL_SOURCES} SYSOUT=${KERNEL_OUTPUT} CC=gcc CXX=g++
+	else
+		%{make_build} SYSSRC=${KERNEL_SOURCES} SYSOUT=${KERNEL_OUTPUT} IGNORE_CC_MISMATCH=1
+	fi
+
+	mkdir ../../modules-open-$i
+	mv *.ko ../../modules-open-$i
+done
+
+%install
+# dkms kmod open
+# Create empty tree
+mkdir -p %{buildroot}%{_usrsrc}/%{open_dkms_name}-%{version}/src
+rm -rf \
+	%{nvidia_driver_dir}/kernel-open/conftest \
+	%{nvidia_driver_dir}/kernel-open/conftest*.c \
+	%{nvidia_driver_dir}/kernel-open/modules.order \
+	%{nvidia_driver_dir}/kernel-open/nv_compiler.h \
+	%{nvidia_driver_dir}/kernel-open/Module.symvers
+cp -fr %{nvidia_driver_dir}/kernel-open/* %{buildroot}%{_usrsrc}/%{open_dkms_name}-%{version}/
+
+# Add symlink
+cd %{buildroot}%{_usrsrc}/%{open_dkms_name}-%{version}/src/ &&
+ln -sf ../../%{open_dkms_name}-%{version}/ kernel-open &&
+cd - >/dev/null
+cd %{nvidia_driver_dir}
+# end dkms kmod open
 
 inst() {
 	install -m 644 -D $(basename $1) %{buildroot}"$1"
@@ -293,7 +453,10 @@ inst %{_sysconfdir}/OpenCL/vendors/nvidia.icd
 instx %{_libdir}/libnvidia-cfg.so.%{version}
 sl nvidia-cfg 1
 
+%ifarch %{x86_64}
 instx %{_libdir}/libnvidia-compiler.so.%{version}
+%endif
+
 instx %{_libdir}/libnvidia-opencl.so.%{version}
 
 # Encode (what is this?)
@@ -306,11 +469,15 @@ sl nvidia-fbc 1
 
 # Yuck...
 instx %{_libdir}/libnvidia-gtk2.so.%{version}
+
+%ifarch %{x86_64}
 instx %{_libdir}/libnvidia-gtk3.so.%{version}
+%endif
 
 # IFR
-instx %{_libdir}/libnvidia-ifr.so.%{version}
-sl nvidia-ifr 1
+# not found in 515
+#instx %%{_libdir}/libnvidia-ifr.so.%%{version}
+#sl nvidia-ifr 1
 
 # VDPAU
 instx %{_libdir}/vdpau/libvdpau_nvidia.so.%{version}
@@ -327,6 +494,8 @@ instx %{_bindir}/nvidia-smi
 inst %{_mandir}/man1/nvidia-smi.1
 instx %{_bindir}/nvidia-settings       
 inst %{_mandir}/man1/nvidia-settings.1
+inst %{_datadir}/applications/nvidia-settings.desktop
+inst %{_datadir}/pixmaps/nvidia-settings.png
 
 # glvk
 instx %{_libdir}/libnvidia-glvkspirv.so.%{version}
@@ -337,34 +506,90 @@ inst %{_datadir}/nvidia/nvidia-application-profiles-%{version}-key-documentation
 
 # Configs
 install -D -m 644 %{S:10} %{buildroot}%{_sysconfdir}/X11/xorg.conf.d/15-nvidia.conf
-install -D -m 644 %{S:11} %{buildroot}%{_sysconfdir}/modprobe.d/nvidia.conf
+
+# license and doc files
+mkdir -p %{buildroot}%{_docdir}/%{name}
+mkdir -p %{buildroot}%{_datadir}/licenses/%{name}
+cp %{nvidia_driver_dir}/LICENSE %{buildroot}%{_datadir}/licenses/%{name}
+cp %{nvidia_driver_dir}/NVIDIA_Changelog %{buildroot}%{_docdir}/%{name}
+cp %{nvidia_driver_dir}/README.txt %{buildroot}%{_docdir}/%{name}
+cp -r %{nvidia_driver_dir}/html %{buildroot}%{_docdir}/%{name}
 
 # Kernel modules
-cd kernel
-inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia.ko
-inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia-drm.ko
-inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia-modeset.ko
-inst /lib/modules/%{kdir}/kernel/drivers/video/nvidia-uvm.ko
-
-cd ../kernel-clang
-inst /lib/modules/%{ckdir}/kernel/drivers/video/nvidia.ko
-inst /lib/modules/%{ckdir}/kernel/drivers/video/nvidia-drm.ko
-inst /lib/modules/%{ckdir}/kernel/drivers/video/nvidia-modeset.ko
-inst /lib/modules/%{ckdir}/kernel/drivers/video/nvidia-uvm.ko
-
-cd ../kernel-server
-inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia.ko
-inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia-drm.ko
-inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia-modeset.ko
-inst /lib/modules/%{skdir}/kernel/drivers/video/nvidia-uvm.ko
-
-cd ../kernel-server-clang
-inst /lib/modules/%{cskdir}/kernel/drivers/video/nvidia.ko
-inst /lib/modules/%{cskdir}/kernel/drivers/video/nvidia-drm.ko
-inst /lib/modules/%{cskdir}/kernel/drivers/video/nvidia-modeset.ko
-inst /lib/modules/%{cskdir}/kernel/drivers/video/nvidia-uvm.ko
+for i in %{kernels}; do
+	KD=$(rpm -q --qf "%%{VERSION}-$i-%%{RELEASE}%%{DISTTAG}\n" kernel-${i}-devel |tail -n1)
+	if echo $i |grep -q rc; then
+		KD=$(echo $KD |sed -e 's,rc-,,g')
+	fi
+	mkdir -p %{buildroot}/lib/modules/$KD/kernel/drivers/video/nvidia %{buildroot}/lib/modules/$KD/kernel/drivers/video/nvidia-open
+	mv ../modules-$i/*.ko %{buildroot}/lib/modules/$KD/kernel/drivers/video/nvidia/
+	mv ../modules-open-$i/*.ko %{buildroot}/lib/modules/$KD/kernel/drivers/video/nvidia-open/
+done
+
+# dkms-kmod
+# Create empty tree
+mkdir -p %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/
+cp -fr %{nvidia_driver_dir}/kernel/* %{buildroot}%{_usrsrc}/%{dkms_name}-%{version}/
+
+mkdir -p %{buildroot}%{_udevrulesdir}
+mkdir -p %{buildroot}%{_modprobe_d}/
+mkdir -p %{buildroot}%{_dracut_conf_d}/
+mkdir -p %{buildroot}%{_unitdir}
+mkdir -p %{buildroot}%{_presetdir}
+
+# Blacklist nouveau and load nvidia-uvm:
+install -p -m 0644 %{SOURCE11} %{buildroot}%{_modprobe_d}/
+
+# Avoid Nvidia modules getting in the initrd:
+install -p -m 0644 %{SOURCE6} %{buildroot}%{_dracut_conf_d}/
+
+# UDev rules:
+# https://github.com/NVIDIA/nvidia-modprobe/blob/master/modprobe-utils/nvidia-modprobe-utils.h#L33-L46
+# https://github.com/negativo17/nvidia-driver/issues/27
+install -p -m 644 %{SOURCE4} %{buildroot}%{_udevrulesdir}
+
+%post kmod-common
+sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
+/sbin/depmod -a
+/usr/bin/dracut -f
+%{_sbindir}/update-grub2
+
+%postun kmod-common
+sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
+/sbin/depmod -a
+/usr/bin/dracut -f
+%{_sbindir}/update-grub2
+
+%files kmod-common
+%{_dracut_conf_d}/99-nvidia.conf
+%{_modprobe_d}/modprobe-nvidia.conf
+%{_udevrulesdir}/60-nvidia.rules
+
+%post dkms-kmod
+dkms add -m %{dkms_name}-v %{version} || :
+# Rebuild and make available for the currently running kernel
+dkms build -m %{dkms_name} -v %{version} || :
+dkms install -m %{dkms_name} -v %{version} --force || :
+
+%preun dkms-kmod
+# Remove all versions from DKMS registry
+dkms remove -m %{dkms_name} -v %{version} --all || :
+
+%post kmod-%{open_dkms_name}-dkms
+dkms add -m %{open_dkms_name} -v %{version} -q || :
+# Rebuild and make available for the currently running kernel
+dkms build -m %{open_dkms_name} -v %{version} -q || :
+dkms install -m %{open_dkms_name} -v %{version} -q --force || :
+
+%preun kmod-%{open_dkms_name}-dkms
+# Remove all versions from DKMS registry
+dkms remove -m %{open_dkms_name} -v %{version} -q --all || :
 
 %files
+%{_datadir}/licenses/%{name}/LICENSE
+%{_docdir}/%{name}/NVIDIA_Changelog
+%{_docdir}/%{name}/README.txt
+%{_docdir}/%{name}/html
 %{_libdir}/xorg/modules/drivers/nvidia_drv.so
 %{_datadir}/vulkan/icd.d/nvidia_icd.json
 %{_libdir}/libnvidia-glcore.so*
@@ -384,24 +609,30 @@ inst /lib/modules/%{cskdir}/kernel/drivers/video/nvidia-uvm.ko
 %{_libdir}/libnvidia-tls.so*
 %{_sysconfdir}/OpenCL/vendors/nvidia.icd
 %{_libdir}/libnvidia-cfg.so*
+%ifarch %{x86_64}
 %{_libdir}/libnvidia-compiler.so*
+%endif
 %{_libdir}/libnvidia-opencl.so*
 %{_libdir}/libnvidia-encode.so*
 %{_libdir}/libnvidia-fbc.so*
 %{_libdir}/libnvidia-gtk2.so*
+%ifarch %{x86_64}
 %{_libdir}/libnvidia-gtk3.so*
-%{_libdir}/libnvidia-ifr.so*
+%endif
+# not found in 515
+#%%{_libdir}/libnvidia-ifr.so*
 %{_libdir}/vdpau/libvdpau_nvidia.so*
 %{_bindir}/nvidia-bug-report.sh
 %{_bindir}/nvidia-smi
 %{_mandir}/man1/nvidia-smi.1*
 %{_bindir}/nvidia-settings
 %{_mandir}/man1/nvidia-settings.1*
+%{_datadir}/applications/nvidia-settings.desktop
+%{_datadir}/pixmaps/nvidia-settings.png
 %{_libdir}/libnvidia-glvkspirv.so*
 %{_datadir}/nvidia/nvidia-application-profiles-%{version}-rc
 %{_datadir}/nvidia/nvidia-application-profiles-%{version}-key-documentation
 %{_sysconfdir}/X11/xorg.conf.d/15-nvidia.conf
-%{_sysconfdir}/modprobe.d/nvidia.conf
 
 %ifarch %{x86_64}
 %files 32bit
@@ -422,99 +653,26 @@ inst /lib/modules/%{cskdir}/kernel/drivers/video/nvidia-uvm.ko
 %{_prefix}/lib/libnvidia-opencl.so*
 %{_prefix}/lib/libnvidia-encode.so*
 %{_prefix}/lib/libnvidia-fbc.so*
-%{_prefix}/lib/libnvidia-ifr.so*
+# not found in 515
+#%%{_prefix}/lib/libnvidia-ifr.so*
 %{_prefix}/lib/vdpau/libvdpau_nvidia.so*
 %{_prefix}/lib/libnvidia-glvkspirv.so*
 %endif
 
-%files kernel-modules-desktop
-/lib/modules/%{kdir}/kernel/drivers/video/*
-
-%post kernel-modules-desktop
-sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{kdir}
-/usr/bin/dracut -f --kver %{kdir}
-%{_sbindir}/update-grub2
-
-%postun kernel-modules-desktop
-sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{kdir}
-/usr/bin/dracut -f --kver %{kdir}
-%{_sbindir}/update-grub2
-
-%files kernel-modules-desktop-clang
-/lib/modules/%{ckdir}/kernel/drivers/video/*
-
-%post kernel-modules-desktop-clang
-sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{ckdir}
-/usr/bin/dracut -f --kver %{ckdir}
-%{_sbindir}/update-grub2
-
-%postun kernel-modules-desktop-clang
-sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{ckdir}
-/usr/bin/dracut -f --kver %{ckdir}
-%{_sbindir}/update-grub2
-
-%files kernel-modules-server
-/lib/modules/%{skdir}/kernel/drivers/video/*
-
-%post kernel-modules-server
-sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{skdir}
-/usr/bin/dracut -f --kver %{skdir}
-%{_sbindir}/update-grub2
-
-%postun kernel-modules-server
-sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{skdir}
-/usr/bin/dracut -f --kver %{skdir}
-%{_sbindir}/update-grub2
-
-%files kernel-modules-server-clang
-/lib/modules/%{cskdir}/kernel/drivers/video/*
-
-%post kernel-modules-server-clang
-sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{cskdir}
-/usr/bin/dracut -f --kver %{cskdir}
-%{_sbindir}/update-grub2
+%files dkms-kmod
+%{_usrsrc}/%{dkms_name}-%{version}
 
-%postun kernel-modules-server-clang
-sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{cskdir}
-/usr/bin/dracut -f --kver %{cskdir}
-%{_sbindir}/update-grub2
+%files kmod-%{open_dkms_name}-dkms
+%{_usrsrc}/%{open_dkms_name}-%{version}/common
+%{_usrsrc}/%{open_dkms_name}-%{version}/nvidia*
+%{_usrsrc}/%{open_dkms_name}-%{version}/Kbuild
+%{_usrsrc}/%{open_dkms_name}-%{version}/Makefile
+%{_usrsrc}/%{open_dkms_name}-%{version}/conftest.sh
+%{_usrsrc}/%{open_dkms_name}-%{version}/dkms.conf
+%{_usrsrc}/%{open_dkms_name}-%{version}/*.mk
 
-%if %{with kernel_rc}
-%files kernel-modules-rc-desktop
-/lib/modules/%{rkdir}/kernel/drivers/video/*
+%files -n nvidia-kmod-source
+%{_usrsrc}/%{open_dkms_name}-%{version}/src
 
-%post kernel-modules-rc-desktop
-sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{rkdir}
-/usr/bin/dracut -f --kver %{rkdir}
-%{_sbindir}/update-grub2
-
-%postun kernel-modules-rc-desktop
-sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{rkdir}
-/usr/bin/dracut -f --kver %{rkdir}
-%{_sbindir}/update-grub2
-
-%files kernel-modules-rc-server
-/lib/modules/%{rskdir}/kernel/drivers/video/*
-
-%post kernel-modules-rc-server
-sed -i 's/GRUB_CMDLINE_LINUX_DEFAULT="/GRUB_CMDLINE_LINUX_DEFAULT="rd.driver.blacklist=nouveau /' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{rkdir}
-/usr/bin/dracut -f --kver %{rskdir}
-%{_sbindir}/update-grub2
-
-%postun kernel-modules-rc-server
-sed -i 's/rd.driver.blacklist=nouveau //g' %{_sysconfdir}/default/grub
-/sbin/depmod -a %{rskdir}
-/usr/bin/dracut -f --kver %{rskdir}
-%{_sbindir}/update-grub2
-%endif
+%files kmod-headers
+%{_usrsrc}/%{dkms_name}-%{version}
Not Available

benbullard79 [@T] cox.netNo Comment.467d 12hrs