aco_dump runs a SPIR-V binary through the RADV/ACO pipeline and dumps ACO IR. No physical GPU required.

I proposed it upstream; the discussion is in Mesa issue #15111.

The problem

The usual path to inspect ACO output starts with an AMD GPU and a Vulkan application. That is a lot of machinery when the question is only “what does ACO do to this SPIR-V on gfx9?”

I wanted the compiler-shaped version: one .spv file in, ACO IR out, target selected on the command line.

How it works

drm-shim intercepts DRM ioctls and presents enough fake hardware for driver initialization. RADV sees the selected target and initializes normally.

PipelineBuilder is Mesa's internal test utility. I used it for direct control over pipeline state.

Usage

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 and 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

The version discussed supports gfx6 through gfx12 and has two modes: cs for compute and vsfs for vertex plus fragment.

Why it stayed a prototype

The tool depends on RADV internals that move often. Keeping it beside the existing ACO tests made that dependency obvious, but it still meant updating the tool whenever those interfaces changed.

This note describes the proposed version of the tool. Check the linked upstream issue before relying on the paths or command-line interface; both may change with Mesa.