Black screen after login on laptop with nvidia graphics card

Hello Community,

after installing Fedora 32 on my laptop (default ISO; gnome + gdm) I added the rpm fusion repository and installed the nvidia graphics driver:

  • dnf install akmod-nvidia
  • xorg-x11-drv-nvidia-cuda).

Afterwards i copied the nvidia.conf file to /etc/X11/xorg.conf.d/ and added Option “PrimaryGPU” “yes” to every section As described here:

nvidia.conf looks like this:
Section “OutputClass”
Identifier “nvidia”
MatchDriver “nvidia-drm”
Driver “nvidia”
Option “AllowEmptyInitialConfiguration”
Option “SLI” “Auto”
Option “BaseMosaic” “on”
EndSection

Section “ServerLayout”
Identifier “layout”
Option “AllowNVIDIAGPUScreens”

After a reboot everything is working fine and with gnome and gdm I actually never had problems. The output of nvidia-smi and lsof /dev/nvidia* shows that my graphics card is in use.

  • nouveau is blacklisted and nvidia module is loaded
  • but this is the default configuration after installing the nvidia graphics driver
  • secure boot is off

But when I want to use another desktop environment, login manager or no login manager at all I get a black screen.

  • use another desktop environment / window manager with gdm → black screen
  • use another login manager (sddm, slim, lightdm) → black screen before login manager is even visible
  • using no login manager and start for instance openbox / i3 via startx → black screen

On my PC I don’t have this problem. So switching the login manager or desktop environment / window manager is working fine (no xorg.conf or nvidia.conf is in use).

Laptop (Lenove Legion Y520):

  • i5
  • 8GB RAM
  • integrated intel gpu
  • nvidia 1050ti

PC:

  • i7
  • 16GB RAM
  • nvidia 2070

Let me know if you need more information.

Best regards,
Doodleface

Sry. My nvidia.conf is missing some information. It should look like this:

Section “OutputClass”
Identifier “nvidia”
MatchDriver “nvidia-drm”
Driver “nvidia”
Option “AllowEmptyInitialConfiguration”
Option “SLI” “Auto”
Option “BaseMosaic” “on”
Option “PrimaryGPU” “yes”
EndSection

Section “ServerLayout”
Identifier “layout”
Option “AllowNVIDIAGPUScreens”
Option “PrimaryGPU” “yes”
EndSection