Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
fixing nvidia-drivers with kernel-4.7
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware
View previous topic :: View next topic  
Author Message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1181
Location: Stuttgart, Germany

PostPosted: Thu Jul 28, 2016 7:12 pm    Post subject: fixing nvidia-drivers with kernel-4.7 Reply with quote

In case anybody else runs across the same issue I did:

the 4.7 kernel introduces a function that the nvidia-drivers installer already uses, leading to a failed emerge of nvidia-drivers. You can read about the issue and find the necessary patch on this thread.

Happy emerging,

EE
Back to top
View user's profile Send private message
Fred Krogh
Veteran
Veteran


Joined: 07 Feb 2005
Posts: 1019
Location: Tujunga, CA

PostPosted: Thu Jul 28, 2016 9:33 pm    Post subject: Reply with quote

I haven't done much patching, but I didn't see anything there that I could use as patch just as it is. I have added patches at /etc/portage/x11-drivers/nvidia-drievers-xxx in the past, but what I see at the link given does not look like those patches. Am I missing something. Thanks,
Fred
Think I was confused. Thought I was trying to patch the nvidia-drivers, not stuff in the kernel. I think I'll just wait.
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1181
Location: Stuttgart, Germany

PostPosted: Fri Jul 29, 2016 4:11 am    Post subject: Reply with quote

Post #4 of that thread (as of this writing, at least) contains a text block. Save that block as /etc/portage/patches/x11-drivers/nvidia-drivers-361.35/kernel-4.7.patch (or whatever you want to name it in that subdirectory), and remerge nvidia-drivers. You will need to manually edit that file, however, replacing every instance of "361.27" with "361.35" so that it applies to the correct version.

HTH,

EE
Back to top
View user's profile Send private message
Fred Krogh
Veteran
Veteran


Joined: 07 Feb 2005
Posts: 1019
Location: Tujunga, CA

PostPosted: Fri Jul 29, 2016 4:50 am    Post subject: Reply with quote

Thanks. That was easy and it worked.
Back to top
View user's profile Send private message
peter4
Guru
Guru


Joined: 19 Jul 2005
Posts: 359
Location: Wroclaw, Poland

PostPosted: Sat Jul 30, 2016 10:27 am    Post subject: Reply with quote

Don't you guys get the sandbox violations? I get this for every file the ebuild tries to compile, with or without the patch:

Code:

  x86_64-pc-linux-gnu-gcc -Wp,-MD,/var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel/nvidia-uvm/.uvm8_pushbuffer.o.d  -nostdinc -isystem /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include -I/usr/src/linux-4.7.0-gentoo/arch/x86/include -Iarch/x86/include/generated/uapi -Iarch/x86/include/generated  -I/usr/src/linux-4.7.0-gentoo/include -Iinclude -I/usr/src/linux-4.7.0-gentoo/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/usr/src/linux-4.7.0-gentoo/include/uapi -Iinclude/generated/uapi -include /usr/src/linux-4.7.0-gentoo/include/linux/kconfig.h   -I/var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel -D__KERNEL__ -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -Werror-implicit-function-declaration -Wno-format-security -std=gnu89 -mno-sse -mno-mmx -mno-sse2 -mno-3dnow -mno-avx -m64 -falign-jumps=1 -falign-loops=1 -mno-80387 -mno-fp-ret-in-387 -mpreferred-stack-boundary=3 -mskip-rax-setup -march=core2 -mno-red-zone -mcmodel=kernel -funit-at-a-time -maccumulate-outgoing-args -DCONFIG_X86_X32_ABI -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 -DCONFIG_AS_SHA1_NI=1 -DCONFIG_AS_SHA256_NI=1 -pipe -Wno-sign-compare -fno-asynchronous-unwind-tables -fno-delete-null-pointer-checks -O2 --param=allow-store-data-races=0 -Wframe-larger-than=2048 -fno-stack-protector -Wno-unused-but-set-variable -fomit-frame-pointer -fno-var-tracking-assignments -Wdeclaration-after-statement -Wno-pointer-sign -fno-strict-overflow -fconserve-stack -Werror=implicit-int -Werror=strict-prototypes -Werror=date-time -Werror=incompatible-pointer-types -DCC_HAVE_ASM_GOTO   -I/var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel/common/inc   -I/var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel -Wall -MD -Wsign-compare -Wno-cast-qual -Wno-error -D__KERNEL__ -DMODULE -DNVRM -DNV_VERSION_STRING=\"367.35\" -Wno-unused-function -Wuninitialized -fno-strict-aliasing -mno-red-zone -mcmodel=kernel -DNV_UVM_ENABLE -Wno-sign-compare -Wno-format-extra-args -O2 -DNVIDIA_UVM_ENABLED -DNVIDIA_UNDEF_LEGACY_BIT_MACROS -DLinux -D__linux__   -I/var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel/nvidia-uvm  -DMODULE  -DKBUILD_BASENAME='"uvm8_pushbuffer"'  -DKBUILD_MODNAME='"nvidia_uvm"' -c -o /var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel/nvidia-uvm/uvm8_pushbuffer.o /var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel/nvidia-uvm/uvm8_pushbuffer.c
 * ACCESS DENIED:  fopen_wr:     /usr/src/linux-4.7.0-gentoo/uvm8_pushbuffer.d
/var/tmp/portage/x11-drivers/nvidia-drivers-367.35-r1/work/kernel/nvidia-uvm/uvm8_pushbuffer.c:31:0: fatal error: opening dependency file uvm8_pushbuffer.d: Permission denied
 #include "uvm_common.h"
 ^
compilation terminated.


Doesn't happen with kernel 4.6.5.
Back to top
View user's profile Send private message
Fred Krogh
Veteran
Veteran


Joined: 07 Feb 2005
Posts: 1019
Location: Tujunga, CA

PostPosted: Sat Jul 30, 2016 1:32 pm    Post subject: Reply with quote

From backups, I can see that I used to have a uvm_common.h, but that is no longer in my system.
Back to top
View user's profile Send private message
Mikkl
n00b
n00b


Joined: 12 Jan 2006
Posts: 71

PostPosted: Sun Jul 31, 2016 3:04 pm    Post subject: Reply with quote

Hey Peter,

Quote:
Don't you guys get the sandbox violations? I get this for every file the ebuild tries to compile, with or without the patch:


have you set TRIM_UNUSED_KSYSMS to yes in your kernel config? I had the same violations and now have set it to "no" and emerging now works.

Greetins, Mikkl
Back to top
View user's profile Send private message
Chiitoo
Administrator
Administrator


Joined: 28 Feb 2010
Posts: 1775
Location: Here and Away Again

PostPosted: Sun Jul 31, 2016 5:31 pm    Post subject: ><)))°€ Reply with quote

Mikkl wrote:
Hey Peter,

Quote:
Don't you guys get the sandbox violations? I get this for every file the ebuild tries to compile, with or without the patch:


have you set TRIM_UNUSED_KSYSMS to yes in your kernel config? I had the same violations and now have set it to "no" and emerging now works.

Greetins, Mikkl

Did you perhaps mean

Code:
TRIM_UNUSED_KSYMS

instead of 'KSYSMS'? :]

I have 'CONFIG_TRIM_UNUSED_KSYMS is not set', and don't have that issue either.

For convenience, here's a patch I've been using. It's slightly modified from the one available at the devtalk.nvidia.com post mentioned before (note the trailing whitespaces that may appear when “copy-pasting”):

Code:
--- kernel/nvidia-drm/nvidia-drm-fb.c
+++ kernel/nvidia-drm/nvidia-drm-fb.c
@@ -114,7 +114,7 @@
      * We don't support any planar format, pick up first buffer only.
      */

-    gem = drm_gem_object_lookup(dev, file, cmd->handles[0]);
+    gem = drm_gem_object_lookup(file, cmd->handles[0]);

     if (gem == NULL)
     {
--- kernel/nvidia-drm/nvidia-drm-gem.c
+++ kernel/nvidia-drm/nvidia-drm-gem.c
@@ -408,7 +408,7 @@

     mutex_lock(&dev->struct_mutex);

-    gem = drm_gem_object_lookup(dev, file, handle);
+    gem = drm_gem_object_lookup(file, handle);

     if (gem == NULL)
     {
--- kernel/nvidia-uvm/uvm_linux.h
+++ kernel/nvidia-uvm/uvm_linux.h
@@ -554,12 +554,13 @@
     INIT_RADIX_TREE(tree, GFP_NOWAIT);
 }

+/*
 static bool radix_tree_empty(struct radix_tree_root *tree)
 {
     void *dummy;
     return radix_tree_gang_lookup(tree, &dummy, 0, 1) == 0;
 }
-
+*/

 #if !defined(NV_USLEEP_RANGE_PRESENT)
 static void __sched usleep_range(unsigned long min, unsigned long max)

_________________
Kind Regards,
~ The Noob Unlimited ~

Sore wa sore, kore wa kore.
Back to top
View user's profile Send private message
Mikkl
n00b
n00b


Joined: 12 Jan 2006
Posts: 71

PostPosted: Sun Jul 31, 2016 7:15 pm    Post subject: Reply with quote

Quote:
Did you perhaps mean

Code:
TRIM_UNUSED_KSYMS

instead of 'KSYSMS'? :]


:oops: You're right. I should definitely learn how to properly copy'n'paste.

Besides from that, I'm now getting errors due to missing symbols when loading the nvidia kernel module...

Edit: OK, I just forgot to copy my kernel again after re-compiling without the stripped symbols. Another failed copy'n'paste job...
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Sun Jul 31, 2016 8:58 pm    Post subject: Reply with quote

I have added the patch to my overlay, hnaparst.

Code:
layman -a hnaparst
emerge =nvidia-drivers-367.35-r2
Back to top
View user's profile Send private message
undrwater
Guru
Guru


Joined: 28 Jan 2003
Posts: 300
Location: Caucasia

PostPosted: Tue Aug 02, 2016 5:00 am    Post subject: Reply with quote

hnaparst wrote:
I have added the patch to my overlay, hnaparst.

Code:
layman -a hnaparst
emerge =nvidia-drivers-367.35-r2


Thank you! Will you be updating for newer kernel versions?
_________________
Open-mindedness is painful...
Back to top
View user's profile Send private message
Pryka
l33t
l33t


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

PostPosted: Tue Aug 02, 2016 9:57 am    Post subject: Reply with quote

And what about patch for 340.96? Only with that driver u can get support for older GPU.
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Tue Aug 02, 2016 3:45 pm    Post subject: Reply with quote

Pryka wrote:
And what about patch for 340.96? Only with that driver u can get support for older GPU.


I do not own the legacy hardware, so it would be difficult to test. If you have any ideas, I am all ears. The patches are available on the various developer forums, but I am hesitant to produce a version for Gentoo without the ability to test it.
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Tue Aug 02, 2016 3:48 pm    Post subject: Reply with quote

undrwater wrote:

Thank you! Will you be updating for newer kernel versions?


It has not been a problem for a while. However, it certainly is my intention to be able to run my own nvidia hardware with the latest kernel, so I guess I should answer yes to your question.
Back to top
View user's profile Send private message
ycUygB1
Apprentice
Apprentice


Joined: 27 Jul 2005
Posts: 276
Location: Portland, Oregon

PostPosted: Tue Aug 02, 2016 7:21 pm    Post subject: Reply with quote

Pryka wrote:
And what about patch for 340.96? Only with that driver u can get support for older GPU.


I have added x11-drivers/nvidia-drivers-340.96-r6 to my overlay and verified that it emerges correctly with kernels 4.6.5 and 4.7.0
I have not tested it because I do not have legacy hardware.


Last edited by ycUygB1 on Wed Aug 03, 2016 1:02 am; edited 1 time in total
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7094
Location: Saint Amant, Acadiana

PostPosted: Tue Aug 02, 2016 8:13 pm    Post subject: Reply with quote

Thanks! I have a MythTV frontend with this hardware, will test it soon.
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Pryka
l33t
l33t


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

PostPosted: Wed Aug 03, 2016 4:55 am    Post subject: Reply with quote

hnaparst wrote:
Pryka wrote:
And what about patch for 340.96? Only with that driver u can get support for older GPU.


I have added x11-drivers/nvidia-drivers-340.96-r6 to my overlay and verified that it emerges correctly with kernels 4.6.5 and 4.7.0
I have not tested it because I do not have legacy hardware.


I will check it soon, THX!
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 7094
Location: Saint Amant, Acadiana

PostPosted: Wed Aug 03, 2016 1:01 pm    Post subject: Reply with quote

Works on ION chipset. Thanks again!
_________________
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
haarp
Guru
Guru


Joined: 31 Oct 2007
Posts: 517

PostPosted: Mon Aug 22, 2016 7:45 am    Post subject: Reply with quote

Mikkl wrote:
Hey Peter,

Quote:
Don't you guys get the sandbox violations? I get this for every file the ebuild tries to compile, with or without the patch:


have you set TRIM_UNUSED_KSYMS to yes in your kernel config? I had the same violations and now have set it to "no" and emerging now works.

Greetins, Mikkl

Same here. Thanks for the tip!

The ebuild should probably check for that setting being present.
Back to top
View user's profile Send private message
Pryka
l33t
l33t


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

PostPosted: Mon Aug 22, 2016 9:46 am    Post subject: Reply with quote

hnaparst wrote:
Pryka wrote:
And what about patch for 340.96? Only with that driver u can get support for older GPU.


I have added x11-drivers/nvidia-drivers-340.96-r6 to my overlay and verified that it emerges correctly with kernels 4.6.5 and 4.7.0
I have not tested it because I do not have legacy hardware.


Working on old 9600GT. Thank You.
Back to top
View user's profile Send private message
Fred Krogh
Veteran
Veteran


Joined: 07 Feb 2005
Posts: 1019
Location: Tujunga, CA

PostPosted: Mon Aug 22, 2016 2:04 pm    Post subject: Reply with quote

Nvidia-drivers-370.23 with kernel 4.7.2 works just fine on my system with no patches.
Back to top
View user's profile Send private message
musv
Advocate
Advocate


Joined: 01 Dec 2002
Posts: 3254
Location: de

PostPosted: Sun Aug 28, 2016 4:41 pm    Post subject: Reply with quote

hnaparst wrote:
I have added x11-drivers/nvidia-drivers-340.96-r6 to my overlay

Thanks a lot.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Kernel & Hardware All times are GMT
Page 1 of 1

 
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