Skip to content

Commit

Permalink
openvino: add nvidia dgpu support
Browse files Browse the repository at this point in the history
  • Loading branch information
Koushik Dutta authored and Koushik Dutta committed May 2, 2024
1 parent e9722d3 commit 0cfef48
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 6 deletions.
10 changes: 5 additions & 5 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.79"
"version": "0.1.80"
}
16 changes: 16 additions & 0 deletions plugins/openvino/src/ov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ def __init__(self, nativeId: str | None = None):
mode = self.storage.getItem("mode")
if mode == "Default":
mode = "AUTO"

dgpus = []
# search for NVIDIA dGPU, as that is not preferred by AUTO for some reason?
# todo: create separate core per NVIDIA dGPU as inference does not seem to
# be distributed to multiple dGPU.
for device in self.available_devices:
try:
full_device_name = self.core.get_property(device, "FULL_DEVICE_NAME")
if "NVIDIA" in full_device_name and "dGPU" in full_device_name:
dgpus.append(device)
except:
pass

if len(dgpus):
mode = f"AUTO:{','.join(dgpus)},CPU"

mode = mode or "AUTO"
self.mode = mode

Expand Down

0 comments on commit 0cfef48

Please sign in to comment.