Pin Me

Linux: Installing Graphics Card Drivers for 3D Acceleration

written by: Pranav Thadeshwar•edited by: Lamar Stonecypher•updated: 5/23/2011

Getting your graphics card working on Linux in its full glory used to be a daunting task. With increased Linux exposure, AMD and Nvidia are trying to please Linux supporters by improving their graphics card software by leaps and bounds. This article will help you get 3D acceleration in Linux.

  • slide 1 of 3

    Introduction

    The myth that Linux doesn't have good hardware support has always been untrue. While you could say that it might take a bit of time for new hardware to show up in the "supported" list, Linux probably has better support for more hardware than Windows. And the proof of that is in the fact that whatever device you have, someone has already tried it in Linux before and most probably, tried it successfully.

    On top of that, drivers for devices are rarely removed from the kernel, if ever. Compare that to the fiasco of Windows Vista, where a lot of older hardware simply refused to work. Although a lot of device manufacturers fixed the problem by releasing updated drivers, there's still a good amount of hardware that's lying around uselessly because Windows Vista doesn't support it anymore.

    On topic though, good hardware-accelerated graphics has always been one of the sore points in Linux. Although you are guaranteed to have a graphical interface and your video card will be recognized in Linux, 3D acceleration will be missing. Since both NVIDIA and AMD (previously ATi) work so hard to eke out every ounce of performance from their hardware, and since they have contractual obligations with many other companies, they're generally very silent about the hardware specifications. This means that Linux developers pretty much have to shoot in the dark when it comes to graphics drivers. So even though the kernel has display drivers for more hardware than Windows, a lot of it is by reverse-engineering, and therefore unsupported by manufacturers. On top of that, most of the proprietary features are unusable by the default drivers and you have to use the proprietary drivers to use those features.

    And that's what this guide is about. Since there are way too many distributions to cover specifically, I'll be referring to the documents given by AMD/ATi and Nvidia which should work on all distributions. The downside of this method is that your package manager will not handle driver updates and you'll have to do them manually. If you'd like your package manager to handle the graphics drivers, refer to your distribution's documentation for the same.

  • slide 2 of 3

    AMD / ATi Binary drivers

    AMD releases their drivers as “Catalyst" drivers. The latest stable version as of writing this article is 9.3. The Catalyst drivers support all modern ATi/AMD graphics cards for desktops, laptops, and workstations. The complete list of cards supported by these drivers can be viewed in the driver's release notes available here.

    Since a part of the driver needs to be compiled against your specific kernel's source code before it can be installed, the first thing to make sure of is that your Linux kernel's source code is available on the machine on which you are going to install the drivers. To do this, refer to my article which deals with this step here. Reading and following the instructions on the first page is enough to accomplish this task.

    Once you've covered this step, all you need to do is make sure that a few dependencies are met before you install the driver. Here's a list of things you should have installed. Refer to your distribution's package manger for the same:

    • glibc version 2.2 or 2.3
    • XOrg 6.8, 6.9, 7.0, 7.1, 7.2, 7.3 or 7.4
    • XFree86-Mesa-libGL
    • libstdc++
    • libgcc
    • XFree86-libs
    • fontconfig
    • freetype
    • zlib
    • gcc

    Once you have these things installed, it's as easy as going to AMD's driver downloads site, choosing Linux from the selection menu, choosing your graphics card from the list and pressing the Go button. On the subsequent driver download page, save the .run file that is given for download. This is the complete driver package that should work on any Linux distribution, provided it fulfills the above dependency criteria. Once you have the driver package stored on your computer, type the following command in the same folder where you downloaded the .run file to install the driver:

    sh ./ati-driver-installer-<version>-x86.x86_64.run

    This will run a graphical installer which will guide you through the installation. After the driver is installed, type "aticonfig" in the command line to run a configurator which will configure your xorg.conf file (This file handles all settings for X.Org, and consequently, all graphics settings.) Once that's done, all you have to do is reboot your computer to load the newly installed driver. In case of problems, refer to the bundled readme file, or check the PDF version of it here.

  • slide 3 of 3

    NVIDIA Binary drivers

    NVIDIA has been much more sincere about releasing Linux drivers in the past, and as a result, Nvidia cards have always been a bit more popular with Linux users. Though with the changing scene, and with AMD releasing the specifications of their drivers, they have gained a few brownie points from Linux supporters in the recent past. Nonetheless, Nvidia's drivers are also very stable and easy to install.

    Although the driver itself is a pre-compiled binary, a separate part of the driver needs to be compiled against your specific kernel before the driver can be installed and loaded on your computer. Hence, you need your kernel's sources available on your hard-disk in the proper folder. Refer to my previous article here and follow the instructions on the first page to accomplish that.

    Once that's done, you need to satisfy the following dependencies which need to be installed before you go about installing the graphics driver:

    • Linux kernel 2.6
    • XFree86/X.Org 4.0.1/6.7 and above
    • Kernel modutils 2.1.121
    • binutils 2.9.5
    • GNU make 3.77
    • gcc 2.91.66
    • glibc 2.0

    Refer to this page for detailed instructions about the same and install them using your distribution's package manager. After that, download the Nvidia driver from their Linux driver download page. Go with the "Linux IA32" version and grab the latest version available unless you're specifically running a 64bit Linux distribution on your computer.

    As with the ATi/AMD driver, you will be downloading a .run file which is a packaged installer which does its job without any intervention. Once you have downloaded the file, shut down the graphical interface which is generally done by typing the command "/etc/init.d/xdm stop" in another tty (Change the tty by pressing Ctrl+Alt+X where X is a number between 1-6). This should shut down X, else, refer to your distributions documentation for the same. Now navigate to the folder where the .run file is stored using the command line and type the following command:

    sh ./NVIDIA-Linux-x86-<version>-pkg1.run

    This will start the installer which will do its work automatically without needing any input from you. Once everything is done, it will offer you to run the configurator called "nvidia-xconfig". Accept it and let it do its job. It will find out more information about your hardware like your screen/monitor, graphics card and change the xorg.conf file accordingly. That should do it. All you now have to do is reboot your computer to let it load the newly installed driver. In case of problems, refer to the bundled readme file or check the online version here.