4
4
:keywords: AMD, ROCm, HIP, ROCgdb, performance, debugging
5
5
6
6
*******************************************************************************
7
- ROCgdb
7
+ ROCgdb debugger for Linux targets
8
8
*******************************************************************************
9
9
10
10
.. _rocgdb_introduction :
11
11
Introduction
12
12
===============================================================================
13
- This document introduces ROCgdb, the AMD ROCm debugger for Linux targets.
13
+ ` ROCgdb < https://github.com/ROCm/ ROCgdb>`_ is the AMD ROCm debugger for Linux targets.
14
14
15
15
ROCgdb is an extension to GDB, the GNU Project debugger. The tool provides developers
16
- with a mechanism for debugging CUDA applications running on actual hardware. This
16
+ with a mechanism for debugging CUDA applications running on actual hardware. This tool
17
17
enables developers to debug applications without the potential variations introduced
18
- by simulation and emulation environments. It is meant to present a seamless debugging
19
- environment that allows simultaneous debugging of both GPU and CPU code within the
20
- same application, just like programming in HIP is a seamless extension of C++
18
+ by simulation and emulation environments. It presents a seamless debugging
19
+ environment that allows simultaneous GPU and CPU code debugging within the same
20
+ application, just like programming in HIP, which is a seamless extension of C++
21
21
programming. The existing GDB debugging features are inherently present for debugging
22
22
the host code, and additional features have been provided to support debugging ROCm
23
23
device code.
24
24
25
- ROCgdb supports HIP kernel debugging. It allows the user to set breakpoints, to
26
- single-step ROCm applications, and also to inspect and modify the memory and variables
27
- of any given thread running on the hardware.
25
+ ROCgdb supports HIP kernel debugging. It allows you to set breakpoints, single-step
26
+ ROCm applications, and inspect and modify the memory and variablesof any given thread
27
+ running on the hardware.
28
28
29
29
.. _rocgdb_installation :
30
30
Installation
@@ -35,17 +35,16 @@ before using the debugger.
35
35
.. _rocgdb_setup :
36
36
Setup
37
37
===============================================================================
38
- Before debugging you have to compile your software with debug information. To do this
39
- you have to add the '-g' flag for your compilation command. This will generate debug
40
- information even when optimizations are turned on. Notice that higher optimization
41
- levels make the debugging more difficult, so it might be useful to turn off these
42
- optimizations by using the '-O0' compiler option.
38
+ Before debugging, compile your software with debug information. Add the ‘-g’ flag to your
39
+ compilation command to do this. This generates debug information even when optimizations
40
+ are turned on. Notice that higher optimization levels make the debugging more difficult,
41
+ so it might be helpful to turn off these optimizations using the ‘-O0’ compiler option.
43
42
44
43
.. _rocgdb_debugging :
45
44
Debugging
46
45
===============================================================================
47
- This section is a brief introduction on how to use ROCgdb. For a more information on the
48
- functionality of gdb look up the gdb documentation.
46
+ This section introduces how to use ROCgdb. For more information about GDB, see the ` GDB
47
+ documentation <https://www.sourceware.org/ gdb/ documentation/> `_ .
49
48
50
49
First step is to run ROCgdb with your ROCm application:
51
50
@@ -55,7 +54,7 @@ At this point the application is not running, but you'll have access to the debu
55
54
console. Here you can use every gdb option for host debugging and you can use them and
56
55
extra ROCgdb specific features for device debugging.
57
56
58
- Before you run your application with the debugger, you'll need to set a breakpoint .
57
+ You'll need to set a breakpoint before you run your application with the debugger.
59
58
60
59
``tbreak my_app.cpp:458 ``
61
60
@@ -64,9 +63,9 @@ command:
64
63
65
64
``run ``
66
65
67
- If the breakpoint is in device code the debugger will show the device and host threads as
68
- well . The device threads will not be individual threads, instead they represent a
69
- wavefront on the device. You can switch between the device wavefronts, like you would
66
+ If the breakpoint is in the device code, the debugger will also show the device and host
67
+ threads . The device threads will not be individual threads; instead, they represent a
68
+ wavefront on the device. You can switch between the device wavefronts as you would
70
69
between host threads.
71
70
72
71
You can also switch between layouts. Use different layouts for different situations while
@@ -77,7 +76,8 @@ debugging.
77
76
``layout asm ``
78
77
79
78
The `src ` layout is the source code view, while the `asm ` is the assembly view. There are
80
- further layouts you can look up on the gdb documentation.
79
+ further layouts you can look up in the `GDB documentation
80
+ <https://www.sourceware.org/gdb/documentation/> `_.
81
81
82
82
``info threads ``
83
83
@@ -95,5 +95,5 @@ To dump the content of the current wavefronts registers use:
95
95
96
96
``i r ``
97
97
98
- For further information on the usage of gdb, you can go to the ` gdb documentation
99
- <https://www.sourceware.org/gdb/documentation/> `_ .
98
+ The result of this command is just the register dump, which is the all-inclusive data
99
+ about the state of the current wavefront, but very difficult to parse .
0 commit comments