source: x/installing/mesa.xml@ 0262f7c

12.1 ken/TL2024 ken/tuningfonts lazarus plabs/newcss python3.11 rahul/power-profiles-daemon trunk xry111/llvm18
Last change on this file since 0262f7c was e1e58be, checked in by Pierre Labastie <pierre.labastie@…>, 7 months ago

Remove all ftp urls

neither firefox nor epiphany can download them, and they are not
well maintained, because rarely tested.
This is WIP because the "(HTTP)" part of "Download (HTTP)" will
need to be removed too.
But let's see what users think first...

  • Property mode set to 100644
File size: 20.6 KB
Line 
1<?xml version="1.0" encoding="ISO-8859-1"?>
2<!DOCTYPE sect1 PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd" [
4 <!ENTITY % general-entities SYSTEM "../../general.ent">
5 %general-entities;
6
7 <!ENTITY mesa-download-http "https://mesa.freedesktop.org/archive/mesa-&mesa-version;.tar.xz">
8 <!ENTITY mesa-download-ftp " ">
9 <!ENTITY mesa-md5sum "6c89b2d1335993d708e1810eacfba9e4">
10 <!ENTITY mesa-size "18 MB">
11 <!ENTITY mesa-buildsize "465 MB (with docs, add 216 MB for tests)">
12 <!ENTITY mesa-time "2.6 SBU (with docs; add 0.5 SBU for tests; both with parallelism=4)">
13]>
14
15<sect1 id="mesa" xreflabel="Mesa-&mesa-version;">
16 <?dbhtml filename="mesa.html"?>
17
18
19 <title>Mesa-&mesa-version;</title>
20
21 <indexterm zone="mesa">
22 <primary sortas="a-Mesa">Mesa</primary>
23 </indexterm>
24
25 <sect2 role="package">
26 <title>Introduction to Mesa</title>
27
28 <para>
29 <application>Mesa</application> is an OpenGL compatible 3D graphics
30 library.
31 </para>
32
33 <note>
34 <para>
35 <application>Mesa</application> is updated relatively often. You may
36 want to use the latest available &mesa-major-minor;.x mesa version.
37 </para>
38 </note>
39
40 &lfs120_checked;
41
42 <bridgehead renderas="sect3">Package Information</bridgehead>
43 <itemizedlist spacing="compact">
44 <listitem>
45 <para>
46 Download (HTTP): <ulink url="&mesa-download-http;"/>
47 </para>
48 </listitem>
49 <listitem>
50 <para>
51 Download (FTP): <ulink url="&mesa-download-ftp;"/>
52 </para>
53 </listitem>
54 <listitem>
55 <para>
56 Download MD5 sum: &mesa-md5sum;
57 </para>
58 </listitem>
59 <listitem>
60 <para>
61 Download size: &mesa-size;
62 </para>
63 </listitem>
64 <listitem>
65 <para>
66 Estimated disk space required: &mesa-buildsize;
67 </para>
68 </listitem>
69 <listitem>
70 <para>
71 Estimated build time: &mesa-time;
72 </para>
73 </listitem>
74 </itemizedlist>
75
76 <bridgehead renderas="sect3">Additional Downloads</bridgehead>
77 <itemizedlist spacing="compact">
78 <!-- 9 Apr 23. Change to unversioned patch since it never changes. -->
79 <listitem>
80 <para>
81 Recommended patch:
82 <ulink url="&patch-root;/mesa-add_xdemos-2.patch"/>
83 (installs 2 demo programs for testing Mesa - not needed if you
84 install the <ulink url="https://archive.mesa3d.org/demos/">
85 mesa-demos</ulink> package)
86 </para>
87 </listitem>
88 </itemizedlist>
89
90 <bridgehead renderas="sect3">Mesa Dependencies</bridgehead>
91
92 <bridgehead renderas="sect4">Required</bridgehead>
93 <para role="required">
94 <xref linkend="xorg7-lib"/>,
95 <xref linkend="libdrm"/>, and
96 <xref linkend="Mako"/>
97 </para>
98
99 <bridgehead renderas="sect4">Recommended</bridgehead>
100 <para role="recommended">
101
102 <xref role="first" linkend="libva"/> (to provide VA-API support for some
103 gallium drivers, note that there is a circular dependency. You must
104 build <application>libva</application> first without EGL and GLX support,
105 install this package, and rebuild <application>libva</application>),
106
107 <xref linkend="libvdpau"/> (to build VDPAU drivers),
108
109 <xref linkend="llvm"/> (required for Gallium3D, nouveau, and radeonsi
110 drivers and for swrast, the software rasterizer which is sometimes referred
111 to as llvmpipe. See <ulink role="nodep"
112 url="https://docs.mesa3d.org/systems.html"/> for more information), and
113
114 <xref linkend="wayland-protocols"/> (required for
115 <xref role="nodep" linkend='plasma5-build'/>,
116 GNOME, and recommended for <xref role="nodep" linkend='gtk3'/>)
117 </para>
118
119 <bridgehead renderas="sect4">Optional</bridgehead>
120 <para role="optional">
121 <xref linkend="libgcrypt"/>,
122 <xref linkend="libunwind"/>,
123 <xref linkend="lm_sensors"/> <!-- for libsensors according to Meson -->,
124 <xref linkend="nettle"/>,
125 <xref linkend="valgrind"/>,
126 <ulink url="https://archive.mesa3d.org/demos/">mesa-demos</ulink>
127 (provides more than 300 extra demos to test
128 <application>Mesa</application>; this includes the same programs added by
129 the patch above),
130 <ulink url="https://omxil.sourceforge.net/">Bellagio OpenMAX Integration
131 Layer</ulink> (for mobile platforms),
132 <ulink url="https://github.com/KhronosGroup/glslang">glslang</ulink>
133 (for vulkan drivers),
134 <ulink url="https://github.com/tizonia/tizonia-openmax-il/wiki/Tizonia-OpenMAX-IL/">
135 libtizonia</ulink>, and
136 <ulink url="https://github.com/KhronosGroup/Vulkan-Loader">Vulkan-Loader</ulink>
137 </para>
138<!--
139 <note>
140 <para>
141 The instructions below assume that
142 <application>LLVM</application> with the r600/amdgpu and host backends
143 and run-time type information (RTTI - needed for nouveau) are installed.
144 You will need to modify the instructions if you
145 choose not to install all of these. For an explanation of Gallium3D see
146 <ulink url="https://en.wikipedia.org/wiki/Gallium3D"/>.
147 </para>
148 </note>
149-->
150 </sect2>
151
152 <sect2 role="kernel" id="mesa-kernel"
153 xreflabel='Mesa Kernel Configuration'>
154 <title>Kernel Configuration</title>
155
156 <para>
157 Enable the following options in the kernel configuration and
158 recompile the kernel if necessary:
159 </para>
160
161 <xi:include xmlns:xi="http://www.w3.org/2001/XInclude"
162 href="mesa-kernel.xml"/>
163
164 <note>
165 <para>
166 The corresponding Mesa Gallium3D driver name is provided as the
167 comment for the configuration entries. If you don't know the name
168 of the Mesa Gallium3D driver for your GPU, see <xref
169 linkend="mesa-gallium-drivers"/> below.
170 </para>
171
172 <para>
173 <option>CONFIG_DRM_RADEON</option>,
174 <option>CONFIG_DRM_AMDGPU</option>,
175 <option>CONFIG_DRM_NOUVEAU</option>, and
176 <option>CONFIG_DRM_I915</option> may require firmware.
177 See <xref linkend='postlfs-firmware'/> for details.
178 </para>
179
180 <para>
181 Selecting <option>CONFIG_DRM_RADEON</option> or
182 <option>CONFIG_DRM_AMDGPU</option> as
183 <quote><literal>y</literal></quote> is not recommended. If it is, any
184 required firmware must be built as a part of the kernel image or the
185 initramfs for the driver to function correctly.
186 </para>
187
188 <para>
189 The sub-entries under <option>CONFIG_DRM_AMDGPU</option> are used
190 to ensure the AMDGPU kernel driver supports all GPUs using the
191 <literal>radeonsi</literal> driver. They are not needed if you
192 won't need <option>CONFIG_DRM_AMDGPU</option> itself. They
193 may be unneeded for some GPU models.
194 </para>
195
196 <para>
197 For <literal>swrast</literal>, <option>CONFIG_DRM_VGEM</option>
198 is not strictly needed but recommended as an optimization.
199 </para>
200 </note>
201 <indexterm zone="mesa mesa-kernel">
202 <primary sortas="d-mesa">mesa</primary>
203 </indexterm>
204 </sect2>
205
206 <sect2 role="installation">
207 <title>Installation of Mesa</title>
208 <para>
209 If you have downloaded the xdemos patch (needed if testing the Xorg
210 installation per BLFS instructions), apply it by running the following
211 command:
212 </para>
213
214<!--<screen><userinput>patch -Np1 -i ../mesa-&mesa-version;-add_xdemos-1.patch</userinput></screen>-->
215<screen><userinput>patch -Np1 -i ../mesa-add_xdemos-2.patch</userinput></screen>
216
217 <!-- Note that freedreno, vc4, and virgl all need special support from
218 libdrm - renodr
219 For me, libdrm does not mention virgl, but mesa accepts it. AFAICS
220 freedreno is for qualcom hardware, libdrm will build for it on suitable
221 systems. VC4 is for the Broadcom VC4 used in the raspberry pi - ken -->
222<!--
223 <note>
224 <para>
225 The measurements above, and the Contents below, are for a full build.
226 Many people will not wish to install drivers they cannot use, so the
227 following paragraphs explain how to limit the drivers, and give an
228 example which can be be reduced or amended as necessary.
229 </para>
230 </note>
231
232-->
233<!--
234 <para>
235 The (non-gallium) DRI drivers available in X86 are auto, <emphasis>or
236 alternatively a choice from</emphasis> i915, i965, nouveau, r100, r200,
237 and swrast. Use 'auto' to build all available DRI drivers, or use an
238 empty string (DRI_DRIVERS="") if you wish to only build gallium drivers.
239 </para>
240
241 <para>
242 The platforms ("window systems") available for X86 linux are x11, wayland,
243 drm, and surfaceless. By not specifying anything, the meson
244 build-system will build for all these platforms if you have the
245 dependencies, identical to if you had specified '-Dplatforms=auto'.
246 </para>
247
248 <para>
249 Modify the commands below for your desired drivers. The drivers listed
250 below will cover most modern video cards and virtual machines. For help in
251 selecting drivers see <ulink url="https://docs.mesa3d.org/systems.html"/>.
252-->
253 <!-- these two don't seem to be mentioned in that mesa link -->
254<!--
255 For intel drivers, specify crocus for i965 gen 4 through to haswell, iris
256 for broadwell and later.
257 </para>
258
259 <note>
260 <para>
261 Although the nouveau drivers can be built for both gallium and dri, the
262 i915 driver can only be built for one or the other.
263 </para>
264 </note>
265
266<screen><userinput>GALLIUM_DRV="crocus,i915,iris,nouveau,r600,radeonsi,svga,swrast,virgl"
267DRI_DRIVERS="i965,nouveau"</userinput></screen>
268-->
269
270 <!-- https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22021 -->
271 <para>
272 Remove two unneeded references to LLVM headers to avoid a build
273 failure with LLVM 17 or later:
274 </para>
275
276<screen><userinput>sed '/Scalar.h/d;/Utils.h/d' \
277 -i src/gallium/auxiliary/gallivm/lp_bld_init.c</userinput></screen>
278
279 <para>
280 Install <application>Mesa</application> by running the following
281 commands:
282 </para>
283
284<screen><userinput>mkdir build &amp;&amp;
285cd build &amp;&amp;
286
287meson setup \
288 --prefix=$XORG_PREFIX \
289 --buildtype=release \
290 -Dplatforms=x11,wayland \
291 -Dgallium-drivers=auto \
292 -Dvulkan-drivers="" \
293 -Dvalgrind=disabled \
294 -Dlibunwind=disabled \
295 .. &amp;&amp;
296
297ninja</userinput></screen>
298
299 <para>
300 To test the results, issue:
301 <command>meson configure -Dbuild-tests=true &amp;&amp; ninja test</command>.
302 One test relating to mesa:util is known to timeout
303 </para>
304<!-- All 88 tests passed for me for 22.3.3 [pierre]
305 All 90 tests passed for me for 23.1.0 [bdubbs]
306 89 Tests passed for me, 1 timeout on 23.1.8 [rahul]
307-->
308
309 <para>
310 Now, as the <systemitem class="username">root</systemitem> user:
311 </para>
312
313<screen role="root"><userinput>ninja install</userinput></screen>
314
315 <para>
316 If desired, install the optional documentation by running
317 the following commands as the
318 <systemitem class="username">root</systemitem> user:
319 </para>
320
321<screen role="root"
322 remap="doc"><userinput>install -v -dm755 /usr/share/doc/mesa-&mesa-version; &amp;&amp;
323cp -rfv ../docs/* /usr/share/doc/mesa-&mesa-version;</userinput></screen>
324
325 </sect2>
326
327 <sect2 role="commands">
328 <title>Command Explanations</title>
329
330 <para>
331 <parameter>--buildtype=release</parameter>: This switch ensures a
332 fully-optimized build, and disables debug assertions which will
333 severely slow down the libraries in certain use-cases. Without this
334 switch, build sizes can span into the 2GB range.
335 </para>
336
337 <para>
338 <anchor id='mesa-gallium-drivers' xreflabel='Mesa Gallium3D Drivers'/>
339 <parameter>-Dgallium-drivers=auto</parameter>: This parameter
340 controls which Gallium3D drivers should be built.
341 <literal>auto</literal> selects all Gallium3D drivers available
342 for x86: <literal>r300</literal> (for ATI Radeon 9000 or Radeon X
343 series), <literal>r600</literal> (for AMD/ATI Radeon HD 2000-6000
344 series), <literal>radeonsi</literal> (for AMD Radeon HD 7000 or newer
345 AMD GPU models), <literal>nouveau</literal>
346 (for Supported NVIDIA GPUs, they are listed as all
347 <quote>3D features</quote> either <quote>DONE</quote> or
348 <quote>N/A</quote> in <ulink
349 url='https://nouveau.freedesktop.org/FeatureMatrix.html'>the Nouveau
350 status page</ulink>), <literal>virgl</literal> (for QEMU virtual GPU
351 with <application>virglrender</application> support; note that BLFS
352 <xref linkend='qemu'/> is not built with
353 <application>virglrender</application>), <literal>svga</literal>
354 (for VMWare virtual GPU), <literal>swrast</literal> (using CPU for 3D
355 rasterisation; note that it's much slower than using a modern
356 3D-capable GPU, so it should be only used if the GPU is not supported
357 by other drivers), <literal>iris</literal> (for Intel GPUs shipped
358 with Broadwell or newer CPUs), <literal>crocus</literal> (for Intel
359 GMA 3000, X3000 series, 4000 series, or X4000 series GPUs shipped with
360 chipsets, or Intel HD GPUs shipped with pre-Broadwell CPUs),
361 <literal>i915</literal> (for Intel GMA 900, 950, 3100, or 3150 GPUs
362 shipped with chipsets or Atom D/N 4xx/5xx CPUs). You may replace
363 <literal>auto</literal> with a comma-separated list to build only
364 a subset of these drivers if you precisely know which drivers you
365 need, for example
366 <option>-Dgallium-drivers=radeonsi,iris,swrast</option>.
367 </para>
368<!--
369 <para>
370 <parameter>-Dosmesa=true</parameter>: This switch enables building
371 the <filename class="libraryfile">libOSMesa</filename> library and
372 provides Gallium3D support in it. It requires the swrast gallium driver.
373 </para>
374-->
375
376 <para>
377 <parameter>-Dplatforms="..."</parameter>: This parameter
378 controls which windowing systems will be supported. Available
379 linux platforms are x11 and wayland.
380 </para>
381
382 <para>
383 <parameter>-Dvulkan-drivers=""</parameter>: This switch allows choosing
384 which Vulkan drivers are built. The default is auto, but this requires
385 the optional dependencies <application>glslang</application> and
386 <application>Vulkan-Loader</application>. Vulkan is a newer API
387 designed for utilizing the GPUs with a performance better than OpenGL,
388 but nothing in BLFS benefits from it for now. So we pass an empty
389 list in order to remove the need for these dependencies.
390 </para>
391
392 <para>
393 <parameter>-Dvalgrind=disabled</parameter>: This parameter disables
394 the usage of Valgrind during the build process. Remove this parameter
395 if you have Valgrind installed, and wish to check for memory leaks.
396 </para>
397
398 <para>
399 <parameter>-Dlibunwind=disabled</parameter>: This parameter disables
400 the usage of libunwind.
401 </para>
402
403 <para>
404 <command>meson configure -Dbuild-tests=true</command>: This command will
405 reconfigure the build to set <option>-Dbuild-tests=true</option>, but
406 keep the other options specified in the <command>meson setup</command>
407 command unchanged. It allows <command>ninja test</command> to build and
408 run unit tests.
409 </para>
410
411 <para>
412 <option>-Degl-native-platform="..."</option>: This parameter
413 controls which Embedded Graphics Library support will be built. Available
414 linux options are auto (default), x11, wayland, surfaceless, and drm.
415 </para>
416
417 </sect2>
418
419 <sect2 role="content">
420 <title>Contents</title>
421
422 <segmentedlist>
423 <segtitle>Installed Programs</segtitle>
424 <segtitle>Installed Libraries</segtitle><!-- in /usr/lib -->
425 <segtitle>Installed Drivers</segtitle><!-- in /usr/lib/<subdir> -->
426 <segtitle>Installed Directories</segtitle>
427
428 <seglistitem>
429 <seg>
430 glxgears and glxinfo
431 </seg>
432 <seg>
433 libEGL.so,
434 libGL.so,
435 libGLESv1_CM.so,
436 libGLESv2.so,
437 libgbm.so,
438 libglapi.so, and
439 libxatracker.so
440 </seg>
441 <seg>
442 <!-- d3dadapter9.so (optional)
443 I guess this is useless today, Wine applications use Vulkan
444 through libvkd3d, and new games with native Linux support
445 likely uses Vulkan directly. -->
446 <!-- Begin gallium DRI drivers (*_dri.so) and VA-API drivers
447 (*_drv_video.so): this is the full set -->
448 crocus_dri.so,
449 i915_dri.so,
450 iris_dri.so,
451 kms_swrast_dri.so,
452 nouveau_dri.so,
453 nouveau_drv_video.so,
454 r300_dri.so,
455 r600_dri.so,
456 r600_drv_video.so,
457 radeonsi_dri.so,
458 radeonsi_drv_video.so,
459 swrast_dri.so,
460 virtio_gpu_dri.so,
461 virtio_gpu_drv_video.so,
462 vmwgfx_dri.so,
463 <!-- End DRI Drivers -->
464 <!-- Begin VDPAU drivers -->
465 libvdpau_nouveau.so,
466 libvdpau_r300.so
467 libvdpau_r600.so, and
468 libvdpau_radeonsi.so
469 libvdpau_virtio_gpu.so
470 <!-- End VDPAU drivers -->
471 (Many of these drivers are hard-linked).
472 </seg>
473 <seg>
474 <!-- $XORG_PREFIX/include/GL is installed by xorg-protos -->
475 $XORG_PREFIX/{include/{EGL,GLES,GLES2,GLES3,KHR},
476 $XORG_PREFIX/lib/{dri,vdpau}},
477 $XORG_PREFIX/share/drirc.d (contains workarounds for various applications,
478 particularly browsers and games),
479 and /usr/share/doc/mesa-&mesa-version;
480 </seg>
481 </seglistitem>
482 </segmentedlist>
483
484 <variablelist>
485 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
486 <?dbfo list-presentation="list"?>
487 <?dbhtml list-presentation="table"?>
488
489 <varlistentry id="glxgears">
490 <term><command>glxgears</command></term>
491 <listitem>
492 <para>
493 is a GL demo useful for troubleshooting graphics
494 problems
495 </para>
496 <indexterm zone="mesa glxgears">
497 <primary sortas="b-glxgears">glxgears</primary>
498 </indexterm>
499 </listitem>
500 </varlistentry>
501
502 <varlistentry id="glxinfo">
503 <term><command>glxinfo</command></term>
504 <listitem>
505 <para>
506 is a diagnostic program that displays information about the
507 graphics hardware and installed GL libraries
508 </para>
509 <indexterm zone="mesa glxinfo">
510 <primary sortas="b-glxinfo">glxinfo</primary>
511 </indexterm>
512 </listitem>
513 </varlistentry>
514
515 <varlistentry id="libEGL">
516 <term><filename class="libraryfile">libEGL.so</filename></term>
517 <listitem>
518 <para>
519 provides a native platform graphics interface as
520 defined by the EGL-1.4 specification
521 </para>
522 <indexterm zone="mesa libEGL">
523 <primary sortas="c-libGL">libEGL.so</primary>
524 </indexterm>
525 </listitem>
526 </varlistentry>
527
528 <varlistentry id="libgbm">
529 <term><filename class="libraryfile">libgbm.so</filename></term>
530 <listitem>
531 <para>
532 is the <application>Mesa</application> Graphics Buffer
533 Manager library
534 </para>
535 <indexterm zone="mesa libgbm">
536 <primary sortas="c-libgbm">libgbm.so</primary>
537 </indexterm>
538 </listitem>
539 </varlistentry>
540
541 <varlistentry id="libGLESv1_CM">
542 <term><filename class="libraryfile">libGLESv1_CM.so</filename></term>
543 <listitem>
544 <para>
545 is the <application>Mesa</application> OpenGL ES 1.1 library
546 </para>
547 <indexterm zone="mesa libGLESv1_CM">
548 <primary sortas="c-libGLESv1_CM">libGLESv1_CM.so</primary>
549 </indexterm>
550 </listitem>
551 </varlistentry>
552
553 <varlistentry id="libGLES2">
554 <term><filename class="libraryfile">libGLES2.so</filename></term>
555 <listitem>
556 <para>
557 is the <application>Mesa</application> OpenGL ES 2.0 library
558 </para>
559 <indexterm zone="mesa libGLES2">
560 <primary sortas="c-libGLES2">libGLES2.so</primary>
561 </indexterm>
562 </listitem>
563 </varlistentry>
564
565 <varlistentry id="libGL">
566 <term><filename class="libraryfile">libGL.so</filename></term>
567 <listitem>
568 <para>
569 is the main <application>Mesa</application> OpenGL library
570 </para>
571 <indexterm zone="mesa libGL">
572 <primary sortas="c-libGL">libGL.so</primary>
573 </indexterm>
574 </listitem>
575 </varlistentry>
576
577 </variablelist>
578
579 </sect2>
580
581</sect1>
Note: See TracBrowser for help on using the repository browser.