Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/scripts/enable_wddm.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#Requires -RunAsAdministrator

Get-PnpDevice
$gpu = Get-PnpDevice -FriendlyName 'NVIDIA*'
nvidia-smi -i 0 -fdm 0
Disable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false
Enable-PnpDevice -InstanceId $gpu.InstanceId -Confirm:$false
File renamed without changes.
518 changes: 259 additions & 259 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion .github/workflows/test-wheel-windows.yml
Original file line number Diff line number Diff line change
@@ -35,7 +35,11 @@ jobs:

- name: Update driver
run: |
.github/workflows/install_gpu_driver.ps1
.github/scripts/install_gpu_driver.ps1
- name: Switch to WDDM
run: |
.github/scripts/enable_wddm.ps1
- name: Ensure GPU is working
run: nvidia-smi