radv: initial support for the Radeon GPU Profiler
The Radeon GPU profiler support [1] is an awesome performance tool provided by AMD that can be used by developers to optimize Vulkan (also DX12 and OpenCL) applications for AMD RDNA and GCN hardware.
RGP is a GUI tool used to visualize and analyze the profile data. RGP consumes .rgp files that have to be generated by the driver. AFAIU, AMDVLK has two different ways to record RGP captures:
- trigger the internal GPU profiler with some settings stored in amdPalSettings.cfg
- use RDS (Radeon Developer Serviceà that unlocks the Developer Mode Driver features and supports communications with high level tools
This MR implements 1) for RADV, 2) sounds more complicated and I'm not sure yet how does it really work (future work).
Under the hood, AMD hardware has something called SQTT (SQ Thread Trace) which collects thread trace data (wave occupancy, timings, etc). SQTT is also a file format (.rgp extension) that is consumed by RGP. It's composed of different chunks, CPU info, GPU info, thread trace info, etc (see radv_sqtt.c).
This MR allows to capture SQTT files with RADV_THREAD_TRACE=<start_frame>, it's pretty crappy at the moment but it's a start. I think I will implement some sort of overlay and allow to trigger captures with F12 (like RenderDoc) in the future. Only GFX9 is supported and a bunch of useful stuff like shader ISA, pipeline info etc are still missing (future work).
This is the first step towards profiling with RADV! Enjoy! \o/
This MR is based on !3899 (merged)