Skip to content

Commit ec35752

Browse files
author
cuda-python-bot
committed
Deploy doc preview for PR 1285 (605f1ef)
1 parent cb43144 commit ec35752

File tree

592 files changed

+297213
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

592 files changed

+297213
-0
lines changed
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE HTML>
2+
<html lang="en">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta http-equiv="refresh" content="0; url=latest/" />
6+
<link rel="canonical" href="latest/" />
7+
</head>
8+
<body>
9+
<p>If this page does not refresh automatically, then please direct your browser to
10+
<a href="latest/">our latest docs</a>.
11+
</p>
12+
</body>
13+
</html>
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
# Sphinx build info version 1
2+
# This file records the configuration used when building these files. When it is not found, a full rebuild will be done.
3+
config: d0778a072656ec317fd11b6992f9c24b
4+
tags: 645f666f9bcd5a90fca523b33c5a78b7
332 KB
Loading
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
-------------------------
5+
CUDA Python API Reference
6+
-------------------------
7+
8+
.. toctree::
9+
:maxdepth: 3
10+
:caption: CaptionHolder:
11+
12+
module/driver
13+
module/runtime
14+
module/nvrtc
15+
module/nvjitlink
16+
module/nvvm
17+
module/cufile
18+
module/utils
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
Code of Conduct
5+
===============
6+
7+
Overview
8+
--------
9+
10+
Define the code of conduct followed and enforced for the ``cuda.bindings`` project.
11+
12+
Our Pledge
13+
----------
14+
15+
In the interest of fostering an open and welcoming environment, we as
16+
contributors and maintainers pledge to making participation in our project and
17+
our community a harassment-free experience for everyone, regardless of age, body
18+
size, disability, ethnicity, sex characteristics, gender identity and expression,
19+
level of experience, education, socio-economic status, nationality, personal
20+
appearance, race, religion, or sexual identity and orientation.
21+
22+
Our Standards
23+
-------------
24+
25+
Examples of behavior that contributes to creating a positive environment
26+
include:
27+
28+
* Using welcoming and inclusive language
29+
* Being respectful of differing viewpoints and experiences
30+
* Gracefully accepting constructive criticism
31+
* Focusing on what is best for the community
32+
* Showing empathy towards other community members
33+
34+
Examples of unacceptable behavior by participants include:
35+
36+
* The use of sexualized language or imagery and unwelcome sexual attention or
37+
advances
38+
* Trolling, insulting/derogatory comments, and personal or political attacks
39+
* Public or private harassment
40+
* Publishing others' private information, such as a physical or electronic
41+
address, without explicit permission
42+
* Other conduct which could reasonably be considered inappropriate in a
43+
professional setting
44+
45+
Our Responsibilities
46+
--------------------
47+
48+
Project maintainers are responsible for clarifying the standards of acceptable
49+
behavior and are expected to take appropriate and fair corrective action in
50+
response to any instances of unacceptable behavior.
51+
52+
Project maintainers have the right and responsibility to remove, edit, or
53+
reject comments, commits, code, wiki edits, issues, and other contributions
54+
that are not aligned to this Code of Conduct, or to ban temporarily or
55+
permanently any contributor for other behaviors that they deem inappropriate,
56+
threatening, offensive, or harmful.
57+
58+
Scope
59+
-----
60+
61+
This Code of Conduct applies both within project spaces and in public spaces
62+
when an individual is representing the project or its community. Examples of
63+
representing a project or community include using an official project e-mail
64+
address, posting via an official social media account, or acting as an appointed
65+
representative at an online or offline event. Representation of a project may be
66+
further defined and clarified by project maintainers.
67+
68+
Enforcement
69+
-----------
70+
71+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
72+
reported by contacting the project team at
73+
`cuda-python-conduct@nvidia.com <mailto:cuda-python-conduct@nvidia.com>`_ All
74+
complaints will be reviewed and investigated and will result in a response that
75+
is deemed necessary and appropriate to the circumstances. The project team is
76+
obligated to maintain confidentiality with regard to the reporter of an
77+
incident. Further details of specific enforcement policies may be posted
78+
separately.
79+
80+
Project maintainers who do not follow or enforce the Code of Conduct in good
81+
faith may face temporary or permanent repercussions as determined by other
82+
members of the project's leadership.
83+
84+
Attribution
85+
-----------
86+
87+
This Code of Conduct is adapted from the `Contributor Covenant <https://www.contributor-covenant.org>`_, version 1.4,
88+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
89+
90+
For answers to common questions about this code of conduct, see
91+
https://www.contributor-covenant.org/faq
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
Contributing
5+
============
6+
7+
Thank you for your interest in contributing to ``cuda-bindings``! Based on the type of contribution, it will fall into two categories:
8+
9+
1. You want to report a bug, feature request, or documentation issue
10+
- File an `issue <https://github.com/NVIDIA/cuda-python/issues/new/choose>`_ describing what you encountered or what you want to see changed.
11+
- The NVIDIA team will evaluate the issues and triage them, scheduling
12+
them for a release. If you believe the issue needs priority attention
13+
comment on the issue to notify the team.
14+
2. You want to implement a feature, improvement, or bug fix:
15+
- At this time we do not accept code contributions.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
Environment Variables
5+
=====================
6+
7+
Runtime Environment Variables
8+
-----------------------------
9+
10+
- ``CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM`` : When set to 1, the default stream is the per-thread default stream. When set to 0, the default stream is the legacy default stream. This defaults to 0, for the legacy default stream. See `Stream Synchronization Behavior <https://docs.nvidia.com/cuda/cuda-runtime-api/stream-sync-behavior.html>`_ for an explanation of the legacy and per-thread default streams.
11+
12+
13+
Build-Time Environment Variables
14+
--------------------------------
15+
16+
- ``CUDA_HOME`` or ``CUDA_PATH``: Specifies the location of the CUDA Toolkit.
17+
18+
- ``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.
19+
20+
- ``CUDA_PYTHON_PARALLEL_LEVEL`` (previously ``PARALLEL_LEVEL``) : int, sets the number of threads used in the compilation of extension modules. Not setting it or setting it to 0 would disable parallel builds.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
.. SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
``cuda.bindings``: Low-level Python Bindings for CUDA
5+
=====================================================
6+
7+
.. toctree::
8+
:maxdepth: 2
9+
:caption: Contents:
10+
11+
release
12+
install
13+
overview
14+
motivation
15+
environment_variables
16+
api
17+
tips_and_tricks
18+
support
19+
contribute
20+
conduct
21+
license
22+
23+
24+
Indices and tables
25+
==================
26+
27+
* :ref:`genindex`
28+
* :ref:`modindex`
29+
* :ref:`search`
Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,111 @@
1+
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
Installation
5+
============
6+
7+
Runtime Requirements
8+
--------------------
9+
10+
``cuda.bindings`` supports the same platforms as CUDA. Runtime dependencies are:
11+
12+
* Linux (x86-64, arm64) and Windows (x86-64)
13+
* Python 3.10 - 3.14
14+
* Driver: Linux (580.65.06 or later) Windows (580.88 or later)
15+
* Optionally, NVRTC, nvJitLink, NVVM, and cuFile from CUDA Toolkit 13.x
16+
17+
.. note::
18+
19+
The optional CUDA Toolkit components are now installed via the ``cuda-toolkit`` metapackage from PyPI for improved dependency resolution. Components can also be installed via Conda, OS-specific package managers, or local installers (as described in the CUDA Toolkit `Windows <https://docs.nvidia.com/cuda/cuda-installation-guide-microsoft-windows/index.html>`_ and `Linux <https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html>`_ Installation Guides).
20+
21+
Starting from v12.8.0, ``cuda-python`` becomes a meta package which currently depends only on ``cuda-bindings``; in the future more sub-packages will be added to ``cuda-python``. In the instructions below, we still use ``cuda-python`` as example to serve existing users, but everything is applicable to ``cuda-bindings`` as well.
22+
23+
24+
Free-threading Build Support
25+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
26+
27+
As of cuda-bindings 13.0.2 and 12.9.3, **experimental** packages for the `free-threaded interpreter`_ are shipped.
28+
29+
1. Support for these builds is best effort, due to heavy use of `built-in
30+
modules that are known to be thread-unsafe`_, such as ``ctypes``.
31+
2. For now, you are responsible for making sure that calls into the ``cuda-bindings``
32+
library are thread-safe. This is subject to change.
33+
34+
.. _built-in modules that are known to be thread-unsafe: https://github.com/python/cpython/issues/116738
35+
.. _free-threaded interpreter: https://docs.python.org/3/howto/free-threading-python.html
36+
37+
38+
Installing from PyPI
39+
--------------------
40+
41+
.. code-block:: console
42+
43+
$ pip install -U cuda-python
44+
45+
Install all optional dependencies with:
46+
47+
.. code-block:: console
48+
49+
$ pip install -U cuda-python[all]
50+
51+
Where the optional dependencies include:
52+
53+
* ``nvidia-cuda-nvrtc`` (NVRTC runtime compilation library)
54+
* ``nvidia-nvjitlink`` (nvJitLink library)
55+
* ``nvidia-nvvm`` (NVVM library)
56+
* ``nvidia-cufile`` (cuFile library, Linux only)
57+
58+
These are now installed through the ``cuda-toolkit`` metapackage for improved dependency resolution.
59+
60+
Installing from Conda
61+
---------------------
62+
63+
.. code-block:: console
64+
65+
$ conda install -c conda-forge cuda-python
66+
67+
.. note::
68+
69+
When using conda, the ``cuda-version`` metapackage can be used to control the versions of CUDA Toolkit components that are installed to the conda environment.
70+
71+
For example:
72+
73+
.. code-block:: console
74+
75+
$ conda install -c conda-forge cuda-python cuda-version=13
76+
77+
Installing from Source
78+
----------------------
79+
80+
Requirements
81+
^^^^^^^^^^^^
82+
83+
* CUDA Toolkit headers[^1]
84+
* CUDA Runtime static library[^2]
85+
86+
[^1]: User projects that ``cimport`` CUDA symbols in Cython must also use CUDA Toolkit (CTK) types as provided by the ``cuda.bindings`` major.minor version. This results in CTK headers becoming a transitive dependency of downstream projects through CUDA Python.
87+
88+
[^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.
89+
90+
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:
91+
92+
.. code-block:: console
93+
94+
$ export CUDA_HOME=/usr/local/cuda
95+
96+
See `Environment Variables <environment_variables.rst>`_ for a description of other build-time environment variables.
97+
98+
.. note::
99+
100+
Only ``cydriver``, ``cyruntime`` and ``cynvrtc`` are impacted by the header requirement.
101+
102+
Editable Install
103+
^^^^^^^^^^^^^^^^
104+
105+
You can use:
106+
107+
.. code-block:: console
108+
109+
$ pip install -v -e .
110+
111+
to install the module as editable in your current Python environment (e.g. for testing of porting other libraries to use the binding).
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
Software License Agreement
5+
**************************
6+
7+
.. literalinclude:: ../../LICENSE
8+
:language: text

0 commit comments

Comments
 (0)