mirror of
https://github.com/saymrwulf/onnxruntime.git
synced 2026-06-11 00:49:31 +00:00
[QNN EP] Clean up correctly from a partial setup (#23320)
### Description Fix bug in previous change where a failure during `SetupBackend` causes `ReleaseResources `to be called to clean up but does nothing because `backend_setup_completed_ ` is false. `backend_setup_completed_ ` _seems_ to now be redundant so removing it fixes the problem. ### Motivation and Context We are seeing crashes due to the log callback failing to be de-registered
This commit is contained in:
parent
ab59e9e31e
commit
5d215ff810
1 changed files with 6 additions and 10 deletions
|
|
@ -1097,39 +1097,35 @@ Status QnnBackendManager::TerminateQnnLog() {
|
|||
}
|
||||
|
||||
void QnnBackendManager::ReleaseResources() {
|
||||
if (!backend_setup_completed_) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto result = ReleaseContext();
|
||||
if (Status::OK() != result) {
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext.";
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ReleaseContext: " << result.ErrorMessage();
|
||||
}
|
||||
|
||||
result = ReleaseProfilehandle();
|
||||
if (Status::OK() != result) {
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle.";
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ReleaseProfilehandle: " << result.ErrorMessage();
|
||||
}
|
||||
|
||||
result = ReleaseDevice();
|
||||
if (Status::OK() != result) {
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice.";
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ReleaseDevice: " << result.ErrorMessage();
|
||||
}
|
||||
|
||||
result = ShutdownBackend();
|
||||
if (Status::OK() != result) {
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend.";
|
||||
LOGS_DEFAULT(ERROR) << "Failed to ShutdownBackend: " << result.ErrorMessage();
|
||||
}
|
||||
|
||||
result = TerminateQnnLog();
|
||||
if (Status::OK() != result) {
|
||||
LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog.";
|
||||
LOGS_DEFAULT(ERROR) << "Failed to TerminateQnnLog: " << result.ErrorMessage();
|
||||
}
|
||||
|
||||
if (backend_lib_handle_) {
|
||||
result = UnloadLib(backend_lib_handle_);
|
||||
if (Status::OK() != result) {
|
||||
LOGS_DEFAULT(ERROR) << "Failed to unload backend library.";
|
||||
LOGS_DEFAULT(ERROR) << "Failed to unload backend library: " << result.ErrorMessage();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue