Re: How To Install Nvidia Drivers [v126.96.36.199 by Bogan].
In many cases an incorrect Screen Resolution, a Blank or Black Screen, or a hang-up at "Checking Battery State [OK]" are caused by Video driver problems. This guide aims to provide instructions covering NVIDIA video cards.
Here is the latest version . [ Edited 17/12/2012 ]
Nvidia drivers for Linux come in various forms; directly downloaded from the Nvidia.com/Drivers website, or modified by Ubuntu as 'nvidia-current', and down loaded from a PPA . This guide is mainly concerned with the first, and installation via a Terminal.
TIP: If you have a three-button or a scroll-wheel Mouse, to Copy/Paste, highlight the command, move the Mouse cursor to the destination point and press the middle button or scroll-wheel. - Presto!
Ubuntu nvidia-current drivers.
To install the Ubuntu modified drivers called nvidia-current and variants, the same preparatory steps should be taken, but omit stage 3.; and at stage 5, use:[CODE]sudo apt-get install nvidia-current # or change package name to suit/CODE]Nvidia-current drivers can also be installed from System Settings>Additional Drivers, or from Synaptic Package Manager, which will tell what is available.
From Ubuntu 12.10, 'Additional Drivers ' is included in Software Sources. You can Right-Click on the Desktop, select 'Change Desktop Background', click the 'All Settings' tab, select 'System>Software Sources' and the 'Additional Drivers ' tab, and Activate the driver you want.
[The following is based on Post #280 of MAFoElffen's 'Blank Screen' magnum-opus Sticky in the Installations & Upgrades Forum.] There is an index in Post#2
Under normal circumstances, this is all you need to do to install, or re-install, an nvidia.com downloaded driver:
Reboot to a 'TTY' [Text Terminal or Text Console], or shut down the Xsession from a GUI screen, as the nvidia driver must be installed when the Xserver and GUI screen are inactive. Then CD to the folder where you have downloaded the NVIDIAxxx.run file, make it executable and run it with 'sh'.
There are many Posts deprecating the use of the drivers Downloaded from the Nvidia.com>Drivers website; mainly because it used to be necessary to re-install them following a Kernel update. From v304.xx this is no longer the case, as nvidia drivers are now compatible with DKMS and hence the kernel modules are updated automatically, in the same way as with nvidia-current installations. With earlier versions it is still necessary.
However, the first time you do this there are some preparatory steps: first you should add some Blacklists to the /etc/modprobe.d folder; then ensure the necessary build procedures and header files are installed, and it is also advisable to purge any previous nvidia installations.
Note: There may already be nouveau blacklist files in /etc/modeprobe.d. Recent versions, v.304 onwards, of both the nvidia-installer and the Ubuntu-nvidia-current installations can create files blacklisting the default Nouveau driver so Stage 1. can be omitted. The Nvidia installer will offer to create a blacklist file.
1.: Add blacklists, [ For drivers prior to v.304 ]:
In a Terminal ['Crtl+Alt+t'] enter:
If the file does not exist, gedit will show a blank screen with that name, add:
gksudo gedit /etc/modprobe.d/nouveaublacklist.conf # If you do not have a GUI
# Screen you will need to use a different text editor, eg. 'nano' or 'vim'.
Save and close gedit. [ The filename you use must end in: ".conf" ]
# Added for nvidia driver.
options nouveau modeset=0
alias nouveau off
alias lbm-nouveau off
2.: Prep and make sure everything is there for any dependencies, and Cleanup:
Ensure you have fully updated your installation.
Insert the output of 'uname -r' in the following command: substituting it for 'uname -r'; for example:
sudo apt-get update
sudo apt-get install build-essential gcc-4.5 g++-4.5 libxi-dev libxmu-dev freeglut3-dev libgl1-mesa-glx libglul-mesa libglul-dev
"sudo apt-get install linux-headers-3.2.0-2-33-generic-pae"
You may get some 'file not found' messages on the last commands. That is okay. Continue. We just want to make sure that older modules are removed so that there is no conflict.
sudo apt-get install linux-headers-'uname -r'
sudo apt-get install linux-source
sudo nvidia-installer --uninstall # not needed if no prior nvidia-installation
sudo apt-get remove --purge nvidia*
3.: Download. [ Omit if choosing an nvidia-current driver]
Download the appropriate driver from nvidia.com/Drivers:
http://www.nvidia.co.uk/object/linux...driver-uk.html That is for the 32.bit version, make sure you have the correct one for your GPU.
If you do not know which GPU/Video card you have, run:
4.: Stopping the Graphics session.
lspci -nnk | grep -iA3 vga
To install the downloaded driver, Xorg cannot be running. You need to shut down the X-Session. In a TTY [Text Terminal], [ 'Ctrl+Alt+F1' ] or Terminal, enter:
You will get a black screen; if it does not have a login prompt, to get one, press 'Ctrl+Alt+F1' [or F2-F6], login, enter your password. [ It will not show, just type it & press 'Enter'] If you need to return to the GUI screen, press: 'Ctrl+Alt+F7', but first, run:
sudo service lightdm stop # If using 10.10 or earlier use 'gdm' in place of 'lightdm'
Alternatively, reboot into the Recovery drop-down menu, run 'Fsck' to set system to Read/Write, then 'Drop to a Root shell' and login if requested:
sudo service lightdm start
In this case you should enter:
[Should 'fsck' hang, wait a minute or two, then enter 'Ctrl+c']
telinit 3 # to set system level
5.: Installing the driver. If choosing an nvidia-current driver, see paragraph 3 above,"Ubuntu nvidia-current drivers." and skip to Stage 6.
Change directory [cd] to the directory where you saved the nvidiaxxx.run file, for example:
Running 'ls' will confirm you are in the right place and you can be sure the spelling is correct - entering 'NV' and pressing 'Tab' will [/should] Auto-complete the file name.
[In the following, substitute the correct file name:]
Mark the downloaded file as executable:
Run the file to Install drivers:
sudo chmod a+x NVIDIA-Linux-x86-304.60.run
You may get an error message about a failed script, continue, accept the options, navigating by using 'Tab' and pressing 'Enter'. [If Nouveau is found to be running, the nvidia-installer may advise to abort and blacklist it, but if you choose to continue, it will create a blacklist for you.]
sudo sh NVIDIA-Linux-x86-304.60.run
6.: When complete, reboot, 7.: In case of difficulty:
If necessary edit the grub boot menu script, by pressing 'e' with the boot option highlighted and entering 'nomodeset' after 'splash ' in the Linux boot line where it shows "ro quiet splash ", and pressing 'Ctrl+x' to boot.
You may need to run one or more of:
NVIDIA XServer Settings [run as Root]
sudo apt-get install --reinstall nvidia-common # for nvidia cards 5xxx FX or earlier
sudo apt-get install --reinstall ubuntu-desktop
sudo dpkg-reconfigure nvidia-current*
sudo update-initramfs -u