From 31bdb15911a3cd847806e69bb28f8ef716224d44 Mon Sep 17 00:00:00 2001 From: "Mads R. B. Kristensen" Date: Thu, 31 Oct 2024 16:15:58 +0100 Subject: [PATCH] debug --- ci/test_wheel.sh | 12 ++++++++---- dependencies.yaml | 26 ++++++++++++++++++++++++++ python/kvikio/kvikio/__init__.py | 12 ++++++++++++ python/kvikio/pyproject.toml | 1 + 4 files changed, 47 insertions(+), 4 deletions(-) diff --git a/ci/test_wheel.sh b/ci/test_wheel.sh index 94a31b04b6..2a060fa05f 100755 --- a/ci/test_wheel.sh +++ b/ci/test_wheel.sh @@ -4,9 +4,13 @@ set -eou pipefail RAPIDS_PY_CUDA_SUFFIX="$(rapids-wheel-ctk-name-gen ${RAPIDS_CUDA_VERSION})" -WHEELHOUSE="${PWD}/dist/" -RAPIDS_PY_WHEEL_NAME="kvikio_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python "${WHEELHOUSE}" -python -m pip install "$(echo ${WHEELHOUSE}/kvikio_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" +# Download the libkvikio and kvikio built in the previous step +RAPIDS_PY_WHEEL_NAME="libkvikio_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 cpp ./dist +RAPIDS_PY_WHEEL_NAME="kvikio_${RAPIDS_PY_CUDA_SUFFIX}" rapids-download-wheels-from-s3 python ./dist -python -m pytest ./python/kvikio/tests +python -m pip install -v \ + "$(echo ./dist/libkvikio_${RAPIDS_PY_CUDA_SUFFIX}*.whl)" \ + "$(echo ./dist/kvikio_${RAPIDS_PY_CUDA_SUFFIX}*.whl)[test]" + +python -m pytest -v ./python/kvikio/tests diff --git a/dependencies.yaml b/dependencies.yaml index ae99fb5d83..b80ed69337 100644 --- a/dependencies.yaml +++ b/dependencies.yaml @@ -64,6 +64,7 @@ files: includes: - depends_on_cupy - depends_on_nvcomp + - depends_on_libkvikio - run py_rapids_build_libkvikio: output: pyproject @@ -282,6 +283,31 @@ dependencies: - matrix: packages: - nvidia-nvcomp==4.1.0.6 + depends_on_libkvikio: + common: + - output_types: conda + packages: + - &libkvikio_unsuffixed libkvikio==24.12.*,>=0.0.0a0 + - output_types: requirements + packages: + # pip recognizes the index as a global option for the requirements.txt file + # This index is needed for libkvikio-cu{11,12}. + - --extra-index-url=https://pypi.nvidia.com + - --extra-index-url=https://pypi.anaconda.org/rapidsai-wheels-nightly/simple + specific: + - output_types: [requirements, pyproject] + matrices: + - matrix: + cuda: "12.*" + cuda_suffixed: "true" + packages: + - libkvikio-cu12==24.12.*,>=0.0.0a0 + - matrix: + cuda: "11.*" + cuda_suffixed: "true" + packages: + - libkvikio-cu11==24.12.*,>=0.0.0a0 + - {matrix: null, packages: [*libkvikio_unsuffixed]} docs: common: - output_types: [conda, requirements] diff --git a/python/kvikio/kvikio/__init__.py b/python/kvikio/kvikio/__init__.py index 9ddd24e0b2..349f7be427 100644 --- a/python/kvikio/kvikio/__init__.py +++ b/python/kvikio/kvikio/__init__.py @@ -3,9 +3,19 @@ # If libkvikio was installed as a wheel, we must request it to load the library symbols. # Otherwise, we assume that the library was installed in a system path that ld can find. + +try: + from nvidia import nvcomp +except ModuleNotFoundError: + print("nvidia.nvcomp: not found!") + pass +else: + del nvcomp + try: import libkvikio except ModuleNotFoundError: + print("libkvikio: not found!") pass else: libkvikio.load_library() @@ -26,4 +36,6 @@ "CuFile", "RemoteFile", "is_remote_file_available", + "libkvikio", + "nvcomp", ] diff --git a/python/kvikio/pyproject.toml b/python/kvikio/pyproject.toml index b30437cec0..bdfda864b6 100644 --- a/python/kvikio/pyproject.toml +++ b/python/kvikio/pyproject.toml @@ -20,6 +20,7 @@ license = { text = "Apache 2.0" } requires-python = ">=3.10" dependencies = [ "cupy-cuda11x>=12.0.0", + "libkvikio==24.12.*,>=0.0.0a0", "numcodecs !=0.12.0", "numpy>=1.23,<3.0a0", "nvidia-nvcomp==4.1.0.6",