Skip to content

Commit

Permalink
call getLatestBuildError when pfn-related function is called on backend
Browse files Browse the repository at this point in the history
  • Loading branch information
ShaojieZhuIntel committed Sep 24, 2024
1 parent db57945 commit 24779ef
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
1 change: 1 addition & 0 deletions src/plugins/intel_npu/src/backend/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ target_link_libraries(${TARGET_NAME}
PRIVATE
openvino::npu_al
openvino_npu_zero_result_parser
openvino_npu_driver_compiler_adapter
ze_loader
)

Expand Down
17 changes: 13 additions & 4 deletions src/plugins/intel_npu/src/backend/src/zero_executor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,14 @@
#include "intel_npu/al/prefix.hpp"
#include "openvino/runtime/properties.hpp"
#include "ze_command_queue_npu_ext.h"
#include "zero_compiler_in_driver.hpp"
#include "zero_device.hpp"
#include "zero_utils.hpp"

using namespace intel_npu;

driverCompilerAdapter::LevelZeroCompilerInDriver levelZeroCiD;

ZeroExecutor::ZeroExecutor(const std::shared_ptr<const ZeroInitStructsHolder>& initStructs,
const std::shared_ptr<const NetworkDescription>& networkDescription,
const Config& config,
Expand Down Expand Up @@ -70,7 +73,8 @@ ZeroExecutor::ZeroExecutor(const std::shared_ptr<const ZeroInitStructsHolder>& i

zeroUtils::throwOnFail(
"pfnCreate",
_graph_ddi_table_ext.pfnCreate(_initStructs->getContext(), _initStructs->getDevice(), &desc, &_graph));
_graph_ddi_table_ext.pfnCreate(_initStructs->getContext(), _initStructs->getDevice(), &desc, &_graph),
levelZeroCiD.getLatestBuildError());

} else {
_logger.debug("reuse graph handle created from compiler");
Expand All @@ -79,7 +83,9 @@ ZeroExecutor::ZeroExecutor(const std::shared_ptr<const ZeroInitStructsHolder>& i

OV_ITT_TASK_NEXT(ZERO_EXECUTOR_GRAPH, "pfnGetProperties");
_logger.debug("performing pfnGetProperties");
zeroUtils::throwOnFail("pfnGetProperties", _graph_ddi_table_ext.pfnGetProperties(_graph, &_props));
zeroUtils::throwOnFail("pfnGetProperties",
_graph_ddi_table_ext.pfnGetProperties(_graph, &_props),
levelZeroCiD.getLatestBuildError());
auto targetDriverExtVersion = _graph_ddi_table_ext.version();
if (targetDriverExtVersion <= ZE_GRAPH_EXT_VERSION_1_1) {
OPENVINO_THROW("Incompatibility between the NPU plugin and driver! The driver version is too old, please "
Expand All @@ -91,7 +97,8 @@ ZeroExecutor::ZeroExecutor(const std::shared_ptr<const ZeroInitStructsHolder>& i
for (uint32_t index = 0; index < _props.numGraphArgs; ++index) {
ze_graph_argument_properties_3_t arg3;
zeroUtils::throwOnFail("pfnGetArgumentProperties3",
_graph_ddi_table_ext.pfnGetArgumentProperties3(_graph, index, &arg3));
_graph_ddi_table_ext.pfnGetArgumentProperties3(_graph, index, &arg3),
levelZeroCiD.getLatestBuildError());

if (arg3.type == ZE_GRAPH_ARGUMENT_TYPE_INPUT) {
_input_descriptors.push_back(ArgumentDescriptor{arg3, index});
Expand Down Expand Up @@ -135,7 +142,9 @@ void ZeroExecutor::setWorkloadType(const ov::WorkloadType workloadType) const {
}

void ZeroExecutor::setArgumentValue(uint32_t argi_, const void* argv_) const {
zeroUtils::throwOnFail("zeGraphSetArgumentValue", _graph_ddi_table_ext.pfnSetArgumentValue(_graph, argi_, argv_));
zeroUtils::throwOnFail("zeGraphSetArgumentValue",
_graph_ddi_table_ext.pfnSetArgumentValue(_graph, argi_, argv_),
levelZeroCiD.getLatestBuildError());
}

void ZeroExecutor::mutexLock() const {
Expand Down

0 comments on commit 24779ef

Please sign in to comment.