Andreas Boll | ecd5c7c | 2012-06-12 09:05:03 +0200 | [diff] [blame] | 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> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 9 | |
Andreas Boll | b5da52a | 2012-09-18 18:57:02 +0200 | [diff] [blame] | 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 | |
Andreas Boll | ecd5c7c | 2012-06-12 09:05:03 +0200 | [diff] [blame] | 17 | <h1>Environment Variables</h1> |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 18 | |
| 19 | <p> |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 20 | Normally, no environment variables need to be set. Most of the environment |
| 21 | variables used by Mesa/Gallium are for debugging purposes, but they can |
| 22 | sometimes be useful for debugging end-user issues. |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 23 | </p> |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 24 | |
| 25 | |
Andreas Boll | 210a27d | 2012-06-12 09:05:36 +0200 | [diff] [blame] | 26 | <h2>LibGL environment variables</h2> |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 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 - 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šák | dd6152b | 2013-03-26 03:19:10 +0100 | [diff] [blame] | 35 | <li>LIBGL_SHOW_FPS - print framerate to stdout based on the number of glXSwapBuffers |
| 36 | calls per second. |
Martin Peres | e4b2973 | 2015-05-07 16:57:48 +0300 | [diff] [blame^] | 37 | <li>LIBGL_DRI3_DISABLE - disable DRI3 if set (the value does not matter) |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 38 | </ul> |
| 39 | |
| 40 | |
| 41 | |
Andreas Boll | 210a27d | 2012-06-12 09:05:36 +0200 | [diff] [blame] | 42 | <h2>Core Mesa environment variables</h2> |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 43 | |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 44 | <ul> |
Brian Paul | b07d6a8 | 2004-02-02 22:35:55 +0000 | [diff] [blame] | 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 |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 49 | <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 Kidd | 0691b37 | 2014-01-03 16:44:00 -0700 | [diff] [blame] | 51 | message indicating where the error occurred, and possibly why, will be |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 52 | printed to stderr.<br> |
| 53 | If the value of MESA_DEBUG is 'FP' floating point arithmetic errors will |
| 54 | generate exceptions. |
Brian Paul | 9ccf5bf | 2012-06-25 11:43:03 -0600 | [diff] [blame] | 55 | <li>MESA_LOG_FILE - specifies a file name for logging all errors, warnings, |
| 56 | etc., rather than stderr |
Brian Paul | 4d3ab19 | 2006-06-01 20:22:30 +0000 | [diff] [blame] | 57 | <li>MESA_TEX_PROG - if set, implement conventional texture env modes with |
| 58 | fragment programs (intended for developers only) |
| 59 | <li>MESA_TNL_PROG - if set, implement conventional vertex transformation |
| 60 | operations with vertex programs (intended for developers only). |
| 61 | Setting this variable automatically sets the MESA_TEX_PROG variable as well. |
Brian Paul | cc26e27 | 2009-06-08 10:56:51 -0600 | [diff] [blame] | 62 | <li>MESA_EXTENSION_OVERRIDE - can be used to enable/disable extensions. |
| 63 | A value such as "GL_EXT_foo -GL_EXT_bar" will enable the GL_EXT_foo extension |
| 64 | and disable the GL_EXT_bar extension. |
Brian Paul | 82dd62f | 2011-03-24 11:39:21 -0600 | [diff] [blame] | 65 | <li>MESA_EXTENSION_MAX_YEAR - The GL_EXTENSIONS string returned by Mesa is sorted |
| 66 | by extension year. |
| 67 | If this variable is set to year X, only extensions defined on or before year |
| 68 | X will be reported. |
| 69 | This is to work-around a bug in some games where the extension string is |
| 70 | copied into a fixed-size buffer without truncating. |
| 71 | If the extension string is too long, the buffer overrun can cause the game |
| 72 | to crash. |
| 73 | This is a work-around for that. |
Chad Versace | 0527c11 | 2011-09-26 11:48:46 -0700 | [diff] [blame] | 74 | <li>MESA_GL_VERSION_OVERRIDE - changes the value returned by |
Jordan Justen | 00905db | 2012-09-01 01:38:08 -0700 | [diff] [blame] | 75 | glGetString(GL_VERSION) and possibly the GL API type. |
| 76 | <ul> |
| 77 | <li> The format should be MAJOR.MINOR[FC] |
| 78 | <li> FC is an optional suffix that indicates a forward compatible context. |
| 79 | This is only valid for versions >= 3.0. |
| 80 | <li> GL versions < 3.0 are set to a compatibility (non-Core) profile |
| 81 | <li> GL versions = 3.0, see below |
| 82 | <li> GL versions > 3.0 are set to a Core profile |
| 83 | <li> Examples: 2.1, 3.0, 3.0FC, 3.1, 3.1FC |
| 84 | <ul> |
| 85 | <li> 2.1 - select a compatibility (non-Core) profile with GL version 2.1 |
| 86 | <li> 3.0 - select a compatibility (non-Core) profile with GL version 3.0 |
| 87 | <li> 3.0FC - select a Core+Forward Compatible profile with GL version 3.0 |
| 88 | <li> 3.1 - select a Core profile with GL version 3.1 |
| 89 | <li> 3.1FC - select a Core+Forward Compatible profile with GL version 3.1 |
| 90 | </ul> |
| 91 | <li> Mesa may not really implement all the features of the given version. |
| 92 | (for developers only) |
| 93 | </ul> |
Chad Versace | a1eff55 | 2011-09-27 13:53:11 -0700 | [diff] [blame] | 94 | <li>MESA_GLSL_VERSION_OVERRIDE - changes the value returned by |
| 95 | glGetString(GL_SHADING_LANGUAGE_VERSION). Valid values are integers, such as |
| 96 | "130". Mesa will not really implement all the features of the given language version |
| 97 | if it's higher than what's normally reported. (for developers only) |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 98 | <li>MESA_GLSL - <a href="shading.html#envvars">shading language compiler options</a> |
Brian Paul | b07d6a8 | 2004-02-02 22:35:55 +0000 | [diff] [blame] | 99 | </ul> |
| 100 | |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 101 | |
Andreas Boll | 210a27d | 2012-06-12 09:05:36 +0200 | [diff] [blame] | 102 | <h2>Mesa Xlib driver environment variables</h2> |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 103 | |
Brian Paul | b07d6a8 | 2004-02-02 22:35:55 +0000 | [diff] [blame] | 104 | <p> |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 105 | The following are only applicable to the Mesa Xlib software driver. |
Andreas Boll | 210a27d | 2012-06-12 09:05:36 +0200 | [diff] [blame] | 106 | See the <a href="xlibdriver.html">Xlib software driver page</a> for details. |
Brian Paul | b07d6a8 | 2004-02-02 22:35:55 +0000 | [diff] [blame] | 107 | </p> |
| 108 | <ul> |
Brian Paul | 5e9d731 | 2006-01-27 20:12:06 +0000 | [diff] [blame] | 109 | <li>MESA_RGB_VISUAL - specifies the X visual and depth for RGB mode |
| 110 | <li>MESA_CI_VISUAL - specifies the X visual and depth for CI mode |
| 111 | <li>MESA_BACK_BUFFER - specifies how to implement the back color buffer, |
| 112 | either "pixmap" or "ximage" |
| 113 | <li>MESA_GAMMA - gamma correction coefficients for red, green, blue channels |
| 114 | <li>MESA_XSYNC - enable synchronous X behavior (for debugging only) |
| 115 | <li>MESA_GLX_FORCE_CI - if set, force GLX to treat 8bpp visuals as CI visuals |
Brian Paul | 4f6b1ad | 2004-07-23 15:49:12 +0000 | [diff] [blame] | 116 | <li>MESA_GLX_FORCE_ALPHA - if set, forces RGB windows to have an alpha channel. |
Brian Paul | dfa5c2b | 2004-07-23 23:32:15 +0000 | [diff] [blame] | 117 | <li>MESA_GLX_DEPTH_BITS - specifies default number of bits for depth buffer. |
Brian Paul | 8894a55 | 2005-11-05 03:12:06 +0000 | [diff] [blame] | 118 | <li>MESA_GLX_ALPHA_BITS - specifies default number of bits for alpha channel. |
Brian Paul | 0b27ace | 2003-03-08 17:38:57 +0000 | [diff] [blame] | 119 | </ul> |
| 120 | |
| 121 | |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 122 | <h2>i945/i965 driver environment variables (non-Gallium)</h2> |
| 123 | |
Brian Paul | 1d8b308 | 2010-01-26 09:12:32 -0700 | [diff] [blame] | 124 | <ul> |
Chris Forbes | 90d1855 | 2013-11-24 18:12:49 +1300 | [diff] [blame] | 125 | <li>INTEL_NO_HW - if set to 1, prevents batches from being submitted to the hardware. |
| 126 | This is useful for debugging hangs, etc.</li> |
| 127 | <li>INTEL_DEBUG - a comma-separated list of named flags, which do various things: |
| 128 | <ul> |
| 129 | <li>tex - emit messages about textures.</li> |
| 130 | <li>state - emit messages about state flag tracking</li> |
| 131 | <li>blit - emit messages about blit operations</li> |
| 132 | <li>miptree - emit messages about miptrees</li> |
| 133 | <li>perf - emit messages about performance issues</li> |
| 134 | <li>perfmon - emit messages about AMD_performance_monitor</li> |
| 135 | <li>bat - emit batch information</li> |
| 136 | <li>pix - emit messages about pixel operations</li> |
| 137 | <li>buf - emit messages about buffer objects</li> |
| 138 | <li>reg - emit messages about regions</li> |
| 139 | <li>fbo - emit messages about framebuffers</li> |
| 140 | <li>fs - dump shader assembly for fragment shaders</li> |
| 141 | <li>gs - dump shader assembly for geometry shaders</li> |
| 142 | <li>sync - emit messages about synchronization</li> |
| 143 | <li>prim - emit messages about drawing primitives</li> |
| 144 | <li>vert - emit messages about vertex assembly</li> |
| 145 | <li>dri - emit messages about the DRI interface</li> |
| 146 | <li>sf - emit messages about the strips & fans unit (for old gens, includes the SF program)</li> |
| 147 | <li>stats - enable statistics counters. you probably actually want perfmon or intel_gpu_top instead.</li> |
| 148 | <li>urb - emit messages about URB setup</li> |
| 149 | <li>vs - dump shader assembly for vertex shaders</li> |
| 150 | <li>clip - emit messages about the clip unit (for old gens, includes the CLIP program)</li> |
| 151 | <li>aub - dump batches into an AUB trace for use with simulation tools</li> |
| 152 | <li>shader_time - record how much GPU time is spent in each shader</li> |
| 153 | <li>no16 - suppress generation of 16-wide fragment shaders. useful for debugging broken shaders</li> |
| 154 | <li>blorp - emit messages about the blorp operations (blits & clears)</li> |
| 155 | <li>nodualobj - suppress generation of dual-object geometry shader code</li> |
| 156 | </ul> |
Brian Paul | 1d8b308 | 2010-01-26 09:12:32 -0700 | [diff] [blame] | 157 | </ul> |
| 158 | |
| 159 | |
Matt Turner | ef3cec5 | 2012-01-30 13:58:10 -0500 | [diff] [blame] | 160 | <h2>Radeon driver environment variables (radeon, r200, and r300g)</h2> |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 161 | |
Brian Paul | 1d8b308 | 2010-01-26 09:12:32 -0700 | [diff] [blame] | 162 | <ul> |
Matt Turner | ef3cec5 | 2012-01-30 13:58:10 -0500 | [diff] [blame] | 163 | <li>RADEON_NO_TCL - if set, disable hardware-accelerated Transform/Clip/Lighting. |
Brian Paul | 1d8b308 | 2010-01-26 09:12:32 -0700 | [diff] [blame] | 164 | </ul> |
| 165 | |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 166 | |
| 167 | <h2>EGL environment variables</h2> |
| 168 | |
Chia-I Wu | 7fc3581 | 2010-02-02 11:05:19 +0800 | [diff] [blame] | 169 | <p> |
| 170 | Mesa EGL supports different sets of environment variables. See the |
| 171 | <a href="egl.html">Mesa EGL</a> page for the details. |
| 172 | </p> |
Brian Paul | 1d8b308 | 2010-01-26 09:12:32 -0700 | [diff] [blame] | 173 | |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 174 | |
| 175 | <h2>Gallium environment variables</h2> |
| 176 | |
| 177 | <ul> |
Marek Olšák | dd6152b | 2013-03-26 03:19:10 +0100 | [diff] [blame] | 178 | <li>GALLIUM_HUD - draws various information on the screen, like framerate, |
| 179 | cpu load, driver statistics, performance counters, etc. |
| 180 | Set GALLIUM_HUD=help and run e.g. glxgears for more info. |
Brian Paul | 75e6202 | 2012-06-25 11:44:44 -0600 | [diff] [blame] | 181 | <li>GALLIUM_LOG_FILE - specifies a file for logging all errors, warnings, etc. |
| 182 | rather than stderr. |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 183 | <li>GALLIUM_PRINT_OPTIONS - if non-zero, print all the Gallium environment |
| 184 | variables which are used, and their current values. |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 185 | <li>GALLIUM_DUMP_CPU - if non-zero, print information about the CPU on start-up |
| 186 | <li>TGSI_PRINT_SANITY - if set, do extra sanity checking on TGSI shaders and |
| 187 | print any errors to stderr. |
| 188 | <LI>DRAW_FSE - ??? |
| 189 | <LI>DRAW_NO_FSE - ??? |
| 190 | <li>DRAW_USE_LLVM - if set to zero, the draw module will not use LLVM to execute |
| 191 | shaders, vertex fetch, etc. |
Brian Paul | 90fa71b | 2013-06-07 10:12:28 -0600 | [diff] [blame] | 192 | <li>ST_DEBUG - controls debug output from the Mesa/Gallium state tracker. |
| 193 | Setting to "tgsi", for example, will print all the TGSI shaders. |
| 194 | See src/mesa/state_tracker/st_debug.c for other options. |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 195 | </ul> |
| 196 | |
| 197 | <h3>Softpipe driver environment variables</h3> |
| 198 | <ul> |
| 199 | <li>SOFTPIPE_DUMP_FS - if set, the softpipe driver will print fragment shaders |
| 200 | to stderr |
| 201 | <li>SOFTPIPE_DUMP_GS - if set, the softpipe driver will print geometry shaders |
| 202 | to stderr |
| 203 | <li>SOFTPIPE_NO_RAST - if set, rasterization is no-op'd. For profiling purposes. |
Jakob Bornecrantz | 6afa7cd | 2012-01-09 21:37:50 +0100 | [diff] [blame] | 204 | <li>SOFTPIPE_USE_LLVM - if set, the softpipe driver will try to use LLVM JIT for |
Nathan Kidd | 0691b37 | 2014-01-03 16:44:00 -0700 | [diff] [blame] | 205 | vertex shading processing. |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 206 | </ul> |
| 207 | |
| 208 | |
| 209 | <h3>LLVMpipe driver environment variables</h3> |
| 210 | <ul> |
| 211 | <li>LP_NO_RAST - if set LLVMpipe will no-op rasterization |
Nathan Kidd | 0691b37 | 2014-01-03 16:44:00 -0700 | [diff] [blame] | 212 | <li>LP_DEBUG - a comma-separated list of debug options is accepted. See the |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 213 | source code for details. |
| 214 | <li>LP_PERF - a comma-separated list of options to selectively no-op various |
| 215 | parts of the driver. See the source code for details. |
| 216 | <li>LP_NUM_THREADS - an integer indicating how many threads to use for rendering. |
| 217 | Zero turns of threading completely. The default value is the number of CPU |
| 218 | cores present. |
| 219 | </ul> |
| 220 | |
Brian Paul | 90fa71b | 2013-06-07 10:12:28 -0600 | [diff] [blame] | 221 | <h3>VMware SVGA driver environment variables</h3> |
| 222 | <ul> |
| 223 | <li>SVGA_FORCE_SWTNL - force use of software vertex transformation |
| 224 | <li>SVGA_NO_SWTNL - don't allow software vertex transformation fallbacks |
| 225 | (will often result in incorrect rendering). |
| 226 | <li>SVGA_DEBUG - for dumping shaders, constant buffers, etc. See the code |
| 227 | for details. |
| 228 | <li>See the driver code for other, lesser-used variables. |
| 229 | </ul> |
| 230 | |
Brian Paul | 1bf9954 | 2011-02-17 07:29:20 -0700 | [diff] [blame] | 231 | |
| 232 | <p> |
| 233 | Other Gallium drivers have their own environment variables. These may change |
| 234 | frequently so the source code should be consulted for details. |
| 235 | </p> |
| 236 | |
Andreas Boll | b5da52a | 2012-09-18 18:57:02 +0200 | [diff] [blame] | 237 | </div> |
Andreas Boll | ecd5c7c | 2012-06-12 09:05:03 +0200 | [diff] [blame] | 238 | </body> |
| 239 | </html> |