Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
File renamed without changes.
11 changes: 0 additions & 11 deletions LICENSE.md

This file was deleted.

5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,8 @@ The list of available interfaces is:
* nvFatbin
* cuFile
* NVML

## License

CUDA Python is licensed under the [Apache License 2.0](./LICENSE). Third-party
attributions for `cuda.core` are listed in [`cuda_core/NOTICE`](./cuda_core/NOTICE).
2 changes: 1 addition & 1 deletion benchmarks/cuda_bindings/pixi.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions cuda_bindings/DESCRIPTION.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.. SPDX-FileCopyrightText: Copyright (c) 2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
.. SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
.. SPDX-License-Identifier: Apache-2.0

****************************************
cuda-bindings: Low-level CUDA interfaces
Expand Down
226 changes: 178 additions & 48 deletions cuda_bindings/LICENSE

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions cuda_bindings/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

recursive-include cuda/ *.pyx *.pxd *.pxi *.pyx.in *.pxd.in *.pxi.in *.h
# at least with setuptools 75.0.0 this folder was added erroneously
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/build_hooks.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This module implements basic PEP 517 backend support to defer CUDA-dependent
# logic (header parsing, code generation, cythonization) to build time. See:
Expand Down
4 changes: 2 additions & 2 deletions cuda_bindings/cuda/bindings/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

from cuda.bindings import utils
from cuda.bindings._version import __version__
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_bindings/cyruntime.pxd.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly.
include "../cyruntime_types.pxi"
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_bindings/cyruntime.pyx.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly.
include "../cyruntime_functions.pxi"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly.
cdef extern from "":
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This code was automatically generated with version 13.3.0, generator version 0.3.1.dev1630+gadce055ea.d20260422. Do not modify it directly.
cdef extern from "":
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_example_helpers/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

from .common import KernelHelper, check_compute_capability_too_low, requirement_not_met
from .helper_cuda import check_cuda_errors, find_cuda_device, find_cuda_device_drv
Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_example_helpers/common.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0


import os
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

from cuda.bindings import driver as cuda
from cuda.bindings import nvrtc
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

import sys

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/_fast_enum.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated across versions from 12.9.1 to 13.3.0, generator version 0.3.1.dev1719+g565f73f4e. Do not modify it directly.

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/cudla.pxd
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This code was automatically generated across versions from 1.5.0 to 13.3.0, generator version 0.3.1.dev1465+gc5c5c8652. Do not modify it directly.

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This code was automatically generated across versions from 1.5.0 to 13.3.0, generator version 0.3.1.dev1465+gc5c5c8652. Do not modify it directly.

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0

# This code was automatically generated across versions from 1.5.0 to 13.3.0, generator version 0.3.1.dev1465+gc5c5c8652. Do not modify it directly.

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/cufile.pxd
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly.

Expand Down
2 changes: 1 addition & 1 deletion cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly.

Expand Down
7 changes: 5 additions & 2 deletions cuda_bindings/cuda/bindings/_internal/driver.pxd
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated across versions from 12.9.0 to 13.3.0, generator version 0.3.1.dev1622+g48467ab08.d20260421. Do not modify it directly.
# This code was automatically generated across versions from 12.9.0 to 13.3.0, generator version 0.3.1.dev1853+g2b0a94a68. Do not modify it directly.

from ..cydriver cimport *

Expand Down Expand Up @@ -36,6 +36,8 @@ cdef CUresult _cuDevicePrimaryCtxRelease_v2(CUdevice dev) except ?CUDA_ERROR_NOT
cdef CUresult _cuDevicePrimaryCtxSetFlags_v2(CUdevice dev, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuDevicePrimaryCtxGetState(CUdevice dev, unsigned int* flags, int* active) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuCtxDestroy_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuCtxPushCurrent_v2(CUcontext ctx) except ?CUDA_ERROR_NOT_FOUND nogil
Expand Down Expand Up @@ -224,6 +226,7 @@ cdef CUresult _cuStreamBeginCaptureToGraph(CUstream hStream, CUgraph hGraph, con
cdef CUresult _cuThreadExchangeStreamCaptureMode(CUstreamCaptureMode* mode) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuStreamEndCapture(CUstream hStream, CUgraph* phGraph) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* captureStatus) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuStreamGetCaptureInfo_v2(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuStreamUpdateCaptureDependencies_v2(CUstream hStream, CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
cdef CUresult _cuStreamAttachMemAsync(CUstream hStream, CUdeviceptr dptr, size_t length, unsigned int flags) except ?CUDA_ERROR_NOT_FOUND nogil
Expand Down
55 changes: 53 additions & 2 deletions cuda_bindings/cuda/bindings/_internal/driver_linux.pyx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE
# SPDX-License-Identifier: Apache-2.0
#
# This code was automatically generated across versions from 12.9.0 to 13.3.0, generator version 0.3.1.dev1738+g1060a290f. Do not modify it directly.
# This code was automatically generated across versions from 12.9.0 to 13.3.0, generator version 0.3.1.dev1853+g2b0a94a68. Do not modify it directly.

from libc.stdint cimport intptr_t, uintptr_t

Expand Down Expand Up @@ -85,6 +85,8 @@ cdef void* __cuDevicePrimaryCtxRelease_v2 = NULL
cdef void* __cuDevicePrimaryCtxSetFlags_v2 = NULL
cdef void* __cuDevicePrimaryCtxGetState = NULL
cdef void* __cuDevicePrimaryCtxReset_v2 = NULL
cdef void* __cuCtxCreate_v2 = NULL
cdef void* __cuCtxCreate_v3 = NULL
cdef void* __cuCtxCreate_v4 = NULL
cdef void* __cuCtxDestroy_v2 = NULL
cdef void* __cuCtxPushCurrent_v2 = NULL
Expand Down Expand Up @@ -273,6 +275,7 @@ cdef void* __cuStreamBeginCaptureToGraph = NULL
cdef void* __cuThreadExchangeStreamCaptureMode = NULL
cdef void* __cuStreamEndCapture = NULL
cdef void* __cuStreamIsCapturing = NULL
cdef void* __cuStreamGetCaptureInfo_v2 = NULL
cdef void* __cuStreamGetCaptureInfo_v3 = NULL
cdef void* __cuStreamUpdateCaptureDependencies_v2 = NULL
cdef void* __cuStreamAttachMemAsync = NULL
Expand Down Expand Up @@ -689,6 +692,12 @@ cdef int _init_driver() except -1 nogil:
global __cuDevicePrimaryCtxReset_v2
_F_cuGetProcAddress_v2('cuDevicePrimaryCtxReset', <void **>&__cuDevicePrimaryCtxReset_v2, 11000, ptds_mode, NULL)

global __cuCtxCreate_v2
_F_cuGetProcAddress_v2('cuCtxCreate', <void **>&__cuCtxCreate_v2, 3020, ptds_mode, NULL)

global __cuCtxCreate_v3
_F_cuGetProcAddress_v2('cuCtxCreate', <void **>&__cuCtxCreate_v3, 11040, ptds_mode, NULL)

global __cuCtxCreate_v4
_F_cuGetProcAddress_v2('cuCtxCreate', <void **>&__cuCtxCreate_v4, 12050, ptds_mode, NULL)

Expand Down Expand Up @@ -1253,6 +1262,9 @@ cdef int _init_driver() except -1 nogil:
global __cuStreamIsCapturing
_F_cuGetProcAddress_v2('cuStreamIsCapturing', <void **>&__cuStreamIsCapturing, 10000, ptds_mode, NULL)

global __cuStreamGetCaptureInfo_v2
_F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', <void **>&__cuStreamGetCaptureInfo_v2, 11030, ptds_mode, NULL)

global __cuStreamGetCaptureInfo_v3
_F_cuGetProcAddress_v2('cuStreamGetCaptureInfo', <void **>&__cuStreamGetCaptureInfo_v3, 12030, ptds_mode, NULL)

Expand Down Expand Up @@ -2252,6 +2264,12 @@ cpdef dict _inspect_function_pointers():
global __cuDevicePrimaryCtxReset_v2
data["__cuDevicePrimaryCtxReset_v2"] = <intptr_t>__cuDevicePrimaryCtxReset_v2

global __cuCtxCreate_v2
data["__cuCtxCreate_v2"] = <intptr_t>__cuCtxCreate_v2

global __cuCtxCreate_v3
data["__cuCtxCreate_v3"] = <intptr_t>__cuCtxCreate_v3

global __cuCtxCreate_v4
data["__cuCtxCreate_v4"] = <intptr_t>__cuCtxCreate_v4

Expand Down Expand Up @@ -2816,6 +2834,9 @@ cpdef dict _inspect_function_pointers():
global __cuStreamIsCapturing
data["__cuStreamIsCapturing"] = <intptr_t>__cuStreamIsCapturing

global __cuStreamGetCaptureInfo_v2
data["__cuStreamGetCaptureInfo_v2"] = <intptr_t>__cuStreamGetCaptureInfo_v2

global __cuStreamGetCaptureInfo_v3
data["__cuStreamGetCaptureInfo_v3"] = <intptr_t>__cuStreamGetCaptureInfo_v3

Expand Down Expand Up @@ -3984,6 +4005,26 @@ cdef CUresult _cuDevicePrimaryCtxReset_v2(CUdevice dev) except ?CUDA_ERROR_NOT_F
dev)


cdef CUresult _cuCtxCreate_v2(CUcontext* pctx, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
global __cuCtxCreate_v2
_check_or_init_driver()
if __cuCtxCreate_v2 == NULL:
with gil:
raise FunctionNotFoundError("function cuCtxCreate_v2 is not found")
return (<CUresult (*)(CUcontext*, unsigned int, CUdevice) noexcept nogil>__cuCtxCreate_v2)(
pctx, flags, dev)


cdef CUresult _cuCtxCreate_v3(CUcontext* pctx, CUexecAffinityParam* paramsArray, int numParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
global __cuCtxCreate_v3
_check_or_init_driver()
if __cuCtxCreate_v3 == NULL:
with gil:
raise FunctionNotFoundError("function cuCtxCreate_v3 is not found")
return (<CUresult (*)(CUcontext*, CUexecAffinityParam*, int, unsigned int, CUdevice) noexcept nogil>__cuCtxCreate_v3)(
pctx, paramsArray, numParams, flags, dev)


cdef CUresult _cuCtxCreate_v4(CUcontext* pctx, CUctxCreateParams* ctxCreateParams, unsigned int flags, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil:
global __cuCtxCreate_v4
_check_or_init_driver()
Expand Down Expand Up @@ -5864,6 +5905,16 @@ cdef CUresult _cuStreamIsCapturing(CUstream hStream, CUstreamCaptureStatus* capt
hStream, captureStatus)


cdef CUresult _cuStreamGetCaptureInfo_v2(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil:
global __cuStreamGetCaptureInfo_v2
_check_or_init_driver()
if __cuStreamGetCaptureInfo_v2 == NULL:
with gil:
raise FunctionNotFoundError("function cuStreamGetCaptureInfo_v2 is not found")
return (<CUresult (*)(CUstream, CUstreamCaptureStatus*, cuuint64_t*, CUgraph*, const CUgraphNode**, size_t*) noexcept nogil>__cuStreamGetCaptureInfo_v2)(
hStream, captureStatus_out, id_out, graph_out, dependencies_out, numDependencies_out)


cdef CUresult _cuStreamGetCaptureInfo_v3(CUstream hStream, CUstreamCaptureStatus* captureStatus_out, cuuint64_t* id_out, CUgraph* graph_out, const CUgraphNode** dependencies_out, const CUgraphEdgeData** edgeData_out, size_t* numDependencies_out) except ?CUDA_ERROR_NOT_FOUND nogil:
global __cuStreamGetCaptureInfo_v3
_check_or_init_driver()
Expand Down
Loading
Loading