HOWTO Nvidia
From ZWHLUG
Contents |
[edit] About
This howto can lead you through the 'tough' part of installing and configuring the Nvidia drivers for your graphics card. You can either choose to use the binary drivers from the website or the drivers that are in the Ubuntu repository. The drivers from the site are for the people who really want the latest drivers and want to risk getting problems. The drivers from the repository are for everyone who likes comfort and auto-updates.
[edit] Binary driver
This will lead you through the 'tough' part of installing and configuring the ATI drivers from the ATI-website. I used Ubuntu Breezy (5.10) together with the ATI drivers version 8.18.6.
[edit] Downloading the driver
First we need to prepare ourselves. So let's get the needed drivers from the ATI site. Choose if you have a 64-bit version of linux or not ["| here]. Then download the ATI Driver Installer to a directory of your choosing (use "Save file as").
[edit] Installation preparation
Later on you will need to compile the Nvidia kernel module and for this you will need to do a couple of things. This includes downloading your kernel source, unpacking it and configuring it for your current kernel. This HowTo was written for my 2.6.12-9-686 kernel. First of all, you must check your current kernel version with the following command:
uname -r
Now let's continue with the kernel download, unpacking and configuration.
sudo apt-get install linux-source-2.6.12 cd /usr/src/ sudo tar -xvjf linux-source-2.6.12.tar.bz2 sudo ln -s /usr/src/linux-source-2.6.12 linux cd linux sudo make menuconfig
So far so good. There should be a ncurses screen in front of you now. Now go to the bottom and select "Load an Alternate Configuration File" and then you type:
/boot/config-2.6.12-9-686
Now you can exit the config tool and choose to "Save" your kernel configuration.
Then you must start to build your kernel. I would recommend letting this run for a few minutes and then use CTRL+C to stop it.
sudo make
Let's backup your current xorg.conf file, since this is usually a good idea.
sudo cp /etc/X11/xorg.conf /etc/X11/xorg.conf.backup
We must also check if you don't have anything installed that might interfere with your Nvidia driver installation.
sudo apt-get remove linux-restricted-modules-2.6.12-9-686 nvidia-glx sudo rm /etc/init.d/nvidia-glx
You will need gcc-3.4 to install/compile the Nvidia kernel module. I had gcc-4.0 installed and so I thought I had a problem, but it was easily solved. So let's install gcc-3.4 and create a symlink so we won't use the installed gcc-4.0, but the gcc-3.4 instead!
sudo apt-get install gcc-3.4 cd /usr/bin sudo rm gcc sudo ln -s gcc-3.4 gcc
Note: My currently running kernel, was compiled using gcc-3.4, that's why I needed that version of GCC.
[edit] Installing the driver
Now you will need to leave your beloved Xorg and continue in terminal mode.
sudo /etc/init.d/gdm stop
Login using your username/password. Go to the directory where you downloaded the Nvidia installer and run it.
cd /usr/src/ sudo sh ./NVIDIA-Linux-x86-1.0-8178-pkg1.run
Note: You must follow the on-screen instructions (DO NOT choose to download a precompiled module, since you must always compile it yourself)
[edit] Configuring the driver
Since we only used the gcc-3.4 compiler for the Nvidia kernel module compilation, we can now switch back to our 'current' gcc-4.0
cd /usr/bin sudo rm gcc sudo ln -s gcc-4.0 gcc
If everything goes right, you will just need to reboot your computer and your Nvidia drivers will kick in and will work.
sudo reboot
[edit] Repository driver
This will lead you through the 'tough' part of installing and configuring the ATI drivers from the repositry. I used Ubuntu Dapper Drake (6.06).
[edit] Installing the driver
We need to install the linux-restricted modules and some Nvidia drivers. You will have to install either nvidia-glx-legacy or nvidia-glx. If your graphics card is marked as legacy [here], you will need to install nvidia-glx-legacy, otherwise you'll need to install nvidia-glx. Note: If you are going to compile 3D applications, install nvidia-glx-dev If you are using Hoary Hedgehog or Breezy Badger, you'll need to install nvidia-settings and nvidia-xconfig. DO NOT install either package in Ubuntu 6.06 LTS because it will remove nvidia-glx and these programs are now provided in nvidia-glx.
sudo apt-get install linux-restricted-modules-2.6.15-23-686 nvidia-glx sudo nvidia-glx-config enable sudo /etc/init.d/gdm restart
[edit] Configuring the driver
The Nvidia driver should've updated your /etc/X11/xorg.conf automatically and everything should work fine now. If not you will have to manually edit your xorg.conf file
[edit] Check if everything is OK
Now let's check if everything went right and you are already using the new drivers. Then you're done.
glxinfo | grep NVIDIA
And you should get some output looking like this (at least ATI needs to be printed somewhere)
server glx vendor string: NVIDIA Corporation client glx vendor string: NVIDIA Corporation OpenGL vendor string: NVIDIA Corporation OpenGL version string: 2.0.2 NVIDIA 87.62 server glx vendor string: NVIDIA Corporation client glx vendor string: NVIDIA Corporation OpenGL vendor string: NVIDIA Corporation OpenGL version string: 2.0.2 NVIDIA 87.62
[edit] Problem solving
I would recommend that you edit your /etc/X11/xorg.conf by hand so that you won't get a nagging Nvidia logo at boot.
sudo vim /etc/X11/xorg.conf
Find the section which is named "nvidia" and add the next line:
Option "NoLogo"
If your fonts are too small you'll need to add a 'DisplaySize' to your Monitor in your /etc/xorg.conf. You can find some possible 'DisplaySize' values below. Just remember that one of these 'DisplaySize's need to be put in your 'Section "Monitor"' before 'EndSection'.
DisplaySize 270 203 # 1024x768 96dpi DisplaySize 338 254 # 1280x960 96dpi DisplaySize 338 270 # 1280x1024 96dpi DisplaySize 370 277 # 1400x1050 96dpi DisplaySize 423 370 # 1600x1400 96dpi
Note: If you want other values, you can use the following formula: displaysize = {pixelsize}/96*25.4
Don't forget that 75DPI is smaller than 96 DPI!
[edit] Related pages
Example Nvidia dualscreen xorg.conf
Ubuntu wiki - Binary drivers - Nvidia
