Skip to content
Draft
Show file tree
Hide file tree
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
95 changes: 92 additions & 3 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0

Expand Down Expand Up @@ -91,14 +91,20 @@ jobs:
if [[ ${{ inputs.is-release }} == "true" ]]; then
FILE_HASH="*"
COMMIT_HASH="${{ inputs.git-tag }}"
DOCS_GITHUB_REF="${{ inputs.git-tag }}"
if [[ -z "${DOCS_GITHUB_REF}" ]]; then
DOCS_GITHUB_REF="${GITHUB_REF_NAME}"
fi
COMMIT_HASH="${DOCS_GITHUB_REF}"
else
FILE_HASH="${{ github.sha }}"
COMMIT_HASH="${{ github.sha }}"
DOCS_GITHUB_REF="${{ github.sha }}"
COMMIT_HASH="${DOCS_GITHUB_REF}"
fi
# make outputs from the previous job as env vars
CUDA_CORE_ARTIFACT_BASENAME="cuda-core-python${PYTHON_VERSION_FORMATTED}-linux-64"
echo "CUDA_PYTHON_DOCS_GITHUB_REF=${DOCS_GITHUB_REF}" >> $GITHUB_ENV
echo "COMMIT_HASH=${COMMIT_HASH}" >> $GITHUB_ENV
echo "CUDA_CORE_ARTIFACT_BASENAME=${CUDA_CORE_ARTIFACT_BASENAME}" >> $GITHUB_ENV
echo "CUDA_CORE_ARTIFACT_NAME=${CUDA_CORE_ARTIFACT_BASENAME}-${FILE_HASH}" >> $GITHUB_ENV
Expand Down Expand Up @@ -242,6 +248,11 @@ jobs:
fi
mv ${COMPONENT}/docs/build/html/* artifacts/docs/${TARGET}
- name: Write doc preview marker
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
run: |
echo "${{ github.sha }}" > artifacts/docs/.preview-commit
# TODO: Consider removing this step?
- name: Upload doc artifacts
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
Expand All @@ -257,6 +268,84 @@ jobs:
'artifacts/empty_docs' }}
pr-number: ${{ env.PR_NUMBER }}

- name: Wait for doc preview deployment
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
env:
PREVIEW_URL: https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}
EXPECTED_SHA: ${{ github.sha }}
run: |
preview_ready=0
marker_url="${PREVIEW_URL}/.preview-commit"
for attempt in {1..60}; do
marker=$(curl -fsSL "${marker_url}" || true)
if [[ "${marker}" == "${EXPECTED_SHA}" ]]; then
preview_ready=1
break
fi
echo "Waiting for doc preview marker ${marker_url} (${attempt}/60)"
sleep 10
done
if [[ "${preview_ready}" != "1" ]]; then
echo "error: doc preview marker did not update to ${EXPECTED_SHA}" >&2
exit 1
fi
echo "Doc preview is available at ${PREVIEW_URL}"
- name: Restore lychee cache
id: restore-lychee-cache
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .lycheecache
key: docs-preview-lychee-${{ env.PR_NUMBER }}-${{ github.sha }}
restore-keys: |
docs-preview-lychee-${{ env.PR_NUMBER }}-
- name: Write lychee doc preview URL list
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
env:
PREVIEW_URL: https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}
run: |
find "${GITHUB_WORKSPACE}/artifacts/docs" -type f -name '*.html' ! -path '*/_static/*' -printf '%P\n' \
| LC_ALL=C sort \
| sed "s#^#${PREVIEW_URL}/#" > lychee-preview-urls.txt
if [[ ! -s lychee-preview-urls.txt ]]; then
echo "error: no rendered HTML pages found for lychee" >&2
exit 1
fi
wc -l lychee-preview-urls.txt
- name: Check doc preview links
if: ${{ !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') }}
uses: lycheeverse/lychee-action@6da1d14f3a43098a294b7696d93d938aa8d20fc0 # unreleased: supports v0.24.x archive layout
with:
args: >-
--files-from ${{ github.workspace }}/lychee-preview-urls.txt
--include-fragments=full
--cache
--max-cache-age 1d
--max-concurrency 16
--host-concurrency 2
--host-request-interval 250ms
--max-retries 3
--retry-wait-time 5
--timeout 30
--no-progress
fail: true
failIfEmpty: true
format: markdown
jobSummary: false
lycheeVersion: v0.24.2
output: lychee-preview.md
token: ${{ github.token }}

- name: Save lychee cache
if: ${{ always() && !inputs.is-release && github.ref_name != 'main' && !startsWith(github.ref_name, 'release/') && steps.restore-lychee-cache.outputs.cache-hit != 'true' && steps.restore-lychee-cache.outputs.cache-primary-key != '' }}
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: .lycheecache
key: ${{ steps.restore-lychee-cache.outputs.cache-primary-key }}

- name: Deploy doc update
if: ${{ github.ref_name == 'main' || inputs.is-release }}
uses: JamesIves/github-pages-deploy-action@d92aa235d04922e8f08b40ce78cc5442fcfbfa2f # v4.8.0
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ __pycache__/

# CUDA Python specific
.cache/
.lycheecache
.pytest_cache/
.benchmarks/
*.cpp
Expand Down
16 changes: 16 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ci:
autoupdate_branch: ''
autoupdate_commit_msg: '[pre-commit.ci] pre-commit autoupdate'
autoupdate_schedule: quarterly
skip: [lychee]
Comment thread
kkraus14 marked this conversation as resolved.
submodules: false

# Please update the rev: SHAs below with this command:
Expand Down Expand Up @@ -42,6 +43,21 @@ repos:
language: system
files: '^.*/docs/source/.*\.md$'

# Link checking for authored documentation files
- repo: https://github.com/lycheeverse/lychee
rev: lychee-v0.24.2
hooks:
- id: lychee
args:
- LYCHEE_VERSION=0.24.2
- --cache
- --max-concurrency=4
- --max-retries=3
- --no-progress
- --exclude
- '^https://github\.com/NVIDIA/cuda-python/(blob|tree)/$'
files: '\.(md|rst)$'

# Standard hooks
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0
Expand Down
3 changes: 1 addition & 2 deletions cuda_bindings/cuda/bindings/_bindings/cydriver.pxd.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1711+g875fec45. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
from cuda.bindings.cydriver cimport *

{{if 'cuGetErrorString' in found_functions}}
Expand Down Expand Up @@ -2523,4 +2523,3 @@ cdef CUresult _cuGraphicsVDPAURegisterVideoSurface(CUgraphicsResource* pCudaReso

cdef CUresult _cuGraphicsVDPAURegisterOutputSurface(CUgraphicsResource* pCudaResource, VdpOutputSurface vdpSurface, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
{{endif}}

2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_bindings/cydriver.pyx.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1711+g875fec45. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
{{if 'Windows' == platform.system()}}
import os
cimport cuda.bindings._lib.windll as windll
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
include "../cyruntime_types.pxi"

include "../_lib/cyruntime/cyruntime.pxd"
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
include "../cyruntime_functions.pxi"

import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
cdef extern from "":
"""
#define CUDA_API_PER_THREAD_DEFAULT_STREAM
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
cdef extern from "":
"""
#define CUDA_API_PER_THREAD_DEFAULT_STREAM
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/nvrtc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
#
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

from ..cynvrtc cimport *

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
#
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

from libc.stdint cimport intptr_t, uintptr_t

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
#
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

from libc.stdint cimport intptr_t

Expand Down
4 changes: 2 additions & 2 deletions cuda_bindings/cuda/bindings/cydriver.pxd.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1711+g875fec45. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

from libc.stdint cimport uint32_t, uint64_t

Expand Down Expand Up @@ -5550,4 +5550,4 @@ cdef enum: CU_DEVICE_INVALID = -2

cdef enum: MAX_PLANES = 3

cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295
cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/cydriver.pyx.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1711+g875fec45. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
cimport cuda.bindings._bindings.cydriver as cydriver

{{if 'cuGetErrorString' in found_functions}}
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/cynvrtc.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
#
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

from libc.stdint cimport uint32_t, uint64_t

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/cynvrtc.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
#
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

from ._internal cimport nvrtc as _nvrtc

Expand Down
4 changes: 2 additions & 2 deletions cuda_bindings/cuda/bindings/cyruntime.pxd.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

from libc.stdint cimport uint32_t, uint64_t

Expand Down Expand Up @@ -2091,4 +2091,4 @@ cdef enum: CUDART_VERSION = 13030

cdef enum: __CUDART_API_VERSION = 13030

cdef enum: CUDA_EGL_MAX_PLANES = 3
cdef enum: CUDA_EGL_MAX_PLANES = 3
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/cyruntime.pyx.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
cimport cuda.bindings._bindings.cyruntime as cyruntime
cimport cython

Expand Down
3 changes: 1 addition & 2 deletions cuda_bindings/cuda/bindings/cyruntime_functions.pxi.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.
cdef extern from "cuda_runtime_api.h":

{{if 'cudaDeviceReset' in found_functions}}
Expand Down Expand Up @@ -1615,4 +1615,3 @@ cdef extern from "cuda_profiler_api.h":
cudaError_t cudaProfilerStop() nogil

{{endif}}

2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/cyruntime_types.pxi.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.
# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1731+g535901cce.d20260604. Do not modify it directly.

cdef extern from "vector_types.h":

Expand Down
Loading
Loading