Skip to content

Commit

Permalink
Catch all the exceptions when firmware version is not present. (#8505)
Browse files Browse the repository at this point in the history
Signed-off-by: Manoj Takasi <[email protected]>
Co-authored-by: Manoj Takasi <[email protected]>
  • Loading branch information
ManojTakasi and Manoj Takasi authored Oct 8, 2024
1 parent acf8e76 commit ab21783
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/runtime_src/core/tools/common/XBUtilities.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -762,11 +762,17 @@ fill_xrt_versions(const boost::property_tree::ptree& pt_xrt,
if (boost::iequals(drv_name, "xclmgmt") && boost::iequals(driver.get<std::string>("version", "N/A"), "unknown"))
output << "WARNING: xclmgmt version is unknown. Is xclmgmt driver loaded? Or is MSD/MPD running?" << std::endl;
}
if (!available_devices.empty()) {
const boost::property_tree::ptree& dev = available_devices.begin()->second;
if (dev.get<std::string>("device_class") == xrt_core::query::device_class::enum_to_str(xrt_core::query::device_class::type::ryzen))
output << boost::format(" %-20s : %s\n") % "NPU Firmware Version" % available_devices.begin()->second.get<std::string>("firmware_version");
else
output << boost::format(" %-20s : %s\n") % "Firmware Version" % available_devices.begin()->second.get<std::string>("firmware_version");

try {
if (!available_devices.empty()) {
const boost::property_tree::ptree& dev = available_devices.begin()->second;
if (dev.get<std::string>("device_class") == xrt_core::query::device_class::enum_to_str(xrt_core::query::device_class::type::ryzen))
output << boost::format(" %-20s : %s\n") % "NPU Firmware Version" % available_devices.begin()->second.get<std::string>("firmware_version");
else
output << boost::format(" %-20s : %s\n") % "Firmware Version" % available_devices.begin()->second.get<std::string>("firmware_version");
}
}
catch (...) {
//no device available
}
}

0 comments on commit ab21783

Please sign in to comment.