SWDEV-368741 - Check for uninstalled hsa-amd-aqlprofile to avoid Segmentation Fault

Change-Id: I0c0c7a2ea7c35237332ddd7c2461e4d9ff8e2f1c


[ROCm/clr commit: 243b86dd23]
This commit is contained in:
cadolphe
2023-10-04 17:07:08 -04:00
کامیت شده توسط Maneesh Gupta
والد f6ea7f732b
کامیت bd399106ae
2فایلهای تغییر یافته به همراه8 افزوده شده و 1 حذف شده
@@ -760,8 +760,10 @@ void OCLPerfCounters::run(void) {
_wrapper->clSetDeviceClockModeAMD(global_device, setClockModeInput,
&setClockModeOutput);
_wrapper->clGetPerfCounterInfoAMD(perfCounter, CL_PERFCOUNTER_DATA,
error_ = _wrapper->clGetPerfCounterInfoAMD(perfCounter, CL_PERFCOUNTER_DATA,
sizeof(cl_ulong), &result, NULL);
CHECK_RESULT(error_ != CL_SUCCESS,
"clGetPerfCounterInfoAMD failed (Hint (Linux): install hsa-amd-aqlprofile)\n");
err = _wrapper->clReleasePerfCounterAMD(perfCounter);
CHECK_RESULT(err != CL_SUCCESS, "Release PerfCounter failed\n");
@@ -3636,6 +3636,11 @@ void VirtualGPU::submitPerfCounter(amd::PerfCounterCommand& vcmd) {
// one to get the profile object
amd::PerfCounter* amdCounter = static_cast<amd::PerfCounter*>(counters[0]);
PerfCounter* counter = static_cast<PerfCounter*>(amdCounter->getDeviceCounter());
if (counter == nullptr) {
LogError("Invalid Performance Counter");
vcmd.setStatus(CL_INVALID_OPERATION);
return;
}
PerfCounterProfile* profileRef = counter->profileRef();
// create the AQL packet for stop profiling