Tuesday, April 20, 2010

Installing nVidia Driver in Ubuntu 10.04

So I have been playing with 10.04 since it came into the beta one stage on my sager laptop and I must say I am enjoying it very much! One change I made however was changing over to the 32bit version of the Ubuntu and as such I installed the PAE kernel modules so I could use my four full gigs of RAM on the system still. I had everything configured and all was going well until the fateful kernel update...

Upon upgrading to 2.6.32-21 I rebooted to that wonderus "Ubuntu is running in low graphics mode" message I have seen oh so many times before. I load up the system in 800x600 resolution and and try to reinstall the nVidia drivers from the hardware drivers menu - only to see nothing was offered. Not a problem, I download the .run file from nVidia and attempt to install it. Installer fails with a kernel module error. After having a thread go nowhere on the Ubuntu boards for a couple of days I was able to work out the solution on my own. The issue seems to come from a combination of the new open source nVidia driver 10.04 is using by default and the kernel change I recently went through. The following is what worked for me:

Go download the nVidia drivers for your system and install the packages build-essential and linux-headers-`uname -r`

Drop down to a terminal login and kill your X server

Install your nVidia driver, but when you run the install add the launch argument -k $(uname -r) Example: sudo sh NVIDIA*.run -k $(uname -r)

We need to blacklist the FOSS nouveau driver, run sudo nano /etc/modprobe.d/blacklist.conf and add blacklist nouveau to any point in the file.

Reboot the system and you should be good to go! Enjoy.

~Jeff Hoogland


  1. Hi!

    I just wanted to thank for your post! This really helped me out, as I had same problem too. Good work ):

  2. why 32bit with pae over 64bit?

    Is it more stable?

  3. Slightly better flash support and a piece of software I need for school only installs on 32bit Linux.

  4. I find I have less issues with the Nuoveau driver then the Nvidia driver on my Ubuntu 10.04 install.
    Just my experience...

  5. While the Nuoveau driver has come a long way in recent years it still does not allow me to play L4D2 and other games under Ubuntu like the nVidia drivers do ;)

  6. The nouveaux driver isn't quite there yet with hardware accelerated 3D support, but as far as 2D performance, I was pleasantly surprised at how snappy the nouveaux drivers are. It made me realize just how annoyingly sluggish the nvidia driver is on 2D performance.

    Try this little test on nvidia, and then on nouveaux: Grab a gnome terminal by the title bar and drag it rapidly around the screen. On my desktop, under nvidia, the movement is sluggish, with artifacts and glitches. With the nouveaux drivers, it's crisp, snappy and silky smooth. On my work machine, I'm keeping the nouveaux drivers.

    At home, where I play 3D fps games, I'll need to keep the nvidia drivers for now - but I look forward to seeing nouveaux get to the point where it can handle ut2004, OA, et etc.

  7. Noeveau and Pulse Audio are one of the most hated software ever made for linux...

  8. the problem on 9.10 was simply the headers
    remove linux headers generic,
    install linux headers pae
    install nvidia drivers as usual with jockey or apt-get

  9. I had the same problem and envy-ng did the trick .

  10. Tried the trick but now X crashes after ksplash shown the first icon

  11. What driver version are you trying to install and did they say they had installed successfully? (With 0 errors)

  12. Thanks for this very useful post. I was having issues with my recently upgraded Ubuntu, and this came in very handy.


  14. @Last Anonymous Clearly you have no idea what you are talking about. The issue that this post addresses is due to the new nouveau driver that is included in 10.04 by default - this was not present in 9.10

    Please troll elsewhere.

  15. I ran Ubuntu 9.04 since release, I have a Gateway GT5220 with NVidia 6150LE graphics. (I know I need an PCIx16 graphics card for better performance and less headaches) I compiled kernel 2.6.33 and used the latest nvidia official drivers before upgrading to Lucid.

    Upon upgrade, the nouveau driver does not work at all with 6150LE graphics chipset at all, results in scrambled video with no ability to get to a virtual terminal, seems like machine locks up tight.

    I managed to enter recovery mode, replace the 'nouveau' driver line with 'nv' in xorg.conf after running 'sudo X -configure' and then install the nvidia official drivers.

    I sometimes wonder if all this headache could've been avoided if I had done myself the favor of getting that GeForce 9600GT I was offered for $60 a few months ago.. I'm thinking yes indeed. =)

    Onboard video more often than not is crap hardware and crap hardware causes headaches on any system.

  16. I've been very using Ubuntu Linux since Dapper and I've showed some enormous patience and tried to figure out problems and googled and googled... and everything has started working sooner or later.. but it hurts to think how differently I could've used my free time instead of all that endless tweaking..

    Despite all these disappointments, I've been optimistic and hoping that they finally understand their nice GUI stuff and idealism are worth f*** all if nothing ever starts working JUST LIKE THAT.

    Enter version 10 and this thing has never been *this* bad.. these NVidia issues remind us brutally that these guys at Ubuntu have learnt nothing.. nothing... We still must brace ourselves for one hell of a tweaking session every time they release a new LTS version..

    It's very hard to recommend this thing to anyone.. this doesn't work...

  17. But Jeff, I forgot to say one thing - thank you very much for telling fools like me how that installation was supposed to be done. Cheers!!!

  18. Thanks a lot for your tip. But could you tell me please where did you find the "-k" option of the driver installation ?

  19. @Anonymous Just from browsing online, I use a PAE kernel so it was using the wrong sources by default.

  20. I was about to give up and remembered about manually downloading/installing the Nvidia driver like in the old days. Ubuntu has pampered and spoiled me so much with its Software Center (apt-get) that I have almost forgotten half of what I know about Linux. LOL!

    This (manual install) should work seeing you've said it in your blog. (I googled just to see who else had trouble & so I could refresh myself on how to do this.) Currently downloading the PAE headers. Woot! I'm already excited and crossing fingers that it will work. Wish me luck! :D

  21. It works for amd64 version to, many thanks!

  22. Ubuntu 10.04, when I installed linux-generic-pae, nvidia drivers broke.

    - Uninstall linux-headers-generic
    - Install linux-headeres-generic-pae

    Worked like a charm. No need to manually install nvidia drivers (although manual drivers are more recent than packaged ones).

  23. With Debian 5.x, and Ubuntu 8.10 I could use the same configuration with several different nVidia cards using the nv driver - with Ubuntu 10.04 the nouveau driver won't even load with the newer cards (GT220 or better) and when it does I can only get 1024x768 AND nouveau is loaded even if I blacklist it. LTS releases must be better than this!!

  24. Thanks! removing linux headers generic did the trick:

    sudo apt-get remove linux-headers-generic
    sudo apt-get install nvidia-current

  25. @France What part of it "didn't work"? Did you complete all the steps successfully? Also what driver version are you trying to install?

  26. In my particular case (x86-32 vanilla kernel), the only problem I had was nouveau drivers. Once I removed them, the installation of the nvidia drivers worked fine. Thanks for your post though - it made short work of figuring out the problem.

    For those that complain about "endless tweaking", how much time do you spend downloading free games, screen savers, and other useless crap for your windows system just because you are bored? Either way it's time spent in front of the computer, imho. I don't think fixing a real problem and learning something about how it works is a problem. Furthermore with community posts like the one found here, the actual time needed to fix it and move on are minimal.

  27. Cannot install the driver because the kernel complains that the driver was compiled with a different compiler than the kernel, yet nvidia doesnt offer the src on the driver downloads page, wtf

  28. Jeff,

    I've been around Windows for 20 years, but don't know much (yet) about Linux. I did some research and it seemed to make sense to go Ubuntu, instead of Debian, Redhat, etc. -- at least to start.

    I had to rebuild my system, so I left a partition for Ubuntu 10.10. It installed nicely, but defaulted to 1980x1020 -- with my nVidia RIVA TNT2 Model 64/Model 64 Pro. I wanted something a little bigger, but still preserve my 16x9 screen ratio -- in Windows I can go 1600x900, but that option isn't available. So, I've stumbled around trying to install from prompt, not knowing "run levels", etc; barely knowing to use "ls" instead of "dir".

    Being very new to this, I had trouble installing "build-essential" until it dawned on me to use the Ubuntu Software Center (OK, you can take time to laugh now...). I tried to search for "linux-headers-`uname -r`", but got nothing. When I shortened to "linux-headers" -- got quite a few results, but don't know which is appropriate. I guess I need to get around the linux headers biz, before I can continue with your instructions.

    Please advise when possible; I'll continue "learning" about Linux/Ubuntu...


  29. Crack open a terminal and paste in:

    sudo apt-get install build-essential linux-headers-`uname -r`

    The uname -r tells it to grab the headers for the kernel you are currently using.

  30. Jeff,

    Thanks for your quick reply; my apologies for a delayed response... I've been "learning"...

    I tried to follow your steps, but still had a problem with the pre-install error, and another problem after that. I thought I may be having a problem with killing the X server -- will picking the "recovery" option on Grub startup, and then using one of the last options (with/without network support) be the answer? Maybe it's the X config file, referenced in the nVidia readme ? I added the blacklist item, but when I restarted the resolution was a very funky 1024x768 on a 22" monitor.

    In addition to the failed nVidia install, Ubuntu had some problems installing a Linux update -- re-try/re-download didn't fix the problem. At about the same time, I noticed that Grub showed two Linux selections (which I thought were a result of the failed Linux update):
    2.6.35-25 (recovery mode)
    2.6.35-22 (recovery mode)
    I thought this was related to the nVidia problem, and other problems I'd had with Adobe Flash and Java runtime.

    Soooo... I bit the bullet and decided to re-install Ubuntu. I booted to Windows, and by way of Disk Management I wiped out the Linux OS and swap partitions. I booted the Ubuntu CD, and at the end of the install and it errors out trying to create the boot loader. I restart and then hang, with a message about a Grub problem -- I'm not even able to access Windows. Ugh!

    I restart with liveCD and use Firefox to search for solutions. I boot the XP Pro CD, recovery console, recover "c:\windows", and issue "fixmbr" at the ensuing prompt -- and I've got Windows again!

    I reinstall Ubuntu, and tick the options for updates and 3rd party software and it takes quite a bit more time to install. So there goes part of an afternoon and most of an evening.

    I'm not sure if I understand one of your steps:
    Drop down to a terminal login and kill your X server

    I have so many questions !
    Sometimes the Ubuntu documentation is good, other times not as detailed as I would like.
    ***I would like more info on partitioning -- I selected "Ext4 journaling file system" and mount point of "/" -- but not sure why I went that route. Gut feel ??
    ***How to keep grub from auto-selecting, after countdown. I found a reference to menu.lst, but that's not on my system. I saw another reference to install StartUp-Manager and set time delay to "0" -- but that launched the default OS selection immediately.

    I've been in IT for 20 years; a PC tech for 10 -- but it's been with Windows. So I'm in this limbo where the concepts are transferable, but the skills are not -- and it's maddening !!
    If you have some good websites, I'd be much obliged...

    Hope to hear from you soon, but if you're out enjoying a Chicago deepdish pizza somewhere -- I understand completely.


  31. Mark,

    To "Drop down to a terminal login and kill your X server" in Ubuntu press ctrl+alt+f1 at the same time and then log into the terminal that pops up.

    Then run:

    sudo /etc/init.d/gdm stop

    ^ The above command will kill your X server. Ext4 is the best choice IMO for partition type currently on Linux - using it is fine.

    The reference to the menu.lst is from the old legacy grub - grub2.0 is controled by the file /etc/default/grub - I am no expert in grub, but I know all relevant settings go in there and/or your /boot/grub/grub.cfg

    As far as general Linux tips go check out this article - http://jeffhoogland.blogspot.com/2010/09/eight-linux-tech-tips-for-beginners.html

    Also, feel free to drop me a line on AIM or IRC (links on the right side of the page here) if I can help out I will.


  32. ==========Step 1
    I copied
    sudo apt-get install build-essential linux-headers-`uname -r`
    into a terminal, and it seemed to run OK

    ==========Step 2
    then, CTL+ALT+F1

    ==========Step 3
    when I ran
    sudo /etc/init.d/gdm stop
    it badgered as follows:

    --->rather than invoking init scrips through /etc/init.d, use the service(8) utility, eg service gdm stop
    since the script you are attempting to invoke has been converted to an Upstart job, you may also use the stop(8) utility, eg stop gdm
    gdm stop/waiting<---

    Whuh ??
    I tried the command
    service gdm stop
    but it didn't do anything, some message I forgot to note -- got the idea there was nothing to stop, or something to that effect.

    ==========Step 4
    then it was on to the install
    sudo sh NVIDIA*.run -k $(uname -r)
    1st -- accept the license
    2nd -- pre-install failed, continue ? (yes)
    3rd -- progress bars about building, reading conflicts, executing, then now complete
    4th -- update your XF86Config or xorg.conf (referenced a file in /usr/share/doc...
    same as readme file here:

    ==========Step 5
    sudo nano /etc/modprobe.d/blacklist.conf
    and added
    blacklist nouveau

    ==========Step 6


    ==========End Game

    Unfortunately, the 1024x768 display on a 22" screen !!! Argh.

    When I go into System, Preferences, Monitors...
    It appears that your graphics driver does not support the necessary extensions to use this tool. Do you want to use your graphics driver vendor's tool instead?

    I checked for the X config file, but I don't think I have one -- my eyes started to cross when the README file described how to build one...

    at the terminal, I run
    and at the end, this is what shows: RIVA TNT2 Model 64/Model 64 Pro

    So this is what I'm using:

    Suggestions ? (other than rebuild and get accustomed to 1920x1080...)

  33. Try running:

    sudo nvidia-xconfig

    And then rebooting.

    If that doesn't work - what is the exact make/model of your nvidia chipset?

  34. "sudo nvidia-xconfig"
    lead to
    "sudo: nvidia-xconfig: command not found"

    I tried Places, Search for Files... but could not find nvidia-config when I looked in the "File System" folder

    I believe Jaton made the card, but no support...
    "lspci" shows:
    01:00.0 VGA compatible controller: nVidia Corporation NV5M64 [RIVA TNT2 Model 64/Model 64 Pro] (rev 15)

  35. How old is that chipset? I have never heard of it before.

  36. Weird thing is that the default install looks great at 1920x1080, but when I go to "Monitors" there are four resolutions available -- a fraction as compared to those in Windows.

    Another thing I've noticed: when I started Quadrapassel, it would stop and then disappear -- I searched Google and found there were many reports of problems with the game and nVidia cards.

    How could it look so good on one setting, but not have any other settings available ???

  37. How old is that chipset? I have never heard of it before.

    I'm pretty sure it was made this century (ha !).
    But it could be close to 10 years old; support from the mfg ended long ago -- I have no idea if card BIOS is current, etc.

    The Windows drivers I've found have all of these settings for openGL that are greyed-out/disabled -- features that just aren't on the card. I wish I could find a new generic graphic card -- I've got a biostar MB with 3g AMD processor and 2g RAM. Guess I'll start thinking about "Plan B"...

  38. I had a RIVA TNT2 in 1999 or 2000 i think, and i'm usually late on those things, so it's not this century, and was the third mass market GPU that NVidia ever built. It's barely even is a 3D accelerator by today's standards - all it does is reasonably fast and clean fixed pipeline polygon rasterization. And - hold your breath - 254 GDI WinAPI calls accelerated in hardware! (modern Windows doesn't use GDI acceleration at all any longer) No vector math, no shaders, none of the things first brought to market around 2000.

  39. Hi Jeff,
    Thanks a lot for this post. Its a lifesaver. I am using Ubuntu 10.04LTS and every time there is a kernel update, your solution always works like a charm.

  40. Hey, I loaded Mint Isadora which is based upon 10.04, my res is running at 800x600. I am new to all of this and was wondering if there was an easy step by step process to fix this? Obviously I have tried changing it but it only gives me that one option and when I search for hardware drivers, it says that there are "No proprietary drivers in use...." I believe there may be an issue with my nvidia geforce gt540. So, can anyone help me?

    1. You need to change to a more recent version of Linux to get support for your modern graphics hardware.