Sunday, February 23, 2014

The Infinite Mystery of NVIDIA Linux Device Drivers 2/2


In our previous post we outlined what you have to do to install the NVIDIA graphics device driver under Centos / Redhat Linux 6.5 and similar systems.

In this post we go over each item in boring detail.

I am pretty sure there is a mistake in here somewhere (builds confidence, doesn't it?) because I distinctly recall doing an /sbin/telinit 3 and 5 at some point in the process, but obviously I have edited this out of my longer term memory.  But have no fears, if this doesn't work exactly I am sure you will get the general idea and improvise as necessary.  You have my greatest faith in your abilities.

Remember, before you begin you are expected to sacrifice a goat at least and say the proper prayers spreading the prayer cloth and so forth.

1. Are you already running the NVIDIA driver? How can you tell for sure?

The way I do this is by running "nvidia-settings" from the shell. If a window comes up, everything is installed and working. If it can't find it or it doesn't run, you do not have the driver installed and should proceed.

    nvidia-settings

2. Install the development tools.

Become su and run the command

    yum groupinstall "Development Tools" --skip-broken

Notice the quotes and capitalization. Say yes when it asks you if its ok. Then go get coffee and come back in 15 minutes.

3. Figure out the model of your graphics card.

As su, use the command

    /sbin/lspci -nn | grep VGA

The reported line will have the model of the card. It will probably begin with the word "Geforce" or "Quadro".

4. Figure out if your Linux is 32 or 64 bit

Run the command

    uname -m

and it will tell you.

5. Download the driver from Nvidia.

With your browser of choice, navigate to www.nvidia.com and click on "Drivers". You should find a menu which will ask you which OS you are running (e.g. Mac, Windows, Linux 32, Linux 64), which series of graphics card (e.g. 9 series, 8 series, 200 series, 600 series, etc) and the specific model.  Fill these in and hit search and it will find your driver. A 9xxx card is the 9 series, but a 4xx card is a 400 series.  If you do not find the model of your card then you gave it the wrong series and you should try again.

Click yes or agree on the license agreement and save the driver some place you can find it again. Get another cup of coffee and go play with your dog or something. Come back in a few minutes.

6. Put that driver someplace easy to get to, like /tmp and make it executable.

I used to skip this step but it was too much work. Copy the file you just downloaded to someplace easy to type, like /tmp. Then make it executable with the command

    cp NV* /tmp
    chmod 755 NV*

Ok, now we get to the weirder stuff.

7. Change /etc/inittab to bring the system up at level 3

    su
    cd /etc
    cp inittab inittab.orig
    vi inittab

and change the "5" in the last line to "3".

8. Blacklist Nouveau, Part 1

    su
    cd /etc/modprobe.d
    cp blacklist.conf blacklist.conf.orig
    vi blacklist.conf

and add three lines to the bottom of the file which say

    # get rid of nouveau driver
    blacklist nouveau
    options nouveau modeset=0

and save the file.

9. Blacklist Nouveau, Part 2

    su
    cd /boot/grub
    cp grub.conf grub.conf.orig
    vi grub.conf

and add the word "rdblacklist=nouveau" to the end of the lines that specify the kernel to boot. These are the longest lines in the file and begin with the phrase "kernel /vmlinux-blah-blah-blah".

Dont fuck this up or you wont be able to reboot the system without some major help.

10. Reboot the system

11. Log in as root

12. Verify the location of the system kernel libraries

    cd /usr/src/kernels
    ls

You should see some horrible name that starts with 2.6. You either want to remember that name, or if you are like me, you want to save it as a shell variable. I use csh or tcsh, if you don't then you will have to figure out how your shell does this.

    cd 2.6<esc>
    set kernelpath=`pwd`

Notice the funny direction of the quotes on that set command.

13. Install the Nvidia driver

You should still be root. Change directory to /tmp or where you put the nvidia driver and say

    cd /tmp
    ./NV<esc> --kernel-source-path=$kernelpath

You will need to use the mouse, agree to the license agreement, and watch with your breath held while it jumps through hoops. When it asks you if it can create a new X11.conf say yes. When it asks you if it can install 32 bit compatibility say yes.

If it completes without complaining much we are almost done.

14. Restore the /etc/inittab runlevel to 5

Still as root say

    cd /etc
    cp inittab.orig inittab

It will ask you if its ok to overwrite a file, say yes.

15. Reboot the system

Hopefully the system will come up and the window system will come up, and you will log in.

16. As su, run "nvidia-xconfig"

    su
    nvidia-xconfig

17. Run "nvidia-settings" and save your work.

Say

    nvidia-settings

and goof around with the different options and screens and set things to your liking. Or just say ok and quit.

That is it.

You are done.

No comments:

Post a Comment