Black screen after installing Nvidia driver

Hi!

I’m new to Fedora (and Linux in general) and I’ve been trying to install and setup Fedora 37 i3 spin on my Laptop. I’m running a Ryzen 7 5800H with integrated graphics and also an RTX 3070. Secure boot is turned off and I enabled encryption.

I was only able to boot into Fedora using the nomodeset parameter in grub (I assume because of the missing Nvidia drivers). I ran dnf update and then installed the latest Nvidia drivers from the Nvidia CUDA repository (Later I also tried the RPM Fusion method with the same results).

After rebooting, I tried starting Fedora using the kernel 6.1.14 without the nomodeset parameter and I was able to get to the decryption screen and enter my password. The loading animation starts but the screen goes black before I can see the login screen.

I then tried booting the kernel my installation came with; 6.0.7. And that seems to work (though I’m not sure which GPU it is using right now and how to switch between them yet).

I’ve been trying to find related issues, but I was only able to find recent issues involving a black screen right before the decryption.

I’d like to include more information and relevant log files, but I’m not sure what is relevant. I’d really appreciate if you could tell me what to include and how to better format this question.

Did you have a try to use the password blind. Without seeing the login window? (wrong resolution)
Ctrl & Alt F3 does it bring you to a login?

As I remember i3 is X11 right?

Blindly typing in the password doesn’t work. Logging in over ctrl+alt+f3 does work.
And yes, i3 is a wm for X11.

It might be worth mentioning that the decryption screen seems to be in the “right solution”.

Can you see something suspect while checking the bootlog:
sudo sed $'s/\^\[/\E/g' /var/log/boot.log

With xrander you could check if everything is ok about the resolution while log in with ctrl+alt+f3

Yes this is while using the initramfs, this is before the settings of X11 gets active.

I apologize for the slow response, I’ll be more readily available in about an hour.

How do I scroll up the bootlog output? Shift+pageup doesn’t seem to work.

And I’ll look into xrander as soon as possible, I’ll need to read up on it.

sudo sed $'s/\^\[/\E/g' /var/log/boot.log |more

In bash you can use |more to scroll by page down. Unfortunately with |less you loose the coloration and get crappy characters of coloration.

Don’t apologize, we are here when we have time. Do the same :wink:

Looking at the bootlog when booting with 6.1.14, I don’t see anything suspect (at least there are no “FAILED” fields, only “OK”).

However, I do get

[FAILED] Failed to start dkms.servi…l new kernel modules through DKMS.
See 'systemctl status dkms.service' for details.

when I boot with 6.0.7 (which successfully lets me log in). After logging in and using the following command, I get the following output:

lspci -vnnn | perl -lne 'print if /^\d+\:.+(\[\S+\:\S+\])/' | grep VGA
01:00.0 VGA compatible controller [0300]: NVIDIA Corporation GA104M [GeForce RTX 3070 Mobile / Max-Q] [10de:249d] (rev a1) (prog-if 00 [VGA controller])
07:00.0 VGA compatible controller [0300]: Advanced Micro Devices, Inc. [AMD/ATI] Cezanne [Radeon Vega Series / Radeon Vega Mobile Series] [1002:1638] (rev c5) (prog-if 00 [VGA controller])

Furthermore, running nvidia-settingsgives the output:

ERROR: NVIDIA driver is not loaded


(nvidia-settings:3605): GLib-GObject-CRITICAL **: 17:50:10.391: g_object_unref: assertion 'G_IS_OBJECT (object)' failed

** (nvidia-settings:3605): CRITICAL **: 17:50:10.392: ctk_powermode_new: assertion '(ctrl_target != NULL) && (ctrl_target->h != NULL)' failed

ERROR: nvidia-settings could not find the registry key file or the X server is not
       accessible. This file should have been installed along with this driver at
       /usr/share/nvidia/nvidia-application-profiles-key-documentation. The application
       profiles will continue to work, but values cannot be prepopulated or validated, and
       will not be listed in the help text. Please see the README for possible values and
       descriptions.

For my current installation of the Nvidia drivers, I tried to follow the first option of this guide (the second option results in the same problems, though I haven’t compared the specifics):

Installing the nvidia drivers from the fedora-cuda repo I think requires using dkms and AFAIK does not automatically recompile the drivers with a kernel update.

I always suggest to never use the fedora-cuda repo and instead use the rpmfusion repo for the nvidia drivers. That method does automatic updates when a new version is released and also does an automatic recompile of the kernel modules with every kernel update. Once installed from rpmfusion it is almost a ‘set it and forget it’ process that just keeps things up to date automatically.

My suggestion is to remove what was installed from the cuda repo and instead enable the rpmfusion-nonfree-nvidia-driver repo and install from there with sudo dnf install akmod-nvidia xorg-x11-drv-nvidia-cuda which will give you both the nvidia drivers and cuda as well.

Trying to install xorg-x11-drv-nvidia-cuda results in the following problem:

Last metadata expiration check: 0:40:44 ago on Fri 03 Mar 2023 05:20:48 PM CET.
All matches were filtered out by modular filtering for argument: xorg-x11-drv-nvidia-cuda
Error: Unable to find a match: xorg-x11-drv-nvidia-cuda

Before, I ran sudo dnf module remove nvidia-driver:latest-dkmsto remove the previously installed drivers.

I try to avoid using modules and have disabled the modular repos.
I believe that seems an artifact from installing nvidia from the cuda repo and while I don’t work with modules enough to be fully versed on how to disable the interference I seem to recall that there are ways to disable the modular filtering.

This will tell you what modules are enabled
sudo dnf module list --enabled

There are several threads on this forum about that specific error and a search for
matches were filtered out by modular filtering will show lots of responses and several with the actual fix.

Thank you for your continued help, I appreciate the support. Listing the enabled modules gives me the following:

Name           Stream              Profiles             Summary                              
nvidia-driver  latest-dkms [d][e]  default [d], fm, ks  Nvidia driver for latest-dkms branch

This is weird, because I already ran

sudo dnf module remove nvidia-driver:latest-dkms

which now results in

Unable to match profile in argument nvidia-driver

I get the same result when I try

sudo dnf module remove nvidia-driver

In general, I have a hard time finding information about removing modules.

EDIT:
I now ran sudo dnf module reset nvidia-driver, and now sudo dnf module list --enabled shows me that nothing is enabled. However, I still get the same error:

All matches were filtered out by modular filtering for argument: xorg-x11-drv-nvidia-cuda
Error: Unable to find a match: xorg-x11-drv-nvidia-cuda

This, from one of the individuals involved, may give a final solution for you.

Thank you, this allowed me to install xorg-x11-drv-nvidia-cuda. However, now I’m back at square one: I still get the exact same black screen problem. Looking at the bootlog, there is no “FAILED” field. It seems to be stuck at:

[  OK  ] Started crond.service - Command Scheduler.
         Starting lightdm.service - Light Display Manager...
         Starting plymouth-quit-wai… until boot process finishes up...

Maybe, the following is a useful observation: When I boot using the older kernel 6.0.7, I get

[FAILED] Failed to start dkms.servi…l new kernel modules through DKMS.
See 'systemctl status dkms.service' for details.

but the system boots normally. I’ve been using my laptop with that kernel since.
Looking up systemctl status dkms.servicegives the output:

dkms.service - Builds and install new kernel modules through DKMS
     Loaded: loaded (/usr/lib/systemd/system/dkms.service; enabled; preset: enabled)
     Active: failed (Result: exit-code) since Sat 2023-03-04 18:39:11 CET; 14min ago
       Docs: man:dkms(8)
    Process: 1286 ExecStart=/usr/sbin/dkms autoinstall --verbose --kernelver 6.0.7-301.fc37.x86_64 (code=exited, status=11)
   Main PID: 1286 (code=exited, status=11)
        CPU: 145ms

Mar 04 18:39:11 fedora systemd[1]: Starting dkms.service - Builds and install new kernel modules through DKMS...
Mar 04 18:39:11 fedora dkms[1658]: Sign command: /lib/modules/6.0.7-301.fc37.x86_64/build/scripts/sign-file
Mar 04 18:39:11 fedora dkms[1658]: Binary /lib/modules/6.0.7-301.fc37.x86_64/build/scripts/sign-file not found, modules won't be signed
Mar 04 18:39:11 fedora dkms[1734]: Error! Your kernel headers for kernel 6.0.7-301.fc37.x86_64 cannot be found at /lib/modules/6.0.7-301.fc37.x86_64/build or /lib/modules/6.0.7-301.fc37.x86_64/source.
Mar 04 18:39:11 fedora dkms[1734]: Please install the linux-headers-6.0.7-301.fc37.x86_64 package or use the --kernelsourcedir option to tell DKMS where it's located.
Mar 04 18:39:11 fedora dkms[1735]: Error! One or more modules failed to install during autoinstall.
Mar 04 18:39:11 fedora dkms[1735]: Refer to previous errors for more information.
Mar 04 18:39:11 fedora systemd[1]: dkms.service: Main process exited, code=exited, status=11/n/a
Mar 04 18:39:11 fedora systemd[1]: dkms.service: Failed with result 'exit-code'.
Mar 04 18:39:11 fedora systemd[1]: Failed to start dkms.service - Builds and install new kernel modules through DKMS.

Again, this error only occurs on the “working” kernel. There is no error (as far as I can tell) on the newest kernel 6.1.14.

The nvidia driver from rpmfusion is built using akmods and for that purpose dkms.service is not needed. The fix for the dkms error may be to disable the dkms service with systemctl disable dkms.service then reboot.

Please post the output of dnf list installed '*nvidia*' and dmesg | grep -iE 'secure|nvidia|nouveau'

1 Like