Skip to content

Commit

Permalink
ENH: Trigger CI packaging of several CUDA versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit authored and SimonRit committed May 24, 2024
1 parent bfdca5b commit 29b89fb
Showing 1 changed file with 29 additions and 9 deletions.
38 changes: 29 additions & 9 deletions .github/workflows/build-test-package-python-cuda.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ name: 'Package RTK with CUDA'
on: [push,pull_request]

env:
cmake-options: '-DRTK_BUILD_APPLICATIONS:BOOL=OFF -DRTK_CUDA_VERSION=11.6'
itk-wheel-tag: 'v5.4rc02'
itk-python-package-tag: '8b047b05ee19c01a1744af2b3ee36f7c893ee01e'
itk-python-package-org: 'InsightSoftwareConsortium'
Expand All @@ -17,6 +16,7 @@ jobs:
matrix:
python3-minor-version: ["8", "9", "10", "11"]
manylinux-platform: ["_2_28-x64","2014-x64"]
cuda-version: ["116","121"]

steps:
- uses: actions/checkout@v3
Expand All @@ -36,13 +36,19 @@ jobs:
export ITKPYTHONPACKAGE_TAG=${{ env.itk-python-package-tag }}
export ITKPYTHONPACKAGE_ORG=${{ env.itk-python-package-org }}
export ITK_MODULE_PREQ=${{ env.itk-module-deps }}
CMAKE_OPTIONS=(--cmake_options "${{ env.cmake-options }} -DCUDAToolkit_ROOT=/usr/lib64/cuda116 -DCMAKE_CUDA_COMPILER=/usr/lib64/cuda116/bin/nvcc")
export CUDA_VERSION=${{ matrix.cuda-version }}
export CUDA_VERSION_MAJOR=`(echo ${CUDA_VERSION} | cut -b1-2)`
export CUDA_VERSION_MINOR=`(echo ${CUDA_VERSION} | cut -b3-)`
CMAKE_OPTIONS="-DCUDACOMMON_CUDA_VERSION=${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}"
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCUDAToolkit_ROOT=/usr/lib64/cuda${CUDA_VERSION}"
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CUDA_COMPILER=/usr/lib64/cuda${CUDA_VERSION}/bin/nvcc"
CMAKE_OPTIONS=(--cmake_options "${CMAKE_OPTIONS}")
# The first two are not library paths but are included to be mounted in the
# docker by dockcross-manylinux-build-module-wheels.sh
export LD_LIBRARY_PATH="/home/srit/Downloads/cuda116"
export LD_LIBRARY_PATH="/home/srit/Downloads/cuda${CUDA_VERSION}"
export LD_LIBRARY_PATH="/usr/lib64/libcuda.so.1:$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/home/srit/Downloads/cuda116/targets/x86_64-linux/lib::$LD_LIBRARY_PATH"
export LD_LIBRARY_PATH="/home/srit/Downloads/cuda${CUDA_VERSION}/targets/x86_64-linux/lib:$LD_LIBRARY_PATH"
if test -e ../../ITKPythonBuilds-linux-manylinux2014.tar.zst ; then
mv ../../*zst .
fi
Expand All @@ -57,8 +63,12 @@ jobs:
export TARGET_ARCH=`(echo ${MANYLINUX_PLATFORM} | cut -d '-' -f 2)`
export ITK_MODULE_NO_CLEANUP=TRUE
echo "Building for manylinux specialization ${MANYLINUX_VERSION} and target architecture ${TARGET_ARCH}"
LIBCUDART=`basename /home/srit/Downloads/cuda${CUDA_VERSION}/targets/x86_64-linux/lib/libcudart.so.${CUDA_VERSION_MAJOR}*`
LIBCUBLAS=`basename /home/srit/Downloads/cuda${CUDA_VERSION}/targets/x86_64-linux/lib/libcublas.so.${CUDA_VERSION_MAJOR}*`
LIBCUBLASLT=`basename /home/srit/Downloads/cuda${CUDA_VERSION}/targets/x86_64-linux/lib/libcublasLt.so.${CUDA_VERSION_MAJOR}*`
LIBCUFFT=`basename /home/srit/Downloads/cuda${CUDA_VERSION}/targets/x86_64-linux/lib/libcufft.so.$((${CUDA_VERSION_MAJOR}-1))*`
./dockcross-manylinux-download-cache-and-build-module-wheels.sh "${CMAKE_OPTIONS[@]}" -x "libcuda.so.1;libcudart.so.11.0;libcublas.so.11;libcublasLt.so.11;libcufft.so.10" cp3${{ matrix.python3-minor-version }}
./dockcross-manylinux-download-cache-and-build-module-wheels.sh "${CMAKE_OPTIONS[@]}" -x "libcuda.so.1;${LIBCUDART};${LIBCUBLAS};${LIBCUBLASLT};${LIBCUFFT}" cp3${{ matrix.python3-minor-version }}
mv *zst ../..
- name: Validate build output
Expand All @@ -81,15 +91,16 @@ jobs:
- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v3
with:
name: LinuxWheel3${{ matrix.python3-minor-version }}-cuda116
name: LinuxWheel3${{ matrix.python3-minor-version }}${{ matrix.manylinux-platform }}-cuda${{ matrix.cuda-version }}
path: dist/*.whl

build-windows-cuda-python-packages:
runs-on: self-hosted-windows
strategy:
max-parallel: 2
matrix:
python3-minor-version: ["8", "9", "10", "11"]
python3-minor-version: ["8","9","10","11"]
cuda-version: ["116","121"]

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -131,7 +142,16 @@ jobs:
$env:ITKPYTHONPACKAGE_TAG = "${{ env.itk-python-package-tag }}"
$env:ITKPYTHONPACKAGE_ORG = "${{ env.itk-python-package-org }}"
$env:ITK_MODULE_PREQ = "${{ env.itk-module-deps }}"
./windows-download-cache-and-build-module-wheels.ps1 "${{ matrix.python3-minor-version }}" -setup_options "--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""" -cmake_options "${{ env.cmake-options }}"
$CUDA_VERSION = "${{ matrix.cuda-version }}"
$CUDA_VERSION_MAJOR=$CUDA_VERSION.substring(0,2)
$CUDA_VERSION_MINOR=$CUDA_VERSION.substring(2,$CUDA_VERSION.Length-2)
$env:CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}"
$env:Path = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}\bin;" + $env:Path
$LIBCUDART= (Get-Item "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}\bin\cudart64*dll" ).Name
$LIBCUBLAS= (Get-Item "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}\bin\cublas64*dll" ).Name
$LIBCUBLASLT= (Get-Item "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}\bin\cublasLt64*dll" ).Name
$LIBCUFFT= (Get-Item "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}\bin\cufft64*dll" ).Name
./windows-download-cache-and-build-module-wheels.ps1 "${{ matrix.python3-minor-version }}" -setup_options "--lib-paths ""C:/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v${CUDA_VERSION_MAJOR}.${CUDA_VERSION_MINOR}/bin"" --exclude-libs ""nvcuda.dll;concrt140.dll;${LIBCUDART};${LIBCUBLAS};${LIBCUBLASLT};${LIBCUFFT}""" -cmake_options "${{ env.cmake-options }}"
mkdir -p '${{ github.workspace }}\dist'
cp 'dist\*.whl' '${{ github.workspace }}\dist'
Expand All @@ -150,7 +170,7 @@ jobs:
- name: Publish Python package as GitHub Artifact
uses: actions/upload-artifact@v3
with:
name: WindowsWheel3${{ matrix.python3-minor-version }}-cuda116
name: WindowsWheel3${{ matrix.python3-minor-version }}-cuda${{ matrix.cuda-version }}
path: dist/*.whl

publish-python-packages-to-pypi:
Expand Down

0 comments on commit 29b89fb

Please sign in to comment.