Skip to content

Commit b738d2c

Browse files
authored
Remove CUDA 11 references (#905)
Fixes #904 Removes remaining CUDA 11 references. Authors: - https://github.com/jakirkham - Gregory Lee (https://github.com/grlee77) - Bradley Dice (https://github.com/bdice) Approvers: - Gregory Lee (https://github.com/grlee77) - Bradley Dice (https://github.com/bdice) - James Lamb (https://github.com/jameslamb) URL: #905
1 parent c4684e4 commit b738d2c

File tree

15 files changed

+44
-317
lines changed

15 files changed

+44
-317
lines changed

conda/environments/all_cuda-129_arch-aarch64.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ dependencies:
1818
- ipython
1919
- lazy-loader>=0.4
2020
- libnvjpeg-dev
21-
- libnvjpeg-static
2221
- matplotlib-base>=3.7
2322
- nbsphinx
2423
- ninja

conda/environments/all_cuda-129_arch-x86_64.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ dependencies:
1919
- lazy-loader>=0.4
2020
- libcufile-dev
2121
- libnvjpeg-dev
22-
- libnvjpeg-static
2322
- matplotlib-base>=3.7
2423
- nbsphinx
2524
- ninja
Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
11
c_compiler_version:
2-
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
3-
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
2+
- 13
43

54
cxx_compiler_version:
6-
- 13 # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
7-
- 11 # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
5+
- 13
86

97
cuda_compiler:
10-
- cuda-nvcc # [not os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
11-
- nvcc # [os.environ.get("RAPIDS_CUDA_VERSION", "").startswith("11")]
8+
- cuda-nvcc
129

1310
c_stdlib:
1411
- sysroot
@@ -18,16 +15,3 @@ c_stdlib_version:
1815

1916
cmake_version:
2017
- ">=3.30.4"
21-
22-
# The CTK libraries below are missing from the conda-forge::cudatoolkit package
23-
# for CUDA 11. The "*_host_*" version specifiers correspond to `11.8` packages
24-
# and the "*_run_*" version specifiers correspond to `11.x` packages.
25-
26-
cuda11_libcufile_host_version:
27-
- "1.4.0.31"
28-
29-
cuda11_libcufile_run_version:
30-
- ">=1.0.0.82,<=1.4.0.31"
31-
32-
cuda11_libnvjpeg_host_version:
33-
- "11.6.0.55"

conda/recipes/libcucim/meta.yaml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,15 +55,14 @@ requirements:
5555
host:
5656
- cuda-version ={{ cuda_version }}
5757
- cuda-cudart-dev
58-
- libcufile-dev # [linux64]
58+
- libcufile-dev
5959
- libnvjpeg-dev
60-
- libnvjpeg-static
6160
- nvtx-c >=3.1.0
6261
- openslide
6362
run:
6463
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
6564
- cuda-cudart
66-
- libcufile # [linux64]
65+
- libcufile
6766
- libnvjpeg
6867
run_constrained:
6968
- {{ pin_compatible('openslide') }}

cpp/plugins/cucim.kit.cuslide/CMakeLists.txt

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,6 @@ superbuild_depend(cli11)
125125
superbuild_depend(pugixml)
126126
superbuild_depend(json)
127127
superbuild_depend(libdeflate)
128-
superbuild_depend(nvjpeg)
129-
superbuild_depend(libculibos)
130128

131129
################################################################################
132130
# Find cucim package
@@ -216,11 +214,6 @@ target_compile_options(${CUCIM_PLUGIN_NAME} PRIVATE $<$<COMPILE_LANGUAGE:CXX>:-W
216214
# Link libraries
217215
target_link_libraries(${CUCIM_PLUGIN_NAME}
218216
PRIVATE
219-
# Use custom nvjpeg_static that supports GPU input (>= CUDA 11.6)
220-
deps::nvjpeg_static # add this before cudart so that nvjpeg.h in static library takes precedence.
221-
# Add CUDA::culibos to link necessary methods for 'deps::nvjpeg_static'
222-
CUDA::culibos # for nvjpeg
223-
CUDA::cudart
224217
deps::fmt
225218
cucim::cucim
226219
deps::libtiff
@@ -231,6 +224,22 @@ target_link_libraries(${CUCIM_PLUGIN_NAME}
231224
deps::json
232225
deps::libdeflate
233226
)
227+
if (TARGET CUDA::nvjpeg_static)
228+
target_link_libraries(${CUCIM_PLUGIN_NAME}
229+
PRIVATE
230+
# Add nvjpeg before cudart so that nvjpeg.h in static library takes precedence.
231+
CUDA::nvjpeg_static
232+
# Add CUDA::culibos to link necessary methods for 'deps::nvjpeg_static'
233+
CUDA::culibos
234+
CUDA::cudart
235+
)
236+
else()
237+
target_link_libraries(${CUCIM_PLUGIN_NAME}
238+
PRIVATE
239+
CUDA::nvjpeg
240+
CUDA::cudart
241+
)
242+
endif()
234243

235244
target_include_directories(${CUCIM_PLUGIN_NAME}
236245
PUBLIC

cpp/plugins/cucim.kit.cuslide/cmake/deps/libculibos.cmake

Lines changed: 0 additions & 42 deletions
This file was deleted.

cpp/plugins/cucim.kit.cuslide/cmake/deps/nvjpeg.cmake

Lines changed: 0 additions & 41 deletions
This file was deleted.

dependencies.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,6 @@ dependencies:
173173
cuda: "12.*"
174174
packages:
175175
- libnvjpeg-dev
176-
- libnvjpeg-static
177176
- output_types: conda
178177
matrices:
179178
- matrix:

gds/CMakeLists.txt

Lines changed: 10 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ if (NOT APPLE)
2424
set(CMAKE_INSTALL_RPATH $ORIGIN)
2525
endif ()
2626

27+
# Find CUDA Toolkit for cudart and cufile.
28+
find_package(CUDAToolkit REQUIRED)
29+
2730
################################################################################
2831
# Add library: cufile_stub
2932
################################################################################
@@ -52,52 +55,19 @@ target_compile_options(cufile_stub
5255
)
5356

5457
## Link libraries
55-
target_link_libraries(cufile_stub
58+
if (CUCIM_STATIC_GDS)
59+
# Enabling CUCIM_STATIC_GDS statically links cuFile
60+
target_link_libraries(cufile_stub
5661
PUBLIC
5762
${CMAKE_DL_LIBS}
5863
PRIVATE
59-
CUDA::cudart
60-
)
61-
62-
# Set GDS include path (cufile.h)
63-
if (DEFINED ENV{CONDA_BUILD} AND EXISTS $ENV{PREFIX}/include/cufile.h)
64-
set(GDS_INCLUDE_PATH "$ENV{PREFIX}/include")
65-
elseif (DEFINED ENV{CONDA_PREFIX} AND EXISTS $ENV{CONDA_PREFIX}/include/cufile.h)
66-
set(GDS_INCLUDE_PATH "$ENV{CONDA_PREFIX}/include")
67-
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/include/cufile.h)
68-
set(GDS_INCLUDE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/include)
69-
else ()
70-
set(GDS_INCLUDE_PATH /usr/local/cuda/include)
71-
endif ()
72-
73-
message("Set GDS_INCLUDE_PATH to '${GDS_INCLUDE_PATH}'.")
74-
75-
# Enabling CUCIM_STATIC_GDS assumes that lib/libcufile_static.a and include/cufile.h is available
76-
# under ../temp/cuda folder.
77-
if (CUCIM_STATIC_GDS)
78-
add_library(deps::gds_static STATIC IMPORTED GLOBAL)
79-
80-
if (DEFINED ENV{CONDA_BUILD})
81-
set(GDS_STATIC_LIB_PATH "$ENV{PREFIX}/lib/libcufile_static.a")
82-
elseif (DEFINED ENV{CONDA_PREFIX})
83-
set(GDS_STATIC_LIB_PATH "$ENV{CONDA_PREFIX}/lib/libcufile_static.a")
84-
elseif (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/lib64/libcufile_static.a)
85-
set(GDS_STATIC_LIB_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../temp/cuda/lib64/libcufile_static.a)
86-
else ()
87-
set(GDS_STATIC_LIB_PATH /usr/local/cuda/lib64/libcufile_static.a)
88-
endif ()
89-
90-
message("Set GDS_STATIC_LIB_PATH to '${GDS_STATIC_LIB_PATH}'.")
91-
92-
set_target_properties(deps::gds_static PROPERTIES
93-
IMPORTED_LOCATION "${GDS_STATIC_LIB_PATH}"
94-
INTERFACE_INCLUDE_DIRECTORIES "${GDS_INCLUDE_PATH}"
64+
CUDA::cuFile_static
9565
)
66+
else()
67+
# Use `dlopen` to load cuFile at runtime
9668
target_link_libraries(cufile_stub
9769
PUBLIC
9870
${CMAKE_DL_LIBS}
99-
PRIVATE
100-
deps::gds_static
10171
)
10272
endif()
10373

@@ -110,9 +80,8 @@ PUBLIC
11080
target_include_directories(cufile_stub
11181
PUBLIC
11282
$<BUILD_INTERFACE:${CMAKE_CURRENT_LIST_DIR}/include>
113-
$<BUILD_INTERFACE:${GDS_INCLUDE_PATH}>
83+
${CUDAToolkit_INCLUDE_DIRS}
11484
PRIVATE
115-
# Add path to cufile.h explicitly. ${TOP}/temp/cuda would be available by `./run copy_gds_files_`
11685
${CMAKE_CURRENT_SOURCE_DIR}/../cpp/include # for including helper.h in cucim/dynlib
11786
)
11887

gds/include/cufile_stub.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,12 @@
1616
#ifndef CUCIM_CUFILE_STUB_H
1717
#define CUCIM_CUFILE_STUB_H
1818

19-
#include "cufile.h"
19+
// Try to include the real cufile.h, fall back to minimal types if not available
20+
#if __has_include(<cufile.h>)
21+
#include <cufile.h>
22+
#else
23+
#include "cufile_stub_types.h"
24+
#endif
2025

2126
#include "cucim/dynlib/helper.h"
2227

0 commit comments

Comments
 (0)