Skip to content

Commit

Permalink
update the GPU searching function in multi GPUs (#2021)
Browse files Browse the repository at this point in the history
The original code works well in single GPU mode, and will work wrong in
Multi GPUs mode, so I update the code from
```
if "GPU" not in core.available_devices:
```
to
```
if any('GPU' in device for device in core.available_devices) == False:
```

---------

Co-authored-by: dlod-openvino <dlod-openvino@163.com>
  • Loading branch information
openvino-book and dlod-openvino authored May 17, 2024
1 parent 7252965 commit 33e5fef
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions notebooks/auto-device/auto-device.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"\n",
"core = ov.Core()\n",
"\n",
"if \"GPU\" not in core.available_devices:\n",
"if not any('GPU' in device for device in core.available_devices):\n",
" display(\n",
" Markdown(\n",
" '<div class=\"alert alert-block alert-danger\"><b>Warning: </b> A GPU device is not available. This notebook requires GPU device to have meaningful results. </div>'\n",
Expand Down Expand Up @@ -367,7 +367,7 @@
}
],
"source": [
"if \"GPU\" not in core.available_devices:\n",
"if not any('GPU' in device for device in core.available_devices):\n",
" print(f\"A GPU device is not available. Available devices are: {core.available_devices}\")\n",
"else:\n",
" # Start time.\n",
Expand Down

0 comments on commit 33e5fef

Please sign in to comment.