Spaces:
Running
Running
ci : refactor cuda toolkit installation steps (#2902)
Browse filesThe commit updates the CUDA tookkit installation steps to use variables
for the CUDA version and the components versions.
The motivation for this change is that the currently the versions for
the components are used in multiple places and it is hard to update
and maintain.
- .github/workflows/build.yml +105 -50
.github/workflows/build.yml
CHANGED
|
@@ -693,60 +693,115 @@ jobs:
|
|
| 693 |
- name: Install Cuda Toolkit 11.8.0
|
| 694 |
if: ${{ matrix.cuda-toolkit == '11.8.0' }}
|
| 695 |
run: |
|
| 696 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 697 |
choco install unzip -y
|
| 698 |
-
|
| 699 |
-
|
| 700 |
-
curl -O "
|
| 701 |
-
curl -O "
|
| 702 |
-
curl -O "
|
| 703 |
-
curl -O "
|
| 704 |
-
curl -O "
|
| 705 |
-
curl -O "
|
| 706 |
-
|
| 707 |
-
|
| 708 |
-
|
| 709 |
-
|
| 710 |
-
|
| 711 |
-
|
| 712 |
-
|
| 713 |
-
xcopy "
|
| 714 |
-
xcopy "
|
| 715 |
-
xcopy "
|
| 716 |
-
|
| 717 |
-
|
| 718 |
-
|
| 719 |
-
|
| 720 |
-
|
| 721 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 722 |
if: ${{ matrix.cuda-toolkit == '12.2.0' }}
|
| 723 |
run: |
|
| 724 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 725 |
choco install unzip -y
|
| 726 |
-
|
| 727 |
-
|
| 728 |
-
curl -O "
|
| 729 |
-
curl -O "
|
| 730 |
-
curl -O "
|
| 731 |
-
curl -O "
|
| 732 |
-
curl -O "
|
| 733 |
-
curl -O "
|
| 734 |
-
curl -O "
|
| 735 |
-
|
| 736 |
-
|
| 737 |
-
|
| 738 |
-
|
| 739 |
-
|
| 740 |
-
|
| 741 |
-
|
| 742 |
-
xcopy "
|
| 743 |
-
xcopy "
|
| 744 |
-
xcopy "
|
| 745 |
-
xcopy "
|
| 746 |
-
|
| 747 |
-
|
| 748 |
-
|
| 749 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 750 |
|
| 751 |
- name: Cache CUDA compilation results
|
| 752 |
uses: actions/cache@v3
|
|
|
|
| 693 |
- name: Install Cuda Toolkit 11.8.0
|
| 694 |
if: ${{ matrix.cuda-toolkit == '11.8.0' }}
|
| 695 |
run: |
|
| 696 |
+
$CUDA_VERSION = ${{ matrix.cuda-toolkit }}
|
| 697 |
+
$CUDA_TOOLKIT_DIR = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VERSION"
|
| 698 |
+
$CUDA_DOWNLOAD = "https://developer.download.nvidia.com/compute/cuda/redist"
|
| 699 |
+
|
| 700 |
+
# Components versions
|
| 701 |
+
$CUDART_VER = "11.8.89"
|
| 702 |
+
$NVCC_VER = "11.8.89"
|
| 703 |
+
$NVRTC_VER = "11.8.89"
|
| 704 |
+
$CUBLAS_VER = "11.8.1.74"
|
| 705 |
+
$NVTX_VER = "11.8.86"
|
| 706 |
+
$VS_VER = "11.8.86"
|
| 707 |
+
$NVPROF_VER = "11.8.87"
|
| 708 |
+
$CCCL_VER = "11.8.89"
|
| 709 |
+
|
| 710 |
+
# Create the directory where the CUDA Toolkit will be installed
|
| 711 |
+
mkdir -p $CUDA_TOOLKIT_DIR
|
| 712 |
+
|
| 713 |
+
# Install unzip to extract the downloaded files
|
| 714 |
choco install unzip -y
|
| 715 |
+
|
| 716 |
+
# Download all the required components
|
| 717 |
+
curl -O "$CUDA_DOWNLOAD/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-${CUDART_VER}-archive.zip"
|
| 718 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-${NVCC_VER}-archive.zip"
|
| 719 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-${NVRTC_VER}-archive.zip"
|
| 720 |
+
curl -O "$CUDA_DOWNLOAD/libcublas/windows-x86_64/libcublas-windows-x86_64-${CUBLAS_VER}-archive.zip"
|
| 721 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-${NVTX_VER}-archive.zip"
|
| 722 |
+
curl -O "$CUDA_DOWNLOAD/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-${VS_VER}-archive.zip"
|
| 723 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-${NVPROF_VER}-archive.zip"
|
| 724 |
+
curl -O "$CUDA_DOWNLOAD/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-${CCCL_VER}-archive.zip"
|
| 725 |
+
|
| 726 |
+
# Extract all the downloaded files to the CUDA Toolkit directory
|
| 727 |
+
unzip '*.zip' -d $CUDA_TOOLKIT_DIR
|
| 728 |
+
|
| 729 |
+
# Copy all the extracted files to the main CUDA Toolkit directory
|
| 730 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_cudart-windows-x86_64-${CUDART_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 731 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvcc-windows-x86_64-${NVCC_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 732 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvrtc-windows-x86_64-${NVRTC_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 733 |
+
xcopy "$CUDA_TOOLKIT_DIR\libcublas-windows-x86_64-${CUBLAS_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 734 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvtx-windows-x86_64-${NVTX_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 735 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvprof-windows-x86_64-${NVPROF_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 736 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_cccl-windows-x86_64-${CCCL_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 737 |
+
xcopy "$CUDA_TOOLKIT_DIR\visual_studio_integration-windows-x86_64-${VS_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 738 |
+
|
| 739 |
+
# Visual Studio integration
|
| 740 |
+
xcopy "$CUDA_TOOLKIT_DIR\visual_studio_integration-windows-x86_64-${VS_VER}-archive\visual_studio_integration\MSBuildExtensions\*" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\BuildCustomizations" /E /I /H /Y
|
| 741 |
+
|
| 742 |
+
# Set environment variables
|
| 743 |
+
echo "$CUDA_TOOLKIT_DIR\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
| 744 |
+
echo "$CUDA_TOOLKIT_DIR\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
| 745 |
+
echo "CUDA_PATH=$CUDA_TOOLKIT_DIR" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
| 746 |
+
echo "CUDA_PATH_V11_8=$CUDA_TOOLKIT_DIR" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
| 747 |
+
|
| 748 |
+
- name: Install Cuda Toolkit 12.2.0
|
| 749 |
if: ${{ matrix.cuda-toolkit == '12.2.0' }}
|
| 750 |
run: |
|
| 751 |
+
$CUDA_VERSION = ${{ matrix.cuda-toolkit }}
|
| 752 |
+
$CUDA_TOOLKIT_DIR = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VERSION"
|
| 753 |
+
$CUDA_DOWNLOAD = "https://developer.download.nvidia.com/compute/cuda/redist"
|
| 754 |
+
|
| 755 |
+
# Components versions
|
| 756 |
+
$CUDART_VER = "12.2.140"
|
| 757 |
+
$NVCC_VER = "12.2.140"
|
| 758 |
+
$NVRTC_VER = "12.2.140"
|
| 759 |
+
$CUBLAS_VER = "12.2.5.6"
|
| 760 |
+
$NVTX_VER = "12.2.140"
|
| 761 |
+
$PROFILER_VER = "12.2.140"
|
| 762 |
+
$VS_VER = "12.2.140"
|
| 763 |
+
$NVPROF_VER = "12.2.142"
|
| 764 |
+
$CCCL_VER = "12.2.140"
|
| 765 |
+
|
| 766 |
+
# Create the directory where the CUDA Toolkit will be installed
|
| 767 |
+
mkdir -p $CUDA_TOOLKIT_DIR
|
| 768 |
+
|
| 769 |
+
# Install unzip to extract the downloaded files
|
| 770 |
choco install unzip -y
|
| 771 |
+
|
| 772 |
+
# Download all the required components
|
| 773 |
+
curl -O "$CUDA_DOWNLOAD/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-${CUDART_VER}-archive.zip"
|
| 774 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-${NVCC_VER}-archive.zip"
|
| 775 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-${NVRTC_VER}-archive.zip"
|
| 776 |
+
curl -O "$CUDA_DOWNLOAD/libcublas/windows-x86_64/libcublas-windows-x86_64-${CUBLAS_VER}-archive.zip"
|
| 777 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-${NVTX_VER}-archive.zip"
|
| 778 |
+
curl -O "$CUDA_DOWNLOAD/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-${PROFILER_VER}-archive.zip"
|
| 779 |
+
curl -O "$CUDA_DOWNLOAD/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-${VS_VER}-archive.zip"
|
| 780 |
+
curl -O "$CUDA_DOWNLOAD/cuda_nvprof/windows-x86_64/cuda_nvprof-windows-x86_64-${NVPROF_VER}-archive.zip"
|
| 781 |
+
curl -O "$CUDA_DOWNLOAD/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-${CCCL_VER}-archive.zip"
|
| 782 |
+
|
| 783 |
+
# Extract all the downloaded files to the CUDA Toolkit directory
|
| 784 |
+
unzip '*.zip' -d $CUDA_TOOLKIT_DIR
|
| 785 |
+
|
| 786 |
+
# Copy all the extracted files to the main CUDA Toolkit directory
|
| 787 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_cudart-windows-x86_64-${CUDART_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 788 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvcc-windows-x86_64-${NVCC_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 789 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvrtc-windows-x86_64-${NVRTC_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 790 |
+
xcopy "$CUDA_TOOLKIT_DIR\libcublas-windows-x86_64-${CUBLAS_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 791 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvtx-windows-x86_64-${NVTX_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 792 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvprof-windows-x86_64-${NVPROF_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 793 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_cccl-windows-x86_64-${CCCL_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 794 |
+
xcopy "$CUDA_TOOLKIT_DIR\cuda_profiler_api-windows-x86_64-${PROFILER_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 795 |
+
xcopy "$CUDA_TOOLKIT_DIR\visual_studio_integration-windows-x86_64-${VS_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
|
| 796 |
+
|
| 797 |
+
# Visual Studio integration
|
| 798 |
+
xcopy "$CUDA_TOOLKIT_DIR\visual_studio_integration-windows-x86_64-${VS_VER}-archive\visual_studio_integration\MSBuildExtensions\*" "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\BuildCustomizations" /E /I /H /Y
|
| 799 |
+
|
| 800 |
+
# Set environment variables
|
| 801 |
+
echo "$CUDA_TOOLKIT_DIR\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
| 802 |
+
echo "$CUDA_TOOLKIT_DIR\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
|
| 803 |
+
echo "CUDA_PATH=$CUDA_TOOLKIT_DIR" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
| 804 |
+
echo "CUDA_PATH_V12_2=$CUDA_TOOLKIT_DIR" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
|
| 805 |
|
| 806 |
- name: Cache CUDA compilation results
|
| 807 |
uses: actions/cache@v3
|