304.135 driver patched to build on 4.x kernels (4.9 onwards)
304.135 driver now no longer needs the mttr patch ;-) but for kernel 4.9 onwards the 4.9 patch above is still needed.... patched 32-bit .run file is uploaded to: [url]https://sourceforge.net/projects/lxpup/files/Other/nvidia/NVIDIA-Linux-x86-304.135-patched-k4.9.run/download[/url] @[url=https://devtalk.nvidia.com/member/1882081/]aplattner[/url] please note....
304.135 driver now no longer needs the mttr patch ;-)

but for kernel 4.9 onwards the 4.9 patch above is still needed....

patched 32-bit .run file is uploaded to:
https://sourceforge.net/projects/lxpup/files/Other/nvidia/NVIDIA-Linux-x86-304.135-patched-k4.9.run/download

@aplattner please note....

#16
Posted 02/17/2017 05:16 PM   
A further patch is now needed for kernel 4.10..... Patch obtained from [url=https://github.com/voidlinux/void-packages/commit/cc69502c473a4ed55666c7b721eb7c6332c1271b]here[/url] 304.135 32-bit driver patched for kernel-4.10 available from: [url=https://sourceforge.net/projects/lxpup/files/Other/nvidia/NVIDIA-Linux-x86-304.135-patched-k4.10.run/download]NVIDIA-Linux-x86-304.135-patched-k4.10.run[/url]
A further patch is now needed for kernel 4.10.....

Patch obtained from here

304.135 32-bit driver patched for kernel-4.10 available from:

NVIDIA-Linux-x86-304.135-patched-k4.10.run

#17
Posted 03/25/2017 05:27 PM   
A further patch for kernel 4.11 ..... 304.135 32-bit driver patched for kernel-4.11 available from: [url=https://sourceforge.net/projects/lxpup/files/Other/nvidia/NVIDIA-Linux-x86-304.135-patched-k4.11.run/download]NVIDIA-Linux-x86-304.135-patched-k4.11.run[/url] Patch is: [code]--- a/kernel/nv-drm.c +++ b/kernel/nv-drm.c @@ -22,6 +22,8 @@ #include <drm/drm_gem.h> #endif +#include <linux/version.h> + extern nv_linux_state_t *nv_linux_devices; static int nv_drm_load( @@ -42,7 +44,11 @@ return -ENODEV; } +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) static int nv_drm_unload( +#else +static void nv_drm_unload( +#endif struct drm_device *dev ) { @@ -52,11 +58,19 @@ { if (nvl->dev == dev->pdev) { +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) return 0; +#else + return; +#endif } } +#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0) return -ENODEV; +#else + return; +#endif } static const struct file_operations nv_drm_fops = {[/code]
A further patch for kernel 4.11 .....

304.135 32-bit driver patched for kernel-4.11 available from:

NVIDIA-Linux-x86-304.135-patched-k4.11.run

Patch is:
--- a/kernel/nv-drm.c
+++ b/kernel/nv-drm.c
@@ -22,6 +22,8 @@
#include <drm/drm_gem.h>
#endif

+#include <linux/version.h>
+
extern nv_linux_state_t *nv_linux_devices;

static int nv_drm_load(
@@ -42,7 +44,11 @@
return -ENODEV;
}

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
static int nv_drm_unload(
+#else
+static void nv_drm_unload(
+#endif
struct drm_device *dev
)
{
@@ -52,11 +58,19 @@
{
if (nvl->dev == dev->pdev)
{
+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
return 0;
+#else
+ return;
+#endif
}
}

+#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 11, 0)
return -ENODEV;
+#else
+ return;
+#endif
}

static const struct file_operations nv_drm_fops = {

#18
Posted 05/20/2017 02:56 PM   
hello, is it possible you could prepare *.run file for x86_64 and kernel 4.11.3? I would test it and let everyone know. thank you, geos
hello, is it possible you could prepare *.run file for x86_64 and kernel 4.11.3? I would test it and let everyone know.

thank you,
geos

#19
Posted 06/15/2017 12:30 PM   
A further patch for kernel 4.12 ..... 304.135 32-bit driver patched for kernel-4.12 available from: [url=https://sourceforge.net/projects/lxpup/files/Other/nvidia/NVIDIA-Linux-x86-304.135-patched-k4.12.run/download]NVIDIA-Linux-x86-304.135-patched-k4.12.run[/url] Patch is: [code]--- a/nv-vtophys.c 2016-12-09 20:30:08.000000000 +0100 +++ b/nv-vtophys.c 2017-05-10 10:05:28.452722808 +0200 @@ -25,6 +25,7 @@ NvU64 nv_get_phys_address( #else struct mm_struct *mm; pgd_t *pgd = NULL; + p4d_t *p4d = NULL; pmd_t *pmd = NULL; pte_t *pte = NULL; NvU64 retval; @@ -41,7 +42,7 @@ NvU64 nv_get_phys_address( if (!NV_PGD_PRESENT(pgd)) goto failed; - pmd = NV_PMD_OFFSET(address, pgd); + pmd = NV_PMD_OFFSET(address, p4d); if (!NV_PMD_PRESENT(pmd)) goto failed; --- a/nv-linux.h 2017-05-10 09:19:05.820789291 +0200 +++ b/nv-linux.h 2017-05-10 10:05:57.656844602 +0200 @@ -1389,11 +1389,11 @@ typedef void irqreturn_t; #define NV_PMD_UNMAP(pmd) pmd_unmap(pmd); #else #if defined(PUD_SHIFT) /* 4-level pgtable */ -#define NV_PMD_OFFSET(address, pgd) \ +#define NV_PMD_OFFSET(address, p4d) \ ({ \ pmd_t *__pmd = NULL; \ pud_t *__pud; \ - __pud = pud_offset(pgd, address); \ + __pud = pud_offset(p4d, address); \ if ((__pud != NULL) && \ !(pud_bad(*__pud) || pud_none(*__pud))) \ __pmd = pmd_offset(__pud, address); \[/code]
A further patch for kernel 4.12 .....

304.135 32-bit driver patched for kernel-4.12 available from:

NVIDIA-Linux-x86-304.135-patched-k4.12.run

Patch is:
--- a/nv-vtophys.c	2016-12-09 20:30:08.000000000 +0100
+++ b/nv-vtophys.c 2017-05-10 10:05:28.452722808 +0200
@@ -25,6 +25,7 @@ NvU64 nv_get_phys_address(
#else
struct mm_struct *mm;
pgd_t *pgd = NULL;
+ p4d_t *p4d = NULL;
pmd_t *pmd = NULL;
pte_t *pte = NULL;
NvU64 retval;
@@ -41,7 +42,7 @@ NvU64 nv_get_phys_address(
if (!NV_PGD_PRESENT(pgd))
goto failed;

- pmd = NV_PMD_OFFSET(address, pgd);
+ pmd = NV_PMD_OFFSET(address, p4d);
if (!NV_PMD_PRESENT(pmd))
goto failed;

--- a/nv-linux.h 2017-05-10 09:19:05.820789291 +0200
+++ b/nv-linux.h 2017-05-10 10:05:57.656844602 +0200
@@ -1389,11 +1389,11 @@ typedef void irqreturn_t;
#define NV_PMD_UNMAP(pmd) pmd_unmap(pmd);
#else
#if defined(PUD_SHIFT) /* 4-level pgtable */
-#define NV_PMD_OFFSET(address, pgd) \
+#define NV_PMD_OFFSET(address, p4d) \
({ \
pmd_t *__pmd = NULL; \
pud_t *__pud; \
- __pud = pud_offset(pgd, address); \
+ __pud = pud_offset(p4d, address); \
if ((__pud != NULL) && \
!(pud_bad(*__pud) || pud_none(*__pud))) \
__pmd = pmd_offset(__pud, address); \

#20
Posted 07/11/2017 04:28 PM   
peebee, Do you have nvidia-304 patches for the 64 bit driver and kernel 4.12?
peebee,

Do you have nvidia-304 patches for the 64 bit driver and kernel 4.12?

#21
Posted 07/12/2017 01:43 PM   
The same as the 32-bit patch???
The same as the 32-bit patch???

#22
Posted 07/12/2017 03:57 PM   
[quote=""]The same as the 32-bit patch???[/quote] Do you have a patched x86_64 run file for 4.12?
said:The same as the 32-bit patch???


Do you have a patched x86_64 run file for 4.12?

#23
Posted 07/12/2017 05:30 PM   
Afraid not - it would mean applying all of the 4.9, 4.10, 4.11 and 4.12 patches and I don't have time to do that or the system to test the result.....sorry. The patch process is described at: [url]http://murga-linux.com/puppy/viewtopic.php?p=897078#897078[/url]
Afraid not - it would mean applying all of the 4.9, 4.10, 4.11 and 4.12 patches and I don't have time to do that or the system to test the result.....sorry.

The patch process is described at:
http://murga-linux.com/puppy/viewtopic.php?p=897078#897078

#24
Posted 07/12/2017 07:03 PM   
Hello, I tried the 304.135 32-bit driver patched for kernel-4.12. Building was ok, but trying to load the kernel module I got the error NVRM: CPU hotplug notifier registration failed! I think that the patch for kernel 4.10 mentioned by peabee at [url]https://devtalk.nvidia.com/default/topic/968448/linux/304-135-driver-patched-to-build-on-4-x-kernels-4-9-onwards-/post/5114034/#5114034[/url] must apply the following diff also [code] diff -ruN a/kernel/nv-pat.c b/kernel/nv-pat.c --- a/kernel/nv-pat.c 2017-07-23 15:20:52.754138803 +0200 +++ b/kernel/nv-pat.c 2017-07-22 20:24:55.000000000 +0200 @@ -290,7 +290,7 @@ if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "gpu/nvidia:online", nvidia_cpu_online, - nvidia_cpu_down_prep) != 0) + nvidia_cpu_down_prep) < 0) #endif { nv_disable_pat_support(); [/code] according to function documentation (for example at [url]http://elixir.free-electrons.com/linux/v4.10.17/source/kernel/cpu.c#L1469[/url]).
Hello, I tried the 304.135 32-bit driver patched for kernel-4.12.
Building was ok, but trying to load the kernel module I got the error

NVRM: CPU hotplug notifier registration failed!

I think that the patch for kernel 4.10 mentioned by peabee at https://devtalk.nvidia.com/default/topic/968448/linux/304-135-driver-patched-to-build-on-4-x-kernels-4-9-onwards-/post/5114034/#5114034 must apply the following diff also
diff -ruN a/kernel/nv-pat.c b/kernel/nv-pat.c
--- a/kernel/nv-pat.c 2017-07-23 15:20:52.754138803 +0200
+++ b/kernel/nv-pat.c 2017-07-22 20:24:55.000000000 +0200
@@ -290,7 +290,7 @@
if (cpuhp_setup_state(CPUHP_AP_ONLINE_DYN,
"gpu/nvidia:online",
nvidia_cpu_online,
- nvidia_cpu_down_prep) != 0)
+ nvidia_cpu_down_prep) < 0)
#endif
{
nv_disable_pat_support();

according to function documentation (for example at http://elixir.free-electrons.com/linux/v4.10.17/source/kernel/cpu.c#L1469).

#25
Posted 07/23/2017 01:40 PM   
Har anyone here a patch for 64-bits v304.135 and Kernels 4.12.x or 4.13.x ?? I just need the patch.
Har anyone here a patch for 64-bits v304.135 and Kernels 4.12.x or 4.13.x ?? I just need the patch.

#26
Posted 08/26/2017 09:43 PM   
A .run file for a 64-bit version of 304.135 can be found at: [url=https://sourceforge.net/projects/lxpup/files/Other/nvidia/NVIDIA-Linux-x86_64-304.135-no-compat32-patched-k4.13.run/download]NVIDIA-Linux-x86_64-304.135-no-compat32-patched-k4.13.run[/url] The .run has been used to build a driver for 64-bit kernel 4.13.1 successfully. A different approach to making the .run file has been used - nvidia-304xx-dkms-304.135-16-x86_64.pkg.tar.xz was obtained from Arch Linux: [url]https://www.archlinux.org/packages/testing/x86_64/nvidia-304xx-dkms/[/url] and the source files were copied into [url=http://download.nvidia.com/XFree86/Linux-x86_64/304.135/NVIDIA-Linux-x86_64-304.135-no-compat32.run]NVIDIA-Linux-x86_64-304.135-no-compat32.run[/url] and the .run rebuilt.
A .run file for a 64-bit version of 304.135 can be found at:
NVIDIA-Linux-x86_64-304.135-no-compat32-patched-k4.13.run

The .run has been used to build a driver for 64-bit kernel 4.13.1 successfully.

A different approach to making the .run file has been used - nvidia-304xx-dkms-304.135-16-x86_64.pkg.tar.xz was obtained from Arch Linux:
https://www.archlinux.org/packages/testing/x86_64/nvidia-304xx-dkms/ and the source files were copied into NVIDIA-Linux-x86_64-304.135-no-compat32.run and the .run rebuilt.

#27
Posted 09/12/2017 05:07 PM   
Scroll To Top

Add Reply