diff --git a/.github/workflows/build-test-package.yml b/.github/workflows/build-test-package.yml index 65b8bfc..ca61af9 100644 --- a/.github/workflows/build-test-package.yml +++ b/.github/workflows/build-test-package.yml @@ -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 @@ -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 diff --git a/itk-module-init.cmake b/itk-module-init.cmake index c6f5f5a..a5bcd77 100644 --- a/itk-module-init.cmake +++ b/itk-module-init.cmake @@ -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) @@ -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() diff --git a/setup.py b/setup.py index 45b2ab4..5be982f 100644 --- a/setup.py +++ b/setup.py @@ -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'], @@ -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' ] )