Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
6e6d961
Initial plan
Copilot Aug 21, 2025
5aee727
Create Sphinx documentation infrastructure for cuda.pathfinder
Copilot Aug 21, 2025
b1fbe08
Fix title underline and test pathfinder documentation build
Copilot Aug 21, 2025
12c065f
Address all review feedback - fix references, remove unnecessary file…
Copilot Aug 21, 2025
e86e775
Add cuda-pathfinder documentation link to CI doc preview
Copilot Aug 21, 2025
237df56
[pre-commit.ci] auto code formatting
pre-commit-ci[bot] Aug 21, 2025
288a55b
Update cuda-core and cuda-bindings README to reference nv-versions.json
Copilot Aug 21, 2025
169cfa8
Merge branch 'main' into copilot/fix-760
leofang Aug 21, 2025
6f432c9
Refactor pathfinder documentation based on review feedback
Copilot Aug 22, 2025
7f1e84e
Add release notes for cuda-pathfinder versions 1.0.0 and 1.1.0
Copilot Aug 23, 2025
d252872
Fix SPDX license identifiers and add 1.1.1 release notes for PRs #834…
Copilot Aug 23, 2025
1f12c27
Restore _templates/main.html file as requested in review feedback
Copilot Aug 25, 2025
224156d
Change format as requested by Leo
rwgk Aug 25, 2025
9164130
Remove stray cuda/pathfinder/README.md URL in cuda_python/docs/source…
rwgk Aug 25, 2025
3f10ec8
Merge branch 'main' into copilot/fix-760
rwgk Aug 25, 2025
1006e2b
Rename release 1.1.1 to 1.X.Y
rwgk Aug 25, 2025
d096d21
Add version 1.0.0 in cuda_pathfinder/docs/nv-versions.json
rwgk Aug 25, 2025
89d3564
Merge branch 'main' into copilot/fix-760
leofang Aug 25, 2025
3d5d28b
Remove unused cuda_pathfinder/docs/make.bat
rwgk Aug 25, 2025
ecc5c19
Revert "Add version 1.0.0 in cuda_pathfinder/docs/nv-versions.json"
rwgk Aug 25, 2025
100f18a
Reduce divergence between cuda_bindings/docs/source/contribute.rst an…
rwgk Aug 25, 2025
1c0d6e8
Merge branch 'main' into copilot/fix-760
rwgk Aug 25, 2025
aebd77e
New pre-commit fixes (related to PR #901)
rwgk Aug 25, 2025
a7c8f89
Also remove version 1.1.0 from cuda_pathfinder/docs/nv-versions.json
rwgk Aug 25, 2025
06bc1db
Reduce cuda/pathfinder/README.md to a mere pointer to the sphinx-gene…
rwgk Aug 25, 2025
d5c5b79
Add the Search order section from the old README as a new section in …
rwgk Aug 25, 2025
b324515
Leo's edits to new part of load_nvidia_dynamic_lib docstring
rwgk Aug 26, 2025
5713624
Merge branch 'main' into copilot/fix-760
rwgk Aug 26, 2025
3d9ca9e
Add more empty lines in load_nvidia_dynamic_lib docstring
rwgk Aug 26, 2025
28d83dd
Remove `**` around Linux, Windows (for consistency)
rwgk Aug 26, 2025
ea8bd9a
Fix existing (on main) pre-commit error
rwgk Aug 26, 2025
c08ce51
Add `*/docs/source/generated/` to .gitignore
rwgk Aug 26, 2025
a97918e
Add toolshed/setup-docs-env.sh
rwgk Aug 26, 2025
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
1 change: 1 addition & 0 deletions .github/workflows/build-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ on:
# - cuda-core
# - cuda-bindings
# - cuda-python
# - cuda-pathfinder
# - all
git-tag:
description: "Target git tag to build docs for"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ CUDA Python is the home for accessing NVIDIA’s CUDA platform from Python. It c

* [cuda.core](https://nvidia.github.io/cuda-python/cuda-core/latest): Pythonic access to CUDA Runtime and other core functionalities
* [cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest): Low-level Python bindings to CUDA C APIs
* [cuda.pathfinder](https://github.com/NVIDIA/cuda-python/blob/main/cuda_pathfinder/cuda/pathfinder/README.md): Utilities for locating CUDA components installed in the user's Python environment
* [cuda.pathfinder](https://nvidia.github.io/cuda-python/cuda-pathfinder/latest): Utilities for locating CUDA components installed in the user's Python environment
* [cuda.cccl.cooperative](https://nvidia.github.io/cccl/python/cooperative): A Python module providing CCCL's reusable block-wide and warp-wide *device* primitives for use within Numba CUDA kernels
* [cuda.cccl.parallel](https://nvidia.github.io/cccl/python/parallel): A Python module for easy access to CCCL's highly efficient and customizable parallel algorithms, like `sort`, `scan`, `reduce`, `transform`, etc. that are callable on the *host*
* [numba.cuda](https://nvidia.github.io/numba-cuda/): Numba's target for CUDA GPU programming by directly compiling a restricted subset of Python code into CUDA kernels and device functions following the CUDA execution model.
Expand Down
23 changes: 23 additions & 0 deletions cuda_pathfinder/docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?= -j auto
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build/html/${SPHINX_CUDA_PATHFINDER_VER}

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -b help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -b $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
11 changes: 11 additions & 0 deletions cuda_pathfinder/docs/README.md
Comment thread
leofang marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Build the documentation

1. Install the `cuda-bindings` package of the version that we need to document.
Comment thread
leofang marked this conversation as resolved.
Outdated
2. Ensure the version is included in the [`versions.json`](./versions.json).
Comment thread
leofang marked this conversation as resolved.
Outdated
3. Build the docs with `./build_docs.sh`.
4. The html artifacts should be available under both `./build/html/latest` and `./build/html/<version>`.

Alternatively, we can build all the docs at once by running [`cuda_python/docs/build_all_docs.sh`](../../cuda_python/docs/build_all_docs.sh).

To publish the docs with the built version, it is important to note that the html files of older versions
should be kept intact, in order for the version selection (through `versions.json`) to work.
Comment thread
leofang marked this conversation as resolved.
Outdated
50 changes: 50 additions & 0 deletions cuda_pathfinder/docs/build_docs.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#!/bin/bash

# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
Comment thread
leofang marked this conversation as resolved.
Outdated

set -ex

if [[ "$#" == "0" ]]; then
LATEST_ONLY="0"
elif [[ "$#" == "1" && "$1" == "latest-only" ]]; then
LATEST_ONLY="1"
else
echo "usage: ./build_docs.sh [latest-only]"
exit 1
fi

# SPHINX_CUDA_PATHFINDER_VER is used to create a subdir under build/html
# (the Makefile file for sphinx-build also honors it if defined).
# If there's a post release (ex: .post1) we don't want it to show up in the
# version selector or directory structure.
if [[ -z "${SPHINX_CUDA_PATHFINDER_VER}" ]]; then
export SPHINX_CUDA_PATHFINDER_VER=$(python -c "from importlib.metadata import version; \
ver = '.'.join(str(version('cuda-pathfinder')).split('.')[:3]); \
print(ver)" \
| awk -F'+' '{print $1}')
fi

# build the docs (in parallel)
SPHINXOPTS="-j 4 -d build/.doctrees" make html

# for debugging/developing (conf.py), please comment out the above line and
# use the line below instead, as we must build in serial to avoid getting
# obsecure Sphinx errors
#SPHINXOPTS="-v" make html

# to support version dropdown menu
cp ./versions.json build/html
Comment thread
leofang marked this conversation as resolved.
Outdated

# to have a redirection page (to the latest docs)
cp source/_templates/main.html build/html/index.html

# ensure that the latest docs is the one we built
if [[ $LATEST_ONLY == "0" ]]; then
cp -r build/html/${SPHINX_CUDA_PATHFINDER_VER} build/html/latest
else
mv build/html/${SPHINX_CUDA_PATHFINDER_VER} build/html/latest
fi

# ensure that the Sphinx reference uses the latest docs
cp build/html/latest/objects.inv build/html
38 changes: 38 additions & 0 deletions cuda_pathfinder/docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
@ECHO OFF
Comment thread
rwgk marked this conversation as resolved.
Outdated

REM SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
REM SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
10 changes: 10 additions & 0 deletions cuda_pathfinder/docs/nv-versions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[
{
"version": "latest",
"url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/"
},
{
"version": "1.1.0",
"url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/1.1.0/"
}
Comment thread
rwgk marked this conversation as resolved.
Outdated
]
Comment thread
leofang marked this conversation as resolved.
Outdated
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
leofang marked this conversation as resolved.
Outdated
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Comment thread
leofang marked this conversation as resolved.
Outdated
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions cuda_pathfinder/docs/source/_templates/main.html
Comment thread
leofang marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE HTML>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="refresh" content="0; url=latest/" />
<link rel="canonical" href="latest/" />
</head>
<body>
<p>If this page does not refresh automatically, then please direct your browser to
<a href="latest/">our latest cuda.pathfinder docs</a>.
</p>
</body>
</html>
10 changes: 10 additions & 0 deletions cuda_pathfinder/docs/source/api.rst
Comment thread
leofang marked this conversation as resolved.
Comment thread
leofang marked this conversation as resolved.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0

API Reference
=============

.. automodule:: cuda.pathfinder
:members:
:undoc-members:
:show-inheritance:
103 changes: 103 additions & 0 deletions cuda_pathfinder/docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# SPDX-FileCopyrightText: Copyright (c) 2012-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Path setup --------------------------------------------------------------

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
import os

# import sys
# sys.path.insert(0, os.path.abspath('.'))


# -- Project information -----------------------------------------------------

project = "cuda.pathfinder"
copyright = "2021-2025, NVIDIA"
Comment thread
leofang marked this conversation as resolved.
Outdated
author = "NVIDIA"

# The full version, including alpha/beta/rc tags
release = os.environ["SPHINX_CUDA_PATHFINDER_VER"]


# -- General configuration ---------------------------------------------------

# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.autosummary",
"sphinx.ext.napoleon",
"sphinx.ext.intersphinx",
"myst_nb",
"enum_tools.autoenum",
"sphinx_copybutton",
]

nb_execution_mode = "off"
numfig = True

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_baseurl = "docs"
html_theme = "nvidia_sphinx_theme"
html_theme_options = {
"switcher": {
"json_url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/nv-versions.json",
"version_match": release,
},
# Add light/dark mode and documentation version switcher
"navbar_center": [
"version-switcher",
"navbar-nav",
],
}
if os.environ.get("CI"):
if int(os.environ.get("BUILD_PREVIEW", 0)):
PR_NUMBER = f"{os.environ['PR_NUMBER']}"
PR_TEXT = f'<a href="https://github.com/NVIDIA/cuda-python/pull/{PR_NUMBER}">PR {PR_NUMBER}</a>'
html_theme_options["announcement"] = f"<em>Warning</em>: This documentation is only a preview for {PR_TEXT}!"
elif int(os.environ.get("BUILD_LATEST", 0)):
html_theme_options["announcement"] = (
"<em>Warning</em>: This documentation is built from the development branch!"
)

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]

# skip cmdline prompts
copybutton_exclude = ".linenos, .gp"

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"nvvm": ("https://docs.nvidia.com/cuda/libnvvm-api/", None),
"nvjitlink": ("https://docs.nvidia.com/cuda/nvjitlink/", None),
"cufile": ("https://docs.nvidia.com/gpudirect-storage/api-reference-guide/", None),
Comment thread
leofang marked this conversation as resolved.
Outdated
}

suppress_warnings = [
# for warnings about multiple possible targets, see NVIDIA/cuda-python#152
"ref.python",
]
Comment thread
leofang marked this conversation as resolved.
Outdated
12 changes: 12 additions & 0 deletions cuda_pathfinder/docs/source/contribute.md
Comment thread
leofang marked this conversation as resolved.
Outdated
Comment thread
leofang marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Contributing

Thank you for your interest in contributing to `cuda-bindings`! Based on the type of contribution, it will fall into two categories:

1. You want to report a bug, feature request, or documentation issue
- File an [issue](https://github.com/NVIDIA/cuda-python/issues/new/choose)
describing what you encountered or what you want to see changed.
- The NVIDIA team will evaluate the issues and triage them, scheduling
them for a release. If you believe the issue needs priority attention
comment on the issue to notify the team.
2. You want to implement a feature, improvement, or bug fix:
- At this time we do not accept code contributions.
25 changes: 25 additions & 0 deletions cuda_pathfinder/docs/source/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0

``cuda.pathfinder``: Utilities for locating CUDA components
===========================================================

.. include:: ../../cuda/pathfinder/README.md
:parser: myst_parser.sphinx_
Comment thread
rwgk marked this conversation as resolved.
Outdated

.. toctree::
:maxdepth: 2
:caption: Contents:

api
support
contribute.md
license


Indices and tables
==================

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
8 changes: 8 additions & 0 deletions cuda_pathfinder/docs/source/license.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

Software License Agreement
**************************

.. literalinclude:: ../../LICENSE
:language: text
31 changes: 31 additions & 0 deletions cuda_pathfinder/docs/source/support.rst
Comment thread
leofang marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE

``cuda.bindings`` Support Policy
================================

The ``cuda.bindings`` module has the following support policy:

1. The module shares the same ``major.minor`` version with the CUDA Toolkit. The patch version (the
third number in the version string), however, is reserved to reflect Python-only changes and
is out of sync with the Toolkit patch version.
2. The module is actively maintained to support the latest CUDA major version and its prior major
version. For example, as of writing the bindings for CUDA 11 & 12 are maintained. Any fix in the
latest bindings would be backported to the prior major version.
3. The module supports `CUDA minor version compatibility`_, meaning that ``cuda.bindings`` 12.x
supports any Toolkit 12.y. (Whether or not a binding API would actually correctly function
depends on the underlying driver and the Toolkit versions, as described in the compatibility
documentation.)
4. The module supports all Python versions following the `CPython EOL schedule`_. As of writing
Python 3.9 - 3.13 are supported.
5. The module exposes a Cython layer from which types and functions could be ``cimport``'d. While
we strive to keep this layer stable, due to Cython limitations a new *minor* release of this
module could require Cython layer users to rebuild their projects and update their pinning to
this module.

The NVIDIA CUDA Python team reserves rights to amend the above support policy. Any major changes,
however, will be announced to the users in advance.


.. _CUDA minor version compatibility: https://docs.nvidia.com/deploy/cuda-compatibility/#minor-version-compatibility
.. _CPython EOL schedule: https://devguide.python.org/versions/
4 changes: 4 additions & 0 deletions cuda_pathfinder/docs/versions.json
Comment thread
leofang marked this conversation as resolved.
Outdated
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"latest" : "latest",
"1.1.0" : "1.1.0"
}
10 changes: 10 additions & 0 deletions cuda_python/docs/build_all_docs.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,3 +28,13 @@ rm -rf build
./build_docs.sh $@
cp -r build/html/* "$(dirs -l +1)"/$CUDA_CORE_PATH
popd

# build cuda-pathfinder docs
CUDA_PATHFINDER_PATH=build/html/cuda-pathfinder
mkdir -p $CUDA_PATHFINDER_PATH
pushd .
cd ../../cuda_pathfinder/docs
rm -rf build
./build_docs.sh $@
cp -r build/html/* "$(dirs -l +1)"/$CUDA_PATHFINDER_PATH
popd
2 changes: 1 addition & 1 deletion cuda_python/docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ be available, please refer to the `cuda.bindings`_ documentation for installatio
release.md
cuda.core <https://nvidia.github.io/cuda-python/cuda-core/latest>
cuda.bindings <https://nvidia.github.io/cuda-python/cuda-bindings/latest>
cuda.pathfinder <https://github.com/NVIDIA/cuda-python/blob/main/cuda_pathfinder/cuda/pathfinder/README.md>
cuda.pathfinder <https://nvidia.github.io/cuda-python/cuda-pathfinder/latest>
cuda.cccl.cooperative <https://nvidia.github.io/cccl/python/cooperative>
cuda.cccl.parallel <https://nvidia.github.io/cccl/python/parallel>
numba.cuda <https://nvidia.github.io/numba-cuda/>
Expand Down