From e76ecd53d0b890b283c371d3092101c57955eeb6 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 15:13:27 -0500 Subject: [PATCH 01/12] disable all but win pipelines --- .github/workflows/build-and-test.yml | 518 +++++++++++++-------------- 1 file changed, 259 insertions(+), 259 deletions(-) diff --git a/.github/workflows/build-and-test.yml b/.github/workflows/build-and-test.yml index 9ad2d8c1e..6bbd54629 100644 --- a/.github/workflows/build-and-test.yml +++ b/.github/workflows/build-and-test.yml @@ -15,243 +15,243 @@ on: - "main" jobs: - build: - strategy: - fail-fast: false - matrix: - host-platform: - - linux-64 - - linux-aarch64 - - win-64 - python-version: - - "3.13" - - "3.12" - - "3.11" - - "3.10" - - "3.9" - cuda-version: - # Note: this is for build-time only. - - "12.8.0" - name: Build (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}) - if: ${{ github.repository_owner == 'nvidia' }} - permissions: - contents: read # This is required for actions/checkout - runs-on: ${{ (matrix.host-platform == 'linux-64' && 'linux-amd64-cpu8') || - (matrix.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || - (matrix.host-platform == 'win-64' && 'windows-2019') }} - # (matrix.host-platform == 'win-64' && 'windows-amd64-cpu8') }} - outputs: - BUILD_CTK_VER: ${{ steps.pass_env.outputs.CUDA_VERSION }} - defaults: - run: - shell: bash --noprofile --norc -xeuo pipefail {0} - steps: - - name: Checkout ${{ github.event.repository.name }} - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - # WAR: setup-python is not relocatable... - # see https://github.com/actions/setup-python/issues/871 - - name: Set up Python ${{ matrix.python-version }} - if: ${{ startsWith(matrix.host-platform, 'linux') }} - id: setup-python - uses: actions/setup-python@v5 - with: - python-version: "3.12" - - - name: Set up MSVC - if: ${{ startsWith(matrix.host-platform, 'win') }} - uses: ilammy/msvc-dev-cmd@v1 - - - name: Set environment variables - run: | - PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.') - if [[ "${{ matrix.host-platform }}" == linux* ]]; then - CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-manylinux*" - REPO_DIR=$(pwd) - elif [[ "${{ matrix.host-platform }}" == win* ]]; then - CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-win_amd64" - PWD=$(pwd) - REPO_DIR=$(cygpath -w $PWD) - fi - - echo "CUDA_BINDINGS_PARALLEL_LEVEL=$(nproc)" >> $GITHUB_ENV - CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ matrix.host-platform }}" - echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV - echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV - echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV - CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ matrix.cuda-version }}-${{ matrix.host-platform }}" - echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV - echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV - echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV - echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV - - - name: Dump environment - 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 }} - CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} - CIBW_ENVIRONMENT_WINDOWS: > - CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" - 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 }} +# build: +# strategy: +# fail-fast: false +# matrix: +# host-platform: +# - linux-64 +# - linux-aarch64 +# - win-64 +# python-version: +# - "3.13" +# - "3.12" +# - "3.11" +# - "3.10" +# - "3.9" +# cuda-version: +# # Note: this is for build-time only. +# - "12.8.0" +# name: Build (${{ matrix.host-platform }}, Python ${{ matrix.python-version }}, CUDA ${{ matrix.cuda-version }}) +# if: ${{ github.repository_owner == 'nvidia' }} +# permissions: +# contents: read # This is required for actions/checkout +# runs-on: ${{ (matrix.host-platform == 'linux-64' && 'linux-amd64-cpu8') || +# (matrix.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') || +# (matrix.host-platform == 'win-64' && 'windows-2019') }} +# # (matrix.host-platform == 'win-64' && 'windows-amd64-cpu8') }} +# outputs: +# BUILD_CTK_VER: ${{ steps.pass_env.outputs.CUDA_VERSION }} +# defaults: +# run: +# shell: bash --noprofile --norc -xeuo pipefail {0} +# steps: +# - name: Checkout ${{ github.event.repository.name }} +# uses: actions/checkout@v4 +# with: +# fetch-depth: 0 +# +# # WAR: setup-python is not relocatable... +# # see https://github.com/actions/setup-python/issues/871 +# - name: Set up Python ${{ matrix.python-version }} +# if: ${{ startsWith(matrix.host-platform, 'linux') }} +# id: setup-python +# uses: actions/setup-python@v5 +# with: +# python-version: "3.12" +# +# - name: Set up MSVC +# if: ${{ startsWith(matrix.host-platform, 'win') }} +# uses: ilammy/msvc-dev-cmd@v1 +# +# - name: Set environment variables +# run: | +# PYTHON_VERSION_FORMATTED=$(echo '${{ matrix.python-version }}' | tr -d '.') +# if [[ "${{ matrix.host-platform }}" == linux* ]]; then +# CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-manylinux*" +# REPO_DIR=$(pwd) +# elif [[ "${{ matrix.host-platform }}" == win* ]]; then +# CIBW_BUILD="cp${PYTHON_VERSION_FORMATTED}-win_amd64" +# PWD=$(pwd) +# REPO_DIR=$(cygpath -w $PWD) +# fi +# +# echo "CUDA_BINDINGS_PARALLEL_LEVEL=$(nproc)" >> $GITHUB_ENV +# CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-${{ matrix.host-platform }}" +# echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV +# echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV +# echo "CUDA_CORE_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_core/dist")" >> $GITHUB_ENV +# CUDA_BINDINGS_ARTIFACT_BASENAME="cuda-bindings-python${PYTHON_VERSION_FORMATTED}-cuda${{ matrix.cuda-version }}-${{ matrix.host-platform }}" +# echo "CUDA_BINDINGS_ARTIFACT_BASENAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}" >> $GITHUB_ENV +# echo "CUDA_BINDINGS_ARTIFACT_NAME=${CUDA_BINDINGS_ARTIFACT_BASENAME}-${{ github.sha }}" >> $GITHUB_ENV +# echo "CUDA_BINDINGS_ARTIFACTS_DIR=$(realpath "$REPO_DIR/cuda_bindings/dist")" >> $GITHUB_ENV +# echo "CIBW_BUILD=${CIBW_BUILD}" >> $GITHUB_ENV +# +# - name: Dump environment +# 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 }} +# CUDA_BINDINGS_PARALLEL_LEVEL=${{ env.CUDA_BINDINGS_PARALLEL_LEVEL }} +# CIBW_ENVIRONMENT_WINDOWS: > +# CUDA_HOME="$(cygpath -w ${{ env.CUDA_PATH }})" +# 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-windows: strategy: @@ -265,18 +265,18 @@ 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' }}) if: ${{ github.repository_owner == 'nvidia' }} permissions: contents: read # This is required for actions/checkout - needs: - - build +# needs: +# - build secrets: inherit uses: ./.github/workflows/test-wheel-windows.yml @@ -288,31 +288,31 @@ 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 permissions: checks: read needs: - - build - - test-linux +# - build +# - test-linux - test-windows - - doc +# - doc secrets: inherit uses: ./.github/workflows/status-check.yml From 5c9576f6c6c0441684c2b18635f13f6e99d8abea Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 15:18:24 -0500 Subject: [PATCH 02/12] WIP --- .github/workflows/test-wheel-windows.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 2312085df..1477eb3b8 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -40,6 +40,12 @@ jobs: - name: Ensure GPU is working run: nvidia-smi + - name: Switch to WDDM + run: | + Get-PnpDevice + Get-PnpDevice -FriendlyName 'NVIDIA' + nvidia-smi -i 0 -dm WDDM + - name: Set environment variables run: | $PYTHON_VERSION_FORMATTED = '${{ inputs.python-version }}' -replace '\.' From 3f10ce79403523a65fd33edfdc467d637b8f6a9c Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 15:29:13 -0500 Subject: [PATCH 03/12] WIP --- .github/workflows/test-wheel-windows.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 1477eb3b8..ed5458e72 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -43,8 +43,10 @@ jobs: - name: Switch to WDDM run: | Get-PnpDevice - Get-PnpDevice -FriendlyName 'NVIDIA' + $gpu = Get-PnpDevice -FriendlyName 'NVIDIA*' nvidia-smi -i 0 -dm WDDM + Disable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false + Enable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false - name: Set environment variables run: | From 23d17167c43e82123dc7d5868e5f5fd08362b89c Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 15:37:47 -0500 Subject: [PATCH 04/12] run as admin --- .github/scripts/enable_wddm.ps1 | 7 +++++++ .github/{workflows => scripts}/install_gpu_driver.ps1 | 0 .github/workflows/test-wheel-windows.yml | 8 ++------ 3 files changed, 9 insertions(+), 6 deletions(-) create mode 100644 .github/scripts/enable_wddm.ps1 rename .github/{workflows => scripts}/install_gpu_driver.ps1 (100%) diff --git a/.github/scripts/enable_wddm.ps1 b/.github/scripts/enable_wddm.ps1 new file mode 100644 index 000000000..c0cc60098 --- /dev/null +++ b/.github/scripts/enable_wddm.ps1 @@ -0,0 +1,7 @@ +#Requires -RunAsAdministrator + +Get-PnpDevice +$gpu = Get-PnpDevice -FriendlyName 'NVIDIA*' +nvidia-smi -i 0 -dm WDDM +Disable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false +Enable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false diff --git a/.github/workflows/install_gpu_driver.ps1 b/.github/scripts/install_gpu_driver.ps1 similarity index 100% rename from .github/workflows/install_gpu_driver.ps1 rename to .github/scripts/install_gpu_driver.ps1 diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index ed5458e72..e57f9fd93 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -35,18 +35,14 @@ jobs: - name: Update driver run: | - .github/workflows/install_gpu_driver.ps1 + .github/scripts/install_gpu_driver.ps1 - name: Ensure GPU is working run: nvidia-smi - name: Switch to WDDM run: | - Get-PnpDevice - $gpu = Get-PnpDevice -FriendlyName 'NVIDIA*' - nvidia-smi -i 0 -dm WDDM - Disable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false - Enable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false + .github/scripts/enable_wddm.ps1 - name: Set environment variables run: | From 7065d14fc99485baced62c8f8432f798de9ae5b0 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 16:10:40 -0500 Subject: [PATCH 05/12] try run as admin --- .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 e57f9fd93..555f6c2fc 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -41,6 +41,7 @@ jobs: run: nvidia-smi - name: Switch to WDDM + shell: powershell -Verb RunAs -command ". '{0}'" run: | .github/scripts/enable_wddm.ps1 From 6cb088c0e0b8242ccb76a8768c99333286bdf3b2 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 16:17:03 -0500 Subject: [PATCH 06/12] try run as admin --- .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 555f6c2fc..1af5e95b7 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -41,9 +41,8 @@ jobs: run: nvidia-smi - name: Switch to WDDM - shell: powershell -Verb RunAs -command ". '{0}'" run: | - .github/scripts/enable_wddm.ps1 + Start-Process powershell -Verb RunAs -ArgumentList "-File .github/scripts/enable_wddm.ps1" - name: Set environment variables run: | From 794dcc19af77534b9ff9ff8f2348655e41a635f5 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 16:29:44 -0500 Subject: [PATCH 07/12] try run as admin --- .github/workflows/test-wheel-windows.yml | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 1af5e95b7..9df0c2f9f 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -37,12 +37,27 @@ jobs: run: | .github/scripts/install_gpu_driver.ps1 - - name: Ensure GPU is working - run: nvidia-smi - - name: Switch to WDDM run: | - Start-Process powershell -Verb RunAs -ArgumentList "-File .github/scripts/enable_wddm.ps1" + $process = Start-Process powershell -Verb RunAs -ArgumentList "-File .github/scripts/enable_wddm.ps1" -PassThru -Wait -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt + $stdout = Get-Content stdout.txt + $stderr = Get-Content stderr.txt + $exitCode = $process.ExitCode + Remove-Item stdout.txt, stderr.txt + + Write-Host "Standard Output:" + $stdout + if ($exitCode -eq 0) { + Write-Host "Script executed successfully" + } else { + Write-Host "Script failed with exit code $exitCode" + Write-Host "Standard Error:" + $stderr + exit $exitCode + } + + - name: Ensure GPU is working + run: nvidia-smi - name: Set environment variables run: | From 15900beb05e70e17c8cb242b41bf05aa19fe3a43 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 16:44:19 -0500 Subject: [PATCH 08/12] try run as admin --- .github/workflows/test-wheel-windows.yml | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 9df0c2f9f..de0186837 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -39,21 +39,11 @@ jobs: - name: Switch to WDDM run: | - $process = Start-Process powershell -Verb RunAs -ArgumentList "-File .github/scripts/enable_wddm.ps1" -PassThru -Wait -RedirectStandardOutput stdout.txt -RedirectStandardError stderr.txt - $stdout = Get-Content stdout.txt - $stderr = Get-Content stderr.txt - $exitCode = $process.ExitCode - Remove-Item stdout.txt, stderr.txt - - Write-Host "Standard Output:" - $stdout - if ($exitCode -eq 0) { - Write-Host "Script executed successfully" + $process = Start-Process powershell -Verb RunAs -ArgumentList "-File .github/scripts/enable_wddm.ps1" -PassThru -Wait + if ($process.ExitCode -eq 0) { + Write-Host "Command executed successfully" } else { - Write-Host "Script failed with exit code $exitCode" - Write-Host "Standard Error:" - $stderr - exit $exitCode + Write-Host "Command failed with exit code $($process.ExitCode)" } - name: Ensure GPU is working From c5ae1d68b5a1ac3433d95b2e2c1268dc2d09bb19 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 17:01:22 -0500 Subject: [PATCH 09/12] try run as admin --- .github/workflows/test-wheel-windows.yml | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index de0186837..ba97f211f 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -39,12 +39,8 @@ jobs: - name: Switch to WDDM run: | - $process = Start-Process powershell -Verb RunAs -ArgumentList "-File .github/scripts/enable_wddm.ps1" -PassThru -Wait - if ($process.ExitCode -eq 0) { - Write-Host "Command executed successfully" - } else { - Write-Host "Command failed with exit code $($process.ExitCode)" - } + sc config "$((Get-Service actions.runner.*).name)" obj= "NT AUTHORITY\SYSTEM" type= own + .github/scripts/enable_wddm.ps1 - name: Ensure GPU is working run: nvidia-smi From 37d72c421f2750bb176b6e25deb407ea7f355a9e Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Fri, 21 Feb 2025 17:41:42 -0500 Subject: [PATCH 10/12] Update test-wheel-windows.yml --- .github/workflows/test-wheel-windows.yml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index ba97f211f..4e42fcd49 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -36,10 +36,15 @@ jobs: - name: Update driver run: | .github/scripts/install_gpu_driver.ps1 + "RUNNER_NAME=$((Get-Service actions.runner.*).name)" >> $Env:GITHUB_ENV + - name: Get admin priviledge + shell: cmd + run: | + sc config %RUNNER_NAME% obj= "NT AUTHORITY\SYSTEM" type= own + - name: Switch to WDDM run: | - sc config "$((Get-Service actions.runner.*).name)" obj= "NT AUTHORITY\SYSTEM" type= own .github/scripts/enable_wddm.ps1 - name: Ensure GPU is working From efa232e6b371931bf219bce27dcaa1c9733e4756 Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sun, 23 Feb 2025 22:08:09 -0500 Subject: [PATCH 11/12] Update test-wheel-windows.yml --- .github/workflows/test-wheel-windows.yml | 6 ------ 1 file changed, 6 deletions(-) diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 4e42fcd49..ce5226456 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -36,12 +36,6 @@ jobs: - name: Update driver run: | .github/scripts/install_gpu_driver.ps1 - "RUNNER_NAME=$((Get-Service actions.runner.*).name)" >> $Env:GITHUB_ENV - - - name: Get admin priviledge - shell: cmd - run: | - sc config %RUNNER_NAME% obj= "NT AUTHORITY\SYSTEM" type= own - name: Switch to WDDM run: | From 5bc6f9bdea1e3900a30110c46a09e9595e6ca79e Mon Sep 17 00:00:00 2001 From: Leo Fang Date: Sun, 23 Feb 2025 22:13:31 -0500 Subject: [PATCH 12/12] Update enable_wddm.ps1 --- .github/scripts/enable_wddm.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/scripts/enable_wddm.ps1 b/.github/scripts/enable_wddm.ps1 index c0cc60098..e13269cbf 100644 --- a/.github/scripts/enable_wddm.ps1 +++ b/.github/scripts/enable_wddm.ps1 @@ -2,6 +2,6 @@ Get-PnpDevice $gpu = Get-PnpDevice -FriendlyName 'NVIDIA*' -nvidia-smi -i 0 -dm WDDM +nvidia-smi -i 0 -fdm 0 Disable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false Enable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false