Skip to content

Conversation

@jakirkham
Copy link
Member

@jakirkham jakirkham commented Jul 16, 2025

Fixes #904

Removes remaining CUDA 11 references.

@copy-pr-bot
Copy link

copy-pr-bot bot commented Jul 16, 2025

Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually.

Contributors can view more details about this message here.

@jakirkham jakirkham added improvement Improves an existing functionality non-breaking Introduces a non-breaking change labels Jul 16, 2025
@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

jakirkham commented Jul 16, 2025

Also seeing some references in the notebooks

"!conda install -c pytorch -c conda-forge pytorch==1.7.1 torchvision==0.8.2 torchaudio==0.7.2 cudatoolkit=11.0\n",
"(If executing `import torch; torch.cuda.is_available()` doesn't show 'True', use `pip` PyTorch installation method.)\n",
"```\n",
"\n",
"\n",
"or\n",
"```\n",
"!pip install cupy-cuda110\n",
"!pip install torch==1.7.1+cu110 torchvision==0.8.2+cu110 torchaudio==0.7.2 -f https://download.pytorch.org/whl/torch_stable.html\n",

https://github.com/rapidsai/cucim/blob/44c559284714c79c8a5af2a90212106f6b2a89f6/notebooks/Basic_Usage.ipynb#L25

Though have not addressed those

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@jakirkham
Copy link
Member Author

/ok to test

@grlee77
Copy link
Contributor

grlee77 commented Aug 20, 2025

/ok to test

@bdice
Copy link
Contributor

bdice commented Aug 20, 2025

/ok to test

@grlee77
Copy link
Contributor

grlee77 commented Aug 20, 2025

Some notebooks also have outdated pip install commands using cuda 11 versions of CuPy. It looks like we should replace cupy-cuda110 with cupy-cuda12x in the following places:

notebooks/Basic_Usage.ipynb:25:    "!pip install numpy scipy scikit-image cupy-cuda110  # for cucim dependency (assuming that CUDA 11.0 is used for CuPy)\n",
notebooks/Basic_Usage.ipynb:40:    "# !pip install numpy scipy scikit-image cupy-cuda110  # for cucim dependency (assuming that CUDA 11.0 is used for CuPy)"
notebooks/Accessing_File_with_GDS.ipynb:37:    "!pip install cupy-cuda110\n",
notebooks/Accessing_File_with_GDS.ipynb:52:    "#!pip install cupy-cuda110\n",
notebooks/Working_with_DALI.ipynb:23:    "!pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110\n",
notebooks/Working_with_DALI.ipynb:27:    "!pip install cucim scipy scikit-image cupy-cuda110 matplotlib\n",
notebooks/Working_with_DALI.ipynb:28:    "!pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110\n",
notebooks/Working_with_DALI.ipynb:39:    "#!pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110\n",
notebooks/Working_with_DALI.ipynb:43:    "#!pip install cucim scipy scikit-image cupy-cuda110 matplotlib\n",
notebooks/Working_with_DALI.ipynb:45:    "#!pip install --extra-index-url https://developer.download.nvidia.com/compute/redist --upgrade nvidia-dali-cuda110"

Copy link
Contributor

@grlee77 grlee77 left a comment

Choose a reason for hiding this comment

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

Thanks @jakirkham, it looks good to me.

I pushed a 1-line commit that seems to have resolved finding the CUDA include path for GDS. Other changes look good to me, but @gigony, please confirm if you have a chance as you are the original author of most of the modified files.

I left a couple of comments for additional minor residual cleanups that could be made.

@bdice bdice marked this pull request as ready for review August 20, 2025 17:29
@bdice bdice requested review from a team as code owners August 20, 2025 17:29
@bdice bdice requested a review from jameslamb August 20, 2025 17:29
Copy link
Member

@jameslamb jameslamb left a comment

Choose a reason for hiding this comment

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

Looks good to me, this simplification will help with CUDA 13 support (#926).

@jameslamb
Copy link
Member

After handling culibos being removed from cuda-cudart, I didn't face any other issues adding CUDA 13 support: #926

If we can merge this soon, I'll update the CUDA 13 PR and ensure everything is still working together. If more work is needed here, we should merge the CUDA 13 PR first.

grlee77 and others added 2 commits August 20, 2025 17:14
Co-authored-by: Bradley Dice <bdice@bradleydice.com>
@grlee77
Copy link
Contributor

grlee77 commented Aug 21, 2025

I was able to push to John's branch, so just pushed the notebook commit here. Should be able to just merge once CI passes

@bdice
Copy link
Contributor

bdice commented Aug 21, 2025

Great. I'll do that now, to help along CUDA 13 work.

@bdice
Copy link
Contributor

bdice commented Aug 21, 2025

/merge

@rapids-bot rapids-bot bot merged commit b738d2c into rapidsai:branch-25.10 Aug 21, 2025
37 checks passed
Copy link
Member Author

@jakirkham jakirkham left a comment

Choose a reason for hiding this comment

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

Just wanted to say thank you all for pushing this across the line ❤️

Had the sense this got 80-90% of the way during 25.08. However wasn't able to finish in that cycle so just split out the doc fixes and moved this to 25.10

There were some remaining things that I hoped to do here. Mainly fixing CI, cleaning up more CUDA 11 references, and some build fixes for issues I caught along the way

Think the changes that all of you made are good enough for this to be in. Will leave some comments here to discuss the remaining work that can be split out. Also to leave some context (especially for Gigon when he looks at this)

Comment on lines +227 to +242
if (TARGET CUDA::nvjpeg_static)
target_link_libraries(${CUCIM_PLUGIN_NAME}
PRIVATE
# Add nvjpeg before cudart so that nvjpeg.h in static library takes precedence.
CUDA::nvjpeg_static
# Add CUDA::culibos to link necessary methods for 'deps::nvjpeg_static'
CUDA::culibos
CUDA::cudart
)
else()
target_link_libraries(${CUCIM_PLUGIN_NAME}
PRIVATE
CUDA::nvjpeg
CUDA::cudart
)
endif()
Copy link
Member Author

Choose a reason for hiding this comment

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

Right now this checks for nvJPEG static and uses it if it finds it. Otherwise dynamically linking to nvJPEG

This works for the needs of cuCIM. Namely wheels continue to statically link to nvJPEG. Meanwhile Conda packages can dynamically link to nvJPEG

However what would be better is to add an option to build nvJPEG either dynamically or statically (like with cuFile's option). The code here could similarly be updated to check that option (just like cuFile's linking logic). Then wheel and Conda builds could pass that flag based on their needs

Copy link
Member Author

Choose a reason for hiding this comment

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

Raised this in a new issue: #932

Comment on lines +58 to 63
if (CUCIM_STATIC_GDS)
# Enabling CUCIM_STATIC_GDS statically links cuFile
target_link_libraries(cufile_stub
PUBLIC
${CMAKE_DL_LIBS}
PRIVATE
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 diff (and the diff behind the fold) looks more exciting than it is

All this does is reproduce the previous logic

cucim/gds/CMakeLists.txt

Lines 96 to 101 in 54cc342

target_link_libraries(cufile_stub
PUBLIC
${CMAKE_DL_LIBS}
PRIVATE
deps::gds_static
)

It just replaces deps::gds_static with CUDA::cuFile_static. The former was a stand-in for what CMake now provides. So we just switch to the latter

Comment on lines +64 to 65
CUDA::cuFile_static
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Here is where deps::gds_static was replaced with CUDA::cuFile_static . For some reason GitHub put a large number of deleted lines between the two. Unclear why it did that. In any event, this is connected with the above content

Comment on lines +58 to 62
if (CUCIM_STATIC_GDS)
# Enabling CUCIM_STATIC_GDS statically links cuFile
target_link_libraries(cufile_stub
PUBLIC
${CMAKE_DL_LIBS}
Copy link
Member Author

@jakirkham jakirkham Aug 22, 2025

Choose a reason for hiding this comment

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

As another note, it appears we define a bunch of stuff unconditionally that needs dlopen, etc. and thus need to link to ${CMAKE_DL_LIBS}. However we don't actually need to use it in the static case. So it seems this linkage could be dropped (after adding some of the C++ code in guards)

Copy link
Member Author

Choose a reason for hiding this comment

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

Raised in issue: #933

Comment on lines -62 to -73
# Set GDS include path (cufile.h)
if (DEFINED ENV{CONDA_BUILD} AND EXISTS $ENV{PREFIX}/include/cufile.h)
set(GDS_INCLUDE_PATH "$ENV{PREFIX}/include")
elseif (DEFINED ENV{CONDA_PREFIX} AND EXISTS $ENV{CONDA_PREFIX}/include/cufile.h)
set(GDS_INCLUDE_PATH "$ENV{CONDA_PREFIX}/include")
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/include/cufile.h)
set(GDS_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/include)
else ()
set(GDS_INCLUDE_PATH /usr/local/cuda/include)
endif ()

message("Set GDS_INCLUDE_PATH to '${GDS_INCLUDE_PATH}'.")
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 was just to find the path to the cuFile download we did on CI

Using CMake's CUDA::cuFile* targets to pick up the cuFile in the CUDA Toolkit obviates this need

Comment on lines -22 to -33
# 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"
Copy link
Member Author

Choose a reason for hiding this comment

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

These are CUDA 11 pinnings for dependencies outside the Conda cudatoolkit package

None of that is relevant for CUDA 12+, which has the full CTK as packages with associated pinning

Also the usage of these values was dropped already with PR: #889

Hence these can just be dropped

- cuda-version ={{ cuda_version }}
- 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.

cuFile is available on all platforms. Hence it is added as a dependency here

Comment on lines 59 to -60
- libnvjpeg-dev
- libnvjpeg-static
Copy link
Member Author

Choose a reason for hiding this comment

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

nvJPEG is now dynamically linked to in the Conda case. Hence no need for the static library

- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
- cuda-cudart
- libcufile # [linux64]
- libcufile
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 adds the cuFile dependency on ARM

However the CTK only added cuFile for ARM in CUDA 12.2: conda-forge/libcufile-feedstock#9

So this won't work for ARM with CUDA 12.0 or 12.1. Meaning we need to use a similar workaround as KvikIO did: rapidsai/kvikio#754

Another option would be to just start depending on KvikIO

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressing in PR: #930

Comment on lines -128 to -129
superbuild_depend(nvjpeg)
superbuild_depend(libculibos)
Copy link
Member Author

Choose a reason for hiding this comment

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

These handled finding the nvJPEG and cuLIBOS dependencies via custom CMake logic

That is no longer needed now that they come from the CTK

Hence this and the associated files are dropped

@jakirkham jakirkham deleted the drop_cuda_11 branch August 22, 2025 05:09
rapids-bot bot pushed a commit that referenced this pull request Aug 22, 2025
Following up on this thread: #905 (comment)

The indentation here was off. Think the editor may have used tabs. This fixes that spacing issue

Authors:
  - https://github.com/jakirkham

Approvers:
  - Kyle Edwards (https://github.com/KyleFromNVIDIA)

URL: #931
rapids-bot bot pushed a commit that referenced this pull request Sep 18, 2025
Following up on this thread: #905 (comment)

The CUDA Toolkit (CTK) added cuFile for ARM in CTK 12.2. As a result always requiring `libcufile` with `libcucim` can make it uninstallable on ARM with CTK 12.0 & 12.1.

To fix this, build two variants of the `libcucim` package. One with `libcufile` and one without. Constrain `cuda-version` accordingly so that `libcufile` is installed whenever possible. Only when `libcufile` cannot be installed, fallback to the `libcucim` package where the `libcufile` dependency is left off.

The `x86_64` CTK has had cuFile since the CTK 11.4. As RAPIDS now requires CUDA 12.0+, there is no issue always requiring `libcufile` on `x86_64`.

This issue will not be present in CUDA 13+. So always require `libcufile` in that case.

Authors:
  - https://github.com/jakirkham
  - James Lamb (https://github.com/jameslamb)
  - Gregory Lee (https://github.com/grlee77)

Approvers:
  - James Lamb (https://github.com/jameslamb)
  - Bradley Dice (https://github.com/bdice)

URL: #930
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

improvement Improves an existing functionality non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove CUDA 11 from code, docs, etc.

4 participants