Skip to content

Commit

Permalink
ENH: Define CUDACOMMON_CUDA_VERSION for wheel names and verify it
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit committed Nov 18, 2022
1 parent 4e89624 commit 4b157fa
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-test-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ jobs:
for tarball in "-manylinux_2_28" "-manylinux2014"; do
rm -rf ITKPythonPackage
export TARBALL_SPECIALIZATION=${tarball}
./dockcross-manylinux-download-cache-and-build-module-wheels.sh -c "-DCUDAToolkit_ROOT=/usr/lib64/cuda116 -DCMAKE_CUDA_COMPILER=/usr/lib64/cuda116/bin/nvcc -DRTK_CUDA_VERSION=11.6" -x "libcuda.so;libcuda.so.1;libcudart.so;libcudart.so.11.0;libcublas.so;libcublas.so.11;libcublasLt.so;libcublasLt.so.11;libcufft.so;libcufft.so.10" cp${{ matrix.python-version }}
./dockcross-manylinux-download-cache-and-build-module-wheels.sh -c "-DCUDAToolkit_ROOT=/usr/lib64/cuda116 -DCMAKE_CUDA_COMPILER=/usr/lib64/cuda116/bin/nvcc -DCUDACOMMON_CUDA_VERSION=11.6" -x "libcuda.so;libcuda.so.1;libcudart.so;libcudart.so.11.0;libcublas.so;libcublas.so.11;libcublasLt.so;libcublasLt.so.11;libcufft.so;libcufft.so.10" cp${{ matrix.python-version }}
done
Expand Down Expand Up @@ -205,7 +205,7 @@ jobs:
set PATH=C:\P\grep;%PATH%
set CC=cl.exe
set CXX=cl.exe
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" --no-cleanup --lib-paths "C:/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.6/bin" --exclude-libs "nvcuda.dll;concrt140.dll;cublas64_11.dll;cublasLt64_11.dll;cudart64_110.dll;cufft64_10.dll" -- "-DRTK_CUDA_VERSION=11.6"
C:\Python3${{ matrix.python-version-minor }}-x64\python.exe C:\P\IPP\scripts\windows_build_module_wheels.py --py-envs "3${{ matrix.python-version-minor }}-x64" --no-cleanup --lib-paths "C:/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.6/bin" --exclude-libs "nvcuda.dll;concrt140.dll;cublas64_11.dll;cublasLt64_11.dll;cudart64_110.dll;cufft64_10.dll" -- "-DCUDACOMMON_CUDA_VERSION=11.6"
- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v1
Expand Down
5 changes: 4 additions & 1 deletion itk-module-init.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES)
set(CMAKE_CUDA_ARCHITECTURES "52" CACHE STRING "CUDA architectures")
endif()
endif()

include(CheckLanguage)
check_language(CUDA)

Expand All @@ -25,7 +24,11 @@ if (CMAKE_CUDA_COMPILER)
endif()

# Configure CUDA compilation options
option(CUDACOMMON_CUDA_VERSION "Specify the exact CUDA version that must be used for CudaCommon")
if(CUDAToolkit_FOUND)
enable_language(CUDA)
set(CMAKE_CUDA_RUNTIME_LIBRARY Static)
if(CUDACOMMON_CUDA_VERSION)
find_package(CUDAToolkit EXACT ${CUDACOMMON_CUDA_VERSION})
endif()
endif()
17 changes: 12 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,17 @@
print(' python -m pip install scikit-build')
sys.exit(1)

# Configure wheel name if CUDA is used
wheel_name='itk-cudacommon'
# Extract cuda version from the CUDACOMMON_CUDA_VERSION cmake option
for arg in sys.argv:
if "CUDACOMMON_CUDA_VERSION" in str(arg):
cuda_version = arg.rsplit('CUDACOMMONG_CUDA_VERSION=', 1)[-1]
wheel_name += '-cuda' + cuda_version.replace('.', '')

setup(
name='itk-cudacommon',
version='0.1.0',
name=wheel_name,
version='1.0.0',
author='RTK Consortium',
author_email='simon.rit@creatis.insa-lyon.fr',
packages=['itk'],
Expand Down Expand Up @@ -40,9 +48,8 @@
"Operating System :: MacOS"
],
license='Apache',
keywords='RTK Reconstruction Toolkit',
url=r'https://www.openrtk.org/',
url=r'https://github.com/SimonRit/ITKCudaCommon',
install_requires=[
r'itk>=5.2.1.post1'
r'itk>=5.3rc04'
]
)

0 comments on commit 4b157fa

Please sign in to comment.