[solved] black screen w/ no backlight when running startx on optimus laptop

hi, nvidia devs. i’m running a gentoo desktop profile, and i’ve followed their wiki to set up my graphics cards. using driver 430.26 and kernel version 4.19.52. also followed their link to the randr1.4 page in nvidia handbook for the recommended xorg.conf.

~/.xinitrc:

#!/bin/sh

xrandr --setprovideroutputsource modesetting NVIDIA-0
xrandr --auto

compton &
exec awesome

i put this in xorg.conf.d:

# /etc/X11/xorg.conf.d/00_nvidia.conf

Section "ServerLayout"
    Identifier      "layout"
    Screen 0        "nvidia"
    Inactive        "intel"
EndSection

Section "Module"
    Disable         "libglamoregl"
EndSection

Section "Device"
    Identifier      "nvidia"
    Driver          "nvidia"
    BusID           "PCI:1:0:0"
EndSection

Section "Device"
    Identifier      "intel"
    Driver          "modesetting"
    BusID           "PCI:0:2:0"
EndSection

Section "Screen"
    Identifier      "nvidia"
    Device          "nvidia"
    Option          "AllowEmptyInitialConfiguration" "yes"
EndSection

Section "Screen"
    Identifier      "intel"
    Device          "intel"
EndSection

i noticed when i ctrl+alt+f1 out to close the x server, i see this:

X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  139 (RANDR)
  Minor opcode of failed request:  35 (RRSetProviderOutputSource)
  Value in failed request:  0x232
  Serial number of failed request:  16

and when i add ‘xrandr --listproviders > providers.txt’ to my .xinitrc, i get this:

Providers: number : 2
Provider 0: id: 0x242 cap: 0x0 crtcs: 0 outputs: 0 associated providers: 0 name:NVIDIA-0
Provider 1: id: 0x46 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 3 outputs: 4 associated providers: 0 name:modesetting

i created the bug report as instructed. edit: *in attachment
nvidia-bug-report.log.gz (1.03 MB)

That looks rather odd, the provider capabilities are 0x0/0xf, correct would be 0x1/0x2.
Please post the output of
emerge -pv xorg-server nvidia-drivers
For testing, please comment out

Section "Module"
    Disable         "libglamoregl"
EndSection

Attaching files:
Hovering the mouse over an existing post of yours will reveal a paperclip icon.
https://devtalk.nvidia.com/default/topic/1043347/announcements/attaching-files-to-forum-topics-posts/

i’ve been messing with this since yesterday. something about the modesetting driver trying to load libglamoregl.so conflicting with the nvidia egl. i’ll get rid of it since it didn’t fix anything. thanks, got the log uploaded properly.

These are the packages that would be merged, in order:

Calculating dependencies                          ... done!   
[ebuild   R    ] x11-base/xorg-server-1.20.4:0/1.20.4::gentoo  USE="glamor ipv6 suid udev xorg -debug -dmx -doc -elogind -kdrive -libressl -minimal (-selinux) -static-libs -systemd -unwind -wayland -xcsecurity -xephyr -xnest -xvfb" 0 KiB
[ebuild   R   ~] x11-drivers/nvidia-drivers-430.26:0/430::gentoo  USE="X acpi driver gtk3 kms multilib tools -compat -static-libs -uvm -wayland" ABI_X86="32 (64) (-x32)" 0 KiB

Total: 2 packages (2 reinstalls), Size of downloads: 0 KiB

*yes, i was looking at that scratching my head. seems like the xrandr line in my .xinitrc isn’t working.

Everything seems to be set up correctly. Maybe this is a recurrence of a stupid old bug, please change your xorg.conf like this:

Section "ServerLayout"
    Identifier      "layout"
    Screen 0        "nvidia"
    Inactive        "intel"
EndSection

Section "Device"
    Identifier      "intel"
    Driver          "modesetting"
    BusID           "PCI:0:2:0"
    Option          "AccelMethod" "none"
EndSection

Section "Device"
    Identifier      "nvidia"
    Driver          "nvidia"
    BusID           "PCI:1:0:0"
    Option          "AllowEmptyInitialConfiguration" "yes"
EndSection

Section "Screen"
    Identifier      "nvidia"
    Device          "nvidia"
EndSection

edit: well, i figured the problem out… see, i had enabled module signing in my kernel, and i set up a script to sign my nvidia modules. unfortunately, i forgot to add a line for nvidia-drm like so:

/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/$(uname -r)/video/nvidia.ko
/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/$(uname -r)/video/nvidia-modeset.ko
/usr/src/linux/scripts/sign-file sha512 /usr/src/linux/certs/signing_key.pem /usr/src/linux/certs/signing_key.x509 /lib/modules/$(uname -r)/video/nvidia-drm.ko

thanks a lot for helping me try to figure this out. in the end it was a brain-fart.

There’s no way to change the capabilities besides changing the driver.
Is your user member of the ‘video’ group?
Please create a new nvidia-bug-report.log with the changed xorg.conf.

Urgs, that’s a detail that would be really hard to find with no error telling it.