From e7627e308b43e8143f2a4bdcc5667bc1eca27bee Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 15:57:47 +0000 Subject: [PATCH 01/32] test installing git for windows --- .github/workflows/test-wheel-windows.yml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 95a9cbe6f8..315b5707c2 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -107,6 +107,20 @@ jobs: } gh --version + - name: Install Git for Windows + # the GPU runner image does not have Git Bash pre-installed... + env: + # doesn't seem there's an easy way to avoid hard-coding it? + GFW_EXE_URL: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe + run: | + Invoke-WebRequest -Uri "$env:GFW_EXE_URL" -OutFile "PortableGit.7z.exe" + Start-Process 7z -Wait -Verbose -ArgumentList "x PortableGit.7z.exe -oPortableGit" + ls -l PortableGit + mv PortableGit\git-bash.exe PortableGit\bash.exe + echo "$(pwd).path\\PortableGit" >> $env:GITHUB_PATH + $env:Path += ";$(pwd).path\\PortableGit" + bash --version + - name: Download cuda-python & cuda.bindings build artifacts from the prior branch if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} env: From 562b558006f84b52f8331a917e3b9027403ed9a9 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 16:02:33 +0000 Subject: [PATCH 02/32] shrink CI --- .github/workflows/build-and-test.yml | 150 +++++++++++++-------------- 1 file changed, 75 insertions(+), 75 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a00a940286..d2b04b7890 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -24,15 +24,15 @@ jobs: fail-fast: false matrix: host-platform: - - linux-64 - - linux-aarch64 +# - linux-64 +# - linux-aarch64 - win-64 python-version: - - "3.13" +# - "3.13" - "3.12" - - "3.11" - - "3.10" - - "3.9" +# - "3.11" +# - "3.10" +# - "3.9" cuda-version: # Note: this is for build-time only. - "12.8.0" @@ -208,56 +208,56 @@ jobs: run: | echo "CUDA_VERSION=${{ matrix.cuda-version }}" >> $GITHUB_OUTPUT - test-linux: - strategy: - fail-fast: false - # TODO: add driver version here - matrix: - host-platform: - - linux-64 - - linux-aarch64 - python-version: - - "3.13" - - "3.12" - - "3.11" - - "3.10" - - "3.9" - cuda-version: - # Note: this is for test-time only. - - "12.8.0" - - "12.0.1" - - "11.8.0" - local-ctk: - - 1 # use mini CTK - - 0 # use CTK wheels - runner: - - default - exclude: - # To test this combo would require nontrivial installation steps. - - cuda-version: "12.0.1" - local-ctk: 0 - include: - - host-platform: linux-64 - python-version: "3.12" - cuda-version: "12.8.0" - local-ctk: 1 - runner: H100 - name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) - if: ${{ github.repository_owner == 'nvidia' }} - permissions: - contents: read # This is required for actions/checkout - needs: - - build - secrets: inherit - uses: - ./.github/workflows/test-wheel-linux.yml - with: - host-platform: ${{ matrix.host-platform }} - python-version: ${{ matrix.python-version }} - build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} - cuda-version: ${{ matrix.cuda-version }} - local-ctk: ${{ matrix.local-ctk}} - runner: ${{ matrix.runner }} +# test-linux: +# strategy: +# fail-fast: false +# # TODO: add driver version here +# matrix: +# host-platform: +# - linux-64 +# - linux-aarch64 +# python-version: +# - "3.13" +# - "3.12" +# - "3.11" +# - "3.10" +# - "3.9" +# cuda-version: +# # Note: this is for test-time only. +# - "12.8.0" +# - "12.0.1" +# - "11.8.0" +# local-ctk: +# - 1 # use mini CTK +# - 0 # use CTK wheels +# runner: +# - default +# exclude: +# # To test this combo would require nontrivial installation steps. +# - cuda-version: "12.0.1" +# local-ctk: 0 +# include: +# - host-platform: linux-64 +# python-version: "3.12" +# cuda-version: "12.8.0" +# local-ctk: 1 +# runner: H100 +# name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) +# if: ${{ github.repository_owner == 'nvidia' }} +# permissions: +# contents: read # This is required for actions/checkout +# needs: +# - build +# secrets: inherit +# uses: +# ./.github/workflows/test-wheel-linux.yml +# with: +# host-platform: ${{ matrix.host-platform }} +# python-version: ${{ matrix.python-version }} +# build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} +# cuda-version: ${{ matrix.cuda-version }} +# local-ctk: ${{ matrix.local-ctk}} +# runner: ${{ matrix.runner }} test-windows: strategy: @@ -271,10 +271,10 @@ jobs: cuda-version: # Note: this is for test-time only. - "12.8.0" - - "11.8.0" +# - "11.8.0" local-ctk: - 1 # use mini CTK - - 0 # use CTK wheels +# - 0 # use CTK wheels runner: - default name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) @@ -294,21 +294,21 @@ jobs: local-ctk: ${{ matrix.local-ctk}} runner: ${{ matrix.runner }} - doc: - name: Docs - if: ${{ github.repository_owner == 'nvidia' }} - # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages - permissions: - id-token: write - contents: write - pull-requests: write - needs: - - build - secrets: inherit - uses: - ./.github/workflows/build-docs.yml - with: - build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} +# doc: +# name: Docs +# if: ${{ github.repository_owner == 'nvidia' }} +# # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages +# permissions: +# id-token: write +# contents: write +# pull-requests: write +# needs: +# - build +# secrets: inherit +# uses: +# ./.github/workflows/build-docs.yml +# with: +# build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} checks: name: Check job status @@ -316,9 +316,9 @@ jobs: checks: read needs: - build - - test-linux +# - test-linux - test-windows - - doc +# - doc secrets: inherit uses: ./.github/workflows/status-check.yml From c54332b78cfa22877902f5b6ef85337ba5f1bdb6 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 16:33:33 +0000 Subject: [PATCH 03/32] also install 7z... --- .github/workflows/test-wheel-windows.yml | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 315b5707c2..441c924f2b 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -37,9 +37,9 @@ jobs: with: fetch-depth: 0 - - name: Update driver - run: | - .github/workflows/install_gpu_driver.ps1 +# - name: Update driver +# run: | +# .github/workflows/install_gpu_driver.ps1 - name: Ensure GPU is working run: nvidia-smi @@ -107,6 +107,21 @@ jobs: } gh --version + - name: Install 7z + # the GPU runner image does not have Git Bash pre-installed... + env: + # doesn't seem there's an easy way to avoid hard-coding it? + 7Z_URL: https://www.7-zip.org/a/7z2409-x64.msi + run: | + Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" + Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /qn' + $GH_POSSIBLE_PATHS = "C:\\Program Files\\7-Zip", "C:\\Program Files (x86)\\7-Zip" + foreach ($p in $GH_POSSIBLE_PATHS) { + echo "$p" >> $env:GITHUB_PATH + $env:Path += ";$p" + } + 7z --version + - name: Install Git for Windows # the GPU runner image does not have Git Bash pre-installed... env: From 270b6816e019bc5ce927632f65fa7fd94c0be766 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 16:37:13 +0000 Subject: [PATCH 04/32] skip cuda.bindings for now --- .github/workflows/build-and-test.yml | 92 ++++++++++++++-------------- 1 file changed, 46 insertions(+), 46 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index d2b04b7890..a7c82fee03 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -127,52 +127,52 @@ jobs: path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl if-no-files-found: error - - name: Set up mini CTK - uses: ./.github/actions/fetch_ctk - continue-on-error: false - with: - host-platform: ${{ matrix.host-platform }} - cuda-version: ${{ matrix.cuda-version }} - - - name: Build cuda.bindings wheel - uses: pypa/cibuildwheel@v2.22.0 - env: - CIBW_BUILD: ${{ env.CIBW_BUILD }} - CIBW_ARCHS_LINUX: "native" - CIBW_BUILD_VERBOSITY: 1 - # CIBW mounts the host filesystem under /host - CIBW_ENVIRONMENT_LINUX: > - CUDA_PATH=/host/${{ env.CUDA_PATH }} - LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib - CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} - CIBW_ENVIRONMENT_WINDOWS: > - CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" - LIB="${CUDA_HOME}\\lib\\x64;${LIB}" - CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} - with: - package-dir: ./cuda_bindings/ - output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - - - name: List the cuda.bindings artifacts directory - run: | - if [[ "${{ matrix.host-platform }}" == win* ]]; then - export CHOWN=chown - else - export CHOWN="sudo chown" - fi - $CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - ls -lahR ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - - - name: Check cuda.bindings wheel - run: | - twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl - - - name: Upload cuda.bindings build artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} - path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl - if-no-files-found: error +# - name: Set up mini CTK +# uses: ./.github/actions/fetch_ctk +# continue-on-error: false +# with: +# host-platform: ${{ matrix.host-platform }} +# cuda-version: ${{ matrix.cuda-version }} +# +# - name: Build cuda.bindings wheel +# uses: pypa/cibuildwheel@v2.22.0 +# env: +# CIBW_BUILD: ${{ env.CIBW_BUILD }} +# CIBW_ARCHS_LINUX: "native" +# CIBW_BUILD_VERBOSITY: 1 +# # CIBW mounts the host filesystem under /host +# CIBW_ENVIRONMENT_LINUX: > +# CUDA_PATH=/host/${{ env.CUDA_PATH }} +# LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib +# CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} +# CIBW_ENVIRONMENT_WINDOWS: > +# CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" +# LIB="${CUDA_HOME}\\lib\\x64;${LIB}" +# CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} +# with: +# package-dir: ./cuda_bindings/ +# output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} +# +# - name: List the cuda.bindings artifacts directory +# run: | +# if [[ "${{ matrix.host-platform }}" == win* ]]; then +# export CHOWN=chown +# else +# export CHOWN="sudo chown" +# fi +# $CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} +# ls -lahR ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} +# +# - name: Check cuda.bindings wheel +# run: | +# twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl +# +# - name: Upload cuda.bindings build artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} +# path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl +# if-no-files-found: error # upload-artifact's "overwrite: true" option has a race condition among parallel # jobs, so we let job 0 do the work From 9e665db5e2355918b19358eb755e3b8419fe595e Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 17:01:27 +0000 Subject: [PATCH 05/32] fix --- .github/workflows/test-wheel-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 441c924f2b..25236d6169 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -40,9 +40,9 @@ jobs: # - name: Update driver # run: | # .github/workflows/install_gpu_driver.ps1 - - - name: Ensure GPU is working - run: nvidia-smi +# +# - name: Ensure GPU is working +# run: nvidia-smi - name: Set environment variables run: | From 38830b20fa2716a26c2f801c9460bad468033f01 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 17:27:58 +0000 Subject: [PATCH 06/32] fix --- .github/workflows/test-wheel-windows.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 25236d6169..eb439db845 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -85,12 +85,12 @@ jobs: name: cuda-python-wheel path: . - - name: Download cuda.bindings build artifacts - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@v4 - with: - name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} - path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} +# - name: Download cuda.bindings build artifacts +# if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} +# uses: actions/download-artifact@v4 +# with: +# name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} +# path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - name: Install gh cli # the GPU runner image does not have gh pre-installed... From 4a2bb6fbf8a4432160f579e26382433b30f0d1f3 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 18:25:36 +0000 Subject: [PATCH 07/32] fix --- .github/workflows/test-wheel-windows.yml | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index eb439db845..09c371acbe 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -114,12 +114,10 @@ jobs: 7Z_URL: https://www.7-zip.org/a/7z2409-x64.msi run: | Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" - Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /qn' - $GH_POSSIBLE_PATHS = "C:\\Program Files\\7-Zip", "C:\\Program Files (x86)\\7-Zip" - foreach ($p in $GH_POSSIBLE_PATHS) { - echo "$p" >> $env:GITHUB_PATH - $env:Path += ";$p" - } + Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR=$((Get-Location).Path)\7-Zip' + ls -l 7-Zip + echo "$((Get-Location).Path)\7-Zip" >> $env:GITHUB_PATH + $env:Path += ";$((Get-Location).Path)\7-Zip" 7z --version - name: Install Git for Windows @@ -132,8 +130,8 @@ jobs: Start-Process 7z -Wait -Verbose -ArgumentList "x PortableGit.7z.exe -oPortableGit" ls -l PortableGit mv PortableGit\git-bash.exe PortableGit\bash.exe - echo "$(pwd).path\\PortableGit" >> $env:GITHUB_PATH - $env:Path += ";$(pwd).path\\PortableGit" + echo "$((Get-Location).Path)\\PortableGit" >> $env:GITHUB_PATH + $env:Path += ";$((Get-Location).Path)\\PortableGit" bash --version - name: Download cuda-python & cuda.bindings build artifacts from the prior branch From 2bb32a939e0ccb81ba9ae5aa4bc4dafe9d352521 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 18:26:58 +0000 Subject: [PATCH 08/32] skip --- .github/workflows/build-and-test.yml | 64 ++++++++++++++-------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a7c82fee03..aba5f86401 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -95,38 +95,38 @@ jobs: run: | env - - name: Build cuda.core wheel - uses: pypa/cibuildwheel@v2.22.0 - env: - CIBW_BUILD: ${{ env.CIBW_BUILD }} - CIBW_ARCHS_LINUX: "native" - CIBW_BUILD_VERBOSITY: 1 - with: - package-dir: ./cuda_core/ - output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - - - name: List the cuda.core artifacts directory - run: | - if [[ "${{ matrix.host-platform }}" == win* ]]; then - export CHOWN=chown - else - export CHOWN="sudo chown" - fi - $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - - - name: Check cuda.core wheel - run: | - pip install twine - twine check ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl - - - name: Upload cuda.core build artifacts - uses: actions/upload-artifact@v4 - with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} - path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl - if-no-files-found: error - +# - name: Build cuda.core wheel +# uses: pypa/cibuildwheel@v2.22.0 +# env: +# CIBW_BUILD: ${{ env.CIBW_BUILD }} +# CIBW_ARCHS_LINUX: "native" +# CIBW_BUILD_VERBOSITY: 1 +# with: +# package-dir: ./cuda_core/ +# output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} +# +# - name: List the cuda.core artifacts directory +# run: | +# if [[ "${{ matrix.host-platform }}" == win* ]]; then +# export CHOWN=chown +# else +# export CHOWN="sudo chown" +# fi +# $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }} +# ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} +# +# - name: Check cuda.core wheel +# run: | +# pip install twine +# twine check ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl +# +# - name: Upload cuda.core build artifacts +# uses: actions/upload-artifact@v4 +# with: +# name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} +# path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl +# if-no-files-found: error +# # - name: Set up mini CTK # uses: ./.github/actions/fetch_ctk # continue-on-error: false From dc633dcf04e0cf9002ed3c0e6fa50c4d0cb73b37 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 18:29:19 +0000 Subject: [PATCH 09/32] skip --- .github/workflows/build-and-test.yml | 58 ++++++++++++++-------------- 1 file changed, 29 insertions(+), 29 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index aba5f86401..698208fbee 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -173,35 +173,35 @@ jobs: # name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} # path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl # if-no-files-found: error - - # upload-artifact's "overwrite: true" option has a race condition among parallel - # jobs, so we let job 0 do the work - - name: Build and check cuda-python wheel - if: ${{ strategy.job-index == 0 }} - run: | - pushd cuda_python - pip wheel -v --no-deps . - twine check *.whl - popd - - - name: List the cuda-python artifacts directory - if: ${{ strategy.job-index == 0 }} - run: | - if [[ "${{ matrix.host-platform }}" == win* ]]; then - export CHOWN=chown - else - export CHOWN="sudo chown" - fi - $CHOWN -R $(whoami) cuda_python/*.whl - ls -lahR cuda_python - - - name: Upload cuda-python build artifacts - if: ${{ strategy.job-index == 0 }} - uses: actions/upload-artifact@v4 - with: - name: cuda-python-wheel - path: cuda_python/*.whl - if-no-files-found: error +# +# # upload-artifact's "overwrite: true" option has a race condition among parallel +# # jobs, so we let job 0 do the work +# - name: Build and check cuda-python wheel +# if: ${{ strategy.job-index == 0 }} +# run: | +# pushd cuda_python +# pip wheel -v --no-deps . +# twine check *.whl +# popd +# +# - name: List the cuda-python artifacts directory +# if: ${{ strategy.job-index == 0 }} +# run: | +# if [[ "${{ matrix.host-platform }}" == win* ]]; then +# export CHOWN=chown +# else +# export CHOWN="sudo chown" +# fi +# $CHOWN -R $(whoami) cuda_python/*.whl +# ls -lahR cuda_python +# +# - name: Upload cuda-python build artifacts +# if: ${{ strategy.job-index == 0 }} +# uses: actions/upload-artifact@v4 +# with: +# name: cuda-python-wheel +# path: cuda_python/*.whl +# if-no-files-found: error - name: Pass environment variables to the next runner id: pass_env From cd69de39639ca3e77feef0a42a7aa6b887af7921 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 18:32:11 +0000 Subject: [PATCH 10/32] more skip --- .github/workflows/test-wheel-windows.yml | 44 ++++++++++++------------ 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 09c371acbe..396cbaa4b8 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -78,34 +78,34 @@ jobs: "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" >> $env:GITHUB_ENV "MINI_CTK_DEPS=${MINI_CTK_DEPS}" >> $env:GITHUB_ENV - - name: Download cuda-python build artifacts - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} - uses: actions/download-artifact@v4 - with: - name: cuda-python-wheel - path: . - +# - name: Download cuda-python build artifacts +# if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} +# uses: actions/download-artifact@v4 +# with: +# name: cuda-python-wheel +# path: . +# # - name: Download cuda.bindings build artifacts # if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} # uses: actions/download-artifact@v4 # with: # name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} # path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} - - - name: Install gh cli - # the GPU runner image does not have gh pre-installed... - env: - # doesn't seem there's an easy way to avoid hard-coding it? - GH_MSI_URL: https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.msi - run: | - Invoke-WebRequest -Uri "$env:GH_MSI_URL" -OutFile "gh_installer.msi" - Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "gh_installer.msi" /qn' - $GH_POSSIBLE_PATHS = "C:\\Program Files\\GitHub CLI", "C:\\Program Files (x86)\\GitHub CLI" - foreach ($p in $GH_POSSIBLE_PATHS) { - echo "$p" >> $env:GITHUB_PATH - $env:Path += ";$p" - } - gh --version +# +# - name: Install gh cli +# # the GPU runner image does not have gh pre-installed... +# env: +# # doesn't seem there's an easy way to avoid hard-coding it? +# GH_MSI_URL: https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.msi +# run: | +# Invoke-WebRequest -Uri "$env:GH_MSI_URL" -OutFile "gh_installer.msi" +# Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "gh_installer.msi" /qn' +# $GH_POSSIBLE_PATHS = "C:\\Program Files\\GitHub CLI", "C:\\Program Files (x86)\\GitHub CLI" +# foreach ($p in $GH_POSSIBLE_PATHS) { +# echo "$p" >> $env:GITHUB_PATH +# $env:Path += ";$p" +# } +# gh --version - name: Install 7z # the GPU runner image does not have Git Bash pre-installed... From 52adef23e96012ec11e31bf2672ca7483e6c7a44 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 18:37:28 +0000 Subject: [PATCH 11/32] add quotes --- .github/workflows/test-wheel-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 396cbaa4b8..7089411d04 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -114,7 +114,7 @@ jobs: 7Z_URL: https://www.7-zip.org/a/7z2409-x64.msi run: | Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" - Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR=$((Get-Location).Path)\7-Zip' + Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="$((Get-Location).Path)\7-Zip"' ls -l 7-Zip echo "$((Get-Location).Path)\7-Zip" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\7-Zip" From d5c7be2f6943d840ec85a602ff1e2fc30ef0e869 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 18:41:02 +0000 Subject: [PATCH 12/32] try this --- .github/workflows/test-wheel-windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 7089411d04..0cfe51cd81 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -115,7 +115,8 @@ jobs: run: | Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="$((Get-Location).Path)\7-Zip"' - ls -l 7-Zip + #ls -l 7-Zip + Get-Location echo "$((Get-Location).Path)\7-Zip" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\7-Zip" 7z --version From efd6036128aeea829d88d47519a56ba73be68783 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 18:50:26 +0000 Subject: [PATCH 13/32] try this --- .github/workflows/test-wheel-windows.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 0cfe51cd81..8884c2e0b9 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -116,7 +116,8 @@ jobs: Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="$((Get-Location).Path)\7-Zip"' #ls -l 7-Zip - Get-Location + #Get-Location + ls echo "$((Get-Location).Path)\7-Zip" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\7-Zip" 7z --version From 1c8d7a8d162d3cd565f2afdad251b62bb40be5af Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 19:13:25 +0000 Subject: [PATCH 14/32] try this --- .github/workflows/test-wheel-windows.yml | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 8884c2e0b9..48eb22a09c 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -114,12 +114,10 @@ jobs: 7Z_URL: https://www.7-zip.org/a/7z2409-x64.msi run: | Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" - Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="$((Get-Location).Path)\7-Zip"' - #ls -l 7-Zip - #Get-Location - ls - echo "$((Get-Location).Path)\7-Zip" >> $env:GITHUB_PATH - $env:Path += ";$((Get-Location).Path)\7-Zip" + Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="C:\Program Files\7-Zip" /qn' + ls -l "C:\\Program Files\7-Zip" + echo "C:\\Program Files\7-Zip" >> $env:GITHUB_PATH + $env:Path += ";C:\\Program Files\7-Zip" 7z --version - name: Install Git for Windows From 4cb69d65e9a270676faee25ec4a168c2c875fcdc Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 19:31:43 +0000 Subject: [PATCH 15/32] don't escape? --- .github/workflows/test-wheel-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 48eb22a09c..23e227ab3b 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -115,9 +115,9 @@ jobs: run: | Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="C:\Program Files\7-Zip" /qn' - ls -l "C:\\Program Files\7-Zip" - echo "C:\\Program Files\7-Zip" >> $env:GITHUB_PATH - $env:Path += ";C:\\Program Files\7-Zip" + ls -l "C:\Program Files\7-Zip" + echo "C:\Program Files\7-Zip" >> $env:GITHUB_PATH + $env:Path += ";C:\Program Files\7-Zip" 7z --version - name: Install Git for Windows From 10de33c20b262a8f46f4e78406d1fd0e7756f95d Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 19:38:03 +0000 Subject: [PATCH 16/32] try this --- .github/workflows/test-wheel-windows.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 23e227ab3b..e7e6be8032 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -118,6 +118,7 @@ jobs: ls -l "C:\Program Files\7-Zip" echo "C:\Program Files\7-Zip" >> $env:GITHUB_PATH $env:Path += ";C:\Program Files\7-Zip" + echo $env:Path 7z --version - name: Install Git for Windows From 3cfc4e3442feb3e76476fe07353d7ec79e3d988c Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 19:42:10 +0000 Subject: [PATCH 17/32] --version does not exist --- .github/workflows/test-wheel-windows.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index e7e6be8032..94ce657b77 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -119,7 +119,7 @@ jobs: echo "C:\Program Files\7-Zip" >> $env:GITHUB_PATH $env:Path += ";C:\Program Files\7-Zip" echo $env:Path - 7z --version + 7z - name: Install Git for Windows # the GPU runner image does not have Git Bash pre-installed... From fffe85c9500c4393a4f89b017387a6f19687bf01 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 19:49:20 +0000 Subject: [PATCH 18/32] switch to fetch_ctk --- .github/workflows/test-wheel-windows.yml | 110 ++++++++++++----------- 1 file changed, 59 insertions(+), 51 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 94ce657b77..a3b94dcf78 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -135,66 +135,74 @@ jobs: $env:Path += ";$((Get-Location).Path)\\PortableGit" bash --version - - name: Download cuda-python & cuda.bindings build artifacts from the prior branch - if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} - env: - GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - $OLD_BRANCH = Get-Content .github/BACKPORT_BRANCH - $OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" - $runData = gh run list -b $OLD_BRANCH -L 1 -w "CI: Build and test" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json - if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) { - Write-Host "LATEST_PRIOR_RUN_ID not found!" - exit 1 - } - $LATEST_PRIOR_RUN_ID = $runData[0].databaseId - - gh run download $LATEST_PRIOR_RUN_ID -p $OLD_BASENAME -R NVIDIA/cuda-python - Get-ChildItem -Path $OLD_BASENAME - New-Item -Path "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" -ItemType Directory -Force - Move-Item -Path "$OLD_BASENAME/*.whl" -Destination "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" - Remove-Item -Path $OLD_BASENAME -Force - - gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python - Get-ChildItem -Path cuda-python-wheel - Move-Item -Path "cuda-python-wheel/*.whl" -Destination . - Remove-Item -Path cuda-python-wheel -Force - - - name: Display structure of downloaded cuda-python artifacts - run: | - Get-Location - Get-ChildItem -Recurse -Force | Select-Object Mode, LastWriteTime, Length, FullName - - - name: Display structure of downloaded cuda.bindings artifacts - run: | - Get-Location - Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - - - name: Download cuda.core build artifacts - uses: actions/download-artifact@v4 - with: - name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} - path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} - - - name: Display structure of downloaded cuda.core build artifacts - run: | - Get-Location - Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName +# - name: Download cuda-python & cuda.bindings build artifacts from the prior branch +# if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} +# env: +# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} +# run: | +# $OLD_BRANCH = Get-Content .github/BACKPORT_BRANCH +# $OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" +# $runData = gh run list -b $OLD_BRANCH -L 1 -w "CI: Build and test" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json +# if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) { +# Write-Host "LATEST_PRIOR_RUN_ID not found!" +# exit 1 +# } +# $LATEST_PRIOR_RUN_ID = $runData[0].databaseId +# +# gh run download $LATEST_PRIOR_RUN_ID -p $OLD_BASENAME -R NVIDIA/cuda-python +# Get-ChildItem -Path $OLD_BASENAME +# New-Item -Path "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" -ItemType Directory -Force +# Move-Item -Path "$OLD_BASENAME/*.whl" -Destination "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" +# Remove-Item -Path $OLD_BASENAME -Force +# +# gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python +# Get-ChildItem -Path cuda-python-wheel +# Move-Item -Path "cuda-python-wheel/*.whl" -Destination . +# Remove-Item -Path cuda-python-wheel -Force +# +# - name: Display structure of downloaded cuda-python artifacts +# run: | +# Get-Location +# Get-ChildItem -Recurse -Force | Select-Object Mode, LastWriteTime, Length, FullName +# +# - name: Display structure of downloaded cuda.bindings artifacts +# run: | +# Get-Location +# Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName +# +# - name: Download cuda.core build artifacts +# uses: actions/download-artifact@v4 +# with: +# name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} +# path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} +# +# - name: Display structure of downloaded cuda.core build artifacts +# run: | +# Get-Location +# Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Set up Python ${{ inputs.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} +# - name: Set up mini CTK +# if: ${{ inputs.local-ctk == '1' }} +# # Note: The GH-hosted Windows GPU runner does not have Git for Windows pre-installed, +# # so we cannot use our own fetch_ctk action unfortunately... +# uses: Jimver/cuda-toolkit@v0.2.21 +# with: +# cuda: ${{ inputs.cuda-version }} +# method: 'network' +# sub-packages: ${{ env.MINI_CTK_DEPS }} + - name: Set up mini CTK if: ${{ inputs.local-ctk == '1' }} - # Note: The GH-hosted Windows GPU runner does not have Git for Windows pre-installed, - # so we cannot use our own fetch_ctk action unfortunately... - uses: Jimver/cuda-toolkit@v0.2.21 + uses: ./.github/actions/fetch_ctk + continue-on-error: false with: - cuda: ${{ inputs.cuda-version }} - method: 'network' - sub-packages: ${{ env.MINI_CTK_DEPS }} + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ inputs.cuda-version }} - name: Update PATH if: ${{ inputs.local-ctk == '1' }} From daf26ade38ec20efa05d4e40f6841dde9f1e58fc Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 20:19:59 +0000 Subject: [PATCH 19/32] try not to hang --- .github/actions/fetch_ctk/action.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index ed0b6d2907..17330a5544 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -19,11 +19,14 @@ inputs: type: string default: "cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_sanitizer_api,libnvjitlink" +defaults: + run: + shell: bash ${{ (inputs.host-platform != 'win-64' && '--noprofile --norc') || '' }} -xeuo pipefail {0} + runs: using: composite steps: - name: Set up CTK cache variable - shell: bash --noprofile --norc -xeuo pipefail {0} run: | HASH=$(echo -n "${{ inputs.cuda-components }}" | sha256sum | awk '{print $1}') echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV @@ -48,7 +51,6 @@ runs: - name: Get CUDA components if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }} - shell: bash --noprofile --norc -xeuo pipefail {0} run: | CUDA_PATH="./cuda_toolkit" mkdir $CUDA_PATH @@ -126,7 +128,6 @@ runs: - name: Restore CTK cache if: ${{ steps.ctk-get-cache.outputs.cache-hit == 'true' }} - shell: bash --noprofile --norc -xeuo pipefail {0} run: | ls -l CUDA_PATH="./cuda_toolkit" @@ -137,7 +138,6 @@ runs: fi - name: Set output environment variables - shell: bash --noprofile --norc -xeuo pipefail {0} run: | CUDA_PATH=$(realpath "./cuda_toolkit") echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV From 0a578befe13b66f7c6f2bdc2dc877ea1dee24ef4 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 20:26:25 +0000 Subject: [PATCH 20/32] try not to hang --- .github/actions/fetch_ctk/action.yml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index 17330a5544..36622d24ff 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -19,12 +19,11 @@ inputs: type: string default: "cuda_nvcc,cuda_cudart,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_sanitizer_api,libnvjitlink" -defaults: - run: - shell: bash ${{ (inputs.host-platform != 'win-64' && '--noprofile --norc') || '' }} -xeuo pipefail {0} - runs: using: composite + defaults: + run: + shell: bash ${{ (inputs.host-platform != 'win-64' && '--noprofile --norc') || '' }} -xeuo pipefail {0} steps: - name: Set up CTK cache variable run: | From f3fa59640cf93e4ed1bc2f3af93dc8da5ddff359 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 20:31:58 +0000 Subject: [PATCH 21/32] try not to hang; composite action does not support setting default shell... --- .github/actions/fetch_ctk/action.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index 36622d24ff..7c2ab91a3f 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -21,11 +21,9 @@ inputs: runs: using: composite - defaults: - run: - shell: bash ${{ (inputs.host-platform != 'win-64' && '--noprofile --norc') || '' }} -xeuo pipefail {0} steps: - name: Set up CTK cache variable + shell: bash -xeuo pipefail {0} run: | HASH=$(echo -n "${{ inputs.cuda-components }}" | sha256sum | awk '{print $1}') echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV @@ -50,6 +48,7 @@ runs: - name: Get CUDA components if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }} + shell: bash -xeuo pipefail {0} run: | CUDA_PATH="./cuda_toolkit" mkdir $CUDA_PATH @@ -127,6 +126,7 @@ runs: - name: Restore CTK cache if: ${{ steps.ctk-get-cache.outputs.cache-hit == 'true' }} + shell: bash -xeuo pipefail {0} run: | ls -l CUDA_PATH="./cuda_toolkit" @@ -137,6 +137,7 @@ runs: fi - name: Set output environment variables + shell: bash -xeuo pipefail {0} run: | CUDA_PATH=$(realpath "./cuda_toolkit") echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV From 0418045d4dbcdbeae304ee59803c3d25a3f7a4df Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 22:48:09 -0400 Subject: [PATCH 22/32] self extracting + run post install --- .github/workflows/test-wheel-windows.yml | 31 ++++++++++++------------ 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index a3b94dcf78..26656e30a0 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -107,19 +107,19 @@ jobs: # } # gh --version - - name: Install 7z - # the GPU runner image does not have Git Bash pre-installed... - env: - # doesn't seem there's an easy way to avoid hard-coding it? - 7Z_URL: https://www.7-zip.org/a/7z2409-x64.msi - run: | - Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" - Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="C:\Program Files\7-Zip" /qn' - ls -l "C:\Program Files\7-Zip" - echo "C:\Program Files\7-Zip" >> $env:GITHUB_PATH - $env:Path += ";C:\Program Files\7-Zip" - echo $env:Path - 7z +# - name: Install 7z +# # the GPU runner image does not have Git Bash pre-installed... +# env: +# # doesn't seem there's an easy way to avoid hard-coding it? +# 7Z_URL: https://www.7-zip.org/a/7z2409-x64.msi +# run: | +# Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" +# Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="C:\Program Files\7-Zip" /qn' +# ls -l "C:\Program Files\7-Zip" +# echo "C:\Program Files\7-Zip" >> $env:GITHUB_PATH +# $env:Path += ";C:\Program Files\7-Zip" +# echo $env:Path +# 7z - name: Install Git for Windows # the GPU runner image does not have Git Bash pre-installed... @@ -128,9 +128,10 @@ jobs: GFW_EXE_URL: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe run: | Invoke-WebRequest -Uri "$env:GFW_EXE_URL" -OutFile "PortableGit.7z.exe" - Start-Process 7z -Wait -Verbose -ArgumentList "x PortableGit.7z.exe -oPortableGit" + .\PortableGit.7z.exe -y -gm2 -InstallPath=".\\PortableGit" ls -l PortableGit - mv PortableGit\git-bash.exe PortableGit\bash.exe + .\PortableGit\post-install.bat + New-Item -Path PortableGit\bash.exe -ItemType SymbolicLink -Value PortableGit\git-bash.exe echo "$((Get-Location).Path)\\PortableGit" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\\PortableGit" bash --version From 869ff140c0a67a3ac8ef263839628ceecafab419 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 23:06:16 -0400 Subject: [PATCH 23/32] block extraction to ensure file visibility --- .github/workflows/test-wheel-windows.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 26656e30a0..a24484bb47 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -128,9 +128,8 @@ jobs: GFW_EXE_URL: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe run: | Invoke-WebRequest -Uri "$env:GFW_EXE_URL" -OutFile "PortableGit.7z.exe" - .\PortableGit.7z.exe -y -gm2 -InstallPath=".\\PortableGit" + Start-Process .\PortableGit.7z.exe -Wait -Verbose -ArgumentList '-y -gm2' ls -l PortableGit - .\PortableGit\post-install.bat New-Item -Path PortableGit\bash.exe -ItemType SymbolicLink -Value PortableGit\git-bash.exe echo "$((Get-Location).Path)\\PortableGit" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\\PortableGit" From ffa239ebb1a951980660489ec1bdcc3a19796873 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 2 May 2025 23:38:49 -0400 Subject: [PATCH 24/32] clean up --- .github/workflows/build-and-test.yml | 364 +++++++++++------------ .github/workflows/test-wheel-windows.yml | 190 +++++------- 2 files changed, 261 insertions(+), 293 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 698208fbee..a00a940286 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -24,15 +24,15 @@ jobs: fail-fast: false matrix: host-platform: -# - linux-64 -# - linux-aarch64 + - linux-64 + - linux-aarch64 - win-64 python-version: -# - "3.13" + - "3.13" - "3.12" -# - "3.11" -# - "3.10" -# - "3.9" + - "3.11" + - "3.10" + - "3.9" cuda-version: # Note: this is for build-time only. - "12.8.0" @@ -95,169 +95,169 @@ jobs: run: | env -# - name: Build cuda.core wheel -# uses: pypa/cibuildwheel@v2.22.0 -# env: -# CIBW_BUILD: ${{ env.CIBW_BUILD }} -# CIBW_ARCHS_LINUX: "native" -# CIBW_BUILD_VERBOSITY: 1 -# with: -# package-dir: ./cuda_core/ -# output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} -# -# - name: List the cuda.core artifacts directory -# run: | -# if [[ "${{ matrix.host-platform }}" == win* ]]; then -# export CHOWN=chown -# else -# export CHOWN="sudo chown" -# fi -# $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }} -# ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} -# -# - name: Check cuda.core wheel -# run: | -# pip install twine -# twine check ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl -# -# - name: Upload cuda.core build artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} -# path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl -# if-no-files-found: error -# -# - name: Set up mini CTK -# uses: ./.github/actions/fetch_ctk -# continue-on-error: false -# with: -# host-platform: ${{ matrix.host-platform }} -# cuda-version: ${{ matrix.cuda-version }} -# -# - name: Build cuda.bindings wheel -# uses: pypa/cibuildwheel@v2.22.0 -# env: -# CIBW_BUILD: ${{ env.CIBW_BUILD }} -# CIBW_ARCHS_LINUX: "native" -# CIBW_BUILD_VERBOSITY: 1 -# # CIBW mounts the host filesystem under /host -# CIBW_ENVIRONMENT_LINUX: > -# CUDA_PATH=/host/${{ env.CUDA_PATH }} -# LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib -# CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} -# CIBW_ENVIRONMENT_WINDOWS: > -# CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" -# LIB="${CUDA_HOME}\\lib\\x64;${LIB}" -# CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} -# with: -# package-dir: ./cuda_bindings/ -# output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} -# -# - name: List the cuda.bindings artifacts directory -# run: | -# if [[ "${{ matrix.host-platform }}" == win* ]]; then -# export CHOWN=chown -# else -# export CHOWN="sudo chown" -# fi -# $CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} -# ls -lahR ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} -# -# - name: Check cuda.bindings wheel -# run: | -# twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl -# -# - name: Upload cuda.bindings build artifacts -# uses: actions/upload-artifact@v4 -# with: -# name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} -# path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl -# if-no-files-found: error -# -# # upload-artifact's "overwrite: true" option has a race condition among parallel -# # jobs, so we let job 0 do the work -# - name: Build and check cuda-python wheel -# if: ${{ strategy.job-index == 0 }} -# run: | -# pushd cuda_python -# pip wheel -v --no-deps . -# twine check *.whl -# popd -# -# - name: List the cuda-python artifacts directory -# if: ${{ strategy.job-index == 0 }} -# run: | -# if [[ "${{ matrix.host-platform }}" == win* ]]; then -# export CHOWN=chown -# else -# export CHOWN="sudo chown" -# fi -# $CHOWN -R $(whoami) cuda_python/*.whl -# ls -lahR cuda_python -# -# - name: Upload cuda-python build artifacts -# if: ${{ strategy.job-index == 0 }} -# uses: actions/upload-artifact@v4 -# with: -# name: cuda-python-wheel -# path: cuda_python/*.whl -# if-no-files-found: error + - name: Build cuda.core wheel + uses: pypa/cibuildwheel@v2.22.0 + env: + CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_ARCHS_LINUX: "native" + CIBW_BUILD_VERBOSITY: 1 + with: + package-dir: ./cuda_core/ + output-dir: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + + - name: List the cuda.core artifacts directory + run: | + if [[ "${{ matrix.host-platform }}" == win* ]]; then + export CHOWN=chown + else + export CHOWN="sudo chown" + fi + $CHOWN -R $(whoami) ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + ls -lahR ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + + - name: Check cuda.core wheel + run: | + pip install twine + twine check ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl + + - name: Upload cuda.core build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} + path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl + if-no-files-found: error + + - name: Set up mini CTK + uses: ./.github/actions/fetch_ctk + continue-on-error: false + with: + host-platform: ${{ matrix.host-platform }} + cuda-version: ${{ matrix.cuda-version }} + + - name: Build cuda.bindings wheel + uses: pypa/cibuildwheel@v2.22.0 + env: + CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_ARCHS_LINUX: "native" + CIBW_BUILD_VERBOSITY: 1 + # CIBW mounts the host filesystem under /host + CIBW_ENVIRONMENT_LINUX: > + CUDA_PATH=/host/${{ env.CUDA_PATH }} + LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib + CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} + CIBW_ENVIRONMENT_WINDOWS: > + CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" + LIB="${CUDA_HOME}\\lib\\x64;${LIB}" + CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} + with: + package-dir: ./cuda_bindings/ + output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + + - name: List the cuda.bindings artifacts directory + run: | + if [[ "${{ matrix.host-platform }}" == win* ]]; then + export CHOWN=chown + else + export CHOWN="sudo chown" + fi + $CHOWN -R $(whoami) ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + ls -lahR ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} + + - name: Check cuda.bindings wheel + run: | + twine check ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + + - name: Upload cuda.bindings build artifacts + uses: actions/upload-artifact@v4 + with: + name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} + path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + if-no-files-found: error + + # upload-artifact's "overwrite: true" option has a race condition among parallel + # jobs, so we let job 0 do the work + - name: Build and check cuda-python wheel + if: ${{ strategy.job-index == 0 }} + run: | + pushd cuda_python + pip wheel -v --no-deps . + twine check *.whl + popd + + - name: List the cuda-python artifacts directory + if: ${{ strategy.job-index == 0 }} + run: | + if [[ "${{ matrix.host-platform }}" == win* ]]; then + export CHOWN=chown + else + export CHOWN="sudo chown" + fi + $CHOWN -R $(whoami) cuda_python/*.whl + ls -lahR cuda_python + + - name: Upload cuda-python build artifacts + if: ${{ strategy.job-index == 0 }} + uses: actions/upload-artifact@v4 + with: + name: cuda-python-wheel + path: cuda_python/*.whl + if-no-files-found: error - name: Pass environment variables to the next runner id: pass_env run: | echo "CUDA_VERSION=${{ matrix.cuda-version }}" >> $GITHUB_OUTPUT -# test-linux: -# strategy: -# fail-fast: false -# # TODO: add driver version here -# matrix: -# host-platform: -# - linux-64 -# - linux-aarch64 -# python-version: -# - "3.13" -# - "3.12" -# - "3.11" -# - "3.10" -# - "3.9" -# cuda-version: -# # Note: this is for test-time only. -# - "12.8.0" -# - "12.0.1" -# - "11.8.0" -# local-ctk: -# - 1 # use mini CTK -# - 0 # use CTK wheels -# runner: -# - default -# exclude: -# # To test this combo would require nontrivial installation steps. -# - cuda-version: "12.0.1" -# local-ctk: 0 -# include: -# - host-platform: linux-64 -# python-version: "3.12" -# cuda-version: "12.8.0" -# local-ctk: 1 -# runner: H100 -# name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) -# if: ${{ github.repository_owner == 'nvidia' }} -# permissions: -# contents: read # This is required for actions/checkout -# needs: -# - build -# secrets: inherit -# uses: -# ./.github/workflows/test-wheel-linux.yml -# with: -# host-platform: ${{ matrix.host-platform }} -# python-version: ${{ matrix.python-version }} -# build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} -# cuda-version: ${{ matrix.cuda-version }} -# local-ctk: ${{ matrix.local-ctk}} -# runner: ${{ matrix.runner }} + test-linux: + strategy: + fail-fast: false + # TODO: add driver version here + matrix: + host-platform: + - linux-64 + - linux-aarch64 + python-version: + - "3.13" + - "3.12" + - "3.11" + - "3.10" + - "3.9" + cuda-version: + # Note: this is for test-time only. + - "12.8.0" + - "12.0.1" + - "11.8.0" + local-ctk: + - 1 # use mini CTK + - 0 # use CTK wheels + runner: + - default + exclude: + # To test this combo would require nontrivial installation steps. + - cuda-version: "12.0.1" + local-ctk: 0 + include: + - host-platform: linux-64 + python-version: "3.12" + cuda-version: "12.8.0" + local-ctk: 1 + runner: H100 + name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) + if: ${{ github.repository_owner == 'nvidia' }} + permissions: + contents: read # This is required for actions/checkout + needs: + - build + secrets: inherit + uses: + ./.github/workflows/test-wheel-linux.yml + with: + host-platform: ${{ matrix.host-platform }} + python-version: ${{ matrix.python-version }} + build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} + cuda-version: ${{ matrix.cuda-version }} + local-ctk: ${{ matrix.local-ctk}} + runner: ${{ matrix.runner }} test-windows: strategy: @@ -271,10 +271,10 @@ jobs: cuda-version: # Note: this is for test-time only. - "12.8.0" -# - "11.8.0" + - "11.8.0" local-ctk: - 1 # use mini CTK -# - 0 # use CTK wheels + - 0 # use CTK wheels runner: - default name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) @@ -294,21 +294,21 @@ jobs: local-ctk: ${{ matrix.local-ctk}} runner: ${{ matrix.runner }} -# doc: -# name: Docs -# if: ${{ github.repository_owner == 'nvidia' }} -# # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages -# permissions: -# id-token: write -# contents: write -# pull-requests: write -# needs: -# - build -# secrets: inherit -# uses: -# ./.github/workflows/build-docs.yml -# with: -# build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} + doc: + name: Docs + if: ${{ github.repository_owner == 'nvidia' }} + # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages + permissions: + id-token: write + contents: write + pull-requests: write + needs: + - build + secrets: inherit + uses: + ./.github/workflows/build-docs.yml + with: + build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} checks: name: Check job status @@ -316,9 +316,9 @@ jobs: checks: read needs: - build -# - test-linux + - test-linux - test-windows -# - doc + - doc secrets: inherit uses: ./.github/workflows/status-check.yml diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index a24484bb47..347a98a8fa 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -37,12 +37,12 @@ jobs: with: fetch-depth: 0 -# - name: Update driver -# run: | -# .github/workflows/install_gpu_driver.ps1 -# -# - name: Ensure GPU is working -# run: nvidia-smi + - name: Update driver + run: | + .github/workflows/install_gpu_driver.ps1 + + - name: Ensure GPU is working + run: nvidia-smi - name: Set environment variables run: | @@ -57,14 +57,6 @@ jobs: $SKIP_CUDA_BINDINGS_TEST = 0 } - if ('${{ inputs.local-ctk }}' -eq '1') { - if ($TEST_CUDA_MAJOR -eq '12') { - $MINI_CTK_DEPS = '["nvcc", "nvrtc", "nvjitlink", "thrust"]' - } else { - $MINI_CTK_DEPS = '["nvcc", "nvrtc", "thrust"]' - } - } - # Make outputs from the previous job as env vars $CUDA_CORE_ARTIFACT_BASENAME = "cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ inputs.host-platform }}" "PYTHON_VERSION_FORMATTED=${PYTHON_VERSION_FORMATTED}" >> $env:GITHUB_ENV @@ -76,50 +68,35 @@ jobs: "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${{ github.sha }}" >> $env:GITHUB_ENV "CUDA_BINDINGS_ARTIFACTS_DIR=$($ExecutionContext.SessionState.Path.GetUnresolvedProviderPathFromPSPath("$REPO_DIR\cuda_bindings\dist"))" >> $env:GITHUB_ENV "SKIP_CUDA_BINDINGS_TEST=${SKIP_CUDA_BINDINGS_TEST}" >> $env:GITHUB_ENV - "MINI_CTK_DEPS=${MINI_CTK_DEPS}" >> $env:GITHUB_ENV -# - name: Download cuda-python build artifacts -# if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} -# uses: actions/download-artifact@v4 -# with: -# name: cuda-python-wheel -# path: . -# -# - name: Download cuda.bindings build artifacts -# if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} -# uses: actions/download-artifact@v4 -# with: -# name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} -# path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} -# -# - name: Install gh cli -# # the GPU runner image does not have gh pre-installed... -# env: -# # doesn't seem there's an easy way to avoid hard-coding it? -# GH_MSI_URL: https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.msi -# run: | -# Invoke-WebRequest -Uri "$env:GH_MSI_URL" -OutFile "gh_installer.msi" -# Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "gh_installer.msi" /qn' -# $GH_POSSIBLE_PATHS = "C:\\Program Files\\GitHub CLI", "C:\\Program Files (x86)\\GitHub CLI" -# foreach ($p in $GH_POSSIBLE_PATHS) { -# echo "$p" >> $env:GITHUB_PATH -# $env:Path += ";$p" -# } -# gh --version + - name: Download cuda-python build artifacts + if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} + uses: actions/download-artifact@v4 + with: + name: cuda-python-wheel + path: . + + - name: Download cuda.bindings build artifacts + if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0'}} + uses: actions/download-artifact@v4 + with: + name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} + path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }} -# - name: Install 7z -# # the GPU runner image does not have Git Bash pre-installed... -# env: -# # doesn't seem there's an easy way to avoid hard-coding it? -# 7Z_URL: https://www.7-zip.org/a/7z2409-x64.msi -# run: | -# Invoke-WebRequest -Uri "$env:7Z_URL" -OutFile "7z_installer.msi" -# Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "7z_installer.msi" /q INSTALLDIR="C:\Program Files\7-Zip" /qn' -# ls -l "C:\Program Files\7-Zip" -# echo "C:\Program Files\7-Zip" >> $env:GITHUB_PATH -# $env:Path += ";C:\Program Files\7-Zip" -# echo $env:Path -# 7z + - name: Install gh cli + # the GPU runner image does not have gh pre-installed... + env: + # doesn't seem there's an easy way to avoid hard-coding it? + GH_MSI_URL: https://github.com/cli/cli/releases/download/v2.67.0/gh_2.67.0_windows_amd64.msi + run: | + Invoke-WebRequest -Uri "$env:GH_MSI_URL" -OutFile "gh_installer.msi" + Start-Process msiexec.exe -Wait -Verbose -ArgumentList '/i "gh_installer.msi" /qn' + $GH_POSSIBLE_PATHS = "C:\\Program Files\\GitHub CLI", "C:\\Program Files (x86)\\GitHub CLI" + foreach ($p in $GH_POSSIBLE_PATHS) { + echo "$p" >> $env:GITHUB_PATH + $env:Path += ";$p" + } + gh --version - name: Install Git for Windows # the GPU runner image does not have Git Bash pre-installed... @@ -128,6 +105,7 @@ jobs: GFW_EXE_URL: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe run: | Invoke-WebRequest -Uri "$env:GFW_EXE_URL" -OutFile "PortableGit.7z.exe" + # Self-extracting, see https://gitforwindows.org/zip-archives-extracting-the-released-archives.html Start-Process .\PortableGit.7z.exe -Wait -Verbose -ArgumentList '-y -gm2' ls -l PortableGit New-Item -Path PortableGit\bash.exe -ItemType SymbolicLink -Value PortableGit\git-bash.exe @@ -135,67 +113,57 @@ jobs: $env:Path += ";$((Get-Location).Path)\\PortableGit" bash --version -# - name: Download cuda-python & cuda.bindings build artifacts from the prior branch -# if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} -# env: -# GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} -# run: | -# $OLD_BRANCH = Get-Content .github/BACKPORT_BRANCH -# $OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" -# $runData = gh run list -b $OLD_BRANCH -L 1 -w "CI: Build and test" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json -# if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) { -# Write-Host "LATEST_PRIOR_RUN_ID not found!" -# exit 1 -# } -# $LATEST_PRIOR_RUN_ID = $runData[0].databaseId -# -# gh run download $LATEST_PRIOR_RUN_ID -p $OLD_BASENAME -R NVIDIA/cuda-python -# Get-ChildItem -Path $OLD_BASENAME -# New-Item -Path "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" -ItemType Directory -Force -# Move-Item -Path "$OLD_BASENAME/*.whl" -Destination "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" -# Remove-Item -Path $OLD_BASENAME -Force -# -# gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python -# Get-ChildItem -Path cuda-python-wheel -# Move-Item -Path "cuda-python-wheel/*.whl" -Destination . -# Remove-Item -Path cuda-python-wheel -Force -# -# - name: Display structure of downloaded cuda-python artifacts -# run: | -# Get-Location -# Get-ChildItem -Recurse -Force | Select-Object Mode, LastWriteTime, Length, FullName -# -# - name: Display structure of downloaded cuda.bindings artifacts -# run: | -# Get-Location -# Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName -# -# - name: Download cuda.core build artifacts -# uses: actions/download-artifact@v4 -# with: -# name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} -# path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} -# -# - name: Display structure of downloaded cuda.core build artifacts -# run: | -# Get-Location -# Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName + - name: Download cuda-python & cuda.bindings build artifacts from the prior branch + if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + $OLD_BRANCH = Get-Content .github/BACKPORT_BRANCH + $OLD_BASENAME = "cuda-bindings-python${env:PYTHON_VERSION_FORMATTED}-cuda*-${{ inputs.host-platform }}*" + $runData = gh run list -b $OLD_BRANCH -L 1 -w "CI: Build and test" -s completed -R NVIDIA/cuda-python --json databaseId | ConvertFrom-Json + if (-not $runData -or $runData.Length -eq 0 -or -not $runData[0].databaseId -or [string]::IsNullOrEmpty($runData[0].databaseId)) { + Write-Host "LATEST_PRIOR_RUN_ID not found!" + exit 1 + } + $LATEST_PRIOR_RUN_ID = $runData[0].databaseId + + gh run download $LATEST_PRIOR_RUN_ID -p $OLD_BASENAME -R NVIDIA/cuda-python + Get-ChildItem -Path $OLD_BASENAME + New-Item -Path "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" -ItemType Directory -Force + Move-Item -Path "$OLD_BASENAME/*.whl" -Destination "${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}" + Remove-Item -Path $OLD_BASENAME -Force + + gh run download $LATEST_PRIOR_RUN_ID -p cuda-python-wheel -R NVIDIA/cuda-python + Get-ChildItem -Path cuda-python-wheel + Move-Item -Path "cuda-python-wheel/*.whl" -Destination . + Remove-Item -Path cuda-python-wheel -Force + + - name: Display structure of downloaded cuda-python artifacts + run: | + Get-Location + Get-ChildItem -Recurse -Force | Select-Object Mode, LastWriteTime, Length, FullName + + - name: Display structure of downloaded cuda.bindings artifacts + run: | + Get-Location + Get-ChildItem -Recurse -Force $env:CUDA_BINDINGS_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName + + - name: Download cuda.core build artifacts + uses: actions/download-artifact@v4 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} + path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }} + + - name: Display structure of downloaded cuda.core build artifacts + run: | + Get-Location + Get-ChildItem -Recurse -Force $env:CUDA_CORE_ARTIFACTS_DIR | Select-Object Mode, LastWriteTime, Length, FullName - name: Set up Python ${{ inputs.python-version }} uses: actions/setup-python@v5 with: python-version: ${{ inputs.python-version }} -# - name: Set up mini CTK -# if: ${{ inputs.local-ctk == '1' }} -# # Note: The GH-hosted Windows GPU runner does not have Git for Windows pre-installed, -# # so we cannot use our own fetch_ctk action unfortunately... -# uses: Jimver/cuda-toolkit@v0.2.21 -# with: -# cuda: ${{ inputs.cuda-version }} -# method: 'network' -# sub-packages: ${{ env.MINI_CTK_DEPS }} - - name: Set up mini CTK if: ${{ inputs.local-ctk == '1' }} uses: ./.github/actions/fetch_ctk From 1b02e55ccf76b3013180c758239e4750f04b1231 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 00:26:04 -0400 Subject: [PATCH 25/32] ensure cuda related paths are set correctly on windows --- .github/actions/fetch_ctk/action.yml | 12 +++++++++--- .github/workflows/build-and-test.yml | 2 +- .github/workflows/test-wheel-windows.yml | 8 +------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index 3aff4100ac..47ad49e786 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -146,8 +146,14 @@ runs: - name: Set output environment variables shell: bash -xeuo pipefail {0} run: | - CUDA_PATH=$(realpath "./cuda_toolkit") + # mimics actual CTK installation + if [[ "${{ inputs.host-platform }}" == linux* ]]; then + CUDA_PATH=$(realpath "./cuda_toolkit") + echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib:${CUDA_PATH}/nvvm/lib64" >> $GITHUB_ENV + elif [[ "${{ inputs.host-platform }}" == win* ]]; then + CUDA_PATH=$(cygpath -w $(realpath "./cuda_toolkit")) + echo "$(cygpath -w ${CUDA_PATH}/bin)" >> $GITHUB_PATH + echo "$(cygpath -w $CUDA_PATH/nvvm/bin)" >> $GITHUB_PATH + fi echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV echo "CUDA_HOME=${CUDA_PATH}" >> $GITHUB_ENV - echo "${CUDA_PATH}/bin" >> $GITHUB_PATH - echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib:${CUDA_PATH}/nvvm/lib64" >> $GITHUB_ENV diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index a00a940286..b6d3ce5497 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -146,7 +146,7 @@ jobs: LIBRARY_PATH=/host/${{ env.CUDA_PATH }}/lib CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} CIBW_ENVIRONMENT_WINDOWS: > - CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" + CUDA_HOME=${{ env.CUDA_PATH }} LIB="${CUDA_HOME}\\lib\\x64;${LIB}" CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} with: diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 347a98a8fa..567c281e24 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -100,6 +100,7 @@ jobs: - name: Install Git for Windows # the GPU runner image does not have Git Bash pre-installed... + if: ${{ inputs.local-ctk == '1' }} env: # doesn't seem there's an easy way to avoid hard-coding it? GFW_EXE_URL: https://github.com/git-for-windows/git/releases/download/v2.49.0.windows.1/PortableGit-2.49.0-64-bit.7z.exe @@ -172,13 +173,6 @@ jobs: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ inputs.cuda-version }} - - name: Update PATH - if: ${{ inputs.local-ctk == '1' }} - run: | - # mimics actual CTK installation - echo $PATH - echo "$env:CUDA_PATH\nvvm\bin" >> $env:GITHUB_PATH - - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} run: | From 7a0e053feec2d65998d5526022c49c32c6c42e97 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 00:50:21 -0400 Subject: [PATCH 26/32] fix normpath (again) to escape slash --- .github/actions/fetch_ctk/action.yml | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index 47ad49e786..03f30eaa73 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -151,9 +151,12 @@ runs: CUDA_PATH=$(realpath "./cuda_toolkit") echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH:-}:${CUDA_PATH}/lib:${CUDA_PATH}/nvvm/lib64" >> $GITHUB_ENV elif [[ "${{ inputs.host-platform }}" == win* ]]; then - CUDA_PATH=$(cygpath -w $(realpath "./cuda_toolkit")) - echo "$(cygpath -w ${CUDA_PATH}/bin)" >> $GITHUB_PATH - echo "$(cygpath -w $CUDA_PATH/nvvm/bin)" >> $GITHUB_PATH + function normpath() { + echo "$(echo $(cygpath -w $1) | sed 's/\\/\\\\/g')" + } + CUDA_PATH=$(normpath $(realpath "./cuda_toolkit")) + echo "$(normpath ${CUDA_PATH}/bin)" >> $GITHUB_PATH + echo "$(normpath $CUDA_PATH/nvvm/bin)" >> $GITHUB_PATH fi echo "CUDA_PATH=${CUDA_PATH}" >> $GITHUB_ENV echo "CUDA_HOME=${CUDA_PATH}" >> $GITHUB_ENV From 96ecae04e10ee2ac3763da6c5b6679f7ae4d1387 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 02:22:06 -0400 Subject: [PATCH 27/32] DEBUG --- .github/workflows/build-and-test.yml | 118 +++++++++++------------ .github/workflows/test-wheel-windows.yml | 8 ++ 2 files changed, 67 insertions(+), 59 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index b6d3ce5497..da4809224a 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -24,15 +24,15 @@ jobs: fail-fast: false matrix: host-platform: - - linux-64 - - linux-aarch64 +# - linux-64 +# - linux-aarch64 - win-64 python-version: - - "3.13" +# - "3.13" - "3.12" - - "3.11" - - "3.10" - - "3.9" +# - "3.11" +# - "3.10" +# - "3.9" cuda-version: # Note: this is for build-time only. - "12.8.0" @@ -208,56 +208,56 @@ jobs: run: | echo "CUDA_VERSION=${{ matrix.cuda-version }}" >> $GITHUB_OUTPUT - test-linux: - strategy: - fail-fast: false - # TODO: add driver version here - matrix: - host-platform: - - linux-64 - - linux-aarch64 - python-version: - - "3.13" - - "3.12" - - "3.11" - - "3.10" - - "3.9" - cuda-version: - # Note: this is for test-time only. - - "12.8.0" - - "12.0.1" - - "11.8.0" - local-ctk: - - 1 # use mini CTK - - 0 # use CTK wheels - runner: - - default - exclude: - # To test this combo would require nontrivial installation steps. - - cuda-version: "12.0.1" - local-ctk: 0 - include: - - host-platform: linux-64 - python-version: "3.12" - cuda-version: "12.8.0" - local-ctk: 1 - runner: H100 - name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) - if: ${{ github.repository_owner == 'nvidia' }} - permissions: - contents: read # This is required for actions/checkout - needs: - - build - secrets: inherit - uses: - ./.github/workflows/test-wheel-linux.yml - with: - host-platform: ${{ matrix.host-platform }} - python-version: ${{ matrix.python-version }} - build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} - cuda-version: ${{ matrix.cuda-version }} - local-ctk: ${{ matrix.local-ctk}} - runner: ${{ matrix.runner }} +# test-linux: +# strategy: +# fail-fast: false +# # TODO: add driver version here +# matrix: +# host-platform: +# - linux-64 +# - linux-aarch64 +# python-version: +# - "3.13" +# - "3.12" +# - "3.11" +# - "3.10" +# - "3.9" +# cuda-version: +# # Note: this is for test-time only. +# - "12.8.0" +# - "12.0.1" +# - "11.8.0" +# local-ctk: +# - 1 # use mini CTK +# - 0 # use CTK wheels +# runner: +# - default +# exclude: +# # To test this combo would require nontrivial installation steps. +# - cuda-version: "12.0.1" +# local-ctk: 0 +# include: +# - host-platform: linux-64 +# python-version: "3.12" +# cuda-version: "12.8.0" +# local-ctk: 1 +# runner: H100 +# name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) +# if: ${{ github.repository_owner == 'nvidia' }} +# permissions: +# contents: read # This is required for actions/checkout +# needs: +# - build +# secrets: inherit +# uses: +# ./.github/workflows/test-wheel-linux.yml +# with: +# host-platform: ${{ matrix.host-platform }} +# python-version: ${{ matrix.python-version }} +# build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} +# cuda-version: ${{ matrix.cuda-version }} +# local-ctk: ${{ matrix.local-ctk}} +# runner: ${{ matrix.runner }} test-windows: strategy: @@ -270,11 +270,11 @@ jobs: - "3.12" cuda-version: # Note: this is for test-time only. - - "12.8.0" +# - "12.8.0" - "11.8.0" local-ctk: - 1 # use mini CTK - - 0 # use CTK wheels +# - 0 # use CTK wheels runner: - default name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) @@ -316,7 +316,7 @@ jobs: checks: read needs: - build - - test-linux +# - test-linux - test-windows - doc secrets: inherit diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 567c281e24..cdfcadc907 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -173,6 +173,14 @@ jobs: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ inputs.cuda-version }} + - name: DEBUG + if: ${{ inputs.local-ctk == '1' }} + run: | + echo $env:CUDA_PATH + echo $env:Path + Get-Location $env:CUDA_PATH + Get-Location $env:CUDA_PATH/bin + - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} run: | From a73564c5b423033a985e42ab18a44d96a54d3fea Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 02:58:44 -0400 Subject: [PATCH 28/32] perhaps git-bash is not the right exe... --- .github/workflows/test-wheel-windows.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index cdfcadc907..45ae501ee6 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -109,9 +109,9 @@ jobs: # Self-extracting, see https://gitforwindows.org/zip-archives-extracting-the-released-archives.html Start-Process .\PortableGit.7z.exe -Wait -Verbose -ArgumentList '-y -gm2' ls -l PortableGit - New-Item -Path PortableGit\bash.exe -ItemType SymbolicLink -Value PortableGit\git-bash.exe - echo "$((Get-Location).Path)\\PortableGit" >> $env:GITHUB_PATH - $env:Path += ";$((Get-Location).Path)\\PortableGit" + #New-Item -Path PortableGit\bash.exe -ItemType SymbolicLink -Value PortableGit\git-bash.exe + echo "$((Get-Location).Path)\\PortableGit\\bin" >> $env:GITHUB_PATH + $env:Path += ";$((Get-Location).Path)\\PortableGit\\bin" bash --version - name: Download cuda-python & cuda.bindings build artifacts from the prior branch From 78d0113525507c1cff8357bb38a733928c04639e Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 21:30:26 -0400 Subject: [PATCH 29/32] install zstd for win local ctk test --- .github/actions/fetch_ctk/action.yml | 8 ++++---- .github/workflows/test-wheel-windows.yml | 16 +++++++++++++++- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index 03f30eaa73..cbdd25ad17 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -23,7 +23,7 @@ runs: using: composite steps: - name: Set up CTK cache variable - shell: bash -xeuo pipefail {0} + shell: bash --noprofile --norc -xeuo pipefail {0} run: | HASH=$(echo -n "${{ inputs.cuda-components }}" | sha256sum | awk '{print $1}') echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV @@ -48,7 +48,7 @@ runs: - name: Get CUDA components if: ${{ steps.ctk-get-cache.outputs.cache-hit != 'true' }} - shell: bash -xeuo pipefail {0} + shell: bash --noprofile --norc -xeuo pipefail {0} run: | # Everything under this folder is packed and stored in the GitHub Cache space, # and unpacked after retrieving from the cache. @@ -128,7 +128,7 @@ runs: - name: Restore CTK cache if: ${{ steps.ctk-get-cache.outputs.cache-hit == 'true' }} - shell: bash -xeuo pipefail {0} + shell: bash --noprofile --norc -xeuo pipefail {0} run: | ls -l CACHE_TMP_DIR="./cache_tmp_dir" @@ -144,7 +144,7 @@ runs: fi - name: Set output environment variables - shell: bash -xeuo pipefail {0} + shell: bash --noprofile --norc -xeuo pipefail {0} run: | # mimics actual CTK installation if [[ "${{ inputs.host-platform }}" == linux* ]]; then diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 45ae501ee6..b16c8c5fe8 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -109,11 +109,25 @@ jobs: # Self-extracting, see https://gitforwindows.org/zip-archives-extracting-the-released-archives.html Start-Process .\PortableGit.7z.exe -Wait -Verbose -ArgumentList '-y -gm2' ls -l PortableGit - #New-Item -Path PortableGit\bash.exe -ItemType SymbolicLink -Value PortableGit\git-bash.exe echo "$((Get-Location).Path)\\PortableGit\\bin" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\\PortableGit\\bin" bash --version + - name: Install zstd + # the GPU runner image does not have zstd pre-installed... and it's needed by actions/cache + if: ${{ inputs.local-ctk == '1' }} + env: + # doesn't seem there's an easy way to avoid hard-coding it? + ZSTD_URL: https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-v1.5.7-win64.zip + ZSTD_DIR: zstd-v1.5.7-win64 + run: | + Invoke-WebRequest -Uri "$env:ZSTD_URL" -OutFile "zstd-win64.zip" + Expand-Archive -Path "zstd-win64.zip" + ls -l $env:ZSTD_DIR + echo "$((Get-Location).Path)\\$env:ZSTD_DIR" >> $env:GITHUB_PATH + $env:Path += ";$((Get-Location).Path)\\$env:ZSTD_DIR" + zstd -h + - name: Download cuda-python & cuda.bindings build artifacts from the prior branch if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} env: From 390995ab2760229c2a3c3c60e6f1177e96759ebd Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 21:46:07 -0400 Subject: [PATCH 30/32] fix copy pasta --- .github/workflows/test-wheel-windows.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index b16c8c5fe8..67d68045d6 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -37,12 +37,12 @@ jobs: with: fetch-depth: 0 - - name: Update driver - run: | - .github/workflows/install_gpu_driver.ps1 - - - name: Ensure GPU is working - run: nvidia-smi +# - name: Update driver +# run: | +# .github/workflows/install_gpu_driver.ps1 +# +# - name: Ensure GPU is working +# run: nvidia-smi - name: Set environment variables run: | @@ -122,7 +122,7 @@ jobs: ZSTD_DIR: zstd-v1.5.7-win64 run: | Invoke-WebRequest -Uri "$env:ZSTD_URL" -OutFile "zstd-win64.zip" - Expand-Archive -Path "zstd-win64.zip" + Expand-Archive -Path "zstd-win64.zip" -DestinationPath . ls -l $env:ZSTD_DIR echo "$((Get-Location).Path)\\$env:ZSTD_DIR" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\\$env:ZSTD_DIR" From 65e19b230279e6fbc318c20e28a753f3e9628641 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 22:04:16 -0400 Subject: [PATCH 31/32] forward-port fetch_ctk fix --- .github/actions/fetch_ctk/action.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index cbdd25ad17..f6b78701a5 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -75,6 +75,8 @@ runs: unzip $1 -d $_TEMP_DIR_ cp -r $_TEMP_DIR_/*/* $CACHE_TMP_DIR rm -rf $_TEMP_DIR_ + # see commit NVIDIA/cuda-python@69410f1d9228e775845ef6c8b4a9c7f37ffc68a5 + chmod 644 $CACHE_TMP_DIR/LICENSE } fi function populate_cuda_path() { From 6ade91b6bf70883d9c0f5d42dc46cbedfe2c4652 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sat, 3 May 2025 22:21:55 -0400 Subject: [PATCH 32/32] ready for full test! --- .github/workflows/build-and-test.yml | 118 +++++++++++------------ .github/workflows/test-wheel-windows.yml | 22 ++--- 2 files changed, 66 insertions(+), 74 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index da4809224a..b6d3ce5497 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -24,15 +24,15 @@ jobs: fail-fast: false matrix: host-platform: -# - linux-64 -# - linux-aarch64 + - linux-64 + - linux-aarch64 - win-64 python-version: -# - "3.13" + - "3.13" - "3.12" -# - "3.11" -# - "3.10" -# - "3.9" + - "3.11" + - "3.10" + - "3.9" cuda-version: # Note: this is for build-time only. - "12.8.0" @@ -208,56 +208,56 @@ jobs: run: | echo "CUDA_VERSION=${{ matrix.cuda-version }}" >> $GITHUB_OUTPUT -# test-linux: -# strategy: -# fail-fast: false -# # TODO: add driver version here -# matrix: -# host-platform: -# - linux-64 -# - linux-aarch64 -# python-version: -# - "3.13" -# - "3.12" -# - "3.11" -# - "3.10" -# - "3.9" -# cuda-version: -# # Note: this is for test-time only. -# - "12.8.0" -# - "12.0.1" -# - "11.8.0" -# local-ctk: -# - 1 # use mini CTK -# - 0 # use CTK wheels -# runner: -# - default -# exclude: -# # To test this combo would require nontrivial installation steps. -# - cuda-version: "12.0.1" -# local-ctk: 0 -# include: -# - host-platform: linux-64 -# python-version: "3.12" -# cuda-version: "12.8.0" -# local-ctk: 1 -# runner: H100 -# name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) -# if: ${{ github.repository_owner == 'nvidia' }} -# permissions: -# contents: read # This is required for actions/checkout -# needs: -# - build -# secrets: inherit -# uses: -# ./.github/workflows/test-wheel-linux.yml -# with: -# host-platform: ${{ matrix.host-platform }} -# python-version: ${{ matrix.python-version }} -# build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} -# cuda-version: ${{ matrix.cuda-version }} -# local-ctk: ${{ matrix.local-ctk}} -# runner: ${{ matrix.runner }} + test-linux: + strategy: + fail-fast: false + # TODO: add driver version here + matrix: + host-platform: + - linux-64 + - linux-aarch64 + python-version: + - "3.13" + - "3.12" + - "3.11" + - "3.10" + - "3.9" + cuda-version: + # Note: this is for test-time only. + - "12.8.0" + - "12.0.1" + - "11.8.0" + local-ctk: + - 1 # use mini CTK + - 0 # use CTK wheels + runner: + - default + exclude: + # To test this combo would require nontrivial installation steps. + - cuda-version: "12.0.1" + local-ctk: 0 + include: + - host-platform: linux-64 + python-version: "3.12" + cuda-version: "12.8.0" + local-ctk: 1 + runner: H100 + name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) + if: ${{ github.repository_owner == 'nvidia' }} + permissions: + contents: read # This is required for actions/checkout + needs: + - build + secrets: inherit + uses: + ./.github/workflows/test-wheel-linux.yml + with: + host-platform: ${{ matrix.host-platform }} + python-version: ${{ matrix.python-version }} + build-ctk-ver: ${{ needs.build.outputs.BUILD_CTK_VER }} + cuda-version: ${{ matrix.cuda-version }} + local-ctk: ${{ matrix.local-ctk}} + runner: ${{ matrix.runner }} test-windows: strategy: @@ -270,11 +270,11 @@ jobs: - "3.12" cuda-version: # Note: this is for test-time only. -# - "12.8.0" + - "12.8.0" - "11.8.0" local-ctk: - 1 # use mini CTK -# - 0 # use CTK wheels + - 0 # use CTK wheels runner: - default name: Test (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}, Runner ${{ matrix.runner }}, ${{ (matrix.local-ctk == '1' && 'local CTK') || 'CTK wheels' }}) @@ -316,7 +316,7 @@ jobs: checks: read needs: - build -# - test-linux + - test-linux - test-windows - doc secrets: inherit diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 67d68045d6..c741fe1616 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -37,12 +37,12 @@ jobs: with: fetch-depth: 0 -# - name: Update driver -# run: | -# .github/workflows/install_gpu_driver.ps1 -# -# - name: Ensure GPU is working -# run: nvidia-smi + - name: Update driver + run: | + .github/workflows/install_gpu_driver.ps1 + + - name: Ensure GPU is working + run: nvidia-smi - name: Set environment variables run: | @@ -126,7 +126,7 @@ jobs: ls -l $env:ZSTD_DIR echo "$((Get-Location).Path)\\$env:ZSTD_DIR" >> $env:GITHUB_PATH $env:Path += ";$((Get-Location).Path)\\$env:ZSTD_DIR" - zstd -h + zstd --version - name: Download cuda-python & cuda.bindings build artifacts from the prior branch if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '1'}} @@ -187,14 +187,6 @@ jobs: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ inputs.cuda-version }} - - name: DEBUG - if: ${{ inputs.local-ctk == '1' }} - run: | - echo $env:CUDA_PATH - echo $env:Path - Get-Location $env:CUDA_PATH - Get-Location $env:CUDA_PATH/bin - - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} run: |