Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index Assistance Portage & Programming
  • Search

nvidia-drivers-390.87 fails against kernel-4.20 [SOLVED]

Problems with emerge or ebuilds? Have a basic programming question about C, PHP, Perl, BASH or something else?
Post Reply
Advanced search
19 posts • Page 1 of 1
Author
Message
ExecutorElassus
Veteran
Veteran
User avatar
Posts: 1526
Joined: Thu Mar 11, 2004 11:12 pm
Location: Berlin, Germany

nvidia-drivers-390.87 fails against kernel-4.20 [SOLVED]

  • Quote

Post by ExecutorElassus » Wed Dec 26, 2018 6:58 pm

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: Select all

/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.
Top
Naib
Watchman
Watchman
User avatar
Posts: 6101
Joined: Fri May 21, 2004 9:42 pm
Location: Removed by Neddy
Contact:
Contact Naib
Website

  • Quote

Post by Naib » Wed Dec 26, 2018 7:08 pm

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
#define HelloWorld int
#define Int main()
#define Return printf
#define Print return
#include <stdio>
HelloWorld Int {
Return("Hello, world!\n");
Print 0;
Top
ExecutorElassus
Veteran
Veteran
User avatar
Posts: 1526
Joined: Thu Mar 11, 2004 11:12 pm
Location: Berlin, Germany

  • Quote

Post by ExecutorElassus » Wed Dec 26, 2018 8:25 pm

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
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Wed Dec 26, 2018 9:20 pm

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
Top
yzg
Guru
Guru
Posts: 500
Joined: Sat Jun 18, 2005 11:56 am

  • Quote

Post by yzg » Thu Dec 27, 2018 1:56 am

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: Select all

--- 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: Select all

--- 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
 )
 {
Top
ExecutorElassus
Veteran
Veteran
User avatar
Posts: 1526
Joined: Thu Mar 11, 2004 11:12 pm
Location: Berlin, Germany

  • Quote

Post by ExecutorElassus » Thu Dec 27, 2018 4:07 am

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

Thanks!

EE
Top
yzg
Guru
Guru
Posts: 500
Joined: Sat Jun 18, 2005 11:56 am

  • Quote

Post by yzg » Thu Dec 27, 2018 8:24 am

I'm using nvidia drivers-390.87. Are you using this version?
Top
yzg
Guru
Guru
Posts: 500
Joined: Sat Jun 18, 2005 11:56 am

  • Quote

Post by yzg » Thu Dec 27, 2018 8:26 am

And kernel sys-kernel/gentoo-sources-4.20.0 on ~amd64 setup.
Top
yzg
Guru
Guru
Posts: 500
Joined: Sat Jun 18, 2005 11:56 am

  • Quote

Post by yzg » Thu Dec 27, 2018 8:34 am

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: Select all

# 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 ...
Top
ExecutorElassus
Veteran
Veteran
User avatar
Posts: 1526
Joined: Thu Mar 11, 2004 11:12 pm
Location: Berlin, Germany

  • Quote

Post by ExecutorElassus » Thu Dec 27, 2018 8:46 am

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
Top
yzg
Guru
Guru
Posts: 500
Joined: Sat Jun 18, 2005 11:56 am

  • Quote

Post by yzg » Thu Dec 27, 2018 12:05 pm

Download them from there:

https://paste.pound-python.org/show/1tB ... aMeJkFd4C/

https://paste.pound-python.org/show/8Xl ... Co8C6PGa8/

If they do not work, post the errors.
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Thu Dec 27, 2018 2:34 pm

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
Top
ExecutorElassus
Veteran
Veteran
User avatar
Posts: 1526
Joined: Thu Mar 11, 2004 11:12 pm
Location: Berlin, Germany

  • Quote

Post by ExecutorElassus » Thu Dec 27, 2018 3:06 pm

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
Top
cfgauss
l33t
l33t
User avatar
Posts: 793
Joined: Wed May 18, 2005 7:07 pm
Location: USA

  • Quote

Post by cfgauss » Thu Dec 27, 2018 4:13 pm

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.
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Thu Dec 27, 2018 4:16 pm

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: Select all

/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: Select all

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
Top
ExecutorElassus
Veteran
Veteran
User avatar
Posts: 1526
Joined: Thu Mar 11, 2004 11:12 pm
Location: Berlin, Germany

  • Quote

Post by ExecutorElassus » Thu Dec 27, 2018 5:44 pm

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: Select all

 ./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
Top
yzg
Guru
Guru
Posts: 500
Joined: Sat Jun 18, 2005 11:56 am

  • Quote

Post by yzg » Fri Dec 28, 2018 1:34 am

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

https://paste.pound-python.org/show/baE ... YPxb7eRV0/
Top
ExecutorElassus
Veteran
Veteran
User avatar
Posts: 1526
Joined: Thu Mar 11, 2004 11:12 pm
Location: Berlin, Germany

  • Quote

Post by ExecutorElassus » Fri Dec 28, 2018 4:27 am

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
Top
tld
Veteran
Veteran
Posts: 1889
Joined: Tue Dec 09, 2003 9:35 pm

  • Quote

Post by tld » Fri Dec 28, 2018 2:42 pm

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
Top
Post Reply

19 posts • Page 1 of 1

Return to “Portage & Programming”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy

 

 

magic