Skip to content

Commit

Permalink
openvino: improve device selection
Browse files Browse the repository at this point in the history
  • Loading branch information
koush committed Aug 30, 2024
1 parent 51f893e commit 7104ad6
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 11 deletions.
2 changes: 1 addition & 1 deletion plugins/openvino/.vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
},
{
"localRoot": "${workspaceFolder}/src",
"remoteRoot": "${config:scrypted.pythonRemoteRoot}"
"remoteRoot": "."
},

]
Expand Down
10 changes: 5 additions & 5 deletions plugins/openvino/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@

{
// docker installation
"scrypted.debugHost": "scrypted-demo",
"scrypted.serverRoot": "/server",
// "scrypted.debugHost": "scrypted-demo",
// "scrypted.serverRoot": "/server",

// proxmox installation
// "scrypted.debugHost": "scrypted-server",
// "scrypted.serverRoot": "/root/.scrypted",
"scrypted.debugHost": "scrypted-server",
"scrypted.serverRoot": "/root/.scrypted",

// pi local installation
// "scrypted.debugHost": "192.168.2.119",
Expand All @@ -18,7 +18,7 @@
// "scrypted.debugHost": "koushik-winvm",
// "scrypted.serverRoot": "C:\\Users\\koush\\.scrypted",

"scrypted.pythonRemoteRoot": "${config:scrypted.serverRoot}/volume/plugin.zip",
"scrypted.pythonRemoteRoot": "${config:scrypted.serverRoot}/volume",
"python.analysis.extraPaths": [
"./node_modules/@scrypted/sdk/types/scrypted_python"
]
Expand Down
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.109"
"version": "0.1.110"
}
17 changes: 15 additions & 2 deletions plugins/openvino/src/ov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def __init__(self, nativeId: str | None = None):
nvidia = False
iris_xe = False
arc = False
npu = False
gpu = False

dgpus = []
# search for NVIDIA dGPU, as that is not preferred by AUTO for some reason?
Expand All @@ -116,15 +118,26 @@ def __init__(self, nativeId: str | None = None):
if "NVIDIA" in full_device_name and "dGPU" in full_device_name:
dgpus.append(device)
nvidia = True
if "NPU" in device:
npu = True
if "GPU" in device:
gpu = True
except:
pass

mode = self.storage.getItem("mode")
if mode == "Default":
mode = "AUTO"

if len(dgpus):
if npu:
if gpu:
mode = f"AUTO:NPU,GPU,CPU"
else:
mode = f"AUTO:NPU,CPU"
elif len(dgpus):
mode = f"AUTO:{','.join(dgpus)},CPU"
elif gpu:
mode = f"GPU"

mode = mode or "AUTO"
self.mode = mode
Expand All @@ -137,7 +150,7 @@ def __init__(self, nativeId: str | None = None):
if model == "Default" or model not in availableModels:
if model != "Default":
self.storage.setItem("model", "Default")
if arc or nvidia:
if arc or nvidia or npu:
model = "scrypted_yolov9c_320"
elif iris_xe:
model = "scrypted_yolov9s_320"
Expand Down

0 comments on commit 7104ad6

Please sign in to comment.