Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 603818 - =x11-drivers/nvidia-drivers-440.100-r2 with =sys-kernel/gentoo-sources-5.4.72 - KMS helpers missing(?)
Summary: =x11-drivers/nvidia-drivers-440.100-r2 with =sys-kernel/gentoo-sources-5.4.72...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: David Seifert
URL: https://devtalk.nvidia.com/default/to...
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2016-12-27 06:58 UTC by Christopher Head
Modified: 2022-11-21 07:10 UTC (History)
3 users (show)

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


Attachments
Xorg.0.log booting with CONFIG_DRM=n and no Device section in xorg.conf (Xorg.0.log,5.53 KB, text/plain)
2021-03-07 18:39 UTC, Christopher Head
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Christopher Head 2016-12-27 06:58:51 UTC
NVidia drivers 375.26 uses the KMS API from the kernel. As of gentoo-sources-4.4.39 at least, having CONFIG_DRM enabled but no specific cards enabled (because I don’t have any cards that need in-tree kernel drivers) results in CONFIG_DRM_KMS_HELPER=n, and that option is not user-configurable through menuconfig. Having that option clear results in module load failures due to missing symbols.

The URL I will provide has some more information. Hacking Kconfig to forcefully enable CONFIG_DRM_KMS_HELPER, as recommended in comment 6 at that URL, makes the drivers work fine.
Comment 1 Christopher Head 2016-12-27 06:59:36 UTC
$ emerge --info
Portage 2.3.0 (python 3.4.5-final-0, default/linux/amd64/13.0, gcc-4.9.4, glibc-2.22-r4, 4.4.39-gentoo x86_64)
=================================================================
System uname: Linux-4.4.39-gentoo-x86_64-Intel-R-_Core-TM-_i7-3770_CPU_@_3.40GHz-with-gentoo-2.3
KiB Mem:    16421368 total,  10217460 free
KiB Swap:   16777212 total,  16777212 free
Timestamp of repository gentoo: Sun, 25 Dec 2016 18:15:01 +0000
sh bash 4.3_p48-r1
ld GNU ld (Gentoo 2.25.1 p1.1) 2.25.1
app-shells/bash:          4.3_p48-r1::gentoo
dev-java/java-config:     2.2.0-r3::gentoo
dev-lang/perl:            5.22.3_rc4::gentoo
dev-lang/python:          2.7.12::gentoo, 3.4.5::gentoo
dev-util/cmake:           3.6.3::gentoo
dev-util/pkgconfig:       0.28-r2::gentoo
sys-apps/baselayout:      2.3::gentoo
sys-apps/openrc:          0.22.4::gentoo
sys-apps/sandbox:         2.10-r1::gentoo
sys-devel/autoconf:       2.13::gentoo, 2.69::gentoo
sys-devel/automake:       1.11.6-r1::gentoo, 1.14.1::gentoo, 1.15::gentoo
sys-devel/binutils:       2.25.1-r1::gentoo
sys-devel/gcc:            4.9.4::gentoo
sys-devel/gcc-config:     1.7.3::gentoo
sys-devel/libtool:        2.4.6-r2::gentoo
sys-devel/make:           4.1-r1::gentoo
sys-kernel/linux-headers: 4.4::gentoo (virtual/os-headers)
sys-libs/glibc:           2.22-r4::gentoo
Repositories:

steam-overlay
    location: /var/cache/repos/steam
    sync-type: git
    sync-uri: https://github.com/anyc/steam-overlay.git
    masters: gentoo
    priority: 1

gentoo-dev
    location: /var/cache/repos/gentoo-dev
    priority: 2

gentoo
    location: /var/cache/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.ca.gentoo.org/gentoo-portage
    priority: 3

hawk777
    location: /var/cache/repos/hawk777
    masters: gentoo
    priority: 4

Installed sets: @admin, @android, @cups, @datacenter, @desktop, @emulation, @fonts, @games, @lisp, @magicalgame, @media, @minetest, @misc, @net, @office, @vim, @web
ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA AdobeFlash-11.x dlj-1.1 Google-TOS Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--jobs 2 --load-average 4 --with-bdeps y --complete-graph y -1"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fakeroot fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms sign strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="ftp://gentoo.arcticnetwork.ca/pub/gentoo ftp://mirror.csclub.uwaterloo.ca/gentoo-distfiles http://gentoo.osuosl.org/"
LANG="en_CA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--jobs 2 --load-average 4"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 archive bzip2 cairo caps cdda cddb cdinstall cdio cli css cups cxx dbus double-precision dri dvd faac faad fat ffmpeg fftw flac fontconfig fortran gcrypt gimp gnutls gtk hou iconv icu idn imap ipv6 java joystick laptop libnotify libsamplerate lm_sensors mad mbox mikmod mmx mmxext modules mp3 mpeg multilib multiuser ncurses nls nntp nowin nptl ntp offensive ogg opengl openmp pam pdf plotutils qt3support readline scanner seccomp session sou spell sse sse2 ssl startup-notification stream svg symlink taglib theora threads thunar truetype udev unicode usb vaapi vdpau videos vim-syntax vorbis win32codecs xattr xetex xft xinerama xscreensaver xulrunner xv xvid xvmc zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx mmx mmxext popcnt sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="evdev" KERNEL="linux" L10N="en en-CA" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LINGUAS="en en_CA" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_4" QEMU_SOFTMMU_TARGETS="i386 x86_64" RUBY_TARGETS="ruby21" SANE_BACKENDS="plustek" USERLAND="GNU" VIDEO_CARDS="nvidia" XFCE_PLUGINS="logout menu" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON
Comment 2 Christopher Head 2016-12-27 07:10:21 UTC
I’m not entirely sure why things used to work. Either it’s something that changed from kernel 4.4.26 (the old stable) to 4.4.39 (though I also didn’t have CONFIG_DRM_KMS_HELPER activated there) or something that changed from nvidia-drivers 361.28 (the old stable) to 375.26, as I got those at the same time.
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2016-12-28 17:59:34 UTC
Could you describe the problem in a single sentence?
Comment 4 Christopher Head 2016-12-29 18:50:38 UTC
Sure. TLDR: Install gentoo-sources-4.4.39, build with CONFIG_DRM=y, install nvidia-drivers-375.26, X fails to start, dmesg says missing symbols; follow the workaround in the URL to force CONFIG_DRM_KMS_HELPER=y, X starts, no more missing symbol messages.
Comment 5 David Seifert gentoo-dev 2020-11-18 18:45:36 UTC
Closing due to inactivity
Comment 6 Christopher Head 2020-11-22 18:23:19 UTC
I haven’t been updating the version numbers, but nothing has changed and this problem still exists: nvidia-drivers-440.100-r2 requires CONFIG_DRM_KMS_HELPERS to be set (it even has an ewarn message when you install it via the CONFIG_CHECK variable), yet gentoo-sources-5.4.72 does not have this option as a user-selectable option in menuconfig.
Comment 7 Ionen Wolkens gentoo-dev 2021-03-06 19:23:31 UTC
Will be adding a error message as to how to set this. For example you can set CONFIG_DRM_FBDEV_EMULATION instead and it'll side-enable it. Many other options but that one is the smallest.

Also it's not always required, I personally have DRM and DRM_KMS_HELPERS disabled and nvidia-drm loads fine. This is mostly for when want to use nvidia-drm.modeset=1 (typically for wayland).
Comment 8 Ionen Wolkens gentoo-dev 2021-03-07 07:20:57 UTC
While testing I did find something.

If both DRM and DRM_KMS_HELPER are unset there's no issue, e.g. what I had.

If you enable DRM, the kernel enables DRM_FBDEV_EMULATION by default (and thus KMS_HELPER) so that's fine too.

If you enable DRM but disable DRM_FBDEV_EMULATION you now only have CONFIG_DRM, and that's causing build failures in modpost due to missing symbols (at least on 460.56). I assume related to your issues.

I'm thinking to patch the test to ignore CONFIG_DRM if KMS_HELPER is not set and remove config check for DRM, but I'll look into this further.
Comment 9 Christopher Head 2021-03-07 18:14:09 UTC
Ah, yes, you’re right. I am able to run with CONFIG_DRM=n. I previously thought that was impossible. That was partly because the ebuild warns me that that config value is needed; actually it isn’t, so that should probably change, which I think is what you’re suggesting doing. However, it is also partly because I needed to add a Device section to my xorg.conf; it worked fine without one when CONFIG_DRM=y, but with CONFIG_DRM=n it could not find any cards until I added a Device section—somehow the presence of CONFIG_DRM=y allowed the nvidia driver to be autodetected. I haven’t done anything with Wayland; I am only running xorg-server here.

I had CONFIG_DRM_FBDEV_EMULATION=n because I wasn’t using it; this is an EFI system so my fbdef is simplefb instead.

All told, I’m happy with my new configuration, so I think this bug can be reduced to removing the config check warning (and possibly mentioning that with CONFIG_DRM=n you have to write some text in xorg.conf, but maybe that is unnecessary).
Comment 10 Ionen Wolkens gentoo-dev 2021-03-07 18:33:12 UTC
It should work with defaults either way (or at least on common setups), if you have your own xorg configs then I can't say.

Also yes, I'm removing CONFIG_DRM check and with fix it'll no longer fail in a situation where you have DRM set but KMS_HELPER isn't.
Comment 11 Ionen Wolkens gentoo-dev 2021-03-07 18:35:08 UTC
(In reply to Ionen Wolkens from comment #10)
> It should work with defaults either way (or at least on common setups), if
> you have your own xorg configs then I can't say.
Or wait, I may need to recheck that, been testing more with a generic kernel lately.
Comment 12 Christopher Head 2021-03-07 18:38:31 UTC
(In reply to Ionen Wolkens from comment #11)
> (In reply to Ionen Wolkens from comment #10)
> > It should work with defaults either way (or at least on common setups), if
> > you have your own xorg configs then I can't say.
> Or wait, I may need to recheck that, been testing more with a generic kernel
> lately.

It didn’t for me. I did not have any xorg config related to video cards for years. With CONFIG_DRM=y that worked fine just autodetecting things (and it was definitely using nvidia-drivers; I don’t have any other drivers installed, and even if I did, I would quickly notice the terrible performance in games), but with CONFIG_DRM=n X would not start (I’ll attach my Xorg.0.log in case it’s of interest to you). I had to add a config file with a Device section to get X to start with CONFIG_DRM=n.
Comment 13 Christopher Head 2021-03-07 18:39:07 UTC
Created attachment 689853 [details]
Xorg.0.log booting with CONFIG_DRM=n and no Device section in xorg.conf
Comment 14 Ionen Wolkens gentoo-dev 2021-03-07 18:41:06 UTC
Yes it's possible that's why I corrected myself, auto-detection is based on nvidia-drm outputclass, I'll have a look later.

But at best it'll just mean giving a better error message so people don't wonder what happened if they're not setting requested options.
Comment 15 Ionen Wolkens gentoo-dev 2021-03-08 06:20:32 UTC
So yes, you were right and can reproduce.

So to resume I'll:
1. remove CONFIG_DRM message
2. if config CONFIG_DRM is set but KMS_HELPER isn't, act as if DRM is not set (to avoid build failures or symbol issues)
3. if DRM_KMS_HELPER is not set, display a custom warning message about auto-detection by Xorg, nvidia-drm.modeset=1, and briefly explain how to set it in menuconfig.

I don't intend to make it forced so people with their own config (also described on the wiki, or with the questionable nvidia-xconfig), don't need to set this for nothing.

Hopefully that'll reasonably cover everything.
Comment 16 Ionen Wolkens gentoo-dev 2021-03-08 06:30:07 UTC
(In reply to Ionen Wolkens from comment #15)
> 3. if DRM_KMS_HELPER is not set, display a custom warning message [...]
And a different message for 390.xx because that would cause the glx workaround to not work as it uses the outputclass check.

Looking back that explains why some users had problems with the workaround not working.
Comment 17 Larry the Git Cow gentoo-dev 2021-03-21 15:53:30 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26146d1510fd678538b7d02400c1eb8e66e20212

commit 26146d1510fd678538b7d02400c1eb8e66e20212
Author:     Ionen Wolkens <sudinave@gmail.com>
AuthorDate: 2021-03-21 15:52:10 +0000
Commit:     David Seifert <soap@gentoo.org>
CommitDate: 2021-03-21 15:52:10 +0000

    x11-drivers/nvidia-drivers: bump to 460.67 with refactored ebuild
    
    ebuild carries a lot of history and, rather than cleanups, it needed
    something closer to a rewrite.
    
    Bugfixes:
    - Removed all udev rules to solve long standing issues (bug #454740)
    - Install libraries with no X11 dependencies with USE=-X,
      notably for headless OpenCL/CUDA (bug #561706)
    - Install systemd unit for persistenced + nvpd user (bug #591638)
    - Add custom error message for DRM_KMS_HELPER and ensure driver
      doesn't attempt building DRM support without it (bug #603818)
    - Warn about AMD SME if enabled by default (bug #652408)
    - Distribute extra sources to lift RESTRICT="bindist mirror", the
      nvidia-driver.eclass is no longer used (bug #732702)
    - Build modprobe and persistenced from source (bug #747145)
    - Use system locations for vulkan icd/layers (bug #749600)
    
    Others:
    - Dropped IUSE=compat/multilib/kms/uvm/wayland
      > compat: was for non-GLVND variants and currently a no-op
      > multilib: obsolete, abi_x86_32 does all that's needed
      > kms/uvm: modules are loaded by nvidia-modprobe as-needed and
        there's not much sense in skipping installation. Will also save
        OpenCL/CUDA packages from having to depend on [uvm]
      > wayland: library is provided by gui-libs/egl-wayland instead which
        now also provides pkgconfig files and can be a newer version.
        optfeature warning was added for awareness.
    - Dropped REQUIRED_USE, all USE can now be used independently, e.g.
      now possible to get libXNVCtrl.a (static-libs) without the
      deps-heavy USE=tools
    - Dropped locale patch, the offending code it was meant to fix is gone.
    - Dropped linker patch, uses right linker even with -native-symlinks.
    - Added modprobe.d .conf to blacklist nouveau by default.
    - Patched nvidia-modprobe to respect nvidia.conf's permissions when
      creating uvm devices, was previously created as world read-write.
    - No longer installing libOpenCL.so loader (not needed to use OpenCL,
      was used by the no longer available eselect-opencl).
    - nvidia-persistenced init script simplified and updated for nvpd user.
    - nvidia-smi init script removed (all it did was query cards every 300
      seconds), mentioned behavior is no longer observable (fan scales
      normally without X) and it wasn't intended for this purpose.
    - Removed I2C_NVIDIA_GPU check as it caused unnecessary noise for
      gentoo-kernel-bin users (built as module), and being a bad thing
      even if loaded is questionable.
    - Attempt to reduce message noise. The only fatal CONFIG_CHECK is
      fairly rare so there's little reason to check twice with pkg_pretend.
    - ... but added new conditional messages to explain important things
      often seen as common sense but that a new user likely won't know.
    - Replaced the nvidia-driver.eclass legacy test with a compact version
      that reads supported-gpus.json (usable on >450).
    - More strict deps, some may sound strange but nvidia-settings only
      use headers for some of these (dbus/Xrandr/Xv/vdpau).
      > X? libs kept separate as it's the only one needing multilib deps.
      > pax-utils now unconditional for scanelf as libraries are always
        installed. Alternatively could've generated those, but prefer to
        leave it easier to maintain for future generations.
      > virtual/opencl removed, no sense in the drivers depending on this
        and it's instead applications using opencl that should.
      > Added MODULES_OPTIONAL_USE="driver" to handle linux-mod deps
    - Added MIT license for persistenced
    - Added ZLIB license for supported-gpus.json
    - NV_KERNEL_MAX (previously NV_KV_MAX_PLUS) set to be <=5.11 form
      rather than <5.12 given that often confused users thinking it meant
      5.12 support from quick looks.
    - arm64 support "should" work but runtime untested
    - And a long list of cleanups that "hopefully" won't cause new issues.
    
    Closes: https://bugs.gentoo.org/454740
    Closes: https://bugs.gentoo.org/561706
    Closes: https://bugs.gentoo.org/591638
    Closes: https://bugs.gentoo.org/603818
    Closes: https://bugs.gentoo.org/652408
    Closes: https://bugs.gentoo.org/732702
    Closes: https://bugs.gentoo.org/747145
    Closes: https://bugs.gentoo.org/749600
    Signed-off-by: Ionen Wolkens <sudinave@gmail.com>
    Signed-off-by: David Seifert <soap@gentoo.org>

 x11-drivers/nvidia-drivers/Manifest                |   7 +
 .../files/nvidia-blacklist-nouveau.conf            |   3 +
 .../files/nvidia-modprobe-390.141-uvm-perms.patch  |  12 +
 .../nvidia-drivers/files/nvidia-persistenced.confd |   7 +
 .../nvidia-drivers/files/nvidia-persistenced.initd |  12 +
 .../nvidia-drivers/nvidia-drivers-460.67.ebuild    | 391 +++++++++++++++++++++
 6 files changed, 432 insertions(+)