Configuration
Generic
| Env var | Explanation |
|---|---|
MACH_DEBUG_AUDIO=true | enable verbose audio debug logging |
Linux
On Linux, Mach binaries have both Wayland/X11, and Vulkan/OpenGL/GLES support built-in (loaded dynamically via dlopen.)
Mach will try to use Wayland and Vulkan first. If Wayland is unavailable, it falls back to X11 automatically. If Vulkan is unavailable, it falls back to OpenGL.
For audio, Mach tries backends in the following order: PulseAudio → PipeWire → JACK → ALSA.
| Env var | Explanation |
|---|---|
MACH_FORCE_BACKEND=wayland | force the use of Wayland backend only |
MACH_FORCE_BACKEND=x11 | force the use of X11 backend only |
MACH_FORCE_GPU_BACKEND=vulkan | force the use of Vulkan backend only |
MACH_FORCE_GPU_BACKEND=opengl | force the use of OpenGL backend only |
MACH_FORCE_GPU_BACKEND=opengles | force the use of OpenGLES backend only |
MACH_FORCE_AUDIO_BACKEND=pulseaudio | force the use of PulseAudio audio backend |
MACH_FORCE_AUDIO_BACKEND=pipewire | force the use of PipeWire audio backend |
MACH_FORCE_AUDIO_BACKEND=jack | force the use of JACK audio backend |
MACH_FORCE_AUDIO_BACKEND=alsa | force the use of ALSA audio backend |
Forcing Vulkan hardware acceleration on older Linux distros
Some older Linux distros (e.g. Pop!_OS 20.x, Ubuntu 20.x, Linux Mint 20.x, Elementary OS 6, Debian 11 (Bullseye), etc. around 2020-2022) did not have great ranking for Vulkan loader ICD priority/ranking. As a result, Vulkan may be running on llvmpipe (software rendering), or your integrated graphics card instead of the desired dedicated GPU. In this case, you can force it using e.g.:
| Env var | Explanation |
|---|---|
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json | force llvmpipe (software rendering) |
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/nvidia_icd.json | force NVIDIA GPU (or try /etc/vulkan/icd.d/nvidia_icd.json) |
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/radeon_icd.x86_64.json | force AMD GPU |
VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/intel_icd.x86_64.json | force Intel GPU |
Note: exact filenames may differ for your system, check ls /usr/share/vulkan/icd.d/ and ls /etc/vulkan/icd.d/.
Windows
On Windows, Mach only supports shipping applications with Direct3D, and uses WASAPI for audio.
Sometimes it’s helpful for developers on Windows to test the OpenGL, Vulkan, or OpenGL ES backends on a Windows host. We don’t support shipping games in this configuration, but they can be enabled via build.zig (OpenGL ES support varies across drivers, Vulkan depends on the heavyweight LunarG Vulkan SDK. OpenGL is generally always available.)
macOS
On macOS, Mach only supports Metal, and uses CoreAudio.