From 3a2615f5aa101fd2a50bd0b9ca1b900b37bd91a8 Mon Sep 17 00:00:00 2001 From: kjayapra-amd Date: Thu, 6 Jul 2023 20:32:11 -0400 Subject: [PATCH] SWDEV-408889 - Add the logging message back that will print devices without COs from Bundle. Change-Id: Ie6f95d5e9bafe6c3db192419e4d8829053cc8b65 --- hipamd/src/hip_fatbin.cpp | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/hipamd/src/hip_fatbin.cpp b/hipamd/src/hip_fatbin.cpp index 56bca305da..af7542c4c8 100644 --- a/hipamd/src/hip_fatbin.cpp +++ b/hipamd/src/hip_fatbin.cpp @@ -52,6 +52,16 @@ FatBinaryInfo::~FatBinaryInfo() { uri_ = std::string(); } +void ListAllDeviceWithNoCOFromBundle(const std::unordered_map> unique_isa_names) { + LogError("Missing CO for these ISAs - "); + for (const auto& unique_isa : unique_isa_names) { + if (unique_isa.second.first == 0) { + LogPrintfError(" %s", unique_isa.first.c_str()); + } + } +} + hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vector& devices) { amd_comgr_data_t data_object; amd_comgr_status_t comgr_status = AMD_COMGR_STATUS_SUCCESS; @@ -184,6 +194,13 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectordevices()[0]->isa().isaName(); auto dev_it = unique_isa_names.find(device_name); + // If the size is 0, then COMGR API could not find the CO for this GPU device/ISA + if (dev_it->second.first == 0) { + LogPrintfError("Cannot find CO in the bundle for ISA: %s \n", device_name); + hip_status = hipErrorNoBinaryForGpu; + ListAllDeviceWithNoCOFromBundle(unique_isa_names); + break; + } guarantee(unique_isa_names.cend() != dev_it, "Cannot find the device name in the unique device name"); fatbin_dev_info_[devices[dev_idx]->deviceId()] @@ -194,6 +211,11 @@ hipError_t FatBinaryInfo::ExtractFatBinaryUsingCOMGR(const std::vectorasContext()); } + if ((comgr_status = amd_comgr_release_data(data_object)) != AMD_COMGR_STATUS_SUCCESS) { + LogPrintfError("Releasing COMGR data failed with status %d ", comgr_status); + return hipErrorInvalidValue; + } + } while(0); if (query_list_array) {