• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2<html lang="en">
3<head>
4  <meta http-equiv="content-type" content="text/html; charset=utf-8">
5  <title>Environment Variables</title>
6  <link rel="stylesheet" type="text/css" href="mesa.css">
7</head>
8<body>
9
10<div class="header">
11  <h1>The Mesa 3D Graphics Library</h1>
12</div>
13
14<iframe src="contents.html"></iframe>
15<div class="content">
16
17<h1>Environment Variables</h1>
18
19<p>
20Normally, no environment variables need to be set.  Most of the environment
21variables used by Mesa/Gallium are for debugging purposes, but they can
22sometimes be useful for debugging end-user issues.
23</p>
24
25
26<h2>LibGL environment variables</h2>
27
28<ul>
29<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
30   If set to 'verbose' additional information will be printed.
31<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
32<li>LIBGL_ALWAYS_INDIRECT - if set to `true`, forces an indirect rendering context/connection.
33<li>LIBGL_ALWAYS_SOFTWARE - if set to `true`, always use software rendering
34<li>LIBGL_NO_DRAWARRAYS - if set to `true`, do not use DrawArrays GLX protocol (for debugging)
35<li>LIBGL_SHOW_FPS - print framerate to stdout based on the number of glXSwapBuffers
36    calls per second.
37<li>LIBGL_DRI3_DISABLE - disable DRI3 if set to `true`.
38</ul>
39
40
41
42<h2>Core Mesa environment variables</h2>
43
44<ul>
45<li>MESA_NO_ASM - if set, disables all assembly language optimizations
46<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
47<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
48<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
49<li>MESA_NO_ERROR - if set to 1, error checking is disabled as per KHR_no_error.
50   This will result in undefined behaviour for invalid use of the api, but
51   can reduce CPU use for apps that are known to be error free.</li>
52<li>MESA_DEBUG - if set, error messages are printed to stderr.  For example,
53   if the application generates a GL_INVALID_ENUM error, a corresponding error
54   message indicating where the error occurred, and possibly why, will be
55   printed to stderr.<br>
56
57   For release builds, MESA_DEBUG defaults to off (no debug output).
58
59   MESA_DEBUG accepts the following comma-separated list of named
60   flags, which adds extra behaviour to just set MESA_DEBUG=1:
61   <ul>
62     <li>silent - turn off debug messages. Only useful for debug builds.</li>
63     <li>flush - flush after each drawing command</li>
64     <li>incomplete_tex - extra debug messages when a texture is incomplete</li>
65     <li>incomplete_fbo - extra debug messages when a fbo is incomplete</li>
66     <li>context - create a debug context (see GLX_CONTEXT_DEBUG_BIT_ARB) and
67         print error and performance messages to stderr (or MESA_LOG_FILE).</li>
68   </ul>
69<li>MESA_LOG_FILE - specifies a file name for logging all errors, warnings,
70etc., rather than stderr
71<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
72fragment programs (intended for developers only)
73<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
74operations with vertex programs (intended for developers only).
75Setting this variable automatically sets the MESA_TEX_PROG variable as well.
76<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
77A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
78and disable the GL_EXT_bar extension.
79<li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
80by extension year.
81If this variable is set to year X, only extensions defined on or before year
82X will be reported.
83This is to work-around a bug in some games where the extension string is
84copied into a fixed-size buffer without truncating.
85If the extension string is too long, the buffer overrun can cause the game
86to crash.
87This is a work-around for that.
88<li>MESA_GL_VERSION_OVERRIDE - changes the value returned by
89glGetString(GL_VERSION) and possibly the GL API type.
90<ul>
91  <li>The format should be MAJOR.MINOR[FC|COMPAT]
92  <li>FC is an optional suffix that indicates a forward compatible
93      context. This is only valid for versions &gt;= 3.0.
94  <li>COMPAT is an optional suffix that indicates a compatibility
95      context or GL_ARB_compatibility support. This is only valid for
96      versions &gt;= 3.1.
97  <li>GL versions &lt;= 3.0 are set to a compatibility (non-Core)
98      profile
99  <li>GL versions = 3.1, depending on the driver, it may or may not
100      have the ARB_compatibility extension enabled.
101  <li>GL versions &gt;= 3.2 are set to a Core profile
102  <li>Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC, 3.1COMPAT, X.Y, X.YFC,
103      X.YCOMPAT.
104  <ul>
105    <li>2.1 - select a compatibility (non-Core) profile with GL
106        version 2.1.
107    <li>3.0 - select a compatibility (non-Core) profile with GL
108        version 3.0.
109    <li>3.0FC - select a Core+Forward Compatible profile with GL
110        version 3.0.
111    <li>3.1 - select GL version 3.1 with GL_ARB_compatibility enabled
112        per the driver default.
113    <li>3.1FC - select GL version 3.1 with forward compatibility and
114        GL_ARB_compatibility disabled.
115    <li>3.1COMPAT - select GL version 3.1 with GL_ARB_compatibility
116        enabled.
117    <li>X.Y - override GL version to X.Y without changing the profile.
118    <li>X.YFC - select a Core+Forward Compatible profile with GL
119        version X.Y.
120    <li>X.YCOMPAT - select a Compatibility profile with GL version
121        X.Y.
122  </ul>
123  <li>Mesa may not really implement all the features of the given
124      version. (for developers only)
125</ul>
126<li>MESA_GLES_VERSION_OVERRIDE - changes the value returned by
127glGetString(GL_VERSION) for OpenGL ES.
128<ul>
129<li> The format should be MAJOR.MINOR
130<li> Examples: 2.0, 3.0, 3.1
131<li> Mesa may not really implement all the features of the given version.
132(for developers only)
133</ul>
134<li>MESA_GLSL_VERSION_OVERRIDE - changes the value returned by
135glGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as
136"130".  Mesa will not really implement all the features of the given language version
137if it's higher than what's normally reported. (for developers only)
138<li>MESA_GLSL_CACHE_DISABLE - if set to `true`, disables the GLSL shader cache
139<li>MESA_GLSL_CACHE_MAX_SIZE - if set, determines the maximum size of
140the on-disk cache of compiled GLSL programs. Should be set to a number
141optionally followed by 'K', 'M', or 'G' to specify a size in
142kilobytes, megabytes, or gigabytes. By default, gigabytes will be
143assumed. And if unset, a maximum size of 1GB will be used. Note: A separate
144cache might be created for each architecture that Mesa is installed for on
145your system. For example under the default settings you may end up with a 1GB
146cache for x86_64 and another 1GB cache for i386.
147<li>MESA_GLSL_CACHE_DIR - if set, determines the directory to be used
148for the on-disk cache of compiled GLSL programs. If this variable is
149not set, then the cache will be stored in $XDG_CACHE_HOME/mesa (if
150that variable is set), or else within .cache/mesa within the user's
151home directory.
152<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
153<li>MESA_NO_MINMAX_CACHE - when set, the minmax index cache is globally disabled.
154<li>MESA_SHADER_CAPTURE_PATH - see <a href="shading.html#capture">Capturing Shaders</a></li>
155<li>MESA_SHADER_DUMP_PATH and MESA_SHADER_READ_PATH - see <a href="shading.html#replacement">Experimenting with Shader Replacements</a></li>
156</ul>
157
158
159<h2>Mesa Xlib driver environment variables</h2>
160
161<p>
162The following are only applicable to the Mesa Xlib software driver.
163See the <a href="xlibdriver.html">Xlib software driver page</a> for details.
164</p>
165<ul>
166<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
167<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
168<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
169    either "pixmap" or "ximage"
170<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
171<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
172<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
173<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
174<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
175<li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
176</ul>
177
178
179<h2>i945/i965 driver environment variables (non-Gallium)</h2>
180
181<ul>
182<li>INTEL_NO_HW - if set to 1, prevents batches from being submitted to the hardware.
183   This is useful for debugging hangs, etc.</li>
184<li>INTEL_DEBUG - a comma-separated list of named flags, which do various things:
185<ul>
186   <li>ann - annotate IR in assembly dumps</li>
187   <li>aub - dump batches into an AUB trace for use with simulation tools</li>
188   <li>bat - emit batch information</li>
189   <li>blit - emit messages about blit operations</li>
190   <li>blorp - emit messages about the blorp operations (blits &amp; clears)</li>
191   <li>buf - emit messages about buffer objects</li>
192   <li>clip - emit messages about the clip unit (for old gens, includes the CLIP program)</li>
193   <li>color - use color in output</li>
194   <li>cs - dump shader assembly for compute shaders</li>
195   <li>do32 - generate compute shader SIMD32 programs even if workgroup size doesn't exceed the SIMD16 limit</li>
196   <li>dri - emit messages about the DRI interface</li>
197   <li>fbo - emit messages about framebuffers</li>
198   <li>fs - dump shader assembly for fragment shaders</li>
199   <li>gs - dump shader assembly for geometry shaders</li>
200   <li>hex - print instruction hex dump with the disassembly</li>
201   <li>l3 - emit messages about the new L3 state during transitions</li>
202   <li>miptree - emit messages about miptrees</li>
203   <li>no8 - don't generate SIMD8 fragment shader</li>
204   <li>no16 - suppress generation of 16-wide fragment shaders. useful for debugging broken shaders</li>
205   <li>nocompact - disable instruction compaction</li>
206   <li>nodualobj - suppress generation of dual-object geometry shader code</li>
207   <li>norbc - disable single sampled render buffer compression</li>
208   <li>optimizer - dump shader assembly to files at each optimization pass and iteration that make progress</li>
209   <li>perf - emit messages about performance issues</li>
210   <li>perfmon - emit messages about AMD_performance_monitor</li>
211   <li>pix - emit messages about pixel operations</li>
212   <li>prim - emit messages about drawing primitives</li>
213   <li>reemit - mark all state dirty on each draw call</li>
214   <li>sf - emit messages about the strips &amp; fans unit (for old gens, includes the SF program)</li>
215   <li>shader_time - record how much GPU time is spent in each shader</li>
216   <li>spill_fs - force spilling of all registers in the scalar backend (useful to debug spilling code)</li>
217   <li>spill_vec4 - force spilling of all registers in the vec4 backend (useful to debug spilling code)</li>
218   <li>state - emit messages about state flag tracking</li>
219   <li>submit - emit batchbuffer usage statistics</li>
220   <li>sync - after sending each batch, emit a message and wait for that batch to finish rendering</li>
221   <li>tcs - dump shader assembly for tessellation control shaders</li>
222   <li>tes - dump shader assembly for tessellation evaluation shaders</li>
223   <li>tex - emit messages about textures.</li>
224   <li>urb - emit messages about URB setup</li>
225   <li>vert - emit messages about vertex assembly</li>
226   <li>vs - dump shader assembly for vertex shaders</li>
227</ul>
228<li>INTEL_SCALAR_VS (or TCS, TES, GS) - force scalar/vec4 mode for a shader stage (Gen8-9 only)</li>
229<li>INTEL_PRECISE_TRIG - if set to 1, true or yes, then the driver prefers
230   accuracy over performance in trig functions.</li>
231</ul>
232
233
234<h2>Radeon driver environment variables (radeon, r200, and r300g)</h2>
235
236<ul>
237<li>RADEON_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
238</ul>
239
240
241<h2>EGL environment variables</h2>
242
243<p>
244Mesa EGL supports different sets of environment variables.  See the
245<a href="egl.html">Mesa EGL</a> page for the details.
246</p>
247
248
249<h2>Gallium environment variables</h2>
250
251<ul>
252<li>GALLIUM_HUD - draws various information on the screen, like framerate,
253    cpu load, driver statistics, performance counters, etc.
254    Set GALLIUM_HUD=help and run e.g. glxgears for more info.
255<li>GALLIUM_HUD_PERIOD - sets the hud update rate in seconds (float). Use zero
256    to update every frame. The default period is 1/2 second.
257<li>GALLIUM_HUD_VISIBLE - control default visibility, defaults to true.
258<li>GALLIUM_HUD_TOGGLE_SIGNAL - toggle visibility via user specified signal.
259    Especially useful to toggle hud at specific points of application and
260    disable for unencumbered viewing the rest of the time. For example, set
261    GALLIUM_HUD_VISIBLE to false and GALLIUM_HUD_TOGGLE_SIGNAL to 10 (SIGUSR1).
262    Use kill -10 <pid> to toggle the hud as desired.
263<li>GALLIUM_HUD_DUMP_DIR - specifies a directory for writing the displayed
264    hud values into files.
265<li>GALLIUM_DRIVER - useful in combination with LIBGL_ALWAYS_SOFTWARE=true for
266    choosing one of the software renderers "softpipe", "llvmpipe" or "swr".
267<li>GALLIUM_LOG_FILE - specifies a file for logging all errors, warnings, etc.
268    rather than stderr.
269<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
270    variables which are used, and their current values.
271<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
272<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
273    print any errors to stderr.
274<LI>DRAW_FSE - ???
275<LI>DRAW_NO_FSE - ???
276<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
277    shaders, vertex fetch, etc.
278<li>ST_DEBUG - controls debug output from the Mesa/Gallium state tracker.
279Setting to "tgsi", for example, will print all the TGSI shaders.
280See src/mesa/state_tracker/st_debug.c for other options.
281</ul>
282
283<h3>Clover state tracker environment variables</h3>
284
285<ul>
286<li>CLOVER_EXTRA_BUILD_OPTIONS - allows specifying additional compiler and linker
287    options. Specified options are appended after the options set by the OpenCL
288    program in clBuildProgram.
289<li>CLOVER_EXTRA_COMPILE_OPTIONS - allows specifying additional compiler
290    options. Specified options are appended after the options set by the OpenCL
291    program in clCompileProgram.
292<li>CLOVER_EXTRA_LINK_OPTIONS - allows specifying additional linker
293    options. Specified options are appended after the options set by the OpenCL
294    program in clLinkProgram.
295</ul>
296
297
298<h3>Softpipe driver environment variables</h3>
299<ul>
300<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
301    to stderr
302<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
303    to stderr
304<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd.  For profiling purposes.
305<li>SOFTPIPE_USE_LLVM - if set, the softpipe driver will try to use LLVM JIT for
306    vertex shading processing.
307</ul>
308
309
310<h3>LLVMpipe driver environment variables</h3>
311<ul>
312<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
313<li>LP_DEBUG - a comma-separated list of debug options is accepted.  See the
314    source code for details.
315<li>LP_PERF - a comma-separated list of options to selectively no-op various
316    parts of the driver.  See the source code for details.
317<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
318    Zero turns off threading completely.  The default value is the number of CPU
319    cores present.
320</ul>
321
322<h3>VMware SVGA driver environment variables</h3>
323<ul>
324<li>SVGA_FORCE_SWTNL - force use of software vertex transformation
325<li>SVGA_NO_SWTNL - don't allow software vertex transformation fallbacks
326(will often result in incorrect rendering).
327<li>SVGA_DEBUG - for dumping shaders, constant buffers, etc.  See the code
328for details.
329<li>SVGA_EXTRA_LOGGING - if set, enables extra logging to the vmware.log file,
330such as the OpenGL program's name and command line arguments.
331<li>See the driver code for other, lesser-used variables.
332</ul>
333
334
335<h3>VA-API state tracker environment variables</h3>
336<ul>
337<li>VAAPI_MPEG4_ENABLED - enable MPEG4 for VA-API, disabled by default.
338</ul>
339
340
341<h3>VC4 driver environment variables</h3>
342<ul>
343<li>VC4_DEBUG - a comma-separated list of named flags, which do various things:
344<ul>
345   <li>cl - dump command list during creation</li>
346   <li>qpu - dump generated QPU instructions</li>
347   <li>qir - dump QPU IR during program compile</li>
348   <li>nir - dump NIR during program compile</li>
349   <li>tgsi - dump TGSI during program compile</li>
350   <li>shaderdb - dump program compile information for shader-db analysis</li>
351   <li>perf - print during performance-related events</li>
352   <li>norast - skip actual hardware execution of commands</li>
353   <li>always_flush - flush after each draw call</li>
354   <li>always_sync - wait for finish after each flush</li>
355   <li>dump - write a GPU command stream trace file (VC4 simulator only)</li>
356</ul>
357</ul>
358
359
360<p>
361Other Gallium drivers have their own environment variables.  These may change
362frequently so the source code should be consulted for details.
363</p>
364
365</div>
366</body>
367</html>
368