diff --git a/src/runtime_src/core/common/smi.cpp b/src/runtime_src/core/common/smi.cpp index 0640c959b1..2aec39d4ac 100644 --- a/src/runtime_src/core/common/smi.cpp +++ b/src/runtime_src/core/common/smi.cpp @@ -46,30 +46,7 @@ const tuple_vector& smi_base:: get_validate_test_desc() const { - static const tuple_vector validate_test_desc = { - {"aie-reconfig-overhead", "Run end-to-end array reconfiguration overhead through shim DMA", "hidden"}, - {"all", "All applicable validate tests will be executed (default)", "common"}, - {"cmd-chain-latency", "Run end-to-end latency test using command chaining", "common"}, - {"cmd-chain-throughput", "Run end-to-end throughput test using command chaining", "common"}, - {"df-bw", "Run bandwidth test on data fabric", "common"}, - {"gemm", "Measure the TOPS value of GEMM operations", "common"}, - {"latency", "Run end-to-end latency test", "common"}, - {"quick", "Run a subset of four tests: \n1. latency \n2. throughput \n3. cmd-chain-latency \n4. cmd-chain-throughput", "common"}, - {"spatial-sharing-overhead", "Run Spatial Sharing Overhead Test", "hidden"}, - {"tct-all-col", "Measure average TCT processing time for all columns", "common"}, - {"tct-one-col", "Measure average TCT processing time for one column", "common"}, - {"temporal-sharing-overhead", "Run Temporal Sharing Overhead Test", "hidden"}, - {"throughput", "Run end-to-end throughput test", "common"}, - {"aux-connection", "Check if auxiliary power is connected", "common"}, - {"dma", "Run dma test", "common"}, - {"thostmem-bw", "Run 'bandwidth kernel' when host memory is enabled", "common"}, - {"m2m", "Run M2M test", "common"}, - {"mem-bw", "Run 'bandwidth kernel' and check the throughput", "common"}, - {"p2p", "Run P2P test", "common"}, - {"pcie-link", "Check if PCIE link is active", "common"}, - {"sc-version","Check if SC firmware is up-to-date", "common"}, - {"verify", "Run 'Hello World' kernel test", "common"} - }; + static const tuple_vector validate_test_desc = {}; return validate_test_desc; } @@ -78,24 +55,7 @@ smi_base:: get_examine_report_desc() const { static const tuple_vector examine_report_desc = { - {"aie-partitions", "AIE partition information", "common"}, - {"host", "Host information", "common"}, - {"platform", "Platforms flashed on the device", "common"}, - {"telemetry", "Telemetry data for the device", "common"}, - {"aie", "AIE metadata in xclbin", "common"}, - {"aiemem", "AIE memory tile information", "common"}, - {"aieshim", "AIE shim tile status", "common"}, - {"debug-ip-status", "Status of Debug IPs present in xclbin loaded on device", "common"}, - {"dynamic-regions", "Information about the xclbin and the compute units", "common"}, - {"electrical", "Electrical and power sensors present on the device", "common"}, - {"error", "Asyncronus Error present on the device", "common"}, - {"firewall", "Firewall status", "common"}, - {"mailbox", "Mailbox metrics of the device", "common"}, - {"mechanical", "Mechanical sensors on and surrounding the device", "common"}, - {"memory", "Memory information present on the device", "common"}, - {"pcie-info", "Pcie information of the device", "common"}, - {"qspi-status", "QSPI write protection status", "common"}, - {"thermal", "Thermal sensors present on the device", "common"} + {"host", "Host information", "common"} }; return examine_report_desc; } diff --git a/src/runtime_src/core/tools/common/XBMain.cpp b/src/runtime_src/core/tools/common/XBMain.cpp index 8703b261d2..5fb269ef61 100644 --- a/src/runtime_src/core/tools/common/XBMain.cpp +++ b/src/runtime_src/core/tools/common/XBMain.cpp @@ -187,18 +187,28 @@ void main_(int argc, char** argv, * instead of xrt-smi. * If the device is not found, then load the default xrt-smi config. */ - std::shared_ptr device; boost::property_tree::ptree configTreeMain; std::string config; - try { - device = XBU::get_device(boost::algorithm::to_lower_copy(sDevice), isUserDomain); - } catch (...) { - device = nullptr; + + boost::property_tree::ptree available_devices = XBU::get_available_devices(isUserDomain); + + if (available_devices.empty()) //no device + config = xrt_core::smi::get_smi_config(); + else if (available_devices.size() == 1 || !sDevice.empty()) { //1 device + auto device = XBU::get_device(boost::algorithm::to_lower_copy(sDevice), isUserDomain); + config = xrt_core::device_query(device, xrt_core::query::xrt_smi_config::type::options_config); } - if (device) + else { //multiple devices + std::string dev; + for (auto& kd : available_devices) { + boost::property_tree::ptree& devpt = kd.second; + dev = devpt.get("bdf"); + } + std::cout << (boost::format("NOTE: Multiple devices found. Showing help for %s device\n\n") % dev).str(); + auto device = XBU::get_device(boost::algorithm::to_lower_copy(dev), isUserDomain); config = xrt_core::device_query(device, xrt_core::query::xrt_smi_config::type::options_config); - else - config = xrt_core::smi::get_smi_config(); + } + std::istringstream command_config_stream(config); boost::property_tree::read_json(command_config_stream, configTreeMain); subCommand->setOptionConfig(configTreeMain);