Skip to content
Merged
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
15 changes: 13 additions & 2 deletions python/libcuopt/libcuopt/load.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,23 @@ def load_library():
libcuopt_lib = _load_wheel_installation(soname)
if libcuopt_lib is None:
libcuopt_lib = _load_system_installation(soname)
except OSError:
except OSError as e:
# If none of the searches above succeed, just silently return None
# and rely on other mechanisms (like RPATHs on other DSOs) to
# help the loader find the library.
pass

import warnings

warnings.warn(
f"Failed to load libcuopt library: {soname}. "
f"Error: {str(e)}. "
"Falling back to relying on system loader. "
"cuOpt functionality may be unavailable. "
"This might lead to a generic error such as "
"'libcuopt.so missing' if the library cannot be found.",
RuntimeWarning,
)
pass
# The caller almost never needs to do anything with this library, but no
# harm in offering the option since this object at least provides a handle
# to inspect where libcuopt was loaded from.
Expand Down