450.51 reverse prime issues

Distro: Pop!_OS 20.04 (gnome)
Kernel: 5.6.17

With the existing gpu-manager selection of hybrid mode, I was able to plug in a display to the ports hardwired to the nvidia chip, and everything seemed fine except for the fact that my ultrawide would not display a clear picture, it looked like the old CRT refresh rate too high scrambled picture.

When I bumped the resolution down a notch everything seemed okay, except for the fact that the two screens were acting like one big screen surface instead of two individual screens.

When I followed the guide in the README for reverse-prime I was unable to start X unless I had the external screen plugged in (otherwise no screen found error), or I had to add “AllowEmptyInitialConfiguration” to the conf. However once I went this route sure it worked, but, it worked like I was using standard PRIME mode and the driver never allowed powersaving.

What is the correct way to set this up, and what is the precise expected behaviour when used with a laptop that has the external outputs wired to the Nvidia GPU?

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post. You will have to rename the file ending to something else since the forum software doesn’t accept .gz files (nifty!).

Hmm, the repeated message that really sticks out is:

Jun 25 12:44:12 zephyrus /usr/lib/gdm3/gdm-x-session[1040]: (WW) NVIDIA(G0): Failed to set the display configuration
Jun 25 12:44:12 zephyrus /usr/lib/gdm3/gdm-x-session[1040]: (WW) NVIDIA(G0):  - Setting a mode on head 0 failed: Insufficient permissions
Jun 25 12:44:12 zephyrus /usr/lib/gdm3/gdm-x-session[1040]: (WW) NVIDIA(G0):  - Setting a mode on head 1 failed: Insufficient permissions
Jun 25 12:44:12 zephyrus /usr/lib/gdm3/gdm-x-session[1040]: (WW) NVIDIA(G0):  - Setting a mode on head 2 failed: Insufficient permissions
Jun 25 12:44:12 zephyrus /usr/lib/gdm3/gdm-x-session[1040]: (WW) NVIDIA(G0):  - Setting a mode on head 3 failed: Insufficient permissions

The display weirdness is really weird - if I maximise a window, it takes up both screens, but since the external screen is garbled unless I set a lower res… the window shows the effect of the internal screen showing only a portion of the full desktop too.

nvidia-bug-report.log.gz.remove.txt (325.7 KB)

This is what the screen looks like. I’m able to see the mouse cursor on the garbage screen perfectly.

Using the suggested configuration in the Readme.

nvidia-bug-report.log.gz.suggested-conf.txt (404.6 KB)

Please delete
as it sets a second server layout, which is problematic. In order to not have it recreated, please also disable gpu-manager by using nogpumanager kernel parameter.
Please create a new nvidia-bug-report.log after reboot.

After performing the requested steps, no external output and the GPU is active.

nvidia-bug-report.log.gz.suggested-conf.txt (415.8 KB)

Gnome shows the second screen, but I’m unable to set it to be used (stuck in single screen mode).

If I stop X manually then the GPU suspends itself.

Additional note: I see NVIDIA-G0 with the default Pop!_OS hybrid mode, but this gives me the weird virtual screen stuff (both screens as one big screen) if at lower res, or the garbled screen if at native res (as shown in photo in previous post).

Using the suggested X config I don’t get NVIDIA-G0 at all, and though the driver appears to be loaded, I’m not able to use the screen plugged in although that does show in gnome-control-center

Config madness. Now it loads the modesetting driver for both gpus. Please add the BusID to the nvidia device section

    BusID "PCI:1:0:0"

No change there. Same log as last (including the modesetting(G0) stuff.

Please swap the order of nvidia device/screen and intel device/screen sections in xorg.conf.
Also, please post the output of

ls -l /etc/X11 /etc/X11/xorg.conf.d /usr/share/X11/xorg.conf.d

to check for forgotten config files

Swapping order got me back to the same results as with stock hybrid mode in Pop (along with the corrupt screen/virtual screen).

[luke@zephyrus]$ ls -l /etc/X11 /etc/X11/xorg.conf.d /usr/share/X11/xorg.conf.d
total 84
drwxr-xr-x 2 root root  4096 Apr 12 12:36 app-defaults
-rw-r--r-- 1 root root    15 Jan 25 06:34 default-display-manager
drwxr-xr-x 4 root root  4096 Jan 25 06:26 fonts
-rw-r--r-- 1 root root 17394 Jan 20  2017 rgb.txt
drwxr-xr-x 2 root root  4096 Apr 12 12:35 xinit
drwxr-xr-x 2 root root  4096 Jan 11 03:26 xkb
-rw-r--r-- 1 root root   520 Jun 25 22:37 xorg.conf
drwxr-xr-x 2 root root  4096 Jun 25 11:11 xorg.conf.d
-rwxr-xr-x 1 root root   709 Jan 20  2017 Xreset
drwxr-xr-x 2 root root  4096 Apr 12 12:33 Xreset.d
drwxr-xr-x 2 root root  4096 Apr 12 12:33 Xresources
-rwxr-xr-x 1 root root  3730 Dec 15  2018 Xsession
drwxr-xr-x 2 root root  4096 Jun 17 16:05 Xsession.d
-rw-r--r-- 1 root root   265 Jan 20  2017 Xsession.options
drwxr-xr-x 2 root root  4096 Apr 12 12:36 xsm
-rw-r--r-- 1 root root    13 Jan 21 03:54 XvMCConfig
-rw-r--r-- 1 root root    85 Apr 12 12:40 Xwrapper.config

total 0

total 24
-rw-r--r-- 1 root root   92 Oct 23  2019 10-amdgpu.conf
-rw-r--r-- 1 root root 1350 May 21 20:22 10-quirks.conf
-rw-r--r-- 1 root root   92 Oct 23  2019 10-radeon.conf
-rw-r--r-- 1 root root 1429 Aug 13  2019 40-libinput.conf
-rw-r--r-- 1 root root 3458 Mar 11 21:56 70-wacom.conf
-r--r--r-- 1 root root  489 Jun 25 10:42 nvidia-drm-outputclass.conf

[luke@zephyrus]$ cat /usr/share/X11/xorg.conf.d/nvidia-drm-outputclass.conf 
# This xorg.conf.d configuration snippet configures the X server to
# automatically load the nvidia X driver when it detects a device driven by the
# nvidia-drm.ko kernel module.  Please note that this only works on Linux kernels
# version 3.9 or higher with CONFIG_DRM enabled, and only if the nvidia-drm.ko
# kernel module is loaded before the X server is started.

Section "OutputClass"
    Identifier     "nvidia"
    MatchDriver    "nvidia-drm"
    Driver         "nvidia"

Please post the output of
xrandr --listproviders
in that case

[luke@zephyrus]$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x43 cap: 0x9, Source Output, Sink Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting
Provider 1: id: 0x1ce cap: 0x2, Sink Output crtcs: 4 outputs: 4 associated providers: 1 name:NVIDIA-G0

Explicitly, if I set the next resolution down (external), everything works as expected. However if I set the native resolution (external), then i get the virtual screen weirdness.

This is the case with both default Pop/Ubuntu using gpumanger, and using the steps in previous discussion. It appears that powersaving also works.

But yeah, can’t get native external res without the corrupt screen and virtual screen weirdness, even though it shows the mouse cursor.

Edit: not able to change refresh rate at lower res, can in native res.

Edit2: Sorry, still have the virtual desktop using both screens either way I set things.

I’ve taken a look again at the first log you provided and this seems the problem that the nvidia driver doesn’t correctly set the virtual resolution. Has been an issue with normal prime before on some wine games. Please try the workaround:

    SubSection     "Display"
        Virtual     1920 1080

adding this inside the nvidia screen section.
Edit: of course using the values of the native resolution of your monitor in case it’s not 1920x1080.

There is no change with that unfortunately. Same as before - virtual desktop using both screens with blanks where the smaller screen doesn’t quite fill its portion of the virtual desktop, and the external screen scrambled unless lower res.

It’s late here, sorry, I need to hit the hay.

I’m having a similar issue with the X screen treating my multimonitor setup as a single desktop, with a very basic reverse prime setup. (Pretty much autoconfigured.)

There are also some more issues present:

  • The output on the external displays feel choppy compared to the main display.
  • Using the external display in Single Display mode is extremely laggy and is virtually unusable.


Same issue here, if I use external monitor plugged on NVIDIA card on REVERSE PRIME mode:

  • if external screen only : very laggy (glxgears returns 1 FPS)
  • if external screen as extended : laggy (glxgears returns 75 FPS on external monitor, if I move the window to the laptop display it goes to 120 FPS); Worse if resolution on external monitor is different from laptop display.
  • games like CS:GO (OpenGL) are very laggy, didn’t try any Vulkan game

I use Arch Linux with kernel 5.7, KDE 5.19. My setup is Razer Blade 15 : i7-8770h, 16BO of RAM, 2Tb NVME drive, RTX 2080.

Thank you for finally having implemented these functionalities, once these few bugs are corrected, we will be almost on par with Windows. We would appreciate to see this in Wayland in the future as well :)