Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 803209 - x11-drivers/nvidia-drivers-470.57.02[wayland] Reverse Prime stops working
Summary: x11-drivers/nvidia-drivers-470.57.02[wayland] Reverse Prime stops working
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Ionen Wolkens
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-21 11:04 UTC by nvaert1986
Modified: 2021-07-21 19:44 UTC (History)
2 users (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description nvaert1986 2021-07-21 11:04:48 UTC
After upgrading to x11-drivers/nvidia-drivers-470.57.02 I no longer have any output on my external monitors on my Lenovo ThinkPad P52 laptop that are hardwired to the NVIDIA GPU. Reverting back to x11-drivers/nvidia-drivers-460.84 resolves this issue. I'm using gnome-base/gdm-40.0-r1.

Tried using both xorg-x11 and wayland and compiled x11-drivers/nvidia-drivers-470.57.02 with the wayland USE flag set.

Additional information:
- With x11-drivers/nvidia-drivers-470.57.02 I had display output on all monitors on the console, but not in xorg-x11
- With x11-drivers/nvidia-drivers-460.84 I had only had display output on my laptop screen on the console and display output on all monitors in xorg-x11 (which it was and always has been like)

Reproducible: Always

Steps to Reproduce:
1.Run emerge x11-drivers/nvidia-drivers-470.57.02 (with the wayland USE flag set)
2.Reboot
Actual Results:  
Reverse prime no longer working

Expected Results:  
Both display output on my internal graphics and on the nvidia graphics chip.

Portage 3.0.20 (python 3.9.5-final-0, default/linux/amd64/17.1/systemd, gcc-10.3.0, glibc-2.33-r1, 5.12.9-gentoo x86_64)
=================================================================
System uname: Linux-5.12.9-gentoo-x86_64-Intel-R-_Core-TM-_i7-8750H_CPU_@_2.20GHz-with-glibc2.33
KiB Mem:    32529244 total,  24829048 free
KiB Swap:    6291452 total,   6291452 free
Timestamp of repository gentoo: Wed, 21 Jul 2021 06:00:01 +0000
Head commit of repository gentoo: 17b8829709e48037ecce75d4586c13cd511b3dd0
sh bash 5.1_p8
ld GNU ld (Gentoo 2.35.2 p1) 2.35.2
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0::gentoo
dev-lang/python:          2.7.18_p11::gentoo, 3.6.13_p5::gentoo, 3.7.10_p6::gentoo, 3.8.10_p2::gentoo, 3.9.5_p2::gentoo
dev-lang/rust:            1.52.1::gentoo
dev-util/cmake:           3.18.5::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.35.2::gentoo
sys-devel/gcc:            10.3.0-r2::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.12::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r1::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-metamanifest: no
    sync-rsync-extra-opts: 
    sync-rsync-verify-jobs: 1

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

vifino-overlay
    location: /var/lib/layman/vifino-overlay
    masters: gentoo
    priority: 50

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /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"
CXXFLAGS="-march=native -O2 -pipe -fomit-frame-pointer"
DISTDIR="/usr/portage/distfiles"
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="-march=native -O2 -pipe -fomit-frame-pointer"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-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="-march=native -O2 -pipe -fomit-frame-pointer"
GENTOO_MIRRORS="https://mirror.leaseweb.com/gentoo/ http://mirror.leaseweb.com/gentoo/ rsync://mirror.leaseweb.com/gentoo/ https://ftp.snt.utwente.nl/pub/os/linux/gentoo http://ftp.snt.utwente.nl/pub/os/linux/gentoo ftp://ftp.snt.utwente.nl/pub/os/linux/gentoo rsync://ftp.snt.utwente.nl/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j10"
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="7zip X accessibility acl acpi activities adns alsa amd64 archive atm audit ayatana bluetooth bluetooth-sound branding broadway bzip2 cairo caps chm cli colord crypt cryptsetup cups curl cxx dbus designer dri eds egl elfutils eps epub evdev exif fam ffmpeg flac fontconfig fonts fortran fuse gconf gdbm gdm geolocation gif git gles1 gles2 glib gmp gnome gnome-keyring gnome-online-accounts google gpm graphite gssapi gstreamer gtk gtk3 harfbuzz ibus iconv icu idn idna imlib inotify introspection iproute2 ipv6 javascript jpeg jpeg2k kerberos kinit lcms libevent libglvnd libidn2 libkms libnotify libproxy libsamplerate libtirpc libv4l lz4 lzma lzo mng modemmanager mono mp3 mtp multilib nautilus ncurses networkmanager nls nptl nsplugin oauth odbc ogg openconnect opengl openmp pam pbkdf2 pcap pcre pdf perl pkcs11 plymouth png policykit pulseaudio python qml rar raw readline samba sasl screensaver sdl seccomp sha2 share skey smartcard spell split-usr sqlite srp ssh ssl startup-notification svc systemd taglib tcpd telepathy theora tidy tiff truetype udev unicode upower urandom usb user-session uuid uvm v4l vaapi vala vdpau vorbis vulkan wayland webengine webkit widgets winbind xa xar xattr xcb xcomposite xinerama xml xps xvmc zeroconf zip zlib" ABI_X86="32 64" ADA_TARGET="gnat_2018" 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" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt sse sse2 sse3 ssse3 sse4_1 sse4_2" CURL_SSL="nss" 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="evdev keyboard libinput mouse" KERNEL="linux" L10N="en nl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="i965 intel nvidia iris" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

Output of xrandr with x11-drivers/nvidia-drivers-460.84
~ $ xrandr --listproviders 
Providers: number : 2
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting
Provider 1: id: 0x29e cap: 0x2, Sink Output crtcs: 4 outputs: 7 associated providers: 1 name:NVIDIA-G0

Output of xrandr with x11-drivers/nvidia-drivers-470.57.02
~ $ xrandr --listproviders 
Providers: number : 1
Provider 0: id: 0x43 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting

If you need any additional information, then please let me know.
Comment 1 Ionen Wolkens gentoo-dev 2021-07-21 11:23:14 UTC
The major change in this version is that in order to use wayland with nvidia-drivers, nvidia-drm.modeset=1 needs to be set -- so USE=wayland does this.

I did fear that it may cause issues for some more exotic setups though thus the postinst elog message to warn about this change when enabling wayland.

To confirm, try to #comment out this line in /etc/modprobe.d/nvidia.conf:

    options nvidia-drm modeset=1

As far as I'm aware, this option is also needed for PRIME offloading, but reverse PRIME may be a different deal. Like SLI, I may need to adjust the informational message to warn about reverse PRIME. Unsure if I want to disable this by default given it'll be impossible for wayland to work out of the box.

Unfortunately I don't have the right hardware to test this myself.
Comment 2 Ionen Wolkens gentoo-dev 2021-07-21 11:26:17 UTC
>I'm using gnome-base/gdm-40.0-r1
Oh!

I forgot about this, I believe gdm will default to wayland if this is set... are you sure you're starting a Xorg session?
Comment 3 Ionen Wolkens gentoo-dev 2021-07-21 11:29:30 UTC
(In reply to Ionen Wolkens from comment #2)
> >I'm using gnome-base/gdm-40.0-r1
> Oh!
> 
> I forgot about this, I believe gdm will default to wayland if this is set...
> are you sure you're starting a Xorg session?
i.e. I'd like to know if keeping this set is fine as long as explicitly request for gnome on Xorg
Comment 4 nvaert1986 2021-07-21 12:27:25 UTC
(In reply to Ionen Wolkens from comment #2)
> >I'm using gnome-base/gdm-40.0-r1
> Oh!
> 
> I forgot about this, I believe gdm will default to wayland if this is set...
> are you sure you're starting a Xorg session?

When I run the following command it always shows x11:
~ $ loginctl show-session 2 -p Type 
Type=x11
Comment 5 nvaert1986 2021-07-21 12:35:12 UTC
(In reply to Ionen Wolkens from comment #1)
> The major change in this version is that in order to use wayland with
> nvidia-drivers, nvidia-drm.modeset=1 needs to be set -- so USE=wayland does
> this.
> 
> I did fear that it may cause issues for some more exotic setups though thus
> the postinst elog message to warn about this change when enabling wayland.
> 
> To confirm, try to #comment out this line in /etc/modprobe.d/nvidia.conf:
> 
>     options nvidia-drm modeset=1
> 
> As far as I'm aware, this option is also needed for PRIME offloading, but
> reverse PRIME may be a different deal. Like SLI, I may need to adjust the
> informational message to warn about reverse PRIME. Unsure if I want to
> disable this by default given it'll be impossible for wayland to work out of
> the box.
> 
> Unfortunately I don't have the right hardware to test this myself.

Commenting the option: "options nvidia-drm modeset=1" in /etc/modprobe.d/nvidia.conf resolves the issue in my case. I think it's wise to update the postinst elog message and include reverse prime in cases where external displays are hardwired to the NVIDIA GPU (which is the case in most mobile workstations. (The Lenovo ThinkPad P series and higher end Dell Precision series laptops etc.).
Comment 6 Ionen Wolkens gentoo-dev 2021-07-21 13:13:35 UTC
(In reply to nvaert1986 from comment #4)
> When I run the following command it always shows x11:
> ~ $ loginctl show-session 2 -p Type 
> Type=x11
At gdm's login, there's a not-too-visible setting icon at the bottom right, could you check what it's starting there? Just to be sure.
Comment 7 Larry the Git Cow gentoo-dev 2021-07-21 19:44:41 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=153367194a0cbacdcb70c4c25a8bc351e1c3d29e

commit 153367194a0cbacdcb70c4c25a8bc351e1c3d29e
Author:     Ionen Wolkens <ionen@gentoo.org>
AuthorDate: 2021-07-21 18:42:12 +0000
Commit:     Ionen Wolkens <ionen@gentoo.org>
CommitDate: 2021-07-21 19:42:51 +0000

    x11-drivers/nvidia-drivers: extend USE=wayland warnings a bit
    
    Can't test this myself, but adding the warning for
    Reverse PRIME to be on the safe side, plus a note
    about gdm.
    
    Closes: https://bugs.gentoo.org/803209
    Signed-off-by: Ionen Wolkens <ionen@gentoo.org>

 x11-drivers/nvidia-drivers/files/nvidia-450.conf           | 2 +-
 x11-drivers/nvidia-drivers/files/nvidia-470.conf           | 2 +-
 x11-drivers/nvidia-drivers/nvidia-drivers-470.57.02.ebuild | 7 ++++++-
 3 files changed, 8 insertions(+), 3 deletions(-)