Linux what is mesa

An explanation of what Mesa is and what graphics cards use it

You’ve most likely heard the term “Mesa” thrown around a lot, but you might not quite understand what it is. This is an attempt to clear up the question of “What exactly is Mesa and do I need it?”.

Note: This is an attempt to keep things simple for the average user to understand, so I won’t go overly technical with this.

Mesa is a term used to encompass the different open source graphics drivers available on Linux, so it can be what powers your GPU. I say can be, since AMD and NVIDIA also have their own closed-source proprietary drivers (what you would download from their website on Windows, if that makes that clearer).

Originally, Mesa began only to serve as an open source Linux implementation of OpenGL, but it has since grown to be a lot more than that. Mesa was started in 1993 by Brian Paul, but now it has many more developers, some of which are employed by the likes of AMD, Intel, Valve and others. Linux game porters like Feral Interactive have also contributed code to Mesa. Plenty of people also help with Mesa development in their spare time too.

Mesa itself is not a driver, as you will be using a different part of Mesa for each graphics card vendor. Still with me? Okay!

Mesa implements various API’s (Application programming interface) like OpenGL, OpenGL ES, OpenCL, OpenMAX, VDPAU, VA API, XvMC and Vulkan.

Mesa versioning
Something also worth noting, is that Mesa has switched to a year-based release numbering scheme. This is why Mesa jumped from 13 to 17 in release numbers.

Usually, it is recommended to update to a new major version of Mesa once they have done the first round of bug fixing. If you’re concerned with stability and reliability stick to point release numbers like 17.0.1.

How to find your current version of Mesa
Do this in terminal:
glxinfo | grep Mesa
Which will give you something like this:

Quote OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.0.1
OpenGL version string: 3.0 Mesa 17.0.1
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 17.0.1

So you can see your Mesa version, along with what version of OpenGL support you have. This will likely show nothing if you’re not using Mesa.

Intel
The story for Intel is mostly pretty simple, if you’re using Intel integrated graphics, you will be using Mesa. Except for the ‘PowerVR’ based chips in the GMA 500, GMA 600, GMA 3600, GMA 3650 series.

Читайте также:  Linux online file sharing

Intel usually supports Mesa quite well and even have their own Mesa update tool named ‘Intel® Graphics Update Tool’ to give certain distributions the latest version of Mesa.

Intel also have the ‘anv’ Vulkan driver, which seems to be largely feature complete and should work.

AMD
There are a number of different Mesa drivers available for AMD cards, you can see a little information on that here.

The latest AMD cards use the ‘amdgpu’ kernel driver (the proprietary AMDGPU-PRO also uses a version of this, which has not yet been accepted into the Linux kernel yet), whereas all older cards use the ‘radeon’ kernel driver. Each part of Mesa listed below hooks into one of those kernel drivers, which part depends on your graphics card model.

As mentioned, the kernel driver (either ‘radeon’ or ‘amdgpu’) is paired with one of these:
radeon — R100 series
r200 — R200 series
r300g — R300, R400, and R500 series
r600g — R600, R700, HD 5000 and HD 6000
radeonsi — HD 7000, HD 8000 and RX 200, RX 300 and RX 400

You also have the ‘radv’ driver for Vulkan, which was officially added in Mesa 13. It’s still in development right now, so it’s to be considered in beta.

Right now, most AMD graphics cards have pretty good support in Mesa, with the closed source driver often not being needed. Our own statistics have users telling us that only around 11% of Linux gamers with an AMD GPU use the proprietary AMD driver.

NVIDIA
NVIDIA isn’t quite such a nice story, as NVIDIA doesn’t help towards development of Mesa, since they prefer their own closed-source proprietary drivers. For NVIDIA cards Mesa is typically quite far behind the closed drivers in terms of performance and features due to this. Mesa also typically doesn’t work well, if at all with the very latest generation of NVIDIA graphics cards.

With Mesa, you have the nouveau (pronounced like nu-vo) kernel driver, but like AMD, NVIDIA uses nouveau plus another part of Mesa depending on your graphics card model.

Later generations of NVIDIA cards require something called ‘signed firmware’ in order for Mesa to interact with them and NVIDIA has been quite slow to release it.

The ‘Pascal’ generation in particular right now has very little support, as NVIDIA has only recently provided the signed firmware required.

For NVIDIA, it’s usually best to stick with the proprietary driver. Older generations have reasonable support in Mesa now, but you will still see better performance with the proprietary NVIDIA driver.

I hope this all makes sense, but if anything really needs further clarification be sure to reach out in the comments. Article taken from GamingOnLinux.com.

Источник

OpenGL

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

Читайте также:  What is different unix and linux

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

Installation

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

  • 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.
  • Intel’s GenN hardware does not refer to the generation of the CPU, it refers to the generation of the GPU, which is different from the generation of the CPU.
  • To find the family of an AMD (and ATI) GPU, check Wikipedia:List of AMD graphics processing units#Features overview
  • To find the code-name of an NVIDIA GPU, check the code-name list from the Nouveau project

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, AMD (formerly ATI) 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.
    • i915 : for Intel’s Gen 3 hardware.
    • crocus : for Intel’s Gen 4 to Gen 7 hardware.
    • iris : for Intel’s Gen 8 hardware and later. Officially supported by Intel.
    • zink : 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).
    • swrast : a legacy software rasterizer.
    • softpipe : a software rasterizer and a reference Gallium driver.
    • llvmpipe : 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:
      • i830 : for Intel’s Gen 2 hardware. Same binary as i965 .
      • i915 : for Intel’s Gen 3 hardware. Same binary as i965 .
      • i965 : for Intel’s Gen 4 hardware and later. Officially supported by Intel.
      • radeon : for AMD’s Radeon R100 GPUs. Same binary as r200 .
      • r200 : for AMD’s Radeon R200 GPUs.
      • nouveau_vieux : for NVIDIA NV04 (Fahrenheit) to NV20 (Kelvin) GPUs.
      • swrast : a legacy software rasterizer.

      Note: When using Mesa, the correct driver should be selected automatically, thus no configuration is needed once the package is installed.

      • nvidia-utils is the proprietary driver for NVIDIA GPUs, which includes an OpenGL implementation.
      • amdgpu-pro-oglpAUR is the proprietary driver for AMD GPUs.

      Verification

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

      OpenGL vendor string: X.Org OpenGL renderer string: AMD RV620 (DRM 2.50.0 / 5.10.12-arch1-1, LLVM 11.0.1) OpenGL core profile version string: 3.3 (Core Profile) Mesa 20.3.4 OpenGL core profile shading language version string: 3.30 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 3.0 Mesa 20.3.4 OpenGL shading language version string: 1.30 OpenGL context flags: (none) OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.0 Mesa 20.3.4 OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00 OpenGL ES profile extensions:

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

      Switching between drivers

      Note: According to this Reddit post, you can use 2 GPUs from different vendors working at the same time using PRIME without any problems.

      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 /lib/dri/ . You can view the list of installed drivers with

      driver in driver_dri.so is the actual name of the driver. If Mesa failed to find the specified driver, it will fall back to llvmpipe .

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

      LIBGL_ALWAYS_SOFTWARE=true GALLIUM_DRIVER=driver 

      driver can be either softpipe , llvmpipe , or swr .

      OpenGL over Vulkan (Zink)

      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 might be lower in some applications compared to RadeonSI.

      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

      Note: This section is for developers who want to use OpenGL in projects. End users should not need anything from this section.

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

      This article or section needs expansion.

      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.

      Источник

Оцените статью
Adblock
detector