The gpu backends each used a bare 255 as the sentinel for a
not-yet-initialized context id. Define InvalidGpuContextId (-1) in
TracyQueue.hpp and replace the scattered 255s and their asserts
with it.
Id exhaustion is handled by an error message and an assert in the
new NextGpuContextId() getter. Non-assert builds continue execution,
at which point they are no longer valid. Handling this code path
is out of scope here. Various attempts at handling the exhaustion
problem have been otherwise purged from the API implementations.
Without this, a late-connecting client receives the deferred
GpuNewContext but not the GpuContextName, so the GPU context appears
unnamed in the profiler.
Add check_gpu_ctx_name tool to verify context names in captured traces.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Two issues prevented the rocprofiler GPU backend from working with
TRACY_ON_DEMAND:
1. GpuNewContext not deferred: When a Tracy client connects late (on-demand
mode), it never receives the GPU context creation message because the
GpuNewContext queue item was not buffered via DeferItem. This caused an
assertion failure (ctx == nullptr) in the capture/profiler when
processing GPU zone events. Add the same DeferItem pattern used by the
CUDA backend.
2. Kernel symbols dropped before init: The data->init guard at the top of
tool_callback_tracing_callback() blocked kernel symbol registrations
(CODE_OBJECT_DEVICE_KERNEL_SYMBOL_REGISTER) which happen at HIP init
time, before any Tracy client connects. Move the init guard after the
code_object block so symbols are always recorded, while dispatch and
memory-copy events are still gated on initialization.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This provides some instructions and tips for the manual. Also:
* Made the calibration feature a CMake option
* Cleaned up some minor code issues
* Fixed an issue with the calibration
* Incremented patch number
Synchronizes the GPU timeline periodically. This is needed to counter
network time updates that cause drift in the GPU and CPU timeline.
Signed-off-by: Eric Eaton <erieaton@amd.com>