reports KFD core dump support through hsakmt API

Member added to KFDVersion to report if KFD supports core dump
mechanism. This is done through hsaKmtRuntimeEnable API call while
the topology is being built. It also dictates if core dump will be
generated by either KFD or hsa-runtime.

Signed-off-by: Alex Sierra <alex.sierra@amd.com>
Change-Id: I2e9d4166563402f78613d728446feb692c52d9d1


[ROCm/ROCR-Runtime commit: 54604654bd]
This commit is contained in:
Alex Sierra
2023-02-16 16:32:23 -06:00
committed by Alejandro Sierra Guiza
parent ba0e2d3664
commit 4370aa1364
2 changed files with 7 additions and 2 deletions
@@ -124,6 +124,7 @@ class Runtime {
HsaVersionInfo version;
bool supports_exception_debugging;
bool supports_event_age;
bool supports_core_dump;
};
/// @brief Open connection to kernel driver and increment reference count.
@@ -451,8 +452,9 @@ class Runtime {
kfd_version.supports_event_age = true;
}
void KfdVersion(bool exception_debugging) {
void KfdVersion(bool exception_debugging, bool core_dump) {
kfd_version.supports_exception_debugging = exception_debugging;
kfd_version.supports_core_dump = core_dump;
}
KfdVersion_t KfdVersion() const { return kfd_version; }
@@ -417,7 +417,10 @@ bool Load() {
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);
HSAuint32 caps_mask;
hsaKmtGetRuntimeCapabilities(&caps_mask);
core::Runtime::runtime_singleton_->KfdVersion(err != HSAKMT_STATUS_NOT_SUPPORTED,
!!(caps_mask & HSA_RUNTIME_ENABLE_CAPS_SUPPORTS_CORE_DUMP_MASK));
kfd.Dismiss();
return true;