- Remove tooling initialization from rocprofiler_configure:
when rocprofiler configure is called from __hip_module_ctor
(which in turn is called as a global constructor when loading shared
libraries or before main in a hip program), initializing tooling
in it can cause problems because it is too early to do some of the tasks
that it involves (e.g. opening shared libraries, creating threads).
Instead, we rely on rocprofsys_main to initialize tooling later.

- Skip rocprofiler_configure if ROCPROFSYS_PRELOAD is not set since
preload is required for tooling (such as perfetto, which is used by
the rocprofiler callbacks) to be initialized.

- Revert RCCL initialization changes: These are no longer needed since rocprofsys_init_tooling_hidden will not
be called from rocprofiler_configure

- Force rocprofiler_configure in rocprofsys_init_tooling_hidden if it hasn't been
called through __hip_module_ctor global constructor
Цей коміт міститься в:
Sohaib Nadeem
2025-04-21 17:04:24 -04:00
зафіксовано GitHub
джерело f03dce5fa6
коміт 0e535daa93
4 змінених файлів з 30 додано та 41 видалено
+1 -1
Переглянути файл
@@ -95,7 +95,7 @@ extern "C"
// these are the real implementations for internal calling convention
void rocprofsys_init_library_hidden(void) ROCPROFSYS_HIDDEN_API;
bool rocprofsys_init_tooling_hidden(bool postinit = false) ROCPROFSYS_HIDDEN_API;
bool rocprofsys_init_tooling_hidden(void) ROCPROFSYS_HIDDEN_API;
void rocprofsys_init_hidden(const char*, bool, const char*) ROCPROFSYS_HIDDEN_API;
void rocprofsys_finalize_hidden(void) ROCPROFSYS_HIDDEN_API;
void rocprofsys_reset_preload_hidden(void) ROCPROFSYS_HIDDEN_API;