Mesa の概要

Mesa は OpenGL 互換の 3D グラフィックライブラリです。



Mesa は頻繁に更新されています。 mesa の最新バージョン 21.2.x があれば、それを利用することもできます。

本パッケージは LFS-11.1 において正しくビルドでき動作することが確認されています。



Mesa の依存パッケージ


Xorg ライブラリ, libdrm-2.4.107, Mako-1.1.5



libgcrypt-1.9.4, lm-sensors-3-6-0 , Nettle-3.7.3, Valgrind-3.17.0, mesa-demos (provides more than 300 extra demos to test Mesa; this includes the same programs added by the patch above), Bellagio OpenMAX Integration Layer (for mobile platforms), libunwind, libtizonia, libvulkan (for the zink driver)



The instructions below assume that LLVM with the r600/amdgpu and host backends and run-time type information (RTTI - needed for nouveau) are installed. You will need to modify the instructions if you choose not to install all of these. For an explanation of Gallium3D see


Mesa のインストール

If you have downloaded the xdemos patch (needed if testing the Xorg installation per BLFS instructions), apply it by running the following command:

patch -Np1 -i ../mesa-21.2.2-add_xdemos-1.patch

Adjust a script file in test suite to use Python 3, instead of the obsolete Python 2:

sed '1s/python/&3/' -i bin/


The measurements above, and the Contents below, are for a full build. Many people will not wish to install drivers they cannot use, so the following paragraphs explain how to limit the drivers, and give an example which can be be reduced or amended as necessary.

Now, select the drivers you wish to install. For the X86 architecture, the available gallium drivers are auto (in 21.2.1 this does not select crocus ), or alternatively a choice from crocus, i915, iris, nouveau, r300, r600, radeonsi, svga, swrast, and virgl. The latter can provide acceleration in qemu-6.1.0 if that has been linked against virglrenderer (you will need a account to get to that page, you can download the 0.9.1 release without an account from virglrenderer-0.9.1).

The (non-gallium) DRI drivers available in X86 are auto, or alternatively a choice from i915, i965, nouveau, r100, r200, and swrast. Use 'auto' to build all available DRI drivers, or use an empty string (DRI_DRIVERS="") if you wish to only build gallium drivers.

The platforms ("window systems") available for X86 linux are x11, wayland, and surfaceless. By not specifying anything, the meson build-system will build for all these platforms if you have the dependencies, identical to if you had specified '-Dplatforms=auto'.

Modify the commands below for your desired drivers. The drivers listed below will cover most modern video cards and virtual machines. For help in selecting drivers see For intel drivers, specify crocus for i965 gen 4 through to haswell, iris for broadwell and later.



Although the nouveau drivers can be built for both gallium and dri, the i915 driver can only be built for one or the other.


以下のコマンドを実行して Mesa をビルドします。

mkdir build &&
cd    build &&

meson --prefix=$XORG_PREFIX          \
      --buildtype=release            \
      -Ddri-drivers=$DRI_DRIVERS     \
      -Dgallium-drivers=$GALLIUM_DRV \
      -Dgallium-nine=false           \
      -Dglx=dri                      \
      -Dvalgrind=disabled            \
      -Dlibunwind=disabled           \
      ..                             &&



If you built the tests (see 'Command Explanations'), to run them issue: ninja test. All 33 subtests tests in the mesa:compiler+glsl / glsl compiler warnings suite are known to fail.

root ユーザーになって以下を実行します。

ninja install

任意インストールのドキュメントを導入したい場合は、root ユーザーになって以下を実行します。

install -v -dm755 /usr/share/doc/mesa-21.2.2 &&
cp -rfv ../docs/* /usr/share/doc/mesa-21.2.2


--buildtype=release: This switch ensures a fully-optimized build, and disables debug assertions which will severely slow down the libraries in certain use-cases. Without this switch, build sizes can span into the 2GB range.

-Ddri-drivers="...": This parameter controls which (non-gallium) dri drivers should be built.

-Dgallium-drivers="...": This parameter controls which Gallium3D drivers should be built.

-Dgallium-nine=false: Prevents building support for (MS Windows) games designed for DX9. Set it to true if this support is desired.

-Dvalgrind=disabled: This parameter disables the usage of Valgrind during the build process. Remove this parameter if you have Valgrind installed, and wish to check for memory leaks.

-Dlibunwind=disabled: This parameter disables the usage of libunwind.

-Dbuild-tests=true: This option will cause the test code to be enabled. To run the tests, issue: ninja test.


インストールプログラム: glxgears and glxinfo
Installed Drivers: (optional),,,,,,,,,, (optional), (optional),,, (optional),,,,,,, (optional),, and (Many of these drivers are hard-linked).
インストールディレクトリ: $XORG_PREFIX/{include/{EGL,GL,GLES,GLES2,GLES3,KHR,vulkan},lib/{dri,vdpau}}, $XORG_PREFIX/include/d3adapter (optional), $XORG_PREFIX/lib/d3d (optional), $XORG_PREFIX/share/drirc.d (contains workarounds for various applications, particularly browsers and games) $XORG_PREFIX/share/vulkan/icd.d, and /usr/share/doc/mesa-21.2.2 (optional)



GL のデモプログラム。グラフィックにて何か問題があった場合のトラブルシューティングとなります。


グラフィックハードウェアや、インストールされている GL ライブラリの情報を表示する診断プログラムです。

provides a native platform graphics interface as defined by the EGL-1.4 specification

is the Mesa Graphics Buffer Manager library

is the Mesa OpenGL ES 1.1 library

is the Mesa OpenGL ES 2.0 library

主要な Mesa OpenGL ライブラリ。

is the Mesa Off-screen Rendering library