diff --git a/ucp/__init__.py b/ucp/__init__.py index ce9764fa..b8b5c67f 100644 --- a/ucp/__init__.py +++ b/ucp/__init__.py @@ -21,11 +21,19 @@ # Otherwise, we assume that the library was installed in a system path that ld can find. try: import libucx -except (ImportError, OSError, RuntimeError): +except ImportError: pass else: - libucx.load_library() - del libucx + try: + libucx.load_library() + del libucx + except RuntimeError as err: + msg = ( + "Loading 'libucx' failed. Ignore this warning on CPU-only systems, " + "but on a system with GPUs this could indicate a more serious issue. " + f"Full error: {str(err)}" + ) + logger.warning(msg) from .core import * # noqa