Nvidia Black Screen

New to Linux. So I have reinstalled Fedora 5 times now thinking I had figured out what I was doing wrong, but the issue persists. After installing the Nvidia drivers, when I try to reboot, I press enter to choose the kernel like usual then just black screen. This is my process.

After install, I do a full update and reboot. Then
sudo dnf upgrade --refresh
sudo dnf install akmod-nvidia -y
Wait for the modules to build
sudo kmodgenca -a
sudo mokutil --import /etc/pki/akmods/certs/public_key.der
Reboot then enroll MOK

After that, next reboot just black screen. I cannot figure it out, so I am asking for help now. Have also tried enroll MOK before installing the drivers.

If you have repeated this multiple times then there will be a new key imported into bios for each time you ran that command. The space within bios to store those keys is limited and after a few extra keys are imported it will be filled up and cause problems.

When that occurs it will be necessary for the user to first, within bios security screen, reset the system to factory default keys. Then repeat the import step for the current key so secure boot will allow loading the nvidia module.

However, this may or may not be a factor at present.

  1. Is secure boot enabled? mokutil --sb-state will answer that.
    If secure boot is disabled then the key is immaterial at present.
  2. What is the result of modinfo -l nvidia?
  3. What is the result of dnf list --installed \*nvidia\*?
  4. Have you tried booting from the grub menu by editing the kernel command line and either removing rhgb quiet or adding nomodeset. (Do not do both at the same time)
  5. You can also try booting from the grub menu and edit the kernel command line to remove the rd.driver.blacklist=nouveau,nova_core modprobe.blacklist=nouveau,nova_core options from that line so the system will load the default nouveau driver instead of the nvidia driver.
  6. Which kernel are you choosing to boot? The 6.19.10 for a new fedora 44 install before updating or have you already upgraded to a newer kernel?
  7. What nvidia GPU is installed? A modern one (1650 or newer?) or a legacy version (10xx series or older?)
    This is critical since the nvidia driver version available for routine installation on fedora 44 is the 595 series driver, and that one does not support the legacy devices.

RPMFusion’s akmod-nvidia package should have automatically generated the MOK certificates without users needing to run kmodgenca.

Did kmodgenca -a give any errors when you ran the command? I’d imagine you may generated new MOK keys, while the drivers were signed by the new keys

No errors. Also first attempt I didn’t do that and got same results

Each attempt was with a fresh install. Doing it with the new kernel. Full system update before I try. GPU is 4070 super. Secure boor is enabled. modinfo -l nvidia gives me the driver version. Can only do this before the reboot that only give black screen

Kmodgenca is silent unless it is creating the key for the first time. If the key already exists “kmodgenca -a” is silent. The key is overwritten only when using --force (or -f) To see what happens use kmodgenca -h

Doing a new install of fedora, then installing the nvidia driver will automatically install akmods and build the driver, but the new driver at that point is not signed because no key exists. To create the key requires either a reboot or running kmodgenca. If the driver is not signed, it will not load with secure boot enabled even if the key has been imported into bios.

The only way to ensure that the driver is signed when it is first installed is to install akmods first, then run kmodgenca or reboot before installing the driver.

To sign the driver modules after the key has been newly generated requires that the user run sudo akmods --rebuild --force which will rebuild the driver and reinstall the now signed driver. A reboot after that should load the driver.

@saraneth

Lets not continue the wasted cycle of reinstalling fedora then reinstalling the driver then reimporting the key, all of which is wasted effort and may lead to problems with the number of keys stored in bios.

Lets work with what you have right now. I understand that is Fedora 44 newly installed, the nvidia driver installed, and a reboot giving you a black screen.

What I am unsure of is whether you have upgraded fedora from the initial installation or not?

Lets bypass the black screen first.

  1. From the boot menu – edit the kernel command line for the kernel being booted by pressing the e key to display the commands, then on the line that begins with linux move to the end of that line and add 3 to that line, then continue booting according to the prompt at the bottom of the screen. ctrlx
    This should bring you to a text login screen where you log in.

  2. update the system fully with sudo dnf upgrade --refresh and reboot. This may or may not give the black screen, and if it does not then you are done. If it does then continue by repeating step 1 then continue with step 3 below.

  3. Now run modinfo -l nvidia && modinfo -F version nvidia and tell us exactly what the response is to those commands (the note below gives the expected response).

  4. Run mokutil --sb-state and tell us exactly what the response is.

  5. Run sudo akmods --rebuild --force and let us know if there are any error messages.

  6. Run sudo mokutil --test-key /etc/pki/akmods/certs/public_key.der
    It should return /etc/pki/akmods/certs/public_key.der is already enrolled

If the results of 4 is enabled and the result of 6 is not as expected then the key will need to be enrolled before rebooting.
Step 3 should be able to provide this

$ modinfo -l nvidia && modinfo -F version nvidia
Dual MIT/GPL
595.71.05

Any errors in steps 1-6 above should be fixed before rebooting.

  1. reboot
    If rebooting still gives the black screen then you can try the earlier suggestions of editing the linux kernel command line as noted above and one at a time try
    a. remove rhgb quiet
    b. add nomodeset
    c. remove rd.driver.blacklist=nouveau,nova_core modprobe.blacklist=nouveau,nova_core

If there is still no progress and the black screen persists then let us know and we will dig deeper. DO NOT REINSTALL FEDORA. That totally defeats the troubleshooting.

Yes, I did full update beforehand. I also tried using sudo akmods --rebuild --force.
Tried enrolling the key before and after installing nvidia drivers. Each with fresh install. I also did sudo dnf upgrade --refresh after the full update and reboot before installing drivers.

I’ll get to the other stuff shortly.

It is extremely late here (near midnight) and I will need to resume tomorrow.
Hopefully my guides above assist and if not then resuming tomorrow is the best choice.

edit: Pay special attention to steps 1, 3, 6, and 7

ok, no worries. Appreciate the help. Goodnight

Ok, did everything there and here are results of step 1 to 6. I did need to to nomodeset 3 instead of just 3 or it stayed black. It not showing driver version is odd as it shows it before I reboot after installing them.

Step 7.
a. gave me a lot of text that froze on the screenshot below.
b. Had to use that anyway.
c. Actually got me to the login screen, but after entering password it just went black.

Also noticed when I just try booting normally the screen flashed for a fraction of a second. Pic below

In the future, instead of taking picture of text output, please copy and paste the actual text here using the Preformatted text button </> above. That makes it much easier to read, others can search for similar errors and people can copy and paste the commands you’re using.

Thanks for letting me know. The issue is, well, you know, copy it how? I couldn’t load into the OS to copy paste it anywhere. Pics aren’t hurting anyone, anyway.

The first screenshot shows that system is running kernel 6.19.10 and not the newer kernel 7.0.8, which is also installed.

Further down the error from the akmods --rebuild command means that the kernel modules couldn’t be compiled, because the kernel-devel package for kernel-6.19.10 was not installed. But the next line shows that modules were compiled for kernel 7.0.8.

The question is why does your system still boot the older kernel?
Pls post output of cat /etc/sysconfig/kernel and
sudo grubby --default-kernel as preformatted text.

when not running the latest kernel, the modinfo command would be

modinfo -l nvidia -k 7.0.8-200.fc44.x86_64
modinfo -F version nvidia -k 7.0.8-200.fc44.x86_64

check that these two files exist

ls -l  /boot/vmlinuz-7.0.8-200.fc44.x86_64 \
       /boot/initramfs-7.0.8-200.fc44.x86_64.img

check that output lists the 7.0.8 kernel

sudo grubby --info=0

change default kernel to 7.0.8 with

sudo grubby --set-default=/boot/vmlinuz-7.0.8-200.fc44.x86_64

restart the system (w/o nomodeset )
then run lsmod |grep -E 'nvidia|nouveau' and nvidia-smi

I do have the new kernel. And I saw it every other time. Just for that it. I know what I did. I pressed down to stop it auto selecting the kernel when double checking what to push. e. For everything else I was on the correct kernel. I will need to take another screenshot of that tomorrow. Might get different results. Bed time now. Also tried other things from the help I have been getting on reddit. Still no luck though. Reddit - Please wait for verification

no screenshot pls, redirect output to text files then boot into GUI (add nomodeset) and copy paste from the text files.

It’s possible that you highlighted the older kernel while in grub and started this kernel.

How do I do that?

( set -x;  some_command ) 2>&1 | tee   outputfile 

the command tee will overwrite the output file
tee -a will append output to the file

But you can run all commands in a GUI when you boot with nomodeset. Then you can just copy& paste.

Yeah, that means nothing to me. No idea what it does

You will find that command-line skills are much more efficient when seeking help with problems. GUI tools often hide important details. https://LinuxCommand.org dates from long before the AI clickbait epidemic and has helped many colleagues getting started with linux. Spend a couple hours to become familiar with it and then go back when you need to understand a command-line before running it.

same case as yours @saraneth. Maybe nvidia published a bad driver. For me it causes a black screen before asking me to decrypt my drive. But if you load the driver after with all the other modules it works. open /etc/default/grub as root. You should see a line beginning by GRUB_CMDLINE_LINUX. you should see “rd.driver.blacklist=nouveau,nova_core modprobe.blacklist=nouveau,nova_core” if you have installed the nvidia driver. Add nomodeset after quiet, or where you want inside the “”. save it and run “grub2-mkconfig -o /boot/grub2/grub.cfg”. This will permanently change your grub. After that you won’t need to enter grub and add nomodeset at each boot. This is a workaround and not a good solution but it should let you enjoy your new system.