Skip to content

Commit 3fdfd8c

Browse files
committed
Fix rendered docs linkcheck failures
1 parent 2a22f81 commit 3fdfd8c

13 files changed

Lines changed: 83 additions & 42 deletions

File tree

.github/workflows/build-docs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -306,7 +306,7 @@ jobs:
306306
env:
307307
PREVIEW_URL: https://nvidia.github.io/cuda-python/pr-preview/pr-${{ env.PR_NUMBER }}
308308
run: |
309-
find "${GITHUB_WORKSPACE}/artifacts/docs" -type f -name '*.html' -printf '%P\n' \
309+
find "${GITHUB_WORKSPACE}/artifacts/docs" -type f -name '*.html' ! -path '*/_static/*' -printf '%P\n' \
310310
| LC_ALL=C sort \
311311
| sed "s#^#${PREVIEW_URL}/#" > lychee-preview-urls.txt
312312
if [[ ! -s lychee-preview-urls.txt ]]; then

cuda_bindings/docs/source/conf.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,15 @@ def _github_examples_ref():
3737
GITHUB_EXAMPLES_REF = _github_examples_ref()
3838

3939

40+
def _html_baseurl():
41+
docs_domain = os.environ.get("CUDA_PYTHON_DOCS_DOMAIN", "https://nvidia.github.io/cuda-python")
42+
if int(os.environ.get("BUILD_PREVIEW", 0)):
43+
return f"{docs_domain}/pr-preview/pr-{os.environ['PR_NUMBER']}/cuda-bindings/latest/"
44+
if int(os.environ.get("BUILD_LATEST", 0)):
45+
return f"{docs_domain}/cuda-bindings/latest/"
46+
return f"{docs_domain}/cuda-bindings/{release}/"
47+
48+
4049
# -- General configuration ---------------------------------------------------
4150

4251
# Add any Sphinx extension module names here, as strings. They can be
@@ -76,7 +85,7 @@ def _github_examples_ref():
7685

7786
# The theme to use for HTML and HTML Help pages. See the documentation for
7887
# a list of builtin themes.
79-
html_baseurl = "docs"
88+
html_baseurl = _html_baseurl()
8089
html_theme = "nvidia_sphinx_theme"
8190
html_theme_options = {
8291
"switcher": {

cuda_bindings/docs/source/install.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33
44
Installation
@@ -99,7 +99,7 @@ Source builds require that the provided CUDA headers are of the same major.minor
9999
100100
$ export CUDA_PATH=/usr/local/cuda
101101
102-
See `Environment Variables <environment_variables.rst>`_ for a description of other build-time environment variables.
102+
See :doc:`Environment Variables <environment_variables>` for a description of other build-time environment variables.
103103

104104
.. note::
105105

cuda_bindings/docs/source/module/driver.rst

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -406,25 +406,25 @@ Data types used by CUDA driver
406406
.. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_GEQ
407407

408408

409-
Wait until (int32_t)(*addr - value) >= 0 (or int64_t for 64 bit values). Note this is a cyclic comparison which ignores wraparound. (Default behavior.)
409+
Wait until (int32_t)(\*addr - value) >= 0 (or int64_t for 64 bit values). Note this is a cyclic comparison which ignores wraparound. (Default behavior.)
410410

411411

412412
.. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_EQ
413413

414414

415-
Wait until *addr == value.
415+
Wait until \*addr == value.
416416

417417

418418
.. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_AND
419419

420420

421-
Wait until (*addr & value) != 0.
421+
Wait until (\*addr & value) != 0.
422422

423423

424424
.. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_NOR
425425

426426

427-
Wait until ~(*addr | value) != 0. Support for this operation can be queried with :py:obj:`~.cuDeviceGetAttribute()` and :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR`.
427+
Wait until ~(\*addr | value) != 0. Support for this operation can be queried with :py:obj:`~.cuDeviceGetAttribute()` and :py:obj:`~.CU_DEVICE_ATTRIBUTE_CAN_USE_STREAM_WAIT_VALUE_NOR`.
428428

429429

430430
.. autoattribute:: cuda.bindings.driver.CUstreamWaitValue_flags.CU_STREAM_WAIT_VALUE_FLUSH
@@ -506,19 +506,19 @@ Data types used by CUDA driver
506506
.. autoattribute:: cuda.bindings.driver.CUstreamAtomicReductionOpType.CU_STREAM_ATOMIC_REDUCTION_OP_OR
507507

508508

509-
Performs an atomic OR: *(address) = *(address) | value
509+
Performs an atomic OR: \*(address) = \*(address) | value
510510

511511

512512
.. autoattribute:: cuda.bindings.driver.CUstreamAtomicReductionOpType.CU_STREAM_ATOMIC_REDUCTION_OP_AND
513513

514514

515-
Performs an atomic AND: *(address) = *(address) & value
515+
Performs an atomic AND: \*(address) = \*(address) & value
516516

517517

518518
.. autoattribute:: cuda.bindings.driver.CUstreamAtomicReductionOpType.CU_STREAM_ATOMIC_REDUCTION_OP_ADD
519519

520520

521-
Performs an atomic ADD: *(address) = *(address) + value
521+
Performs an atomic ADD: \*(address) = \*(address) + value
522522

523523
.. autoclass:: cuda.bindings.driver.CUstreamAtomicReductionDataType
524524

cuda_bindings/docs/source/module/runtime.rst

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
1+
.. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
22
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
33
44
-------
@@ -299,7 +299,7 @@ Data types used by CUDA Runtime
299299
.. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorIncompatibleDriverContext
300300

301301

302-
This indicates that the current context is not compatible with this the CUDA Runtime. This can only occur if you are using CUDA Runtime/Driver interoperability and have created an existing Driver context using the driver API. The Driver context may be incompatible either because the Driver context was created using an older version of the API, because the Runtime API call expects a primary driver context and the Driver context is not primary, or because the Driver context has been destroyed. Please see :py:obj:`~.Interactions`with the CUDA Driver API" for more information.
302+
This indicates that the current context is not compatible with this the CUDA Runtime. This can only occur if you are using CUDA Runtime/Driver interoperability and have created an existing Driver context using the driver API. The Driver context may be incompatible either because the Driver context was created using an older version of the API, because the Runtime API call expects a primary driver context and the Driver context is not primary, or because the Driver context has been destroyed. Please see `Interactions with the CUDA Driver API`_ for more information.
303303

304304

305305
.. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorMissingConfiguration
@@ -6403,11 +6403,11 @@ The types ::CUevent and cudaEvent_t are identical and may be used interchangeabl
64036403

64046404

64056405

6406-
The types ::CUarray and struct ::cudaArray * represent the same data type and may be used interchangeably by casting the two types between each other.
6406+
The types ``CUarray`` and ``struct cudaArray *`` represent the same data type and may be used interchangeably by casting the two types between each other.
64076407

6408-
In order to use a ::CUarray in a CUDA Runtime API function which takes a struct ::cudaArray *, it is necessary to explicitly cast the ::CUarray to a struct ::cudaArray *.
6408+
In order to use a ``CUarray`` in a CUDA Runtime API function which takes a ``struct cudaArray *``, it is necessary to explicitly cast the ``CUarray`` to a ``struct cudaArray *``.
64096409

6410-
In order to use a struct ::cudaArray * in a CUDA Driver API function which takes a ::CUarray, it is necessary to explicitly cast the struct ::cudaArray * to a ::CUarray .
6410+
In order to use a ``struct cudaArray *`` in a CUDA Driver API function which takes a ``CUarray``, it is necessary to explicitly cast the ``struct cudaArray *`` to a ``CUarray``.
64116411

64126412

64136413

cuda_core/docs/source/conf.py

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,15 @@ def _github_examples_ref():
3838
GITHUB_EXAMPLES_REF = _github_examples_ref()
3939

4040

41+
def _html_baseurl():
42+
docs_domain = os.environ.get("CUDA_PYTHON_DOCS_DOMAIN", "https://nvidia.github.io/cuda-python")
43+
if int(os.environ.get("BUILD_PREVIEW", 0)):
44+
return f"{docs_domain}/pr-preview/pr-{os.environ['PR_NUMBER']}/cuda-core/latest/"
45+
if int(os.environ.get("BUILD_LATEST", 0)):
46+
return f"{docs_domain}/cuda-core/latest/"
47+
return f"{docs_domain}/cuda-core/{release}/"
48+
49+
4150
# -- General configuration ---------------------------------------------------
4251

4352
# Add any Sphinx extension module names here, as strings. They can be
@@ -46,6 +55,7 @@ def _github_examples_ref():
4655
extensions = [
4756
"sphinx.ext.autodoc",
4857
"sphinx.ext.autosummary",
58+
"sphinx.ext.extlinks",
4959
"sphinx.ext.napoleon",
5060
"sphinx.ext.intersphinx",
5161
"sphinx.ext.extlinks",
@@ -75,7 +85,7 @@ def _github_examples_ref():
7585

7686
# The theme to use for HTML and HTML Help pages. See the documentation for
7787
# a list of builtin themes.
78-
html_baseurl = "docs"
88+
html_baseurl = _html_baseurl()
7989
html_theme = "nvidia_sphinx_theme"
8090
html_theme_options = {
8191
"switcher": {

cuda_core/docs/source/examples.rst

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,48 +12,48 @@ workflow.
1212
Compilation and kernel launch
1313
-----------------------------
1414

15-
- :cuda-core-example:`vector_add.py`
15+
- :cuda-core-example:`vector_add.py <vector_add.py>`
1616
compiles and launches a simple vector-add kernel with CuPy arrays.
17-
- :cuda-core-example:`saxpy.py`
17+
- :cuda-core-example:`saxpy.py <saxpy.py>`
1818
JIT-compiles a templated SAXPY kernel and launches both float and double
1919
instantiations.
20-
- :cuda-core-example:`pytorch_example.py`
20+
- :cuda-core-example:`pytorch_example.py <pytorch_example.py>`
2121
launches a CUDA kernel with PyTorch tensors and a wrapped PyTorch stream.
2222

2323
Multi-device and advanced launch configuration
2424
----------------------------------------------
2525

26-
- :cuda-core-example:`simple_multi_gpu_example.py`
26+
- :cuda-core-example:`simple_multi_gpu_example.py <simple_multi_gpu_example.py>`
2727
compiles and launches kernels across multiple GPUs.
28-
- :cuda-core-example:`thread_block_cluster.py`
28+
- :cuda-core-example:`thread_block_cluster.py <thread_block_cluster.py>`
2929
demonstrates thread block cluster launch configuration on Hopper-class GPUs.
30-
- :cuda-core-example:`tma_tensor_map.py`
30+
- :cuda-core-example:`tma_tensor_map.py <tma_tensor_map.py>`
3131
demonstrates Tensor Memory Accelerator descriptors and TMA-based bulk copies.
3232

3333
Linking and graphs
3434
------------------
3535

36-
- :cuda-core-example:`jit_lto_fractal.py`
36+
- :cuda-core-example:`jit_lto_fractal.py <jit_lto_fractal.py>`
3737
uses JIT link-time optimization to link user-provided device code into a
3838
fractal workflow at runtime.
39-
- :cuda-core-example:`cuda_graphs.py`
39+
- :cuda-core-example:`cuda_graphs.py <cuda_graphs.py>`
4040
captures and replays a multi-kernel CUDA graph to reduce launch overhead.
4141

4242
Interoperability and memory access
4343
----------------------------------
4444

45-
- :cuda-core-example:`memory_ops.py`
45+
- :cuda-core-example:`memory_ops.py <memory_ops.py>`
4646
covers memory resources, pinned memory, device transfers, and DLPack interop.
47-
- :cuda-core-example:`strided_memory_view_cpu.py`
47+
- :cuda-core-example:`strided_memory_view_cpu.py <strided_memory_view_cpu.py>`
4848
uses ``StridedMemoryView`` with JIT-compiled CPU code via ``cffi``.
49-
- :cuda-core-example:`strided_memory_view_gpu.py`
49+
- :cuda-core-example:`strided_memory_view_gpu.py <strided_memory_view_gpu.py>`
5050
uses ``StridedMemoryView`` with JIT-compiled GPU code and foreign GPU buffers.
51-
- :cuda-core-example:`gl_interop_plasma.py`
51+
- :cuda-core-example:`gl_interop_plasma.py <gl_interop_plasma.py>`
5252
renders a CUDA-generated plasma effect through OpenGL interop without CPU
5353
copies.
5454

5555
System inspection
5656
-----------------
5757

58-
- :cuda-core-example:`show_device_properties.py`
58+
- :cuda-core-example:`show_device_properties.py <show_device_properties.py>`
5959
prints a detailed report of the CUDA devices available on the system.

cuda_core/docs/source/getting-started.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Example: Compiling and Launching a CUDA kernel
3232
----------------------------------------------
3333

3434
To get a taste for ``cuda.core``, let's walk through a simple example that compiles and launches a vector addition kernel.
35-
You can find the complete example in :cuda-core-example:`vector_add.py`
35+
You can find the complete example in :cuda-core-example:`vector_add.py <vector_add.py>`
3636
and browse the :doc:`examples page <examples>` for the rest of the shipped
3737
workflows.
3838

@@ -80,7 +80,7 @@ Note the use of the ``name_expressions`` parameter to the :meth:`Program.compile
8080
Next, we retrieve the compiled kernel from the CUBIN and prepare the arguments and kernel configuration.
8181
We're using `CuPy <https://cupy.dev/>`_ arrays as inputs for this example, but
8282
you can use PyTorch tensors too (see
83-
:cuda-core-example:`pytorch_example.py`
83+
:cuda-core-example:`pytorch_example.py <pytorch_example.py>`
8484
and the :doc:`examples page <examples>`).
8585

8686
.. code-block:: python

cuda_core/docs/source/interoperability.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,11 @@ a few iterations to ensure correctness.
7070
for extracting the metadata (such as pointer address, shape, strides, and
7171
dtype) from any Python objects supporting either CAI or DLPack and returning a
7272
:class:`~utils.StridedMemoryView` object. See the
73-
:cuda-core-example:`strided_memory_view_constructors.py`
73+
:cuda-core-example:`strided_memory_view_constructors.py <strided_memory_view_constructors.py>`
7474
example for the explicit constructors, or
75-
:cuda-core-example:`strided_memory_view_cpu.py`
75+
:cuda-core-example:`strided_memory_view_cpu.py <strided_memory_view_cpu.py>`
7676
and
77-
:cuda-core-example:`strided_memory_view_gpu.py`
77+
:cuda-core-example:`strided_memory_view_gpu.py <strided_memory_view_gpu.py>`
7878
for decorator-based workflows. This provides a *concrete implementation* to
7979
both protocols that is **array-library-agnostic**, so that all Python projects
8080
can just rely on this without either re-implementing (the consumer-side of)

cuda_core/docs/source/release/0.3.1-notes.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ None.
3131
New examples
3232
------------
3333

34-
- Add a `CUDA graph <https://github.com/NVIDIA/cuda-python/blob/|cuda_core_github_ref|/cuda_core/examples/cuda_graphs.py>`_ example.
35-
- Add a `memory resource <https://github.com/NVIDIA/cuda-python/blob/|cuda_core_github_ref|/cuda_core/examples/memory_ops.py>`_ example.
34+
- Add a :cuda-core-example:`CUDA graph <cuda_graphs.py>` example.
35+
- Add a :cuda-core-example:`memory resource <memory_ops.py>` example.
3636

3737

3838
Fixes and enhancements

0 commit comments

Comments
 (0)