-
Notifications
You must be signed in to change notification settings - Fork 74
Remove CUDA 11 references #905
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
e456cd3
5a6b778
0ca8ef7
b94d4e2
9e46e6f
19d6af2
6cc92a6
e899a6b
47602ba
0d94e84
0b5fb05
6abd4b5
3a296bd
6ba441a
64a69c7
53af8f2
65f00dd
2315f06
d53e58e
050ef58
c44e7fd
3158ca9
49934d0
fdf955b
a3d2f7a
ad02b70
f06bdc9
1b5a984
d42ec91
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -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" | ||
|
Comment on lines
-22
to
-33
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These are CUDA 11 pinnings for dependencies outside the Conda 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 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -55,15 +55,14 @@ requirements: | |
| host: | ||
| - cuda-version ={{ cuda_version }} | ||
| - cuda-cudart-dev | ||
| - libcufile-dev # [linux64] | ||
| - libcufile-dev | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| - libnvjpeg-dev | ||
| - libnvjpeg-static | ||
|
Comment on lines
59
to
-60
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
| - nvtx-c >=3.1.0 | ||
| - openslide | ||
| run: | ||
| - {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }} | ||
| - cuda-cudart | ||
| - libcufile # [linux64] | ||
| - libcufile | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressing in PR: #930 |
||
| - libnvjpeg | ||
| run_constrained: | ||
| - {{ pin_compatible('openslide') }} | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -125,8 +125,6 @@ superbuild_depend(cli11) | |
| superbuild_depend(pugixml) | ||
| superbuild_depend(json) | ||
| superbuild_depend(libdeflate) | ||
| superbuild_depend(nvjpeg) | ||
| superbuild_depend(libculibos) | ||
|
Comment on lines
-128
to
-129
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||
|
|
||
| ################################################################################ | ||
| # Find cucim package | ||
|
|
@@ -216,11 +214,6 @@ target_compile_options(${CUCIM_PLUGIN_NAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-W | |
| # Link libraries | ||
| target_link_libraries(${CUCIM_PLUGIN_NAME} | ||
| PRIVATE | ||
| # Use custom nvjpeg_static that supports GPU input (>= CUDA 11.6) | ||
| deps::nvjpeg_static # add this before cudart so that nvjpeg.h in static library takes precedence. | ||
| # Add CUDA::culibos to link necessary methods for 'deps::nvjpeg_static' | ||
| CUDA::culibos # for nvjpeg | ||
| CUDA::cudart | ||
| deps::fmt | ||
| cucim::cucim | ||
| deps::libtiff | ||
|
|
@@ -231,6 +224,22 @@ target_link_libraries(${CUCIM_PLUGIN_NAME} | |
| deps::json | ||
| deps::libdeflate | ||
| ) | ||
| 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 | ||
|
Comment on lines
+230
to
+233
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like I goofed on the indenting here. Will follow up on this
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Addressing in PR: #931 |
||
| CUDA::cudart | ||
| ) | ||
| else() | ||
| target_link_libraries(${CUCIM_PLUGIN_NAME} | ||
| PRIVATE | ||
| CUDA::nvjpeg | ||
| CUDA::cudart | ||
| ) | ||
| endif() | ||
|
Comment on lines
+227
to
+242
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Raised this in a new issue: #932 |
||
|
|
||
| target_include_directories(${CUCIM_PLUGIN_NAME} | ||
| PUBLIC | ||
|
|
||
This file was deleted.
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -173,7 +173,6 @@ dependencies: | |
| cuda: "12.*" | ||
| packages: | ||
| - libnvjpeg-dev | ||
| - libnvjpeg-static | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Now that the nvJPEG version we need is in the CTK and there are Conda packages for it, we have switched to dynamic linking Already commented on the relevant build logic making this change above |
||
| - output_types: conda | ||
| matrices: | ||
| - matrix: | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -24,6 +24,9 @@ if (NOT APPLE) | |||||||||||||||
| set(CMAKE_INSTALL_RPATH $ORIGIN) | ||||||||||||||||
| endif () | ||||||||||||||||
|
|
||||||||||||||||
| # Find CUDA Toolkit for cudart and cufile. | ||||||||||||||||
| find_package(CUDAToolkit REQUIRED) | ||||||||||||||||
|
Comment on lines
+27
to
+28
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. To ensure cuFile is picked up from the CTK, we add this Note that in the case where nvJPEG is used, we already had an equivalent line. Hence no change there |
||||||||||||||||
|
|
||||||||||||||||
| ################################################################################ | ||||||||||||||||
| # Add library: cufile_stub | ||||||||||||||||
| ################################################################################ | ||||||||||||||||
|
|
@@ -52,52 +55,19 @@ target_compile_options(cufile_stub | |||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| ## Link libraries | ||||||||||||||||
| target_link_libraries(cufile_stub | ||||||||||||||||
| if (CUCIM_STATIC_GDS) | ||||||||||||||||
| # Enabling CUCIM_STATIC_GDS statically links cuFile | ||||||||||||||||
| target_link_libraries(cufile_stub | ||||||||||||||||
| PUBLIC | ||||||||||||||||
| ${CMAKE_DL_LIBS} | ||||||||||||||||
|
Comment on lines
+58
to
62
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Raised in issue: #933 |
||||||||||||||||
| PRIVATE | ||||||||||||||||
|
Comment on lines
+58
to
63
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 Lines 96 to 101 in 54cc342
It just replaces |
||||||||||||||||
| CUDA::cudart | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
| # 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}'.") | ||||||||||||||||
|
Comment on lines
-62
to
-73
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 |
||||||||||||||||
|
|
||||||||||||||||
| # Enabling CUCIM_STATIC_GDS assumes that lib/libcufile_static.a and include/cufile.h is available | ||||||||||||||||
| # under ../temp/cuda folder. | ||||||||||||||||
| if (CUCIM_STATIC_GDS) | ||||||||||||||||
| add_library(deps::gds_static STATIC IMPORTED GLOBAL) | ||||||||||||||||
|
|
||||||||||||||||
| if (DEFINED ENV{CONDA_BUILD}) | ||||||||||||||||
| set(GDS_STATIC_LIB_PATH "$ENV{PREFIX}/lib/libcufile_static.a") | ||||||||||||||||
| elseif (DEFINED ENV{CONDA_PREFIX}) | ||||||||||||||||
| set(GDS_STATIC_LIB_PATH "$ENV{CONDA_PREFIX}/lib/libcufile_static.a") | ||||||||||||||||
| elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/lib64/libcufile_static.a) | ||||||||||||||||
| set(GDS_STATIC_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/lib64/libcufile_static.a) | ||||||||||||||||
| else () | ||||||||||||||||
| set(GDS_STATIC_LIB_PATH /usr/local/cuda/lib64/libcufile_static.a) | ||||||||||||||||
| endif () | ||||||||||||||||
|
|
||||||||||||||||
| message("Set GDS_STATIC_LIB_PATH to '${GDS_STATIC_LIB_PATH}'.") | ||||||||||||||||
|
Comment on lines
-80
to
-90
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Again obviated by CMake's |
||||||||||||||||
|
|
||||||||||||||||
| set_target_properties(deps::gds_static PROPERTIES | ||||||||||||||||
| IMPORTED_LOCATION "${GDS_STATIC_LIB_PATH}" | ||||||||||||||||
| INTERFACE_INCLUDE_DIRECTORIES "${GDS_INCLUDE_PATH}" | ||||||||||||||||
| CUDA::cuFile_static | ||||||||||||||||
| ) | ||||||||||||||||
|
Comment on lines
+64
to
65
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here is where |
||||||||||||||||
| else() | ||||||||||||||||
| # Use `dlopen` to load cuFile at runtime | ||||||||||||||||
| target_link_libraries(cufile_stub | ||||||||||||||||
| PUBLIC | ||||||||||||||||
| ${CMAKE_DL_LIBS} | ||||||||||||||||
| PRIVATE | ||||||||||||||||
| deps::gds_static | ||||||||||||||||
| ) | ||||||||||||||||
|
Comment on lines
+66
to
71
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is just the same dynamic cuFile library case as before Lines 54 to 60 in 54cc342
For some reason GitHub included Also as we use We did include the That said, @gigony please let me know if I'm missing something here |
||||||||||||||||
| endif() | ||||||||||||||||
|
|
||||||||||||||||
|
|
@@ -110,9 +80,8 @@ PUBLIC | |||||||||||||||
| target_include_directories(cufile_stub | ||||||||||||||||
| PUBLIC | ||||||||||||||||
| $<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include> | ||||||||||||||||
| $<BUILD_INTERFACE:${GDS_INCLUDE_PATH}> | ||||||||||||||||
| ${CUDAToolkit_INCLUDE_DIRS} | ||||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since cuFile is picked up from the CTK now, this can just be the CTK header directories |
||||||||||||||||
| PRIVATE | ||||||||||||||||
| # Add path to cufile.h explicitly. ${TOP}/temp/cuda would be available by `./run copy_gds_files_` | ||||||||||||||||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As Greg already noted, the comment above is irrelevant. So it is dropped |
||||||||||||||||
| ${CMAKE_CURRENT_SOURCE_DIR}/../cpp/include # for including helper.h in cucim/dynlib | ||||||||||||||||
| ) | ||||||||||||||||
|
|
||||||||||||||||
|
|
||||||||||||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -16,7 +16,12 @@ | |
| #ifndef CUCIM_CUFILE_STUB_H | ||
| #define CUCIM_CUFILE_STUB_H | ||
|
|
||
| #include "cufile.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 | ||
|
Comment on lines
+19
to
+24
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @grlee77 it looks like you added this change. Could you please share a bit more context? Given the CTK has Is there some other issue that is coming up? |
||
|
|
||
| #include "cucim/dynlib/helper.h" | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -61,19 +61,9 @@ void CuFileStub::load() | |
| { | ||
| // Note: Load the dynamic library with RTLD_NODELETE flag because libcufile.so uses thread_local which can | ||
| // cause a segmentation fault if the library is dynamically loaded/unloaded. (See #158) | ||
| // CUDA versions before CUDA 11.7.1 did not ship libcufile.so.0, so this is | ||
| // a workaround that adds support for all prior versions of libcufile. | ||
| handle_ = cucim::dynlib::load_library( | ||
| { | ||
| "libcufile.so.0", | ||
| "libcufile.so.1.3.0" /* 11.7.0 */, | ||
| "libcufile.so.1.2.1" /* 11.6.2, 11.6.1 */, | ||
| "libcufile.so.1.2.0" /* 11.6.0 */, | ||
| "libcufile.so.1.1.1" /* 11.5.1 */, | ||
| "libcufile.so.1.1.0" /* 11.5.0 */, | ||
| "libcufile.so.1.0.2" /* 11.4.4, 11.4.3, 11.4.2 */, | ||
| "libcufile.so.1.0.1" /* 11.4.1 */, | ||
| "libcufile.so.1.0.0" /* 11.4.0 */ | ||
| }, | ||
|
Comment on lines
62
to
67
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In CUDA 11, cuFile's SOVERSION changed repeatedly. Hence we had this workaround. Since we used Now that CUDA 11 is dropped, none of these workarounds are needed. Hence this now just loads |
||
| RTLD_LAZY | RTLD_LOCAL | RTLD_NODELETE); | ||
| if (handle_ == nullptr) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,7 +34,7 @@ | |
| "\n", | ||
| "or\n", | ||
| "```\n", | ||
| "!pip install cupy-cuda110\n", | ||
| "!pip install cupy-cuda12x\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", | ||
|
Comment on lines
-37
to
38
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @grlee77 thanks for updating the CuPy packages! 🙏 Should we do the same with PyTorch and friends? There are a bunch more lines like these throughout the notebooks. Perhaps we should update them all and rerun to make sure they are working ok |
||
| "```" | ||
| ] | ||
|
|
@@ -49,7 +49,7 @@ | |
| "\n", | ||
| "# or\n", | ||
| "\n", | ||
| "#!pip install cupy-cuda110\n", | ||
| "#!pip install cupy-cuda12x\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" | ||
| ] | ||
| }, | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -22,7 +22,7 @@ | |
| "or\n", | ||
| "```\n", | ||
| "!pip install pillow\n", | ||
| "!pip install numpy scipy scikit-image cupy-cuda110 # for cucim dependency (assuming that CUDA 11.0 is used for CuPy)\n", | ||
| "!pip install numpy scipy scikit-image cupy-cuda12x # for cucim dependency (assuming that CUDA 12.x is used for CuPy)\n", | ||
| "```" | ||
| ] | ||
| }, | ||
|
|
@@ -32,12 +32,12 @@ | |
| "metadata": {}, | ||
| "outputs": [], | ||
| "source": [ | ||
| "#!conda install -c conda-forge pillow\n", | ||
| "# !conda install -c conda-forge pillow\n", | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like an errant space snuck in here |
||
| "\n", | ||
| "# or\n", | ||
| "\n", | ||
| "# !pip install pillow\n", | ||
| "# !pip install numpy scipy scikit-image cupy-cuda110 # for cucim dependency (assuming that CUDA 11.0 is used for CuPy)" | ||
| "# !pip install numpy scipy scikit-image cupy-cuda12x # for cucim dependency (assuming that CUDA 12.x is used for CuPy)" | ||
| ] | ||
| }, | ||
| { | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No more GCC 11 now that we are on CUDA 12+
This sticks with GCC 13 on CUDA 12 for simplicity
Though we have been bumping to GCC 14 in RAPIDS projects. So that could be done as a follow up