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