Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
417a5d7
Squash-merge of PR #1519 (rparolin/env_var_improvements) rebased onto…
rwgk Mar 20, 2026
2164c33
replace _get_cuda_paths() with _get_cuda_path() using pathfinder
rwgk Mar 20, 2026
c004342
treat empty env vars as undefined in get_cuda_home_or_path()
rwgk Mar 20, 2026
3ba64ae
fix(pathfinder): clear get_cuda_home_or_path cache in test fixtures
rwgk Mar 20, 2026
0c6c655
fix(core): update test_build_hooks for _get_cuda_path rename, drop mu…
rwgk Mar 20, 2026
a4e38d0
refactor(core): use get_cuda_home_or_path() in test conftest skipif
rwgk Mar 20, 2026
3cb531e
refactor(core): use get_cuda_home_or_path() in examples
rwgk Mar 20, 2026
c174cd8
rename get_cuda_home_or_path -> get_cuda_path_or_home
rwgk Mar 20, 2026
24b89b5
make get_cuda_path_or_home a public API, privatize CUDA_ENV_VARS_ORDERED
rwgk Mar 20, 2026
feecb82
docs(pathfinder): manually edit 1.5.0 release notes, fix RST formatti…
rwgk Mar 20, 2026
74e2d5b
Add 1.5.0, 1.4.3, 1.4.2 in cuda_pathfinder/docs/nv-versions.json
rwgk Mar 20, 2026
5ae2976
docs: clarify that CUDA_PATH/CUDA_HOME priority comes from pathfinder
rwgk Mar 20, 2026
6d065e9
fix oversights that slipped in when manually editing cuda_pathfinder/…
rwgk Mar 21, 2026
8d3ed03
fix(pathfinder): change found_via from "CUDA_HOME" to "CUDA_PATH"
rwgk Mar 21, 2026
5e445bf
fix(build): don't import cuda.pathfinder in build_hooks.py
rwgk Mar 21, 2026
f44a308
Revert "fix(build): don't import cuda.pathfinder in build_hooks.py"
rwgk Mar 21, 2026
47ea03e
ci: reduce build matrix to py3.12 only, enable CIBW_BUILD_VERBOSITY=3
rwgk Mar 21, 2026
30622e3
ci: add namespace package diagnostic to build hooks
rwgk Mar 21, 2026
1b4f1a2
ci: add pkgutil.extend_path fallback to namespace diagnostic
rwgk Mar 21, 2026
8a49f6a
ci: reduce test matrix to py3.12/CUDA 13.2.0 only
rwgk Mar 21, 2026
9f7793c
build: use cuda.pathfinder in build hooks with namespace fix
rwgk Mar 21, 2026
1884c5e
build: getattr fallback for cuda-pathfinder < 1.5
rwgk Mar 21, 2026
fd497c9
build: fix import style for ModuleNotFoundError compatibility
rwgk Mar 21, 2026
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
8 changes: 3 additions & 5 deletions .github/workflows/build-wheel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,8 @@ jobs:
fail-fast: false
matrix:
python-version:
- "3.10"
- "3.11"
# TODO: temporarily reduced to single entry for namespace package diagnostic
- "3.12"
- "3.13"
- "3.14"
- "3.14t"
name: py${{ matrix.python-version }}
runs-on: ${{ (inputs.host-platform == 'linux-64' && 'linux-amd64-cpu8') ||
(inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu8') ||
Expand Down Expand Up @@ -156,6 +152,8 @@ jobs:
output-dir: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}
env:
CIBW_BUILD: ${{ env.CIBW_BUILD }}
# TODO: temporary diagnostic for namespace package resolution — remove after investigation
CIBW_BUILD_VERBOSITY: "3"
# CIBW mounts the host filesystem under /host
CIBW_ENVIRONMENT_LINUX: >
CUDA_PATH=/host/${{ env.CUDA_PATH }}
Expand Down
61 changes: 2 additions & 59 deletions ci/test-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,70 +17,13 @@

linux:
pull-request:
# linux-64
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
# TODO: temporarily reduced to single entry per platform for namespace package diagnostic
- { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 't4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 't4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest' }
# linux-aarch64
- { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.10', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.11', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.12', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'arm64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest' }
# special runners
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '1', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 't4', GPU_COUNT: '2', DRIVER: 'latest' }
- { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'h100', GPU_COUNT: '2', DRIVER: 'latest' }
nightly: []

windows:
pull-request:
# win-64
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'rtx2080', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'WDDM' }
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' }
- { ARCH: 'amd64', PY_VER: '3.10', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' }
- { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
- { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'rtx4090', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'WDDM' }
- { ARCH: 'amd64', PY_VER: '3.11', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'rtx4090', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'WDDM' }
- { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
- { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' }
# TODO: temporarily reduced to single entry for namespace package diagnostic
- { ARCH: 'amd64', PY_VER: '3.12', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' }
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' }
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
- { ARCH: 'amd64', PY_VER: '3.13', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'rtxpro6000', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '12.9.1', LOCAL_CTK: '0', GPU: 'v100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' }
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.0.2', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
- { ARCH: 'amd64', PY_VER: '3.14', CUDA_VER: '13.2.0', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
- { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '12.9.1', LOCAL_CTK: '1', GPU: 'l4', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'TCC' }
- { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.0.2', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
- { ARCH: 'amd64', PY_VER: '3.14t', CUDA_VER: '13.2.0', LOCAL_CTK: '0', GPU: 'a100', GPU_COUNT: '1', DRIVER: 'latest', DRIVER_MODE: 'MCDM' }
nightly: []
7 changes: 4 additions & 3 deletions conftest.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

import os

import pytest

from cuda.pathfinder import get_cuda_path_or_home


def pytest_collection_modifyitems(config, items): # noqa: ARG001
cuda_home = os.environ.get("CUDA_HOME")
cuda_home = get_cuda_path_or_home()
for item in items:
nodeid = item.nodeid.replace("\\", "/")

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ To run these tests:

Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [Installing from Source](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them:

1. Setup environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation.
1. Setup environment variable `CUDA_PATH` (or `CUDA_HOME`) with the path to the CUDA Toolkit installation. Note: If both are set, `CUDA_PATH` takes precedence.
2. Run `build_tests` script located in `test/cython` appropriate to your platform. This will both cythonize the tests and build them.

To run these tests:
Expand Down
61 changes: 49 additions & 12 deletions cuda_bindings/build_hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,51 @@
_extensions = None


def _import_get_cuda_path_or_home():
"""Import get_cuda_path_or_home, working around PEP 517 namespace shadowing.

In isolated build environments, backend-path=["."] causes the ``cuda``
namespace package to resolve to only the project's ``cuda/`` directory,
hiding ``cuda.pathfinder`` installed in the build-env's site-packages.
Fix by replacing ``cuda.__path__`` with a plain list that includes the
site-packages ``cuda/`` directory.
"""
try:
import cuda.pathfinder
except ModuleNotFoundError:
pass
else:
return getattr(
cuda.pathfinder,
"get_cuda_path_or_home",
lambda: os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME")),
)

import cuda

for p in sys.path:
sp_cuda = os.path.join(p, "cuda")
if os.path.isdir(os.path.join(sp_cuda, "pathfinder")):
cuda.__path__ = list(cuda.__path__) + [sp_cuda]
break

import cuda.pathfinder

return getattr(
cuda.pathfinder,
"get_cuda_path_or_home",
lambda: os.environ.get("CUDA_PATH", os.environ.get("CUDA_HOME")),
)


@functools.cache
def _get_cuda_paths() -> list[str]:
CUDA_HOME = os.environ.get("CUDA_HOME", os.environ.get("CUDA_PATH", None))
if not CUDA_HOME:
raise RuntimeError("Environment variable CUDA_HOME or CUDA_PATH is not set")
CUDA_HOME = CUDA_HOME.split(os.pathsep)
print("CUDA paths:", CUDA_HOME)
return CUDA_HOME
def _get_cuda_path() -> str:
get_cuda_path_or_home = _import_get_cuda_path_or_home()
cuda_path = get_cuda_path_or_home()
if not cuda_path:
raise RuntimeError("Environment variable CUDA_PATH or CUDA_HOME is not set")
print("CUDA path:", cuda_path)
return cuda_path


# -----------------------------------------------------------------------
Expand Down Expand Up @@ -133,8 +170,8 @@ def _fetch_header_paths(required_headers, include_path_list):
if missing_headers:
error_message = "Couldn't find required headers: "
error_message += ", ".join(missing_headers)
cuda_paths = _get_cuda_paths()
raise RuntimeError(f'{error_message}\nIs CUDA_HOME setup correctly? (CUDA_HOME="{cuda_paths}")')
cuda_path = _get_cuda_path()
raise RuntimeError(f'{error_message}\nIs CUDA_PATH setup correctly? (CUDA_PATH="{cuda_path}")')

return header_dict

Expand Down Expand Up @@ -291,7 +328,7 @@ def _build_cuda_bindings(strip=False):

global _extensions

cuda_paths = _get_cuda_paths()
cuda_path = _get_cuda_path()

if os.environ.get("PARALLEL_LEVEL") is not None:
warn(
Expand All @@ -307,7 +344,7 @@ def _build_cuda_bindings(strip=False):
compile_for_coverage = bool(int(os.environ.get("CUDA_PYTHON_COVERAGE", "0")))

# Parse CUDA headers
include_path_list = [os.path.join(path, "include") for path in cuda_paths]
include_path_list = [os.path.join(cuda_path, "include")]
header_dict = _fetch_header_paths(_REQUIRED_HEADERS, include_path_list)
found_types, found_functions, found_values, found_struct, struct_list = _parse_headers(
header_dict, include_path_list, parser_caching
Expand Down Expand Up @@ -347,7 +384,7 @@ def _build_cuda_bindings(strip=False):
] + include_path_list
library_dirs = [sysconfig.get_path("platlib"), os.path.join(os.sys.prefix, "lib")]
cudalib_subdirs = [r"lib\x64"] if sys.platform == "win32" else ["lib64", "lib"]
library_dirs.extend(os.path.join(prefix, subdir) for prefix in cuda_paths for subdir in cudalib_subdirs)
library_dirs.extend(os.path.join(cuda_path, subdir) for subdir in cudalib_subdirs)

extra_compile_args = []
extra_link_args = []
Expand Down
9 changes: 8 additions & 1 deletion cuda_bindings/docs/source/environment_variables.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,14 @@ Runtime Environment Variables
Build-Time Environment Variables
--------------------------------

- ``CUDA_HOME`` or ``CUDA_PATH``: Specifies the location of the CUDA Toolkit.
- ``CUDA_PATH`` or ``CUDA_HOME``: Specifies the location of the CUDA Toolkit. If both are set, ``CUDA_PATH`` takes precedence.

.. note::
The ``CUDA_PATH`` > ``CUDA_HOME`` priority is determined by ``cuda-pathfinder``.
Earlier versions of ``cuda-pathfinder`` (before 1.5.0) used the opposite order
(``CUDA_HOME`` > ``CUDA_PATH``). See the
`cuda-pathfinder 1.5.0 release notes <https://nvidia.github.io/cuda-python/cuda-pathfinder/latest/release/1.5.0-notes.html>`_
for details and migration guidance.

- ``CUDA_PYTHON_PARSER_CACHING`` : bool, toggles the caching of parsed header files during the cuda-bindings build process. If caching is enabled (``CUDA_PYTHON_PARSER_CACHING`` is True), the cache path is set to ./cache_<library_name>, where <library_name> is derived from the cuda toolkit libraries used to build cuda-bindings.

Expand Down
4 changes: 2 additions & 2 deletions cuda_bindings/docs/source/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -87,11 +87,11 @@ Requirements

[^2]: The CUDA Runtime static library (``libcudart_static.a`` on Linux, ``cudart_static.lib`` on Windows) is part of the CUDA Toolkit. If using conda packages, it is contained in the ``cuda-cudart-static`` package.

Source builds require that the provided CUDA headers are of the same major.minor version as the ``cuda.bindings`` you're trying to build. Despite this requirement, note that the minor version compatibility is still maintained. Use the ``CUDA_HOME`` (or ``CUDA_PATH``) environment variable to specify the location of your headers. For example, if your headers are located in ``/usr/local/cuda/include``, then you should set ``CUDA_HOME`` with:
Source builds require that the provided CUDA headers are of the same major.minor version as the ``cuda.bindings`` you're trying to build. Despite this requirement, note that the minor version compatibility is still maintained. Use the ``CUDA_PATH`` (or ``CUDA_HOME``) environment variable to specify the location of your headers. If both are set, ``CUDA_PATH`` takes precedence. For example, if your headers are located in ``/usr/local/cuda/include``, then you should set ``CUDA_PATH`` with:

.. code-block:: console

$ export CUDA_HOME=/usr/local/cuda
$ export CUDA_PATH=/usr/local/cuda

See `Environment Variables <environment_variables.rst>`_ for a description of other build-time environment variables.

Expand Down
1 change: 1 addition & 0 deletions cuda_bindings/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ requires = [
"setuptools_scm[simple]>=8",
"cython>=3.2,<3.3",
"pyclibrary>=0.1.7",
"cuda-pathfinder",
]
build-backend = "build_hooks"
backend-path = ["."]
Expand Down
2 changes: 1 addition & 1 deletion cuda_core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ Alternatively, from the repository root you can use a simple script:

Cython tests are located in `tests/cython` and need to be built. These builds have the same CUDA Toolkit header requirements as [those of cuda.bindings](https://nvidia.github.io/cuda-python/cuda-bindings/latest/install.html#requirements) where the major.minor version must match `cuda.bindings`. To build them:

1. Set up environment variable `CUDA_HOME` with the path to the CUDA Toolkit installation.
1. Set up environment variable `CUDA_PATH` (or `CUDA_HOME`) with the path to the CUDA Toolkit installation. Note: If both are set, `CUDA_PATH` takes precedence.
2. Run `build_tests` script located in `tests/cython` appropriate to your platform. This will both cythonize the tests and build them.

To run these tests:
Expand Down
Loading
Loading