diff --git a/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc b/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc index 76be8758a37a1..a27beae0c8dc6 100644 --- a/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc +++ b/onnxruntime/core/providers/qnn/builder/qnn_backend_manager.cc @@ -279,7 +279,7 @@ Status QnnBackendManager::InitializeQnnLog() { } } - ORT_RETURN_IF(QNN_BACKEND_NO_ERROR != result, "Failed to initialize logging in the QNN backend"); + ORT_RETURN_IF(QNN_BACKEND_NO_ERROR != result, "Failed to initialize logging in the QNN backend. Error: ", QnnErrorHandleToString(result)); return Status::OK(); } @@ -320,7 +320,7 @@ Status QnnBackendManager::UpdateQnnLogLevel(logging::Severity ort_log_level) { LOGS(*logger_, ERROR) << "Invalid log handle provided to QnnLog_setLogLevel."; } } - ORT_RETURN_IF(QNN_BACKEND_NO_ERROR != result, "Failed to set log level in Qnn backend"); + ORT_RETURN_IF(QNN_BACKEND_NO_ERROR != result, "Failed to set log level in Qnn backend. Error: ", QnnErrorHandleToString(result)); return Status::OK(); } @@ -566,7 +566,7 @@ std::unique_ptr QnnBackendManager::GetContextBinaryBuffer(uint6 // Generate all graphs in one single context Qnn_ErrorHandle_t rt = qnn_interface_.contextGetBinarySize(contexts_[0], &required_buffer_size); if (QNN_CONTEXT_NO_ERROR != rt) { - LOGS(*logger_, ERROR) << "Failed to get QNN context binary size. Error code: " << rt; + LOGS(*logger_, ERROR) << "Failed to get QNN context binary size. Error: " << QnnErrorHandleToString(rt); return nullptr; } @@ -581,7 +581,7 @@ std::unique_ptr QnnBackendManager::GetContextBinaryBuffer(uint6 required_buffer_size, &written_buffer_size); if (QNN_CONTEXT_NO_ERROR != rt) { - LOGS(*logger_, ERROR) << "Failed to get context binary."; + LOGS(*logger_, ERROR) << "Failed to get context binary. Error: " << QnnErrorHandleToString(rt); return nullptr; } diff --git a/onnxruntime/core/providers/qnn/builder/qnn_model.cc b/onnxruntime/core/providers/qnn/builder/qnn_model.cc index 503943dfb636b..22ab28d0fa560 100644 --- a/onnxruntime/core/providers/qnn/builder/qnn_model.cc +++ b/onnxruntime/core/providers/qnn/builder/qnn_model.cc @@ -368,8 +368,8 @@ Status QnnModel::DeserializeGraphInfoFromBinaryInfo(const QnnSystemContext_Graph } Qnn_GraphHandle_t graph; auto qnn_interface = qnn_backend_manager_->GetQnnInterface(); - auto rt = qnn_interface.graphRetrieve(context, graph_name.c_str(), &graph); - ORT_RETURN_IF(QNN_SUCCESS != rt, "Failed to retrieve QNN graph."); + Qnn_ErrorHandle_t rt = qnn_interface.graphRetrieve(context, graph_name.c_str(), &graph); + ORT_RETURN_IF(QNN_SUCCESS != rt, "Failed to retrieve QNN graph. Error: ", QnnErrorHandleToString(rt)); graph_info_ = std::make_unique(graph, graph_name, diff --git a/onnxruntime/core/providers/qnn/builder/qnn_model_wrapper.cc b/onnxruntime/core/providers/qnn/builder/qnn_model_wrapper.cc index f85cdc401a152..96b3a5223f70b 100644 --- a/onnxruntime/core/providers/qnn/builder/qnn_model_wrapper.cc +++ b/onnxruntime/core/providers/qnn/builder/qnn_model_wrapper.cc @@ -39,7 +39,7 @@ bool QnnModelWrapper::CreateQnnGraph(const Qnn_ContextHandle_t& context, if (rt != QNN_GRAPH_NO_ERROR || graph_ == nullptr) { rt = qnn_interface_.graphRetrieve(context, graph_name_.c_str(), &graph_); if (rt != QNN_GRAPH_NO_ERROR || graph_ == nullptr) { - LOGS(logger_, ERROR) << "Failed to create Qnn graph: " << graph_name; + LOGS(logger_, ERROR) << "Failed to create Qnn graph: " << graph_name << " Error: " << QnnErrorHandleToString(rt); return false; } }