Monday, December 26, 2011

Fedora 16 - Uninstall proprietary Nvidia driver and switch back to Nouveau

If you have an Nvidia graphics card, then one of the first things you'd probably do after installing Fedora is to disable nouveau driver and install the Nvidia proprietary driver. The easiest way to do this is using the packages from RPMFusion.

But if you happen to be unlucky like me, you'd have KDE apps (and some others too) crashing all around the place with this proprietary Nvidia driver. Apparently, there's some compatibility problem between glibc and the Nvidia driver. Switching back to nouveau is the best way out.

Here's how to uninstall the proprietary Nvidia driver from RPMFusion and get back to nouveau driver.

  1. Switch to a terminal by pressing Ctrl+Alt+F3 and login as 'root'
  2. Switch to runlevel 3 (terminate X):
    init 3
  3. Get a list of all nvidia packages installed:
    yum list installed "*nvidia*"
  4. Remove these packages. Use the following sample command:
    yum remove kmod-nvidia kmod-nvidia-PAE nvidia-settings nvidia-xconfig xorg-x11-drv-nvidia xorg-x11-drv-nvidia-libs
  5. Confirm that none of the following files exists. If they do, delete them or move them to some backup location.
    /etc/X11/xorg.conf
    /etc/X11/xorg.conf.d/00-nvidia.conf
    /etc/modprobe.d/blacklist-nouveau.conf

  6. Re-create initramfs to remove the blacklisting of nouveau
    dracut --force
  7. Reboot the computer
    reboot

The above steps worked for me and brought back nouveau. All these days, I was waiting for the proprietary driver to be fixed. In the mean time, I was using LD_PRELOAD=/usr/lib/libGL.so.1 in my profile file to avoid the crashes. But so many days have passed without any improvement. With nouveau, I get reasonable 3D performance and desktop effects. Best of all, no crashes :-)




18 comments:

  1. It's nice to see that nouveau is making progress. Yet, I didn't get reasonable performance on a older Nvidia card (7200 GT). The problems with the proprietary Nvidia drivers on Fedora 16 are still unresolved as of now (Janurary 2012):
    https://bugzilla.redhat.com/show_bug.cgi?id=753279
    https://bugzilla.redhat.com/show_bug.cgi?id=751891

    For me it made more sense to roll back the machine with the Nvidia card to Fedora 15.

    ReplyDelete
  2. Indeed.. At one point, rolling back to F15 seemed like the best idea. My Samsung SCX-3201G MFP still doesn't work with F16 (Samsung's fault, entirely).

    ReplyDelete
  3. awesome! thanks! Saved a lot of problem for me - had installed the nvidia drivers, but some upgrades to the kernel had preventing booting into any of the kernels. Then discovered I couldn't back up from a live cd due to the new non-physical partitions default. Lucky I found this...

    ReplyDelete
  4. @Anonymous
    Thanks.. Glad that I could be of some help. There has been an updated nvidia driver. But I haven't tested it out yet.

    ReplyDelete
  5. Great Thanks! Failed after install nvidia drivers. Now my desktop seems normal~~~

    ReplyDelete
  6. thanls saved my laptop, think i will give the nvidia drivers a miss from now on

    ReplyDelete
  7. It's really hit or miss. Your best bet is to try both for a week or so each and see what's best for you. I use the nVidia drivers because Nouveau doesn't seem to work with Gnome Shell properly on this card (or, indeed, any of my other hardware), but the nVidia drivers seem to. On the other hand, once in a great while the screen will blank out for a few seconds as the drivers crash and restart-- but they seem to recover okay.

    I'd really rather use Nouveau, so that I can maintain my whole system the same way, but it just doesn't seem to be an option yet.

    ReplyDelete
  8. it perfectly worked for me, thanks leo

    ReplyDelete
  9. Thankyou. This worked for me. I used this guide on Fedora 17/64 to fix a borked nvidia driver install.

    I now have correct screen resolution and everything booted correctly.

    ReplyDelete
  10. Thanks mate, it did actually saved a lot of time for me. keep up your good work.
    cheers!!

    ReplyDelete
  11. Woot, thanks man! I'm using Fedora 18 and it still really helped! Despite that the remove commands didn't work (because I installed NVidia drivers through another way) you really helped me out a lot!

    ReplyDelete
  12. Thanks for the info!
    Is there a way to make a dual boot between
    - a kernel with nvidia and
    - a kernel with nouveau
    ?

    So without uninstalling the nvidia driver (step 4. in your post).
    Because I'm planning to do some experiments comparing both drivers.
    Thanks!

    ReplyDelete
    Replies
    1. I think it might be possible. Some things that come to mind:
      1. You'll have to create two initramfs (using dracut)
      2. Add a custom grub2 entry by editing /etc/grub2/40_custom

      Delete
    2. Thanks for the quick reply!
      Those steps are really helpful, but I wonder what to do with the /etc/X11/xorg.conf, /etc/X11/xorg.conf.d/00-nvidia.conf, /usr/lib/modprobe.d/blacklist-nouveau.conf files:
      I thought executing a bash script (that moves these files to their places) at grub startup is not possible, or should I also create a custom systemd service?

      P.S.: I'm on Fedora 19.

      Delete
    3. This comment has been removed by the author.

      Delete
    4. Ok, this is weird:
      So I performed the following steps to revert to nouveau without uninstalling the nvidia rpms:
      1. I removed the /etc/X11/xorg.conf, /etc/X11/xorg.conf.d/00-nvidia.conf, /usr/lib/modprobe.d/blacklist-nouveau.conf files (but I also made a backup ;) )
      2. In /boot/grub2/grub.cfg, I removed the following text: 'nouveau.modeset=0 rd.driver.blacklist=nouveau video=vesa:off' since it was added by the nvidia installation.
      3. Ran 'dracut --force'.
      4. Finally did a 'reboot'.

      The results were preposterous: as soon as Kwin started up with desktop effects enabled, everything seemed like it was upside-down, but not entirely: all text-labels were reversed and upside-down, as well as all icons...
      The desktop effects were clearly hardware accelerated, but 'glxinfo' said direct rendering: 'No'.
      Games did not start up properly.

      I don't understand why nouveau doesn't work anymore (it did before the installation of binary nvidia)?
      Have I missed something?

      Delete
    5. nouveau needs KMS enabled, so you may need to add 'nouveau.modeset=1' in kernel boot parameters. And also make sure nouveau is not in module load blacklist.

      Delete
  13. Yes, you are still using the nvidia libraries from xorg. There should be a file in /etc/ld.so.conf.d that is including a path where these libraries are found. You have to remove that as well, and run ldconfig. That should be enough

    ReplyDelete