Skip to content

OpenVINO™ is an open source toolkit for optimizing and deploying AI inference

[NPU] Get max ext properties version supported by plugin or driver (#29458)

Bogdan Pereanu1f7b841900c1
diff --git a/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp b/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp
index 06500808ff6..4e060689bbc 100644
--- a/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp
+++ b/src/plugins/intel_npu/src/utils/src/zero/zero_init.cpp
@@ -36,13 +36,15 @@ static std::tuple<uint32_t, std::string> queryDriverExtensionVersion(
continue;
}
- if (property.version == extCurrentVersion) {
+ if (property.version >= extCurrentVersion) {
functionExtName = property.name;
- targetVersion = property.version;
+ targetVersion = extCurrentVersion;
break;
}
- // Use the latest version supported by the driver.
+ // Use the latest version supported by the driver - We need to go through all the properties for older drivers
+ // that use specific names for different graph ext versions, e.g.: ZE_extension_graph_1_1,
+ // ZE_extension_graph_1_2
if (property.version > targetVersion) {
functionExtName = property.name;
targetVersion = property.version;
@@ -210,24 +212,12 @@ ZeroInitStructsHolder::ZeroInitStructsHolder()
OPENVINO_THROW("queryGraphExtensionVersion: Failed to find Graph extension in NPU Driver");
}
- // Use version that plugin can support as identifier to control workflow
- if (graph_ext_version > target_graph_ext_version) {
- log.warning("Graph extension version from driver is %d.%d. "
- "Larger than plugin max graph ext version %d.%d. "
- "Force to use plugin ext version with the new table to control flow!",
- ZE_MAJOR_VERSION(graph_ext_version),
- ZE_MINOR_VERSION(graph_ext_version),
- ZE_MAJOR_VERSION(target_graph_ext_version),
- ZE_MINOR_VERSION(target_graph_ext_version));
- graph_ext_version = target_graph_ext_version;
- }
-
- const uint16_t supported_driver_ext_major_version = 1;
+ const uint16_t supported_driver_ext_major_version = ZE_MAJOR_VERSION(target_graph_ext_version);
const uint16_t driver_ext_major_version = ZE_MAJOR_VERSION(graph_ext_version);
if (supported_driver_ext_major_version != driver_ext_major_version) {
- OPENVINO_THROW("Plugin supports only driver with extension major version ",
+ OPENVINO_THROW("Plugin supports only driver with graph extension major version ",
supported_driver_ext_major_version,
- "; discovered driver extension has major version ",
+ "; discovered driver graph extension has major version ",
driver_ext_major_version);
}