OpenGL

Development of OpenGL ceased in 2017 in favour of Vulkan, the "next generation" API which offers higher performance on newer hardware.

From Wikipedia:OpenGL:

OpenGL (Open Graphics Library) is a cross-language, cross-platform application programming interface (API) for rendering 2D and 3D vector graphics.

Learn more at Khronos.

Installation

To run applications that use OpenGL, you will need to install the correct driver(s) for your hardware (either GPUs or CPUs).

Tip:
  • For AMD (and ATI) it is recommended to use the open-source drivers unless you have a strong reason to use the proprietary ones.
  • For NVIDIA, the proprietary driver is recommended for cards newer than the Kepler (NVE0/GKXXX) series, and/or better performance in general.
Note:

Mesa is an open-source OpenGL implementation, continually updated to support the latest OpenGL specification. It has a collection of open-source drivers for Intel graphics, ATI, AMD and NVIDIA GPUs. Mesa also provides software rasterizers, such as llvmpipe.

There are two Mesa packages, each with a distinct set of drivers:

  • mesa is the up-to-date Mesa package which includes most of the modern drivers for newer hardware:
    • r300 : for AMD's Radeon R300, R400, and R500 GPUs.
    • r600 : for AMD's Radeon R600 GPUs up to Northern Islands. Officially supported by AMD.
    • radeonsi : for AMD's Southern Island GPUs and later. Officially supported by AMD.
    • nouveau : Nouveau is the open-source driver for NVIDIA GPUs.
    • virtio_gpu : a virtual GPU driver for virtio, can be used with QEMU based VMMs (like KVM or Xen).
    • vmwgfx : for VMware virtual GPUs.
    • crocus : for Intel's Gen 4 to Gen 7 hardware.
    • iris : for Intel's Gen 8 hardware and later. Officially supported by Intel.
    •  : a Gallium driver used to run OpenGL on top of Vulkan.
    • d3d12 : for OpenGL 3.3 support on devices that only support D3D12 (i.e. WSL).
    •  : a legacy software rasterizer.
    •  : a software rasterizer and a reference Gallium driver.
    •  : a software rasterizer which uses LLVM for x86 JIT code generation and is multi-threaded.
  • mesa-amber is the legacy Mesa package which includes the classic (non-Gallium3D) drivers for older hardware:
    • and  : for older Intel integrated GPUs. Same binary as .
    •  : for Intel's Gen 4 hardware and later. Officially supported by Intel.
    •  : for AMD's Radeon R100 GPUs. Same binary as .
    •  : for AMD's Radeon R200 GPUs.
    •  : for NVIDIA NV04 (Fahrenheit) to NV20 (Kelvin) GPUs.
    •  : a legacy software rasterizer.
  • is the proprietary driver for NVIDIA GPUs, which includes an OpenGL implementation.

Verification

To verify your OpenGL installation, you can use glxinfo, which should display output like this (with different values depending on your setup, of course):

From the same package, you can also use as a basic OpenGL test. You should see 3 rotating gears when running the program.

Switching between drivers

For Hybrid graphics, see PRIME.

Mesa

You can override the driver used for an application with the following environment variable:

MESA_LOADER_DRIVER_OVERRIDE=driver

By default, Mesa searches for drivers in . You can view the list of installed drivers with

$ ls /lib/dri/
in  is the actual name of the driver. If Mesa failed to find the specified driver, it will fall back to .

You can also use an OpenGL software rasterizer by setting the following environment variables:

LIBGL_ALWAYS_SOFTWARE=true
GALLIUM_DRIVER=driver
can be either , , or .

OpenGL over Vulkan (Zink)

From the Mesa documentation:

The Zink driver is a Gallium driver that emits Vulkan API calls instead of targeting a specific GPU architecture. This can be used to get full desktop OpenGL support on devices that only support Vulkan.

If you are experiencing issues in your default OpenGL drivers (a bug in RadeonSI, Iris, etc.), you could try using the Zink driver.

According to this Phoronix benchmark, the average FPS in some applications ranges from 58-105% on Zink compared to RadeonSI, using an AMD RX 6700 XT.

As of 2021-11-30, many applications do not work on NVIDIA GPUs even with the latest driver 495.44 and mesa-gitAUR's master branch. When paired with Copper DRI extension (not yet upstreamed), the average FPS in Tomb Raider is 20% higher on a RTX 2070. To use Zink on NVIDIA drivers, use this command or similar:

$ env __GLX_VENDOR_LIBRARY_NAME=mesa MESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink application

Development

Using OpenGL in code requires functions loader, read more at Khronos.

OpenGL Hardware Database

GPUInfo provides user reported GPU/driver combinations, supported extensions, capabilities, etc. This information is useful for verifying compatibility / compliance of particular hardware under both OpenGL and Vulkan.

gollark: ++tel dial YanksTowelBegin
gollark: In the webhook bit.
gollark: It *explicitly* does this: `allowed_mentions=discord.AllowedMentions(everyone=False)`
gollark: Broken how?
gollark: Great?
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.