Black screen after login on Optimus Laptop due to Section "Devices" in xorg.conf

Hello, I have an old laptop that was handed to me. I’m trying to install Fedora on it and I’m coming into problems when it comes to using proprietary NVIDIA drivers. I mainly followed the instructions from RPM Fusion with some help from the Fedora Docs and the Arch Wiki but it seems I’m still coming up short. Every time I would log in the screen would just stay black. I’ve tried moving the mouse around but I don’t see a cursor.

This is the laptop’s VGA/3D:

00:02.0 VGA compatible controller: Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)
01:00.0 3D controller: NVIDIA Corporation GF119M [GeForce GT 520MX] (rev a1)

I’ve installed the following packages trying to make this work:

  • NVIDIA related packages
nvidia-gpu-firmware-20260110-1.fc42.noarch
xorg-x11-drv-nvidia-390xx-kmodsrc-390.157-7.fc42.x86_64
xorg-x11-drv-nvidia-390xx-libs-390.157-7.fc42.x86_64
nvidia-settings-390xx-390.157-5.fc42.x86_64
akmod-nvidia-390xx-390.157-22.fc42.x86_64
xorg-x11-drv-nvidia-390xx-390.157-7.fc42.x86_64
kmod-nvidia-390xx-6.18.7-100.fc42.x86_64-390.157-22.fc42.x86_64
nvidia-persistenced-580.119.02-1.fc42.x86_64
xorg-x11-drv-nvidia-390xx-cuda-libs-390.157-7.fc42.x86_64
xorg-x11-drv-nvidia-390xx-cuda-390.157-7.fc42.x86_64

I did the usual dnf update and installed the free and nonfree repos. I made sure to wait for the kmods to build. I’ve confirmed that it was finished with modinfo. I alse ran the commands sudo akmods --force and sudo dracut --force.

  • X11 related packages:
plasma-workspace-x11

I’ve searched around and this seems to be the only package I need to enable X11 again in Fedora 42. kwin is also included in this package. If there are any packages missing that X11 needs in order to work properly I would love to know!

I added the kernel argument nvidia-drm.modeset=0 via the command sudo grubby --update-kernel=ALL --args='nvidia-drm.modeset=0'. It used to be nvidia-drm.modeset=1 after a fresh install but using that argument stops me from reaching the login screen when using X11 + proprietary Nvidia drivers. The RPM Fusion docs also recommended removing that argument. I’ve added xrandr commands on Xsetup for SDDM as mentioned by the Arch Wiki, but I wrote those commands in /etc/sddm/Xsetup instead. According to the Fedora Docs this is how it should be done.

This is my xorg config:

Section "ServerLayout"
	Identifier "layout"
	Option "AllowNVIDIAGPUScreens"
EndSection

Section "Files"
	ModulePath   "/usr/lib64/nvidia-390xx/xorg/"
	ModulePath   "/usr/lib64/xorg/modules"
	FontPath     "catalogue:/etc/X11/fontpath.d"
	FontPath     "built-ins"
EndSection

Section "Device"
	Identifier  "Card0"
	Driver      "nvidia"
	VendorName  "NVIDIA Corporation"
	BusID       "PCI:1:0:0"
	Option		"AllowEmptyInitialConfiguration"
EndSection

Section "OutputClass"
	Identifier "nvidia"
	MatchDriver "nvidia-drm"
	Driver "nvidia"
	Option "AllowEmptyInitialConfiguration"
	Option "PrimaryGPU" "yes"
	Option "SLI" "Auto"
	Option "BaseMosaic" "on"
	ModulePath "/usr/lib64/nvidia-390xx/xorg"
EndSection

While I was troubleshooting I found that xorg was using its own glx module, I had to include an additional ModulePath that points to NVIDIA’s own glx module in order for xorg to use the that one. Apparently the order is important so I made sure the Nvidia path is listed first before the xorg one. The part of the config that is causing problems seems to be the Devices section. Without it Fedora boots fine, but running glxinfo gives the error:

name of display: :0
Error: couldn't find RGB GLX visual or fbconfig

I also can’t run nvidia-settings as well.

The OutputClass section is something I’ve seen in other examples online so I’ve included it, but I’m not sure if xorg is picking it up? With these settings (including the Devices section), resulted in this xorg log: https://pastebin.com/NTSuUw5Y

I believe the log ends at around the lines similar to systemd-logind: got pause for 13:75. Anything after lines like those is when I switched to a different tty and rebooted.

I believe that’s everything I’ve done to this point. Despite all this I still get a black screen after login, and looking at the logs I couldn’t figure it out. I’m not even sure if this is a xorg issue, maybe plasma-workspace-x11 is causing troubles maybe? I’ve tried looking online to see if others have similar problems but their solutions don’t work for me, or at least I don’t think it does. I would appreciate it if I get pointed at the right direction! This is my first time trying out fedora and I’m tinkering around on an old laptop before I finally give it a try on my main one!

That graphics card is old enough to no longer be supported by the current 580 drivers, and I see that you’ve got the 390 drivers installed, apart from nvidia-persistence which is a 580 version.

I’ll admit, I’ve got no idea what that is used for, but Is there not a 390 version of that package you could use so that aligns with the other 390 packages you’re using?

Might be absolutely nothing and entirely fine - it just stuck out to me when reading your post.

You could always try using the nouveau drivers just to see if the card actually works correctly…

Hey Steve. You are right, that does seem out of place, I’ve checked via dnf search and it doesn’t look like there’s a version specifically for my driver version. The actual package name doesn’t seem to include the 580 part though, and I didn’t get any conflict warnings as I recall, so maybe its fine?

The nvidia-persistenced package does not appear to be provided with the 390 drivers. I would suggest removing that one package.

Other than the devel packages which I trimmed from the below, your list of packages seems to match what is available for the 390 drivers.

$ sudo dnf list --available *nvidia*390* --releasever=42
Updating and loading repositories:
Repositories loaded.
Available packages
akmod-nvidia-390xx.x86_64                  3:390.157-22.fc42 rpmfusion-nonfree-updates
nvidia-settings-390xx.x86_64               390.157-5.fc42    rpmfusion-nonfree
xorg-x11-drv-nvidia-390xx.x86_64           3:390.157-7.fc42  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-cuda.x86_64      3:390.157-7.fc42  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-cuda-libs.i686   3:390.157-7.fc42  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-cuda-libs.x86_64 3:390.157-7.fc42  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-kmodsrc.x86_64   3:390.157-7.fc42  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-libs.i686        3:390.157-7.fc42  rpmfusion-nonfree-updates
xorg-x11-drv-nvidia-390xx-libs.x86_64      3:390.157-7.fc42  rpmfusion-nonfree-updates

I cannot speak to the layout of the 390 driver libs as I have never needed that version, but it seems odd to use /usr/lib64/xorg/modules. Most nvidia kernel modules for newer drivers and kernels are under /lib/modules/$(uname -r)/extra/nvidia.

I see you do not have either of the available i686 packages installed.
xorg-x11-drv-nvidia-390xx-cuda-libs-i686 or xorg-x11-drv-nvidia-390xx-libs-i686

No, this is normal: this directory provides the Xorg modules.
Ex: RPM xorg-x11-drv-nvidia-390xx: /usr/lib64/xorg/modules/drivers/nvidia_drv.so

1 Like

Understood. I am not at all familiar with the 390 driver, but only with the newer drivers. That makes sense for the library files, but the kernel driver modules seem to be located at

$ ls /lib/modules/$(uname -r)/extra/nvidia
nvidia-drm.ko  nvidia.ko  nvidia-modeset.ko  nvidia-peermem.ko  nvidia-uvm.ko

It appears that the nvidia-persistenced package was included when I installed xorg-x11-drv-nvidia-390xx-cuda-libs:

Package                                 Arch    Version              Repository
Installing:
 xorg-x11-drv-nvidia-390xx-cuda         x86_64  3:390.157-7.fc42     rpmfusion-nonfree-updates 
Installing dependencies:
 nvidia-persistenced                    x86_64  3:580.119.02-1.fc42  rpmfusion-nonfree-nvidia-driver
 opencl-filesystem                      noarch  1.0-22.fc42          fedora
 xorg-x11-drv-nvidia-390xx-cuda-libs    x86_64  3:390.157-7.fc42     rpmfusion-nonfree-updates

I don’t think conflicts will arise from having it installed. As for the i686 packages, aren’t those for 32-bit computers? I’m sure mine is 64-bit.

I think my kernel modules are good, they’re displayed when I run lsmod | grep -i nvidia:

nvidia_drm             69632  0
nvidia_modeset       1343488  1 nvidia_drm
nvidia_uvm           2191360  0
nvidia              19804160  20 nvidia_uvm,nvidia_modeset
ipmi_msghandler       110592  2 ipmi_devintf,nvidia
video                  81920  2 nvidia,i915

Are there any modules that might be missing?

I was suspecting if SDDM might be causing issues, after checking the boot logs I found this error:

sddm-helper-start-x11user[1664]: "Could not find provider with name NVIDIA-0\n"

I’ve seen other posts online use NVIDIA-G0 instead of NVIDIA-0 and I tried that as well even random ones like NVIDIA-G1 and NVIDIA-1, but I would get the same errors. Running xrandr --listproviders gives me:

Providers: number : 1
Provider 0: id: 0x44 cap: 0xf, Source Output, Sink Output, Source Offload, Sink Offload crtcs: 2 outputs: 4 associated providers: 0 name:modesetting

So it seems for some reason an nvidia provider is not showing up. Could this be a possible cause of the black screen?

I also noticed in my xorg config, despite having the option AllowNVIDIAGPUScreens in my ServerLayout, I don’t see it mentioned anywhere in the xorg logs, same for anything within the section OutputClass.

That’s where I am currently at. I’m searching around if anyone had similar issues in the past and reading some documentation/manpages in the meantime.

It’s normal to have those installed, for compatibility with legacy 32-bit apps, notably Steam. But the absence of them shouldn’t be the cause of the issues you’re having.

Ah right, that makes sense. I’ll keep those then.

When I was using X11 with nvidia there was a file /usr/share/X11/xorg.conf.d/nvidia.conf that was suggested to copy into /etc/X11/xofg.conf.d/ and then some of the settings you show were in in that file for use with X11 & nvidia. Since X11 is no longer used on my version of fedora I no longer have the simple change to that file which made the nvidia gpu primary but I see it in the OutputClass section of your posted xorg.conf file. There are several differences that section of the file from what I used to use a couple years past.

This is what was shown and I was using back then on F36

There are only one line added into each stanza of that file that are not stock with the provided /usr/share/X11/xorg.conf.d/nvidia.conf file. Those lines are the ones that are Option "Primary" "yes". I see you have it differently in the xorg.conf file
Option "PrimaryGPU" "yes" which may be one of the issues you are encountering.

This doc may help

.

I’ve tried both, and I don’t see any difference when rebooting. Actually, the default nvidia.conf that was included when installing the 390xx drivers uses PrimaryGPU instead of Primary.

If I were to just use that conf file (copied to /etc/X11/xorg.conf.d), the computer does boot, but all the nvidia specific modules such as the nvidia driver and nvidia’s own glx module aren’t loaded according to the xorg logs. It’s as if OutputClass is being ignored entirely.

Just a hope: try perhaps to install the nvidia-xconfig RPM and use
nvidia-xconfig --prime ... to generate xorg.conf.

When optimus appeared (around 2014 I think), I managed to configure lightdm to use it,
following mostly /usr/share/doc/xorg-x11-drv-nvidia/README.txt:

  • Chapter 33. Offloading Graphics Display with RandR 1.4

(in your case: /usr/share/doc/xorg-x11-drv-nvidia-390xx/README.txt)

3 files to install:

/etc/X11/xorg.conf
# Install as: /etc/X11/xorg.conf
#   Adjust the BusID if needed (cf lspci)

# Cf: /usr/share/doc/xorg-x11-drv-nvidia/README.txt
#  Chapter 33. Offloading Graphics Display with RandR 1.4

# lspci|grep 3D
# 02:00.0 3D controller: NVIDIA Corporation GK107GLM [Quadro K1100M] (rev a1)
# # root@nsjura 2014-09-25 09:06:10 /
#   => PCI:2:0:0

Section "ServerFlags"
    Option "DontVTSwitch" "off"
EndSection

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

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

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

Section "Device"
    Identifier "intel"
    Driver "modesetting"
EndSection

Section "Screen"
    Identifier "intel"
    Device "intel"
EndSection
/etc/lightdm/lightdm.conf.d/nvidia-optimus.conf
# Install as: /etc/lightdm/lightdm.conf.d/nvidia-optimus.conf

[SeatDefaults]
display-setup-script=/etc/lightdm/nvidia-optimus-setup
/etc/lightdm/nvidia-optimus-setup
#!/bin/bash -p

# Install as:         /etc/lightdm/nvidia-optimus-setup
# Make it executable: chmod a+x /etc/lightdm/nvidia-optimus-setup

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

# Specific Dell Precision M3800
#   3200x1800 pixels 
#   Image Size:  346 x 194 mm
xrandr --dpi 234

To ease debugging, you may:

  • stop the display-manager
  • from a textual console, start a minimal X session
    Example: startx /usr/bin/xterm -- :1
  • from this xterm:
    • use xrandr to setup nvidia
    • verify, example: glxinfo -B

Finally, for this old laptop, it’s perhaps better to use a more minimal Desktop Environment
than Gnome, KDE or Cinnamon that also require GPU features. Use the MATE Desktop for example (it uses lightdm)