Skip to content

small wgpu changes #691

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions fastplotlib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
__version__ = f.read().split("\n")[0]

if len(enumerate_adapters()) < 1:
raise IndexError(
from warnings import warn

warn(
f"WGPU could not enumerate any adapters, fastplotlib will not work.\n"
f"This is caused by one of the following:\n"
f"1. You do not have a hardware GPU installed and you do not have "
Expand All @@ -35,5 +37,6 @@
f"common in cloud computing environments.\n"
f"These two links can help you troubleshoot:\n"
f"https://wgpu-py.readthedocs.io/en/stable/start.html#platform-requirements\n"
f"https://fastplotlib.readthedocs.io/en/latest/user_guide/gpu.html\n"
f"https://fastplotlib.readthedocs.io/en/latest/user_guide/gpu.html\n",
RuntimeWarning,
)
4 changes: 2 additions & 2 deletions fastplotlib/utils/gui.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ def _notebook_print_banner():
image = Image(value=logo_data, format="png", width=300, height=55)

# get adapters and info
adapters = [a for a in wgpu.gpu.enumerate_adapters()]
adapters = [a for a in wgpu.gpu.enumerate_adapters_sync()]
adapters_info = [a.info for a in adapters]

default_adapter_info = wgpu.gpu.request_adapter().info
default_adapter_info = wgpu.gpu.request_adapter_sync().info
default_ix = adapters_info.index(default_adapter_info)

if len(adapters) < 1:
Expand Down
Loading