Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add rocgdb how-to #3097

Closed
wants to merge 3 commits into from
Closed

add rocgdb how-to #3097

wants to merge 3 commits into from

Conversation

parbenc
Copy link
Contributor

@parbenc parbenc commented May 8, 2024

No description provided.

@parbenc parbenc force-pushed the rocgdb branch 2 times, most recently from c115022 to f35d561 Compare May 8, 2024 13:20
randyh62
randyh62 previously approved these changes May 8, 2024
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe provide a link to the ROCgdb repo?
https://rocm.docs.amd.com/projects/ROCgdb/en/latest/index.html

:keywords: AMD, ROCm, HIP, ROCgdb, performance, debugging

*******************************************************************************
ROCgdb
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ROCgdb
ROCgdb debugger for Linux targets

.. _rocgdb_introduction:
Introduction
===============================================================================
This document introduces ROCgdb, the AMD ROCm debugger for Linux targets.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
This document introduces ROCgdb, the AMD ROCm debugger for Linux targets.
ROCgdb is the AMD ROCm debugger for Linux targets.

This document introduces ROCgdb, the AMD ROCm debugger for Linux targets.

ROCgdb is an extension to GDB, the GNU Project debugger. The tool provides developers
with a mechanism for debugging CUDA applications running on actual hardware. This
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
with a mechanism for debugging CUDA applications running on actual hardware. This
with a mechanism for debugging CUDA applications running on actual hardware. This tool

with a mechanism for debugging CUDA applications running on actual hardware. This
enables developers to debug applications without the potential variations introduced
by simulation and emulation environments. It is meant to present a seamless debugging
environment that allows simultaneous debugging of both GPU and CPU code within the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
environment that allows simultaneous debugging of both GPU and CPU code within the
environment that allows simultaneous GPU and CPU code debugging within the

ROCgdb is an extension to GDB, the GNU Project debugger. The tool provides developers
with a mechanism for debugging CUDA applications running on actual hardware. This
enables developers to debug applications without the potential variations introduced
by simulation and emulation environments. It is meant to present a seamless debugging
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
by simulation and emulation environments. It is meant to present a seamless debugging
by simulation and emulation environments. It presents a seamless debugging

enables developers to debug applications without the potential variations introduced
by simulation and emulation environments. It is meant to present a seamless debugging
environment that allows simultaneous debugging of both GPU and CPU code within the
same application, just like programming in HIP is a seamless extension of C++
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
same application, just like programming in HIP is a seamless extension of C++
same application, just like programming in HIP, which is a seamless extension of C++

the host code, and additional features have been provided to support debugging ROCm
device code.

ROCgdb supports HIP kernel debugging. It allows the user to set breakpoints, to
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps this instead:
It allows you to set breakpoints, single-step ROCm applications, and inspect and modify the memory and variables of any given thread running on the hardware.

.. _rocgdb_setup:
Setup
===============================================================================
Before debugging you have to compile your software with debug information. To do this
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider this paragraph instead:
Before debugging, compile your software with debug information. Add the ‘-g’ flag to your compilation command to do this. This generates debug information even when optimizations are turned on. Notice that higher optimization levels make the debugging more difficult, so it might be helpful to turn off these optimizations using the ‘-O0’ compiler option.

.. _rocgdb_debugging:
Debugging
===============================================================================
This section is a brief introduction on how to use ROCgdb. For a more information on the
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps:
This section introduces how to use ROCgdb. For more information about GDB, see the GDB documentation.

Add a link for the bold.

console. Here you can use every gdb option for host debugging and you can use them and
extra ROCgdb specific features for device debugging.

Before you run your application with the debugger, you'll need to set a breakpoint.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Before you run your application with the debugger, you'll need to set a breakpoint.
You'll need to set a breakpoint before you run your application with the debugger.


``run``

If the breakpoint is in device code the debugger will show the device and host threads as
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps:
If the breakpoint is in the device code, the debugger will also show the device and host threads. The device threads will not be individual threads; instead, they represent a wavefront on the device. You can switch between the device wavefronts as you would between host threads.

By the way, is it "wavefront" or "warp"?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As far as I know they are the same thing, but warp is the word nvidia uses for cuda, and wavefront is used for opencl and by amd for its hardware

``layout asm``

The `src` layout is the source code view, while the `asm` is the assembly view. There are
further layouts you can look up on the gdb documentation.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
further layouts you can look up on the gdb documentation.
further layouts you can look up in the GBD documentation. (Make this a link)


``i r``

For further information on the usage of gdb, you can go to the `gdb documentation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This feels like it's been discussed multiple times.
Not sure needed again here. Perhaps it doesn't hurt.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added some text about the command above it. Just ending on a command felt weird.

docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
docs/how-to/rocgdb.rst Outdated Show resolved Hide resolved
Copy link
Member

@saadrahim saadrahim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This belongs in the rocgdb docs repo.

@yhuiYH
Copy link
Collaborator

yhuiYH commented May 27, 2024

I agree with Saad. Can we move this to the rocgdb-docs repo instead of merging in here pls @neon60 @parbenc

@parbenc
Copy link
Contributor Author

parbenc commented May 28, 2024

This belongs in the rocgdb docs repo.

moved to rocgdb-docs
PR: https://github.com/ROCm/ROCgdb-docs/pull/35

@neon60
Copy link
Collaborator

neon60 commented May 30, 2024

This belongs in the rocgdb docs repo.

moved to rocgdb-docs PR: ROCm/ROCgdb-docs#35

The PR is merged in on rocgdb docs repository. Closing this PR.

@neon60 neon60 closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants