Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
nvidia-drivers-390.87 fails against kernel-4.20 [SOLVED]
View unanswered posts
View posts from last 24 hours

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


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Wed Dec 26, 2018 6:58 pm    Post subject: nvidia-drivers-390.87 fails against kernel-4.20 [SOLVED] Reply with quote

I'm stuck on the nvidia-drivers-390.* branch due to a legacy GPU (an nVidia-GeForce GTX580). The 4.20 kernel, jokes about which I am sure Linus Torvalds is really going to enjoy filling his inbox every day for the next month, does not allow the nvidia-drivers ebuild to package. I get the following error:

Code:
/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c: In function ‘__nv_drm_vma_fault’:
/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c:240:11: error: implicit declaration of function ‘vm_insert_pfn’; did you mean ‘vmf_insert_pfn’? [-Werror=implicit-function-declaration]
     ret = vm_insert_pfn(vma, address, pfn + page_offset);
           ^~~~~~~~~~~~~
           vmf_insert_pfn
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:291: /var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.o] Error 1
make[2]: *** Waiting for unfinished jobs....
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline "/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-drm/nvidia-drm-gem-user-memory.o";
make[1]: *** [Makefile:1563: _module_/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel] Error 2
make[1]: Leaving directory '/usr/src/linux-4.20.0-gentoo'
make: *** [Makefile:79: modules] Error 2


I suspect this is something that could easily be solved with a patch, as it seems to be a simple name change in a function, but I lack the skills to make one, or to assess whether that's the correct, or only, change to patch.

Is there a patch out already? Anybody else encountering the error?

Thanks for the help,

EE
ADDENDUM: according to this page, nvidia implemented a fix in the -415 branch; so maybe it'll get backported?


Last edited by ExecutorElassus on Fri Dec 28, 2018 4:27 am; edited 1 time in total
Back to top
View user's profile Send private message
Naib
Watchman
Watchman


Joined: 21 May 2004
Posts: 6051
Location: Removed by Neddy

PostPosted: Wed Dec 26, 2018 7:08 pm    Post subject: Reply with quote

nvidia are quite good at this sort of thing but yes, you will need to wait for the next legacy bump to support 4.20
_________________
Quote:
Removed by Chiitoo
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Wed Dec 26, 2018 8:25 pm    Post subject: Reply with quote

Well, weirdly, nvidia now says that the -396.* branch also supports my card. But since that version's getting dropped from the tree "on or about 16th January 2019" according to package.mask, I guess I'm stuck on the -390.* branch for now.

Sigh. Really, I should just suck it up and buy a new card sometime soon.

Cheers,

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


Joined: 09 Dec 2003
Posts: 1812

PostPosted: Wed Dec 26, 2018 9:20 pm    Post subject: Reply with quote

Yuk...this is one that'll start biting me in the ass with my MythTV frontend before long...not so much because of my card (a GT 430) but because the machine is an old x86. nVidia as I understand it dropped 32 bit support past the 390.x versions. I recall the hell I went through with an old card in this machine (endlessly chasing down patches for kernel compatibility) until I gave up and went with the Nouveau drivers. For my MythTV machine however where I need all the vdpau capability etc, that's not an option.

As far as support by model it really is confusing as hell and always has been. If you look at the models listed for the legacy 390.x driver it includes a ton of models that are also supported by the current driver.

Tom
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 493

PostPosted: Thu Dec 27, 2018 1:56 am    Post subject: Reply with quote

I have the same problem. There are two issues preventing nvidia-drivers-390.87 from compiling under kernel 4.20: vmf_insert_pfn and ipmi_user.

I've created the following two patches to fix them:

/etc/portage/patches/x11-drivers/nvidia-drivers-390.87/nvidia-drivers-390.87-kernel-4.20-vmf_insert_pfn.patch
Code:

--- a/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c   2018-12-27 12:02:01.534608650 +1100
+++ b/kernel/nvidia-drm/nvidia-drm-gem-nvkms-memory.c   2018-12-27 12:04:31.541940558 +1100
@@ -237,7 +237,7 @@
 
     page_offset = vmf->pgoff - drm_vma_node_start(&gem->vma_node);
 
-    ret = vm_insert_pfn(vma, address, pfn + page_offset);
+    ret = vmf_insert_pfn(vma, address, pfn + page_offset);
 
     switch (ret) {
         case 0:


/etc/portage/patches/x11-drivers/nvidia-drivers-390.87/nvidia-drivers-390.87-kernel-4.20-ipmi_user.patch
Code:

--- a/kernel/nvidia/os-interface.c   2018-12-27 11:57:21.788109696 +1100
+++ b/kernel/nvidia/os-interface.c   2018-12-27 11:59:45.300394369 +1100
@@ -1697,7 +1697,7 @@
 
 struct nv_ipmi_softc
 {
-    ipmi_user_t         p_user;     // ptr to ipmi_msghandler user structure
+    struct ipmi_user   *p_user;     // ptr to ipmi_msghandler user structure
     spinlock_t          msg_lock;
     struct list_head    msgs;
     NvU32               seqNum;     //request sequence number
@@ -1706,7 +1706,7 @@
 static inline int
 nv_ipmi_set_my_address
 (
-    ipmi_user_t     user,
+    struct ipmi_user *user,
     unsigned char   address
 )
 {
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Thu Dec 27, 2018 4:07 am    Post subject: Reply with quote

@vzg, are you sure about those patches? Both failed on my system.

Thanks!

EE
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 493

PostPosted: Thu Dec 27, 2018 8:24 am    Post subject: Reply with quote

I'm using nvidia drivers-390.87. Are you using this version?
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 493

PostPosted: Thu Dec 27, 2018 8:26 am    Post subject: Reply with quote

And kernel sys-kernel/gentoo-sources-4.20.0 on ~amd64 setup.
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 493

PostPosted: Thu Dec 27, 2018 8:34 am    Post subject: Reply with quote

You mentioned the version number in the title. Sorry for asking redundant question.

This is the start of my nvidia drivers emerge. As you can see at the end, the patches were applied correctly.

Code:

# emerge -av1 nvidia-drivers

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

Calculating dependencies... done!
[ebuild   R    ] x11-drivers/nvidia-drivers-390.87:0/390::gentoo  USE="X acpi driver kms multilib static-libs tools uvm -compat -gtk3 -pax_kernel -wayland" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 1 package (1 reinstall), Size of downloads: 0 KiB

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

>>> Verifying ebuild manifests
>>> Running pre-merge checks for x11-drivers/nvidia-drivers-390.87
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     4.20.0-gentoo
 * Gentoo supports kernels which are supported by NVIDIA
 * which are limited to the following kernels:
 * <sys-kernel/gentoo-sources-4.19
 * <sys-kernel/vanilla-sources-4.19
 *
 * 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-390.87::gentoo
 * NVIDIA-Linux-x86_64-390.87.run BLAKE2B SHA512 size ;-) ...                                                [ ok ]
 * nvidia-settings-390.87.tar.bz2 BLAKE2B SHA512 size ;-) ...                                                [ ok ]
 * Determining the location of the kernel source code
 * Found kernel source directory:
 *     /usr/src/linux
 * Found sources for kernel version:
 *     4.20.0-gentoo
 * Gentoo supports kernels which are supported by NVIDIA
 * which are limited to the following kernels:
 * <sys-kernel/gentoo-sources-4.19
 * <sys-kernel/vanilla-sources-4.19
 *
 * 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 ]
 * Checking for suitable kernel configuration options...                                                     [ ok ]
>>> Unpacking source...
>>> Unpacking NVIDIA-Linux-x86_64-390.87.run to /var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work
>>> Unpacking nvidia-settings-390.87.tar.bz2 to /var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work
>>> Source unpacked in /var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work
>>> Preparing source in /var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work ...
 * Applying nvidia-settings-linker.patch ...                                                                 [ ok ]
 * Applying nvidia-drivers-390.87-kernel-4.19.patch ...                                                      [ ok ]
 * Applying nvidia-drivers-390.87-kernel-4.20-ipmi_user.patch ...                                            [ ok ]
 * Applying nvidia-drivers-390.87-kernel-4.20-vmf_insert_pfn.patch ...                                       [ ok ]
 * User patches applied.
>>> Source prepared.
>>> Configuring source in /var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work ...
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Thu Dec 27, 2018 8:46 am    Post subject: Reply with quote

Are you sure you posted the complete patch? I see some open brackets at the end.

As far as kernel and drivers version, I'm the same as you.

Cheers,

EE
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 493

PostPosted: Thu Dec 27, 2018 12:05 pm    Post subject: Reply with quote

Download them from there:

https://paste.pound-python.org/show/1tBTFKnwWU6aMeJkFd4C/

https://paste.pound-python.org/show/8XlyVBU8DufCo8C6PGa8/

If they do not work, post the errors.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1812

PostPosted: Thu Dec 27, 2018 2:34 pm    Post subject: Reply with quote

ExecutorElassus wrote:
Are you sure you posted the complete patch? I see some open brackets at the end.
Patch files are basically unified diff output and generally include three lines after line(s) that have changed...so that actually looks correct. There's no reason the patch would have matching brackets or the like as would a complete block of code.

Tom
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Thu Dec 27, 2018 3:06 pm    Post subject: Reply with quote

ah, my mistake.

But then, I'm really not sure why it works on yzg's system and not mine. I've copied it exactly as it is in the linked pastes, and it still crashes out.

Thanks again,

EE
Back to top
View user's profile Send private message
cfgauss
l33t
l33t


Joined: 18 May 2005
Posts: 688
Location: USA

PostPosted: Thu Dec 27, 2018 4:13 pm    Post subject: Reply with quote

I can confirm that nvidia-drivers-390.87 installed under gentoo-sources-4.20.0 on my ~amd64 system with yzg's patches. Many thanks, yzg.
ExecutorElassus wrote:
I've copied it exactly as it is in the linked pastes, and it still crashes out.

Perhaps this is a copy error. If you click on raw in the paste and then use your browser's Save Page As... option you'll get precisely the files yzg uploaded.

I hope these patches work for you as well.
Back to top
View user's profile Send private message
tld
Veteran
Veteran


Joined: 09 Dec 2003
Posts: 1812

PostPosted: Thu Dec 27, 2018 4:16 pm    Post subject: Reply with quote

When you say it "crashes out"...what exactly do you mean? Is it failing to apply the patch? While I can't install that here at the moment I was able to test applying those patches using "ebuild nvidia-drivers-390.87.ebuild prepare". I used the links he provided above and chose the "raw" option and saved the files to these files:
Code:
/etc/portage/patches/x11-drivers/nvidia-drivers-390.87/nvidia-drivers-390.87-kernel-4.20-ipmi_user.patch
/etc/portage/patches/x11-drivers/nvidia-drivers-390.87/nvidia-drivers-390.87-kernel-4.20-vmf_insert_pfn.patch

The patches applied correctly, though for the life of me I can't figure out why patch is giving me those "patch unexpectedly ends in middle of line" warnings.

Code:
ebuild nvidia-drivers-390.87.ebuild prepare
>>> Downloading 'https://us.download.nvidia.com/XFree86/Linux-x86/390.87/NVIDIA-Linux-x86-390.87.run'
--2018-12-27 10:51:21--  https://us.download.nvidia.com/XFree86/Linux-x86/390.87/NVIDIA-Linux-x86-390.87.run
Resolving us.download.nvidia.com... 192.229.211.70, 2606:2800:21f:3aa:dcf:37b:1ed6:1fb
Connecting to us.download.nvidia.com|192.229.211.70|:443... connected.
...etc...
>>> Unpacking source...
>>> Unpacking NVIDIA-Linux-x86-390.87.run to /disk2/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work
>>> Unpacking nvidia-settings-390.87.tar.bz2 to /disk2/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work
>>> Source unpacked in /disk2/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work
>>> Preparing source in /disk2/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work ...
 * Applying nvidia-settings-linker.patch ...                                                                                                   [ ok ]
 * Applying nvidia-drivers-390.87-kernel-4.20-ipmi_user.patch ...
patch unexpectedly ends in middle of line                                                                                                      [ ok ]
 * Applying nvidia-drivers-390.87-kernel-4.20-vmf_insert_pfn.patch ...
patch unexpectedly ends in middle of line                                                                                                      [ ok ]
 * User patches applied.
>>> Source prepared.

So yea...the patches do apply. Really stumped on those patch warnings. I've verified that all the line endings in the patches are correct.

Tom
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Thu Dec 27, 2018 5:44 pm    Post subject: Reply with quote

ugh. There we go. I saved them from the raw output, and now it works. I have no idea what I was doing wrong (maybe missing a whitespace somewhere?), but I must have copied them incorrectly.

Anyway, now I have another error in compilation:

Code:
 ./tools/objtool/objtool orc generate  --module --no-fp --retpoline "/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-uvm/uvm8_range_group_tree_test.o";
   ./tools/objtool/objtool orc generate  --module --no-fp --retpoline "/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-drm/nvidia-drm-crtc.o";
/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-drm/nvidia-drm-connector.c: In function ‘nv_drm_connector_get_modes’:
/var/tmp/portage/x11-drivers/nvidia-drivers-390.87/work/kernel/nvidia-drm/nvidia-drm-connector.c:229:9: error: implicit declaration of function ‘drm_mode_connector_update_edid_property’; did you mean ‘drm_connector_update_edid_property’? [-Werror=implicit-function-declaration]
         drm_mode_connector_update_edid_property(
         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
         drm_connector_update_edid_property
cc1: some warnings being treated as errors


So here's another name change from upstream that needs patching, unless I've somehow missed something.

Thanks for helping.

EE
Back to top
View user's profile Send private message
yzg
Guru
Guru


Joined: 18 Jun 2005
Posts: 493

PostPosted: Fri Dec 28, 2018 1:34 am    Post subject: Reply with quote

This is a problem since kernel 4.19. Here is a patch for it

https://paste.pound-python.org/show/baEGm7aGU1cYPxb7eRV0/
Back to top
View user's profile Send private message
ExecutorElassus
Veteran
Veteran


Joined: 11 Mar 2004
Posts: 1435
Location: Berlin, Germany

PostPosted: Fri Dec 28, 2018 4:27 am    Post subject: Reply with quote

arrgh, right: I forgot that I renamed that patch to *.patch.backup in case that was causing problems. OK, now, finally, nvidia-drivers has successfully compiled and I could reboot.

Thanks for all the help! Marking [SOLVED].

Cheers,

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


Joined: 09 Dec 2003
Posts: 1812

PostPosted: Fri Dec 28, 2018 2:42 pm    Post subject: Reply with quote

In case it confuses anyone else: The patches downloaded as "raw" from those links will be missing the trailing newline on the last line of the file (similar to the behavior of countless Windows text editors). That's why I was getting those "patch unexpectedly ends in middle of line" warnings. As soon as I opened and saved them in vi (which automatically adds that) that warning went away.

Tom
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming 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