Skip to content

Commit 856eef5

Browse files
authored
Merge branch 'main' into dependabot/github_actions/actions-monthly-67a8adbf42
2 parents 7046474 + 77f2757 commit 856eef5

52 files changed

Lines changed: 11911 additions & 806 deletions

Some content is hidden

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

ci/tools/tests/test_fetch_ctk_redistrib.py

Lines changed: 0 additions & 221 deletions
This file was deleted.

cuda_bindings/AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,6 @@ subpackage in the `cuda-python` monorepo.
4444
- run: `pytest tests/cython/`
4545
- **Examples**: example coverage is pytest-based under `examples/`.
4646
- **Benchmarks**: run with `pytest --benchmark-only benchmarks/` when needed.
47-
- **Orchestrated run**: from repo root, `scripts/run_tests.sh bindings`.
4847

4948
## Build and environment notes
5049

cuda_bindings/cuda/bindings/nvml.pyx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#
33
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
44
#
5-
# This code was automatically generated across versions from 12.9.1 to 13.3.0, generator version 0.3.1.dev1602+g3c8d84404. Do not modify it directly.
5+
# This code was automatically generated across versions from 12.9.1 to 13.3.0, generator version 0.3.1.dev1779+ga8cc71818.d20260626. Do not modify it directly.
66

77
cimport cython # NOQA
88

@@ -26815,13 +26815,13 @@ cpdef object unit_get_devices(intptr_t unit):
2681526815
"""
2681626816
cdef unsigned int[1] deviceCount = [0]
2681726817
with nogil:
26818-
__status__ = nvmlUnitGetDevices(<nvmlUnit_t *>unit, <unsigned int*>deviceCount, NULL)
26818+
__status__ = nvmlUnitGetDevices(<nvmlUnit_t>unit, <unsigned int*>deviceCount, NULL)
2681926819
check_status_size(__status__)
2682026820
if deviceCount[0] == 0:
2682126821
return view.array(shape=(1,), itemsize=sizeof(intptr_t), format="P", mode="c")[:0]
2682226822
cdef view.array deviceArray = view.array(shape=(deviceCount[0],), itemsize=sizeof(intptr_t), format="P", mode="c")
2682326823
with nogil:
26824-
__status__ = nvmlUnitGetDevices(<nvmlUnit_t *>unit, <unsigned int*>deviceCount, <nvmlDevice_t *>deviceArray.data)
26824+
__status__ = nvmlUnitGetDevices(<nvmlUnit_t>unit, <unsigned int*>deviceCount, <nvmlDevice_t *>deviceArray.data)
2682526825
check_status(__status__)
2682626826
return deviceArray
2682726827

cuda_bindings/pyproject.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@
33
[build-system]
44
requires = [
55
"setuptools>=80.0.0",
6-
"setuptools_scm[simple]>=8,<10.1",
7-
"vcs-versioning<2.0",
6+
"setuptools_scm[simple]>=8,!=10.1",
87
"cython>=3.2,<3.3",
98
"pyclibrary>=0.1.7",
109
"cuda-pathfinder>=1.5",
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
3+
4+
import pytest
5+
6+
from cuda.bindings import nvml
7+
8+
9+
@pytest.fixture
10+
def unit_handles(nvml_init):
11+
"""Yield all unit handles, or skip if no units are present."""
12+
count = nvml.unit_get_count()
13+
if count == 0:
14+
pytest.skip("No NVML units present on this system")
15+
return [nvml.unit_get_handle_by_index(i) for i in range(count)]
16+
17+
18+
@pytest.mark.agent_authored(model="claude-sonnet-4-6")
19+
def test_unit_get_devices_returns_array(unit_handles):
20+
"""Regression test: unit_get_devices must not crash due to double-pointer cast.
21+
22+
Previously nvmlUnitGetDevices was called with <nvmlUnit_t *>unit instead of
23+
<nvmlUnit_t>unit, causing undefined behaviour because nvmlUnit_t is itself an
24+
opaque pointer handle.
25+
"""
26+
for unit in unit_handles:
27+
devices = nvml.unit_get_devices(unit)
28+
# Result is a memoryview / cython array of intptr_t device handles.
29+
assert hasattr(devices, "__len__")
30+
# Each element must be a non-zero pointer (valid device handle).
31+
for dev in devices:
32+
assert dev != 0

cuda_core/AGENTS.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ This file describes `cuda_core`, the high-level Pythonic CUDA subpackage in the
4040
- run: `pytest tests/cython/`
4141
- **Examples**: validate affected examples in `examples/` when changing user
4242
workflows or public APIs.
43-
- **Orchestrated run**: from repo root, `scripts/run_tests.sh core`.
4443

4544
## Runtime/build environment notes
4645

cuda_core/README.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,6 @@ To run these tests:
2424
* `python -m pytest tests/` with editable installations
2525
* `pytest tests/` with installed packages
2626

27-
Alternatively, from the repository root you can use a simple script:
28-
29-
* `./scripts/run_tests.sh core` to run only `cuda_core` tests
30-
* `./scripts/run_tests.sh` to run all package tests (pathfinder → bindings → core)
31-
* `./scripts/run_tests.sh smoke` to run meta-level smoke tests under `tests/integration`
32-
3327
### Cython Unit Tests
3428

3529
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:

cuda_core/cuda/core/__init__.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,12 @@ class _PatchedProperty(metaclass=_PatchedPropMeta):
110110
from cuda.core._tensor_map import TensorMapDescriptor, TensorMapDescriptorOptions
111111

112112
# isort: split
113+
# Texture/surface types live under the cuda.core.texture namespace (not the
114+
# flat cuda.core namespace); import the subpackage so it is available as
115+
# `cuda.core.texture` after `import cuda.core`.
113116
# Must come after the cuda.core._* extension imports above: loading graph
114117
# earlier interacts badly with the merged-wheel __path__ rewrite and leaves
115118
# Graph/GraphBuilder/GraphCompleteOptions/GraphDebugPrintOptions missing from
116119
# cuda.core.graph.
117120
import cuda.core.graph
121+
import cuda.core.texture

0 commit comments

Comments
 (0)