blob: f29bf53dfec1f25162d20a9e9cda6a6b3d35e54d [file] [log] [blame]
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +01001Debugging
2=========
3
4Debugging utilities in gallium.
5
6Debug Variables
7^^^^^^^^^^^^^^^
8
9All drivers respond to a couple of debug enviromental variables. Below is
10a collection of them. Set them as you would any normal enviromental variable
11for the platform/operating system you are running. For linux this can be
12done by typing "export var=value" into a console and then running the
13program from that console.
14
15Common
16""""""
17
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070018.. envvar:: GALLIUM_PRINT_OPTIONS <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010019
20This options controls if the debug variables should be printed to stderr.
21This is probably the most usefull variable since it allows you to find
22which variables a driver responds to.
23
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070024.. envvar:: GALLIUM_RBUG <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010025
26Controls if the :ref:`rbug` should be used.
27
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070028.. envvar:: GALLIUM_TRACE <string> ("")
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010029
30If not set tracing is not used, if set it will write the output to the file
31specifed by the variable. So setting it to "trace.xml" will write the output
32to the file "trace.xml".
33
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070034.. envvar:: GALLIUM_DUMP_CPU <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010035
36Dump information about the current cpu that the driver is running on.
37
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070038.. envvar:: TGSI_PRINT_SANITY <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010039
40Gallium has a inbuilt shader sanity checker, this option controls if results
41from it should be printed. This include warnings such as unused variables.
42
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070043.. envvar:: DRAW_USE_LLVM <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010044
45Should the :ref:`draw` module use llvm for vertex and geometry shaders.
46
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070047.. envvar:: ST_DEBUG <flags> (0x0)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010048
49Debug :ref:`flags` for the GL state tracker.
50
51
52Driver specific
53"""""""""""""""
54
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070055.. envvar:: I915_DEBUG <flags> (0x0)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010056
57Debug :ref:`flags` for the i915 driver.
58
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070059.. envvar:: I915_NO_HW <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010060
61Stop the i915 driver from submitting commands to the hardware.
62
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070063.. envvar:: I915_DUMP_CMD <bool> (false)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010064
65Dump all commands going to the hardware.
66
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070067.. envvar:: LP_DEBUG <flags> (0x0)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010068
69Debug :ref:`flags` for the llvmpipe driver.
70
Corbin Simpsonbf357ae2010-08-15 03:05:18 -070071.. envvar:: LP_NUM_THREADS <int> (num cpus)
Jakob Bornecrantzd62b29f2010-08-15 00:59:57 +010072
73Number of threads that the llvmpipe driver should use.
74
75
76.. _flags:
77
78Flags
79"""""
80
81The variables of type <flags> all take a string with comma seperated
82flags to enable different debugging for different parts of the drivers
83or state tracker. If set to "help" the driver will print a list of flags
84to which the variable can be set to. Order does not matter.
85
86
87.. _rbug:
88
89Remote Debugger
90^^^^^^^^^^^^^^^
91
92Or rbug for short allows for runtime inspections of :ref:`Context`,
93:ref:`Screen`, Resources and Shaders; pauseing and stepping of draw calls;
94and runtime disable and replacement of shaders. Is used with rbug-gui which
95is hosted outside of the main mesa repositor. Rbug is can be used over a
96network connection so the debbuger does not need to be on the same machine.