From 3cd6f55e72a585ece29491ba64c189cee79eac06 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sat, 24 Feb 2024 13:13:54 -0500 Subject: [PATCH 01/15] Add ci build pipeline for windows --- .github/workflows/cuda/Windows-env.sh | 44 +++++++++++++ .github/workflows/cuda/Windows.sh | 51 +++++++++++++++ .github/workflows/windows.yml | 92 +++++++++++++++++++++++++++ CMakeLists.txt | 2 +- 4 files changed, 188 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/cuda/Windows-env.sh create mode 100644 .github/workflows/cuda/Windows.sh create mode 100644 .github/workflows/windows.yml diff --git a/.github/workflows/cuda/Windows-env.sh b/.github/workflows/cuda/Windows-env.sh new file mode 100644 index 00000000..d1a8bf49 --- /dev/null +++ b/.github/workflows/cuda/Windows-env.sh @@ -0,0 +1,44 @@ +#!/bin/bash + +# Took from https://github.com/pyg-team/pyg-lib/ + +case ${1} in + cu121) + CUDA_HOME="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1" + PATH=${CUDA_HOME}/bin:$PATH + PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" + TORCH_CUDA_ARCH_LIST="7.0;7.5" + ;; + cu118) + CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.8 + PATH=${CUDA_HOME}/bin:$PATH + PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH + TORCH_CUDA_ARCH_LIST="7.0;7.5" + ;; + cu117) + CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.7 + PATH=${CUDA_HOME}/bin:$PATH + PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH + TORCH_CUDA_ARCH_LIST="7.0;7.5" + ;; + cu116) + CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.6 + PATH=${CUDA_HOME}/bin:$PATH + PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH + TORCH_CUDA_ARCH_LIST="7.0;7.5" + ;; + cu115) + CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.5 + PATH=${CUDA_HOME}/bin:$PATH + PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH + TORCH_CUDA_ARCH_LIST="7.0;7.5" + ;; + cu113) + CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.3 + PATH=${CUDA_HOME}/bin:$PATH + PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH + TORCH_CUDA_ARCH_LIST="7.0;7.5" + ;; + *) + ;; +esac \ No newline at end of file diff --git a/.github/workflows/cuda/Windows.sh b/.github/workflows/cuda/Windows.sh new file mode 100644 index 00000000..efc34e34 --- /dev/null +++ b/.github/workflows/cuda/Windows.sh @@ -0,0 +1,51 @@ +#!/bin/bash + +#curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip" +#7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32" + +case ${1} in + cu121) + CUDA_SHORT=12.1 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.1_531.14_windows.exe + ;; + cu118) + CUDA_SHORT=11.8 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.0_522.06_windows.exe + ;; + cu117) + CUDA_SHORT=11.7 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.1_516.94_windows.exe + ;; + cu116) + CUDA_SHORT=11.3 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe + ;; + cu115) + CUDA_SHORT=11.3 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe + ;; + cu113) + CUDA_SHORT=11.3 + CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers + CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe + ;; + *) + echo "Unrecognized CUDA_VERSION=${1}" + exit 1 + ;; +esac + +PowerShell -Command "echo 'CUDA_PATH=\"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_SHORT}\"' | Out-File -FilePath \$env:GITHUB_ENV -Encoding utf8 -Append" +PowerShell -Command "echo 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_SHORT}\bin' | Out-File -FilePath \$env:GITHUB_PATH -Encoding utf8 -Append" + +curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}" +echo "" +echo "Installing from ${CUDA_FILE}..." +PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cuobjdump_${CUDA_SHORT} nvprune_${CUDA_SHORT} cupti_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cudart_${CUDA_SHORT} cufft_dev_${CUDA_SHORT} curand_dev_${CUDA_SHORT} cusolver_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT} thrust_${CUDA_SHORT} npp_dev_${CUDA_SHORT} nvrtc_dev_${CUDA_SHORT} nvml_dev_${CUDA_SHORT}\" -Wait -NoNewWindow" +echo "Done!" +rm -f "${CUDA_FILE}" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml new file mode 100644 index 00000000..37ad892a --- /dev/null +++ b/.github/workflows/windows.yml @@ -0,0 +1,92 @@ +name: OpenSplat (Windows) + +on: + push: + branches: + - ci-windows + pull_request: + types: [ assigned, opened, synchronize, reopened ] + release: + types: [ published, edited ] + +jobs: + build: + name: ${{ matrix.os }}-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [windows-2022] # [windows-2019, windows-2022] + arch: [x64] # [x64, x86] + generator: ['Visual Studio 17 2022'] # ['Visual Studio 16 2019', 'Visual Studio 17 2022'] + torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] + cuda-version: ['cu121'] # ['cpu', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121'] + cmake-build-type: [ Release ] # [Debug, ClangTidy] +# include: +# - os: windows-2019 +# generator: 'Visual Studio 16 2019' +# - os: windows-2022 +# generator: 'Visual Studio 17 2022' + env: + CCACHE_DIR: ${{ github.workspace }}\ccache + CCACHE_BASEDIR: ${{ github.workspace }} + CL: /MP + CMAKE_GENERATOR: ${{matrix.generator}} + CMAKE_GENERATOR_PLATFORM: ${{matrix.arch}} + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + with: + submodules: recursive + + - name: Setup Windows (ccache, ninja) + run: | + Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-windows-x86_64.zip -OutFile ccache.zip + Expand-Archive -Path .\ccache.zip -DestinationPath ${{ env.CCACHE_BASEDIR }} + Remove-Item .\ccache.zip + echo "${{ env.CCACHE_BASEDIR }}\ccache-4.9.1-windows-x86_64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + +# Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip +# Expand-Archive -Path .\ninja-win.zip -Destination "${{ env.CCACHE_BASEDIR }}\bin" +# Remove-Item .\ninja-win.zip +# echo "${{ env.CCACHE_BASEDIR }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Install CUDA ${{ matrix.cuda-version }} + if: ${{ matrix.cuda-version != 'cpu' }} + run: | + bash .github/workflows/cuda/${{ runner.os }}.sh ${{ matrix.cuda-version }} + + - name: Install libtorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }} + run: | + Invoke-WebRequest https://download.pytorch.org/libtorch/${{ matrix.cuda-version }}/libtorch-win-shared-with-deps-${{ matrix.torch-version }}%2B${{ matrix.cuda-version }}.zip -OutFile libtorch.zip + Expand-Archive -Path .\libtorch.zip -DestinationPath ${{ env.CCACHE_BASEDIR }} + Remove-Item .\libtorch.zip + + - name: Cache Build + uses: actions/cache@v4 + id: cache-builds + with: + key: ${{ matrix.os }}-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }}-ccache-${{ github.run_id }} + restore-keys: ${{ matrix.os }}-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }}-ccache- + path: ${{ env.CCACHE_DIR }} + + - name: Configure and build + run: | + ls "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin" + echo $env:PATH + mkdir build + cd build + cmake .. ` + -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} ` + -DCMAKE_C_COMPILER_LAUNCHER:FILEPATH=ccache ` + -DCMAKE_CXX_COMPILER_LAUNCHER:FILEPATH=ccache ` + -DCMAKE_PREFIX_PATH=${{ github.workspace }}\libtorch + cmake --build . --parallel --config ${{ matrix.cmake-build-type }} + + - name: Clean compiler cache + shell: pwsh + run: | + ccache --show-stats + ccache --evict-older-than 7d + ccache -s + ccache --show-stats diff --git a/CMakeLists.txt b/CMakeLists.txt index 136c403e..c194e5aa 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,7 +16,7 @@ if (NOT WIN32 AND NOT APPLE) set(STDPPFS_LIBRARY stdc++fs) endif() -find_package(CUDA REQUIRED) +find_package(CUDAToolkit REQUIRED) find_package(Torch REQUIRED) find_package(OpenCV HINTS "${OPENCV_DIR}" REQUIRED) From f0acbcd9fcc1fd0dd35e261431655e977f78a80e Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sat, 24 Feb 2024 13:39:14 -0500 Subject: [PATCH 02/15] Add cuda visual_studio_integration to support MSVC build --- .github/workflows/cuda/Windows.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cuda/Windows.sh b/.github/workflows/cuda/Windows.sh index efc34e34..0a2258ce 100644 --- a/.github/workflows/cuda/Windows.sh +++ b/.github/workflows/cuda/Windows.sh @@ -46,6 +46,6 @@ PowerShell -Command "echo 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$ curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}" echo "" echo "Installing from ${CUDA_FILE}..." -PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cuobjdump_${CUDA_SHORT} nvprune_${CUDA_SHORT} cupti_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cudart_${CUDA_SHORT} cufft_dev_${CUDA_SHORT} curand_dev_${CUDA_SHORT} cusolver_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT} thrust_${CUDA_SHORT} npp_dev_${CUDA_SHORT} nvrtc_dev_${CUDA_SHORT} nvml_dev_${CUDA_SHORT}\" -Wait -NoNewWindow" +PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cuobjdump_${CUDA_SHORT} nvprune_${CUDA_SHORT} cupti_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cudart_${CUDA_SHORT} cufft_dev_${CUDA_SHORT} curand_dev_${CUDA_SHORT} cusolver_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT} thrust_${CUDA_SHORT} npp_dev_${CUDA_SHORT} nvrtc_dev_${CUDA_SHORT} nvml_dev_${CUDA_SHORT} visual_studio_integration_${CUDA_SHORT} \" -Wait -NoNewWindow" echo "Done!" rm -f "${CUDA_FILE}" From 0fd452260aa04eb6555e704c3170f949a43849ea Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sat, 24 Feb 2024 14:31:31 -0500 Subject: [PATCH 03/15] Refactor Windows cuda installer --- .github/workflows/cuda/Windows.ps1 | 38 ++++++++++++++++++++++++++++++ .github/workflows/windows.yml | 4 ++-- 2 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/cuda/Windows.ps1 diff --git a/.github/workflows/cuda/Windows.ps1 b/.github/workflows/cuda/Windows.ps1 new file mode 100644 index 00000000..a9b34c2e --- /dev/null +++ b/.github/workflows/cuda/Windows.ps1 @@ -0,0 +1,38 @@ + +# Took from https://github.com/isl-org/Open3D + +# CUDA major and minor version +$CUDA_VER_FULL = $args[0] +$CUDA_VER_ARR = $CUDA_VER_FULL.Split(".") +$CUDA_VER = "$($CUDA_VER_ARR[0]).$($CUDA_VER_ARR[1])" +$CUDA_VER_ID = "$($CUDA_VER_ARR[0])_$($CUDA_VER_ARR[1])" + +# Network installer url +if ( $CUDA_VER_ARR[0] -ge 11 ) { +$CUDA_URL = "https://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" +} else { +$CUDA_URL = "https://developer.download.nvidia.com/compute/cuda/$CUDA_VER/Prod/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" +} + +# Installer arguments +$CUDA_INSTALL_ARGS = "-s" + +# Required packages +$CUDA_PACKAGES = "nvcc", "cuobjdump", "nvprune", "cupti", "cublas_dev", "cudart", "cufft_dev", "curand_dev", "cusolver_dev", "cusparse_dev", "thrust", "npp_dev", "nvrtc_dev", "nvml_dev", "visual_studio_integration" +$CUDA_PACKAGES.ForEach({ $CUDA_INSTALL_ARGS += " $($_)_$($CUDA_VER)" }) + +# Download and install CUDA +echo "Downloading CUDA installer from $CUDA_URL" +Invoke-WebRequest $CUDA_URL -OutFile cuda.exe +echo "Installing CUDA..." +Start-Process -Wait -FilePath .\cuda.exe -ArgumentList "$CUDA_INSTALL_ARGS" + +if ( !$? ) { + exit 1 +} + +# Add CUDA environment variables. +$CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VER" +echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 37ad892a..f26f021d 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -20,7 +20,7 @@ jobs: arch: [x64] # [x64, x86] generator: ['Visual Studio 17 2022'] # ['Visual Studio 16 2019', 'Visual Studio 17 2022'] torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] - cuda-version: ['cu121'] # ['cpu', 'cu113', 'cu116', 'cu117', 'cu118', 'cu121'] + cuda-version: [12.1.1] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] cmake-build-type: [ Release ] # [Debug, ClangTidy] # include: # - os: windows-2019 @@ -54,7 +54,7 @@ jobs: - name: Install CUDA ${{ matrix.cuda-version }} if: ${{ matrix.cuda-version != 'cpu' }} run: | - bash .github/workflows/cuda/${{ runner.os }}.sh ${{ matrix.cuda-version }} + .github/workflows/cuda/${{ runner.os }}.ps1 ${{ matrix.cuda-version }} - name: Install libtorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }} run: | From 52fb47b3c014d4d41ac90d5c248236708bf4d60d Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sat, 24 Feb 2024 18:30:09 -0500 Subject: [PATCH 04/15] Adjust cuda subpackage deps --- .github/workflows/cuda/Windows.ps1 | 27 ++++++++++++++++++++++++++- .github/workflows/windows.yml | 15 +++++++++------ 2 files changed, 35 insertions(+), 7 deletions(-) diff --git a/.github/workflows/cuda/Windows.ps1 b/.github/workflows/cuda/Windows.ps1 index a9b34c2e..90e77b82 100644 --- a/.github/workflows/cuda/Windows.ps1 +++ b/.github/workflows/cuda/Windows.ps1 @@ -6,6 +6,27 @@ $CUDA_VER_FULL = $args[0] $CUDA_VER_ARR = $CUDA_VER_FULL.Split(".") $CUDA_VER = "$($CUDA_VER_ARR[0]).$($CUDA_VER_ARR[1])" $CUDA_VER_ID = "$($CUDA_VER_ARR[0])_$($CUDA_VER_ARR[1])" +$CUDA_VER_SHORT = "cu$($CUDA_VER_ARR[0])$($CUDA_VER_ARR[1])" + +# Free up disk space +# Docker Cache +# docker rmi $(docker images -q -a) +# Android SDK +# if ($Env:ANDROID_HOME) { +# Remove-Item -Recurse -Force $Env:ANDROID_HOME -ErrorAction Ignore +# } +# if ($Env:ANDROID_NDK_HOME) { +# Remove-Item -Recurse -Force $Env:ANDROID_NDK_HOME -ErrorAction Ignore +# } +# # JVM +# if ($Env:JAVA_HOME_11_X64) { +# Remove-Item -Recurse -Force $Env:JAVA_HOME_11_X64 -ErrorAction Ignore +# } +# if ($Env:JAVA_HOME_8_X64) { +# Remove-Item -Recurse -Force $Env:JAVA_HOME_8_X64 -ErrorAction Ignore +# } +#Remove-Item -Force -Recurse -LiteralPath "C:\msys64\" +#Remove-Item -Force -Recurse -LiteralPath "C:\mingw64\" # Network installer url if ( $CUDA_VER_ARR[0] -ge 11 ) { @@ -18,7 +39,7 @@ $CUDA_URL = "https://developer.download.nvidia.com/compute/cuda/$CUDA_VER/Prod/n $CUDA_INSTALL_ARGS = "-s" # Required packages -$CUDA_PACKAGES = "nvcc", "cuobjdump", "nvprune", "cupti", "cublas_dev", "cudart", "cufft_dev", "curand_dev", "cusolver_dev", "cusparse_dev", "thrust", "npp_dev", "nvrtc_dev", "nvml_dev", "visual_studio_integration" +$CUDA_PACKAGES = "nvcc", "cuobjdump", "nvprune", "cupti", "cublas_dev", "cudart", "cufft_dev", "curand_dev", "cusolver_dev", "cusparse_dev", "thrust", "npp_dev", "nvrtc_dev", "nvml_dev", "nvtx", "visual_studio_integration" $CUDA_PACKAGES.ForEach({ $CUDA_INSTALL_ARGS += " $($_)_$($CUDA_VER)" }) # Download and install CUDA @@ -31,8 +52,12 @@ if ( !$? ) { exit 1 } +Remove-Item .\cuda.exe -Force +Get-PSDrive + # Add CUDA environment variables. $CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VER" echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +echo "CUDA_VER_SHORT=$CUDA_VER_SHORT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index f26f021d..2ce54820 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -45,11 +45,11 @@ jobs: Expand-Archive -Path .\ccache.zip -DestinationPath ${{ env.CCACHE_BASEDIR }} Remove-Item .\ccache.zip echo "${{ env.CCACHE_BASEDIR }}\ccache-4.9.1-windows-x86_64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - -# Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip -# Expand-Archive -Path .\ninja-win.zip -Destination "${{ env.CCACHE_BASEDIR }}\bin" -# Remove-Item .\ninja-win.zip -# echo "${{ env.CCACHE_BASEDIR }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + # Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip + # Expand-Archive -Path .\ninja-win.zip -Destination "${{ env.CCACHE_BASEDIR }}\bin" + # Remove-Item .\ninja-win.zip + # echo "${{ env.CCACHE_BASEDIR }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Install CUDA ${{ matrix.cuda-version }} if: ${{ matrix.cuda-version != 'cpu' }} @@ -58,7 +58,10 @@ jobs: - name: Install libtorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }} run: | - Invoke-WebRequest https://download.pytorch.org/libtorch/${{ matrix.cuda-version }}/libtorch-win-shared-with-deps-${{ matrix.torch-version }}%2B${{ matrix.cuda-version }}.zip -OutFile libtorch.zip + echo $env:CUDA_VER_SHORT + $LIBTORCH_URL = "https://download.pytorch.org/libtorch/$env:CUDA_VER_SHORT/libtorch-win-shared-with-deps-${{ matrix.torch-version }}%2B$($env:CUDA_VER_SHORT).zip" + echo $LIBTORCH_URL + Invoke-WebRequest $LIBTORCH_URL -OutFile libtorch.zip Expand-Archive -Path .\libtorch.zip -DestinationPath ${{ env.CCACHE_BASEDIR }} Remove-Item .\libtorch.zip From 269b1290a614f0b2280d25077afcc9d00c7d09a0 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sat, 24 Feb 2024 21:57:32 -0500 Subject: [PATCH 05/15] Switch to cuda 11.8 to support msvc-based build (cuda 12.x should work fine after pytorch PR# 116926 gets merged). --- .github/workflows/cuda/Windows.ps1 | 5 +++++ .github/workflows/windows.yml | 10 ++++------ 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/cuda/Windows.ps1 b/.github/workflows/cuda/Windows.ps1 index 90e77b82..56e1e26e 100644 --- a/.github/workflows/cuda/Windows.ps1 +++ b/.github/workflows/cuda/Windows.ps1 @@ -55,9 +55,14 @@ if ( !$? ) { Remove-Item .\cuda.exe -Force Get-PSDrive +Get-ChildItem -Path "C:/Program Files" -Recurse -File -Filter "nvToolsExt.dll" -ErrorAction SilentlyContinue + # Add CUDA environment variables. $CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VER" echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "CUDA_VER_SHORT=$CUDA_VER_SHORT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + +$NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" +echo "NVTOOLSEXT_PATH=$NVTOOLSEXT_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 2ce54820..b7dd9110 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -11,7 +11,7 @@ on: jobs: build: - name: ${{ matrix.os }}-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }} + name: ${{ matrix.os }}-cuda-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }} runs-on: ${{ matrix.os }} strategy: fail-fast: false @@ -20,7 +20,7 @@ jobs: arch: [x64] # [x64, x86] generator: ['Visual Studio 17 2022'] # ['Visual Studio 16 2019', 'Visual Studio 17 2022'] torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] - cuda-version: [12.1.1] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] + cuda-version: [11.8.0] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] cmake-build-type: [ Release ] # [Debug, ClangTidy] # include: # - os: windows-2019 @@ -58,7 +58,6 @@ jobs: - name: Install libtorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }} run: | - echo $env:CUDA_VER_SHORT $LIBTORCH_URL = "https://download.pytorch.org/libtorch/$env:CUDA_VER_SHORT/libtorch-win-shared-with-deps-${{ matrix.torch-version }}%2B$($env:CUDA_VER_SHORT).zip" echo $LIBTORCH_URL Invoke-WebRequest $LIBTORCH_URL -OutFile libtorch.zip @@ -69,13 +68,12 @@ jobs: uses: actions/cache@v4 id: cache-builds with: - key: ${{ matrix.os }}-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }}-ccache-${{ github.run_id }} - restore-keys: ${{ matrix.os }}-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }}-ccache- + key: ${{ matrix.os }}-cuda-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }}-ccache-${{ github.run_id }} + restore-keys: ${{ matrix.os }}-cuda-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }}-ccache- path: ${{ env.CCACHE_DIR }} - name: Configure and build run: | - ls "C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v12.1/bin" echo $env:PATH mkdir build cd build From e8bd73733e68cc246741328c6e751b49c8c49e9c Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sat, 24 Feb 2024 23:10:53 -0500 Subject: [PATCH 06/15] Patch NvToolsExt --- .github/workflows/cuda/Windows.ps1 | 34 +++++++++++++++++++++++------- 1 file changed, 26 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cuda/Windows.ps1 b/.github/workflows/cuda/Windows.ps1 index 56e1e26e..92f2e777 100644 --- a/.github/workflows/cuda/Windows.ps1 +++ b/.github/workflows/cuda/Windows.ps1 @@ -1,6 +1,3 @@ - -# Took from https://github.com/isl-org/Open3D - # CUDA major and minor version $CUDA_VER_FULL = $args[0] $CUDA_VER_ARR = $CUDA_VER_FULL.Split(".") @@ -28,6 +25,31 @@ $CUDA_VER_SHORT = "cu$($CUDA_VER_ARR[0])$($CUDA_VER_ARR[1])" #Remove-Item -Force -Recurse -LiteralPath "C:\msys64\" #Remove-Item -Force -Recurse -LiteralPath "C:\mingw64\" +# Install NvToolsExt +$NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" +if (Test-Path -Path "$NVTOOLSEXT_PATH " -PathType Container) { +Write-Output "Existing nvtools installation already found, continuing..." +return +} +function New-TemporaryDirectory() { + New-TemporaryFile | ForEach-Object { Remove-Item $_; New-Item -ItemType Directory -Path $_ } +} +$NV_TOOLS_URL = "https://ossci-windows.s3.amazonaws.com/NvToolsExt.7z" # pytorch test-infra +$tmpToolsDl = New-TemporaryFile +Write-Output "Downloading NvTools, $NV_TOOLS_URL" +Invoke-WebRequest -Uri "$NV_TOOLS_URL" -OutFile "$tmpToolsDl" +$tmpExtractedNvTools = New-TemporaryDirectory +7z x "$tmpToolsDl" -o"$tmpExtractedNvTools" +Write-Output "Copying NvTools, '$tmpExtractedNvTools' -> '$NVTOOLSEXT_PATH'" +New-Item -Path "$NVTOOLSEXT_PATH "-ItemType "directory" -Force +Copy-Item -Recurse -Path "$tmpExtractedNvTools\*" -Destination "$NVTOOLSEXT_PATH" +Remove-Item "$tmpExtractedNvTools" -Recurse -Force +Remove-Item "$tmpToolsDl" -Recurse -Force + +$NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" +echo "NVTOOLSEXT_PATH=$NVTOOLSEXT_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + # Network installer url if ( $CUDA_VER_ARR[0] -ge 11 ) { $CUDA_URL = "https://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" @@ -53,9 +75,6 @@ if ( !$? ) { } Remove-Item .\cuda.exe -Force -Get-PSDrive - -Get-ChildItem -Path "C:/Program Files" -Recurse -File -Filter "nvToolsExt.dll" -ErrorAction SilentlyContinue # Add CUDA environment variables. $CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VER" @@ -64,5 +83,4 @@ echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV - echo "CUDA_VER_SHORT=$CUDA_VER_SHORT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append -$NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" -echo "NVTOOLSEXT_PATH=$NVTOOLSEXT_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +Get-PSDrive From 1838b939d0e9a3adaa29589c17a8793420a8d2ff Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 14:18:48 -0500 Subject: [PATCH 07/15] Add CUDA cache to speedup windows setup task --- .github/workflows/cuda/Windows.ps1 | 61 +++++++++++++++--------------- .github/workflows/windows.yml | 36 ++++++++++++++++-- 2 files changed, 63 insertions(+), 34 deletions(-) diff --git a/.github/workflows/cuda/Windows.ps1 b/.github/workflows/cuda/Windows.ps1 index 92f2e777..cfc82f51 100644 --- a/.github/workflows/cuda/Windows.ps1 +++ b/.github/workflows/cuda/Windows.ps1 @@ -25,31 +25,6 @@ $CUDA_VER_SHORT = "cu$($CUDA_VER_ARR[0])$($CUDA_VER_ARR[1])" #Remove-Item -Force -Recurse -LiteralPath "C:\msys64\" #Remove-Item -Force -Recurse -LiteralPath "C:\mingw64\" -# Install NvToolsExt -$NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" -if (Test-Path -Path "$NVTOOLSEXT_PATH " -PathType Container) { -Write-Output "Existing nvtools installation already found, continuing..." -return -} -function New-TemporaryDirectory() { - New-TemporaryFile | ForEach-Object { Remove-Item $_; New-Item -ItemType Directory -Path $_ } -} -$NV_TOOLS_URL = "https://ossci-windows.s3.amazonaws.com/NvToolsExt.7z" # pytorch test-infra -$tmpToolsDl = New-TemporaryFile -Write-Output "Downloading NvTools, $NV_TOOLS_URL" -Invoke-WebRequest -Uri "$NV_TOOLS_URL" -OutFile "$tmpToolsDl" -$tmpExtractedNvTools = New-TemporaryDirectory -7z x "$tmpToolsDl" -o"$tmpExtractedNvTools" -Write-Output "Copying NvTools, '$tmpExtractedNvTools' -> '$NVTOOLSEXT_PATH'" -New-Item -Path "$NVTOOLSEXT_PATH "-ItemType "directory" -Force -Copy-Item -Recurse -Path "$tmpExtractedNvTools\*" -Destination "$NVTOOLSEXT_PATH" -Remove-Item "$tmpExtractedNvTools" -Recurse -Force -Remove-Item "$tmpToolsDl" -Recurse -Force - -$NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" -echo "NVTOOLSEXT_PATH=$NVTOOLSEXT_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - - # Network installer url if ( $CUDA_VER_ARR[0] -ge 11 ) { $CUDA_URL = "https://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" @@ -77,10 +52,36 @@ if ( !$? ) { Remove-Item .\cuda.exe -Force # Add CUDA environment variables. -$CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VER" -echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -echo "CUDA_VER_SHORT=$CUDA_VER_SHORT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append +# $CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VER" +# echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +# echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +# echo "CUDA_VER_SHORT=$CUDA_VER_SHORT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append +# echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append +# $TORCH_CUDA_ARCH_LIST = "7.0;7.5" +# echo "TORCH_CUDA_ARCH_LIST=$TORCH_CUDA_ARCH_LIST" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + +# Install NvToolsExt +$NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" +if (Test-Path -Path "$NVTOOLSEXT_PATH " -PathType Container) { +Write-Output "Existing nvtools installation already found, continuing..." +return +} +function New-TemporaryDirectory() { + New-TemporaryFile | ForEach-Object { Remove-Item $_; New-Item -ItemType Directory -Path $_ } +} +$NV_TOOLS_URL = "https://ossci-windows.s3.amazonaws.com/NvToolsExt.7z" # pytorch test-infra +$tmpToolsDl = New-TemporaryFile +Write-Output "Downloading NvTools, $NV_TOOLS_URL" +Invoke-WebRequest -Uri "$NV_TOOLS_URL" -OutFile "$tmpToolsDl" +$tmpExtractedNvTools = New-TemporaryDirectory +7z x "$tmpToolsDl" -o"$tmpExtractedNvTools" +Write-Output "Copying NvTools, '$tmpExtractedNvTools' -> '$NVTOOLSEXT_PATH'" +New-Item -Path "$NVTOOLSEXT_PATH "-ItemType "directory" -Force +Copy-Item -Recurse -Path "$tmpExtractedNvTools\*" -Destination "$NVTOOLSEXT_PATH" +Remove-Item "$tmpExtractedNvTools" -Recurse -Force +Remove-Item "$tmpToolsDl" -Recurse -Force + +# $NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" +# echo "NVTOOLSEXT_PATH=$NVTOOLSEXT_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append Get-PSDrive diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index b7dd9110..ff975e7b 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -33,13 +33,14 @@ jobs: CL: /MP CMAKE_GENERATOR: ${{matrix.generator}} CMAKE_GENERATOR_PLATFORM: ${{matrix.arch}} + TORCH_CUDA_ARCH_LIST: "7.0;7.5" steps: - name: Checkout Repository uses: actions/checkout@v4 with: submodules: recursive - - name: Setup Windows (ccache, ninja) + - name: Setup Windows run: | Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-windows-x86_64.zip -OutFile ccache.zip Expand-Archive -Path .\ccache.zip -DestinationPath ${{ env.CCACHE_BASEDIR }} @@ -51,12 +52,39 @@ jobs: # Remove-Item .\ninja-win.zip # echo "${{ env.CCACHE_BASEDIR }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - - name: Install CUDA ${{ matrix.cuda-version }} - if: ${{ matrix.cuda-version != 'cpu' }} + - name: Restore CUDA Cache + uses: actions/cache@v4 + id: cuda-cache + with: + key: cuda-${{matrix.CUDA-VERSION}}-${{ matrix.os }} + path: | + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA + C:\Program Files\NVIDIA Corporation\NvToolsExt + + - name: Install CUDA + if: ${{ steps.cuda-cache.outputs.cache-hit != 'true' && matrix.cuda-version != 'cpu' }} run: | + echo ${{ steps.cuda-cache.outputs.cache-hit != 'true' }} + echo ${{ matrix.cuda-version != 'cpu' }} .github/workflows/cuda/${{ runner.os }}.ps1 ${{ matrix.cuda-version }} - - name: Install libtorch ${{ matrix.torch-version }}+${{ matrix.cuda-version }} + - name: Setup CUDA + shell: bash + run: | + CUDA_VER_FULL=${{ matrix.cuda-version }} + CUDA_VER_ARR=($(echo ${CUDA_VER_FULL} | tr "." " ")) + CUDA_VER="${CUDA_VER_ARR[0]}.${CUDA_VER_ARR[1]}" + CUDA_VER_ID="${CUDA_VER_ARR[0]}_${CUDA_VER_ARR[1]}" + CUDA_VER_SHORT="cu${CUDA_VER_ARR[0]}${CUDA_VER_ARR[1]}" + + echo "CUDA_VER_SHORT=${CUDA_VER_SHORT}" >> ${GITHUB_ENV} + echo "CUDA_PATH=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}" >> ${GITHUB_ENV} + echo "CUDA_PATH_V${CUDA_VER_ID}=C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}" >> ${GITHUB_ENV} + echo "CUDA_PATH_VX_Y=CUDA_PATH_V${CUDA_VER_ID}" >> ${GITHUB_ENV} + echo "NVTOOLSEXT_PATH=C:\\Program Files\\NVIDIA Corporation\\NvToolsExt" >> ${GITHUB_ENV} + echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\bin" >> ${GITHUB_PATH} + + - name: Install libtorch run: | $LIBTORCH_URL = "https://download.pytorch.org/libtorch/$env:CUDA_VER_SHORT/libtorch-win-shared-with-deps-${{ matrix.torch-version }}%2B$($env:CUDA_VER_SHORT).zip" echo $LIBTORCH_URL From be70920291b35932ce7cc4d4ce398ded0726491c Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 14:39:18 -0500 Subject: [PATCH 08/15] Add libtorch cache to speedup windows setup task --- .github/workflows/windows.yml | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index ff975e7b..bf415a12 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -43,14 +43,14 @@ jobs: - name: Setup Windows run: | Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-windows-x86_64.zip -OutFile ccache.zip - Expand-Archive -Path .\ccache.zip -DestinationPath ${{ env.CCACHE_BASEDIR }} + Expand-Archive -Path .\ccache.zip -DestinationPath ${{ github.workspace }} Remove-Item .\ccache.zip - echo "${{ env.CCACHE_BASEDIR }}\ccache-4.9.1-windows-x86_64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "${{ github.workspace }}\ccache-4.9.1-windows-x86_64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append # Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip - # Expand-Archive -Path .\ninja-win.zip -Destination "${{ env.CCACHE_BASEDIR }}\bin" + # Expand-Archive -Path .\ninja-win.zip -Destination "${{ github.workspace }}\bin" # Remove-Item .\ninja-win.zip - # echo "${{ env.CCACHE_BASEDIR }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + # echo "${{ github.workspace }}\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - name: Restore CUDA Cache uses: actions/cache@v4 @@ -62,10 +62,8 @@ jobs: C:\Program Files\NVIDIA Corporation\NvToolsExt - name: Install CUDA - if: ${{ steps.cuda-cache.outputs.cache-hit != 'true' && matrix.cuda-version != 'cpu' }} + if: ${{ steps.cuda-cache.outputs.cache-hit != 'true' }} run: | - echo ${{ steps.cuda-cache.outputs.cache-hit != 'true' }} - echo ${{ matrix.cuda-version != 'cpu' }} .github/workflows/cuda/${{ runner.os }}.ps1 ${{ matrix.cuda-version }} - name: Setup CUDA @@ -84,12 +82,21 @@ jobs: echo "NVTOOLSEXT_PATH=C:\\Program Files\\NVIDIA Corporation\\NvToolsExt" >> ${GITHUB_ENV} echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\bin" >> ${GITHUB_PATH} + - name: Restore libtorch Cache + uses: actions/cache@v4 + id: libtorch-cache + with: + key: libtorch-${{ matrix.torch-version }}-${{env.CUDA_VER_SHORT}}-${{ matrix.os }} + path: | + ${{ github.workspace }}\libtorch + - name: Install libtorch + if: ${{ steps.libtorch-cache.outputs.cache-hit != 'true' }} run: | $LIBTORCH_URL = "https://download.pytorch.org/libtorch/$env:CUDA_VER_SHORT/libtorch-win-shared-with-deps-${{ matrix.torch-version }}%2B$($env:CUDA_VER_SHORT).zip" echo $LIBTORCH_URL Invoke-WebRequest $LIBTORCH_URL -OutFile libtorch.zip - Expand-Archive -Path .\libtorch.zip -DestinationPath ${{ env.CCACHE_BASEDIR }} + Expand-Archive -Path .\libtorch.zip -DestinationPath ${{ github.workspace }} Remove-Item .\libtorch.zip - name: Cache Build From 6ae546a5675d5638433db3271ec95f052cba9503 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 15:08:13 -0500 Subject: [PATCH 09/15] Add opencv into build matrix --- .github/workflows/windows.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index bf415a12..8dc71c88 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -21,6 +21,7 @@ jobs: generator: ['Visual Studio 17 2022'] # ['Visual Studio 16 2019', 'Visual Studio 17 2022'] torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] cuda-version: [11.8.0] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] + opencv-version: [4.9.0] # [4.7.0, 4.8.1, 4.9.0] cmake-build-type: [ Release ] # [Debug, ClangTidy] # include: # - os: windows-2019 @@ -42,11 +43,17 @@ jobs: - name: Setup Windows run: | + # Install ccache Invoke-WebRequest https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-windows-x86_64.zip -OutFile ccache.zip Expand-Archive -Path .\ccache.zip -DestinationPath ${{ github.workspace }} Remove-Item .\ccache.zip echo "${{ github.workspace }}\ccache-4.9.1-windows-x86_64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append - + + # Install OpenCV + Invoke-WebRequest https://github.com/opencv/opencv/releases/download/${{ matrix.opencv-version }}/opencv-${{ matrix.opencv-version }}-windows.exe -OutFile opencv.exe + Start-Process -Wait -FilePath .\opencv.exe -ArgumentList "-oopencv -y" + Remove-Item .\opencv.exe + # Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip # Expand-Archive -Path .\ninja-win.zip -Destination "${{ github.workspace }}\bin" # Remove-Item .\ninja-win.zip @@ -58,7 +65,7 @@ jobs: with: key: cuda-${{matrix.CUDA-VERSION}}-${{ matrix.os }} path: | - C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA + C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA* C:\Program Files\NVIDIA Corporation\NvToolsExt - name: Install CUDA @@ -82,7 +89,7 @@ jobs: echo "NVTOOLSEXT_PATH=C:\\Program Files\\NVIDIA Corporation\\NvToolsExt" >> ${GITHUB_ENV} echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\bin" >> ${GITHUB_PATH} - - name: Restore libtorch Cache + - name: Restore LibTorch Cache uses: actions/cache@v4 id: libtorch-cache with: @@ -90,7 +97,7 @@ jobs: path: | ${{ github.workspace }}\libtorch - - name: Install libtorch + - name: Install LibTorch if: ${{ steps.libtorch-cache.outputs.cache-hit != 'true' }} run: | $LIBTORCH_URL = "https://download.pytorch.org/libtorch/$env:CUDA_VER_SHORT/libtorch-win-shared-with-deps-${{ matrix.torch-version }}%2B$($env:CUDA_VER_SHORT).zip" @@ -107,7 +114,7 @@ jobs: restore-keys: ${{ matrix.os }}-cuda-${{ matrix.cuda-version }}-torch-${{ matrix.torch-version }}-${{ matrix.cmake-build-type }}-ccache- path: ${{ env.CCACHE_DIR }} - - name: Configure and build + - name: Configure And Build run: | echo $env:PATH mkdir build @@ -116,10 +123,11 @@ jobs: -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} ` -DCMAKE_C_COMPILER_LAUNCHER:FILEPATH=ccache ` -DCMAKE_CXX_COMPILER_LAUNCHER:FILEPATH=ccache ` - -DCMAKE_PREFIX_PATH=${{ github.workspace }}\libtorch + -DCMAKE_PREFIX_PATH=${{ github.workspace }}\libtorch ` + -DOPENCV_DIR=${{ github.workspace }}\OpenCV\opencv\build cmake --build . --parallel --config ${{ matrix.cmake-build-type }} - - name: Clean compiler cache + - name: Clean Compiler Cache shell: pwsh run: | ccache --show-stats From de537deea1c9b132505b86fed90222cddd5e0698 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 19:44:36 -0500 Subject: [PATCH 10/15] Make cuda visual studio integration available from cuda cache hit --- .github/workflows/windows.yml | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 8dc71c88..381f9146 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -23,18 +23,18 @@ jobs: cuda-version: [11.8.0] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] opencv-version: [4.9.0] # [4.7.0, 4.8.1, 4.9.0] cmake-build-type: [ Release ] # [Debug, ClangTidy] -# include: + include: # - os: windows-2019 # generator: 'Visual Studio 16 2019' -# - os: windows-2022 -# generator: 'Visual Studio 17 2022' + - os: windows-2022 + generator: 'Visual Studio 17 2022' env: CCACHE_DIR: ${{ github.workspace }}\ccache CCACHE_BASEDIR: ${{ github.workspace }} CL: /MP CMAKE_GENERATOR: ${{matrix.generator}} CMAKE_GENERATOR_PLATFORM: ${{matrix.arch}} - TORCH_CUDA_ARCH_LIST: "7.0;7.5" + TORCH_CUDA_ARCH_LIST: '7.0;7.5' steps: - name: Checkout Repository uses: actions/checkout@v4 @@ -88,6 +88,17 @@ jobs: echo "CUDA_PATH_VX_Y=CUDA_PATH_V${CUDA_VER_ID}" >> ${GITHUB_ENV} echo "NVTOOLSEXT_PATH=C:\\Program Files\\NVIDIA Corporation\\NvToolsExt" >> ${GITHUB_ENV} echo "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\bin" >> ${GITHUB_PATH} + + # Add cuda visual studio integration + cache_hit="${{ steps.cuda-cache.outputs.cache-hit }}" + generator="${{ matrix.generator }}" + if [[ $cache_hit == 'true' ]]; then + if [[ $generator == 'Visual Studio 17 2022' ]]; then + cp -R "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\extras\\visual_studio_integration\\MSBuildExtensions\\." "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations" + else + cp -R "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\extras\\visual_studio_integration\\MSBuildExtensions\\." "C:\Program Files\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\BuildCustomizations" + fi + fi - name: Restore LibTorch Cache uses: actions/cache@v4 @@ -124,7 +135,8 @@ jobs: -DCMAKE_C_COMPILER_LAUNCHER:FILEPATH=ccache ` -DCMAKE_CXX_COMPILER_LAUNCHER:FILEPATH=ccache ` -DCMAKE_PREFIX_PATH=${{ github.workspace }}\libtorch ` - -DOPENCV_DIR=${{ github.workspace }}\OpenCV\opencv\build + -DOPENCV_DIR=${{ github.workspace }}\OpenCV\opencv\build ` + -DTORCH_CUDA_ARCH_LIST="${{ env.TORCH_CUDA_ARCH_LIST }}" cmake --build . --parallel --config ${{ matrix.cmake-build-type }} - name: Clean Compiler Cache From 7289f1c4e32357a561db7c3e1498ed136055fc1f Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 20:25:14 -0500 Subject: [PATCH 11/15] Test windows-2019 with MSVC16 --- .github/workflows/windows.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 381f9146..1dc27e27 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,18 +16,17 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022] # [windows-2019, windows-2022] + os: [windows-2019] # [windows-2019, windows-2022] arch: [x64] # [x64, x86] - generator: ['Visual Studio 17 2022'] # ['Visual Studio 16 2019', 'Visual Studio 17 2022'] torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] cuda-version: [11.8.0] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] opencv-version: [4.9.0] # [4.7.0, 4.8.1, 4.9.0] cmake-build-type: [ Release ] # [Debug, ClangTidy] include: -# - os: windows-2019 -# generator: 'Visual Studio 16 2019' - - os: windows-2022 - generator: 'Visual Studio 17 2022' + - os: windows-2019 + generator: 'Visual Studio 16 2019' +# - os: windows-2022 +# generator: 'Visual Studio 17 2022' env: CCACHE_DIR: ${{ github.workspace }}\ccache CCACHE_BASEDIR: ${{ github.workspace }} @@ -63,7 +62,7 @@ jobs: uses: actions/cache@v4 id: cuda-cache with: - key: cuda-${{matrix.CUDA-VERSION}}-${{ matrix.os }} + key: cuda-${{matrix.CUDA-VERSION}}-windows-2022 path: | C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA* C:\Program Files\NVIDIA Corporation\NvToolsExt @@ -96,7 +95,7 @@ jobs: if [[ $generator == 'Visual Studio 17 2022' ]]; then cp -R "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\extras\\visual_studio_integration\\MSBuildExtensions\\." "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations" else - cp -R "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\extras\\visual_studio_integration\\MSBuildExtensions\\." "C:\Program Files\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\BuildCustomizations" + cp -R "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v${CUDA_VER}\\extras\\visual_studio_integration\\MSBuildExtensions\\." "C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\MSBuild\Microsoft\VC\v160\BuildCustomizations" fi fi @@ -104,7 +103,7 @@ jobs: uses: actions/cache@v4 id: libtorch-cache with: - key: libtorch-${{ matrix.torch-version }}-${{env.CUDA_VER_SHORT}}-${{ matrix.os }} + key: libtorch-${{ matrix.torch-version }}-${{env.CUDA_VER_SHORT}}-windows-2022 path: | ${{ github.workspace }}\libtorch @@ -131,6 +130,7 @@ jobs: mkdir build cd build cmake .. ` + -G"${{ matrix.generator }}" ` -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} ` -DCMAKE_C_COMPILER_LAUNCHER:FILEPATH=ccache ` -DCMAKE_CXX_COMPILER_LAUNCHER:FILEPATH=ccache ` From a07a56c2565c38fe0e8402bf3be12efe3d5fb834 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 21:53:13 -0500 Subject: [PATCH 12/15] Share cuda and libtorch cache across all windows versions --- .github/workflows/windows.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 1dc27e27..05a53a03 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,17 +16,17 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2019] # [windows-2019, windows-2022] + os: [windows-2022] # [windows-2019, windows-2022] arch: [x64] # [x64, x86] torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] cuda-version: [11.8.0] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] opencv-version: [4.9.0] # [4.7.0, 4.8.1, 4.9.0] cmake-build-type: [ Release ] # [Debug, ClangTidy] include: - - os: windows-2019 - generator: 'Visual Studio 16 2019' -# - os: windows-2022 -# generator: 'Visual Studio 17 2022' +# - os: windows-2019 +# generator: 'Visual Studio 16 2019' + - os: windows-2022 + generator: 'Visual Studio 17 2022' env: CCACHE_DIR: ${{ github.workspace }}\ccache CCACHE_BASEDIR: ${{ github.workspace }} @@ -62,7 +62,7 @@ jobs: uses: actions/cache@v4 id: cuda-cache with: - key: cuda-${{matrix.CUDA-VERSION}}-windows-2022 + key: cuda-${{matrix.CUDA-VERSION}}-windows path: | C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA* C:\Program Files\NVIDIA Corporation\NvToolsExt @@ -103,7 +103,7 @@ jobs: uses: actions/cache@v4 id: libtorch-cache with: - key: libtorch-${{ matrix.torch-version }}-${{env.CUDA_VER_SHORT}}-windows-2022 + key: libtorch-${{ matrix.torch-version }}-${{env.CUDA_VER_SHORT}}-windows path: | ${{ github.workspace }}\libtorch From 490d08425afa22229e909417450983a9f7a67c47 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 22:28:24 -0500 Subject: [PATCH 13/15] Retest cuda 12.x --- .github/workflows/windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 05a53a03..3fe92235 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -19,7 +19,7 @@ jobs: os: [windows-2022] # [windows-2019, windows-2022] arch: [x64] # [x64, x86] torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] - cuda-version: [11.8.0] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] + cuda-version: [12.1.1] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] opencv-version: [4.9.0] # [4.7.0, 4.8.1, 4.9.0] cmake-build-type: [ Release ] # [Debug, ClangTidy] include: From 8a9b8b5d098112a9ac2664c13f37216f1c7bc4b0 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 22:46:28 -0500 Subject: [PATCH 14/15] Perform full test --- .github/workflows/cuda/Windows.ps1 | 41 +----------------------------- .github/workflows/windows.yml | 10 ++++---- 2 files changed, 6 insertions(+), 45 deletions(-) diff --git a/.github/workflows/cuda/Windows.ps1 b/.github/workflows/cuda/Windows.ps1 index cfc82f51..c66b0b70 100644 --- a/.github/workflows/cuda/Windows.ps1 +++ b/.github/workflows/cuda/Windows.ps1 @@ -5,26 +5,6 @@ $CUDA_VER = "$($CUDA_VER_ARR[0]).$($CUDA_VER_ARR[1])" $CUDA_VER_ID = "$($CUDA_VER_ARR[0])_$($CUDA_VER_ARR[1])" $CUDA_VER_SHORT = "cu$($CUDA_VER_ARR[0])$($CUDA_VER_ARR[1])" -# Free up disk space -# Docker Cache -# docker rmi $(docker images -q -a) -# Android SDK -# if ($Env:ANDROID_HOME) { -# Remove-Item -Recurse -Force $Env:ANDROID_HOME -ErrorAction Ignore -# } -# if ($Env:ANDROID_NDK_HOME) { -# Remove-Item -Recurse -Force $Env:ANDROID_NDK_HOME -ErrorAction Ignore -# } -# # JVM -# if ($Env:JAVA_HOME_11_X64) { -# Remove-Item -Recurse -Force $Env:JAVA_HOME_11_X64 -ErrorAction Ignore -# } -# if ($Env:JAVA_HOME_8_X64) { -# Remove-Item -Recurse -Force $Env:JAVA_HOME_8_X64 -ErrorAction Ignore -# } -#Remove-Item -Force -Recurse -LiteralPath "C:\msys64\" -#Remove-Item -Force -Recurse -LiteralPath "C:\mingw64\" - # Network installer url if ( $CUDA_VER_ARR[0] -ge 11 ) { $CUDA_URL = "https://developer.download.nvidia.com/compute/cuda/$CUDA_VER_FULL/network_installers/cuda_$($CUDA_VER_FULL)_windows_network.exe" @@ -44,22 +24,8 @@ echo "Downloading CUDA installer from $CUDA_URL" Invoke-WebRequest $CUDA_URL -OutFile cuda.exe echo "Installing CUDA..." Start-Process -Wait -FilePath .\cuda.exe -ArgumentList "$CUDA_INSTALL_ARGS" - -if ( !$? ) { - exit 1 -} - Remove-Item .\cuda.exe -Force -# Add CUDA environment variables. -# $CUDA_PATH = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VER" -# echo "CUDA_PATH=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -# echo "CUDA_PATH_V$CUDA_VER_ID=$CUDA_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -# echo "CUDA_VER_SHORT=$CUDA_VER_SHORT" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append -# echo "$CUDA_PATH\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append -# $TORCH_CUDA_ARCH_LIST = "7.0;7.5" -# echo "TORCH_CUDA_ARCH_LIST=$TORCH_CUDA_ARCH_LIST" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - # Install NvToolsExt $NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" if (Test-Path -Path "$NVTOOLSEXT_PATH " -PathType Container) { @@ -79,9 +45,4 @@ Write-Output "Copying NvTools, '$tmpExtractedNvTools' -> '$NVTOOLSEXT_PATH'" New-Item -Path "$NVTOOLSEXT_PATH "-ItemType "directory" -Force Copy-Item -Recurse -Path "$tmpExtractedNvTools\*" -Destination "$NVTOOLSEXT_PATH" Remove-Item "$tmpExtractedNvTools" -Recurse -Force -Remove-Item "$tmpToolsDl" -Recurse -Force - -# $NVTOOLSEXT_PATH = "C:\Program Files\NVIDIA Corporation\NvToolsExt" -# echo "NVTOOLSEXT_PATH=$NVTOOLSEXT_PATH" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append - -Get-PSDrive +Remove-Item "$tmpToolsDl" -Recurse -Force \ No newline at end of file diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 3fe92235..9b402fa5 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -16,15 +16,15 @@ jobs: strategy: fail-fast: false matrix: - os: [windows-2022] # [windows-2019, windows-2022] + os: [windows-2019, windows-2022] # [windows-2019, windows-2022] arch: [x64] # [x64, x86] - torch-version: [2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] - cuda-version: [12.1.1] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] + torch-version: [2.1.2, 2.2.1] # [1.12.0, 1.13.0, 2.0.0, 2.1.0, 2.1.1, 2.1.2, 2.2.0, 2.2.1] + cuda-version: [11.8.0, 12.1.1] # [12.3.1, 12.1.1, 11.8.0, 11.7.1, 11.6.2, 11.5.2,11.4.4, 11.3.1, 11.2.2, 11.1.1, 11.0.3, cpu] opencv-version: [4.9.0] # [4.7.0, 4.8.1, 4.9.0] cmake-build-type: [ Release ] # [Debug, ClangTidy] include: -# - os: windows-2019 -# generator: 'Visual Studio 16 2019' + - os: windows-2019 + generator: 'Visual Studio 16 2019' - os: windows-2022 generator: 'Visual Studio 17 2022' env: From 51856fe0fa61ef6d402b2378dfb6d280d0a284d5 Mon Sep 17 00:00:00 2001 From: Pengfei Xuan Date: Sun, 25 Feb 2024 23:08:24 -0500 Subject: [PATCH 15/15] Switch ci tigger back to the main branch --- .github/workflows/cuda/Windows-env.sh | 44 ----------------------- .github/workflows/cuda/Windows.sh | 51 --------------------------- .github/workflows/windows.yml | 2 +- 3 files changed, 1 insertion(+), 96 deletions(-) delete mode 100644 .github/workflows/cuda/Windows-env.sh delete mode 100644 .github/workflows/cuda/Windows.sh diff --git a/.github/workflows/cuda/Windows-env.sh b/.github/workflows/cuda/Windows-env.sh deleted file mode 100644 index d1a8bf49..00000000 --- a/.github/workflows/cuda/Windows-env.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash - -# Took from https://github.com/pyg-team/pyg-lib/ - -case ${1} in - cu121) - CUDA_HOME="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1" - PATH=${CUDA_HOME}/bin:$PATH - PATH="C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\Bin" - TORCH_CUDA_ARCH_LIST="7.0;7.5" - ;; - cu118) - CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.8 - PATH=${CUDA_HOME}/bin:$PATH - PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH - TORCH_CUDA_ARCH_LIST="7.0;7.5" - ;; - cu117) - CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.7 - PATH=${CUDA_HOME}/bin:$PATH - PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH - TORCH_CUDA_ARCH_LIST="7.0;7.5" - ;; - cu116) - CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.6 - PATH=${CUDA_HOME}/bin:$PATH - PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH - TORCH_CUDA_ARCH_LIST="7.0;7.5" - ;; - cu115) - CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.5 - PATH=${CUDA_HOME}/bin:$PATH - PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH - TORCH_CUDA_ARCH_LIST="7.0;7.5" - ;; - cu113) - CUDA_HOME=/c/Program\ Files/NVIDIA\ GPU\ Computing\ Toolkit/CUDA/v11.3 - PATH=${CUDA_HOME}/bin:$PATH - PATH=/c/Program\ Files\ \(x86\)/Microsoft\ Visual\ Studio/2017/BuildTools/MSBuild/15.0/Bin:$PATH - TORCH_CUDA_ARCH_LIST="7.0;7.5" - ;; - *) - ;; -esac \ No newline at end of file diff --git a/.github/workflows/cuda/Windows.sh b/.github/workflows/cuda/Windows.sh deleted file mode 100644 index 0a2258ce..00000000 --- a/.github/workflows/cuda/Windows.sh +++ /dev/null @@ -1,51 +0,0 @@ -#!/bin/bash - -#curl -k -L "https://drive.google.com/u/0/uc?id=1injUyo3lnarMgWyRcXqKg4UGnN0ysmuq&export=download" --output "/tmp/gpu_driver_dlls.zip" -#7z x "/tmp/gpu_driver_dlls.zip" -o"/c/Windows/System32" - -case ${1} in - cu121) - CUDA_SHORT=12.1 - CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers - CUDA_FILE=cuda_${CUDA_SHORT}.1_531.14_windows.exe - ;; - cu118) - CUDA_SHORT=11.8 - CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers - CUDA_FILE=cuda_${CUDA_SHORT}.0_522.06_windows.exe - ;; - cu117) - CUDA_SHORT=11.7 - CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.1/local_installers - CUDA_FILE=cuda_${CUDA_SHORT}.1_516.94_windows.exe - ;; - cu116) - CUDA_SHORT=11.3 - CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers - CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe - ;; - cu115) - CUDA_SHORT=11.3 - CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers - CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe - ;; - cu113) - CUDA_SHORT=11.3 - CUDA_URL=https://developer.download.nvidia.com/compute/cuda/${CUDA_SHORT}.0/local_installers - CUDA_FILE=cuda_${CUDA_SHORT}.0_465.89_win10.exe - ;; - *) - echo "Unrecognized CUDA_VERSION=${1}" - exit 1 - ;; -esac - -PowerShell -Command "echo 'CUDA_PATH=\"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_SHORT}\"' | Out-File -FilePath \$env:GITHUB_ENV -Encoding utf8 -Append" -PowerShell -Command "echo 'C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v${CUDA_SHORT}\bin' | Out-File -FilePath \$env:GITHUB_PATH -Encoding utf8 -Append" - -curl -k -L "${CUDA_URL}/${CUDA_FILE}" --output "${CUDA_FILE}" -echo "" -echo "Installing from ${CUDA_FILE}..." -PowerShell -Command "Start-Process -FilePath \"${CUDA_FILE}\" -ArgumentList \"-s nvcc_${CUDA_SHORT} cuobjdump_${CUDA_SHORT} nvprune_${CUDA_SHORT} cupti_${CUDA_SHORT} cublas_dev_${CUDA_SHORT} cudart_${CUDA_SHORT} cufft_dev_${CUDA_SHORT} curand_dev_${CUDA_SHORT} cusolver_dev_${CUDA_SHORT} cusparse_dev_${CUDA_SHORT} thrust_${CUDA_SHORT} npp_dev_${CUDA_SHORT} nvrtc_dev_${CUDA_SHORT} nvml_dev_${CUDA_SHORT} visual_studio_integration_${CUDA_SHORT} \" -Wait -NoNewWindow" -echo "Done!" -rm -f "${CUDA_FILE}" diff --git a/.github/workflows/windows.yml b/.github/workflows/windows.yml index 9b402fa5..85aef521 100644 --- a/.github/workflows/windows.yml +++ b/.github/workflows/windows.yml @@ -3,7 +3,7 @@ name: OpenSplat (Windows) on: push: branches: - - ci-windows + - main pull_request: types: [ assigned, opened, synchronize, reopened ] release: