Sunday, February 23, 2014

The Infinite Mystery of NVIDIA Linux Device Drivers 1/2

We are now going to do a series of boring technical notes that nevertheless fulfill a more noble purpose.

Those of us who are interested in doing or fostering independent production with computers and computer animation have a lot to be grateful for with Linux, particularly with Centos/Redhat Linux. It is stable, scalable, various applications work with it and it is remarkably Unix-like for something that isn't Unix.

And it has so far avoided the insane Linux-of-the-day bullshit of Ubuntu, praise Allah.

But we do not live in a perfect world and a well-tempered Linux is going to be running the NVIDIA device driver with a solid, respectable NVIDIA graphics card and we are going to discuss why and then dive into the crazy shit you have to do to make it all work.

The only manufacturer out there that really supports Linux is NVIDIA, in spite of what you may have heard of Linus fingering NVIDIA. His frustration is real, but it is bullshit. For a variety of reasons NVIDIA is not able to put their device drivers in the open source because it contains proprietary information they just do not want to give their competitors. So that means that certain purists can not include it with the standard distributions. That means you have to install it yourself.

With Centos / Redhat, one also has the option of using the so-called "nouveau" driver which supposedly supports NVIDIA. I have crashed my system so many times using the nouveau driver that I do not recommend you use it for serious work. Since I also do things like CUDA/GPU development, it isnt a serious option anyway.

So we are going to install the NVIDIA driver, and it is a little wacky to do so. There are three fundamental reasons why installing the driver is so convoluted and they are (a) you can not install a graphics driver if you have graphics running, (b) in particular you have to get rid of the nouveau driver and its non-trivial to do so, and finally (c) you have to be able to "compile" the NVIDIA driver against your current Linux and that means having the development environment loaded.

There is one more reason too that this note was written. There is so much craziness on the Internet about what to do with graphics drivers that I am adding my own opinion to the mix, along with clear instructions.

In order to follow these steps, you need to know how to do basic Unix/Linux things like ls, cd, chmod and so forth, have the su/root password, be able to use a text editor like vi that can work without X running, have access to the Internet, be able to use a web browser to download files, and be able to follow instructions.

In this post, I am just going to outline what you will have to do to install the driver. In the next post, I will fill in the details of how to actually do these things.

So hold on everybody, here we go!

1. Are you already running the NVIDIA driver? How can you tell for sure?
2. Install the development tools.
3. Figure out the model of your graphics card.
4. Figure out if your Linux is 32 or 64 bit
5. Download the driver from NVIDIA.
6. Put that driver someplace easy to get to, like /tmp and make it executable.

Now we get into the more tricky stuff.

7. Change /etc/inittab to bring the system up at level 3
8. Blacklist Nouveau, Part 1
9. Blacklist Nouveau, Part 2
10. Reboot
11. Log in as root
12. Verify the location of the system kernel libraries
13. Install the Nvidia driver (say yes to compatibility mode if you are asked)
14. Restore the /etc/inittab runlevel to 5
15. Reboot the system

We are almost done, hang in there!

16. As su, run "nvidia-xconfig"
17. Run "nvidia-settings" and save your work.

My goodness, that was annoying wasn't it?

The next post will have the mere details of how you actually do these things. The only thing really, really arcane is the blacklist of Nouveau.

No comments:

Post a Comment