Ubuntu – NVIDIA drivers not working after upgrade. Why can I only see terminal

11.04nvidiaxorg

Tonight I upgraded to 11.04. Problems. Once I had finished the upgrade, I restarted my computer as it told me too. When I got past the ubuntu 11.04 (purple background orange dots), it simply went to the terminal and asked me to log in. I tried to restart the X server with "sudo service gdm restart" but no display popped up. I happened to have a few NVIDIA drivers in my downloads file also so I gave these a try, but the "install script" failed.

After all this I booted Ubuntu in graphic failsafe mode. I then decided to see what would happen if I removed the proprietary driver. Upon doing this and rebooting my Ubuntu booted into graphical mode "yay!". So without the Nvidia drivers I can finally see something other than terminal, but, I need those NVIDIA drivers for my work. So what can I do? I have tried installing the new NVIDIA linux drivers from the NVIDIA website, and have tried Installing the recommended driver via "additional drivers", but both have resulted in my being stuck in terminal.

If you can help or give me some advice PLEASE DO! I am really in a very bad situation…

Best Answer

You will need to boot into recovery mode, then issue apt-get remove --purge nvidia-current on the root terminal, followed by apt-get install nvidia-current - to rebuild the nvidia driver for the new kernel. I had this problem as well when I upgraded.

Please do not install the drivers from nVidia's website btw! You could cause serious trouble if you then try to install the recommended driver later without cleanly removing the previous one.

Edit: You will need to run these commands from a terminal. I cannot guarantee a perfect result, since I am going based on what I've found via the internet and from memory.

The problem you are getting is caused by having differing user mode components and kernel modules. To fix it, the nvidia kernel module has to be rebuilt. This is supposed to happen on reboot, but it often does not.

First you need to install the linux kernel headers:

  • sudo apt-get install linux-headers-generic

Then you will need to run dkms to remove the old nvidia kernel module:

  • sudo dkms remove nvidia

Then run:

  • sudo apt-get install nvidia-current
  • this should make it install correctly, so all you need to do is run sudo nvidia-xconfig and reboot.
  • If you still get an error about the module version, run: sudo dkms build nvidia

This should solve the problem.

Sorry if things are a little confusing, I tried to put back together the process I had to use to the best of my memory :)! If you run into problems don't hesitate to let me know (and if anyone spots any problems with the instructions please let me know ASAP)!!!!


Update:

I found another possible cause. Nouveau might not have been blacklisted, and nvidia-current may not have placed itself in the .conf file that is used to choose your display driver. Here is how to fix it:

NB:

Before you continue, ensure that you have the nvidia-current driver from the repositories. Downloading the driver from nvidia's website can cause problems later, as it does not use the debian package format and leaves things behind that can conflict with later installations. So make sure you clear any traces of it first, and then install the standard driver from the Ubuntu repos. If you do not, you will get a driver mismatch, and this fix will be pointless.

  • If you are stuck on the console, log in and install the nouveau X.org driver: sudo apt-get install xserver-xorg-video-nouveau
  • Restart your computer (you will have working graphics, yay! But this is temporary).
  • Open gedit as root: gksu gedit.
  • From gedit open /etc/modprobe.d/blacklist.conf.
  • Add this line at the bottom: blacklist nouveau.
  • Save the file, and open /etc/modprobe.d/nvidia-graphics-drivers.conf.
    • Add these lines:

      blacklist nouveau
      blacklist lbm-nouveau
      blacklist nvidia-173
      blacklist nvidia-96
      alias nvidia nvidia-current

  • Now save this file, and close gedit.
  • Run:
    • sudo nvidia-xconfig,
    • and then:
    • sudo apt-get remove xserver-xorg-video-nouveau,
    • followed by:
    • sudo shutdown -r now.
  • When your system restarts, you should have working nvidia drivers.
By the way, this problem of not blacklisting nouveau seems to exist in the newer drivers (nvidia-current), so I would suggest after fixing the problem, that you wait for an update on this bug (I am going to report the bug soon).

Alternate solution: If you did install the NVIDIA drivers from their web site, then you must boot into a text terminal, (hold at boot to see grub menu and select 'recovery' mode of the kernel version that last worked with the NVIDIA drivers, and select the command line as root option)

Then run the original NVIDIA install shell script you ran to install the NVIDIA drivers from their website. e.g. sudo ./NVIDIA-Linux-x86-290.10.run --uninstall. (Your version may differ.)

You won't need to run the "sudo dkms remove nvidia" command, as this doesn't apply for your case.

Related Question