SWDEV-540576 - Abort if user request a core dump (#653)

* SWDEV-539414 - Return error status from runtime handler when HIP_SKIP_ABORT_ON_GPU_ERROR is false

* SWDEV-539414 - default handler when GPU core file is generated

* SWDEV-540576 - Abort if user request a core dump

Change-Id: I9e2c640acf559880bd13641de9103e660ef822a3

---------

Co-authored-by: Assiouras, Ioannis <Ioannis.Assiouras@amd.com>
Co-authored-by: agunashe <ajay.gunashekar@amd.com>

[ROCm/clr commit: 9c1bff0ae7]
This commit is contained in:
Xie, Pengda
2025-07-02 11:59:14 -07:00
کامیت شده توسط GitHub
والد 19007f7015
کامیت 8e5921174f
@@ -56,13 +56,14 @@
#include <iostream>
#include <iomanip>
#include <memory>
#include <sys/resource.h>
#ifdef ROCCLR_SUPPORT_NUMA_POLICY
#include <numa.h>
#include <numaif.h>
#endif // ROCCLR_SUPPORT_NUMA_POLICY
#include <sstream>
#include <vector>
#endif // WITHOUT_HSA_BaCKEND
#endif // WITHOUT_HSA_BACKEND
#define OPENCL_VERSION_STR XSTR(OPENCL_MAJOR) "." XSTR(OPENCL_MINOR)
#define OPENCL_C_VERSION_STR XSTR(OPENCL_C_MAJOR) "." XSTR(OPENCL_C_MINOR)
@@ -3446,12 +3447,14 @@ hsa_status_t Device::BackendErrorCallBackHandler(const hsa_amd_event_t* event, v
break;
}
if (HIP_SKIP_ABORT_ON_GPU_ERROR) {
gpu_error_ = gpu_error;
} else {
abort();
// Execute the default handler if a GPU core file should be generated ...
struct rlimit rlimit;
if ((getrlimit(RLIMIT_CORE, &rlimit) == 0 && rlimit.rlim_cur != 0) ||
!HIP_SKIP_ABORT_ON_GPU_ERROR) {
return HSA_STATUS_ERROR;
}
gpu_error_ = gpu_error;
return HSA_STATUS_SUCCESS;
}
@@ -3674,11 +3677,12 @@ void callbackQueue(hsa_status_t status, hsa_queue_t* queue, void* data) {
errorMsg, status);
}
if (HIP_SKIP_ABORT_ON_GPU_ERROR) {
amd::Device::gpu_error_ = ConvertHSAErrorIntoCLError(status);
} else {
struct rlimit rlimit;
if ((getrlimit(RLIMIT_CORE, &rlimit) == 0 && rlimit.rlim_cur != 0) ||
!HIP_SKIP_ABORT_ON_GPU_ERROR) {
abort();
}
amd::Device::gpu_error_ = ConvertHSAErrorIntoCLError(status);
}
}