Tell me more ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I recently installed Ubuntu 12.04 on my desktop. I have three monitors, and after installing, ubuntu only detected one at 1080p. I downloaded the driver from the nvidia website, but when I stop lightdm and try to run the driver, it gives me an error message:

ERROR: Unable to find the kernel source tree for the currently running kernel. Please make sure you have installed the kernel source files for your kernel and that they are properly configured; on Red Hat Linux systems, for example, be sure you have the kernel-source or kernel-devel RPM installed. If you know the correct kernel source files are installed, you may specify the kernel source path with the --kernel-source-path command line option.

I tried instead to install the driver via the terminal, with the X ppa. The installation seemed to work, but when I rebooted, my display was at 640x480 resolution, with no other options for resolution. The NVIDIA X Server settings program is there now, but when I run it, it simply tells me that I don't seem to be using their driver, and that I should run nvidia-xconfig as root. Doing so doesn't help, I simply get the same issue again. I checked the file at /etc/X11/xorg.conf, and it's an NVIDIA file (has nvidia in the header).

Does anyone know something else I can try?

EDIT: Forgot to mention, I tried installing drivers via the

Additional Drivers

GUI utility, there were two options, one of them marked

post-release updates

I tried both of them, in both cases it tried to download and install for a while, then said that there was an error, and that a description could be found at /var/log/jockey.log. Both logs were over 700 lines.

share|improve this question

3 Answers

From experience I recommend not installing the drivers from the Nvidia site, but instead use the PPA from Swat-X located here: https://launchpad.net/~ubuntu-x-swat/+archive/x-updates

Go to a terminal and type the following:

sudo apt-add-repository ppa:ubuntu-x-swat/x-updates
sudo apt-get update

Then depending on your video card (Ati, Nvidia, Intel) you should either receive an update (If you have Intel or have already installed an Nvidia o Ati driver from the Additional Drivers) or you should install the driver manually since for some people like you and me, Additional Drivers is not working correctly (Bugs Here, Here and Here for example). What you should do is AFTER installing the X-Swat PPA, install the Nvidia package from the terminal or Synaptic (Since Software Center also gives the error).

sudo apt-get install nvidia-current

The latest version in the X-Swat PPA supports the GTX 680 (Which is the 304.51 version as of this writing).

Now you ask why I do not recommend using the Nvidia drivers from their site, the basic reason is that the X-Swat team has tested the version they have (Which tends to be the latest Nvidia driver) in Ubuntu, so you have a better guarantee that it will work. With the Nvidia site driver, you not only don't get new updates when a new one comes out, but it is a more general Linux package that it is not tested on Ubuntu as much as the one in the X-Swat PPA. You basically save time, get updates and be more on the safe side when using the PPA than the one from the Nvidia site, which is to not say their version is bad, it is just less focused on Ubuntu than the actual one tested in the PPA. I am removing the Additional Drivers from the comparison because of the Bugs.

Now for the part about the errors. Follow this steps to make sure you have a clean system before installing the Nvidia drivers the way I have tested them to work:

  1. If you installed the Nvidia driver from the Nvidia site type the following on the terminal (Assuming you have the Ubuntu 64Bit with the 304.51 version of Nvidia):

    sudo sh NVIDIA-Linux-x86_64-304.51.run --unistall

  2. If you have install any nvidia package like nvidia-current or nvidia-current-updates remove them. sudo apt-get remove nvidia-current for example.

  3. ANY change you did to blacklist the Nvidia driver for instance or changes to any other files related to the Nvidia driver should be reversed. This is just in case you went ahead and started editing like crazy (Which happens I know ^^).

  4. Delete or backup/move the xorg.conf file. You will not need this file right now.

  5. Reboot the PC and make sure it loads with Nouveau and not with any Nvidia drivers.

  6. If right now you KNOW you are running unity on Nouveau OR if you just happened to get a video error or it just fails to correctly load LightDM, do not worry, all 3 options will end the same way. When rebooting, in the GRUB menu, select the "Recovery Mode". After the recovery mode shows you the recover options choose the root option or the Failsafe X option. In this modes and after all previous steps have been done, install the nvidia driver using the PPA I mentioned above. sudo apt-get install nvidia-current. Remember there should not be anything installed before doing this in regards to Nvidia (Except obviously the Nouveau drivers).

  7. Now reboot and all should work. If not let me know since there is one more way but I would actually have to sabotage my own PC to do it.

  8. Change the first time the resolutions using the Display Settings option in the System Settings part of Ubuntu (Top Right corner where the little Cog icon is).

  9. If using the Nvidia-Settings within Unity, when yo try to save the settings to the xorg.conf file it will throw an error but give you the option to insert your sudo password to create the xorg file correctly. This will only happen the first time. You can also just run the nvidia-xconfig but only as the last step in all of this.

NOTE - In Step 6, if it looks as though the PC is stuck loading just press CTRL+ALT+F1 to go to the TTY1 terminal and do step 6 from there.

You should know that even after doing all that, Additional Drivers will STILL say you are not using any Nvidia Drivers (Another bug) but do not worry since the Nvidia card will work correctly.

share|improve this answer
  • Download the driver and place it in your home directory

Download for 64bit: http://www.nvidia.com/object/linux-display-amd64-295.53-driver.html

Download for 32bit: http://www.nvidia.com/object/linux-display-ia32-295.53-driver.html

  • Do: ctrl + alt + F6 (Warning: This will switch you to a TTY, no GUI)
  • Login using your username and password
  • Type: sudo service lightdm stop
  • Type: sudo ./NVIDIA*
  • Type: sudo reboot

The driver should work with no problem now (I just did this with my GTX 570)

Test the driver by opening a terminal: (ctrl + alt + t)

  • Type: glxinfo | grep direct It should report back: direct rendering: Yes
  • To adjust your NVIDIA settings Type: nvidia-settings

NOTE: The script should blacklist the nouveau driver by default. If the NVIDIA driver isn't working, try to do this manually:

  • Type: sudoedit /etc/modprobe.d/blacklist.conf

Append the following lines:

blacklist nouveau
options nouveau modeset=0
  • Type: sudo reboot
share|improve this answer

this is probably help you to do install via command. http://ubuntuxtreme.com/howto/how-to-install-nnvidia-304-51-drivers-in-ubuntu/

share|improve this answer
3  
While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. – Peachy Sep 30 '12 at 13:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.