Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 602844 - x11-drivers/nvidia-drivers-340.101 with kernel 4.9.0 - nvidia.ko: NVRM: failed to register procfs!
Summary: x11-drivers/nvidia-drivers-340.101 with kernel 4.9.0 - nvidia.ko: NVRM: faile...
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Jeroen Roovers (RETIRED)
URL: https://devtalk.nvidia.com/default/to...
Whiteboard:
Keywords:
: 608264 619114 682910 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-12-16 16:12 UTC by daniel
Modified: 2019-04-09 19:37 UTC (History)
10 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
nvidia-drivers-linux-4.9.patch (nvidia-drivers-linux-4.9.patch,509 bytes, patch)
2016-12-18 22:00 UTC, alexandrl
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description daniel 2016-12-16 16:12:16 UTC
Summary: for kernel 4.9.0 nvidia-drivers-340.101 compiles without patch, but fails to load, nvidia-drivers-340.98 compiles and runs fine with the patch


nvidia-drivers-340.101 compile fine with kernel 4.9.0 without the patch mentioned here:

https://devtalk.nvidia.com/default/topic/981852/linux/resolution-patch-attached-for-nvidia-linux-driver-340-98-x86_64-using-linux-kernel-4-9/post/5037819/#5037819

However, it fails to load, see here:

https://devtalk.nvidia.com/default/topic/981852/linux/resolution-patch-attached-for-nvidia-linux-driver-340-98-x86_64-using-linux-kernel-4-9/post/5038307/#5038307
Comment 1 alexandrl 2016-12-18 22:00:36 UTC
Created attachment 456644 [details, diff]
nvidia-drivers-linux-4.9.patch

With this patch module loaded.
Comment 2 daniel 2016-12-20 07:46:03 UTC
This patch works for me too. Thanks.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2016-12-22 17:08:23 UTC
"Crashes" how?
Comment 4 daniel 2016-12-22 17:15:15 UTC
(In reply to Jeroen Roovers from comment #3)
> "Crashes" how?

    ERROR: Unable to load the kernel module 'nvidia.ko'.  This happens most frequently when this kernel module was built against the wrong or improperly configured kernel sources, with a version of gcc that differs from the one used to build the target kernel, or if a driver such as rivafb, nvidiafb, or nouveau is present and prevents the NVIDIA kernel module from obtaining ownership of the NVIDIA graphics device(s), or no NVIDIA GPU installed in this system is supported by this NVIDIA Linux graphics driver release.

    Please see the log entries 'Kernel module load error' and 'Kernel messages' at the end of the file '/var/log/nvidia-installer.log' for more information.
    -> Kernel module load error: No such device
    -> Kernel messages:
    [ 1092.921957]  [<ffffffffa08da900>] nv_register_procfs+0x3d/0x1a0 [nvidia]
    [ 1092.922174]  [<ffffffffa1789245>] nvidia_init_module+0x245/0x701 [nvidia]
    [ 1092.922386]  [<ffffffffa1789716>] ? nv_drm_init+0x15/0x15 [nvidia]
    [ 1092.922574]  [<ffffffffa1789766>] nvidia_frontend_init_module+0x50/0x8ea [nvidia]
    [ 1092.922739]  [<ffffffffa1789716>] ? nv_drm_init+0x15/0x15 [nvidia]
    [ 1092.922744]  [<ffffffff8100043e>] do_one_initcall+0x90/0x113
    [ 1092.922747]  [<ffffffff815c3fe9>] ? _cond_resched+0x19/0x23
    [ 1092.922750]  [<ffffffff811698ce>] ? slab_pre_alloc_hook+0x19/0x1f
    [ 1092.922753]  [<ffffffff8116c717>] ? kmem_cache_alloc_trace+0xbe/0xcd
    [ 1092.922757]  [<ffffffff81122c37>] do_init_module+0x5f/0x1ef
    [ 1092.922761]  [<ffffffff810bd293>] load_module+0x1a9c/0x2003
    [ 1092.922764]  [<ffffffff8117ea31>] ? fsnotify_access+0x5a/0x61
    [ 1092.922766]  [<ffffffff810b9bb4>] ? strstarts+0x28/0x28
    [ 1092.922769]  [<ffffffff810bd987>] SYSC_finit_module+0x83/0x90
    [ 1092.922771]  [<ffffffff810bd987>] ? SYSC_finit_module+0x83/0x90
    [ 1092.922773]  [<ffffffff810bd9b2>] SyS_finit_module+0xe/0x10
    [ 1092.922776]  [<ffffffff815c68e4>] entry_SYSCALL_64_fastpath+0x17/0x98
    [ 1092.922779] ---[ end trace a38d66f1d193dd50 ]---
    [ 1092.922782] NVRM: failed to register procfs!
    [ 1092.922851] NVRM: request_mem_region failed for 16M @ 0xe0000000. This can
                   NVRM: occur when a driver such as rivatv is loaded and claims
                   NVRM: ownership of the device's registers.
    [ 1092.922859] nvidia: probe of 0000:01:00.0 failed with error -1
    [ 1092.922900] Error: Driver 'nvidia' is already registered, aborting...
    [ 1092.922901] NVRM: DRM init failed
Comment 5 acidhell 2016-12-22 21:27:11 UTC
Patch works. Thank you
Comment 7 Kamen Dokov 2017-01-24 07:30:15 UTC
Same here with
x11-drivers/nvidia-drivers-340.101-r1
sys-kernel/gentoo-sources-4.9.3
Comment 8 Christian Bricart 2017-01-27 18:49:17 UTC
I confirm the patch fixes the issue.

successfully running =x11-drivers/nvidia-drivers-340.101-r1 on =sys-kernel/gentoo-sources-4.9.6 currently
Comment 9 Kamen Dokov 2017-02-04 16:43:17 UTC
(In reply to Christian Bricart from comment #8)
> I confirm the patch fixes the issue.
> 
> successfully running =x11-drivers/nvidia-drivers-340.101-r1 on
> =sys-kernel/gentoo-sources-4.9.6 currently

Can you please upload the ebuild?
I suck at writing ebuilds!
Thank you!
Comment 10 bugs.gentoo.org 2017-02-04 16:50:55 UTC
(In reply to Kamen Dokov from comment #9)
> Can you please upload the ebuild?
> I suck at writing ebuilds!
> Thank you!
Just use eapply_user mechanism with patch provided in attachments https://wiki.gentoo.org/wiki//etc/portage/patches
Comment 11 Kamen Dokov 2017-02-05 20:12:18 UTC
(In reply to bugs.gentoo.org from comment #10)
> (In reply to Kamen Dokov from comment #9)
> > Can you please upload the ebuild?
> > I suck at writing ebuilds!
> > Thank you!
> Just use eapply_user mechanism with patch provided in attachments
> https://wiki.gentoo.org/wiki//etc/portage/patches

Great, thank you!
Comment 12 Marcel Pennewiß 2017-02-06 23:21:10 UTC
The patch fixes the issue running x11-drivers/nvidia-drivers-340.101 on sys-kernel/gentoo-sources-4.9.6. Thx!
Comment 13 Paul Healy 2017-02-10 10:51:48 UTC
Thanks - also confirmed working with: aufs-sources-4.9.6 (and the patched nvidia driver)

Previous to the patch, dmesg had:

[   10.486983] Error: Driver 'nvidia' is already registered, aborting...
[   10.486983] NVRM: DRM init failed
...
Comment 14 Alice Ferrazzi Gentoo Infrastructure gentoo-dev 2017-02-12 08:34:44 UTC
*** Bug 608264 has been marked as a duplicate of this bug. ***
Comment 15 bugs.gentoo.org 2017-02-15 12:40:43 UTC
The new nvidia-drivers-340.102 still have this bug. The patch still can fix it.
Tested on sys-kernel/gentoo-sources-4.9.9
Comment 16 orionbelt2 2017-03-22 11:12:06 UTC
The bug still persists for x11-drivers/nvidia-drivers-340.102 in combination with sys-kernel/gentoo-sources-4.9.6-r1. If the patch can fix it (Comment 15), is there a reason it has not yet been applied?
Comment 17 Michael Palimaka (kensington) gentoo-dev 2017-03-23 09:18:34 UTC
(In reply to orionbelt2 from comment #16)
> The bug still persists for x11-drivers/nvidia-drivers-340.102 in combination
> with sys-kernel/gentoo-sources-4.9.6-r1. If the patch can fix it (Comment
> 15), is there a reason it has not yet been applied?

I believe it's the maintainer's policy not to apply patches to address kernel compatibility issues as this is often a moving target.
Comment 18 orionbelt2 2017-03-23 10:51:45 UTC
Does this mean that we must keep using an older and potentially unsafe kernel rather than bothering to apply the same patch until the day when Nvidia deigns to issue a fix to its driver?
Comment 19 Jeroen Roovers (RETIRED) gentoo-dev 2017-03-23 12:23:53 UTC
(In reply to orionbelt2 from comment #18)
> Does this mean that we must keep using an older and potentially unsafe
> kernel rather than bothering to apply the same patch until the day when
> Nvidia deigns to issue a fix to its driver?

Yes. Remember that gesture Linus Torvalds made toward Nvidia a few years ago?
Comment 20 orionbelt2 2017-03-23 12:34:52 UTC
I do remember Linus' gesture, but in this case we seem to worsen our situation by self-imposing policies like "do not apply known patches to address kernel compatibility issues" for reasons that escape me: What does "moving target" mean? Aren't all packages "moving targets"?

Granted, i could figure out how to apply the patch by myself (haven't had to do it so far), and so could all other affected users, but wouldn't it be more economical if it were done at a single location (the Gentoo repository) and by the capable hands of our beloved Gentoo developers? :-)
Comment 21 Shiba 2017-03-23 13:41:12 UTC
If you really don't want to fix this, since both gentoo-sources-4.9.16 and nvidia-drivers-340.101 are flagged stable, I believe you should at least put a ewarn in the ebuild stating that nvidia-drivers is broken with 4.9, the same as you do with the warning for >=4.10. As the things are right now I can't see how this can be considered a "stable" worthy situation.
Comment 22 Derrier Dominique 2017-04-03 01:28:31 UTC
Hi,

This patch also work for:
sys-kernel/aufs-sources-4.9.18
x11-drivers/nvidia-drivers-340.102

PS, nouveau driver crash/hang for my old G200, I just rollbacked to nvidia-drivers.
Comment 23 Jeroen Roovers (RETIRED) gentoo-dev 2017-06-03 13:50:15 UTC
*** Bug 619114 has been marked as a duplicate of this bug. ***
Comment 24 Octavian 2017-09-28 20:52:31 UTC
For completeness :

Driver version =x11-drivers/nvidia-drivers-340.104 does not require the patch anymore
Comment 25 orionbelt2 2019-04-06 04:23:27 UTC
Octavian, thanks for the heads-up. For some reason i do not recall ever receiving an email notification about your posting even though my email is in the cc list of this bug...

Does anyone know whether patching is needed (for x11-drivers/nvidia-drivers-340.x) for the most recent stable kernel (4.19.x)? Did nvidia finally do what they had to do so that no patching will be needed until the next kernel API change? What about the 5.x kernel series, for that matter?
Comment 26 Jeroen Roovers (RETIRED) gentoo-dev 2019-04-09 19:37:23 UTC
*** Bug 682910 has been marked as a duplicate of this bug. ***