Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nvidia-drivers and kernel-4.0.0
View unanswered posts
View posts from last 24 hours

Goto page 1, 2, 3  Next  
Reply to topic    Gentoo Forums Forum Index Unsupported Software
View previous topic :: View next topic  
Author Message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Mon Apr 13, 2015 2:07 pm    Post subject: nvidia-drivers and kernel-4.0.0 Reply with quote

nvidia-drivers-340.76 (which I need because of an old 9600GT card)
does not install on new kernel-4.0.0

here's the errors in the build log:

Code:
/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.c:38:5: error: implicit declaration of function ‘read_cr4’ [-Werror=implicit-function-declaration]
     *cr4 = read_cr4();
     ^


/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.c:39:5: error: implicit declaration of function ‘write_cr4’ [-Werror=implicit-function-declaration]
     if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);


cc1: some warnings being treated as errors
/usr/src/linux-4.0.0-gentoo/scripts/Makefile.build:258: recipe for target '/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.o' failed
make[3]: *** [/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.o] Error 1


this is an unsupported kernel but I wonder if anyone has a patch ...
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
houtworm
Guru
Guru


Joined: 08 Mar 2003
Posts: 391
Location: Den Haag, Netherlands

PostPosted: Tue Apr 14, 2015 5:27 am    Post subject: Reply with quote

Same problem here, nvidia-drivers-340.76 because an older card.

There is a patch at https://devtalk.nvidia.com/default/topic/813458/linux-4-0-rc1-346-47-build-error-_cr4-functions-fix/ but it needs a little change because the file that should be patched could not be found.
So I changed it into:
Code:
--- a/kernel/nv-pat.c.orig
+++ b/kernel/nv-pat.c
@@ -35,8 +35,13 @@
     unsigned long cr0 = read_cr0();
     write_cr0(((cr0 & (0xdfffffff)) | 0x40000000));
     wbinvd();
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
     *cr4 = read_cr4();
     if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
+#else
+    *cr4 = __read_cr4();
+    if (*cr4 & 0x80) __write_cr4(*cr4 & ~0x80);
+#endif
     __flush_tlb();
 }

@@ -46,7 +51,11 @@
     wbinvd();
     __flush_tlb();
     write_cr0((cr0 & 0x9fffffff));
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 20, 0)
     if (cr4 & 0x80) write_cr4(cr4);
+#else
+    if (cr4 & 0x80) __write_cr4(cr4);
+#endif
 }

 static int nv_determine_pat_mode(void)


put it in /etc/portage/patches/x11-drivers/nvidia-drivers

So now I am running gentoo-4.0.0 :-)
_________________
niemand is onbekwamer, dan een timmerman zonder hamer

Kees
Back to top
View user's profile Send private message
prffzc
Tux's lil' helper
Tux's lil' helper


Joined: 22 Sep 2005
Posts: 105

PostPosted: Tue Apr 14, 2015 7:10 am    Post subject: Reply with quote

Thank you houtworm!

This worked for me too (older card also).
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Tue Apr 14, 2015 12:59 pm    Post subject: Reply with quote

Quote:
Thank you houtworm!

This worked for me too (older card also).


ditto here; great work
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
Pryka
l33t
l33t


Joined: 08 Jun 2007
Posts: 658
Location: /dev/null

PostPosted: Thu Apr 16, 2015 5:52 pm    Post subject: Reply with quote

It's not working for me... :(

I wonder why... i have 9600GT and nvidia-drivers-340.76

After putting patch into /etc/portage/patches/x11-drivers/nvidia-drivers/kernel-4.0.0-patch, I still get this:
Code:
/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.c: In function ‘nv_disable_caches’:
/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.c:38:5: error: implicit declaration of function ‘read_cr4’ [-Werror=implicit-function-declaration]
     *cr4 = read_cr4();
     ^
/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.c:39:5: error: implicit declaration of function ‘write_cr4’ [-Werror=implicit-function-declaration]
     if (*cr4 & 0x80) write_cr4(*cr4 & ~0x80);
     ^
In file included from /usr/src/linux-4.0.0/include/uapi/linux/stddef.h:1:0,
                 from /usr/src/linux-4.0.0/include/linux/stddef.h:4,
                 from /usr/src/linux-4.0.0/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-4.0.0/include/uapi/linux/types.h:13,
                 from /usr/src/linux-4.0.0/include/linux/types.h:5,
                 from /usr/src/linux-4.0.0/include/uapi/linux/capability.h:16,
                 from /usr/src/linux-4.0.0/include/linux/capability.h:15,
                 from /usr/src/linux-4.0.0/include/linux/sched.h:15,
                 from /usr/src/linux-4.0.0/include/linux/utsname.h:5,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-linux.h:44,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-procfs.c:15:
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h: In function ‘copy_from_user’:
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h:712:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.0/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h: In function ‘copy_to_user’:
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h:730:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.0/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
In file included from /usr/src/linux-4.0.0/include/uapi/linux/stddef.h:1:0,
                 from /usr/src/linux-4.0.0/include/linux/stddef.h:4,
                 from /usr/src/linux-4.0.0/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-4.0.0/include/uapi/linux/types.h:13,
                 from /usr/src/linux-4.0.0/include/linux/types.h:5,
                 from /usr/src/linux-4.0.0/include/uapi/linux/capability.h:16,
                 from /usr/src/linux-4.0.0/include/linux/capability.h:15,
                 from /usr/src/linux-4.0.0/include/linux/sched.h:15,
                 from /usr/src/linux-4.0.0/include/linux/utsname.h:5,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-linux.h:44,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-usermap.c:15:
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h: In function ‘copy_from_user’:
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h:712:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.0/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h: In function ‘copy_to_user’:
/usr/src/linux-4.0.0/arch/x86/include/asm/uaccess.h:730:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.0/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
cc1: some warnings being treated as errors
/usr/src/linux-4.0.0/scripts/Makefile.build:258: recipe for target '/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.o' failed
make[3]: *** [/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel/nv-pat.o] Error 1
make[3]: *** Waiting for unfinished jobs....
/usr/src/linux-4.0.0/Makefile:1390: recipe for target '_module_/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel' failed
make[2]: *** [_module_/var/tmp/portage/x11-drivers/nvidia-drivers-340.76/work/kernel] Error 2
make[2]: Leaving directory '/usr/src/linux-4.0.0'
Makefile:145: recipe for target 'sub-make' failed
make[1]: *** [sub-make] Error 2
make[1]: Leaving directory '/usr/src/linux-4.0.0'
NVIDIA: left KBUILD.
nvidia.ko failed to build!
Makefile:181: recipe for target 'nvidia.ko' failed
make: *** [nvidia.ko] Error 1
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Thu Apr 16, 2015 6:05 pm    Post subject: Reply with quote

are you sure the patch is being applied?

shots in the dark:

patch file needs to be of form xxxxx.patch ?

blank space at end of each line of patch (this has bit me) ?
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
Pryka
l33t
l33t


Joined: 08 Jun 2007
Posts: 658
Location: /dev/null

PostPosted: Thu Apr 16, 2015 6:22 pm    Post subject: Reply with quote

Wrong patch name, and after that blank space xD

Thx. :D
Back to top
View user's profile Send private message
gentoosapien
n00b
n00b


Joined: 15 May 2015
Posts: 2

PostPosted: Fri May 15, 2015 10:05 pm    Post subject: Reply with quote

:( what's wrong with me?!

Code:
Failed Patch: linux-4.0.patch !
 *  ( /etc/portage/patches//x11-drivers/nvidia-drivers-340.76/linux-4.0.patch )


Code:
 * Call stack:
 *     ebuild.sh, line   93:  Called pre_src_prepare
 *        bashrc, line    7:  Called epatch_user
 *   environment, line 1732:  Called epatch
 *   environment, line 1705:  Called die
 * The specific snippet of code:
 *               die "Failed Patch: ${patchname}!";


Quote:
albrigth:
blank space at end of each line of patch (this has bit me) ?

double check!

Can somebody help me?! btw, did someone tried with kernel-4.0.3?
Back to top
View user's profile Send private message
albright
Advocate
Advocate


Joined: 16 Nov 2003
Posts: 2588
Location: Near Toronto

PostPosted: Fri May 15, 2015 11:46 pm    Post subject: Reply with quote

Quote:
an somebody help me?! btw, did someone tried with kernel-4.0.3?


yes, it worked for me ...

But - strangely - it failed the first time, installed correctly the second time :?
_________________
.... there is nothing - absolutely nothing - half so much worth
doing as simply messing about with Linux ...
(apologies to Kenneth Graeme)
Back to top
View user's profile Send private message
gentoosapien
n00b
n00b


Joined: 15 May 2015
Posts: 2

PostPosted: Sat May 16, 2015 2:11 pm    Post subject: Reply with quote

I'v patched the file by hand - the patch from /etc/portage/patch... doesn't applied by user epatch
Quote:
"Failed Patch: ${patchname}!


The Patch works also with kernel 4.0.3 - Thanks a lot for this!
Back to top
View user's profile Send private message
gienah
Developer
Developer


Joined: 24 Nov 2010
Posts: 212
Location: AU

PostPosted: Wed May 20, 2015 1:23 pm    Post subject: Reply with quote

In case there are problems with copy/pasting the patch, I have tar'd up the patches that I use on my system running
kernel 4.0.4-hardened-r1 with x11-drivers/nvidia-drivers-340.76 here:

http://dev.gentoo.org/~gienah/unsupported/etc-portage-patches-x11-drivers-nvidia-drivers-340.76-for-kernel-gt-3.14.tar.gz

to extract, as root:
Code:
cd /
tar xvf etc-portage-patches-x11-drivers-nvidia-drivers-340.76-for-kernel-gt-3.14.tar.gz

If you are not running a hardened kernel then the pax patch can be removed:
Code:
rm /etc/portage/patches/x11-drivers/nvidia-drivers-340.76/nvidia-drivers-331.49-pax-uvm.patch
Back to top
View user's profile Send private message
zhushazang
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2005
Posts: 81

PostPosted: Tue May 26, 2015 11:42 pm    Post subject: Reply with quote

Also worked here:

sys-kernel/vanilla-sources-4.0.4
x11-drivers/nvidia-drivers-340.76

Just reporting
Back to top
View user's profile Send private message
Cueball
n00b
n00b


Joined: 19 Sep 2009
Posts: 22
Location: Barrow-in-Furness

PostPosted: Mon Jun 15, 2015 2:03 pm    Post subject: Reply with quote

Not working for me:
sys-kernel/vanilla-sources-4.0.4
x11-drivers/nvidia-drivers-304.125

Code:

In file included from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/stddef.h:1:0,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/stddef.h:4,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/types.h:13,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/types.h:5,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/capability.h:16,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/capability.h:15,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/sched.h:15,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/utsname.h:5,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv-linux.h:40,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:13:
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h: In function ‘copy_from_user’:
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h:712:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.5-gentoo/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h: In function ‘copy_to_user’:
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h:730:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.5-gentoo/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_unlocked_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2029:30: error: ‘struct file’ has no member named ‘f_dentry’
     return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
                              ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_compat_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2038:30: error: ‘struct file’ has no member named ‘f_dentry’
     return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
                              ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_unlocked_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2030:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_compat_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2039:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/usr/src/linux-4.0.5-gentoo/scripts/Makefile.build:258: recipe for target '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.o' failed
make[4]: *** [/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.o] Error 1
/usr/src/linux-4.0.5-gentoo/Makefile:1390: recipe for target '_module_/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel' failed
make[3]: *** [_module_/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel] Error 2
Makefile:145: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
Makefile:250: recipe for target 'module' failed
make[1]: *** [module] Error 1
makefile:59: recipe for target 'module' failed
make: *** [module] Error 2


I also have the above patch.

EDIT: Put in version wrong for my nvidia driver.
_________________
"It said on the side of the box "Requires Windows 95 or better", So I installed Linux"
unzip; strip; touch; finger; grep; mount; fsck; more; yes; fsck; umount; sleep
Back to top
View user's profile Send private message
Cueball
n00b
n00b


Joined: 19 Sep 2009
Posts: 22
Location: Barrow-in-Furness

PostPosted: Tue Jun 16, 2015 9:59 pm    Post subject: Reply with quote

I have also tried this on Kernel 4.0.5 now.
_________________
"It said on the side of the box "Requires Windows 95 or better", So I installed Linux"
unzip; strip; touch; finger; grep; mount; fsck; more; yes; fsck; umount; sleep
Back to top
View user's profile Send private message
papas
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2014
Posts: 141
Location: Athens

PostPosted: Wed Jun 17, 2015 8:48 pm    Post subject: Reply with quote

its not working for me too (kernel 4.0.5 , nvidia-304-125)
Back to top
View user's profile Send private message
gienah
Developer
Developer


Joined: 24 Nov 2010
Posts: 212
Location: AU

PostPosted: Thu Jun 18, 2015 7:08 am    Post subject: Reply with quote

Well of course x11-drivers/nvidia-drivers-304.125 is a different major version (304) to x11-drivers/nvidia-drivers-340.76 (340), so
you would not really expect it to work.

Please try saving this patch:

https://projects.archlinux.org/svntogit/packages.git/plain/trunk/nvidia-4.0.patch?h=packages/nvidia-304xx&id=44604b1a6fdecc23c24b95bef0e311a93c932d82

Which I found by looking on the Nvidia Linux forum, finding the answer:

https://devtalk.nvidia.com/default/topic/844963/linux/legacy-drivers-304-for-linux-kernel-4-/

To the file (creating the directory if it does not already exist)
Code:
/etc/portage/patches/x11-drivers/nvidia-drivers-304.125/nvidia-drivers-304.125-kernel-4.0.patch

And let us know if it works or not. My hardware is not supported by the 304 driver.
Back to top
View user's profile Send private message
mani001
Guru
Guru


Joined: 04 Dec 2004
Posts: 485
Location: Oleiros

PostPosted: Thu Jun 18, 2015 2:13 pm    Post subject: Reply with quote

I'm also on x11-drivers/nvidia-drivers-304.125 and bumped into the same problem. Unfortunately, the patch didn't work for me (I put it in the right directory in /etc/portage/patches and made sure it was applied checking the output from emerge...). I just hope nvidia doesn't leave us like this :?
Back to top
View user's profile Send private message
tomtom69
Apprentice
Apprentice


Joined: 09 Nov 2010
Posts: 245
Location: Bavaria

PostPosted: Thu Jun 18, 2015 5:03 pm    Post subject: Reply with quote

I had the same problem.
Besides the patch mentioned, I generated an additional patch to address the "f_dentry" error, which I put into the file
/etc/portage/patches/x11-drivers/nvidia-drivers-304.125/nvidia-drivers-304.125-kernel-4.0.5.patch
(see patch below)
With this patch in addition to the patch mentioned by gienah I can successfully compile and run a 4.0.5 kernel with nvidia-drivers-304.125
(Sorry if the patch is not directly downloadable or displayed inconveniently - this is the first time I do this in a forum so maybe it is not as convenient as can be) :-)

tom



Patch:

--- kernel/nv.c 2014-12-02 04:58:34.000000000 +0100
+++ kernel/nv.c 2015-06-18 18:51:15.300179450 +0200
@@ -2026,7 +2026,7 @@ long nv_kern_unlocked_ioctl(
unsigned long i_arg
)
{
- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
+ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
}

long nv_kern_compat_ioctl(
@@ -2035,7 +2035,7 @@ long nv_kern_compat_ioctl(
unsigned long i_arg
)
{
- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
+ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
}

/*
Back to top
View user's profile Send private message
papas
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2014
Posts: 141
Location: Athens

PostPosted: Thu Jun 18, 2015 5:58 pm    Post subject: Reply with quote

gienah wrote:
Well of course x11-drivers/nvidia-drivers-304.125 is a different major version (304) to x11-drivers/nvidia-drivers-340.76 (340), so
you would not really expect it to work.

Please try saving this patch:

https://projects.archlinux.org/svntogit/packages.git/plain/trunk/nvidia-4.0.patch?h=packages/nvidia-304xx&id=44604b1a6fdecc23c24b95bef0e311a93c932d82

Which I found by looking on the Nvidia Linux forum, finding the answer:

https://devtalk.nvidia.com/default/topic/844963/linux/legacy-drivers-304-for-linux-kernel-4-/

To the file (creating the directory if it does not already exist)
Code:
/etc/portage/patches/x11-drivers/nvidia-drivers-304.125/nvidia-drivers-304.125-kernel-4.0.patch

And let us know if it works or not. My hardware is not supported by the 304 driver.


Unfortunately didn't work:
Code:

 maria@andreas ~ $ sudo emerge --ask @module-rebuild                                       
Password:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-drivers/nvidia-drivers-304.125

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests
>>> Running pre-merge checks for x11-drivers/nvidia-drivers-304.125
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.0.5-gentoo/build
 * Found sources for kernel version:
 *     4.0.5-gentoo
 * Gentoo supports kernels which are supported by NVIDIA
 * which are limited to the following kernels:
 * <sys-kernel/gentoo-sources-3.18
 * <sys-kernel/vanilla-sources-3.18
 *
 * You are free to utilize epatch_user to provide whatever
 * support you feel is appropriate, but will not receive
 * support as a result of those changes.
 *
 * Do not file a bug report about this.
 * Checking for suitable kernel configuration options...                                                              [ ok ]

>>> Emerging (1 of 1) x11-drivers/nvidia-drivers-304.125::gentoo
 * NVIDIA-Linux-x86_64-304.125.run SHA256 SHA512 WHIRLPOOL size ;-) ...                                               [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.0.5-gentoo/build
 * Found sources for kernel version:
 *     4.0.5-gentoo
>>> Unpacking source...
>>> Unpacking NVIDIA-Linux-x86_64-304.125.run to /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work
>>> Source unpacked in /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work
>>> Preparing source in /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work ...
 * Applying user patches from /etc/portage/patches//x11-drivers/nvidia-drivers ...
 *   linux-4.patch ...                                                                                                [ ok ]
 * Done with patching
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work ...
>>> Source configured.
>>> Compiling source in /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work ...
 * Preparing nvidia module
make -j1 HOSTCC=x86_64-pc-linux-gnu-gcc CROSS_COMPILE=x86_64-pc-linux-gnu- 'LDFLAGS=-m elf_x86_64' ARCH=x86_64 IGNORE_CC_MISMATCH=yes V=1 SYSSRC=/usr/src/linux SYSOUT=/lib/modules/4.0.5-gentoo/build CC=x86_64-pc-linux-gnu-gcc clean module
NVIDIA: calling KBUILD...
make -C /lib/modules/4.0.5-gentoo/build KBUILD_SRC=/usr/src/linux-4.0.5-gentoo \
-f /usr/src/linux-4.0.5-gentoo/Makefile modules
test -e include/generated/autoconf.h -a -e include/config/auto.conf || (                \
echo >&2;                                                       \
echo >&2 "  ERROR: Kernel configuration is invalid.";           \
echo >&2 "         include/generated/autoconf.h or include/config/auto.conf are missing.";\
echo >&2 "         Run 'make oldconfig && make prepare' on kernel src to fix it.";      \
echo >&2 ;                                                      \
/bin/false)
mkdir -p /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/.tmp_versions ; rm -f /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/.tmp_versions/*
make -f /usr/src/linux-4.0.5-gentoo/scripts/Makefile.build obj=/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel
  x86_64-pc-linux-gnu-gcc -Wp,-MD,/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/.nv.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.4/include -I/usr/src/linux-4.0.5-gentoo/arch/x86/include -Iarch/x86/include/generated/uapi -Iarch/x86/include/generated  -I/usr/src/linux-4.0.5-gentoo/include -Iinclude -I/usr/src/linux-4.0.5-gentoo/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-4.0.5-gentoo/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-4.0.5-gentoo/include/linux/kconfig.h   -I/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -m64 -mno-80387 -mno-fp-ret-in-387 -march=core2 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_AS_CFI=1 -DCONFIG_AS_CFI_SIGNAL_FRAME=1 -DCONFIG_AS_CFI_SECTIONS=1 -DCONFIG_AS_FXSAVEQ=1 -DCONFIG_AS_SSSE3=1 -DCONFIG_AS_CRC32=1 -DCONFIG_AS_AVX=1 -DCONFIG_AS_AVX2=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fno-stack-protector -Wno-unused-but-set-variable -fno-omit-frame-pointer -fno-optimize-sibling-calls -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -DCC_HAVE_ASM_GOTO   -I/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel -Wall -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"304.125\" -Wno-unused-function -Wuninitialized -mno-red-zone -mcmodel=kernel -UDEBUG -U_DEBUG -DNDEBUG  -DMODULE  -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(nv)"  -D"KBUILD_MODNAME=KBUILD_STR(nvidia)" -c -o /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.o /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c
In file included from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/stddef.h:1:0,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/stddef.h:4,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/types.h:13,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/types.h:5,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/capability.h:16,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/capability.h:15,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/sched.h:15,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/utsname.h:5,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv-linux.h:40,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:13:
/usr/src/linux-4.0.5-gentoo/include/asm-generic/qrwlock.h: In function ‘queue_write_trylock’:
/usr/src/linux-4.0.5-gentoo/include/asm-generic/qrwlock.h:93:35: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
          cnts, cnts | _QW_LOCKED) == cnts);
                                   ^
/usr/src/linux-4.0.5-gentoo/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
In file included from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/stddef.h:1:0,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/stddef.h:4,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/posix_types.h:4,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/types.h:13,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/types.h:5,
                 from /usr/src/linux-4.0.5-gentoo/include/uapi/linux/capability.h:16,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/capability.h:15,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/sched.h:15,
                 from /usr/src/linux-4.0.5-gentoo/include/linux/utsname.h:5,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv-linux.h:40,
                 from /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:13:
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h: In function ‘copy_from_user’:
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h:712:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.5-gentoo/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h: In function ‘copy_to_user’:
/usr/src/linux-4.0.5-gentoo/arch/x86/include/asm/uaccess.h:730:26: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
  if (likely(sz < 0 || sz >= n))
                          ^
/usr/src/linux-4.0.5-gentoo/include/linux/compiler.h:163:40: note: in definition of macro ‘likely’
 # define likely(x) __builtin_expect(!!(x), 1)
                                        ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_unlocked_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2029:30: error: ‘struct file’ has no member named ‘f_dentry’
     return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
                              ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_compat_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2038:30: error: ‘struct file’ has no member named ‘f_dentry’
     return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
                              ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_unlocked_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2030:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c: In function ‘nv_kern_compat_ioctl’:
/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.c:2039:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
/usr/src/linux-4.0.5-gentoo/scripts/Makefile.build:258: recipe for target '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.o' failed
make[4]: *** [/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel/nv.o] Error 1
/usr/src/linux-4.0.5-gentoo/Makefile:1390: recipe for target '_module_/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel' failed
make[3]: *** [_module_/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel] Error 2
Makefile:145: recipe for target 'sub-make' failed
make[2]: *** [sub-make] Error 2
NVIDIA: left KBUILD.
nvidia.ko failed to build!
Makefile:250: recipe for target 'module' failed
make[1]: *** [module] Error 1
makefile:59: recipe for target 'module' failed
make: *** [module] Error 2
 * ERROR: x11-drivers/nvidia-drivers-304.125::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-304.125::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-304.125::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/kernel'
 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/'
 * !!! User patches were applied to this build!
Back to top
View user's profile Send private message
papas
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2014
Posts: 141
Location: Athens

PostPosted: Thu Jun 18, 2015 6:09 pm    Post subject: Reply with quote

tomtom69 wrote:
I had the same problem.
Besides the patch mentioned, I generated an additional patch to address the "f_dentry" error, which I put into the file
/etc/portage/patches/x11-drivers/nvidia-drivers-304.125/nvidia-drivers-304.125-kernel-4.0.5.patch
(see patch below)
With this patch in addition to the patch mentioned by gienah I can successfully compile and run a 4.0.5 kernel with nvidia-drivers-304.125
(Sorry if the patch is not directly downloadable or displayed inconveniently - this is the first time I do this in a forum so maybe it is not as convenient as can be) :-)

tom



Patch:

--- kernel/nv.c 2014-12-02 04:58:34.000000000 +0100
+++ kernel/nv.c 2015-06-18 18:51:15.300179450 +0200
@@ -2026,7 +2026,7 @@ long nv_kern_unlocked_ioctl(
unsigned long i_arg
)
{
- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
+ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
}

long nv_kern_compat_ioctl(
@@ -2035,7 +2035,7 @@ long nv_kern_compat_ioctl(
unsigned long i_arg
)
{
- return nv_kern_ioctl(file->f_dentry->d_inode, file, cmd, i_arg);
+ return nv_kern_ioctl(file->f_path.dentry->d_inode, file, cmd, i_arg);
}

/*

unfortunately didn't work but i think there is syntax error in that code. Can you please check it again?
Code:

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild   R    ] x11-drivers/nvidia-drivers-304.125

Would you like to merge these packages? [Yes/No] y

>>> Verifying ebuild manifests
>>> Running pre-merge checks for x11-drivers/nvidia-drivers-304.125
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.0.5-gentoo/build
 * Found sources for kernel version:
 *     4.0.5-gentoo
 * Gentoo supports kernels which are supported by NVIDIA
 * which are limited to the following kernels:
 * <sys-kernel/gentoo-sources-3.18
 * <sys-kernel/vanilla-sources-3.18
 *
 * You are free to utilize epatch_user to provide whatever
 * support you feel is appropriate, but will not receive
 * support as a result of those changes.
 *
 * Do not file a bug report about this.
 * Checking for suitable kernel configuration options...                                                              [ ok ]

>>> Emerging (1 of 1) x11-drivers/nvidia-drivers-304.125::gentoo
 * NVIDIA-Linux-x86_64-304.125.run SHA256 SHA512 WHIRLPOOL size ;-) ...                                               [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found kernel object directory:
 *     /lib/modules/4.0.5-gentoo/build
 * Found sources for kernel version:
 *     4.0.5-gentoo
>>> Unpacking source...
>>> Unpacking NVIDIA-Linux-x86_64-304.125.run to /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work
>>> Source unpacked in /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work
>>> Preparing source in /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work ...
 * Applying user patches from /etc/portage/patches//x11-drivers/nvidia-drivers ...
 *   linux-4.patch ...

 * Failed Patch: linux-4.patch !
 *  ( /etc/portage/patches//x11-drivers/nvidia-drivers/linux-4.patch )
 *
 * Include in your bugreport the contents of:
 *
 *   /var/tmp/portage/x11-drivers/nvidia-drivers-304.125/temp/linux-4.patch.out

 * ERROR: x11-drivers/nvidia-drivers-304.125::gentoo failed (prepare phase):
 *   Failed Patch: linux-4.patch!
 *
 * Call stack:
 *     ebuild.sh, line   93:  Called src_prepare
 *   environment, line 4394:  Called epatch_user
 *   environment, line 1701:  Called epatch
 *   environment, line 1674:  Called die
 * The specific snippet of code:
 *               die "Failed Patch: ${patchname}!";
 *
 * If you need support, post the output of `emerge --info '=x11-drivers/nvidia-drivers-304.125::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=x11-drivers/nvidia-drivers-304.125::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/temp/environment'.
 * Working directory: '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work'
 * S: '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/work/'

>>> Failed to emerge x11-drivers/nvidia-drivers-304.125, Log file:

>>>  '/var/tmp/portage/x11-drivers/nvidia-drivers-304.125/temp/build.log'

 * Messages for package x11-drivers/nvidia-drivers-304.125:

 * Gentoo supports kernels which are supported by NVIDIA
 * which are limited to the following kernels:
 * <sys-kernel/gentoo-sources-3.18
 * <sys-kernel/vanilla-sources-3.18
 *
 * You are free to utilize epatch_user to provide whatever
 * support you feel is appropriate, but will not receive
 * support as a result of those changes.
 *
 * Do not file a bug report about this.


Thank you anyway!!!!
Back to top
View user's profile Send private message
tomtom69
Apprentice
Apprentice


Joined: 09 Nov 2010
Posts: 245
Location: Bavaria

PostPosted: Thu Jun 18, 2015 6:30 pm    Post subject: Reply with quote

Strange. I pasted exactly the file from my /etc/portage/patches/x11-drivers/nvidia-drivers-304.125/nvidia-drivers-304.125-kernel-4.0.5.patch
I now copied the patch again and fresh into pastebin. Could you try this one?:
http://pastebin.com/NCJaqux7
Back to top
View user's profile Send private message
papas
Tux's lil' helper
Tux's lil' helper


Joined: 01 Dec 2014
Posts: 141
Location: Athens

PostPosted: Thu Jun 18, 2015 7:08 pm    Post subject: Reply with quote

tomtom69 wrote:
Strange. I pasted exactly the file from my /etc/portage/patches/x11-drivers/nvidia-drivers-304.125/nvidia-drivers-304.125-kernel-4.0.5.patch
I now copied the patch again and fresh into pastebin. Could you try this one?:
http://pastebin.com/NCJaqux7


Now the patch its fine but still i cant build the driver, maybe there is something wrong with my system.
Can anybody else try the patch?
Thank you again tomtom69.
Back to top
View user's profile Send private message
mani001
Guru
Guru


Joined: 04 Dec 2004
Posts: 485
Location: Oleiros

PostPosted: Thu Jun 18, 2015 9:58 pm    Post subject: Reply with quote

tomtom69, your patch (along with the other one from the NVIDIA forums) did the trick for me :D Thank you very much!!

Actually, because I couldn't use the patch as it was, I created myself a slightly modified version. Here it goes, just in case

http://pastebin.com/d1htUQGX

Cheers!!
Back to top
View user's profile Send private message
tomtom69
Apprentice
Apprentice


Joined: 09 Nov 2010
Posts: 245
Location: Bavaria

PostPosted: Fri Jun 19, 2015 6:14 am    Post subject: Reply with quote

@papas:
Be sure to use both patches, the new one from me or from manni01, and also the one mentioned by geienah:
https://projects.archlinux.org/svntogit/packages.git/plain/trunk/nvidia-4.0.patch?h=packages/nvidia-304xx&id=44604b1a6fdecc23c24b95bef0e311a93c932d82
Back to top
View user's profile Send private message
gerard27
Advocate
Advocate


Joined: 04 Jan 2004
Posts: 2377
Location: Netherlands

PostPosted: Tue Jun 23, 2015 1:58 pm    Post subject: Reply with quote

@gienah,
Thanks for your link.
Even works on 4.1.0 !
Gerard.
_________________
To install Gentoo I use sysrescuecd.Based on Gentoo,has firefox to browse Gentoo docs and mc to browse (and edit) files.
The same disk can be used for 32 and 64 bit installs.
You can follow the Handbook verbatim.
http://www.sysresccd.org/Download
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Unsupported Software All times are GMT
Goto page 1, 2, 3  Next
Page 1 of 3

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum