1Asahi 2===== 3 4The Asahi driver aims to provide an OpenGL implementation for the Apple M1. 5 6Testing on macOS 7----------------- 8 9On macOS, the experimental Asahi driver may built with options: 10 11 -Dosmesa=true -Dglx=xlib -Dgallium-drivers=asahi,swrast 12 13To use, set the ``DYLD_LIBRARY_PATH`` environment variable: 14 15 DYLD_LIBRARY_PATH=/Users/nobody/mesa/build/src/gallium/targets/libgl-xlib/ glmark2 --reuse-context 16 17Only X11 apps are supported. XQuartz must be setup separately. 18 19Wrap (macOS only) 20----------------- 21 22Mesa includes a library that wraps the key IOKit entrypoints used in the macOS 23UABI for AGX. The wrapped routines print information about the kernel calls made 24and dump work submitted to the GPU using agxdecode. 25 26This library allows debugging Mesa, particularly around the undocumented macOS 27user-kernel interface. Logs from Mesa may compared to Metal to check that the 28UABI is being used correcrly. 29 30Furthermore, it allows reverse-engineering the hardware, as glue to get at the 31"interesting" GPU memory. 32 33The library is only built if ``-Dtools=asahi`` is passed. It builds a single 34``wrap.dylib`` file, which should be inserted into a process with the 35``DYLD_INSERT_LIBRARIES`` environment variable. 36 37For example, to trace an app ``./app``, run: 38 39 DYLD_INSERT_LIBRARIES=~/mesa/build/src/asahi/lib/libwrap.dylib ./app 40