diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index f0afcd1159..23f3a13392 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -1,5 +1,5 @@ #!/bin/bash -# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2023-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 set -euo pipefail @@ -16,6 +16,17 @@ mkdir -p "${RAPIDS_TESTS_DIR}" # dependencies that can be installed later on when installing the wheel rapids-generate-pip-constraints test_python "${PIP_CONSTRAINT}" +python -m venv libcuml-env +. libcuml-env/bin/activate + +rapids-pip-retry install \ + -v \ + --prefer-binary \ + --constraint "${PIP_CONSTRAINT}" \ + "${LIBCUML_WHEELHOUSE}"/libcuml*.whl +python -c "import libcuml; assert (libraries := libcuml.load_library()) and all(libraries)" +deactivate + # notes: # # * just providing --constraint="${PIP_CONSTRAINT}" to be explicit, and because diff --git a/python/libcuml/libcuml/load.py b/python/libcuml/libcuml/load.py index 5e4a793756..5cbe58490a 100644 --- a/python/libcuml/libcuml/load.py +++ b/python/libcuml/libcuml/load.py @@ -1,4 +1,4 @@ -# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION. +# SPDX-FileCopyrightText: Copyright (c) 2025-2026, NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 # @@ -36,7 +36,7 @@ def _load_wheel_installation(soname: str): def load_library(): """Dynamically load libcuml.so and its dependencies""" try: - # These libraries must all be loaded before libcuml + # These libraries must all be loaded before libcuml, in dependency order import libcuvs import libnvforest import libraft @@ -44,10 +44,10 @@ def load_library(): import rapids_logger rapids_logger.load_library() - libcuvs.load_library() - libnvforest.load_library() librmm.load_library() libraft.load_library() + libcuvs.load_library() + libnvforest.load_library() except ModuleNotFoundError: # These runtime dependencies might be satisfied by conda packages (which do not # have any Python modules) instead of wheels. In that situation, assume that