diff options
author | Simon Marchi <simon.marchi@efficios.com> | 2023-09-06 09:41:45 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@efficios.com> | 2023-09-15 16:19:22 -0400 |
commit | 607c90c7389f2b9a887a638613f6a311311d42b5 (patch) | |
tree | 20d08e56100eaae4fede5969116493e047399c5f /gdb/doc | |
parent | 947e047fac434621264f7212bbaa97580490d4fd (diff) | |
download | fsf-binutils-gdb-607c90c7389f2b9a887a638613f6a311311d42b5.zip fsf-binutils-gdb-607c90c7389f2b9a887a638613f6a311311d42b5.tar.gz fsf-binutils-gdb-607c90c7389f2b9a887a638613f6a311311d42b5.tar.bz2 |
gdb/amdgpu: add precise-memory support
The amd-dbgapi library exposes a setting called "memory precision" for
AMD GPUs [1]. Here's a copy of the description of the setting:
The AMD GPU can overlap the execution of memory instructions with other
instructions. This can result in a wave stopping due to a memory violation
or hardware data watchpoint hit with a program counter beyond the
instruction that caused the wave to stop.
Some architectures allow the hardware to be configured to always wait for
memory operations to complete before continuing. This will result in the
wave stopping at the instruction immediately after the one that caused the
stop event. Enabling this mode can make execution of waves significantly
slower.
Expose this option through a new "amdgpu precise-memory" setting.
The precise memory setting is per inferior. The setting is transferred
from one inferior to another when using the clone-inferior command, or
when a new inferior is created following an exec or a fork.
It can be set before starting the inferior, in which case GDB will
attempt to apply what the user wants when attaching amd-dbgapi. If the
user has requested to enable precise memory, but it can't be enabled
(not all hardware supports it), GDB prints a warning.
If precise memory is disabled, GDB prints a warning when hitting a
memory exception (translated into GDB_SIGNAL_SEGV or GDB_SIGNAL_BUS),
saying that the stop location may not be precise.
Note that the precise memory setting also affects memory watchpoint
reporting, but the watchpoint support for AMD GPUs hasn't been
upstreamed to GDB yet. When we do upstream watchpoint support, GDB will
produce a similar warning message when stopping due to a watchpoint if
precise memory is disabled.
Add a handful of tests. Add a util proc
"hip_devices_support_precise_memory", which indicates if all devices
used for testing support that feature.
[1] https://github.com/ROCm-Developer-Tools/ROCdbgapi/blob/687374258a27b5aab1309a7e8ded719e2f1ed3b1/include/amd-dbgapi.h.in#L6300-L6317
Change-Id: Ife1a99c0e960513da375ced8f8afaf8e47a61b3f
Approved-By: Lancelot Six <lancelot.six@amd.com>
Diffstat (limited to 'gdb/doc')
-rw-r--r-- | gdb/doc/gdb.texinfo | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 9b7e06f..aa3c677 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -26794,6 +26794,49 @@ either not mapped or accessed with incompatible permissions. If a single instruction raises more than one signal, they will be reported one at a time each time the wavefront is continued. +@subsubsection @acronym{AMD GPU} Memory Violation Reporting + +A wavefront can report memory violation events. However, the program +location at which they are reported may be after the machine instruction +that caused them. This can result in the reported source statement +being incorrect. The following commands can be used to control this +behavior: + +@table @code + +@kindex set amdgpu precise-memory +@cindex AMD GPU precise memory event reporting +@item set amdgpu precise-memory @var{mode} +Controls how @acronym{AMD GPU} devices detect memory violations, where +@var{mode} can be: + +@table @code + +@item off +The program location may not be immediately after the instruction that +caused the memory violation. This is the default. + +@item on +Requests that the program location will be immediately after the +instruction that caused a memory violation. Enabling this mode may make +the @acronym{AMD GPU} device execution significantly slower as it has to +wait for each memory operation to complete before executing the next +instruction. + +@end table + +The @code{amdgpu precise-memory} parameter is per-inferior. When an +inferior forks or execs, or the user uses the @code{clone-inferior} command, +and an inferior is created as a result, the newly created inferior inherits +the parameter value of the original inferior. + +@kindex show amdgpu precise-memory +@cindex AMD GPU precise memory event reporting +@item show amdgpu precise-memory +Displays the currently requested AMD GPU precise memory setting. + +@end table + @subsubsection @acronym{AMD GPU} Logging The @samp{set debug amd-dbgapi} command can be used |