diff --git a/.github/actions/doc_preview/action.yml b/.github/actions/doc_preview/action.yml index 6948522daa..ae4f811157 100644 --- a/.github/actions/doc_preview/action.yml +++ b/.github/actions/doc_preview/action.yml @@ -41,7 +41,8 @@ runs: :---: |

:rocket: View preview at
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/
|
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-core/
- |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-bindings/

+ |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-bindings/
+ |
https://nvidia.github.io/cuda-python/pr-preview/pr-${{ inputs.pr-number }}/cuda-pathfinder/

|

Preview will be ready when the GitHub Pages deployment is complete.

# The steps below are executed only when building on main. diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index ed58b4f260..37fa211593 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -19,6 +19,7 @@ on: # - cuda-core # - cuda-bindings # - cuda-python + # - cuda-pathfinder # - all git-tag: description: "Target git tag to build docs for" diff --git a/.gitignore b/.gitignore index a9e5941f67..53c2e4f358 100644 --- a/.gitignore +++ b/.gitignore @@ -115,6 +115,7 @@ instance/ # Sphinx documentation docs_src/_build/ +*/docs/source/generated/ # PyBuilder .pybuilder/ diff --git a/README.md b/README.md index 5f8f3a11e1..cffa52f2e4 100644 --- a/README.md +++ b/README.md @@ -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. diff --git a/cuda_bindings/docs/README.md b/cuda_bindings/docs/README.md index a5e65842a8..54d670d091 100644 --- a/cuda_bindings/docs/README.md +++ b/cuda_bindings/docs/README.md @@ -1,11 +1,11 @@ # Build the documentation 1. Install the `cuda-bindings` package of the version that we need to document. -2. Ensure the version is included in the [`versions.json`](./versions.json). +2. Ensure the version is included in the [`nv-versions.json`](./nv-versions.json). 3. Build the docs with `./build_docs.sh`. 4. The html artifacts should be available under both `./build/html/latest` and `./build/html/`. 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. +should be kept intact, in order for the version selection (through `nv-versions.json`) to work. diff --git a/cuda_bindings/docs/source/release/13.X.Y-notes.rst b/cuda_bindings/docs/source/release/13.X.Y-notes.rst index 4cf9bd9405..0e0e82badd 100644 --- a/cuda_bindings/docs/source/release/13.X.Y-notes.rst +++ b/cuda_bindings/docs/source/release/13.X.Y-notes.rst @@ -16,7 +16,7 @@ Highlights * Automatic CUDA library path detection based on ``CUDA_HOME``, eliminating the need to manually set ``LIBRARY_PATH`` environment variables for installation. * The ``[all]`` optional dependencies now use ``cuda-toolkit`` with appropriate extras instead of individual packages. The NVCC compiler is no longer automatically installed with ``pip install cuda-python[all]`` as it was previously included only to access the NVVM library, which now has its own dedicated wheel. Users who need the NVCC compiler should explicitly install it with ``pip install cuda-toolkit[nvcc]==X.Y`` with the appropriate version for their needs. -* The Python overhead of calling functions in CUDA bindings in `driver`, `runtime` and `nvrtc` has been reduced by approximately 30%. +* The Python overhead of calling functions in CUDA bindings in ``driver``, ``runtime`` and ``nvrtc`` has been reduced by approximately 30%. Known issues diff --git a/cuda_core/docs/README.md b/cuda_core/docs/README.md index 7402ba68e5..a4c0aacf6f 100644 --- a/cuda_core/docs/README.md +++ b/cuda_core/docs/README.md @@ -1,11 +1,11 @@ # Build the documentation 1. Install the `cuda-core` package of the version that we need to document. -2. Ensure the version is included in the [`versions.json`](./versions.json). +2. Ensure the version is included in the [`nv-versions.json`](./nv-versions.json). 3. Build the docs with `./build_docs.sh`. 4. The html artifacts should be available under both `./build/html/latest` and `./build/html/`. 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. +should be kept intact, in order for the version selection (through `nv-versions.json`) to work. diff --git a/cuda_pathfinder/cuda/pathfinder/README.md b/cuda_pathfinder/cuda/pathfinder/README.md index ebed211fef..c020fc6a23 100644 --- a/cuda_pathfinder/cuda/pathfinder/README.md +++ b/cuda_pathfinder/cuda/pathfinder/README.md @@ -1,45 +1,3 @@ -# `cuda.pathfinder` Module +### The `cuda.pathfinder` documentation was moved -## Public API for loading NVIDIA Dynamic Libs - -* `cuda.pathfinder.SUPPORTED_NVIDIA_LIBNAMES` (`tuple[str]`) - -* `cuda.pathfinder.load_nvidia_dynamic_lib(libname: str) -> LoadedDL` - -* `cuda.pathfinder.LoadedDL`: - * `abs_path` (`str`) - * `was_already_loaded_from_elsewhere` (`bool`) - -* `cuda.pathfinder.DynamicLibNotFoundError` (inherits from `RuntimeError`) - -## Dynamic Library Loading Search Priority - -The `cuda.pathfinder.load_nvidia_dynamic_lib` function implements a -hierarchical search strategy for locating NVIDIA shared libraries: - -0. **Check if a library was loaded into the process already by some other means.** - - If yes, there is no alternative to skipping the rest of the search logic. - The absolute path of the already loaded library will be returned, along - with the handle to the library. - -1. **NVIDIA Python wheels** - - Scans all site-packages to find libraries installed via NVIDIA Python wheels. - -2. **OS default mechanisms / Conda environments** - - Falls back to native loader: - - `dlopen()` on Linux - - `LoadLibraryW()` on Windows - - Conda installations are expected to be discovered: - - Linux: Via `$ORIGIN/../lib` on `RPATH` (of the `python` binary; - note that this preempts `LD_LIBRARY_PATH` and `/etc/ld.so.conf.d/`) - - Windows: Via `%CONDA_PREFIX%\Library\bin` on system `PATH` - - CTK installations with system config updates are expected to be discovered: - - Linux: Via `/etc/ld.so.conf.d/*cuda*.conf` - - Windows: Via `C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y\bin` on system `PATH` - -3. **Environment variables** - - Relies on `CUDA_HOME` or `CUDA_PATH` environment variables if set - (in that order). - -Note that the search is done on a per-library basis. Currently there is no -centralized mechanism that ensures all libraries are found in the same way. +Please see https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/ diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py index 29f2654608..3160333aa9 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/load_nvidia_dynamic_lib.py @@ -53,16 +53,62 @@ def _load_lib_no_cache(libname: str) -> LoadedDL: @functools.cache def load_nvidia_dynamic_lib(libname: str) -> LoadedDL: - """Load a NVIDIA dynamic library by name. + """Load an NVIDIA dynamic library by name. Args: - libname: The name of the library to load (e.g. "cudart", "nvvm", etc.) + libname (str): The short name of the library to load (e.g., ``"cudart"``, + ``"nvvm"``, etc.). Returns: - A LoadedDL object containing the library handle and path + LoadedDL: Object containing the OS library handle and absolute path. Raises: - RuntimeError: If the library cannot be found or loaded + DynamicLibNotFoundError: If the library cannot be found or loaded. + RuntimeError: If Python is not 64-bit. + + Search order: + 0. **Already loaded in the current process** + + - If a matching library is already loaded by some other component, + return its absolute path and handle and skip the rest of the search. + + 1. **NVIDIA Python wheels** + + - Scan installed distributions (``site-packages``) to find libraries + shipped in NVIDIA wheels. + + 2. **OS default mechanisms / Conda environments** + + - Fall back to the native loader: + + - Linux: ``dlopen()`` + + - Windows: ``LoadLibraryW()`` + + - Conda installations are commonly discovered via: + + - Linux: ``$ORIGIN/../lib`` in the ``RPATH`` of the ``python`` binary + (note: this can take precedence over ``LD_LIBRARY_PATH`` and + ``/etc/ld.so.conf.d/``). + + - Windows: ``%CONDA_PREFIX%\\Library\\bin`` on the system ``PATH``. + + - CUDA Toolkit (CTK) system installs with system config updates are often + discovered via: + + - Linux: ``/etc/ld.so.conf.d/*cuda*.conf`` + + - Windows: ``C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\vX.Y\\bin`` + on the system ``PATH``. + + 3. **Environment variables** + + - If set, use ``CUDA_HOME`` or ``CUDA_PATH`` (in that order). + + Notes: + The search is performed **per library**. There is currently no mechanism to + guarantee that multiple libraries are all resolved from the same location. + """ pointer_size_bits = struct.calcsize("P") * 8 if pointer_size_bits != 64: diff --git a/cuda_pathfinder/docs/Makefile b/cuda_pathfinder/docs/Makefile new file mode 100644 index 0000000000..3d73179c53 --- /dev/null +++ b/cuda_pathfinder/docs/Makefile @@ -0,0 +1,23 @@ +# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# 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) diff --git a/cuda_pathfinder/docs/README.md b/cuda_pathfinder/docs/README.md new file mode 100644 index 0000000000..47b62fc677 --- /dev/null +++ b/cuda_pathfinder/docs/README.md @@ -0,0 +1,11 @@ +# Build the documentation + +1. Install the `cuda-pathfinder` package of the version that we need to document. +2. Ensure the version is included in the [`nv-versions.json`](./nv-versions.json). +3. Build the docs with `./build_docs.sh`. +4. The html artifacts should be available under both `./build/html/latest` and `./build/html/`. + +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 `nv-versions.json`) to work. diff --git a/cuda_pathfinder/docs/build_docs.sh b/cuda_pathfinder/docs/build_docs.sh new file mode 100755 index 0000000000..3d70cd5580 --- /dev/null +++ b/cuda_pathfinder/docs/build_docs.sh @@ -0,0 +1,50 @@ +#!/bin/bash + +# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +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 ./nv-versions.json build/html + +# 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 diff --git a/cuda_pathfinder/docs/nv-versions.json b/cuda_pathfinder/docs/nv-versions.json new file mode 100644 index 0000000000..1b38475786 --- /dev/null +++ b/cuda_pathfinder/docs/nv-versions.json @@ -0,0 +1,6 @@ +[ + { + "version": "latest", + "url": "https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/" + } +] diff --git a/cuda_pathfinder/docs/source/_templates/main.html b/cuda_pathfinder/docs/source/_templates/main.html new file mode 100644 index 0000000000..38a8d2d642 --- /dev/null +++ b/cuda_pathfinder/docs/source/_templates/main.html @@ -0,0 +1,13 @@ + + + + + + + + +

If this page does not refresh automatically, then please direct your browser to + our latest cuda.pathfinder docs. +

+ + diff --git a/cuda_pathfinder/docs/source/api.rst b/cuda_pathfinder/docs/source/api.rst new file mode 100644 index 0000000000..1870711a1e --- /dev/null +++ b/cuda_pathfinder/docs/source/api.rst @@ -0,0 +1,20 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda.pathfinder`` API Reference +================================= + +The ``cuda.pathfinder`` module provides utilities for loading NVIDIA dynamic libraries. + +Public API +----------- + +.. autosummary:: + :toctree: generated/ + + SUPPORTED_NVIDIA_LIBNAMES + load_nvidia_dynamic_lib + LoadedDL + DynamicLibNotFoundError diff --git a/cuda_pathfinder/docs/source/conf.py b/cuda_pathfinder/docs/source/conf.py new file mode 100644 index 0000000000..4ede571f2b --- /dev/null +++ b/cuda_pathfinder/docs/source/conf.py @@ -0,0 +1,95 @@ +# SPDX-FileCopyrightText: Copyright (c) 2012-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# 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 = "2025, NVIDIA" +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'PR {PR_NUMBER}' + html_theme_options["announcement"] = f"Warning: This documentation is only a preview for {PR_TEXT}!" + elif int(os.environ.get("BUILD_LATEST", 0)): + html_theme_options["announcement"] = ( + "Warning: 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), +} diff --git a/cuda_pathfinder/docs/source/contribute.rst b/cuda_pathfinder/docs/source/contribute.rst new file mode 100644 index 0000000000..4bfcd9c383 --- /dev/null +++ b/cuda_pathfinder/docs/source/contribute.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. _contributor_guide: + +Contributing +============ + +Thank you for your interest in contributing to ``cuda-pathfinder``! 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 `_ 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: + - Please ensure that your commits are signed `following GitHub's instruction `_. diff --git a/cuda_pathfinder/docs/source/index.rst b/cuda_pathfinder/docs/source/index.rst new file mode 100644 index 0000000000..b569d07b47 --- /dev/null +++ b/cuda_pathfinder/docs/source/index.rst @@ -0,0 +1,26 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +``cuda.pathfinder``: Utilities for locating CUDA components +=========================================================== + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + api + contribute + license + +.. toctree:: + :maxdepth: 2 + + release + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/cuda_pathfinder/docs/source/license.rst b/cuda_pathfinder/docs/source/license.rst new file mode 100644 index 0000000000..39c156a893 --- /dev/null +++ b/cuda_pathfinder/docs/source/license.rst @@ -0,0 +1,8 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Software License Agreement +************************** + +.. literalinclude:: ../../LICENSE + :language: text diff --git a/cuda_pathfinder/docs/source/release.rst b/cuda_pathfinder/docs/source/release.rst new file mode 100644 index 0000000000..f90e50d266 --- /dev/null +++ b/cuda_pathfinder/docs/source/release.rst @@ -0,0 +1,12 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +Release Notes +============= + +.. toctree:: + :maxdepth: 3 + + 1.X.Y + 1.1.0 + 1.0.0 diff --git a/cuda_pathfinder/docs/source/release/1.0.0-notes.rst b/cuda_pathfinder/docs/source/release/1.0.0-notes.rst new file mode 100644 index 0000000000..33c7941975 --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.0.0-notes.rst @@ -0,0 +1,17 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.0.0 Release notes +======================================== + +Released on Jul 16, 2025 + + +Highlights +---------- + +* First release of ``cuda-pathfinder`` as a stand-alone module. +* Replaces ``cuda.bindings.path_finder``, which was released with ``cuda-bindings`` 12.9.0 and is now `deprecated `_. +* ``cuda-pathfinder`` is a noarch package and has no dependencies (other than a Python 3.9+ interpreter). diff --git a/cuda_pathfinder/docs/source/release/1.1.0-notes.rst b/cuda_pathfinder/docs/source/release/1.1.0-notes.rst new file mode 100644 index 0000000000..14c3ba5b88 --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.1.0-notes.rst @@ -0,0 +1,16 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.1.0 Release notes +======================================== + +Released on Aug 7, 2025 + + +Highlights +---------- + +* CTK 13.0.0 compatibility +* Bug fix: load ``libnvJitLink.so.12`` from conda, not ``/usr/local/cuda`` (`PR #767 `_) diff --git a/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst b/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst new file mode 100644 index 0000000000..769e6f546e --- /dev/null +++ b/cuda_pathfinder/docs/source/release/1.X.Y-notes.rst @@ -0,0 +1,25 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.pathfinder + +``cuda-pathfinder`` 1.X.Y Release notes +======================================== + +Released on TBD + + +Highlights +---------- + +* ``RTLD_DI_LINKMAP``-based new implementation of ``abs_path_for_dynamic_library()`` (`PR #834 `_) + + - Eliminates ``supported_nvidia_libs.EXPECTED_LIB_SYMBOLS`` entirely, providing major simplification + - Step towards resolving library discovery issues + - Includes minor fixes and cleanup + +* Make ``add_dll_directory()`` and ``load_dependencies()`` side-effects more deterministic (`PR #855 `_) + + - Improves stability in general and supports nvmath specifically + - Proactive change to improve library loading consistency + - Drops boilerplate docstrings for private functions diff --git a/cuda_python/docs/build_all_docs.sh b/cuda_python/docs/build_all_docs.sh index 700f19d5ec..5c2765b989 100755 --- a/cuda_python/docs/build_all_docs.sh +++ b/cuda_python/docs/build_all_docs.sh @@ -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 diff --git a/cuda_python/docs/environment-docs.yml b/cuda_python/docs/environment-docs.yml index 47f1875e3a..f48579843f 100644 --- a/cuda_python/docs/environment-docs.yml +++ b/cuda_python/docs/environment-docs.yml @@ -5,6 +5,8 @@ name: cuda-python-docs channels: - conda-forge dependencies: + # ATTENTION: This dependency list is duplicated in + # toolshed/setup-docs-env.sh. Please KEEP THEM IN SYNC! - cython - myst-parser - numpy diff --git a/cuda_python/docs/source/index.rst b/cuda_python/docs/source/index.rst index d11cdbd7ed..9d2cfc93d8 100644 --- a/cuda_python/docs/source/index.rst +++ b/cuda_python/docs/source/index.rst @@ -15,7 +15,6 @@ multiple components: - `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. * `nvmath-python`_: Pythonic access to NVIDIA CPU & GPU Math Libraries, with both *host* and *device* (through `nvmath.device`_) APIs. It also provides low-level Python bindings to host C APIs (through `nvmath.bindings`_). -.. _cuda.pathfinder: https://github.com/NVIDIA/cuda-python/blob/main/cuda_pathfinder/cuda/pathfinder/README.md .. _nvmath-python: https://docs.nvidia.com/cuda/nvmath-python/latest .. _nvmath.device: https://docs.nvidia.com/cuda/nvmath-python/latest/overview.html#device-apis .. _nvmath.bindings: https://docs.nvidia.com/cuda/nvmath-python/latest/bindings/index.html @@ -35,7 +34,7 @@ be available, please refer to the `cuda.bindings`_ documentation for installatio release cuda.core cuda.bindings - cuda.pathfinder + cuda.pathfinder cuda.cccl.cooperative cuda.cccl.parallel numba.cuda diff --git a/toolshed/setup-docs-env.sh b/toolshed/setup-docs-env.sh new file mode 100755 index 0000000000..9d4768156e --- /dev/null +++ b/toolshed/setup-docs-env.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash + +# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Setup a local conda environment for building the sphinx docs to mirror the CI environment +# (see cuda_python/docs/environment-docs.yml). +# +# Usage: +# ./toolshed/setup-docs-env.sh +# +# Notes: +# - Requires an existing Miniforge/Conda install and `conda` on PATH. +# - Installs the same packages as CI’s environment-docs.yml. + +set -euo pipefail + +ENV_NAME="cuda-python-docs" +PYVER="3.12" + +have_cmd() { command -v "$1" >/dev/null 2>&1; } + +# --- sanity checks ----------------------------------------------------------- +if ! have_cmd conda; then + echo "ERROR: 'conda' not found on PATH. Please ensure Miniforge is installed and initialized." >&2 + exit 1 +fi + +# Load conda's shell integration into this bash process +eval "$(conda shell.bash hook)" + +if conda env list | awk '{print $1}' | grep -qx "${ENV_NAME}"; then + echo "⚠ Environment '${ENV_NAME}' already exists → NO ACTION" + exit 0 +fi + +echo "Creating environment '${ENV_NAME}'…" +# ATTENTION: This dependency list is duplicated in +# cuda_python/docs/environment-docs.yml. Please KEEP THEM IN SYNC! +conda create -y -n "${ENV_NAME}" \ + "python=${PYVER}" \ + cython \ + myst-parser \ + numpy \ + numpydoc \ + pip \ + pydata-sphinx-theme \ + pytest \ + scipy \ + "sphinx<8.2.0" \ + sphinx-copybutton \ + myst-nb \ + enum_tools \ + sphinx-toolbox \ + pyclibrary + +conda activate "${ENV_NAME}" +python -m pip install --upgrade pip +python -m pip install nvidia-sphinx-theme + +echo +echo "✅ Environment '${ENV_NAME}' is ready." +echo +echo "Build docs with e.g.:" +echo " conda activate ${ENV_NAME}" +echo " cd cuda_pathfinder/" +echo " pip install -e ." +echo " (cd docs/ && rm -rf build && ./build_docs.sh)"