envvars.html revision 848b8605
1848b8605Smrg<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
2848b8605Smrg<html lang="en">
3848b8605Smrg<head>
4848b8605Smrg  <meta http-equiv="content-type" content="text/html; charset=utf-8">
5848b8605Smrg  <title>Environment Variables</title>
6848b8605Smrg  <link rel="stylesheet" type="text/css" href="mesa.css">
7848b8605Smrg</head>
8848b8605Smrg<body>
9848b8605Smrg
10848b8605Smrg<div class="header">
11848b8605Smrg  <h1>The Mesa 3D Graphics Library</h1>
12848b8605Smrg</div>
13848b8605Smrg
14848b8605Smrg<iframe src="contents.html"></iframe>
15848b8605Smrg<div class="content">
16848b8605Smrg
17848b8605Smrg<h1>Environment Variables</h1>
18848b8605Smrg
19848b8605Smrg<p>
20848b8605SmrgNormally, no environment variables need to be set.  Most of the environment
21848b8605Smrgvariables used by Mesa/Gallium are for debugging purposes, but they can
22848b8605Smrgsometimes be useful for debugging end-user issues.
23848b8605Smrg</p>
24848b8605Smrg
25848b8605Smrg
26848b8605Smrg<h2>LibGL environment variables</h2>
27848b8605Smrg
28848b8605Smrg<ul>
29848b8605Smrg<li>LIBGL_DEBUG - If defined debug information will be printed to stderr.
30848b8605Smrg   If set to 'verbose' additional information will be printed.
31848b8605Smrg<li>LIBGL_DRIVERS_PATH - colon-separated list of paths to search for DRI drivers
32848b8605Smrg<li>LIBGL_ALWAYS_INDIRECT - forces an indirect rendering context/connection.
33848b8605Smrg<li>LIBGL_ALWAYS_SOFTWARE - if set, always use software rendering
34848b8605Smrg<li>LIBGL_NO_DRAWARRAYS - if set do not use DrawArrays GLX protocol (for debugging)
35848b8605Smrg<li>LIBGL_SHOW_FPS - print framerate to stdout based on the number of glXSwapBuffers
36848b8605Smrg    calls per second.
37848b8605Smrg</ul>
38848b8605Smrg
39848b8605Smrg
40848b8605Smrg
41848b8605Smrg<h2>Core Mesa environment variables</h2>
42848b8605Smrg
43848b8605Smrg<ul>
44848b8605Smrg<li>MESA_NO_ASM - if set, disables all assembly language optimizations
45848b8605Smrg<li>MESA_NO_MMX - if set, disables Intel MMX optimizations
46848b8605Smrg<li>MESA_NO_3DNOW - if set, disables AMD 3DNow! optimizations
47848b8605Smrg<li>MESA_NO_SSE - if set, disables Intel SSE optimizations
48848b8605Smrg<li>MESA_DEBUG - if set, error messages are printed to stderr.  For example,
49848b8605Smrg   if the application generates a GL_INVALID_ENUM error, a corresponding error
50848b8605Smrg   message indicating where the error occurred, and possibly why, will be
51848b8605Smrg   printed to stderr.<br>
52848b8605Smrg   If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will
53848b8605Smrg   generate exceptions.
54848b8605Smrg<li>MESA_LOG_FILE - specifies a file name for logging all errors, warnings,
55848b8605Smrgetc., rather than stderr
56848b8605Smrg<li>MESA_TEX_PROG - if set, implement conventional texture env modes with
57848b8605Smrgfragment programs (intended for developers only)
58848b8605Smrg<li>MESA_TNL_PROG - if set, implement conventional vertex transformation
59848b8605Smrgoperations with vertex programs (intended for developers only).
60848b8605SmrgSetting this variable automatically sets the MESA_TEX_PROG variable as well.
61848b8605Smrg<li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions.
62848b8605SmrgA value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension
63848b8605Smrgand disable the GL_EXT_bar extension.
64848b8605Smrg<li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted
65848b8605Smrgby extension year.
66848b8605SmrgIf this variable is set to year X, only extensions defined on or before year
67848b8605SmrgX will be reported.
68848b8605SmrgThis is to work-around a bug in some games where the extension string is
69848b8605Smrgcopied into a fixed-size buffer without truncating.
70848b8605SmrgIf the extension string is too long, the buffer overrun can cause the game
71848b8605Smrgto crash.
72848b8605SmrgThis is a work-around for that.
73848b8605Smrg<li>MESA_GL_VERSION_OVERRIDE - changes the value returned by
74848b8605SmrgglGetString(GL_VERSION) and possibly the GL API type.
75848b8605Smrg<ul>
76848b8605Smrg<li> The format should be MAJOR.MINOR[FC]
77848b8605Smrg<li> FC is an optional suffix that indicates a forward compatible context.
78848b8605SmrgThis is only valid for versions &gt;= 3.0.
79848b8605Smrg<li> GL versions &lt; 3.0 are set to a compatibility (non-Core) profile
80848b8605Smrg<li> GL versions = 3.0, see below
81848b8605Smrg<li> GL versions &gt; 3.0 are set to a Core profile
82848b8605Smrg<li> Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC
83848b8605Smrg<ul>
84848b8605Smrg<li> 2.1 - select a compatibility (non-Core) profile with GL version 2.1
85848b8605Smrg<li> 3.0 - select a compatibility (non-Core) profile with GL version 3.0
86848b8605Smrg<li> 3.0FC - select a Core+Forward Compatible profile with GL version 3.0
87848b8605Smrg<li> 3.1 - select a Core profile with GL version 3.1
88848b8605Smrg<li> 3.1FC - select a Core+Forward Compatible profile with GL version 3.1
89848b8605Smrg</ul>
90848b8605Smrg<li> Mesa may not really implement all the features of the given version.
91848b8605Smrg(for developers only)
92848b8605Smrg</ul>
93848b8605Smrg<li>MESA_GLSL_VERSION_OVERRIDE - changes the value returned by
94848b8605SmrgglGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as
95848b8605Smrg"130".  Mesa will not really implement all the features of the given language version
96848b8605Smrgif it's higher than what's normally reported. (for developers only)
97848b8605Smrg<li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a>
98848b8605Smrg</ul>
99848b8605Smrg
100848b8605Smrg
101848b8605Smrg<h2>Mesa Xlib driver environment variables</h2>
102848b8605Smrg
103848b8605Smrg<p>
104848b8605SmrgThe following are only applicable to the Mesa Xlib software driver.
105848b8605SmrgSee the <a href="xlibdriver.html">Xlib software driver page</a> for details.
106848b8605Smrg</p>
107848b8605Smrg<ul>
108848b8605Smrg<li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode
109848b8605Smrg<li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode
110848b8605Smrg<li>MESA_BACK_BUFFER - specifies how to implement the back color buffer,
111848b8605Smrg    either "pixmap" or "ximage"
112848b8605Smrg<li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels
113848b8605Smrg<li>MESA_XSYNC - enable synchronous X behavior (for debugging only)
114848b8605Smrg<li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals
115848b8605Smrg<li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel.
116848b8605Smrg<li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer.
117848b8605Smrg<li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel.
118848b8605Smrg</ul>
119848b8605Smrg
120848b8605Smrg
121848b8605Smrg<h2>i945/i965 driver environment variables (non-Gallium)</h2>
122848b8605Smrg
123848b8605Smrg<ul>
124848b8605Smrg<li>INTEL_NO_HW - if set to 1, prevents batches from being submitted to the hardware.
125848b8605Smrg   This is useful for debugging hangs, etc.</li>
126848b8605Smrg<li>INTEL_DEBUG - a comma-separated list of named flags, which do various things:
127848b8605Smrg<ul>
128848b8605Smrg   <li>tex - emit messages about textures.</li>
129848b8605Smrg   <li>state - emit messages about state flag tracking</li>
130848b8605Smrg   <li>blit - emit messages about blit operations</li>
131848b8605Smrg   <li>miptree - emit messages about miptrees</li>
132848b8605Smrg   <li>perf - emit messages about performance issues</li>
133848b8605Smrg   <li>perfmon - emit messages about AMD_performance_monitor</li>
134848b8605Smrg   <li>bat - emit batch information</li>
135848b8605Smrg   <li>pix - emit messages about pixel operations</li>
136848b8605Smrg   <li>buf - emit messages about buffer objects</li>
137848b8605Smrg   <li>reg - emit messages about regions</li>
138848b8605Smrg   <li>fbo - emit messages about framebuffers</li>
139848b8605Smrg   <li>fs - dump shader assembly for fragment shaders</li>
140848b8605Smrg   <li>gs - dump shader assembly for geometry shaders</li>
141848b8605Smrg   <li>sync - emit messages about synchronization</li>
142848b8605Smrg   <li>prim - emit messages about drawing primitives</li>
143848b8605Smrg   <li>vert - emit messages about vertex assembly</li>
144848b8605Smrg   <li>dri - emit messages about the DRI interface</li>
145848b8605Smrg   <li>sf - emit messages about the strips &amp; fans unit (for old gens, includes the SF program)</li>
146848b8605Smrg   <li>stats - enable statistics counters. you probably actually want perfmon or intel_gpu_top instead.</li>
147848b8605Smrg   <li>urb - emit messages about URB setup</li>
148848b8605Smrg   <li>vs - dump shader assembly for vertex shaders</li>
149848b8605Smrg   <li>clip - emit messages about the clip unit (for old gens, includes the CLIP program)</li>
150848b8605Smrg   <li>aub - dump batches into an AUB trace for use with simulation tools</li>
151848b8605Smrg   <li>shader_time - record how much GPU time is spent in each shader</li>
152848b8605Smrg   <li>no16 - suppress generation of 16-wide fragment shaders. useful for debugging broken shaders</li>
153848b8605Smrg   <li>blorp - emit messages about the blorp operations (blits &amp; clears)</li>
154848b8605Smrg   <li>nodualobj - suppress generation of dual-object geometry shader code</li>
155848b8605Smrg</ul>
156848b8605Smrg</ul>
157848b8605Smrg
158848b8605Smrg
159848b8605Smrg<h2>Radeon driver environment variables (radeon, r200, and r300g)</h2>
160848b8605Smrg
161848b8605Smrg<ul>
162848b8605Smrg<li>RADEON_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting.
163848b8605Smrg</ul>
164848b8605Smrg
165848b8605Smrg
166848b8605Smrg<h2>EGL environment variables</h2>
167848b8605Smrg
168848b8605Smrg<p>
169848b8605SmrgMesa EGL supports different sets of environment variables.  See the
170848b8605Smrg<a href="egl.html">Mesa EGL</a> page for the details.
171848b8605Smrg</p>
172848b8605Smrg
173848b8605Smrg
174848b8605Smrg<h2>Gallium environment variables</h2>
175848b8605Smrg
176848b8605Smrg<ul>
177848b8605Smrg<li>GALLIUM_HUD - draws various information on the screen, like framerate,
178848b8605Smrg    cpu load, driver statistics, performance counters, etc.
179848b8605Smrg    Set GALLIUM_HUD=help and run e.g. glxgears for more info.
180848b8605Smrg<li>GALLIUM_LOG_FILE - specifies a file for logging all errors, warnings, etc.
181848b8605Smrg    rather than stderr.
182848b8605Smrg<li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment
183848b8605Smrg    variables which are used, and their current values.
184848b8605Smrg<li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up
185848b8605Smrg<li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and
186848b8605Smrg    print any errors to stderr.
187848b8605Smrg<LI>DRAW_FSE - ???
188848b8605Smrg<LI>DRAW_NO_FSE - ???
189848b8605Smrg<li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute
190848b8605Smrg    shaders, vertex fetch, etc.
191848b8605Smrg<li>ST_DEBUG - controls debug output from the Mesa/Gallium state tracker.
192848b8605SmrgSetting to "tgsi", for example, will print all the TGSI shaders.
193848b8605SmrgSee src/mesa/state_tracker/st_debug.c for other options.
194848b8605Smrg</ul>
195848b8605Smrg
196848b8605Smrg<h3>Softpipe driver environment variables</h3>
197848b8605Smrg<ul>
198848b8605Smrg<li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders
199848b8605Smrg    to stderr
200848b8605Smrg<li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders
201848b8605Smrg    to stderr
202848b8605Smrg<li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd.  For profiling purposes.
203848b8605Smrg<li>SOFTPIPE_USE_LLVM - if set, the softpipe driver will try to use LLVM JIT for
204848b8605Smrg    vertex shading processing.
205848b8605Smrg</ul>
206848b8605Smrg
207848b8605Smrg
208848b8605Smrg<h3>LLVMpipe driver environment variables</h3>
209848b8605Smrg<ul>
210848b8605Smrg<li>LP_NO_RAST - if set LLVMpipe will no-op rasterization
211848b8605Smrg<li>LP_DEBUG - a comma-separated list of debug options is accepted.  See the
212848b8605Smrg    source code for details.
213848b8605Smrg<li>LP_PERF - a comma-separated list of options to selectively no-op various
214848b8605Smrg    parts of the driver.  See the source code for details.
215848b8605Smrg<li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering.
216848b8605Smrg    Zero turns of threading completely.  The default value is the number of CPU
217848b8605Smrg    cores present.
218848b8605Smrg</ul>
219848b8605Smrg
220848b8605Smrg<h3>VMware SVGA driver environment variables</h3>
221848b8605Smrg<ul>
222848b8605Smrg<li>SVGA_FORCE_SWTNL - force use of software vertex transformation
223848b8605Smrg<li>SVGA_NO_SWTNL - don't allow software vertex transformation fallbacks
224848b8605Smrg(will often result in incorrect rendering).
225848b8605Smrg<li>SVGA_DEBUG - for dumping shaders, constant buffers, etc.  See the code
226848b8605Smrgfor details.
227848b8605Smrg<li>See the driver code for other, lesser-used variables.
228848b8605Smrg</ul>
229848b8605Smrg
230848b8605Smrg
231848b8605Smrg<p>
232848b8605SmrgOther Gallium drivers have their own environment variables.  These may change
233848b8605Smrgfrequently so the source code should be consulted for details.
234848b8605Smrg</p>
235848b8605Smrg
236848b8605Smrg</div>
237848b8605Smrg</body>
238848b8605Smrg</html>
239