ROCm / hipamd

35 stars 37 forks source link

Can't compile hipamd in debug? #17

Open Maxzor opened 2 years ago

Maxzor commented 2 years ago

Debian wants debug symbols by default: AFAIR this was fine in 4.5.2. Compiling with -DCMAKE_BUILD_TYPE=Debug

Something happened with the SONAME bump from 4 to 5?

As far as I understand, neither libamdhip64 nor libhiprtc-builtins hold device-side compute kernels. https://salsa.debian.org/rocm-team/rocm-hipamd/-/blob/master/debian/rules

debian/libhiprtc-builtins5/usr/lib/x86_64-linux-gnu/libhiprtc-builtins.so.5.0.13601-: .debug_info section not present
debian/libamdhip64-5/usr/lib/x86_64-linux-gnu/libamdhip64.so.5.0.13601-: Unknown debugging section .debug_addr

objdump -W has a lot of warnings and dh_dwz errors for debian packaging.

Maxzor commented 2 years ago

Might be a clang issue? https://i.imgur.com/SwI2THf.png

Maxzor commented 2 years ago

With the rocm5.0+llvm14 bump that I made were introduced DWARF 5 section headers, not sure it is supported currently in Debian.

Maxzor commented 2 years ago

So yea, .debug_addr is not yet supported on Debian tooling. Which currently prevents debugging HIP host-side.

Device-side, I have been told that stock linux kernels do not have the ioctls to work with rocmgdb, nor the profiler/tracer.

:/

Mystro256 commented 2 years ago

Is this related to https://github.com/ROCm-Developer-Tools/hipamd/issues/24?

I didn't really look into if 5.0 produced valid debug, but I noticed in 5.1, the debug isn't even populated according to rpmbuild.

cgmb commented 1 year ago

So yea, .debug_addr is not yet supported on Debian tooling. Which currently prevents debugging HIP host-side.

Is that Bug 27375 - [dwz, dwarf5] .debug_addr support? A comment from September mentions that they had proposed a patch to add support.

Device-side, I have been told that stock linux kernels do not have the ioctls to work with rocmgdb, nor the profiler/tracer.

The necessary functionality is now being upstreamed into the Linux kernel: https://lists.freedesktop.org/archives/amd-gfx/2023-January/088932.html