Graphics drivers

From Gentoo Linux Wiki

Jump to: navigation, search

X.Org TOC

Contents

[edit] Hardware Discovery

What driver you need depends on the chipset and graphics card you're using. So the first thing you'll need to do now is to identify these. To identify the bus chipset and graphic card, you use lspci(part of sys-apps/pciutils). In the example below we are expecting to find a nforce2 AGP chipset and a ATI Radeon X1600 graphics card, but for completeness we grep for all AGP, PCI-e buses and all VGA and Display controllers.

/usr/sbin/lspci | egrep "AGP|PCI Express|VGA|Display"

For a more verbose output you can run,

/usr/sbin/lspci -vvv | egrep "AGP|PCI Express|VGA|Display"

The resulting output of lspci would be something like:

00:1e.0 PCI bridge: nVidia Corporation nForce2 AGP (rev c1)
03:00.0 VGA compatible controller: ATI Technologies Inc RV535 [Radeon X1650 Series] (rev 9e)
03:00.1 Display controller: ATI Technologies Inc RV535 [Radeon X1650 Series] (rev 9e)

The second line is interesting: apparently, this PC uses a Radeon X1650 GPU, which has an RV535 chipset. Also note that, based on the information on the first line, this is an AGP card.

[edit] Kernel Configuration

If your graphics driver supports it, you should enable the DRM module in your kernel configuration, and a corresponding kernel DRM driver. The various DRM modules are listed under Direct Rendering Manager (XFree86 4.1.0 and higher DRI support). If you are unsure what driver supports what card, highlight the option and press h too see the help screen. Take note that the DRM option for your card might not appear until you enable support for the AGP, PCI or PCI-E chipset.

If your graphics card sits on an AGP bus, you'll need to enable support for your AGP chipset under /dev/agpgart (AGP Support).

Linux Kernel Configuration: Enable AGP chipset
Device Drivers  --->
    Graphics support  --->
        <M> /dev/agpgart (AGP Support)  --->

If your graphics card sits on a PCI-e bus, you'll need to enable PCI Express support.

Linux Kernel Configuration: Enable PCI-Express
Bus options (PCI etc.)  --->
    [*] PCI Express support

Lastly, enable your graphics cards DRM module under Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) ---> if available:

Linux Kernel Configuration: Enable DRM and Radeon DRM
Device Drivers  --->
    Graphics support  --->
        <M> Direct Rendering Manager (XFree86 4.1.0 and higher DRI support) --->

[edit] Kernel Module Configuration

Once you have DRM support for your chipset, you still need to actually load the modules. You need to load your AGP chipset module, the drm and your graphics cards' DRM module. If you use <=sys-apps/baselayout-2.0.0 you should edit /etc/modules.autoload.d/kernel-2.6. In the example below we are using a nforce2 AGP chipset and a ATI Radeon X1600 graphics card,

File: /etc/modules.autoload.d/kernel-2.6
...
nvidia-agp drm radeon

If you use >=sys-apps/baselayout-2.0.0 you should edit /etc/conf.d/modules. In the example below we are using a Intel chipset,

File: /etc/conf.d/modules
...
modules="nvidia-agp drm radeon"

[edit] VIDEO_CARDS

VIDEO_CARDS is an alias for, among more, some x11-drivers/xf86-video-* packages, and in the case of x11-base/xorg-drivers, acts as "pull in" USE flags. So VIDEO_CARDS="radeon" will make the emerge of xorg-server(which pulls in the meta package x11-base/xorg-drivers), pull in x11-drivers/xf86-video-radeon. Setting the VIDEO_CARDS variable is a good idea as it will make the emerge include your drivers or enable support for your graphics card.

The package media-libs/mesa might also be affected by your VIDEO_CARDS variable, but here it does not act as a "pull in" USE flag and actually compiles chipset specifics bits. So setting VIDEO_CARDS="radeon" will when mesa is emerged also build its radeon DRI specific libraries. These libraries must be available to the X server if you want direct rendering to work.

To see what VIDEO_CARDS variables can be set, run,

emerge -pv xorg-drivers

and look at the the output following VIDEO_CARDS,

[ebuild  N    ] x11-base/xorg-drivers-...VIDEO_CARDS="..."...

Add the VIDEO_CARDS variable with the driver you want in /etc/make.conf,

Note: Note that VIDEO_CARDS may contain more than one driver. If this is the case for you, separate each driver with a space.
File: /etc/make.conf
...
VIDEO_CARDS="nvidia nv"
...

[edit] Drivers

[edit] AMD/ATI

fglrx
The proprietary driver for AMD/ATI graphics cards. It is commonly referred by its kernel module name, fglrx, or x11-drivers/ati-drivers. fglrx does not support DRM, but ships with its own direct rendering mechanism. If you want to use it, set VIDEO_CARDS to fglrx in /etc/make.conf. The package is named x11-drivers/ati-drivers in Portage. See fglrx for further instructions.
radeon
The radeon driver is an open-source driver for AMD/ATI graphics cards. It has DRM support for chipsets r100 through r500. Set VIDEO_CARDS to radeon in /etc/make.conf. The package is named x11-drivers/xf86-video-ati in Portage. See Radeon for further instructions.
radeonhd
Warning: RadeonHD is dead. Please use the radeon driver instead, even if you have a Radeon HD-series graphics processor.
The radeonhd driver is another open-source driver for AMD/ATI graphics cards of the Radeon HD series (which means only chipsets r600 and later). Set VIDEO_CARDS to radeonhd in /etc/make.conf. The package is named x11-drivers/xf86-video-radeonhd in Portage. See RadeonHD for further instructions.

[edit] Intel

intel
The intel driver is for most Intel on-board graphic adapters, of the 'Intel Graphic Media Accelerator' series. Set VIDEO_CARDS to intel in /etc/make.conf. The package is named x11-drivers/xf86-video-intel in Portage. See Intel GMA for further instructions.

[edit] nVidia

nouveau
Nouveau is a reverse engineered open source driver for nVidia chips. Nouveau does not yet have a VIDEO_CARDS flag. The package is named x11-drivers/xf86-video-nouveau in x11 and sunrise overlays. See Nouveau for further instructions.
nv
nv is the official open source driver for nVidia chips. Set VIDEO_CARDS to nv in /etc/make.conf. The package is named x11-drivers/xf86-video-nv in Portage.
nvidia
nvidia is the proprietary driver for nVidia chips. Set VIDEO_CARDS to nvidia in /etc/make.conf. The package is named x11-drivers/nvidia-drivers in Portage. See nvidia for further instructions.

[edit] Trident

trident
Trident video cards are found in many laptop computers, mostly the of the Trident CyberBlade family chipset. Set VIDEO_CARDS to trident in /etc/make.conf. The package is named x11-drivers/xf86-video-trident in Portage.

[edit] VIA

openchrome
openChrome is an open-source graphics driver for some VIA IGPs. Set VIDEO_CARDS to via in /etc/make.conf. The package is named x11-drivers/xf86-video-via in Portage.

[edit] Troubleshooting

[edit] DRI permissions

You may have trouble with DRI permissions. Add your user to the video group:

gpasswd -a <your user> video

[edit] Direct & Indirect Rendering

X can handle graphics in two different ways, indirect and direct.

The indirect method is when an application talks to the the X server, which in turn conveys with the hardware drivers(the x11-drivers/xf86-video-* packages) and then returns to the application through the X server. An extension to the X server called GLX with AIGLX enabled allows for the indirect rendering to be hardware accelerated. This requires that x11-base/xorg-server was emerged with -minimal and your graphics drivers actually do hardware acceleration. To check if your X server is AIGLX enabled, run:

grep "AIGLX enabled" /var/log/Xorg.0.log

This should output:

(==) AIGLX enabled

The other way to X deals with graphics is the direct way. This is when the application bypasses the X protocol and talks to the hardware drivers directly. This has the benefit of being faster as it skips the middleman, but you also lose the network abstraction with the X server, this is however no loss if you never intend to use X to display remotely. To have the X server allow for direct rendering you'll need to have the DRI extension enabled, so make sure you emerged x11-base/xorg-server with the -minimal USE-flag set. It's also possible that the driver your VIDEO_CARDS variable pulled in carries the dri USE-flag, if so, enable it. To check if direct rendering is possible you should run glxinfo, which is comes with the x11-apps/mesa-progs package:

glxinfo | grep "direct rendering"

This should output:

direct rendering: Yes

X will try to enable both AIGLX and Direct Rendering if supported.

[edit] 2D Rendering

2D rendering is done through the driver architectures XAA, EXA or UXA, allowing for 2D drawing like lines, glyphs, etc. XAA is the oldest driver architecture and is support by almost all drivers. EXA, superseding XAA, uses the X Render extension(RENDER) which, depending on driver support, gives the X server greater features and performance. UXA, which is set to supersede EXA is basically EXA reimplemented utilizing the GEM memory manager. To see what renderer the X driver uses, run:

grep "acceleration architecture" /var/log/Xorg.0.log

This should tell you what architecture your driver is using. Example:

(**) RADEON(0): Using EXA acceleration architecture

If you want to change the architectures used, you'll need to set the "AccelMethod" option under your graphics cards "Device" section:

File: /etc/xorg.conf
...
Section "Device"
    ...
    Option    "AccelMethod" "EXA"
    ...
EndSection
...

See your graphics driver man page for more information. They are usually named like the driver, i.e, radeon or intel.

Personal tools
In other languages