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

Feature request: VS Code extension support #8

Open MathiasMagnus opened 3 years ago

MathiasMagnus commented 3 years ago

It would be mighty useful if there were visual debugging support akin to nSight VS Code Edition allowing VS Code users to set breakpoints in kernels and inspect variable values like on the host.

I don't know if this repo or the rocr_debug_agent repo is more appropriate to enable this functionality.

t-tye commented 3 years ago

ROCgdb supports the standard gdb MI interface so should function with existing GUI tools. Have you tried it?

I believe someone working on Theia which is using the same debugger interface as VS Code did get ROCgdb working with it.

Currently the ROCm compiler is not generating symbolic variable information so variable inspection is not yet possible. But a future release is planned to add that support.

MathiasMagnus commented 3 years ago

@t-tye Thanks for the reply. I have tried using rocgdb as a drop-in replacement to GDB and it worked well, although the primary reason I'd do so is kernel debugging. That's something currently I rely on HIP-CPU for, and while it is unquestionably valuable, it requires all my dependencies to compile with it, which is still a long way from happening (rocFFT, rocBLAS, etc.), or I have to write small dispatch shims to all such libraries to a host implementation, which is a lot of work. Currently it's comfort zone is very limited, hence my request.

bohemondcouka commented 3 years ago

Hi, I'm the one working with Theia on a debug view for ROCgdb. As @t-tye said, it's quite limited for the moment due to ROCm compiler limitation and it's more a proof of concept than a finished product. As Theia extension work on VSCode it should be able to work, but I haven't tested it yet. As ROCgdb uses the same protocol as gdb, when ROCm compiler will be updated, you should be able to use a C++ GDB extension and use ROCgdb instead of GDB to get the job done.

t-tye commented 3 years ago

@t-tye Thanks for the reply. I have tried using rocgdb as a drop-in replacement to GDB and it worked well, although the primary reason I'd do so is kernel debugging. That's something currently I rely on HIP-CPU for, and while it is unquestionably valuable, it requires all my dependencies to compile with it, which is still a long way from happening (rocFFT, rocBLAS, etc.), or I have to write small dispatch shims to all such libraries to a host implementation, which is a lot of work. Currently it's comfort zone is very limited, hence my request.

@MathiasMagnus not sure I am following. ROCgdb debugs both host and device code in a unified way. So it should work with however you compile the program. Where are you having a problem?

ppanchad-amd commented 1 month ago

@MathiasMagnus Is this ticket still relevant? If not, can we close it? Thanks!

MathiasMagnus commented 1 month ago

This is still a missing ecosystem component, though my own immediate use for this has passed (having moved on from HIP programming to standard APIs), so it's still relevant, just not for me.