Interal Display not working after setting up PRIME

After setting up PRIME, my external displays are working, but my internal display is now black.

xorg.conf

# nvidia-xconfig: X configuration file generated by nvidia-xconfig
# nvidia-xconfig:  version 510.60.02


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 1920 0
    Inactive       "InactiveDevice1"
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "LG Electronics LG ULTRAWIDE"
    HorizSync       30.0 - 90.0
    VertRefresh     56.0 - 75.0
    Option         "DPMS"
EndSection

Section "Device"
    Identifier     "Device0"
    Driver         "nvidia"
    VendorName     "NVIDIA Corporation"
    BoardName      "NVIDIA GeForce GTX 1660 Ti with Max-Q Design"
    BusID          "PCI:1:0:0"
EndSection

Section "Device"
    Identifier     "InactiveDevice1"
    Driver         "modesetting"
    VendorName     "Unknown"
EndSection

Section "Screen"

# Removed Option "metamodes" "DP-0.1: 2560x1080_75 +0+500, DP-0.2: 1920x1080_60 +2560+0 {rotation=right}"
    Identifier     "Screen0"
    Device         "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option         "AllowEmptyInitialConfiguration" "True"
    Option         "Stereo" "0"
    Option         "nvidiaXineramaInfoOrder" "DFP-0.1"
    Option         "metamodes" "DP-0.1: 2560x1080_75 +1920+500, DP-0.2: 1920x1080_60 +4480+0 {rotation=right}"
    Option         "SLI" "Off"
    Option         "MultiGPU" "Off"
    Option         "BaseMosaic" "off"
    SubSection     "Display"
        Depth       24
    EndSubSection
EndSection
$ xrandr --setprovideroutputsource modesetting NVIDIA-0
$ xrandr --auto --verbose
crtc 4:      832x624  74.55 +0+0 "eDP-1-1"
xrandr: Configure crtc 4 failed
crtc 0: disable
crtc 1: disable
crtc 2: disable
crtc 3: disable
crtc 4: disable
crtc 5: disable
crtc 6: disable
screen 0: revert
crtc 0: revert
crtc 1: revert
crtc 2: revert
crtc 3: revert
crtc 4: revert
crtc 5: revert
crtc 6: revert
$ xrandr --listproviders
Providers: number : 2
Provider 0: id: 0x1b7 cap: 0x1, Source Output crtcs: 4 outputs: 5 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x20a cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 1 associated providers: 1 name:modesetting

xrandr-verbose.txt (37.4 KB)
nvidia-bug-report.log.gz (297.5 KB)

Please run nvidia-bug-report.sh as root and attach the resulting nvidia-bug-report.log.gz file to your post.

It has been added.

Please add kernel parameter
nvidia-drm.modeset=1
then don’t use the xorg.conf you created but /etc/X11/xorg.conf.d/10-nvidia-primary.conf

Section "OutputClass"
    Identifier "nvidia primary"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "PrimaryGpu" "true"
EndSection

instead, then try running the xrandr commands again.

I will 100% try these changes when I get home from work today, but I wanted to take a second for a couple of clarifications:

  1. I had set that kernel parameter in my GRUB config previously, but between then and trying PRIME, I tested out Bumblebee which may have changed that
  2. I did not write this xorg.conf myself. It was generated through nvidia-xconfig --prime and then modified through nvidia-settings. I would find it pretty concerning if a config generated entirely through NVIDIA’s own tools could not support a setup they were designed to support.

I was correct about that kernel parameter already being set. Switching from my current xorg.conf to just the single section you provided seems to have done the trick, though. The only problem is that now when I log in to my laptop, I have to 1) reconfigure the external monitors in nvidia-settings 2) reposition the internal monitor within the X screen using xrandr then 3) relaunch bspwm. If I attempt saving the configuration from nvidia-settings to a new xorg.conf, I just end up with the same one I had before and the same problem that I was having before. Do you know how I could go about automatically positioning the screens/setting their resolutions that doesn’t rely on xorg.conf or am I just going to have to manually do all of this every time I log on?

While the xorg.conf created by nvidia-settings is unusable, it should contain a metamode option containing the monitor layout. Just copy that to the 10-nvidia-primary.conf file inside the outputclass.

Thank you so much! that did the trick

Quick follow-up that I hope you can help with. I’m now trying to get the same monitor setup going through Optimus on a Thinkpad P50 running Fedora. The external outputs keep rendering at the starting pos 0x500 and the internal screen keeps starting at pos 0x0.

/etc/X11/xorg.conf.d/10-nvidia-primary.conf :

Section "OutputClass"
    Identifier "nvidia primary"
    MatchDriver "nvidia-drm"
    Driver "nvidia"
    Option "PrimaryGpu" "true"
    Option "metamodes" "DP-4.1: 2560x1080_75 +1920+500, DP-4.2: nvidia-auto-select +4480+0 {rotation=right}"
EndSection

/usr/share/gdm/greeter/autostart/optimus.desktop & /etc/xdg/autostart/optimus.desktop :

[Desktop Entry]
Type=Application
Name=Optimus
Exec=sh -c "xrandr --setprovideroutputsource modesetting NVIDIA-0; xrandr --auto; xrandr --output eDP-1-1 --mode 1920x1080 --pos 0x500"
NoDisplay=true
X-GNOME-Autostart-Phase=DisplayServer

/etc/gdm/custom.conf :

# GDM configuration storage

[daemon]
# Uncomment the line below to force the login screen to use Xorg
WaylandEnable=false

[security]

[xdmcp]

[chooser]

[debug]
# Uncomment the line below to turn on debugging
#Enable=true

$ xrandr --listproviders :

Providers: number : 2
Provider 0: id: 0x218 cap: 0x1, Source Output crtcs: 4 outputs: 8 associated providers: 1 name:NVIDIA-0
Provider 1: id: 0x273 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 5 associated providers: 1 name:modesetting
[xrandr.verbose|attachment](upload://280ktotj6QQ9b8wDZXkZSzBI1qa.verbose) (4.8 KB)

Let me know if it would be best to start a new topic for this, I just thought it fit here since it was the same technology and monitor configuration, just a different laptop and distribution

Most of all, it’s a different DE, Gnome. Gnome has its own monitor manager so you should not use metamodes but set the monitor layout in gnome control center.
I don’t know if the xrandr commands with gnome are still needed or it’s auto-enabling that.

I’m actually using the i3-gaps tiling wm, I just didn’t feel like getting rid of GDM. I’ll try replacing it with LightDM here in a little bit and then removing the DM altogether to see if either of those help at all.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.