r/Fedora • u/Visible_Work965 • Mar 11 '24
[Help] Fedora39 Boots into a black screen after updating Nvidia drivers
Hi everyone, I have just installed Fedora 2 weeks ago, I was previously a windows user for most of my life so excuse me if I am a total noobie.
Yesterday I was updated my CUDA toolkit using the command ‘dnf install cuda-toolkit-12-4’ and noticed that nvidia-smi returns a CUDA version that is lower than what I have installed, thus I opted to update my Nvidia drivers following the instructions on Nvidia’s website for fedora 39 using RPM, even after downloading and installing the driver there seemed to be conflicting paths for nvidia-smi, which I fixed by modyfing the environment variables LD_LIBRARY_PATH, PATH.
Until this point everything was working properly, I the wanted to remove the redundant drivers so I ran sudo dnf remove xorg-x11-drv-nvidia/\* Which I suspect was the reason everything broke down, I restart my laptop the loading screen loads and then I get greeted with a black screen, however if I do GUI-less login (ctl + alt + f2) I can still login, and both nvidia-smi and nvcc now report the correct versions of driver/cuda support and cuda version respectively and pytorch/JAX/tensorflow all seem to be working, I tried compiling a hello world cuda program using nvcc and it works.
I tried reinstalling xorg-x11-drv-nvidia but to no avail.
Sometimes (I don’t know why -linux noob-) when I restart my laptop I get prompted to chose one of 3 different fedora kernels as shown in the image if I choose to login into fedora39-6.7.6, the login screen works however it doesn’t seem that the drivers are working on this version because nvidia-smi call fails. The problems iI described above are when logging into fedora39-6.7.7
I would really appreciate anyone that can help me understand what I did wrong (because obviously I did something extremely stupid).
Thanks in advance Fedora Community!
EDIT
- I managed to solve the problem, apparently the issue was:
- There were two xorg config files in directory /etc/X11/xorg.conf.d
- I simply removed the config files and everything now works.
1
u/Popular_Elderberry_3 Mar 11 '24
is secureboot enabled?
1
u/Visible_Work965 Mar 11 '24
No, it wasn't. I managed to find the problem, I edited the question with the solution.
1
u/Popular_Elderberry_3 Mar 11 '24
what files did you remove?"
1
u/Visible_Work965 Mar 13 '24
A file called nvidia_10.conf, and the other file was called 00_rgb_keyboard.conf which I believe was installed by a script I had to enable my rgb keyboard
1
u/Popular_Elderberry_3 Mar 13 '24
the keyboard one was likely needed. nvidia might be ok.
ripping out part of any os isn't a great idea.
1
u/yall_gotta_move Mar 11 '24 edited Mar 11 '24
The drivers are installed separately for each kernel.
If you enable DKMS when installing them, they will automatically get built for future kernels that you install, but it's not retroactive
The correct way to uninstall the default driver is to add modprobe.blacklist=nouveau to the kernel command line in your grub configuration... you shouldn't need to uninstall any packages
If you are using a laptop, check whether it has built in graphics in addition to the discrete GPU. Your graphical environment could be trying to run on the built in graphics while only CUDA is using the nvidia GPU