blob: cf57ca59da54cf5ab6152a328ff712bc9dd7aeaf [file] [log] [blame]
Andreas Bollecd5c7c2012-06-12 09:05:03 +02001<!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>
Brian Paul0b27ace2003-03-08 17:38:57 +00009
Andreas Bollb5da52a2012-09-18 18:57:02 +020010<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
Andreas Bollecd5c7c2012-06-12 09:05:03 +020017<h1>Environment Variables</h1>
Brian Paul0b27ace2003-03-08 17:38:57 +000018
19<p>
Brian Paul1bf99542011-02-17 07:29:20 -070020Normally, 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.
Brian Paul0b27ace2003-03-08 17:38:57 +000023</p>
Brian Paul1bf99542011-02-17 07:29:20 -070024
25
Andreas Boll210a27d2012-06-12 09:05:36 +020026<h2>LibGL environment variables</h2>
Brian Paul1bf99542011-02-17 07:29:20 -070027
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 - forces an indirect rendering context/connection.
33<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
34<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
Marek Olšákdd6152b2013-03-26 03:19:10 +010035<li>LIBGL_SHOW_FPS - print framerate to stdout based on the number of glXSwapBuffers
36 calls per second.
Martin Perese4b29732015-05-07 16:57:48 +030037<li>LIBGL_DRI3_DISABLE - disable DRI3 if set (the value does not matter)
Brian Paul1bf99542011-02-17 07:29:20 -070038</ul>
39
40
41
Andreas Boll210a27d2012-06-12 09:05:36 +020042<h2>Core Mesa environment variables</h2>
Brian Paul1bf99542011-02-17 07:29:20 -070043
Brian Paul0b27ace2003-03-08 17:38:57 +000044<ul>
Brian Paulb07d6a82004-02-02 22:35:55 +000045<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
Brian Paul1bf99542011-02-17 07:29:20 -070049<li>MESA_DEBUG - if set, error messages are printed to stderr. For example,
50 if the application generates a GL_INVALID_ENUM error, a corresponding error
Nathan Kidd0691b372014-01-03 16:44:00 -070051 message indicating where the error occurred, and possibly why, will be
Brian Paul1bf99542011-02-17 07:29:20 -070052 printed to stderr.<br>
Alejandro Piñeiroa97ee602016-06-27 10:00:58 +020053
54 For release builds, MESA_DEBUG defaults to off (no debug output).
55
56 MESA_DEBUG accepts the following comma-separated list of named
57 flags, which adds extra behaviour to just set MESA_DEBUG=1:
58 <ul>
59 <li>silent - turn off debug messages. Only useful for debug builds.</li>
60 <li>flush - flush after each drawing command</li>
61 <li>incomplete_tex - extra debug messages when a texture is incomplete</li>
62 <li>incomplete_fbo - extra debug messages when a fbo is incomplete</li>
63 </ul>
Brian Paul9ccf5bf2012-06-25 11:43:03 -060064<li>MESA_LOG_FILE - specifies a file name for logging all errors, warnings,
65etc., rather than stderr
Brian Paul4d3ab192006-06-01 20:22:30 +000066<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
67fragment programs (intended for developers only)
68<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
69operations with vertex programs (intended for developers only).
70Setting this variable automatically sets the MESA_TEX_PROG variable as well.
Brian Paulcc26e272009-06-08 10:56:51 -060071<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
72A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
73and disable the GL_EXT_bar extension.
Brian Paul82dd62f2011-03-24 11:39:21 -060074<li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
75by extension year.
76If this variable is set to year X, only extensions defined on or before year
77X will be reported.
78This is to work-around a bug in some games where the extension string is
79copied into a fixed-size buffer without truncating.
80If the extension string is too long, the buffer overrun can cause the game
81to crash.
82This is a work-around for that.
Chad Versace0527c112011-09-26 11:48:46 -070083<li>MESA_GL_VERSION_OVERRIDE - changes the value returned by
Jordan Justen00905db2012-09-01 01:38:08 -070084glGetString(GL_VERSION) and possibly the GL API type.
85<ul>
86<li> The format should be MAJOR.MINOR[FC]
87<li> FC is an optional suffix that indicates a forward compatible context.
88This is only valid for versions &gt;= 3.0.
89<li> GL versions &lt; 3.0 are set to a compatibility (non-Core) profile
90<li> GL versions = 3.0, see below
91<li> GL versions &gt; 3.0 are set to a Core profile
92<li> Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
93<ul>
94<li> 2.1 - select a compatibility (non-Core) profile with GL version 2.1
95<li> 3.0 - select a compatibility (non-Core) profile with GL version 3.0
96<li> 3.0FC - select a Core+Forward Compatible profile with GL version 3.0
97<li> 3.1 - select a Core profile with GL version 3.1
98<li> 3.1FC - select a Core+Forward Compatible profile with GL version 3.1
99</ul>
100<li> Mesa may not really implement all the features of the given version.
101(for developers only)
102</ul>
Alejandro Piñeiroa1501012016-02-13 19:05:49 +0100103<li>MESA_GLES_VERSION_OVERRIDE - changes the value returned by
104glGetString(GL_VERSION) for OpenGL ES.
105<ul>
106<li> The format should be MAJOR.MINOR
107<li> Examples: 2.0, 3.0, 3.1
108<li> Mesa may not really implement all the features of the given version.
109(for developers only)
110</ul>
Chad Versacea1eff552011-09-27 13:53:11 -0700111<li>MESA_GLSL_VERSION_OVERRIDE - changes the value returned by
112glGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as
113"130". Mesa will not really implement all the features of the given language version
114if it's higher than what's normally reported. (for developers only)
Brian Paul1bf99542011-02-17 07:29:20 -0700115<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
Nicolai Hähnlebc8a6842016-01-11 15:56:22 -0500116<li>MESA_NO_MINMAX_CACHE - when set, the minmax index cache is globally disabled.
Brian Paulb07d6a82004-02-02 22:35:55 +0000117</ul>
118
Brian Paul1bf99542011-02-17 07:29:20 -0700119
Andreas Boll210a27d2012-06-12 09:05:36 +0200120<h2>Mesa Xlib driver environment variables</h2>
Brian Paul1bf99542011-02-17 07:29:20 -0700121
Brian Paulb07d6a82004-02-02 22:35:55 +0000122<p>
Brian Paul1bf99542011-02-17 07:29:20 -0700123The following are only applicable to the Mesa Xlib software driver.
Andreas Boll210a27d2012-06-12 09:05:36 +0200124See the <a href="xlibdriver.html">Xlib software driver page</a> for details.
Brian Paulb07d6a82004-02-02 22:35:55 +0000125</p>
126<ul>
Brian Paul5e9d7312006-01-27 20:12:06 +0000127<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
128<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
129<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
130 either "pixmap" or "ximage"
131<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
132<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
133<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
Brian Paul4f6b1ad2004-07-23 15:49:12 +0000134<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
Brian Pauldfa5c2b2004-07-23 23:32:15 +0000135<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
Brian Paul8894a552005-11-05 03:12:06 +0000136<li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
Brian Paul0b27ace2003-03-08 17:38:57 +0000137</ul>
138
139
Brian Paul1bf99542011-02-17 07:29:20 -0700140<h2>i945/i965 driver environment variables (non-Gallium)</h2>
141
Brian Paul1d8b3082010-01-26 09:12:32 -0700142<ul>
Chris Forbes90d18552013-11-24 18:12:49 +1300143<li>INTEL_NO_HW - if set to 1, prevents batches from being submitted to the hardware.
144 This is useful for debugging hangs, etc.</li>
145<li>INTEL_DEBUG - a comma-separated list of named flags, which do various things:
146<ul>
147 <li>tex - emit messages about textures.</li>
148 <li>state - emit messages about state flag tracking</li>
149 <li>blit - emit messages about blit operations</li>
150 <li>miptree - emit messages about miptrees</li>
151 <li>perf - emit messages about performance issues</li>
152 <li>perfmon - emit messages about AMD_performance_monitor</li>
153 <li>bat - emit batch information</li>
154 <li>pix - emit messages about pixel operations</li>
155 <li>buf - emit messages about buffer objects</li>
Chris Forbes90d18552013-11-24 18:12:49 +1300156 <li>fbo - emit messages about framebuffers</li>
157 <li>fs - dump shader assembly for fragment shaders</li>
158 <li>gs - dump shader assembly for geometry shaders</li>
Grazvydas Ignotas23432352016-06-28 01:33:21 +0300159 <li>sync - after sending each batch, emit a message and wait for that batch to finish rendering</li>
Chris Forbes90d18552013-11-24 18:12:49 +1300160 <li>prim - emit messages about drawing primitives</li>
161 <li>vert - emit messages about vertex assembly</li>
162 <li>dri - emit messages about the DRI interface</li>
163 <li>sf - emit messages about the strips &amp; fans unit (for old gens, includes the SF program)</li>
164 <li>stats - enable statistics counters. you probably actually want perfmon or intel_gpu_top instead.</li>
165 <li>urb - emit messages about URB setup</li>
166 <li>vs - dump shader assembly for vertex shaders</li>
167 <li>clip - emit messages about the clip unit (for old gens, includes the CLIP program)</li>
168 <li>aub - dump batches into an AUB trace for use with simulation tools</li>
169 <li>shader_time - record how much GPU time is spent in each shader</li>
170 <li>no16 - suppress generation of 16-wide fragment shaders. useful for debugging broken shaders</li>
171 <li>blorp - emit messages about the blorp operations (blits &amp; clears)</li>
172 <li>nodualobj - suppress generation of dual-object geometry shader code</li>
Alejandro Piñeiroa26e82b2015-09-14 20:16:25 +0200173 <li>optimizer - dump shader assembly to files at each optimization pass and iteration that make progress</li>
Grazvydas Ignotas23432352016-06-28 01:33:21 +0300174 <li>ann - annotate IR in assembly dumps</li>
175 <li>no8 - don't generate SIMD8 fragment shader</li>
Juan A. Suarez Romero7a712e62016-03-18 17:29:55 +0100176 <li>vec4 - force vec4 mode in vertex shader</li>
Iago Toral Quiroga8f456912016-03-18 08:39:23 +0100177 <li>spill_fs - force spilling of all registers in the scalar backend (useful to debug spilling code)</li>
178 <li>spill_vec4 - force spilling of all registers in the vec4 backend (useful to debug spilling code)</li>
Grazvydas Ignotas23432352016-06-28 01:33:21 +0300179 <li>cs - dump shader assembly for compute shaders</li>
180 <li>hex - print instruction hex dump with the disassembly</li>
181 <li>nocompact - disable instruction compaction</li>
182 <li>tcs - dump shader assembly for tessellation control shaders</li>
183 <li>tes - dump shader assembly for tessellation evaluation shaders</li>
184 <li>l3 - emit messages about the new L3 state during transitions</li>
185 <li>do32 - generate compute shader SIMD32 programs even if workgroup size doesn't exceed the SIMD16 limit</li>
Topi Pohjolainen6ca118d2016-05-31 16:47:50 +0300186 <li>norbc - disable single sampled render buffer compression</li>
Chris Forbes90d18552013-11-24 18:12:49 +1300187</ul>
Brian Paul1d8b3082010-01-26 09:12:32 -0700188</ul>
189
190
Matt Turneref3cec52012-01-30 13:58:10 -0500191<h2>Radeon driver environment variables (radeon, r200, and r300g)</h2>
Brian Paul1bf99542011-02-17 07:29:20 -0700192
Brian Paul1d8b3082010-01-26 09:12:32 -0700193<ul>
Matt Turneref3cec52012-01-30 13:58:10 -0500194<li>RADEON_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
Brian Paul1d8b3082010-01-26 09:12:32 -0700195</ul>
196
Brian Paul1bf99542011-02-17 07:29:20 -0700197
198<h2>EGL environment variables</h2>
199
Chia-I Wu7fc35812010-02-02 11:05:19 +0800200<p>
201Mesa EGL supports different sets of environment variables. See the
202<a href="egl.html">Mesa EGL</a> page for the details.
203</p>
Brian Paul1d8b3082010-01-26 09:12:32 -0700204
Brian Paul1bf99542011-02-17 07:29:20 -0700205
206<h2>Gallium environment variables</h2>
207
208<ul>
Marek Olšákdd6152b2013-03-26 03:19:10 +0100209<li>GALLIUM_HUD - draws various information on the screen, like framerate,
210 cpu load, driver statistics, performance counters, etc.
211 Set GALLIUM_HUD=help and run e.g. glxgears for more info.
Jimmy Berry09d61072015-11-03 23:24:47 -0600212<li>GALLIUM_HUD_PERIOD - sets the hud update rate in seconds (float). Use zero
213 to update every frame. The default period is 1/2 second.
Jimmy Berry56a1c102015-11-09 23:20:37 -0600214<li>GALLIUM_HUD_VISIBLE - control default visibility, defaults to true.
215<li>GALLIUM_HUD_TOGGLE_SIGNAL - toggle visibility via user specified signal.
216 Especially useful to toggle hud at specific points of application and
217 disable for unencumbered viewing the rest of the time. For example, set
Christoph Haag7b414bc2016-09-07 01:13:39 +0200218 GALLIUM_HUD_VISIBLE to false and GALLIUM_HUD_TOGGLE_SIGNAL to 10 (SIGUSR1).
Jimmy Berry56a1c102015-11-09 23:20:37 -0600219 Use kill -10 <pid> to toggle the hud as desired.
Christoph Haag55ba5fa2016-09-08 21:32:04 +0200220<li>GALLIUM_DRIVER - useful in combination with LIBGL_ALWAYS_SOFTWARE=1 for
221 choosing one of the software renderers "softpipe", "llvmpipe" or "swr".
Brian Paul75e62022012-06-25 11:44:44 -0600222<li>GALLIUM_LOG_FILE - specifies a file for logging all errors, warnings, etc.
223 rather than stderr.
Brian Paul1bf99542011-02-17 07:29:20 -0700224<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
225 variables which are used, and their current values.
Brian Paul1bf99542011-02-17 07:29:20 -0700226<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
227<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
228 print any errors to stderr.
229<LI>DRAW_FSE - ???
230<LI>DRAW_NO_FSE - ???
231<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
232 shaders, vertex fetch, etc.
Brian Paul90fa71b2013-06-07 10:12:28 -0600233<li>ST_DEBUG - controls debug output from the Mesa/Gallium state tracker.
234Setting to "tgsi", for example, will print all the TGSI shaders.
235See src/mesa/state_tracker/st_debug.c for other options.
Brian Paul1bf99542011-02-17 07:29:20 -0700236</ul>
237
238<h3>Softpipe driver environment variables</h3>
239<ul>
240<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
241 to stderr
242<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
243 to stderr
244<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes.
Jakob Bornecrantz6afa7cd2012-01-09 21:37:50 +0100245<li>SOFTPIPE_USE_LLVM - if set, the softpipe driver will try to use LLVM JIT for
Nathan Kidd0691b372014-01-03 16:44:00 -0700246 vertex shading processing.
Brian Paul1bf99542011-02-17 07:29:20 -0700247</ul>
248
249
250<h3>LLVMpipe driver environment variables</h3>
251<ul>
252<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
Nathan Kidd0691b372014-01-03 16:44:00 -0700253<li>LP_DEBUG - a comma-separated list of debug options is accepted. See the
Brian Paul1bf99542011-02-17 07:29:20 -0700254 source code for details.
255<li>LP_PERF - a comma-separated list of options to selectively no-op various
256 parts of the driver. See the source code for details.
257<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
Rhys Kidda0f55e92016-02-20 16:15:35 +0100258 Zero turns off threading completely. The default value is the number of CPU
Brian Paul1bf99542011-02-17 07:29:20 -0700259 cores present.
260</ul>
261
Brian Paul90fa71b2013-06-07 10:12:28 -0600262<h3>VMware SVGA driver environment variables</h3>
263<ul>
264<li>SVGA_FORCE_SWTNL - force use of software vertex transformation
265<li>SVGA_NO_SWTNL - don't allow software vertex transformation fallbacks
266(will often result in incorrect rendering).
267<li>SVGA_DEBUG - for dumping shaders, constant buffers, etc. See the code
268for details.
269<li>See the driver code for other, lesser-used variables.
270</ul>
271
Brian Paul1bf99542011-02-17 07:29:20 -0700272
Christian Königa2c52002015-11-23 15:21:19 +0100273<h3>VA-API state tracker environment variables</h3>
274<ul>
275<li>VAAPI_MPEG4_ENABLED - enable MPEG4 for VA-API, disabled by default.
276</ul>
277
278
Rhys Kidd76e2af32016-02-13 16:03:02 -0500279<h3>VC4 driver environment variables</h3>
280<ul>
281<li>VC4_DEBUG - a comma-separated list of named flags, which do various things:
282<ul>
283 <li>cl - dump command list during creation</li>
284 <li>qpu - dump generated QPU instructions</li>
285 <li>qir - dump QPU IR during program compile</li>
286 <li>nir - dump NIR during program compile</li>
287 <li>tgsi - dump TGSI during program compile</li>
288 <li>shaderdb - dump program compile information for shader-db analysis</li>
289 <li>perf - print during performance-related events</li>
290 <li>norast - skip actual hardware execution of commands</li>
291 <li>always_flush - flush after each draw call</li>
292 <li>always_sync - wait for finish after each flush</li>
293 <li>dump - write a GPU command stream trace file (VC4 simulator only)</li>
294</ul>
295</ul>
296
297
Brian Paul1bf99542011-02-17 07:29:20 -0700298<p>
299Other Gallium drivers have their own environment variables. These may change
300frequently so the source code should be consulted for details.
301</p>
302
Andreas Bollb5da52a2012-09-18 18:57:02 +0200303</div>
Andreas Bollecd5c7c2012-06-12 09:05:03 +0200304</body>
305</html>