From cf2a2939e857bf6a4b0969762890844fa192a97b Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Tue, 1 Apr 2025 14:58:03 -0400 Subject: [PATCH 01/29] feat(libcucim): port libcucim conda-build to rattler-build --- conda/recipes/libcucim/recipe.yaml | 127 +++++++++++++++++++++++++++++ 1 file changed, 127 insertions(+) create mode 100644 conda/recipes/libcucim/recipe.yaml diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml new file mode 100644 index 000000000..5a50185ff --- /dev/null +++ b/conda/recipes/libcucim/recipe.yaml @@ -0,0 +1,127 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +schema_version: 1 + +context: + version: ${{ env.get("RAPIDS_PACKAGE_VERSION") }} + minor_version: ${{ (version | split("."))[:2] | join(".") }} + cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }} + cuda_major: '${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }}' + date_string: '${{ env.get("RAPIDS_DATE_STRING") }}' + py_version: ${{ env.get("RAPIDS_PY_VERSION") }} + py_buildstring: ${{ py_version | version_to_buildstring }} + head_rev: ${{ git.head_rev(".")[:8] }} + linux64: ${{ linux and x86_64 }} + +package: + name: libcucim + version: ${{ version }} + +source: + path: ../../.. + +build: + string: cuda${{ cuda_major }}_py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }} + script: + content: | + CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} + + # CUDA needs to include $PREFIX/include as system include path + export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " + export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" + + # It is assumed that this script is executed from the root of the repo directory by conda-build + # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) + + # Build libcucim core + ./run build_local libcucim ${CUCIM_BUILD_TYPE} ${PREFIX} + + mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include + cp -P -r install/bin/* $PREFIX/bin/ || true + cp -P -r install/lib/* $PREFIX/lib/ || true + cp -P -r install/include/* $PREFIX/include/ || true + + # Build plugins + for plugin_name in cuslide cumed; do + echo "Building cucim.kit.${plugin_name} ..." + ./run build_local ${plugin_name} ${CUCIM_BUILD_TYPE} ${PREFIX} + mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include + cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/bin/* $PREFIX/bin/ || true + cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/lib/* $PREFIX/lib/ || true + done + secrets: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + env: + CMAKE_C_COMPILER_LAUNCHER: ${{ env.get("CMAKE_C_COMPILER_LAUNCHER") }} + CMAKE_CUDA_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CUDA_COMPILER_LAUNCHER") }} + CMAKE_CXX_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CXX_COMPILER_LAUNCHER") }} + CMAKE_GENERATOR: ${{ env.get("CMAKE_GENERATOR") }} + SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET") }} + SCCACHE_IDLE_TIMEOUT: ${{ env.get("SCCACHE_IDLE_TIMEOUT") }} + SCCACHE_REGION: ${{ env.get("SCCACHE_REGION") }} + SCCACHE_S3_USE_SSL: ${{ env.get("SCCACHE_S3_USE_SSL") }} + SCCACHE_S3_NO_CREDENTIALS: ${{ env.get("SCCACHE_S3_NO_CREDENTIALS") }} + SCCACHE_S3_KEY_PREFIX: libcucim/${{ env.get("RAPIDS_CONDA_ARCH") }}/cuda${{ cuda_major }} + +requirements: + build: + - cmake ${{ cmake_version }} + - ninja + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} + - ${{ compiler("cuda") }} + - cuda-version =${{ cuda_version }} + - ${{ stdlib("c") }} + - if: x86_64 + then: yasm + host: + - cuda-version =${{ cuda_version }} + - nvtx-c >=3.1.0 + - openslide + - if: cuda_major == "11" + then: + - libnvjpeg =${{ cuda11_libnvjpeg_host_version }} + - libnvjpeg-dev =${{ cuda11_libnvjpeg_host_version }} + - if: linux64 + then: + - libcufile =${{ cuda11_libcufile_host_version }} + - libcufile-dev =${{ cuda11_libcufile_host_version }} + else: + - cuda-cudart-dev + - libnvjpeg-dev + - libnvjpeg-static + - if: linux64 + then: libcufile-dev + run: + - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} + - if: cuda_major == "11" + then: + - cudatoolkit + - if: linux64 + then: libcufile ${{ cuda11_libcufile_run_version }} + else: + - cuda-cudart + - libnvjpeg + - if: linux64 + then: libcufile + run_constraints: + - ${{ pin_compatible("openslide") }} + ignore_run_exports: + by_name: + - cuda-cudart + - cuda-version + - libcufile + - if: cuda_major == "11" + then: cudatoolkit + +tests: + - python: + imports: + - kvikio + pip_check: false + +about: + homepage: https://developer.nvidia.com/multidimensional-image-processing + license: Apache-2.0 + summary: libcucim C++ library From a2efae25d1a3066f670d7026560ff29176f3494b Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 11:14:45 -0400 Subject: [PATCH 02/29] refactor(cucim): update license in cucim --- python/cucim/pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/cucim/pyproject.toml b/python/cucim/pyproject.toml index 1473cbae4..4027a6a36 100644 --- a/python/cucim/pyproject.toml +++ b/python/cucim/pyproject.toml @@ -21,7 +21,7 @@ readme = { file = "README.md", content-type = "text/markdown" } authors = [ { name = "NVIDIA Corporation" }, ] -license = { text = "Apache 2.0" } +license = { text = "Apache-2.0" } requires-python = ">=3.10" dependencies = [ "click", From 43276d0d07abcc560e7d9f4547d5597b9768b488 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 12:11:22 -0400 Subject: [PATCH 03/29] refactor(libcucim): prefix_detection and overlinking checks --- conda/recipes/libcucim/recipe.yaml | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 5a50185ff..580d93bea 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -21,6 +21,13 @@ source: build: string: cuda${{ cuda_major }}_py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }} + dynamic_linking: + overlinking_behavior: error + prefix_detection: + ignore: + - lib/libcucim.so + - lib/libcucim.so.* + - lib/cucim.*.so script: content: | CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} @@ -112,15 +119,11 @@ requirements: - cuda-cudart - cuda-version - libcufile + - libnvjpeg + - openslide - if: cuda_major == "11" then: cudatoolkit -tests: - - python: - imports: - - kvikio - pip_check: false - about: homepage: https://developer.nvidia.com/multidimensional-image-processing license: Apache-2.0 From 64e195847d3f5e61830b662a62e3cd66c16ff6a6 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 12:46:16 -0400 Subject: [PATCH 04/29] refactor(cucim): port from conda-build to rattler-build --- conda/recipes/cucim/recipe.yaml | 118 ++++++++++++++++++++++++++++++++ 1 file changed, 118 insertions(+) create mode 100644 conda/recipes/cucim/recipe.yaml diff --git a/conda/recipes/cucim/recipe.yaml b/conda/recipes/cucim/recipe.yaml new file mode 100644 index 000000000..298c4fed2 --- /dev/null +++ b/conda/recipes/cucim/recipe.yaml @@ -0,0 +1,118 @@ +# Copyright (c) 2025, NVIDIA CORPORATION. +schema_version: 1 + +context: + version: ${{ env.get("RAPIDS_PACKAGE_VERSION") }} + minor_version: ${{ (version | split("."))[:2] | join(".") }} + cuda_version: ${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[:2] | join(".") }} + cuda_major: '${{ (env.get("RAPIDS_CUDA_VERSION") | split("."))[0] }}' + date_string: '${{ env.get("RAPIDS_DATE_STRING") }}' + py_version: ${{ env.get("RAPIDS_PY_VERSION") }} + py_buildstring: ${{ py_version | version_to_buildstring }} + head_rev: ${{ git.head_rev(".")[:8] }} + linux64: ${{ linux and x86_64 }} + +package: + name: cucim + version: ${{ version }} + +source: + path: ../../.. + +build: + string: cuda${{ cuda_major }}_py${{ py_buildstring }}_${{ date_string }}_${{ head_rev }} + dynamic_linking: + overlinking_behavior: error + prefix_detection: + ignore: + - lib/libcucim.so + - lib/libcucim.so.* + - lib/cucim.*.so + script: + content: | + CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} + + # CUDA needs to include $PREFIX/include as system include path + export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " + export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" + + # It is assumed that this script is executed from the root of the repo directory by conda-build + # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) + ./run build_local cucim ${CUCIM_BUILD_TYPE} + + cp -P python/install/lib/* python/cucim/src/cucim/clara/ + + pushd python/cucim + + python -m pip install --config-settings rapidsai.disable-cuda=true . -vv + + popd + secrets: + - AWS_ACCESS_KEY_ID + - AWS_SECRET_ACCESS_KEY + - AWS_SESSION_TOKEN + env: + CMAKE_C_COMPILER_LAUNCHER: ${{ env.get("CMAKE_C_COMPILER_LAUNCHER") }} + CMAKE_CUDA_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CUDA_COMPILER_LAUNCHER") }} + CMAKE_CXX_COMPILER_LAUNCHER: ${{ env.get("CMAKE_CXX_COMPILER_LAUNCHER") }} + CMAKE_GENERATOR: ${{ env.get("CMAKE_GENERATOR") }} + SCCACHE_BUCKET: ${{ env.get("SCCACHE_BUCKET") }} + SCCACHE_IDLE_TIMEOUT: ${{ env.get("SCCACHE_IDLE_TIMEOUT") }} + SCCACHE_REGION: ${{ env.get("SCCACHE_REGION") }} + SCCACHE_S3_USE_SSL: ${{ env.get("SCCACHE_S3_USE_SSL") }} + SCCACHE_S3_NO_CREDENTIALS: ${{ env.get("SCCACHE_S3_NO_CREDENTIALS") }} + SCCACHE_S3_KEY_PREFIX: cucim/${{ env.get("RAPIDS_CONDA_ARCH") }}/cuda${{ cuda_major }} + +requirements: + build: + - cmake ${{ cmake_version }} + - ninja + - ${{ compiler("c") }} + - ${{ compiler("cxx") }} + - ${{ compiler("cuda") }} + - cuda-version =${{ cuda_version }} + - ${{ stdlib("c") }} + host: + - click + - cuda-version =${{ cuda_version }} + - cupy >=12.0.0 + - libcucim =${{ version }} + - pip + - python =${{ py_version }} + - rapids-build-backend >=0.3.0,<0.4.0.dev0 + - scikit-image >=0.19.0,<0.25.0a0 + - scipy >=1.6 + - setuptools >=61.0.0 + - if: cuda_major != "11" + then: cuda-cudart-dev + run: + - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} + - click + - cupy >=12.0.0 + - lazy_loader >=0.1 + - libcucim =${{ version }} + - numpy >=1.23,<3.0a0 + - python + - scikit-image >=0.19.0,<0.25.0a0 + - scipy >=1.6 + - if: cuda_major != "11" + then: cuda-cudart + run_constraints: + - openslide-python >=1.3.0 + ignore_run_exports: + by_name: + - cuda-cudart + - cuda-version + - if: cuda_major == "11" + then: cudatoolkit + +tests: + - python: + imports: + - cucim + pip_check: False + +about: + homepage: ${{ load_from_file("python/cucim/pyproject.toml").project.urls.Homepage }} + license: ${{ load_from_file("python/cucim/pyproject.toml").project.license.text }} + summary: ${{ load_from_file("python/cucim/pyproject.toml").project.description }} From 50f9ceeee34e01b428d40d07e2f505a9eab944c2 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 12:59:14 -0400 Subject: [PATCH 05/29] ci: switch to `rattler-build` --- ci/build_cpp.sh | 25 ++++++++++++++++++------- ci/build_python.sh | 39 ++++++++++++++++++++++++++------------- 2 files changed, 44 insertions(+), 20 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 57e4c6c46..bc5e3aae8 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -3,8 +3,6 @@ set -euo pipefail -rapids-configure-conda-channels - source rapids-configure-sccache source rapids-date-string @@ -15,14 +13,27 @@ rapids-print-env rapids-logger "Begin cpp build" -# this can be set back to 'prevent' once the xorg-* migrations are completed -# ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 -conda config --set path_conflict warn - sccache --zero-stats -RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry build conda/recipes/libcucim +RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) +export RAPIDS_PACKAGE_VERSION + +source rapids-rattler-channel-string + +# --no-build-id allows for caching with `sccache` +# more info is available at +# https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build +rattler-build build --recipe conda/recipes/libcucim \ + --experimental \ + --no-build-id \ + --channel-priority disabled \ + --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ + "${RATTLER_CHANNELS[@]}" sccache --show-adv-stats +# remove build_cache directory to avoid uploading the entire source tree +# tracked in https://github.com/prefix-dev/rattler-build/issues/1424 +rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache + rapids-upload-conda-to-s3 cpp diff --git a/ci/build_python.sh b/ci/build_python.sh index 20929a5e2..0000a4140 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -3,8 +3,6 @@ set -euo pipefail -rapids-configure-conda-channels - source rapids-configure-sccache source rapids-date-string @@ -15,23 +13,38 @@ rapids-print-env rapids-generate-version > ./VERSION -rapids-logger "Begin py build" - -# this can be set back to 'prevent' once the xorg-* migrations are completed -# ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 -conda config --set path_conflict warn +RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) +export RAPIDS_PACKAGE_VERSION CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) +# populates `RATTLER_CHANNELS` array +source rapids-rattler-channel-string + +rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" + +RATTLER_CHANNELS=("--channel" "${CPP_CHANNEL}" "${RATTLER_CHANNELS[@]}") + sccache --zero-stats -# TODO: Remove `--no-test` flag once importing on a CPU -# node works correctly -RAPIDS_PACKAGE_VERSION=$(head -1 ./VERSION) rapids-conda-retry build \ - --no-test \ - --channel "${CPP_CHANNEL}" \ - conda/recipes/cucim +rapids-logger "Building cucim" + +# TODO: remove `--test skip` when importing on a CPU node works correctly +# --no-build-id allows for caching with `sccache` +# more info is available at +# https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build +rattler-build build --recipe conda/recipes/cucim \ + --experimental \ + --no-build-id \ + --test skip \ + --channel-priority disabled \ + --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ + "${RATTLER_CHANNELS[@]}" sccache --show-adv-stats +# remove build_cache directory to avoid uploading the entire source tree +# tracked in https://github.com/prefix-dev/rattler-build/issues/1424 +rm -rf "$RAPIDS_CONDA_BLD_OUTPUT_DIR"/build_cache + rapids-upload-conda-to-s3 python From 53b2c0f3eabf4d438a734edcbd7982f13b8e1c56 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 13:01:30 -0400 Subject: [PATCH 06/29] chore(conda): remove conda-build meta.yaml and scripts --- conda/recipes/cucim/build.sh | 23 ------- conda/recipes/cucim/meta.yaml | 100 ------------------------------- conda/recipes/libcucim/build.sh | 30 ---------- conda/recipes/libcucim/meta.yaml | 98 ------------------------------ 4 files changed, 251 deletions(-) delete mode 100644 conda/recipes/cucim/build.sh delete mode 100644 conda/recipes/cucim/meta.yaml delete mode 100644 conda/recipes/libcucim/build.sh delete mode 100644 conda/recipes/libcucim/meta.yaml diff --git a/conda/recipes/cucim/build.sh b/conda/recipes/cucim/build.sh deleted file mode 100644 index a66acc30d..000000000 --- a/conda/recipes/cucim/build.sh +++ /dev/null @@ -1,23 +0,0 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. - -CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} - -echo "CC : ${CC}" -echo "CXX : ${CXX}" - -# CUDA needs to include $PREFIX/include as system include path -export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " -export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" - -# It is assumed that this script is executed from the root of the repo directory by conda-build -# (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) -./run build_local cucim ${CUCIM_BUILD_TYPE} - -cp -P python/install/lib/* python/cucim/src/cucim/clara/ - -pushd python/cucim - -echo "PYTHON: ${PYTHON}" -$PYTHON -m pip install --config-settings rapidsai.disable-cuda=true . -vv - -popd diff --git a/conda/recipes/cucim/meta.yaml b/conda/recipes/cucim/meta.yaml deleted file mode 100644 index f7ed9387d..000000000 --- a/conda/recipes/cucim/meta.yaml +++ /dev/null @@ -1,100 +0,0 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. - -{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} -{% set py_version = environ['CONDA_PY'] %} -{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} -{% set cuda_major = cuda_version.split('.')[0] %} -{% set date_string = environ['RAPIDS_DATE_STRING'] %} - - -package: - name: cucim - version: {{ version }} - -source: - path: ../../.. - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - ignore_run_exports_from: - - {{ compiler('cuda') }} - {% if cuda_major != "11" %} - - cuda-cudart-dev - {% endif %} - script_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - - CMAKE_C_COMPILER_LAUNCHER - - CMAKE_CUDA_COMPILER_LAUNCHER - - CMAKE_CXX_COMPILER_LAUNCHER - - CMAKE_GENERATOR - - PARALLEL_LEVEL - - SCCACHE_BUCKET - - SCCACHE_IDLE_TIMEOUT - - SCCACHE_REGION - - SCCACHE_S3_KEY_PREFIX=cucim-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=cucim-linux64 # [linux64] - - SCCACHE_S3_USE_SSL - - SCCACHE_S3_NO_CREDENTIALS - -requirements: - build: - - {{ compiler("c") }} - - {{ compiler("cxx") }} - {% if cuda_major == "11" %} - - {{ compiler('cuda') }} ={{ cuda_version }} - {% else %} - - {{ compiler('cuda') }} - {% endif %} - - cuda-version ={{ cuda_version }} - - cmake {{ cmake_version }} - - make - - ninja - - {{ stdlib("c") }} - host: - - click - - cuda-version ={{ cuda_version }} - {% if cuda_major != "11" %} - - cuda-cudart-dev - {% endif %} - - cupy >=12.0.0 - - libcucim ={{ version }} - - python - - rapids-build-backend >=0.3.0,<0.4.0.dev0 - - scikit-image >=0.19.0,<0.25.0a0 - - scipy >=1.6 - - setuptools >=61.0.0 - run: - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - {% if cuda_major != "11" %} - - cuda-cudart - {% endif %} - - numpy >=1.23,<3.0a0 - - click - - cupy >=12.0.0 - - lazy_loader >=0.1 - - libcucim ={{ version }} - - python - - scikit-image >=0.19.0,<0.25.0a0 - - scipy >=1.6 - run_constrained: - - openslide-python >=1.3.0 - -tests: - requirements: - - cuda-version ={{ cuda_version }} - imports: - - cucim - -about: - home: https://developer.nvidia.com/multidimensional-image-processing - summary: cucim Python package - license: Apache-2.0 - license_family: Apache - license_file: - - LICENSE - - LICENSE-3rdparty.md - doc_url: https://docs.rapids.ai/api/cucim/stable/ - dev_url: https://github.com/rapidsai/cucim diff --git a/conda/recipes/libcucim/build.sh b/conda/recipes/libcucim/build.sh deleted file mode 100644 index d9da2e18d..000000000 --- a/conda/recipes/libcucim/build.sh +++ /dev/null @@ -1,30 +0,0 @@ -# Copyright (c) 2021, NVIDIA CORPORATION. - -CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} - -echo "CC : ${CC}" -echo "CXX : ${CXX}" - -# CUDA needs to include $PREFIX/include as system include path -export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " -export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" - -# It is assumed that this script is executed from the root of the repo directory by conda-build -# (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) - -# Build libcucim core -./run build_local libcucim ${CUCIM_BUILD_TYPE} ${PREFIX} - -mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include -cp -P -r install/bin/* $PREFIX/bin/ || true -cp -P -r install/lib/* $PREFIX/lib/ || true -cp -P -r install/include/* $PREFIX/include/ || true - -# Build plugins -for plugin_name in cuslide cumed; do - echo "Building cucim.kit.${plugin_name} ..." - ./run build_local ${plugin_name} ${CUCIM_BUILD_TYPE} ${PREFIX} - mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include - cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/bin/* $PREFIX/bin/ || true - cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/lib/* $PREFIX/lib/ || true -done diff --git a/conda/recipes/libcucim/meta.yaml b/conda/recipes/libcucim/meta.yaml deleted file mode 100644 index 75b30f7a9..000000000 --- a/conda/recipes/libcucim/meta.yaml +++ /dev/null @@ -1,98 +0,0 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. - -{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} -{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} -{% set cuda_major = cuda_version.split('.')[0] %} -{% set date_string = environ['RAPIDS_DATE_STRING'] %} - - -package: - name: libcucim - version: {{ version }} - -source: - path: ../../.. - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - ignore_run_exports: - - openslide - ignore_run_exports_from: - - {{ compiler('cuda') }} - {% if cuda_major != "11" %} - - cuda-cudart-dev - - libcufile-dev # [linux64] - - libnvjpeg-dev - {% endif %} - script_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - - CMAKE_C_COMPILER_LAUNCHER - - CMAKE_CUDA_COMPILER_LAUNCHER - - CMAKE_CXX_COMPILER_LAUNCHER - - CMAKE_GENERATOR - - PARALLEL_LEVEL - - SCCACHE_BUCKET - - SCCACHE_IDLE_TIMEOUT - - SCCACHE_REGION - - SCCACHE_S3_KEY_PREFIX=libcucim-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=libcucim-linux64 # [linux64] - - SCCACHE_S3_USE_SSL - - SCCACHE_S3_NO_CREDENTIALS - -requirements: - build: - - {{ compiler("c") }} - - {{ compiler("cxx") }} - {% if cuda_major == "11" %} - - {{ compiler('cuda') }} ={{ cuda_version }} - {% else %} - - {{ compiler('cuda') }} - {% endif %} - - cuda-version ={{ cuda_version }} - - binutils - - cmake {{ cmake_version }} - - make - - ninja - - {{ stdlib("c") }} - - yasm # [x86_64] - host: - - cuda-version ={{ cuda_version }} - {% if cuda_major == "11" %} - - libcufile {{ cuda11_libcufile_host_version }} # [linux64] - - libcufile-dev {{ cuda11_libcufile_host_version }} # [linux64] - - libnvjpeg {{ cuda11_libnvjpeg_host_version }} - - libnvjpeg-dev {{ cuda11_libnvjpeg_host_version }} - {% else %} - - cuda-cudart-dev - - libcufile-dev # [linux64] - - libnvjpeg-dev - - libnvjpeg-static - {% endif %} - - nvtx-c >=3.1.0 - - openslide - run: - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - {% if cuda_major == "11" %} - - cudatoolkit - - libcufile {{ cuda11_libcufile_run_version }} # [linux64] - {% else %} - - cuda-cudart - - libcufile # [linux64] - - libnvjpeg - {% endif %} - run_constrained: - - {{ pin_compatible('openslide') }} - -about: - home: https://developer.nvidia.com/multidimensional-image-processing - summary: libcucim C++ library - license: Apache-2.0 - license_family: Apache - license_file: - - LICENSE - - LICENSE-3rdparty.md - doc_url: https://docs.rapids.ai/api/cucim/stable/ - dev_url: https://github.com/rapidsai/cucim From ffee1f2514ec70122ac20df3de255125cf808721 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 13:12:54 -0400 Subject: [PATCH 07/29] fix(libcucim): comment out changes to LD_LIBRARY_PATH --- conda/recipes/libcucim/recipe.yaml | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 580d93bea..19464c6d3 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -30,14 +30,20 @@ build: - lib/cucim.*.so script: content: | + # Remove `-fdebug-prefix-map` line from CFLAGS and CXXFLAGS so the + # incrementing version number in the compile line doesn't break the + # cache + set -x + export CFLAGS=$(echo $CFLAGS | sed -E 's@\-fdebug\-prefix\-map[^ ]*@@g') + export CXXFLAGS=$(echo $CXXFLAGS | sed -E 's@\-fdebug\-prefix\-map[^ ]*@@g') + set +x + + CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} # CUDA needs to include $PREFIX/include as system include path - export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " - export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" - - # It is assumed that this script is executed from the root of the repo directory by conda-build - # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) + # export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " + # export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" # Build libcucim core ./run build_local libcucim ${CUCIM_BUILD_TYPE} ${PREFIX} From 9410b8365d6f1ba6a2242deb9179e91cfa4639c6 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 13:21:07 -0400 Subject: [PATCH 08/29] refactor: add `make` to both recipes --- conda/recipes/cucim/recipe.yaml | 1 + conda/recipes/libcucim/recipe.yaml | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/conda/recipes/cucim/recipe.yaml b/conda/recipes/cucim/recipe.yaml index 298c4fed2..a6a2b0a03 100644 --- a/conda/recipes/cucim/recipe.yaml +++ b/conda/recipes/cucim/recipe.yaml @@ -66,6 +66,7 @@ build: requirements: build: - cmake ${{ cmake_version }} + - make - ninja - ${{ compiler("c") }} - ${{ compiler("cxx") }} diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 19464c6d3..07aee2b21 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -42,8 +42,8 @@ build: CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} # CUDA needs to include $PREFIX/include as system include path - # export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " - # export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" + export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " + export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" # Build libcucim core ./run build_local libcucim ${CUCIM_BUILD_TYPE} ${PREFIX} @@ -80,6 +80,7 @@ build: requirements: build: - cmake ${{ cmake_version }} + - make - ninja - ${{ compiler("c") }} - ${{ compiler("cxx") }} From 7c73eb545920edf4a5a0d5c57cbba4b7cc38ef5a Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Thu, 3 Apr 2025 13:57:27 -0400 Subject: [PATCH 09/29] fix(cuda11): add `cudatoolkit` to `host` --- conda/recipes/libcucim/recipe.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 07aee2b21..75a308062 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -95,6 +95,7 @@ requirements: - openslide - if: cuda_major == "11" then: + - cudatoolkit - libnvjpeg =${{ cuda11_libnvjpeg_host_version }} - libnvjpeg-dev =${{ cuda11_libnvjpeg_host_version }} - if: linux64 From 321d286f0cb6dcb2aceecc0644d22fc278763929 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Tue, 15 Apr 2025 17:19:21 -0400 Subject: [PATCH 10/29] refactor: use strict channel priority --- ci/build_cpp.sh | 6 ++---- ci/build_python.sh | 7 ++----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index bc5e3aae8..e859c9369 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -18,16 +18,14 @@ sccache --zero-stats RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) export RAPIDS_PACKAGE_VERSION +# populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string # --no-build-id allows for caching with `sccache` # more info is available at # https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build rattler-build build --recipe conda/recipes/libcucim \ - --experimental \ - --no-build-id \ - --channel-priority disabled \ - --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ + "${RATTLER_ARGS[@]}" \ "${RATTLER_CHANNELS[@]}" sccache --show-adv-stats diff --git a/ci/build_python.sh b/ci/build_python.sh index 0000a4140..6fc71e90c 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -18,7 +18,7 @@ export RAPIDS_PACKAGE_VERSION CPP_CHANNEL=$(rapids-download-conda-from-s3 cpp) -# populates `RATTLER_CHANNELS` array +# populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" @@ -34,11 +34,8 @@ rapids-logger "Building cucim" # more info is available at # https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build rattler-build build --recipe conda/recipes/cucim \ - --experimental \ - --no-build-id \ --test skip \ - --channel-priority disabled \ - --output-dir "$RAPIDS_CONDA_BLD_OUTPUT_DIR" \ + "${RATTLER_ARGS[@]}" \ "${RATTLER_CHANNELS[@]}" sccache --show-adv-stats From b793065988c78df185df1f96e9002c909b2da23e Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Wed, 16 Apr 2025 09:53:19 -0400 Subject: [PATCH 11/29] chore(libcucim): add binutils to build --- conda/recipes/libcucim/recipe.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 75a308062..ff6ad4936 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -80,6 +80,7 @@ build: requirements: build: - cmake ${{ cmake_version }} + - binutils - make - ninja - ${{ compiler("c") }} From aac3a759f6d187af30a38d6657fc5849cbad6435 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Tue, 1 Jul 2025 14:51:08 -0400 Subject: [PATCH 12/29] chore: update `libcucim` rattler recipe --- .../recipes/libcucim/conda_build_config.yaml | 22 +----- conda/recipes/libcucim/recipe.yaml | 68 +++++++------------ 2 files changed, 29 insertions(+), 61 deletions(-) diff --git a/conda/recipes/libcucim/conda_build_config.yaml b/conda/recipes/libcucim/conda_build_config.yaml index f7372d75d..caf5489e1 100644 --- a/conda/recipes/libcucim/conda_build_config.yaml +++ b/conda/recipes/libcucim/conda_build_config.yaml @@ -1,14 +1,11 @@ c_compiler_version: - - 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] - - 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] + - 13 cxx_compiler_version: - - 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] - - 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] + - 13 cuda_compiler: - - cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] - - nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")] + - cuda-nvcc c_stdlib: - sysroot @@ -18,16 +15,3 @@ c_stdlib_version: cmake_version: - ">=3.30.4" - -# The CTK libraries below are missing from the conda-forge::cudatoolkit package -# for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages -# and the "*_run_*" version specifiers correspond to `11.x` packages. - -cuda11_libcufile_host_version: - - "1.4.0.31" - -cuda11_libcufile_run_version: - - ">=1.0.0.82,<=1.4.0.31" - -cuda11_libnvjpeg_host_version: - - "11.6.0.55" diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index ff6ad4936..247cbfe8f 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -38,28 +38,30 @@ build: export CXXFLAGS=$(echo $CXXFLAGS | sed -E 's@\-fdebug\-prefix\-map[^ ]*@@g') set +x + set -euo pipefail CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} + LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-} # CUDA needs to include $PREFIX/include as system include path export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" # Build libcucim core - ./run build_local libcucim ${CUCIM_BUILD_TYPE} ${PREFIX} + ./run build_local libcucim "${CUCIM_BUILD_TYPE}" "${PREFIX}" - mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include - cp -P -r install/bin/* $PREFIX/bin/ || true - cp -P -r install/lib/* $PREFIX/lib/ || true - cp -P -r install/include/* $PREFIX/include/ || true + mkdir -p "$PREFIX/bin" "$PREFIX/lib" "$PREFIX/include" + cp -P -r install/bin/* "$PREFIX/bin/" || true + cp -P -r install/lib/* "$PREFIX/lib/" || true + cp -P -r install/include/* $"PREFIX/include/" || true # Build plugins for plugin_name in cuslide cumed; do echo "Building cucim.kit.${plugin_name} ..." - ./run build_local ${plugin_name} ${CUCIM_BUILD_TYPE} ${PREFIX} - mkdir -p $PREFIX/bin $PREFIX/lib $PREFIX/include - cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/bin/* $PREFIX/bin/ || true - cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/lib/* $PREFIX/lib/ || true + ./run build_local ${plugin_name} "${CUCIM_BUILD_TYPE}" "${PREFIX}" + mkdir -p "$PREFIX/bin" "$PREFIX/lib" "$PREFIX/include" + cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/bin/* "$PREFIX/bin/" || true + cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/lib/* "$PREFIX/lib/" || true done secrets: - AWS_ACCESS_KEY_ID @@ -79,48 +81,32 @@ build: requirements: build: - - cmake ${{ cmake_version }} - - binutils - - make - - ninja - ${{ compiler("c") }} - - ${{ compiler("cxx") }} - ${{ compiler("cuda") }} - - cuda-version =${{ cuda_version }} + - ${{ compiler("cxx") }} - ${{ stdlib("c") }} + - binutils + - cmake ${{ cmake_version }} + - cuda-version =${{ cuda_version }} + - make + - ninja - if: x86_64 then: yasm host: + - cuda-cudart-dev - cuda-version =${{ cuda_version }} + - libnvjpeg-dev + - libnvjpeg-static - nvtx-c >=3.1.0 - openslide - - if: cuda_major == "11" - then: - - cudatoolkit - - libnvjpeg =${{ cuda11_libnvjpeg_host_version }} - - libnvjpeg-dev =${{ cuda11_libnvjpeg_host_version }} - - if: linux64 - then: - - libcufile =${{ cuda11_libcufile_host_version }} - - libcufile-dev =${{ cuda11_libcufile_host_version }} - else: - - cuda-cudart-dev - - libnvjpeg-dev - - libnvjpeg-static - - if: linux64 - then: libcufile-dev + - if: linux64 + then: libcufile-dev run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - - if: cuda_major == "11" - then: - - cudatoolkit - - if: linux64 - then: libcufile ${{ cuda11_libcufile_run_version }} - else: - - cuda-cudart - - libnvjpeg - - if: linux64 - then: libcufile + - cuda-cudart + - libnvjpeg + - if: linux64 + then: libcufile run_constraints: - ${{ pin_compatible("openslide") }} ignore_run_exports: @@ -130,8 +116,6 @@ requirements: - libcufile - libnvjpeg - openslide - - if: cuda_major == "11" - then: cudatoolkit about: homepage: https://developer.nvidia.com/multidimensional-image-processing From 1431e1f69485f0cd6189593dfd1ef2949dfe00f7 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Tue, 1 Jul 2025 14:54:09 -0400 Subject: [PATCH 13/29] chore: update `cucim` rattler recipe --- conda/recipes/cucim/recipe.yaml | 25 +++++++++++-------------- 1 file changed, 11 insertions(+), 14 deletions(-) diff --git a/conda/recipes/cucim/recipe.yaml b/conda/recipes/cucim/recipe.yaml index a6a2b0a03..74d783a78 100644 --- a/conda/recipes/cucim/recipe.yaml +++ b/conda/recipes/cucim/recipe.yaml @@ -31,14 +31,15 @@ build: script: content: | CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} + LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-} + + set -euo pipefail # CUDA needs to include $PREFIX/include as system include path export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" - # It is assumed that this script is executed from the root of the repo directory by conda-build - # (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) - ./run build_local cucim ${CUCIM_BUILD_TYPE} + ./run build_local cucim "${CUCIM_BUILD_TYPE}" cp -P python/install/lib/* python/cucim/src/cucim/clara/ @@ -65,16 +66,17 @@ build: requirements: build: - - cmake ${{ cmake_version }} - - make - - ninja - ${{ compiler("c") }} - - ${{ compiler("cxx") }} - ${{ compiler("cuda") }} - - cuda-version =${{ cuda_version }} + - ${{ compiler("cxx") }} - ${{ stdlib("c") }} + - cmake ${{ cmake_version }} + - cuda-version =${{ cuda_version }} + - make + - ninja host: - click + - cuda-cudart-dev - cuda-version =${{ cuda_version }} - cupy >=12.0.0 - libcucim =${{ version }} @@ -84,11 +86,10 @@ requirements: - scikit-image >=0.19.0,<0.25.0a0 - scipy >=1.6 - setuptools >=61.0.0 - - if: cuda_major != "11" - then: cuda-cudart-dev run: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} - click + - cuda-cudart - cupy >=12.0.0 - lazy_loader >=0.1 - libcucim =${{ version }} @@ -96,16 +97,12 @@ requirements: - python - scikit-image >=0.19.0,<0.25.0a0 - scipy >=1.6 - - if: cuda_major != "11" - then: cuda-cudart run_constraints: - openslide-python >=1.3.0 ignore_run_exports: by_name: - cuda-cudart - cuda-version - - if: cuda_major == "11" - then: cudatoolkit tests: - python: From 7d5dcd38576095ed10f7e82817b7ce1f2269e3cc Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Tue, 1 Jul 2025 14:54:39 -0400 Subject: [PATCH 14/29] chore: remove conda-build recipe and scripts --- conda/recipes/cucim/build.sh | 27 ---------- conda/recipes/cucim/meta.yaml | 90 -------------------------------- conda/recipes/libcucim/build.sh | 34 ------------ conda/recipes/libcucim/meta.yaml | 80 ---------------------------- 4 files changed, 231 deletions(-) delete mode 100644 conda/recipes/cucim/build.sh delete mode 100644 conda/recipes/cucim/meta.yaml delete mode 100644 conda/recipes/libcucim/build.sh delete mode 100644 conda/recipes/libcucim/meta.yaml diff --git a/conda/recipes/cucim/build.sh b/conda/recipes/cucim/build.sh deleted file mode 100644 index a52e6eb53..000000000 --- a/conda/recipes/cucim/build.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021-2025, NVIDIA CORPORATION. - -set -e -u -o pipefail - -CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} -LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-} - -echo "CC : ${CC}" -echo "CXX : ${CXX}" - -# CUDA needs to include $PREFIX/include as system include path -export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " -export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" - -# It is assumed that this script is executed from the root of the repo directory by conda-build -# (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) -./run build_local cucim "${CUCIM_BUILD_TYPE}" - -cp -P python/install/lib/* python/cucim/src/cucim/clara/ - -pushd python/cucim - -echo "PYTHON: ${PYTHON}" -$PYTHON -m pip install --config-settings rapidsai.disable-cuda=true . -vv - -popd diff --git a/conda/recipes/cucim/meta.yaml b/conda/recipes/cucim/meta.yaml deleted file mode 100644 index c963a8756..000000000 --- a/conda/recipes/cucim/meta.yaml +++ /dev/null @@ -1,90 +0,0 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. - -{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} -{% set py_version = environ['CONDA_PY'] %} -{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} -{% set cuda_major = cuda_version.split('.')[0] %} -{% set date_string = environ['RAPIDS_DATE_STRING'] %} - - -package: - name: cucim - version: {{ version }} - -source: - path: ../../.. - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - ignore_run_exports_from: - - {{ compiler('cuda') }} - - cuda-cudart-dev - script_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - - CMAKE_C_COMPILER_LAUNCHER - - CMAKE_CUDA_COMPILER_LAUNCHER - - CMAKE_CXX_COMPILER_LAUNCHER - - CMAKE_GENERATOR - - PARALLEL_LEVEL - - SCCACHE_BUCKET - - SCCACHE_IDLE_TIMEOUT - - SCCACHE_REGION - - SCCACHE_S3_KEY_PREFIX=cucim-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=cucim-linux64 # [linux64] - - SCCACHE_S3_USE_SSL - - SCCACHE_S3_NO_CREDENTIALS - -requirements: - build: - - {{ compiler("c") }} - - {{ compiler("cxx") }} - - {{ compiler('cuda') }} - - cuda-version ={{ cuda_version }} - - cmake {{ cmake_version }} - - make - - ninja - - {{ stdlib("c") }} - host: - - click - - cuda-version ={{ cuda_version }} - - cuda-cudart-dev - - cupy >=12.0.0 - - libcucim ={{ version }} - - python - - rapids-build-backend >=0.3.0,<0.4.0.dev0 - - scikit-image >=0.19.0,<0.25.0a0 - - scipy >=1.6 - - setuptools >=61.0.0 - run: - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - - cuda-cudart - - numpy >=1.23,<3.0a0 - - click - - cupy >=12.0.0 - - lazy_loader >=0.1 - - libcucim ={{ version }} - - python - - scikit-image >=0.19.0,<0.25.0a0 - - scipy >=1.6 - run_constrained: - - openslide-python >=1.3.0 - -tests: - requirements: - - cuda-version ={{ cuda_version }} - imports: - - cucim - -about: - home: https://developer.nvidia.com/multidimensional-image-processing - summary: cucim Python package - license: Apache-2.0 - license_family: Apache - license_file: - - LICENSE - - LICENSE-3rdparty.md - doc_url: https://docs.rapids.ai/api/cucim/stable/ - dev_url: https://github.com/rapidsai/cucim diff --git a/conda/recipes/libcucim/build.sh b/conda/recipes/libcucim/build.sh deleted file mode 100644 index 504483389..000000000 --- a/conda/recipes/libcucim/build.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -# Copyright (c) 2021-2025, NVIDIA CORPORATION. - -set -e -u -o pipefail - -CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release} -LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-} - -echo "CC : ${CC}" -echo "CXX : ${CXX}" - -# CUDA needs to include $PREFIX/include as system include path -export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include " -export LD_LIBRARY_PATH="$BUILD_PREFIX/lib:$PREFIX/lib:$LD_LIBRARY_PATH" - -# It is assumed that this script is executed from the root of the repo directory by conda-build -# (https://conda-forge.org/docs/maintainer/knowledge_base.html#using-cmake) - -# Build libcucim core -./run build_local libcucim "${CUCIM_BUILD_TYPE}" "${PREFIX}" - -mkdir -p "$PREFIX/bin" "$PREFIX/lib" "$PREFIX/include" -cp -P -r install/bin/* "$PREFIX/bin/" || true -cp -P -r install/lib/* "$PREFIX/lib/" || true -cp -P -r install/include/* "$PREFIX/include/" || true - -# Build plugins -for plugin_name in cuslide cumed; do - echo "Building cucim.kit.${plugin_name} ..." - ./run build_local ${plugin_name} "${CUCIM_BUILD_TYPE}" "${PREFIX}" - mkdir -p "$PREFIX/bin" "$PREFIX/lib" "$PREFIX/include" - cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/bin/* "$PREFIX/bin/" || true - cp -P -r cpp/plugins/cucim.kit.${plugin_name}/install/lib/* "$PREFIX/lib/" || true -done diff --git a/conda/recipes/libcucim/meta.yaml b/conda/recipes/libcucim/meta.yaml deleted file mode 100644 index 73a4bfe73..000000000 --- a/conda/recipes/libcucim/meta.yaml +++ /dev/null @@ -1,80 +0,0 @@ -# Copyright (c) 2021-2023, NVIDIA CORPORATION. - -{% set version = environ['RAPIDS_PACKAGE_VERSION'].lstrip('v') %} -{% set cuda_version = '.'.join(environ['RAPIDS_CUDA_VERSION'].split('.')[:2]) %} -{% set cuda_major = cuda_version.split('.')[0] %} -{% set date_string = environ['RAPIDS_DATE_STRING'] %} - - -package: - name: libcucim - version: {{ version }} - -source: - path: ../../.. - -build: - number: {{ GIT_DESCRIBE_NUMBER }} - string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }} - ignore_run_exports: - - openslide - ignore_run_exports_from: - - {{ compiler('cuda') }} - - cuda-cudart-dev - - libcufile-dev # [linux64] - - libnvjpeg-dev - script_env: - - AWS_ACCESS_KEY_ID - - AWS_SECRET_ACCESS_KEY - - AWS_SESSION_TOKEN - - CMAKE_C_COMPILER_LAUNCHER - - CMAKE_CUDA_COMPILER_LAUNCHER - - CMAKE_CXX_COMPILER_LAUNCHER - - CMAKE_GENERATOR - - PARALLEL_LEVEL - - SCCACHE_BUCKET - - SCCACHE_IDLE_TIMEOUT - - SCCACHE_REGION - - SCCACHE_S3_KEY_PREFIX=libcucim-aarch64 # [aarch64] - - SCCACHE_S3_KEY_PREFIX=libcucim-linux64 # [linux64] - - SCCACHE_S3_USE_SSL - - SCCACHE_S3_NO_CREDENTIALS - -requirements: - build: - - {{ compiler("c") }} - - {{ compiler("cxx") }} - - {{ compiler('cuda') }} - - cuda-version ={{ cuda_version }} - - binutils - - cmake {{ cmake_version }} - - make - - ninja - - {{ stdlib("c") }} - - yasm # [x86_64] - host: - - cuda-version ={{ cuda_version }} - - cuda-cudart-dev - - libcufile-dev # [linux64] - - libnvjpeg-dev - - libnvjpeg-static - - nvtx-c >=3.1.0 - - openslide - run: - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - - cuda-cudart - - libcufile # [linux64] - - libnvjpeg - run_constrained: - - {{ pin_compatible('openslide') }} - -about: - home: https://developer.nvidia.com/multidimensional-image-processing - summary: libcucim C++ library - license: Apache-2.0 - license_family: Apache - license_file: - - LICENSE - - LICENSE-3rdparty.md - doc_url: https://docs.rapids.ai/api/cucim/stable/ - dev_url: https://github.com/rapidsai/cucim From 8b9d4db9bd86752b7abf0ee697c2194c878bc7c3 Mon Sep 17 00:00:00 2001 From: Gil Forsyth Date: Wed, 2 Jul 2025 11:42:36 -0400 Subject: [PATCH 15/29] fix: misplaced quotation mark --- conda/recipes/libcucim/recipe.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 247cbfe8f..2f6725629 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -53,7 +53,7 @@ build: mkdir -p "$PREFIX/bin" "$PREFIX/lib" "$PREFIX/include" cp -P -r install/bin/* "$PREFIX/bin/" || true cp -P -r install/lib/* "$PREFIX/lib/" || true - cp -P -r install/include/* $"PREFIX/include/" || true + cp -P -r install/include/* "$PREFIX/include/" || true # Build plugins for plugin_name in cuslide cumed; do From 71802ee171816e98d9821f2e18e4426de198e5fd Mon Sep 17 00:00:00 2001 From: jakirkham Date: Thu, 25 Jun 2026 11:49:32 -0700 Subject: [PATCH 16/29] Drop unneeded `CPP_CHANNEL` --- ci/build_python.sh | 2 -- 1 file changed, 2 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index ebaca005e..b3c5dbce9 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -28,8 +28,6 @@ sccache --start-server # ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 conda config --set path_conflict warn -CPP_CHANNEL=$(rapids-download-from-github "$(rapids-artifact-name conda_cpp libcucim cucim --cuda "$RAPIDS_CUDA_VERSION")") - rapids-logger "Building cucim" # TODO: remove `--test skip` when importing on a CPU node works correctly From ef5a9fb2014dc64e2048911923425de51a80997f Mon Sep 17 00:00:00 2001 From: jakirkham Date: Thu, 25 Jun 2026 12:19:58 -0700 Subject: [PATCH 17/29] Drop leftover copy-pasta --- conda/recipes/libcucim/recipe.yaml | 7 ------- 1 file changed, 7 deletions(-) diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 97ea70a4b..1aaee4a47 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -103,13 +103,6 @@ requirements: - nvtx-c >=3.1.0 - openslide run: - {% if cuda_major == "12" %} - - {{ pin_compatible('cuda-version', lower_bound='12.2', upper_bound='13.0a0') }} - {% else %} - - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} - {% endif %} - - - cuda-cudart - libcufile - libnvjpeg From dec1858ad6c24aca790a769da727b066f9654c59 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Thu, 25 Jun 2026 17:41:13 -0700 Subject: [PATCH 18/29] Fix nvimgcodec version constraint syntax The variable already contains a range with comparison operators. So adding `=`s in front just causes issues. Hence the `=`s is dropped. --- conda/recipes/libcucim/recipe.yaml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/conda/recipes/libcucim/recipe.yaml b/conda/recipes/libcucim/recipe.yaml index 1aaee4a47..d213455c2 100644 --- a/conda/recipes/libcucim/recipe.yaml +++ b/conda/recipes/libcucim/recipe.yaml @@ -98,7 +98,7 @@ requirements: - cuda-cudart-dev - cuda-version =${{ cuda_version }} - libcufile-dev - - libnvimgcodec-dev =${{ nvimgcodec_version }} # nvImageCodec development headers and libraries + - libnvimgcodec-dev ${{ nvimgcodec_version }} # nvImageCodec development headers and libraries - libnvjpeg-dev - nvtx-c >=3.1.0 - openslide @@ -106,7 +106,7 @@ requirements: - cuda-cudart - libcufile - libnvjpeg - - libnvimgcodec =${{ nvimgcodec_version }} # nvImageCodec metapackage (includes libnvimgcodec0 + run_exports) + - libnvimgcodec ${{ nvimgcodec_version }} # nvImageCodec metapackage (includes libnvimgcodec0 + run_exports) - if: cuda_version >= "13.0" then: - ${{ pin_compatible("cuda-version", upper_bound="x", lower_bound="x") }} @@ -114,7 +114,7 @@ requirements: - ${{ pin_compatible("cuda-version", lower_bound="12.2", upper_bound="13.0a0") }} run_constraints: - ${{ pin_compatible("openslide") }} - - libnvimgcodec-dev =${{ nvimgcodec_version }} # Optional: for development/debugging + - libnvimgcodec-dev ${{ nvimgcodec_version }} # Optional: for development/debugging ignore_run_exports: by_name: - cuda-cudart From d8ed0943f50fc886e039caa2b7546e6d94786a5e Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 17:29:46 -0700 Subject: [PATCH 19/29] Set RAPIDS package version in Python build --- ci/build_python.sh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/ci/build_python.sh b/ci/build_python.sh index b3c5dbce9..c41a87482 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -14,6 +14,9 @@ rapids-print-env rapids-generate-version > ./VERSION +RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) +export RAPIDS_PACKAGE_VERSION + rapids-logger "Begin py build" sccache --stop-server 2>/dev/null || true From 4fd8c8f0e33b4910e052b1ec9739205bc4e073f3 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 17:43:17 -0700 Subject: [PATCH 20/29] Enable experimental for rattler-build This is needed for Jinja like `${{ git.head_rev(".")[:8] }}`, which RAPIDS frequently uses in its package build strings. --- ci/build_cpp.sh | 1 + ci/build_python.sh | 1 + 2 files changed, 2 insertions(+) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 774ada402..4cf6996b4 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -26,6 +26,7 @@ source rapids-rattler-channel-string # more info is available at # https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build rattler-build build --recipe conda/recipes/libcucim \ + --experimental \ "${RATTLER_ARGS[@]}" \ "${RATTLER_CHANNELS[@]}" diff --git a/ci/build_python.sh b/ci/build_python.sh index c41a87482..61009ea78 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -38,6 +38,7 @@ rapids-logger "Building cucim" # more info is available at # https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build rattler-build build --recipe conda/recipes/cucim \ + --experimental \ --test skip \ "${RATTLER_ARGS[@]}" \ "${RATTLER_CHANNELS[@]}" From 98a044fc6a7b454d62dbc36a397c095eeac267af Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 19:43:44 -0700 Subject: [PATCH 21/29] Drop extra `--experimental` from `rattler-build` Looks like this is already being passed in via the rattler environment variable arguments. So drop the extra manual addition from the C++ builds. --- ci/build_cpp.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 4cf6996b4..774ada402 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -26,7 +26,6 @@ source rapids-rattler-channel-string # more info is available at # https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build rattler-build build --recipe conda/recipes/libcucim \ - --experimental \ "${RATTLER_ARGS[@]}" \ "${RATTLER_CHANNELS[@]}" From 1c78cd6ed892dcbb2966660f3b4f1572469f1e44 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 20:29:26 -0700 Subject: [PATCH 22/29] Readd channels for rattler-build & cached C++ pkgs --- ci/build_python.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ci/build_python.sh b/ci/build_python.sh index 61009ea78..0e7088384 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -25,6 +25,14 @@ export SCCACHE_S3_KEY_PREFIX="cucim/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSI export SCCACHE_S3_PREPROCESSOR_CACHE_KEY_PREFIX="cucim/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSION%%.*}/preprocessor-cache" export SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE="true" +# populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array +source rapids-rattler-channel-string + +# Add C++ cached packages to rattler-build's channels +CPP_CHANNEL=$(rapids-download-from-github "$(rapids-artifact-name conda_cpp libcucim cucim --cuda "$RAPIDS_CUDA_VERSION")") +rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" +RATTLER_CHANNELS=("--channel" "${CPP_CHANNEL}" "${RATTLER_CHANNELS[@]}") + sccache --start-server # this can be set back to 'prevent' once the xorg-* migrations are completed From 9f41309faca02397b62d26f66496563a5b2162f5 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 20:43:38 -0700 Subject: [PATCH 23/29] Set `RAPIDS_PACKAGE_VERSION` and use it Make sure `RAPIDS_PACKAGE_VERSION` is always set first and then used for all later steps. This ensures it is available for the recipe to check later as well. --- ci/build_python.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 0e7088384..54306c0ae 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -12,10 +12,9 @@ export CMAKE_GENERATOR=Ninja rapids-print-env -rapids-generate-version > ./VERSION - -RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) +RAPIDS_PACKAGE_VERSION="$(rapids-generate-version)" export RAPIDS_PACKAGE_VERSION +echo "${RAPIDS_PACKAGE_VERSION}" > ./VERSION rapids-logger "Begin py build" From d6d16e4480ff68548e1cc096999c8969eaea53f9 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 20:47:52 -0700 Subject: [PATCH 24/29] Readd sccache bits for C++ build --- ci/build_cpp.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 774ada402..b732ec469 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -14,7 +14,13 @@ rapids-print-env rapids-logger "Begin cpp build" -sccache --zero-stats +sccache --stop-server 2>/dev/null || true + +export SCCACHE_S3_KEY_PREFIX="libcucim/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSION%%.*}/object-cache" +export SCCACHE_S3_PREPROCESSOR_CACHE_KEY_PREFIX="libcucim/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSION%%.*}/preprocessor-cache" +export SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE="true" + +sccache --start-server RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) export RAPIDS_PACKAGE_VERSION From 0ac6c6825b9dd9459d37af4240955c76e3a46bc4 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 20:52:09 -0700 Subject: [PATCH 25/29] Write to VERSION file in C++ build --- ci/build_cpp.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index b732ec469..5354589cc 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -24,6 +24,7 @@ sccache --start-server RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) export RAPIDS_PACKAGE_VERSION +echo "${RAPIDS_PACKAGE_VERSION}" > ./VERSION # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string From 4c156e3c3fce6e0082c9ebdb6aee3bcd742e91ef Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 20:52:26 -0700 Subject: [PATCH 26/29] Readd xorg workaround for clobbering (warn) --- ci/build_cpp.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 5354589cc..63b209e5c 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -22,6 +22,10 @@ export SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE="true" sccache --start-server +# this can be set back to 'prevent' once the xorg-* migrations are completed +# ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 +conda config --set path_conflict warn + RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) export RAPIDS_PACKAGE_VERSION echo "${RAPIDS_PACKAGE_VERSION}" > ./VERSION From 19f14b788e2ff27d0f5414273a9165027f40fb02 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 20:53:21 -0700 Subject: [PATCH 27/29] Reconsolidate `sccache` steps in Python build --- ci/build_python.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 54306c0ae..1c176c6a4 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -24,6 +24,8 @@ export SCCACHE_S3_KEY_PREFIX="cucim/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSI export SCCACHE_S3_PREPROCESSOR_CACHE_KEY_PREFIX="cucim/${RAPIDS_CONDA_ARCH}/cuda${RAPIDS_CUDA_VERSION%%.*}/preprocessor-cache" export SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE="true" +sccache --start-server + # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string @@ -32,8 +34,6 @@ CPP_CHANNEL=$(rapids-download-from-github "$(rapids-artifact-name conda_cpp libc rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" RATTLER_CHANNELS=("--channel" "${CPP_CHANNEL}" "${RATTLER_CHANNELS[@]}") -sccache --start-server - # this can be set back to 'prevent' once the xorg-* migrations are completed # ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 conda config --set path_conflict warn From 5313a032404e9fc3ed95ac46b8f5c0e703ee5cbc Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 20:54:34 -0700 Subject: [PATCH 28/29] Log before building `libcucim` --- ci/build_cpp.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ci/build_cpp.sh b/ci/build_cpp.sh index 63b209e5c..bca3dca28 100755 --- a/ci/build_cpp.sh +++ b/ci/build_cpp.sh @@ -33,6 +33,8 @@ echo "${RAPIDS_PACKAGE_VERSION}" > ./VERSION # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string +rapids-logger "Building libcucim" + # --no-build-id allows for caching with `sccache` # more info is available at # https://rattler.build/latest/tips_and_tricks/#using-sccache-or-ccache-with-rattler-build From 5448cf76cbdd4f57273ae44e9ab4709d3b389130 Mon Sep 17 00:00:00 2001 From: jakirkham Date: Fri, 26 Jun 2026 21:46:50 -0700 Subject: [PATCH 29/29] Consolidate rattler-build channel config --- ci/build_python.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/build_python.sh b/ci/build_python.sh index 1c176c6a4..81971411f 100755 --- a/ci/build_python.sh +++ b/ci/build_python.sh @@ -26,6 +26,10 @@ export SCCACHE_S3_USE_PREPROCESSOR_CACHE_MODE="true" sccache --start-server +# this can be set back to 'prevent' once the xorg-* migrations are completed +# ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 +conda config --set path_conflict warn + # populates `RATTLER_CHANNELS` array and `RATTLER_ARGS` array source rapids-rattler-channel-string @@ -34,10 +38,6 @@ CPP_CHANNEL=$(rapids-download-from-github "$(rapids-artifact-name conda_cpp libc rapids-logger "Prepending channel ${CPP_CHANNEL} to RATTLER_CHANNELS" RATTLER_CHANNELS=("--channel" "${CPP_CHANNEL}" "${RATTLER_CHANNELS[@]}") -# this can be set back to 'prevent' once the xorg-* migrations are completed -# ref: https://github.com/rapidsai/cucim/issues/800#issuecomment-2529593457 -conda config --set path_conflict warn - rapids-logger "Building cucim" # TODO: remove `--test skip` when importing on a CPU node works correctly