Fedora 21 and the NVIDIA Display Driver

April 1, 2015

I just installed Fedora 21 a few days ago on an old laptop with a GeForce 6600 Go mobile video card, and like I've done many times with many versions of Fedora over the years I installed the RPM Fusion repositories (both the "free" and "nonfree" repositories that they offer) and then installed the NVIDIA driver. Unfortunately, this time after I rebooted the system I was greeted with a black screen where the login screen should be.

Obviously I assumed I had screwed something up, and the next day reinstalled Fedora 21 from the basic "Workstation" DVD I had burned, only to go through the same problem. In my troubleshooting what I had found was that the version of GDM (the window manager from the GNOME desktop, which has been the default window manager in every version of Fedora Linux, at least as far as I know) that is used in Fedora 21 seems to have issues with the official NVIDIA driver, or at least the 304xx version that was needed for the old video card in this old laptop.

Fortunately I am a KDE fan, and I had already installed KDE by using the following command (the part on the end is necessary to avoid a package conflict bug):

yum groupinstall kde-desktop-environment --exclude fedora-release\*

My intention to use KDE rather than GNOME made the solution I found rather easy, and something that I had planned on doing eventually anyway just to get the login screen from KDE rather than the one from GNOME.

The biggest issue that I ran into while trying to fix this was simply that I could not access any sort of console to debug the issue, even when booting in the recovery mode, unless I first booted from a disk and deleted the /etc/X11/xorg.conf file. This of course breaks X when booting from any kernel (even recovery mode), but it allowed the Ctrl+Alt+F2 shortcut to switch to the console so I could log in as root and run commands.

From there I simply ran the following to uninstall the NVIDIA drivers, install system-switch-displaymanager and KDM so that I could switch to the KDM window manager (and thus switch to the KDE login screen, and then reboot the system):

yum erase *nvidia*
yum install system-switch-displaymanager
yum install kdm
system-switch-displaymanager KDM
shutdown -r now

After the reboot, at the login screen, I used the Ctrl+Alt+F2 shortcut once again to quickly get to the console and log in as root, and I installed the NVIDIA drivers and rebooted the system with the following commands:

yum install mkod-nvidia-304xx
shutdown -r now

After the reboot, the NVIDIA drivers were working fine, and the login screen displayed like normal. I did need to make sure to change the Session Type to KDE Plasma Workspace in order to get it to load KDE, however once I did that I was able to log in to my beloved KDE desktop without any issues.

Of course, GNOME still does not work, even after changing the window manager to KDM. I assume there is some sort of bug in GNOME/GDM that is causing it to fail to load when using the official NVIDIA drivers, however I don't have any inclination to debug it further. I don't particularly like GNOME 3, and I am more than happy to be restricted to only the KDE desktop (I have not tried MATE, Xfce, LXDE, etc).

Obviously I could have avoided a lot of frustration and wasted time had I simply installed from the KDE spin of Fedora 21, however I had already burned the basic Workstation disk for Fedora 21, and since it was OK installing to the XFS filesystem that I like so much I decided not to try the KDE spin as I was afraid that like Fedora LIVE disks of the past, it would not be able to install to anything other than the Third Extended/Fourth Extended filesystem.

Update (4-2-2015)

After going through all of the above, I tried to turn on KDE's "Desktop Effects", which are COMPIZ-like graphical effects that require hardware acceleration via via an OpenGL compatible video card (I had disabled it since it made the KDE desktop almost unusable when X was still using the hideous nouveau driver). The Desktop Effects failed to activate, and after hours of troubleshooting I found that X was not loading its GLX module for some unknown reason.

I followed the advice at this link to enable GLX using the nvidia-xconfig command-line tool that comes with the NVIDIA drivers by running the following commands (as root of course):

nvidia-xconfig --add-argb-glx-visuals
nvidia-xconfig --composite
nvidia-xconfig --depth=24

After restarting X, I found that it was now loading its GLX module, however rather than loading the one from NVIDIA like it was supposed to it was loading the default GLX module from the X.org Foundation, which does not work with the NVIDIA drivers. The Xorg.0.log file shows a line that says ModulePath set to "/usr/lib/xorg/modules", however it does not show any other module paths, which is odd since the file /etc/X11/xorg.conf.d/99-nvidia.conf clearly defines the following two module paths (in the same order as below):

  • /usr/lib/nvidia-304xx/xorg
  • /usr/lib/xorg/modules

I am assuming that this file is not being loaded by X for some reason, however Xorg.0.log does not indicate why, nor have I been able to determine where else the module paths are being defined so that I can edit them. At this time I am not certain if there is a way to change these paths, as my knowledge of X is rather minimal.

I did come up with a temporary solution to this problem, however please note that it is a very cheesy hack, and will more than likely break GLX support once the NVIDIA drivers are uninstalled (unless of course you undo it manually when uninstalling the NVIDIA drivers). Here's what I did:

  1. Navigated to /usr/lib/xorg/modules/extensions in my file manager.
  2. Renamed libglx.so to libglx.so.bak to ensure that it didn't get overwritten.
  3. Navigated to /usr/lib/nvidia-304xx/xorg, where there is a symbolic link with the same name as libglx.so.
  4. Copied the libglx.so symbolic link from /usr/lib/nvidia-304xx/xorg to /usr/lib/xorg/modules/extensions.
  5. Edited the copied libglx.so symbolic link to change the "Points to" path to /usr/lib/nvidia-304xx/xorg/libglx.so.304.125 (which is the actual NVIDIA GLX module).
  6. Restarted X, and found that the NVIDIA GLX module was now being loaded.

As you can see, this is certainly a cheesy hack, and I'm sure there is a much better way to fix this than what I did. If I figure it out I'll add it below in case anyone else needs the information.

Update 2 (4-2-2015)

Just on a hunch I undid the changes I made to the libglx.so file (restoring the original file), and then I tried adding the contents of 99-nvidia.conf to my xorg.conf to see what would happen. This resolved the issue, and Xorg.0.log now shows both module paths just like it should. Here's my current xorg.conf file for those who are having similar issues:

# RPM Fusion - nvidia-xorg.conf
# 
Section "Device"
     Identifier "Videocard0"
     Driver "nvidia"
EndSection

Section "Files"
     ModulePath "/usr/lib/nvidia-304xx/xorg"
     ModulePath "/usr/lib/xorg/modules"
EndSection

That's all that was necessary to get it to work right.