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...
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: David Seifert
Depends on:
Reported: 2016-12-27 06:58 UTC by Christopher Head
Modified: 2021-03-08 06:30 UTC (History)
2 users (show)

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

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

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

    location: /var/cache/repos/steam
    sync-type: git
    masters: gentoo
    priority: 1

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

    location: /var/cache/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://
    priority: 3

    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_LICENSE="* -@EULA AdobeFlash-11.x dlj-1.1 Google-TOS Oracle-BCLA-JavaSE"
CFLAGS="-O2 -pipe -march=native -fomit-frame-pointer"
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"
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"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="--jobs 2 --load-average 4"
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"
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"
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 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 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 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 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 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 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 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.