Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 04be32e

Browse filesBrowse files
authored
small wgpu changes (#691)
* fix deprecated wgpu calls * show a warning instead of raising an exception if no WGPU adapter exists * black
1 parent 962c9ba commit 04be32e
Copy full SHA for 04be32e

File tree

2 files changed

+7
-4
lines changed
Filter options

2 files changed

+7
-4
lines changed

‎fastplotlib/__init__.py

Copy file name to clipboardExpand all lines: fastplotlib/__init__.py
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
__version__ = f.read().split("\n")[0]
2525

2626
if len(enumerate_adapters()) < 1:
27-
raise IndexError(
27+
from warnings import warn
28+
29+
warn(
2830
f"WGPU could not enumerate any adapters, fastplotlib will not work.\n"
2931
f"This is caused by one of the following:\n"
3032
f"1. You do not have a hardware GPU installed and you do not have "
@@ -35,5 +37,6 @@
3537
f"common in cloud computing environments.\n"
3638
f"These two links can help you troubleshoot:\n"
3739
f"https://wgpu-py.readthedocs.io/en/stable/start.html#platform-requirements\n"
38-
f"https://fastplotlib.readthedocs.io/en/latest/user_guide/gpu.html\n"
40+
f"https://fastplotlib.readthedocs.io/en/latest/user_guide/gpu.html\n",
41+
RuntimeWarning,
3942
)

‎fastplotlib/utils/gui.py

Copy file name to clipboardExpand all lines: fastplotlib/utils/gui.py
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,10 +59,10 @@ def _notebook_print_banner():
5959
image = Image(value=logo_data, format="png", width=300, height=55)
6060

6161
# get adapters and info
62-
adapters = [a for a in wgpu.gpu.enumerate_adapters()]
62+
adapters = [a for a in wgpu.gpu.enumerate_adapters_sync()]
6363
adapters_info = [a.info for a in adapters]
6464

65-
default_adapter_info = wgpu.gpu.request_adapter().info
65+
default_adapter_info = wgpu.gpu.request_adapter_sync().info
6666
default_ix = adapters_info.index(default_adapter_info)
6767

6868
if len(adapters) < 1:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.