From 758284eda1eb3249d9a4dd0af8a7039e8ce3f1c7 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 6 Jan 2024 07:46:49 +0100 Subject: [PATCH] patched to fix 'Error: Driver nvidia is already registered, aborting...' [release 340.102-2mamba;Sat Aug 12 2017] --- nvidia-340.102-kernel-4.9.patch | 11 +++++++++++ nvidia_340-340.102-kernel-4.9-2.patch | 28 +++++++++++++++++++++++++++ nvidia_340.spec | 14 ++++++++++++-- 3 files changed, 51 insertions(+), 2 deletions(-) create mode 100644 nvidia-340.102-kernel-4.9.patch create mode 100644 nvidia_340-340.102-kernel-4.9-2.patch diff --git a/nvidia-340.102-kernel-4.9.patch b/nvidia-340.102-kernel-4.9.patch new file mode 100644 index 0000000..b2b1a5f --- /dev/null +++ b/nvidia-340.102-kernel-4.9.patch @@ -0,0 +1,11 @@ +--- NVIDIA-Linux-x86_64-340.102/kernel/nv.c.orig 2017-08-12 11:58:37.536676945 +0200 ++++ NVIDIA-Linux-x86_64-340.102/kernel/nv.c 2017-08-12 11:59:26.101854994 +0200 +@@ -1040,6 +1040,8 @@ + + pci_unregister_driver(&nv_pci_driver); + ++ nv_unregister_procfs(); ++ + failed5: + rm_shutdown_rm(sp); + diff --git a/nvidia_340-340.102-kernel-4.9-2.patch b/nvidia_340-340.102-kernel-4.9-2.patch new file mode 100644 index 0000000..78c00f3 --- /dev/null +++ b/nvidia_340-340.102-kernel-4.9-2.patch @@ -0,0 +1,28 @@ +From 19996a25efb250a1b8c7d06fdb85b5462e2a7797 Mon Sep 17 00:00:00 2001 +From: leigh123linux +Date: Sun, 30 Jul 2017 12:16:14 +0100 +Subject: [PATCH 1/4] 4.9.0_kernel + +--- + kernel/nv-drm.c | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/kernel/nv-drm.c b/kernel/nv-drm.c +index 4c1a3ae..ea9f17e 100644 +--- a/kernel/nv-drm.c ++++ b/kernel/nv-drm.c +@@ -115,7 +115,11 @@ static const struct file_operations nv_drm_fops = { + }; + + static struct drm_driver nv_drm_driver = { ++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4, 9, 0) ++ .driver_features = DRIVER_GEM | DRIVER_PRIME | DRIVER_LEGACY, ++#else + .driver_features = DRIVER_GEM | DRIVER_PRIME, ++#endif + .load = nv_drm_load, + .unload = nv_drm_unload, + .fops = &nv_drm_fops, +-- +2.13.3 + diff --git a/nvidia_340.spec b/nvidia_340.spec index a4a61ce..f9d1b84 100644 --- a/nvidia_340.spec +++ b/nvidia_340.spec @@ -1,7 +1,7 @@ %define nvidia_current_ver %version %define nvidia_current_libver %version Name: nvidia_340 -Version: 340.76 +Version: 340.102 Epoch: 1 Release: 2mamba Summary: NVIDIA proprietary accelerated drivers for the Linux Kernel @@ -13,6 +13,8 @@ URL: http://www.nvidia.com/object/unix.html Source0: http://us.download.nvidia.com/XFree86/Linux-x86/%{nvidia_current_ver}/NVIDIA-Linux-x86-%{nvidia_current_ver}.run Source1: http://us.download.nvidia.com/XFree86/Linux-x86_64/%{nvidia_current_ver}/NVIDIA-Linux-x86_64-%{nvidia_current_ver}.run Patch0: nvidia-331.20-x86-conftest.patch +Patch1: nvidia-340.102-kernel-4.9.patch +Patch2: nvidia_340-340.102-kernel-4.9-2.patch License: no OSI Approved ## AUTOBUILDREQ-BEGIN ## AUTOBUILDREQ-END @@ -120,6 +122,8 @@ sed -i "s|__UTILS_PATH__|%{_bindir}|;s|__PIXMAP_PATH__|%{_datadir}/pixmaps|" \ cd current %patch0 -p1 +%patch1 -p1 +%patch2 -p1 cd .. %build @@ -303,7 +307,7 @@ exit 0 %preun -n xorg-drv-video-%{name} # erase -dkms remove -q -m nvidia -v %{version} --all +dkms remove -q -m %{name} -v %{version} --all if [ $1 -eq 0 ]; then # update-alternatives \ # --remove libXvMCNVIDIA_dynamic.so %{_libdir}/libXvMCNVIDIA_current_so @@ -418,6 +422,12 @@ exit 0 %doc current/{LICENSE,NVIDIA_Changelog,README.txt} current/html %changelog +* Sat Aug 12 2017 Silvan Calarco 340.102-2mamba +- patched to fix 'Error: Driver nvidia is already registered, aborting...' + +* Sun Aug 06 2017 Silvan Calarco 340.102-1mamba +- update to 340.102 + * Thu May 28 2015 Silvan Calarco 340.76-2mamba - CLUTTER_BACKEND workaround to fix Gnome >= 3.16 apps