Skip to content

Commit 9979810

Browse files
committed
If not find npu_driver_compiler, rollback to npu_mlir_compiler with vcl
Signed-off-by: Xin Wang <[email protected]>
1 parent 2e0d376 commit 9979810

File tree

2 files changed

+18
-2
lines changed

2 files changed

+18
-2
lines changed

src/plugins/intel_npu/src/compiler_adapter/include/vcl_api.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ class VCLApi {
5454

5555
private:
5656
std::shared_ptr<void> lib;
57+
Logger _logger;
5758
};
5859

5960
#define vcl_symbol_statement(vcl_symbol) \

src/plugins/intel_npu/src/compiler_adapter/src/vcl_api.cpp

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,18 +11,33 @@
1111
#include "openvino/util/shared_object.hpp"
1212

1313
namespace intel_npu {
14-
VCLApi::VCLApi() {
14+
VCLApi::VCLApi() : _logger("VCLApi", ov::log::Level::DEBUG) {
1515
const std::string baseName = "npu_driver_compiler";
1616
try {
1717
auto libpath = ov::util::make_plugin_library_name({}, baseName);
18+
_logger.debug("Try to load npu_driver_compiler");
1819

1920
#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
2021
this->lib = ov::util::load_shared_object(ov::util::string_to_wstring(libpath).c_str());
2122
#else
2223
this->lib = ov::util::load_shared_object(libpath.c_str());
2324
#endif
2425
} catch (const std::runtime_error& error) {
25-
OPENVINO_THROW(error.what());
26+
// OPENVINO_THROW(error.what());
27+
try {
28+
_logger.error("Failed to load npu_driver_compiler: %s", error.what());
29+
_logger.debug("Try to load npu_mlir_compiler with VCL interface");
30+
const std::string rollBackName = "npu_mlir_compiler";
31+
auto libpath = ov::util::make_plugin_library_name({}, rollBackName);
32+
33+
#if defined(OPENVINO_ENABLE_UNICODE_PATH_SUPPORT) && defined(_WIN32)
34+
this->lib = ov::util::load_shared_object(ov::util::string_to_wstring(libpath).c_str());
35+
#else
36+
this->lib = ov::util::load_shared_object(libpath.c_str());
37+
#endif
38+
} catch (const std::runtime_error& error) {
39+
OPENVINO_THROW("Failed to load npu_mlir_compiler with VCL interface: ", error.what());
40+
}
2641
}
2742

2843
try {

0 commit comments

Comments
 (0)