ROCm / ROCgdb

This is ROCgdb, the ROCm source-level debugger for Linux, based on GDB, the GNU source-level debugger.
https://rocm.docs.amd.com/projects/ROCgdb/en/latest/
GNU General Public License v2.0
50 stars 9 forks source link

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

Open Chunming-Zhou opened 2 years ago

Chunming-Zhou commented 2 years ago

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

Maetveis commented 2 years ago

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?

ppanchad-amd commented 1 month ago

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