blob: e47befa388decbc2191f86e10ead32fc4e6f020f [file] [log] [blame]
Erik Faye-Lund4d066832020-06-12 20:09:42 +02001Environment Variables
2=====================
3
4Normally, no environment variables need to be set. Most of the
5environment variables used by Mesa/Gallium are for debugging purposes,
6but they can sometimes be useful for debugging end-user issues.
7
8LibGL environment variables
9---------------------------
10
11``LIBGL_DEBUG``
12 If defined debug information will be printed to stderr. If set to
13 ``verbose`` additional information will be printed.
14``LIBGL_DRIVERS_PATH``
15 colon-separated list of paths to search for DRI drivers
16``LIBGL_ALWAYS_INDIRECT``
17 if set to ``true``, forces an indirect rendering context/connection.
18``LIBGL_ALWAYS_SOFTWARE``
19 if set to ``true``, always use software rendering
20``LIBGL_NO_DRAWARRAYS``
21 if set to ``true``, do not use DrawArrays GLX protocol (for
22 debugging)
23``LIBGL_SHOW_FPS``
24 print framerate to stdout based on the number of ``glXSwapBuffers``
25 calls per second.
Adam Jacksona59b1b182020-11-19 09:54:18 -050026``LIBGL_DRI2_DISABLE``
27 disable DRI2 if set to ``true``.
Erik Faye-Lund4d066832020-06-12 20:09:42 +020028``LIBGL_DRI3_DISABLE``
29 disable DRI3 if set to ``true``.
30
31Core Mesa environment variables
32-------------------------------
33
34``MESA_NO_ASM``
35 if set, disables all assembly language optimizations
36``MESA_NO_MMX``
37 if set, disables Intel MMX optimizations
38``MESA_NO_3DNOW``
39 if set, disables AMD 3DNow! optimizations
40``MESA_NO_SSE``
41 if set, disables Intel SSE optimizations
42``MESA_NO_ERROR``
43 if set to 1, error checking is disabled as per ``KHR_no_error``. This
Erik Faye-Lundf4083432020-09-30 10:33:25 +020044 will result in undefined behavior for invalid use of the API, but
Erik Faye-Lund4d066832020-06-12 20:09:42 +020045 can reduce CPU use for apps that are known to be error free.
46``MESA_DEBUG``
47 if set, error messages are printed to stderr. For example, if the
48 application generates a ``GL_INVALID_ENUM`` error, a corresponding
49 error message indicating where the error occurred, and possibly why,
50 will be printed to stderr. For release builds, ``MESA_DEBUG``
51 defaults to off (no debug output). ``MESA_DEBUG`` accepts the
52 following comma-separated list of named flags, which adds extra
Erik Faye-Lund98909272020-09-25 14:54:56 +020053 behavior to just set ``MESA_DEBUG=1``:
Erik Faye-Lund4d066832020-06-12 20:09:42 +020054
55 ``silent``
56 turn off debug messages. Only useful for debug builds.
57 ``flush``
58 flush after each drawing command
59 ``incomplete_tex``
60 extra debug messages when a texture is incomplete
61 ``incomplete_fbo``
Erik Faye-Lund4aded092020-09-30 15:03:03 +020062 extra debug messages when a FBO is incomplete
Erik Faye-Lund4d066832020-06-12 20:09:42 +020063 ``context``
64 create a debug context (see ``GLX_CONTEXT_DEBUG_BIT_ARB``) and
65 print error and performance messages to stderr (or
66 ``MESA_LOG_FILE``).
67
68``MESA_LOG_FILE``
69 specifies a file name for logging all errors, warnings, etc., rather
70 than stderr
71``MESA_TEX_PROG``
72 if set, implement conventional texture env modes with fragment
73 programs (intended for developers only)
74``MESA_TNL_PROG``
75 if set, implement conventional vertex transformation operations with
76 vertex programs (intended for developers only). Setting this variable
77 automatically sets the ``MESA_TEX_PROG`` variable as well.
78``MESA_EXTENSION_OVERRIDE``
79 can be used to enable/disable extensions. A value such as
80 ``GL_EXT_foo -GL_EXT_bar`` will enable the ``GL_EXT_foo`` extension
81 and disable the ``GL_EXT_bar`` extension.
82``MESA_EXTENSION_MAX_YEAR``
83 The ``GL_EXTENSIONS`` string returned by Mesa is sorted by extension
84 year. If this variable is set to year X, only extensions defined on
85 or before year X will be reported. This is to work-around a bug in
86 some games where the extension string is copied into a fixed-size
87 buffer without truncating. If the extension string is too long, the
88 buffer overrun can cause the game to crash. This is a work-around for
89 that.
90``MESA_GL_VERSION_OVERRIDE``
91 changes the value returned by ``glGetString(GL_VERSION)`` and
92 possibly the GL API type.
93
94 - The format should be ``MAJOR.MINOR[FC|COMPAT]``
95 - ``FC`` is an optional suffix that indicates a forward compatible
96 context. This is only valid for versions >= 3.0.
97 - ``COMPAT`` is an optional suffix that indicates a compatibility
98 context or ``GL_ARB_compatibility`` support. This is only valid
99 for versions >= 3.1.
100 - GL versions <= 3.0 are set to a compatibility (non-Core) profile
101 - GL versions = 3.1, depending on the driver, it may or may not have
102 the ``ARB_compatibility`` extension enabled.
103 - GL versions >= 3.2 are set to a Core profile
104 - Examples:
105
106 ``2.1``
107 select a compatibility (non-Core) profile with GL version 2.1.
108 ``3.0``
109 select a compatibility (non-Core) profile with GL version 3.0.
110 ``3.0FC``
111 select a Core+Forward Compatible profile with GL version 3.0.
112 ``3.1``
113 select GL version 3.1 with ``GL_ARB_compatibility`` enabled per
114 the driver default.
115 ``3.1FC``
116 select GL version 3.1 with forward compatibility and
117 ``GL_ARB_compatibility`` disabled.
118 ``3.1COMPAT``
119 select GL version 3.1 with ``GL_ARB_compatibility`` enabled.
120 ``X.Y``
121 override GL version to X.Y without changing the profile.
122 ``X.YFC``
123 select a Core+Forward Compatible profile with GL version X.Y.
124 ``X.YCOMPAT``
125 select a Compatibility profile with GL version X.Y.
126
127 - Mesa may not really implement all the features of the given
128 version. (for developers only)
129
130``MESA_GLES_VERSION_OVERRIDE``
131 changes the value returned by ``glGetString(GL_VERSION)`` for OpenGL
132 ES.
133
134 - The format should be ``MAJOR.MINOR``
135 - Examples: ``2.0``, ``3.0``, ``3.1``
136 - Mesa may not really implement all the features of the given
137 version. (for developers only)
138
139``MESA_GLSL_VERSION_OVERRIDE``
140 changes the value returned by
141 ``glGetString(GL_SHADING_LANGUAGE_VERSION)``. Valid values are
142 integers, such as ``130``. Mesa will not really implement all the
143 features of the given language version if it's higher than what's
144 normally reported. (for developers only)
145``MESA_GLSL_CACHE_DISABLE``
John Bates5de56932020-09-30 18:35:02 -0700146 if set to ``true``, disables the GLSL shader cache. If set to
147 ``false``, enables the GLSL shader cache when it is disabled by
148 default.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200149``MESA_GLSL_CACHE_MAX_SIZE``
150 if set, determines the maximum size of the on-disk cache of compiled
151 GLSL programs. Should be set to a number optionally followed by
152 ``K``, ``M``, or ``G`` to specify a size in kilobytes, megabytes, or
153 gigabytes. By default, gigabytes will be assumed. And if unset, a
Erik Faye-Lundbf3f0f72019-06-04 10:39:58 +0200154 maximum size of 1GB will be used.
155
156 .. note::
157
158 A separate cache might be created for each architecture that Mesa is
159 installed for on your system. For example under the default settings
160 you may end up with a 1GB cache for x86_64 and another 1GB cache for
161 i386.
162
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200163``MESA_GLSL_CACHE_DIR``
164 if set, determines the directory to be used for the on-disk cache of
165 compiled GLSL programs. If this variable is not set, then the cache
166 will be stored in ``$XDG_CACHE_HOME/mesa_shader_cache`` (if that
167 variable is set), or else within ``.cache/mesa_shader_cache`` within
168 the user's home directory.
169``MESA_GLSL``
Erik Faye-Lund9be0e2d2020-06-15 12:31:36 +0200170 :ref:`shading language compiler options <envvars>`
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200171``MESA_NO_MINMAX_CACHE``
172 when set, the minmax index cache is globally disabled.
173``MESA_SHADER_CAPTURE_PATH``
Erik Faye-Lund9be0e2d2020-06-15 12:31:36 +0200174 see :ref:`Capturing Shaders <capture>`
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200175``MESA_SHADER_DUMP_PATH`` and ``MESA_SHADER_READ_PATH``
Erik Faye-Lund9be0e2d2020-06-15 12:31:36 +0200176 see :ref:`Experimenting with Shader
177 Replacements <replacement>`
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200178``MESA_VK_VERSION_OVERRIDE``
179 changes the Vulkan physical device version as returned in
180 ``VkPhysicalDeviceProperties::apiVersion``.
181
182 - The format should be ``MAJOR.MINOR[.PATCH]``
183 - This will not let you force a version higher than the driver's
184 instance version as advertised by ``vkEnumerateInstanceVersion``
185 - This can be very useful for debugging but some features may not be
186 implemented correctly. (For developers only)
Jan Ziakf5901482020-09-29 14:38:03 +0000187``MESA_LOADER_DRIVER_OVERRIDE``
188 chooses a different driver binary such as ``etnaviv`` or ``zink``.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200189
Eric Engestrom9497a1f2020-07-09 00:52:27 +0200190NIR passes environment variables
191--------------------------------
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200192
193The following are only applicable for drivers that uses NIR, as they
Erik Faye-Lund98909272020-09-25 14:54:56 +0200194modify the behavior for the common NIR_PASS and NIR_PASS_V macros, that
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200195wrap calls to NIR lowering/optimizations.
196
197``NIR_PRINT``
198 If defined, the resulting NIR shader will be printed out at each
Eric Engestrom9497a1f2020-07-09 00:52:27 +0200199 successful NIR lowering/optimization call.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200200``NIR_TEST_CLONE``
Eric Engestrom9497a1f2020-07-09 00:52:27 +0200201 If defined, cloning a NIR shader would be tested at each successful
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200202 NIR lowering/optimization call.
203``NIR_TEST_SERIALIZE``
204 If defined, serialize and deserialize a NIR shader would be tested at
Eric Engestrom9497a1f2020-07-09 00:52:27 +0200205 each successful NIR lowering/optimization call.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200206
207Mesa Xlib driver environment variables
208--------------------------------------
209
210The following are only applicable to the Mesa Xlib software driver. See
Erik Faye-Lund9be0e2d2020-06-15 12:31:36 +0200211the :doc:`Xlib software driver page <xlibdriver>` for details.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200212
213``MESA_RGB_VISUAL``
214 specifies the X visual and depth for RGB mode
215``MESA_CI_VISUAL``
216 specifies the X visual and depth for CI mode
217``MESA_BACK_BUFFER``
218 specifies how to implement the back color buffer, either ``pixmap``
219 or ``ximage``
220``MESA_GAMMA``
221 gamma correction coefficients for red, green, blue channels
222``MESA_XSYNC``
223 enable synchronous X behavior (for debugging only)
224``MESA_GLX_FORCE_CI``
Erik Faye-Lunda1904c92020-09-28 14:57:37 +0200225 if set, force GLX to treat 8 BPP visuals as CI visuals
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200226``MESA_GLX_FORCE_ALPHA``
227 if set, forces RGB windows to have an alpha channel.
228``MESA_GLX_DEPTH_BITS``
229 specifies default number of bits for depth buffer.
230``MESA_GLX_ALPHA_BITS``
231 specifies default number of bits for alpha channel.
232
233i945/i965 driver environment variables (non-Gallium)
234----------------------------------------------------
235
236``INTEL_NO_HW``
237 if set to 1, prevents batches from being submitted to the hardware.
238 This is useful for debugging hangs, etc.
239``INTEL_DEBUG``
240 a comma-separated list of named flags, which do various things:
241
242 ``ann``
243 annotate IR in assembly dumps
244 ``aub``
245 dump batches into an AUB trace for use with simulation tools
246 ``bat``
247 emit batch information
248 ``blit``
249 emit messages about blit operations
250 ``blorp``
251 emit messages about the blorp operations (blits & clears)
252 ``buf``
253 emit messages about buffer objects
254 ``clip``
255 emit messages about the clip unit (for old gens, includes the CLIP
256 program)
257 ``color``
258 use color in output
259 ``cs``
260 dump shader assembly for compute shaders
261 ``do32``
262 generate compute shader SIMD32 programs even if workgroup size
263 doesn't exceed the SIMD16 limit
264 ``dri``
265 emit messages about the DRI interface
266 ``fbo``
267 emit messages about framebuffers
268 ``fs``
269 dump shader assembly for fragment shaders
270 ``gs``
271 dump shader assembly for geometry shaders
272 ``hex``
273 print instruction hex dump with the disassembly
274 ``l3``
275 emit messages about the new L3 state during transitions
276 ``miptree``
277 emit messages about miptrees
278 ``no8``
279 don't generate SIMD8 fragment shader
280 ``no16``
281 suppress generation of 16-wide fragment shaders. useful for
282 debugging broken shaders
283 ``nocompact``
284 disable instruction compaction
285 ``nodualobj``
286 suppress generation of dual-object geometry shader code
287 ``nofc``
288 disable fast clears
289 ``norbc``
290 disable single sampled render buffer compression
291 ``optimizer``
292 dump shader assembly to files at each optimization pass and
293 iteration that make progress
294 ``perf``
295 emit messages about performance issues
296 ``perfmon``
297 emit messages about ``AMD_performance_monitor``
298 ``pix``
299 emit messages about pixel operations
300 ``prim``
301 emit messages about drawing primitives
302 ``reemit``
303 mark all state dirty on each draw call
304 ``sf``
305 emit messages about the strips & fans unit (for old gens, includes
306 the SF program)
307 ``shader_time``
308 record how much GPU time is spent in each shader
309 ``spill_fs``
310 force spilling of all registers in the scalar backend (useful to
311 debug spilling code)
312 ``spill_vec4``
313 force spilling of all registers in the vec4 backend (useful to
314 debug spilling code)
315 ``state``
316 emit messages about state flag tracking
317 ``submit``
318 emit batchbuffer usage statistics
319 ``sync``
320 after sending each batch, emit a message and wait for that batch
321 to finish rendering
322 ``tcs``
323 dump shader assembly for tessellation control shaders
324 ``tes``
325 dump shader assembly for tessellation evaluation shaders
326 ``tex``
327 emit messages about textures.
328 ``urb``
329 emit messages about URB setup
330 ``vert``
331 emit messages about vertex assembly
332 ``vs``
333 dump shader assembly for vertex shaders
334
335``INTEL_SCALAR_VS`` (or ``TCS``, ``TES``, ``GS``)
336 force scalar/vec4 mode for a shader stage (Gen8-9 only)
337``INTEL_PRECISE_TRIG``
338 if set to 1, true or yes, then the driver prefers accuracy over
339 performance in trig functions.
Danylo Piliaiev2c084042020-09-28 19:29:42 +0300340``INTEL_SHADER_ASM_READ_PATH``
341 if set, determines the directory to be used for overriding shader
342 assembly. The binaries with custom assembly should be placed in
343 this folder and have a name formatted as ``sha1_of_assembly.bin``.
344 The sha1 of a shader assembly is printed when assembly is dumped via
345 corresponding ``INTEL_DEBUG`` flag (e.g. ``vs`` for vertex shader).
346 A binary could be generated from a dumped assembly by ``i965_asm``.
347 For ``INTEL_SHADER_ASM_READ_PATH`` to work it is necessary to enable
348 dumping of corresponding shader stages via ``INTEL_DEBUG``.
349 It is advised to use ``nocompact`` flag of ``INTEL_DEBUG`` when
350 dumping and overriding shader assemblies.
351 The success of assembly override would be signified by "Successfully
352 overrode shader with sha1 <sha1>" in stderr replacing the original
353 assembly.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200354
355Radeon driver environment variables (radeon, r200, and r300g)
356-------------------------------------------------------------
357
358``RADEON_NO_TCL``
359 if set, disable hardware-accelerated Transform/Clip/Lighting.
360
361EGL environment variables
362-------------------------
363
Erik Faye-Lund9be0e2d2020-06-15 12:31:36 +0200364Mesa EGL supports different sets of environment variables. See the
365:doc:`Mesa EGL <egl>` page for the details.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200366
367Gallium environment variables
368-----------------------------
369
370``GALLIUM_HUD``
Erik Faye-Lundae7975e2020-09-29 19:15:32 +0200371 draws various information on the screen, like framerate, CPU load,
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200372 driver statistics, performance counters, etc. Set
373 ``GALLIUM_HUD=help`` and run e.g. ``glxgears`` for more info.
374``GALLIUM_HUD_PERIOD``
Erik Faye-Lunde8d03132020-09-30 10:36:29 +0200375 sets the HUD update rate in seconds (float). Use zero to update every
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200376 frame. The default period is 1/2 second.
377``GALLIUM_HUD_VISIBLE``
378 control default visibility, defaults to true.
379``GALLIUM_HUD_TOGGLE_SIGNAL``
380 toggle visibility via user specified signal. Especially useful to
Erik Faye-Lunde8d03132020-09-30 10:36:29 +0200381 toggle HUD at specific points of application and disable for
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200382 unencumbered viewing the rest of the time. For example, set
383 ``GALLIUM_HUD_VISIBLE`` to ``false`` and
384 ``GALLIUM_HUD_TOGGLE_SIGNAL`` to ``10`` (``SIGUSR1``). Use
Erik Faye-Lunde8d03132020-09-30 10:36:29 +0200385 ``kill -10 <pid>`` to toggle the HUD as desired.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200386``GALLIUM_HUD_SCALE``
Erik Faye-Lunde8d03132020-09-30 10:36:29 +0200387 Scale HUD by an integer factor, for high DPI displays. Default is 1.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200388``GALLIUM_HUD_DUMP_DIR``
Erik Faye-Lunde8d03132020-09-30 10:36:29 +0200389 specifies a directory for writing the displayed HUD values into
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200390 files.
391``GALLIUM_DRIVER``
392 useful in combination with ``LIBGL_ALWAYS_SOFTWARE=true`` for
393 choosing one of the software renderers ``softpipe``, ``llvmpipe`` or
394 ``swr``.
395``GALLIUM_LOG_FILE``
396 specifies a file for logging all errors, warnings, etc. rather than
397 stderr.
Jason Ekstrand449f1fe2020-08-18 11:59:19 -0500398``GALLIUM_PIPE_SEARCH_DIR``
399 specifies an alternate search directory for pipe-loader which overrides
400 the compile-time path based on the install location.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200401``GALLIUM_PRINT_OPTIONS``
402 if non-zero, print all the Gallium environment variables which are
403 used, and their current values.
404``GALLIUM_DUMP_CPU``
405 if non-zero, print information about the CPU on start-up
406``TGSI_PRINT_SANITY``
407 if set, do extra sanity checking on TGSI shaders and print any errors
408 to stderr.
409``DRAW_FSE``
410 ???
411``DRAW_NO_FSE``
412 ???
413``DRAW_USE_LLVM``
414 if set to zero, the draw module will not use LLVM to execute shaders,
415 vertex fetch, etc.
416``ST_DEBUG``
417 controls debug output from the Mesa/Gallium state tracker. Setting to
418 ``tgsi``, for example, will print all the TGSI shaders. See
419 ``src/mesa/state_tracker/st_debug.c`` for other options.
420
421Clover environment variables
422~~~~~~~~~~~~~~~~~~~~~~~~~~~~
423
424``CLOVER_EXTRA_BUILD_OPTIONS``
425 allows specifying additional compiler and linker options. Specified
426 options are appended after the options set by the OpenCL program in
427 ``clBuildProgram``.
428``CLOVER_EXTRA_COMPILE_OPTIONS``
429 allows specifying additional compiler options. Specified options are
430 appended after the options set by the OpenCL program in
431 ``clCompileProgram``.
432``CLOVER_EXTRA_LINK_OPTIONS``
433 allows specifying additional linker options. Specified options are
434 appended after the options set by the OpenCL program in
435 ``clLinkProgram``.
436
437Softpipe driver environment variables
438~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
439
Eric Anholt991def02020-07-21 15:11:56 -0700440``SOFTPIPE_DEBUG``
441 a comma-separated list of named flags, which do various things:
442
443 ``vs``
444 Dump vertex shader assembly to stderr
445 ``fs``
446 Dump fragment shader assembly to stderr
447 ``gs``
448 Dump geometry shader assembly to stderr
449 ``cs``
450 Dump compute shader assembly to stderr
451 ``no_rast``
452 rasterization is no-op'd. For profiling purposes.
453 ``use_llvm``
454 the softpipe driver will try to use LLVM JIT for vertex
455 shading processing.
Eric Anholtd0f8fe52019-12-31 16:20:52 -0800456 ``use_tgsi``
457 if set, the softpipe driver will ask to directly consume TGSI, instead
458 of NIR.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200459
460LLVMpipe driver environment variables
461~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
462
463``LP_NO_RAST``
464 if set LLVMpipe will no-op rasterization
465``LP_DEBUG``
466 a comma-separated list of debug options is accepted. See the source
467 code for details.
468``LP_PERF``
469 a comma-separated list of options to selectively no-op various parts
470 of the driver. See the source code for details.
471``LP_NUM_THREADS``
472 an integer indicating how many threads to use for rendering. Zero
473 turns off threading completely. The default value is the number of
474 CPU cores present.
475
476VMware SVGA driver environment variables
477~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
478
479``SVGA_FORCE_SWTNL``
480 force use of software vertex transformation
481``SVGA_NO_SWTNL``
482 don't allow software vertex transformation fallbacks (will often
483 result in incorrect rendering).
484``SVGA_DEBUG``
485 for dumping shaders, constant buffers, etc. See the code for details.
486``SVGA_EXTRA_LOGGING``
487 if set, enables extra logging to the ``vmware.log`` file, such as the
488 OpenGL program's name and command line arguments.
489``SVGA_NO_LOGGING``
490 if set, disables logging to the ``vmware.log`` file. This is useful
491 when using Valgrind because it otherwise crashes when initializing
492 the host log feature.
493
494See the driver code for other, lesser-used variables.
495
496WGL environment variables
497~~~~~~~~~~~~~~~~~~~~~~~~~
498
499``WGL_SWAP_INTERVAL``
500 to set a swap interval, equivalent to calling
501 ``wglSwapIntervalEXT()`` in an application. If this environment
502 variable is set, application calls to ``wglSwapIntervalEXT()`` will
503 have no effect.
504
505VA-API environment variables
506~~~~~~~~~~~~~~~~~~~~~~~~~~~~
507
508``VAAPI_MPEG4_ENABLED``
509 enable MPEG4 for VA-API, disabled by default.
510
511VC4 driver environment variables
512~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
513
514``VC4_DEBUG``
515 a comma-separated list of named flags, which do various things:
516
517 ``cl``
518 dump command list during creation
519 ``qpu``
520 dump generated QPU instructions
521 ``qir``
522 dump QPU IR during program compile
523 ``nir``
524 dump NIR during program compile
525 ``tgsi``
526 dump TGSI during program compile
527 ``shaderdb``
528 dump program compile information for shader-db analysis
529 ``perf``
530 print during performance-related events
531 ``norast``
532 skip actual hardware execution of commands
533 ``always_flush``
534 flush after each draw call
535 ``always_sync``
536 wait for finish after each flush
537 ``dump``
538 write a GPU command stream trace file (VC4 simulator only)
539
540RADV driver environment variables
541~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
542
543``RADV_DEBUG``
544 a comma-separated list of named flags, which do various things:
545
Daniel Schürmannb78f6452020-06-12 17:55:00 +0100546 ``llvm``
547 enable LLVM compiler backend
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200548 ``allbos``
549 force all allocated buffers to be referenced in submissions
550 ``allentrypoints``
551 enable all device/instance entrypoints
552 ``checkir``
553 validate the LLVM IR before LLVM compiles the shader
554 ``errors``
555 display more info about errors
Bas Nieuwenhuizen2fa83dc2020-08-10 00:10:38 +0200556 ``forcecompress``
557 Enables DCC,FMASK,CMASK,HTILE in situations where the driver supports it
558 but normally does not deem it beneficial.
Samuel Pitoiset33c9d4b2020-10-19 18:37:26 +0200559 ``hang``
Samuel Pitoiset8d7f78c2020-11-20 09:19:55 +0100560 enable GPU hangs detection and dump a report to
561 $HOME/radv_dumps_<pid>_<time> if a GPU hang is detected
Simon Ser1cf1ece2020-07-03 15:16:00 +0200562 ``img``
563 Print image info
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200564 ``info``
565 show GPU-related information
566 ``metashaders``
567 dump internal meta shaders
568 ``nobinning``
569 disable primitive binning
570 ``nocache``
571 disable shaders cache
572 ``nocompute``
573 disable compute queue
574 ``nodcc``
575 disable Delta Color Compression (DCC) on images
576 ``nodynamicbounds``
577 do not check OOB access for dynamic descriptors
578 ``nofastclears``
579 disable fast color/depthstencil clears
580 ``nohiz``
581 disable HIZ for depthstencil images
582 ``noibs``
583 disable directly recording command buffers in GPU-visible memory
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200584 ``nomemorycache``
585 disable memory shaders cache
586 ``nongg``
587 disable NGG for GFX10+
588 ``nooutoforder``
589 disable out-of-order rasterization
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200590 ``nothreadllvm``
591 disable LLVM threaded compilation
Samuel Pitoiset4ffa6ac2020-11-20 09:56:59 +0100592 ``noumr``
593 disable UMR dumps during GPU hang detection (only with RADV_DEBUG=hang)
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200594 ``preoptir``
595 dump LLVM IR before any optimizations
596 ``shaders``
597 dump shaders
598 ``shaderstats``
599 dump shader statistics
600 ``spirv``
601 dump SPIR-V
602 ``startup``
603 display info at startup
604 ``syncshaders``
605 synchronize shaders after all draws/dispatches
606 ``vmfaults``
607 check for VM memory faults via dmesg
608 ``zerovram``
609 initialize all memory allocated in VRAM as zero
610
611``RADV_FORCE_FAMILY``
Erik Faye-Lund689145e2020-09-30 15:24:01 +0200612 create a null device to compile shaders without a AMD GPU (e.g.
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200613 gfx900)
614``RADV_PERFTEST``
615 a comma-separated list of named flags, which do various things:
616
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200617 ``bolist``
618 enable the global BO list
619 ``cswave32``
620 enable wave32 for compute shaders (GFX10+)
621 ``dccmsaa``
622 enable DCC for MSAA images
623 ``dfsm``
624 enable dfsm
625 ``gewave32``
626 enable wave32 for vertex/tess/geometry shaders (GFX10+)
627 ``localbos``
628 enable local BOs
629 ``pswave32``
630 enable wave32 for pixel shaders (GFX10+)
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200631 ``tccompatcmask``
632 enable TC-compat cmask for MSAA images
633
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200634``RADV_TEX_ANISO``
635 force anisotropy filter (up to 16)
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200636``ACO_DEBUG``
637 a comma-separated list of named flags, which do various things:
638
639 ``validateir``
640 validate the ACO IR at various points of compilation (enabled by
641 default for debug/debugoptimized builds)
642 ``validatera``
643 validate register assignment of ACO IR and catches many RA bugs
644 ``perfwarn``
645 abort on some suboptimal code generation
Samuel Pitoisetf1531512020-08-19 10:40:35 +0200646 ``force-waitcnt``
647 force emitting waitcnt states if there is something to wait for
Samuel Pitoiset502b9da2020-08-26 14:24:45 +0200648 ``novn``
649 disable value numbering
650 ``noopt``
651 disable various optimizations
652 ``noscheduling``
653 disable instructions scheduling
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200654
655radeonsi driver environment variables
656~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
657
658``AMD_DEBUG``
659 a comma-separated list of named flags, which do various things:
660``nodma``
661 Disable SDMA
662``nodmaclear``
663 Disable SDMA clears
664``nodmacopyimage``
665 Disable SDMA image copies
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200666``nodcc``
667 Disable DCC.
668``nodccclear``
669 Disable DCC fast clear.
670``nodccfb``
671 Disable separate DCC on the main framebuffer
672``nodccmsaa``
673 Disable DCC for MSAA
674``nodpbb``
675 Disable DPBB.
676``nodfsm``
677 Disable DFSM.
678``notiling``
679 Disable tiling
680``nofmask``
681 Disable MSAA compression
682``nohyperz``
683 Disable Hyper-Z
Erik Faye-Lund4d066832020-06-12 20:09:42 +0200684``no2d``
685 Disable 2D tiling
686``info``
687 Print driver information
688``tex``
689 Print texture info
690``compute``
691 Print compute info
692``vm``
693 Print virtual addresses when creating resources
694``vs``
695 Print vertex shaders
696``ps``
697 Print pixel shaders
698``gs``
699 Print geometry shaders
700``tcs``
701 Print tessellation control shaders
702``tes``
703 Print tessellation evaluation shaders
704``cs``
705 Print compute shaders
706``noir``
707 Don't print the LLVM IR
708``nonir``
709 Don't print NIR when printing shaders
710``noasm``
711 Don't print disassembled shaders
712``preoptir``
713 Print the LLVM IR before initial optimizations
714``gisel``
715 Enable LLVM global instruction selector.
716``w32ge``
717 Use Wave32 for vertex, tessellation, and geometry shaders.
718``w32ps``
719 Use Wave32 for pixel shaders.
720``w32cs``
721 Use Wave32 for computes shaders.
722``w64ge``
723 Use Wave64 for vertex, tessellation, and geometry shaders.
724``w64ps``
725 Use Wave64 for pixel shaders.
726``w64cs``
727 Use Wave64 for computes shaders.
728``checkir``
729 Enable additional sanity checks on shader IR
730``mono``
731 Use old-style monolithic shaders compiled on demand
732``nooptvariant``
733 Disable compiling optimized shader variants.
734``forcedma``
735 Use SDMA for all operations when possible.
736``nowc``
737 Disable GTT write combining
738``check_vm``
739 Check VM faults and dump debug info.
740``reserve_vmid``
741 Force VMID reservation per context.
742``nogfx``
743 Disable graphics. Only multimedia compute paths can be used.
744``nongg``
745 Disable NGG and use the legacy pipeline.
746``nggc``
747 Always use NGG culling even when it can hurt.
748``nonggc``
749 Disable NGG culling.
750``alwayspd``
751 Always enable the primitive discard compute shader.
752``pd``
753 Enable the primitive discard compute shader for large draw calls.
754``nopd``
755 Disable the primitive discard compute shader.
756``switch_on_eop``
757 Program WD/IA to switch on end-of-packet.
758``nooutoforder``
759 Disable out-of-order rasterization
760``dpbb``
761 Enable DPBB.
762``dfsm``
763 Enable DFSM.
764
765Other Gallium drivers have their own environment variables. These may
766change frequently so the source code should be consulted for details.