Initialization fixes (#154)
- 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
Este cometimento está contido em:
1 ascendente
f03dce5fa6
cometimento
0e535daa93
4 ficheiros modificados
+30
-41
Não existem ficheiros que correspondam à sua pesquisa
@@ -1301,12 +1301,14 @@ rocprofiler_configure(uint32_t version, const char* runtime_version, uint32_t pr
|
||||
_first = false;
|
||||
}
|
||||
|
||||
if(!tim::get_env("ROCPROFSYS_INIT_TOOLING", true)) return nullptr;
|
||||
if(!tim::settings::enabled()) return nullptr;
|
||||
// If ROCPROFSYS_PRELOAD or ROCPROFSYS_INIT_TOOLING is not set,
|
||||
// the tooling will not be initialized so we cannot enable
|
||||
// profiling with rocprofiler
|
||||
if(!tim::get_env("ROCPROFSYS_PRELOAD", true) ||
|
||||
!tim::get_env("ROCPROFSYS_INIT_TOOLING", true))
|
||||
return nullptr;
|
||||
|
||||
if(!rocprofsys::config::settings_are_configured() &&
|
||||
rocprofsys::get_state() < rocprofsys::State::Active)
|
||||
rocprofsys_init_tooling_hidden();
|
||||
if(!tim::settings::enabled()) return nullptr;
|
||||
|
||||
if(!rocprofsys::config::get_use_rocm())
|
||||
{
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador