source: x/installing/mesa.xml@ ce80a743

12.0 12.1 kea ken/TL2024 ken/tuningfonts lazarus lxqt plabs/newcss python3.11 rahul/power-profiles-daemon renodr/vulkan-addition trunk xry111/llvm18 xry111/xf86-video-removal
Last change on this file since ce80a743 was bf92b52, checked in by Pierre Labastie <pierre.labastie@…>, 12 months ago

mesa: patch to prevent segfaults on old Intel IGP

  • Property mode set to 100644
File size: 17.9 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 "ftp://ftp.freedesktop.org/pub/mesa/mesa-&mesa-version;.tar.xz">
9 <!ENTITY mesa-md5sum "0e9859110df4425e83186e0645452daa">
10 <!ENTITY mesa-size "17 MB">
11 <!ENTITY mesa-buildsize "462 MB (with docs, add 221 MB for tests)">
12 <!ENTITY mesa-time "2.2 SBU (With docs; add 2.3 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 &lfs113_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 <listitem>
89 <para>
90 Required patch if using an Intel integrated graphics processor
91 of 9th generation or lower:
92 <ulink url="&patch-root;/mesa-23.1.2-intel_segfault-1.patch"/>
93 </para>
94 </listitem>
95 </itemizedlist>
96
97 <bridgehead renderas="sect3">Mesa Dependencies</bridgehead>
98
99 <bridgehead renderas="sect4">Required</bridgehead>
100 <para role="required">
101 <xref linkend="xorg7-lib"/>,
102 <xref linkend="libdrm"/>, and
103 <xref linkend="Mako"/>
104 </para>
105
106 <bridgehead renderas="sect4">Recommended</bridgehead>
107 <para role="recommended">
108
109 <xref role="first" linkend="libva"/> (to provide VA-API support for some
110 gallium drivers, note that there is a circular dependency. You must
111 build <application>libva</application> first without EGL and GLX support,
112 install this package, and rebuild <application>libva</application>),
113
114 <xref linkend="libvdpau"/> (to build VDPAU drivers),
115
116 <xref linkend="llvm"/> (required for Gallium3D, nouveau, and radeonsi
117 drivers and for swrast, the software rasterizer which is sometimes referred
118 to as llvmpipe. See <ulink role="nodep"
119 url="https://docs.mesa3d.org/systems.html"/> for more information), and
120
121 <xref linkend="wayland-protocols"/> (required for
122 <xref role="nodep" linkend='plasma5-build'/>,
123 GNOME, and recommended for <xref role="nodep" linkend='gtk3'/>)
124 </para>
125
126 <bridgehead renderas="sect4">Optional</bridgehead>
127 <para role="optional">
128 <xref linkend="libgcrypt"/>,
129 <xref linkend="libunwind"/>,
130 <xref linkend="lm_sensors"/> <!-- for libsensors according to Meson -->,
131 <xref linkend="nettle"/>,
132 <xref linkend="valgrind"/>,
133 <ulink url="https://archive.mesa3d.org/demos/">mesa-demos</ulink>
134 (provides more than 300 extra demos to test
135 <application>Mesa</application>; this includes the same programs added by
136 the patch above),
137 <ulink url="https://omxil.sourceforge.net/">Bellagio OpenMAX Integration
138 Layer</ulink> (for mobile platforms),
139 <ulink url="https://github.com/KhronosGroup/glslang">glslang</ulink>
140 (for vulkan drivers),
141 <ulink url="https://github.com/tizonia/tizonia-openmax-il/wiki/Tizonia-OpenMAX-IL/">
142 libtizonia</ulink>, and
143 <ulink url="https://www.vulkan.org/">libvulkan</ulink>
144 </para>
145<!--
146 <note>
147 <para>
148 The instructions below assume that
149 <application>LLVM</application> with the r600/amdgpu and host backends
150 and run-time type information (RTTI - needed for nouveau) are installed.
151 You will need to modify the instructions if you
152 choose not to install all of these. For an explanation of Gallium3D see
153 <ulink url="https://en.wikipedia.org/wiki/Gallium3D"/>.
154 </para>
155 </note>
156-->
157 <para condition="html" role="usernotes">User Notes:
158 <ulink url="&blfs-wiki;/mesalib"/>
159 </para>
160 </sect2>
161
162 <sect2 role="installation">
163 <title>Installation of Mesa</title>
164
165 <para>
166 If you have downloaded the xdemos patch (needed if testing the Xorg
167 installation per BLFS instructions), apply it by running the following
168 command:
169 </para>
170
171<!--<screen><userinput>patch -Np1 -i ../mesa-&mesa-version;-add_xdemos-1.patch</userinput></screen>-->
172<screen><userinput>patch -Np1 -i ../mesa-add_xdemos-2.patch</userinput></screen>
173
174 <!-- Note that freedreno, vc4, and virgl all need special support from
175 libdrm - renodr
176 For me, libdrm does not mention virgl, but mesa accepts it. AFAICS
177 freedreno is for qualcom hardware, libdrm will build for it on suitable
178 systems. VC4 is for the Broadcom VC4 used in the raspberry pi - ken -->
179<!--
180 <note>
181 <para>
182 The measurements above, and the Contents below, are for a full build.
183 Many people will not wish to install drivers they cannot use, so the
184 following paragraphs explain how to limit the drivers, and give an
185 example which can be be reduced or amended as necessary.
186 </para>
187 </note>
188
189 <para>
190 Now, select the drivers you wish to install. For the X86 architecture, the
191 available gallium drivers are auto (<emphasis>in 21.2.1 this does not select
192 crocus </emphasis>), <emphasis>or alternatively a choice from</emphasis>
193 crocus, i915, iris, nouveau, r300, r600, radeonsi, svga, swrast, and virgl.
194 The latter can provide acceleration in <xref linkend="qemu"/> if that has
195 been linked against
196 <ulink url="https://gitlab.freedesktop.org/virgl/virglrenderer/~/releases/">virglrenderer</ulink>
197 (you will need a freedesktop.org account to get to that page, you can
198 download the 0.9.1 release without an account from
199 <ulink url="https://gitlab.freedesktop.org/virgl/virglrenderer/-/archive/0.9.1/virglrenderer-0.9.1.tar.bz2">virglrenderer-0.9.1</ulink>).-->
200
201<!-- If you wish to build all available gallium drivers,
202 use 'auto'. FIXME : does not build crocus in 21.2.1 -->
203
204 <!-- crocus was added to the default x86/x86_64 drivers for meson in the
205 master branch on 2021-08-31, at some point it will appear in a stable release
206 </para>
207-->
208<!--
209 <para>
210 The (non-gallium) DRI drivers available in X86 are auto, <emphasis>or
211 alternatively a choice from</emphasis> i915, i965, nouveau, r100, r200,
212 and swrast. Use 'auto' to build all available DRI drivers, or use an
213 empty string (DRI_DRIVERS="") if you wish to only build gallium drivers.
214 </para>
215
216 <para>
217 The platforms ("window systems") available for X86 linux are x11, wayland,
218 drm, and surfaceless. By not specifying anything, the meson
219 build-system will build for all these platforms if you have the
220 dependencies, identical to if you had specified '-Dplatforms=auto'.
221 </para>
222
223 <para>
224 Modify the commands below for your desired drivers. The drivers listed
225 below will cover most modern video cards and virtual machines. For help in
226 selecting drivers see <ulink url="https://docs.mesa3d.org/systems.html"/>.
227-->
228 <!-- these two don't seem to be mentioned in that mesa link -->
229<!--
230 For intel drivers, specify crocus for i965 gen 4 through to haswell, iris
231 for broadwell and later.
232 </para>
233
234 <note>
235 <para>
236 Although the nouveau drivers can be built for both gallium and dri, the
237 i915 driver can only be built for one or the other.
238 </para>
239 </note>
240
241<screen><userinput>GALLIUM_DRV="crocus,i915,iris,nouveau,r600,radeonsi,svga,swrast,virgl"
242DRI_DRIVERS="i965,nouveau"</userinput></screen>
243-->
244
245 <para>
246 If you use an Intel processor with integrated graphics of generation 9
247 or lower, apply the following patch to prevent segmentation faults:
248 </para>
249
250<screen><userinput>patch -Np1 -i ../mesa-23.1.2-intel_segfault-1.patch</userinput></screen>
251
252 <para>
253 Install <application>Mesa</application> by running the following
254 commands:
255 </para>
256
257<screen><userinput>mkdir build &amp;&amp;
258cd build &amp;&amp;
259
260meson setup \
261 --prefix=$XORG_PREFIX \
262 --buildtype=release \
263 -Dplatforms=x11,wayland \
264 -Dgallium-drivers=auto \
265 -Dvulkan-drivers="" \
266 -Dvalgrind=disabled \
267 -Dlibunwind=disabled \
268 .. &amp;&amp;
269
270ninja</userinput></screen>
271
272 <para>
273 To test the results, issue:
274 <command>meson configure -Dbuild-tests=true &amp;&amp; ninja test</command>.
275 </para>
276<!-- All 88 tests passed for me for 22.3.3 [pierre]
277 All 90 tests passed for me for 23.1.0 [bdubbs]
278-->
279
280 <para>
281 Now, as the <systemitem class="username">root</systemitem> user:
282 </para>
283
284<screen role="root"><userinput>ninja install</userinput></screen>
285
286 <para>
287 If desired, install the optional documentation by running
288 the following commands as the
289 <systemitem class="username">root</systemitem> user:
290 </para>
291
292<screen role="root"
293 remap="doc"><userinput>install -v -dm755 /usr/share/doc/mesa-&mesa-version; &amp;&amp;
294cp -rfv ../docs/* /usr/share/doc/mesa-&mesa-version;</userinput></screen>
295
296 </sect2>
297
298 <sect2 role="commands">
299 <title>Command Explanations</title>
300
301 <para>
302 <parameter>--buildtype=release</parameter>: This switch ensures a
303 fully-optimized build, and disables debug assertions which will
304 severely slow down the libraries in certain use-cases. Without this
305 switch, build sizes can span into the 2GB range.
306 </para>
307
308 <para>
309 <parameter>-Dgallium-drivers="..."</parameter>: This parameter
310 controls which Gallium3D drivers should be built.
311 </para>
312<!--
313 <para>
314 <parameter>-Dosmesa=true</parameter>: This switch enables building
315 the <filename class="libraryfile">libOSMesa</filename> library and
316 provides Gallium3D support in it. It requires the swrast gallium driver.
317 </para>
318-->
319
320 <para>
321 <parameter>-Dplatforms="..."</parameter>: This parameter
322 controls which windowing systems will be supported. Available
323 linux platforms are x11 and wayland.
324 </para>
325
326 <para>
327 <parameter>-Dvulkan-drivers=""</parameter>: This switch allows choosing
328 which Vulkan drivers are built. The default is auto, but this requires
329 the optional dependency <filename>glslang</filename>. So it is better
330 to pass an empty list, in order to remove the need for that
331 dependency. Nothing in BLFS uses Vulkan anyway.
332 </para>
333
334 <para>
335 <parameter>-Dvalgrind=disabled</parameter>: This parameter disables
336 the usage of Valgrind during the build process. Remove this parameter
337 if you have Valgrind installed, and wish to check for memory leaks.
338 </para>
339
340 <para>
341 <parameter>-Dlibunwind=disabled</parameter>: This parameter disables
342 the usage of libunwind.
343 </para>
344
345 <para>
346 <command>meson configure -Dbuild-tests=true</command>: This command will
347 reconfigure the build to set <option>-Dbuild-tests=true</option>, but
348 keep the other options specified in the <command>meson setup</command>
349 command unchanged. It allows <command>ninja test</command> to build and
350 run unit tests.
351 </para>
352
353 <para>
354 <option>-Degl-native-platform="..."</option>: This parameter
355 controls which Embedded Graphics Library support will be built. Available
356 linux options are auto (default), x11, wayland, surfaceless, and drm.
357 </para>
358
359 </sect2>
360
361 <sect2 role="content">
362 <title>Contents</title>
363
364 <segmentedlist>
365 <segtitle>Installed Programs</segtitle>
366 <segtitle>Installed Libraries</segtitle><!-- in /usr/lib -->
367 <segtitle>Installed Drivers</segtitle><!-- in /usr/lib/<subdir> -->
368 <segtitle>Installed Directories</segtitle>
369
370 <seglistitem>
371 <seg>
372 glxgears and glxinfo
373 </seg>
374 <seg>
375 libEGL.so,
376 libGL.so,
377 libGLESv1_CM.so,
378 libGLESv2.so,
379 libgbm.so,
380 libglapi.so, and
381 libxatracker.so
382 </seg>
383 <seg>
384 <!-- Begin gallium DRI drivers : this is the full set -->
385<!-- d3dadapter9.so (optional), For Windows games. This is DirectX's
386 Direct3D -->
387 crocus_dri.so,
388 i915_dri.so,
389 iris_dri.so,
390 kms_swrast_dri.so,
391 nouveau_dri.so,
392 nouveau_drv_video.so,
393 r300_dri.so,
394 r600_dri.so,
395 r600_drv_video.so,
396 radeonsi_dri.so,
397 radeonsi_drv_video.so,
398 swrast_dri.so,
399 virtio_gpu_dri.so,
400 virtio_gpu_drv_video.so,
401 vmwgfx_dri.so,
402 <!-- End DRI Drivers -->
403 <!-- Begin VDPAU drivers -->
404 libvdpau_nouveau.so,
405 libvdpau_r300.so
406 libvdpau_r600.so, and
407 libvdpau_radeonsi.so
408 libvdpau_virtio_gpu.so
409 <!-- End VDPAU drivers -->
410 (Many of these drivers are hard-linked).
411 </seg>
412 <seg>
413 <!-- $XORG_PREFIX/include/GL is installed by xorg-protos -->
414 $XORG_PREFIX/{include/{EGL,GLES,GLES2,GLES3,KHR},
415 $XORG_PREFIX/lib/{dri,vdpau}},
416 $XORG_PREFIX/share/drirc.d (contains workarounds for various applications,
417 particularly browsers and games),
418 and /usr/share/doc/mesa-&mesa-version;
419 </seg>
420 </seglistitem>
421 </segmentedlist>
422
423 <variablelist>
424 <bridgehead renderas="sect3">Short Descriptions</bridgehead>
425 <?dbfo list-presentation="list"?>
426 <?dbhtml list-presentation="table"?>
427
428 <varlistentry id="glxgears">
429 <term><command>glxgears</command></term>
430 <listitem>
431 <para>
432 is a GL demo useful for troubleshooting graphics
433 problems
434 </para>
435 <indexterm zone="mesa glxgears">
436 <primary sortas="b-glxgears">glxgears</primary>
437 </indexterm>
438 </listitem>
439 </varlistentry>
440
441 <varlistentry id="glxinfo">
442 <term><command>glxinfo</command></term>
443 <listitem>
444 <para>
445 is a diagnostic program that displays information about the
446 graphics hardware and installed GL libraries
447 </para>
448 <indexterm zone="mesa glxinfo">
449 <primary sortas="b-glxinfo">glxinfo</primary>
450 </indexterm>
451 </listitem>
452 </varlistentry>
453
454 <varlistentry id="libEGL">
455 <term><filename class="libraryfile">libEGL.so</filename></term>
456 <listitem>
457 <para>
458 provides a native platform graphics interface as
459 defined by the EGL-1.4 specification
460 </para>
461 <indexterm zone="mesa libEGL">
462 <primary sortas="c-libGL">libEGL.so</primary>
463 </indexterm>
464 </listitem>
465 </varlistentry>
466
467 <varlistentry id="libgbm">
468 <term><filename class="libraryfile">libgbm.so</filename></term>
469 <listitem>
470 <para>
471 is the <application>Mesa</application> Graphics Buffer
472 Manager library
473 </para>
474 <indexterm zone="mesa libgbm">
475 <primary sortas="c-libgbm">libgbm.so</primary>
476 </indexterm>
477 </listitem>
478 </varlistentry>
479
480 <varlistentry id="libGLESv1_CM">
481 <term><filename class="libraryfile">libGLESv1_CM.so</filename></term>
482 <listitem>
483 <para>
484 is the <application>Mesa</application> OpenGL ES 1.1 library
485 </para>
486 <indexterm zone="mesa libGLESv1_CM">
487 <primary sortas="c-libGLESv1_CM">libGLESv1_CM.so</primary>
488 </indexterm>
489 </listitem>
490 </varlistentry>
491
492 <varlistentry id="libGLES2">
493 <term><filename class="libraryfile">libGLES2.so</filename></term>
494 <listitem>
495 <para>
496 is the <application>Mesa</application> OpenGL ES 2.0 library
497 </para>
498 <indexterm zone="mesa libGLES2">
499 <primary sortas="c-libGLES2">libGLES2.so</primary>
500 </indexterm>
501 </listitem>
502 </varlistentry>
503
504 <varlistentry id="libGL">
505 <term><filename class="libraryfile">libGL.so</filename></term>
506 <listitem>
507 <para>
508 is the main <application>Mesa</application> OpenGL library
509 </para>
510 <indexterm zone="mesa libGL">
511 <primary sortas="c-libGL">libGL.so</primary>
512 </indexterm>
513 </listitem>
514 </varlistentry>
515
516 </variablelist>
517
518 </sect2>
519
520</sect1>
Note: See TracBrowser for help on using the repository browser.