I wrote a tool called aco_dump. You give it a SPIR-V binary and it runs it
through the RADV/ACO pipeline and dumps the ACO IR. No GPU needed.
I proposed it upstream, the discussion is on issue #15111.
Normally to see what ACO does to a shader you need an AMD GPU and a running Vulkan app.
You set RADV_DEBUG=shaders, capture a frame, extract the shaders and look at the dump.
It's a bit annoying especially if you just want to check something quick.
I wanted something simpler — just give it a .spv file and get ACO IR out, for any gfx level, without needing actual hardware.
drm-shim basically fakes a GPU by intercepting the DRM ioctls. RADV asks what hardware it's running on and drm-shim answers with whatever gfx level you set. Mesa initializes fine, it just can't submit work — which doesn't matter since I only care about the compiler output anyway.
PipelineBuilder is the internal test utility in Mesa. I used it instead of fossilize because I needed direct control over pipeline state, not replaying pre-recorded captures.
ninja -C build src/amd/compiler/tests/aco_dump
Compute shader:
LD_PRELOAD=build/src/amd/drm-shim/libamdgpu_noop_drm_shim.so \ build/src/amd/compiler/tests/aco_dump gfx9 cs compute.spv
Vertex + fragment pipeline:
LD_PRELOAD=build/src/amd/drm-shim/libamdgpu_noop_drm_shim.so \ build/src/amd/compiler/tests/aco_dump gfx10 vsfs vert.spv frag.spv
Supports gfx6 through gfx12. Two modes: cs for compute, vsfs for
vertex+fragment. If you want to compare the same shader on different hardware you just change
the gfx argument, that's it.
The main concern was maintenance. Anything that depends on RADV internals breaks when those
internals change, and they change often. So the tool lives under src/amd/compiler/tests/
to stay close to the existing test infrastructure.