Skip to content

Commit

Permalink
CR-1214311 Fix xrt-smi validate crash on Alveo (Xilinx#8472)
Browse files Browse the repository at this point in the history
* CR-1214311 Catch no_such_query in device updates

Signed-off-by: Ryan Chane <[email protected]>

* CR-1214311 Fix Windows build errors

Signed-off-by: Ryan Chane <[email protected]>

---------

Signed-off-by: Ryan Chane <[email protected]>
  • Loading branch information
rchane authored Oct 2, 2024
1 parent 3900d9a commit 6ba2335
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/runtime_src/core/tools/xbutil2/SubCmdValidate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,6 +717,9 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const
xrt_core::device_update<xrt_core::query::performance_mode>(device.get(), xrt_core::query::performance_mode::power_type::performance);
}
}
catch (const xrt_core::query::no_such_key&) {
// Do nothing, as performance mode setting is not supported
}
catch(const xrt_core::error& e) {
std::cerr << boost::format("\nERROR: %s\n") % e.what();
printHelp();
Expand All @@ -726,8 +729,12 @@ SubCmdValidate::execute(const SubCmdOptions& _options) const
std::ostringstream oSchemaOutput;
bool has_failures = run_tests_on_devices(device, schemaVersion, testObjectsToRun, oSchemaOutput);

//reset pmode
xrt_core::device_update<xrt_core::query::performance_mode>(device.get(), static_cast<xrt_core::query::performance_mode::power_type>(curr_mode));
try {
//reset pmode
xrt_core::device_update<xrt_core::query::performance_mode>(device.get(), static_cast<xrt_core::query::performance_mode::power_type>(curr_mode));
} catch (const xrt_core::query::no_such_key&) {
// Do nothing, as performance mode setting is not supported
}

// -- Write output file ----------------------------------------------
if (!m_output.empty()) {
Expand Down

0 comments on commit 6ba2335

Please sign in to comment.