Getting started with Mesa

Jan 13, 2026

Notes from my first weeks reading and building Mesa. Mostly for myself, but maybe useful if you're in the same position.

The source tree

AMD-specific code lives under src/amd/. RADV is in src/amd/vulkan/, ACO in src/amd/compiler/. NIR (Mesa's shared compiler IR) is in src/compiler/nir/. I didn't really need to touch anything else at the start.

Building

meson setup build -Dvulkan-drivers=amd -Dgallium-drivers= -Dbuildtype=debug
ninja -C build

Skip Gallium if you're only working on RADV/ACO. Debug builds are slower but you get assertions, which catch bugs early.

To use your build without installing system-wide:

export VK_ICD_FILENAMES=/path/to/build/src/amd/vulkan/radeon_icd.x86_64.json
export LD_LIBRARY_PATH=/path/to/build/src/amd/vulkan:$LD_LIBRARY_PATH

Reading the code

I traced vkCreateGraphicsPipelines end to end. radv_pipeline.cradv_shader.caco_interface.cpp → instruction selection, register allocation, scheduling → binary embedded in the pipeline object. It's a much better way to understand the codebase than just reading docs honestly.

Debug env vars

When something breaks I diff the shader dumps before and after the change, that usually shows what went wrong.

First contribution

My first kernel patch was just removing some unused code that was generating warnings. Nothing special but it helped me understand the patch submission process and what review looks like.

For Mesa: make changes, meson test, format commit message (match existing style), push to GitLab, open MR, wait for CI and review.

Community

IRC on OFTC. #dri-devel for general Mesa, #radeon for AMD.

← Back to main page