Check for debug support after parsing topology
Thunk keeps an internal cache of system topology that can be used to speed up subsequent calls to hsaKmtAcquireSystemProperties(). This cache is cleared by calling hsaKmtReleaseSystemProperties() at the beginning of BuildTopology(). hsaKmtRuntimeEnable() also calls hsaKmtAcquireSystemProperties() inside Thunk. Move call to hsaKmtRuntimeEnable() after BuildTopology() so that we can re-use Thunks internal cache. Parsing of of topology can take ~150 ms on systems for large number of nodes. Change-Id: I741709d49d67d244f5fbd707fe8f01ab923bb153
이 커밋은 다음에 포함됨:
1 부모
8751e65b79
커밋
e39ad34d9c
1 파일이 변경됨
+9
-3
@@ -374,15 +374,21 @@ bool Load() {
|
||||
}
|
||||
MAKE_NAMED_SCOPE_GUARD(kfd, [&]() { hsaKmtCloseKFD(); });
|
||||
|
||||
// Build topology table.
|
||||
BuildTopology();
|
||||
|
||||
// Register runtime and optionally enable the debugger
|
||||
// BuildTopology calls hsaKmtAcquireSystemProperties() causes libhsakmt to cache topology
|
||||
// information. So we need to call hsaKmtRuntimeEnable() after calling BuildTopology() so that
|
||||
// Thunk can re-use it's cached copy instead of re-parsing whole system topology. Otherwise
|
||||
// BuildTopology will cause libhsakmt to destroyed cached copy because it calls
|
||||
// hsaKmtReleaseSystemProperties() at the beginning.
|
||||
|
||||
HSAKMT_STATUS err =
|
||||
hsaKmtRuntimeEnable(&_amdgpu_r_debug, core::Runtime::runtime_singleton_->flag().debug());
|
||||
if ((err != HSAKMT_STATUS_SUCCESS) && (err != HSAKMT_STATUS_NOT_SUPPORTED)) return false;
|
||||
core::Runtime::runtime_singleton_->KfdVersion(err != HSAKMT_STATUS_NOT_SUPPORTED);
|
||||
|
||||
// Build topology table.
|
||||
BuildTopology();
|
||||
|
||||
kfd.Dismiss();
|
||||
return true;
|
||||
}
|
||||
|
||||
새 이슈에서 참조
사용자 차단