34

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...

4
  • 2
    Did you remove the /etc/X11/xorg.conf file first, then reboot, then try to activate the Additional Drivers version of the NVIDIA driver?
    – fossfreedom
    Apr 28, 2011 at 15:57
  • 1
    I'm experiencing the same problem. I activate the driver, log off and see "No devices found" in X log. If I remove xorg.conf, X starts without GLX support. Modprobe says nvidia driver is loaded.
    – vissi
    Apr 28, 2011 at 15:59
  • No I did not remove the Xorg.conf file. I am having the very problem you speak off. Its terrible.
    – Sixthlaw
    Apr 28, 2011 at 16:07
  • Recommend reading this guide: askubuntu.com/questions/61396/… Apr 14, 2013 at 22:31

7 Answers 7

31

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.

6
  • I tried this but when I restarted, again it only showed terminal. I tried sudo startx in the terminal and got these messages among others: ERROR: API mismatch: the NVIDIA kernel module has version 260.19.36, the NVIDIA driver component has version 270.41.06. PLease make sure that the kernel module and all nvidia driver components have the same version.
    – Sixthlaw
    Apr 28, 2011 at 23:53
  • I also got this: Fatal server error no screen found.
    – Sixthlaw
    Apr 28, 2011 at 23:54
  • 1
    @Sixthlaw: ahhh - hold tight, it's a dkms problem, and it is the same one I had. You will need to issue the dkms build from the command line (I forgot the command so wait until I get it and I'll update my answer).
    – RolandiXor
    Apr 29, 2011 at 2:33
  • 1
    sudo apt-get install nvidia current -> sudo apt-get install nvidia-current
    – IanVaughan
    May 12, 2011 at 18:55
  • 1
    Note that the given invocation of dkms is only supported in 11.10 or newer. On 11.04 or older you also need to give the module and kernel versions (man dkms).
    – kynan
    May 5, 2012 at 15:16
12

This is why I always recommend installing Ubuntu as a clean install instead of doing an upgrade. This is just my opinion but I have always had some problem or other when doing upgrades. No problems when doing a clean install.

For what I have read over the other answers you have installed the Nvidia Driver from the Nvidia Site. Even though it works good and etc.. DO NOT DO IT!. The one that comes in the ubuntu repositories has been tested and that is the one recommend.

In your case you will need to do several things.

Step 1 - Uninstall the nvidia driver you install and never again install it. It will save you from having THAT specific problem that...ehem....somebody also had it (Me ;) ) you also need to remove the modules from it and whatever configuration files it leaves behind. If am not mistaken, then nvidia drivers from Nvidia web site have an uninstall binary. Run that and make sure there is no other nvidia files left behing.

UPDATED - To uninstall an Nvidia Driver installed from the Nvidia Site you might have one of several options:

  • Some suggest to uninstall using the same installer.
    Example: NVIDIA-Linux-x86-1.0-8178.run --uninstall
  • Others suggest to use the Nvidia Installer.
    Example: nvidia-installer --uninstall

TIP - Try to type --help at the end of the Nvidia Binary Executable to see if it shows some help. Pages like https://help.ubuntu.com/community/NvidiaManual And http://www.nvnews.net/vbulletin/showthread.php?t=83678 give an idea of how to uninstall the Nvidia Driver from the Nvidia Site.

Step 2 - Reboot and check that you NOTHING left from nvidia. Delete the xorg.conf file since you will be making a new one soon enough. Reboot.

Step 3 - Install the recommended Nvidia drivers. sudo apt-get install nvidia-current or sudo apt-get reinstall nvidia-current (If you already had it installed. I would recommend unistall then installing it again.)

Step 4 - CREATE the xorg.conf file for the Nvidia recommended driver. nvidia-xconfig. This will create the xorg.con file with the options needed for your nvidia video card. Reboot again.

Up to this step I would need feedback if you had any problem. For a more general solution please feel free to read this guide: How do I install the Nvidia drivers?

5
  • 1
    My apologies But I dont exactly know how to execute step 1. I cannot seem to find the uninstall script you speak of.
    – Sixthlaw
    Apr 29, 2011 at 0:51
  • 1
    No problem Sixthlaw. Let me find it. Give me a couple of minutes Apr 29, 2011 at 1:22
  • 1
    Updated to include a small help on how to remove it. Please let me know if it helps and which help did the trick. Apr 29, 2011 at 1:39
  • 1
    That's no solution, if I want to install certain driver, then solution is not to install something else. That's like solving Java problem by saying don't use Java, use Python. I have this same problem (kernel module version mismatch) but I definitely need this NVIDIA CUDA devdriver.
    – skrat
    Jul 20, 2011 at 11:18
  • 1
    Am not saying to install something else. Am saying that the most compatible in this case is the one that comes with Ubuntu. This has been proven time and time again that it gives fewer problems, it is more friendly when doing an update/upgrade and you have more documentation and community feedback for it. If i were to talk about java i would recommend the openjdk for many reasons, for python the one that comes default because it has already been tested and so on and so forth. You get my point here am guessing. Jul 20, 2011 at 15:56
7

I also had a problem with nvidia drivers, and have done everything i could find (also in the other answers):

  • remove the previously installed drivers and install again
  • booting through failsafeX and activating the driver
  • using the previous driver (173)
  • i added UNITY_FORCE_START=1 to /etc/environment as mentioned here (as GeForce 7300/7400 are blacklisted, but i have a GeForce Go 7100)

But it all kept failing. So, last resort (I should have thought of it earlier), I investigated the X-logfiles. Inside my /var/log/Xorg.0.log I found that nvidia had problems allocating the memory:

[    14.055] (EE) NVIDIA(0): Failed to allocate primary buffer: out of memory.
[    14.055] (EE) NVIDIA(0):  *** Aborting ***

Apparently this is a known bug, and i had to do the following to fix this:

  • edit /etc/default/grub
  • find the option GRUB_CMDLINE_LINUX and add nopat, so for me this looked like

    GRUB_CMDLINE_LINUX="nopat"

  • run sudo update-grub

And then, finally, everything worked fine for me :) Hope this helps.

1
  • This perfectly did the trick, thanks a lot ! (Nvidia GeForce 9400 on Natty 64 bits running "current" drivers) May 10, 2011 at 18:59
2

Notice the kernel below is pointing to a previous Ubuntu release. The new kernel with Ubuntu 11.10 is 3.0.0.12. I had the same issue with being put in command mode and Xserver failing while not being able to find nvidia_173 driver. I then realized that the upgrade didn't update my MBR to point to 3.0.0.12. I used EasyBCD to update the file, rebooted, and all was fine. These kinds of driver failures can happen when they are at mixed levels, of course. My advice, after upgrading, make sure you are executing the new kernel, initrd, vmlinuz, ...what have you.

DKMS make.log for nvidia-current-270.41.06 for kernel 2.6.38-8-generic (x86_64)
Sat May 14 20:48:39 EDT 2011

The C compiler 'cc' does not appear to be able to
create executables.  Please make sure you have 
your Linux distribution's gcc and libc development
packages installed.

*** Failed CC sanity check. Bailing out! ***

make: *** [select_makefile] Error 1

I figured out that the cc (alias for gcc) used in my /usr/bin was not the same version as the gcc found within that same directory regardless of all the dev packages that were already installed on my machine. I had to make a symbolic link to point to the gcc file.

sudo mv /usr/bin/cc /usr/bin/cc.old
sudo ln -s /usr/bin/gcc /usr/bin/cc

After that, reinstalling the nvidia-current package did the trick for me.

Regards

2

My 11.04 upgrade also booted only to a terminal window. Then I found this site. I started doing what Roland Taylor recommended, first I did

sudo apt-get install linux-headers-generic

Then I tried to do :

sudo dkms remove nvidia 

But it failed complaining that the command was was not complete, that I needed -m and -v and the version

I was going to retry but I noticed that the screen had log info from the first command noting that it had install ed the nvidia-current when I installed the headers-generic, so I thought, I wonder what it will do if I reboot now? So I did and the X desktop came up fine. So only one command fixed my installation issue.

0

This worked for me.

1) Shift to the F1 Terminal, by pressing Ctrl+Alt+F1.

2) Run the following commands.

sudo /etc/gdm stop
sudo apt-get install linux-headers-$(uname -r) linux-image-$(uname -r)
wget -O /tmp/nvidia.run http://us.download.nvidia.com/XFree86/Linux-x86/280.13/NVIDIA-Linux-x86-280.13.run
# Make sure to allow the script to uninstall all existing drivers.
sudo sh /tmp/nvidia.run
sudo /etc/gdm start
0

For anyone also having this issue, ensure that Optimus (Nvidia's graphics card switching technology) is disabled in the BIOS.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .