radv,vulkan: Add support for Radeon Memory Visualizer
This MR adds functionality to export RMV memory traces, similar to the RGP thread tracing functionality.
During program execution, calls to create or delete resources are logged and, when a device is destroyed, exported in the RMT format to be read by RMV. Additionally, page table mappings are recorded by enabling and reading ftrace events.
Unfortunately, getting RMV to read these traces is not straightforward because the currently released version refuses to read traces that have VAs greater than 0x1000000000 (64GiB). I have opened https://github.com/GPUOpen-Tools/radeon_memory_visualizer/issues/9 in the hopes the RMV team can remove this restriction. For the time being, the two options are to patch RMV by removing the two lines mentioned in the github issue, or to restrict the virtual address space size via the kernel arg This issue is fixed in the latest RMV version.amdgpu.vm_size=64
. The kernel argument way doesn't seem to be quite stable as I've been getting some GPU hangs with it.