From 8d8b762e0ecfeecff798c561b90db0df77648024 Mon Sep 17 00:00:00 2001 From: Stephane Rigaud Date: Thu, 21 Nov 2024 14:08:41 +0100 Subject: [PATCH] set error at backend initialisation not device --- pyclesperanto/_core.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pyclesperanto/_core.py b/pyclesperanto/_core.py index a1ef34ac..28f8e473 100644 --- a/pyclesperanto/_core.py +++ b/pyclesperanto/_core.py @@ -130,6 +130,12 @@ def select_backend(backend: str = "opencl") -> str: BackendManager.set_backend(backend=backend) # reset current device to default one select_device() + + if _current_device._instance is None: + raise RuntimeError( + "No device available. Please check your system installation." + ) + return f"{BackendManager.get_backend()} selected."