Skip to content

Debugging

Philipp Richter edited this page Dec 31, 2018 · 2 revisions

Steam launch options

To debug or confirm that a game is really using gallium nine you may start the game :

PROTON_LOG=1 PROTON_USE_GALLIUM_NINE=1 PROTON_DUMP_DEBUG_COMMANDS=1 %command%

=> PROTON_LOG=1 will write a log to ~/steam-<appid>.log

To quickly check the for the gallium nine state :

$ grep 'Native Direct3D 9' steam-<appid>.log

To reduce the amount of logging you can rename user_settings.sample.py to user_settings.py in the proton directory. Change

"WINEDEBUG": "+timestamp,+pid,+tid,+seh,+debugstr,+module",

to

"WINEDEBUG": "+d3dadapter9,+d3d9",

=> PROTON_USE_GALLIUM_NINE=1 enables gallium

=> PROTON_DUMP_DEBUG_COMMANDS=1 will dump scripts inside /tmp/proton_<username>

use ./run to launch the game, winecfg, regedit, etc...

  • ./run winecfg (gallium nine state is on the staging tab)
  • ./run regedit, keys of interest
    • HKEY_CURRENT_USER\Software\Wine\Direct3DNine\ModulePath (path to the d3dadapter9.so.1)
    • HKEY_CURRENT_USER\Software\Wine\DllRedirects\d3d9 (if d3d9 is redirected to d3d9-nine.dll, gallium nine on/off switch)
  • For winetricks copy ./run to ./run_winetricks, edit it to look something like the following and you may invoke ./run_winetricks and install anything you like with it in the game's prefix.
        STEAM_COMPAT_CLIENT_INSTALL_PATH="/home/popsulfr/.local/share/Steam" \
-       "/home/popsulfr/.local/share/Steam/compatibilitytools.d/Proton_3.16-6_Gallium_Nine_Extras_0.1.2/dist/bin//wine" "${@:-${DEF_CMD[@]}}"
+       WINE="/home/popsulfr/.local/share/Steam/compatibilitytools.d/Proton_3.16-6_Gallium_Nine_Extras_0.1.2/dist/bin//wine" \
+       winetricks "${@}"

Mesa flags

Mesa accepts following environment variables for gallium nine debugging :

  • the NINE_DEBUG variable, to know what the D3D9 ST is doing. Pass NINE_DEBUG=help to get all options.
  • the NINE_TGSI_DUMP=1 variable for dumping generated TGSI code.
  • the NINE_FF_DUMP=1 variable for dumping shader generated by fixed function (ff)
  • the TGSI_PRINT_SANITY=1 variable will precisely check TGSI and assert in case of errors
  • the D3D_ALWAYS_SOFTWARE=1 will run it on CPU instead of GPU… extremly slow

More info here : https://wiki.ixit.cz/d3d9_debugging