From 3ae1ae0f55ad4699aeb0d670d94512d93bc00c35 Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Thu, 16 Jan 2025 01:48:02 -0500 Subject: [PATCH 1/3] fix deprecated wgpu calls --- fastplotlib/utils/gui.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fastplotlib/utils/gui.py b/fastplotlib/utils/gui.py index a8a79920f..6a0d8dfdc 100644 --- a/fastplotlib/utils/gui.py +++ b/fastplotlib/utils/gui.py @@ -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: From e264b85ec5e6100fdf8cd4ba9f80f86823357b1e Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Thu, 16 Jan 2025 01:53:42 -0500 Subject: [PATCH 2/3] show a warning instead of raising an exception if no WGPU adapter exists --- fastplotlib/__init__.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/fastplotlib/__init__.py b/fastplotlib/__init__.py index 2f3c35a1a..c0cbc9cf3 100644 --- a/fastplotlib/__init__.py +++ b/fastplotlib/__init__.py @@ -24,7 +24,8 @@ __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 " @@ -35,5 +36,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, ) From 78e0743e06513da0d26b07b6bbc8d70765a4e718 Mon Sep 17 00:00:00 2001 From: kushalkolar Date: Thu, 16 Jan 2025 01:57:02 -0500 Subject: [PATCH 3/3] black --- fastplotlib/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/fastplotlib/__init__.py b/fastplotlib/__init__.py index c0cbc9cf3..9cc8d8432 100644 --- a/fastplotlib/__init__.py +++ b/fastplotlib/__init__.py @@ -25,6 +25,7 @@ if len(enumerate_adapters()) < 1: 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"