Skip to content

Commit

Permalink
openvino: GPU to AUTO fallback on error
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Sep 11, 2024
1 parent 44dcfe5 commit 674034f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions plugins/openvino/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion plugins/openvino/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,5 @@
"devDependencies": {
"@scrypted/sdk": "file:../../sdk"
},
"version": "0.1.113"
"version": "0.1.114"
}
4 changes: 4 additions & 0 deletions plugins/openvino/src/ov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def __init__(self, nativeId: str | None = None):
mode = f"AUTO:NPU,CPU"
elif len(dgpus):
mode = f"AUTO:{','.join(dgpus)},CPU"
# forcing GPU can cause crashes on older GPU.
elif gpu:
mode = f"GPU"

Expand Down Expand Up @@ -214,6 +215,9 @@ def __init__(self, nativeId: str | None = None):
self.storage.removeItem("mode")
self.storage.removeItem("model")
self.storage.removeItem("precision")
if mode == "GPU":
print("GPU mode failed, reverting to AUTO.")
self.storage.setItem("mode", "AUTO")
self.requestRestart()

# mobilenet 1,300,300,3
Expand Down

0 comments on commit 674034f

Please sign in to comment.