Skip to content

Commit

Permalink
cuCIM: Build CUDA 12 packages (rapidsai#572)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakirkham authored Jul 25, 2023
1 parent fc33e56 commit 0a6bf42
Show file tree
Hide file tree
Showing 9 changed files with 188 additions and 15 deletions.
7 changes: 6 additions & 1 deletion conda/environments/all_cuda-118_arch-x86_64.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,18 @@ dependencies:
- c-compiler
- click
- cmake>=3.23.1,!=3.25.0
- cudatoolkit=11.8
- cuda-version=11.8
- cudatoolkit
- cupy >=12.0.0
- cxx-compiler
- gcc_linux-64=11.*
- imagecodecs>=2021.6.8
- ipython
- jbig
- libcufile-dev=1.4.0.31
- libcufile=1.4.0.31
- libnvjpeg-dev=11.6.0.55
- libnvjpeg=11.6.0.55
- libwebp-base
- nbsphinx
- ninja
Expand Down
52 changes: 52 additions & 0 deletions conda/environments/all_cuda-120_arch-x86_64.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# This file is generated by `rapids-dependency-file-generator`.
# To make changes, edit ../../dependencies.yaml and run `rapids-dependency-file-generator`.
channels:
- rapidsai
- rapidsai-nightly
- conda-forge
- nvidia
dependencies:
- GPUtil>=1.4.0
- c-compiler
- click
- cmake>=3.23.1,!=3.25.0
- cuda-cudart-dev
- cuda-nvcc
- cuda-version=12.0
- cupy >=12.0.0
- cxx-compiler
- gcc_linux-64=11.*
- imagecodecs>=2021.6.8
- ipython
- jbig
- libcufile-dev
- libnvjpeg-dev
- libnvjpeg-static
- libwebp-base
- nbsphinx
- ninja
- numpy >=1.21.3
- numpydoc
- openslide-python>=1.1.2
- pip
- pre-commit
- psutil>=5.8.0
- pydata-sphinx-theme
- pytest-cov>=2.12.1
- pytest-lazy-fixture>=0.6.3
- pytest-xdist
- pytest>=6.2.4
- python>=3.8,<3.11
- recommonmark
- scikit-image >=0.19.0,<0.22.0a0
- scipy
- sphinx<6
- sysroot_linux-64==2.17
- tifffile>=2022.7.28
- xz
- yasm
- zlib
- zstd
- pip:
- opencv-python-headless>=4.6
name: all_cuda-120_arch-x86_64
6 changes: 6 additions & 0 deletions conda/recipes/cucim/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,11 @@ c_compiler_version:
cxx_compiler_version:
- 11

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc

sysroot_version:
- "2.17"
14 changes: 10 additions & 4 deletions conda/recipes/cucim/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Copyright (c) 2021-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[2] %}
{% 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 }}
Expand Down Expand Up @@ -38,21 +38,27 @@ requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
- cuda-version ={{ cuda_version }}
- cmake >=3.23.1,!=3.25.0
- make
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
host:
- click
- cudatoolkit ={{ cuda_version }}
- cuda-version ={{ cuda_version }}
- cupy >=12.0.0
- libcucim ={{ version }}
- numpy 1.21
- python
- scikit-image >=0.19.0,<0.22.0a0
- scipy
run:
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
- {{ pin_compatible('numpy') }}
- click
- cupy >=12.0.0
Expand All @@ -64,7 +70,7 @@ requirements:

tests:
requirements:
- cudatoolkit ={{ cuda_version }}
- cuda-version ={{ cuda_version }}
imports:
- cucim

Expand Down
1 change: 0 additions & 1 deletion conda/recipes/libcucim/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ CUCIM_BUILD_TYPE=${CUCIM_BUILD_TYPE:-release}

echo "CC : ${CC}"
echo "CXX : ${CXX}"
echo "CUDA : ${CUDA}"

# CUDA needs to include $PREFIX/include as system include path
export CUDAFLAGS="-isystem $BUILD_PREFIX/include -isystem $PREFIX/include "
Expand Down
19 changes: 19 additions & 0 deletions conda/recipes/libcucim/conda_build_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,27 @@ c_compiler_version:
cxx_compiler_version:
- 11

cuda_compiler:
- cuda-nvcc

cuda11_compiler:
- nvcc

sysroot_version:
- "2.17"

libwebp_base_version:
- "<1.3a0"

# 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"
27 changes: 24 additions & 3 deletions conda/recipes/libcucim/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
# Copyright (c) 2021-2023, NVIDIA CORPORATION.

{% set version = environ.get('GIT_DESCRIBE_TAG', '0.0.0.dev').lstrip('v') %}
{% set minor_version = version.split('.')[0] + '.' + version.split('.')[1] %}
{% 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 }}
Expand Down Expand Up @@ -39,22 +39,43 @@ requirements:
build:
- {{ compiler("c") }}
- {{ compiler("cxx") }}
{% if cuda_major == "11" %}
- {{ compiler('cuda11') }} ={{ cuda_version }}
{% else %}
- {{ compiler('cuda') }}
{% endif %}
- cuda-version ={{ cuda_version }}
- binutils
- cmake >=3.23.1,!=3.25.0
- make
- ninja
- sysroot_{{ target_platform }} {{ sysroot_version }}
- yasm # [x86_64]
host:
- cudatoolkit ={{ cuda_version }}
- 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 %}
- libcufile-dev # [linux64]
- libnvjpeg-dev
- libnvjpeg-static
{% endif %}
- jbig
- libwebp-base {{ libwebp_base_version }}
- nvtx-c >=3.1.0
- openslide
- xz
- zlib
- zstd
run:
- {{ pin_compatible('cudatoolkit', max_pin='x', min_pin='x') }}
- {{ pin_compatible('cuda-version', max_pin='x', min_pin='x') }}
{% if cuda_major == "11" %}
- cudatoolkit
- libcufile {{ cuda11_libcufile_run_version }} # [linux64]
{% endif %}
- {{ pin_compatible('libwebp-base', max_pin='x.x') }}
- jbig
# - openslide # skipping here but benchmark binary would need openslide library
Expand Down
37 changes: 32 additions & 5 deletions dependencies.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ files:
all:
output: conda
matrix:
cuda: ["11.8"]
cuda: ["11.8", "12.0"]
arch: [x86_64]
includes:
- build
Expand Down Expand Up @@ -66,12 +66,28 @@ dependencies:
arch: x86_64
cuda: "11.8"
packages:
- cuda-version=11.8
- nvcc_linux-64=11.8
- libcufile=1.4.0.31
- libcufile-dev=1.4.0.31
- libnvjpeg=11.6.0.55
- libnvjpeg-dev=11.6.0.55
- matrix:
arch: aarch64
cuda: "11.8"
packages:
- cuda-version=11.8
- nvcc_linux-aarch64=11.8
- libnvjpeg=11.6.0.55
- libnvjpeg-dev=11.6.0.55
- matrix:
cuda: "12.0"
packages:
- cuda-version=12.0
- cuda-nvcc
- libcufile-dev
- libnvjpeg-dev
- libnvjpeg-static
checks:
common:
- output_types: [conda, requirements]
Expand All @@ -84,19 +100,30 @@ dependencies:
- matrix:
cuda: "11.2"
packages:
- cudatoolkit=11.2
- cuda-version=11.2
- cudatoolkit
- matrix:
cuda: "11.4"
packages:
- cudatoolkit=11.4
- cuda-version=11.4
- cudatoolkit
- matrix:
cuda: "11.5"
packages:
- cudatoolkit=11.5
- cuda-version=11.5
- cudatoolkit
- matrix:
cuda: "11.8"
packages:
- cudatoolkit=11.8
- cuda-version=11.8
- cudatoolkit
- matrix:
cuda: "12.0"
packages:
- cuda-version=12.0
- cuda-cudart-dev
- libnvjpeg-dev
- libcufile-dev
docs:
common:
- output_types: [conda, requirements]
Expand Down
40 changes: 39 additions & 1 deletion run
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,26 @@ build_local() {

copy_gds_files_() {
local root_folder=${1:-${TOP}}
local cufile_search="${root_folder}/temp/cuda/include:${root_folder}/temp/cuda/lib64" #"/usr/local/cuda/include:/usr/local/cuda/lib64 ${PREFIX:-}/include:${PREFIX:-}/lib ${CONDA_PREFIX:-}/include:${CONDA_PREFIX:-}/lib ${root_folder}/temp/cuda/include:${root_folder}/temp/cuda/lib64"
local cufile_search="${root_folder}/temp/cuda/include:${root_folder}/temp/cuda/lib64"
local targets_dir=""
if [[ "$(arch)" == "x86_64" ]]
then
targets_dir="targets/x86_64-linux"
elif [[ "$(arch)" == "aarch64" ]]
then
targets_dir="targets/sbsa-linux"
else
echo "Unknown architecture"
exit 1
fi
if [[ ! -z "${CONDA_PREFIX+x}" ]]
then
cufile_search="${CONDA_PREFIX:-}/include:${CONDA_PREFIX:-}/lib ${CONDA_PREFIX:-}/${targets_dir}/include:${CONDA_PREFIX:-}/${targets_dir}/lib ${cufile_search}"
fi
if [[ ! -z "${PREFIX+x}" ]]
then
cufile_search="${PREFIX:-}/include:${PREFIX:-}/lib ${PREFIX:-}/${targets_dir}/include:${PREFIX:-}/${targets_dir}/lib ${cufile_search}"
fi
local gds_version=1.0.0
local candidate
local cufile_include
Expand Down Expand Up @@ -486,6 +505,25 @@ copy_nvjpeg_files_() {
local root_folder=${1:-${TOP}}
local arch_name="$(get_arch_name_)"
local nvjpeg_search="${root_folder}/temp/cuda/include:${root_folder}/temp/cuda/lib64"
local targets_dir=""
if [[ "$(arch)" == "x86_64" ]]
then
targets_dir="targets/x86_64-linux"
elif [[ "$(arch)" == "aarch64" ]]
then
targets_dir="targets/sbsa-linux"
else
echo "Unknown architecture"
exit 1
fi
if [[ ! -z "${CONDA_PREFIX+x}" ]]
then
nvjpeg_search="${CONDA_PREFIX:-}/include:${CONDA_PREFIX:-}/lib ${CONDA_PREFIX:-}/${targets_dir}/include:${CONDA_PREFIX:-}/${targets_dir}/lib ${nvjpeg_search}"
fi
if [[ ! -z "${PREFIX+x}" ]]
then
nvjpeg_search="${PREFIX:-}/include:${PREFIX:-}/lib ${PREFIX:-}/${targets_dir}/include:${PREFIX:-}/${targets_dir}/lib ${nvjpeg_search}"
fi
local cuda_version="11.6"
local nvjpeg_version="11-6_11.6.0.55-1"
local candidate
Expand Down

0 comments on commit 0a6bf42

Please sign in to comment.