Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 824594 - x11-drivers/nvidia-drivers: X login does not start with kernel 5.14.19 or 5.15.3 (need to enable CONFIG_DRM_KMS_HELPER)
Summary: x11-drivers/nvidia-drivers: X login does not start with kernel 5.14.19 or 5.1...
Status: RESOLVED CANTFIX
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal with 1 vote (vote)
Assignee: Ionen Wolkens
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-11-18 22:10 UTC by Chris Smith
Modified: 2022-01-16 05:06 UTC (History)
2 users (show)

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


Attachments
boot log 5.15.3 (fails) (5.15.3_boot.gz,24.43 KB, application/gzip)
2021-11-18 22:36 UTC, Chris Smith
Details
5.15.2 boot log (success) (5.15.2_boot.gz,28.40 KB, application/gzip)
2021-11-18 22:36 UTC, Chris Smith
Details
5.15.3 boot log (fails) (5.15.3_boot.gz,23.69 KB, application/gzip)
2021-11-18 23:22 UTC, Chris Smith
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Smith 2021-11-18 22:10:05 UTC
Main console hangs at start and X login screen does not appear.
Worked fine with 5.14.18 but failed after upgrading to 5.14.19. After that I tried the latest (at the time) 5.15.2 and had no issues, but now attempting to upgrade to 5.15.3 the same problem I had with 5.14.19 appears.

Maybe there's a patchset common to both of the failing versions.

Reproducible: Always

Actual Results:  
One difference I notice on boot was a longer pause waiting for the network to be configured.
Last message on main console was about notifying nfs users of the restart.
I can login to an alternate console (F2) and read logs, etc. No errors are logged.


$ emerge --info
Portage 3.0.28 (python 3.9.9-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-11.2.0, glibc-2.34-r2, 5.15.2-gentoo x86_64)
=================================================================
System uname: Linux-5.15.2-gentoo-x86_64-AMD_Ryzen_9_5900X_12-Core_Processor-with-glibc2.34
KiB Mem:    65874556 total,  62244268 free
KiB Swap:    6291452 total,   6291452 free
Timestamp of repository gentoo: Thu, 18 Nov 2021 20:21:34 +0000
Head commit of repository gentoo: ab14c9b51066240f584f190270b698b1ecb071b4

Head commit of repository audio-overlay: 6a99adb585566300b6c6a47c8253add4ee31b9f2

sh bash 5.1_p12
ld GNU ld (Gentoo 2.37_p1 p1) 2.37
app-shells/bash:          5.1_p12::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r5::gentoo
dev-lang/python:          2.7.18_p13::gentoo, 3.8.12_p1::gentoo, 3.9.9::gentoo, 3.10.0_p1::gentoo
dev-lang/rust:            1.56.1::gentoo
dev-util/cmake:           3.21.4::gentoo
sys-apps/baselayout:      2.8::gentoo
sys-apps/sandbox:         2.29::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.5::gentoo
sys-devel/binutils:       2.37_p1-r1::gentoo
sys-devel/gcc:            11.2.0::gentoo
sys-devel/gcc-config:     2.5::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.15::gentoo (virtual/os-headers)
sys-libs/glibc:           2.34-r2::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000

audio-overlay
    location: /var/db/repos/audio-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-audio/audio-overlay.git
    masters: gentoo

local
    location: /var/db/repos/local
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CC="gcc"
CFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /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"
CXX="g++"
CXXFLAGS="-O2 -march=native -fomit-frame-pointer -pipe"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--with-bdeps y --autounmask-keep-masks"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs clean-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O2 -Wl,--as-needed"
LINGUAS="en_US en"
MAKEOPTS="-j7"
PKGDIR="/var/cache/binpkgs"
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 aalib acl acpi activities alsa amd64 amr apache2 audiofile bash-completion bluray branding btrfs bzip2 cairo caps cdaudio cdda cddb cdparanoia cdr cdrdao chm chromecast cleartype cli corefonts crypt cups curl dbus declarative djvu dri dssi dts dv dvb dvd dvdr ebook egl emboss encode exif fam fdk ffmpeg flac fortran gdbm gif gles2 gmp google gphoto2 gpm gstreamer gtk gtk3 gui iconv icu imagemagick imap imlib introspection ipv6 jack java jpeg jpeg2k kde kipi kpathsea kvm kwallet ladspa lame lash lcms libffi libglvnd libinput libnotify libtirpc linguas_en_US lm-sensors lv2 lzma mad marble midi mmap mng mozilla mp3 mp4 mpeg mtp multimedia musicbrainz ncurses network nls nodrm nptl nsplugin nvenc nvidia ofx ogg opencl openexr opengl openmp opus pam pango pcre pdf plasma png policykit ppds pulseaudio qemu qml qt5 readline rtmp sasl scanner sdl seccomp semantic-desktop slp smp sndfile speex spell split-usr ssl startup-notification subversion svg systemd theora threads tiff tk transparency truetype type1 udev udisks unicode unwind upower usb v4l vaapi vcd vdpau vim-syntax vorbis vpx vst wav wavpack wayland webp widgets wmf wxwidgets x264 x265 xattr xcb xcomposite xine xkb xml xscreensaver xv xvid xvmc zlib" ABI_X86="64" ADA_TARGET="gnat_2019" 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="karbon sheets words" CAMERAS="*" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="libinput wacom" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="autoindex fancyindex fastcgi gzip" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="(-python2_7) (-python3_6) (-python3_7) (-python3_8) python3_9" QEMU_SOFTMMU_TARGETS="x86_64" QEMU_USER_TARGETS="x86_64" RUBY_TARGETS="(-ruby23) (-ruby24) (-ruby25) (-ruby26) (-ruby27) ruby30" SANE_BACKENDS="epson epson2" USERLAND="GNU" VIDEO_CARDS="nvidia nouveau" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CPPFLAGS, CTARGET, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 Chris Smith 2021-11-18 22:34:09 UTC
It's sddm that doesn't start but the problem appears to be much earlier.
Appears to be an nfs issue:as I get:
rpc.mountd[764]: Caught signal 15, un-registering and exiting.
systemd[1]: rpc-statd.service: Deactivated successfully.
Comment 2 Chris Smith 2021-11-18 22:36:07 UTC
Created attachment 752682 [details]
boot log 5.15.3 (fails)
Comment 3 Chris Smith 2021-11-18 22:36:35 UTC
Created attachment 752686 [details]
5.15.2 boot log (success)
Comment 4 Chris Smith 2021-11-18 23:22:36 UTC
Created attachment 752690 [details]
5.15.3 boot log (fails)
Comment 5 Chris Smith 2021-11-18 23:23:32 UTC
I think the rpc thing is a red herring - that was on shutdown.
New boot log of the failing kernel.
Comment 6 Mike Pagano gentoo-dev 2021-11-18 23:41:43 UTC
(In reply to Chris Smith from comment #5)
> I think the rpc thing is a red herring - that was on shutdown.
> New boot log of the failing kernel.

did you mean to attach something here?
Comment 7 Chris Smith 2021-11-18 23:48:01 UTC
(In reply to Mike Pagano from comment #6)
> (In reply to Chris Smith from comment #5)
> > I think the rpc thing is a red herring - that was on shutdown.
> > New boot log of the failing kernel.
> 
> did you mean to attach something here?

I did, a replacement for the previous 5.15.3 failing boot log.
Comment 8 Ionen Wolkens gentoo-dev 2021-11-19 05:44:19 UTC
>nvidia_drm: unknown parameter 'modeset' ignored

This would happen if CONFIG_DRM_KMS_HELPER is not set in the kernel's .config, nvidia-drivers build.log is likely has:

 *   CONFIG_DRM_KMS_HELPER: is not set but needed for Xorg auto-detection
 *      of drivers (no custom config), and for wayland / nvidia-drm.modeset=1.
 *      Cannot be directly selected in the kernel's menuconfig, so enable
 *      options such as CONFIG_DRM_FBDEV_EMULATION instead.

Unfortunately the above instructions may not work anymore.

I believe it's due to this change in 5.15.3 which may have deselected it if have no other DRM selected (like amdgpu)

 config DRM_FBDEV_EMULATION
 	bool "Enable legacy fbdev support for your modesetting driver"
-	depends on DRM
-	depends on FB=y || FB=DRM
-	select DRM_KMS_HELPER
+	depends on DRM_KMS_HELPER
+	depends on FB=y || FB=DRM_KMS_HELPER

Honestly not quite sure what's a sane way to suggest enabling KMS_HELPER (not selectable on its own), not an issue on generic kernels but this been quite annoying for custom minimal ones.

Being unset will prevent auto-detection and the Xorg nvidia module won't be loaded.
Comment 9 Ionen Wolkens gentoo-dev 2021-11-19 06:19:17 UTC
There may be more to this too, I think may also have messed with nvidia's detection. Need to look more closely at this.

Don't be surprised if enabling it still doesn't work.
Comment 10 Larry the Git Cow gentoo-dev 2021-11-19 07:04:05 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=14a3189a2e07e59d2c2a28a7348aff842343e4c2

commit 14a3189a2e07e59d2c2a28a7348aff842343e4c2
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2021-11-19 06:07:59 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2021-11-19 07:03:13 +0000

    x11-drivers/nvidia-drivers: update KMS_HELPER error message and sed
    
    Error message updated to help users enable it on kernel 5.15.3+
    which no longer selects KMS_HELPER with CONFIG_DRM_FBDEV_EMULATION.
    
    This may unfortunately cause a poor surprise (failing Xorg) to users
    that did not notice this newly appearing message with minimal kernels
    and didn't have a custom xorg.conf forcing nvidia.
    
    Also modified sed to ensure nvidia-drm is properly built with support
    if KMS_HELPER is a module and DRM is not (revbump latest arch/~arch
    for this).
    
    Bug: https://bugs.gentoo.org/824594
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 x11-drivers/nvidia-drivers/nvidia-drivers-390.144-r1.ebuild    | 10 ++++++----
 x11-drivers/nvidia-drivers/nvidia-drivers-460.91.03-r1.ebuild  |  8 +++++---
 x11-drivers/nvidia-drivers/nvidia-drivers-470.62.12.ebuild     |  8 +++++---
 x11-drivers/nvidia-drivers/nvidia-drivers-470.82.00.ebuild     |  8 +++++---
 ...a-drivers-470.86.ebuild => nvidia-drivers-470.86-r1.ebuild} |  8 +++++---
 ...rivers-495.44-r1.ebuild => nvidia-drivers-495.44-r2.ebuild} |  8 +++++---
 x11-drivers/nvidia-drivers/nvidia-drivers-495.44.ebuild        |  8 +++++---
 7 files changed, 36 insertions(+), 22 deletions(-)
Comment 11 Ionen Wolkens gentoo-dev 2021-11-19 07:20:28 UTC
Guess there's still a chance the issue was something else (need confirmation), but I'll take it as a nvidia-drivers issue for now given it looks very likely for the sddm part.

Not that there's really anything else I think I can do about this, I'll just leave the bug open for reference for a while and hope people notice the ebuild message.

As mentioned in the commit, can set something like CONFIG_DRM_AMDGPU=m, DRM_I915=y or even DRM_NOUVEAU=m (nouveau is fine as long it's a module and not builtin, can be useful to have around as fallback) so they select the DRM_KMS_HELPER that can't be directly selected.

DRM_SIMPLEDRM may sound nice, but it's known to cause other issues and should be left disabled (the ebuild warns about this if found enabled).

Alternatively, can create a xorg.conf that force-loads nvidia as the driver. Although KMS_HELPER is still needed for wayland, without KMS_HELPER the entire nvidia-drm module is just a stub.
Comment 12 Chris Smith 2021-11-19 15:28:14 UTC
The nvidia driver update has solved the issue.
Note that I do build nouveau as a backup, although it's blacklisted.
Comment 13 Ionen Wolkens gentoo-dev 2021-11-19 15:39:50 UTC
(In reply to Chris Smith from comment #12)
> The nvidia driver update has solved the issue.
> Note that I do build nouveau as a backup, although it's blacklisted.
Nice to hear it works.

If already had nouveau then I guess misdetection I mentioned in comment #9 is what caused issues for you then (did add a small fix for that).
Comment 14 Ionen Wolkens gentoo-dev 2021-11-23 22:28:56 UTC
Looks like FBDEV_EMULATION once again selects KMS_HELPER in 5.15.4 so this should reduce amount of surprises and think can go ahead and close this.

May possibly adjust the message again but will leave it alone for now as it's more fail-proof.
Comment 15 Ionen Wolkens gentoo-dev 2022-01-16 05:06:21 UTC
(In reply to Ionen Wolkens from comment #14)
> Looks like FBDEV_EMULATION once again selects KMS_HELPER in 5.15.4 so this
> should reduce amount of surprises and think can go ahead and close this.
> 
> May possibly adjust the message again but will leave it alone for now as
> it's more fail-proof.
And yes, leaving it alone given 5.16.x changed things around again. Suggesting FBDEV_EMULATION doesn't seem viable anymore.

Guess the issue is still kind of there, but mitigated by the error message. I don't think much else I can do.