Skip to content
Merged
Show file tree
Hide file tree
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
25 changes: 24 additions & 1 deletion ci/build_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,29 @@ conda config --set path_conflict warn

sccache --zero-stats

RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry build conda/recipes/libcucim

# TODO: Remove when CUDA 12.1 is dropped.
# In most cases, the CTK has cuFile.
# However the CTK only added cuFile for ARM in 12.2.
# So for ARM users on CTK 12.0 & 12.1, relax the cuFile requirement.
# On x86_64 or CTK 13 or ARM with CTK 12.2+, always require cuFile.
cat > extra_variants.yaml <<EOF
has_cufile:
- True
EOF
if [[ "$(arch)" == "aarch64" ]] && [[ "${RAPIDS_CUDA_VERSION%%.*}" == "12" ]]
then
cat >> extra_variants.yaml <<EOF
- False
EOF
fi
Comment on lines +30 to +39
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like the current logic will have both in the aarch64+CUDA12 case?

has_cufile:
  - True
  -  False
Suggested change
cat > extra_variants.yaml <<EOF
has_cufile:
- True
EOF
if [[ "$(arch)" == "aarch64" ]] && [[ "${RAPIDS_CUDA_VERSION%%.*}" == "12" ]]
then
cat >> extra_variants.yaml <<EOF
- False
EOF
fi
if [[ "$(arch)" == "aarch64" ]] && [[ "${RAPIDS_CUDA_VERSION%%.*}" == "12" ]]; then
cat > extra_variants.yaml <<EOF
has_cufile:
- False
EOF
else
cat > extra_variants.yaml <<EOF
has_cufile:
- True
EOF
fi

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me commit this and see if it helps

Copy link
Member Author

@jakirkham jakirkham Sep 18, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes this is intended. We want to build once for each of these values, which is what the original logic does

Also for CUDA 13+ or x86_64 builds we want this to only be True

The CI failure is due to something else unrelated to this syntax. Please see this comment: #930 (comment)

Have gone ahead and restored the original logic. Though happy to chat more if you have additional questions 🙂


echo 'Contents of `extra_variants.yaml`:'
cat extra_variants.yaml
echo ''

RAPIDS_PACKAGE_VERSION=$(rapids-generate-version) rapids-conda-retry build \
-m extra_variants.yaml \
conda/recipes/libcucim

sccache --show-adv-stats
2 changes: 1 addition & 1 deletion conda/recipes/cucim/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ source:

build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_py{{ py_version }}_{{ date_string }}_gh{{ GIT_DESCRIBE_HASH }}_gn{{ GIT_DESCRIBE_NUMBER }}}_ph{{ PKG_HASH }}
ignore_run_exports_from:
- {{ compiler('cuda') }}
- cuda-cudart-dev
Expand Down
13 changes: 10 additions & 3 deletions conda/recipes/libcucim/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@ source:

build:
number: {{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_{{ GIT_DESCRIBE_HASH }}_{{ GIT_DESCRIBE_NUMBER }}
string: cuda{{ cuda_major }}_{{ date_string }}_gh{{ GIT_DESCRIBE_HASH }}_gn{{ GIT_DESCRIBE_NUMBER }}}_ph{{ PKG_HASH }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we are building for two different variants of has_cufile, the package hash will change. However the rest of these values stay the same for each variant build. As a result the package name would be the same unless we add the package hash, which we do here

ignore_run_exports:
- openslide
ignore_run_exports_from:
- {{ compiler('cuda') }}
- cuda-cudart-dev
- libcufile-dev # [linux64]
- libcufile-dev
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We want to ignore the run_exports_from libcufile-dev in all cases where it is used as we already constrain the version via cuda-version

This avoids overly tight version constraints that otherwise cause solver errors when testing CUDA 12.9 packages on CUDA 12.0

- libnvjpeg-dev
script_env:
- AWS_ACCESS_KEY_ID
Expand Down Expand Up @@ -60,9 +60,16 @@ requirements:
- nvtx-c >=3.1.0
- openslide
run:
{% if aarch64 and cuda_major == "12" %}
# Relax `libcufile` dependency for old CUDA 12 ARM installs
- {{ pin_compatible('cuda-version', lower_bound='12.0', upper_bound='12.2') }} # [not has_cufile]
- {{ pin_compatible('cuda-version', lower_bound='12.2', upper_bound='13.0') }} # [has_cufile]
- libcufile # [has_cufile]
{% else %}
Comment on lines +63 to +68
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures ARM packages that support CUDA 12.2+ still depend io cuFile whereas packages that require CUDA 12.0 or 12.1 packages on ARM don't require cuFile (as it is not given in this case)

- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
- cuda-cudart
- libcufile
{% endif %}
- cuda-cudart
- libnvjpeg
run_constrained:
- {{ pin_compatible('openslide') }}
Expand Down
2 changes: 1 addition & 1 deletion gds/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ if (NOT APPLE)
endif ()

# Find CUDA Toolkit for cudart and cufile.
find_package(CUDAToolkit REQUIRED)
find_package(CUDAToolkit REQUIRED COMPONENTS cuFile)

################################################################################
# Add library: cufile_stub
Expand Down
7 changes: 1 addition & 6 deletions gds/include/cufile_stub.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,7 @@
#ifndef CUCIM_CUFILE_STUB_H
#define CUCIM_CUFILE_STUB_H

// Try to include the real cufile.h, fall back to minimal types if not available
#if __has_include(<cufile.h>)
#include <cufile.h>
#else
#include "cufile_stub_types.h"
#endif
#include <cufile.h>
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trying to #include "cufile_stub_types.h" causes the following error on CI:

In file included from /opt/conda/conda-bld/work/gds/src/cufile_stub.cpp:17:
/opt/conda/conda-bld/work/gds/include/cufile_stub.h:23:14: fatal error: cufile_stub_types.h: No such file or directory
   23 |     #include "cufile_stub_types.h"
      |              ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.

Given we either have a new enough CUDA Toolkit and it has cuFile or it doesn't, we can simply check for cuFile and build or not

Unsure what we gain by having this in-between mode. Though would be happy to learn if I'm missing something


#include "cucim/dynlib/helper.h"

Expand Down