Make.conf/VIDEO CARDS/DRI vs. Gallium vs. NVIDIA

From Funtoo
Jump to: navigation, search

DRI vs. Gallium vs. NVIDIA

Graphics on Linux can be confusing due to the various technologies involved, not just the different graphics cards available but also the different software architectures for implementing graphics drivers. This page is here to help provide some context as to what makes up a 'Linux graphics stack.'

'Classic' Accelerated Graphics

Traditionally, accelerated graphics in X has been implemented using a combination of technologies:

  • DRI, which stands for Direct Rendering Infrastructure and are user-space libraries that provide accelerated 2D and 3D graphics for X.
  • DRM, the Direct Rendering Manager (Wikipedia) is considered to be a kernel-space component of DRI.
  • Mesa provides an accelerated OpenGL GLX library which leverages DRI and DRM to provide hardware-accelerated graphics.

Gallium Accelerated Graphics

More recently, Open Source graphics drivers have started being written using a new architecture called Gallium (not to be confused with Glamour.) Gallium still makes use of the kernel's DRM but provides a more modern way to design graphics drivers. A Gallium-based graphics stack will typically be composed of the following:

  • DRI, which is still used to some extent.
  • DRM, the kernel-space component of the graphics stack.
  • Gallium, a user-space API that exposes the capabilities of the underlying hardware in a more hardware-agnostic way.
  • Mesa's OpenGL GLX library, which leverages Gallium to provide accelerated graphics.

The benefits of Gallium over the 'classic' approach to graphics support is that Gallium allows for user-space graphics libraries like OpenGL to target Gallium itself rather than be written specifically to the architecture of the underlying hardware. This allows for the OpenGL (and other graphics library) implementation to be de-coupled from the underlying hardware while still providing high performance. It's important to note that the benefits of Gallium are useful primarily to graphics driver developers; in theory, these benefits will result in improved and better-maintained graphics stacks which in turn will benefit Linux users. Said another way, just because a driver is Gallium-based doesn't necessarily mean that it will provide you, the user, with superior performance or functionality over a traditional alternative.

Your graphics driver may use DRI, Gallium or possibly -- in the case of the proprietary NVIDIA driver -- neither!