GPUOpen-Tools / radeon_gpu_profiler

Radeon GPU Profiler (RGP) is a tool from AMD that allows for deep inspection of GPU workloads.
396 stars 41 forks source link

Support for OpenCL/HIP profiling on Linux #84

Open Epliz opened 1 year ago

Epliz commented 1 year ago

Hi,

The profiling capabilities are quite frankly great on Windows, with the instruction tracing being very very useful.

Would it be possible for you to consider adding similar functionality on Linux for OpenCL/HIP?

Best regards, Epliz

Epliz commented 1 year ago

Hi @chesik-amd , Could you please ACK that issue even if not promising anything about fixing it?

chesik-amd commented 1 year ago

On Linux, OpenCL and HIP are built on top of the ROCm driver stack (as opposed to the PAL driver stack on Windows). The ROCm stack does not have the support needed for RGP. The ROCm team provides alternate GPU profiling tools that work with that driver stack.

Epliz commented 1 year ago

Thanks @chesik-amd for the reply. I understand the current situation, but I hope this is not the forever situation as the ROCm profiling tools are far far behind what you have with RGP. I hope the rocm stack gets the sufficient support to at least be able to record a trace that can be loaded in RGP afterwards.

Snektron commented 11 months ago

There is no reason that this support cannot be added, though. In fact, it is not too complex to capture the rgp trace via a HSA PM4 packet, which is already done by rocprof. I partially reverse-engineered this last year and created a proof-of-concept here: https://github.com/Snektron/goniometer. It is able to capture the instruction trace during a HIP workload on Linux using ROCm, though it is a little janky because I didnt mamage to get all packets right. There is also support missing for the other RGP functionally like markers. With the right expertise and access to documentation it should be more than possible to implement this, or is there something else that blocks it, @chesik-amd?