ROCgdb icon indicating copy to clipboard operation
ROCgdb copied to clipboard

Which version of LLVm is required by ROCgdb to support "DWARF Extensions for Optimized SIMT/SIMD (GPU) Debugging"

Open Chunming-Zhou opened this issue 3 years ago • 2 comments

Which version of LLVm is required by ROCgdb to support "DWARF Extensions for Optimized SIMT/SIMD (GPU) Debugging"?

Chunming-Zhou avatar Jan 05 '22 11:01 Chunming-Zhou

According to the release notes ROCM 5.1 supposedly enabled this, but I can't make it work.

I did the following steps:

  1. Installed rocm-hip-runtime-dev and rocm-gdb 5.1.1 on ubuntu 20.04 (docker image)
  2. Compiled a simple program with the following command /opt/rocm/llvm/bin/clang++ -L /opt/rocm/lib -lhipamd64 -g -O0 -x hip main.cpp
  3. Run with rocgdb LD_LIBRARY_PATH=/opt/rocm/lib rocgdb ./a.out
  4. Try to add a breakpoint to the device code: break hello or break main.cpp:5

Expected: gdb adds the breakpoint, breaks when it is hit on the device. The values of variables etc can be inspected.

Actual result: gdb fails to add the breakpoint with this message: No compiled code for line 5 in file "main.cpp".

#include <hip/hip_runtime.h>

__global__
void hello(int a) {
    printf("Hello World: %d\n", a);
}

int main() {
    hipLaunchKernelGGL(hello, dim3(1), dim3(1), 0, 0, 10);
    hipDeviceSynchronize();
}

Note with previous versions (pre 5.1) adding the breakpoint worked, but no values where displayed in device code.

Can you help me what is needed to make this work?

Maetveis avatar Apr 12 '22 08:04 Maetveis

@Chunming-Zhou @Maetveis Apologies for the lack of response. Do you still need assistance with this issue? Thanks!

ppanchad-amd avatar Aug 09 '24 13:08 ppanchad-amd