diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 96b4e501da..8d17deb8a6 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -25,7 +25,6 @@ jobs: fail-fast: false matrix: python-version: - - "3.9" - "3.10" - "3.11" - "3.12" diff --git a/ci/test-matrix.json b/ci/test-matrix.json index e30ac1878c..45ae4299a4 100644 --- a/ci/test-matrix.json +++ b/ci/test-matrix.json @@ -4,8 +4,6 @@ "_notes": "DRIVER: 'earliest' does not work with CUDA 12.9.1 and LOCAL_CTK: 0 does not work with CUDA 12.0.1", "linux": { "pull-request": [ - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, @@ -17,8 +15,6 @@ { "ARCH": "amd64", "PY_VER": "3.13t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.14", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.14t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "13.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "13.0.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.11", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, @@ -32,11 +28,6 @@ { "ARCH": "arm64", "PY_VER": "3.14t", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" } ], "nightly": [ - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "amd64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "earliest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, @@ -57,11 +48,6 @@ { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "l4", "DRIVER": "latest" }, { "ARCH": "amd64", "PY_VER": "3.13", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "l4", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "latest" }, - { "ARCH": "arm64", "PY_VER": "3.9", "CUDA_VER": "12.9.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "0", "GPU": "a100", "DRIVER": "earliest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "11.8.0", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, { "ARCH": "arm64", "PY_VER": "3.10", "CUDA_VER": "12.0.1", "LOCAL_CTK": "1", "GPU": "a100", "DRIVER": "latest" }, diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index 85d7c843a6..6a2821253a 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from ..cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 076df1c544..ccc412b0f8 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t @@ -16,6 +16,8 @@ from cuda.pathfinder import load_nvidia_dynamic_lib # Extern ############################################################################### +# You must 'from .utils import NotSupportedError' before using this template + cdef extern from "" nogil: void* dlopen(const char*, int) char* dlerror() @@ -30,6 +32,25 @@ cdef extern from "" nogil: const void* RTLD_DEFAULT 'RTLD_DEFAULT' +cdef int get_cuda_version(): + cdef void* handle = NULL + cdef int err, driver_ver = 0 + + # Load driver to check version + handle = dlopen('libcuda.so.1', RTLD_NOW | RTLD_GLOBAL) + if handle == NULL: + err_msg = dlerror() + raise NotSupportedError(f'CUDA driver is not found ({err_msg.decode()})') + cuDriverGetVersion = dlsym(handle, "cuDriverGetVersion") + if cuDriverGetVersion == NULL: + raise RuntimeError('Did not find cuDriverGetVersion symbol in libcuda.so.1') + err = (cuDriverGetVersion)(&driver_ver) + if err != 0: + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') + + return driver_ver + + ############################################################################### # Wrapper init @@ -37,7 +58,6 @@ cdef extern from "" nogil: cdef object __symbol_lock = threading.Lock() cdef bint __py_nvjitlink_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvJitLinkCreate = NULL cdef void* __nvJitLinkDestroy = NULL @@ -60,12 +80,16 @@ cdef void* load_library() except* with gil: return handle -cdef int __check_or_init_nvjitlink() except -1 nogil: +cdef int _init_nvjitlink() except -1 nogil: global __py_nvjitlink_init cdef void* handle = NULL with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_nvjitlink_init: + return 0 + # Load function global __nvJitLinkCreate __nvJitLinkCreate = dlsym(RTLD_DEFAULT, 'nvJitLinkCreate') @@ -173,7 +197,7 @@ cdef inline int _check_or_init_nvjitlink() except -1 nogil: if __py_nvjitlink_init: return 0 - return __check_or_init_nvjitlink() + return _init_nvjitlink() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 1ad0def5ab..1b88b99892 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from libc.stdint cimport intptr_t @@ -15,7 +15,7 @@ from libc.stddef cimport wchar_t from libc.stdint cimport uintptr_t from cpython cimport PyUnicode_AsWideCharString, PyMem_Free -from .utils import NotSupportedError +# You must 'from .utils import NotSupportedError' before using this template cdef extern from "windows.h" nogil: ctypedef void* HMODULE @@ -61,10 +61,10 @@ cdef int get_cuda_version(): raise NotSupportedError('CUDA driver is not found') cuDriverGetVersion = GetProcAddress(handle, 'cuDriverGetVersion') if cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') + raise RuntimeError('Did not find cuDriverGetVersion symbol in nvcuda.dll') err = (cuDriverGetVersion)(&driver_ver) if err != 0: - raise RuntimeError('something went wrong') + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') return driver_ver @@ -93,10 +93,14 @@ cdef void* __nvJitLinkGetInfoLog = NULL cdef void* __nvJitLinkVersion = NULL -cdef int __check_or_init_nvjitlink() except -1 nogil: +cdef int _init_nvjitlink() except -1 nogil: global __py_nvjitlink_init with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_nvjitlink_init: + return 0 + # Load library handle = load_nvidia_dynamic_lib("nvJitLink")._handle_uint @@ -151,7 +155,7 @@ cdef inline int _check_or_init_nvjitlink() except -1 nogil: if __py_nvjitlink_init: return 0 - return __check_or_init_nvjitlink() + return _init_nvjitlink() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd index 8ca17dbc4d..2cbe920218 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from ..cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 7e82d2a9aa..e1addcc9ee 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t @@ -16,6 +16,8 @@ from cuda.pathfinder import load_nvidia_dynamic_lib # Extern ############################################################################### +# You must 'from .utils import NotSupportedError' before using this template + cdef extern from "" nogil: void* dlopen(const char*, int) char* dlerror() @@ -49,13 +51,13 @@ cdef int get_cuda_version(): return driver_ver + ############################################################################### # Wrapper init ############################################################################### cdef object __symbol_lock = threading.Lock() cdef bint __py_nvvm_init = False -cdef void* __cuDriverGetVersion = NULL cdef void* __nvvmGetErrorString = NULL cdef void* __nvvmVersion = NULL @@ -77,12 +79,16 @@ cdef void* load_library() except* with gil: return handle -cdef int __check_or_init_nvvm() except -1 nogil: +cdef int _init_nvvm() except -1 nogil: global __py_nvvm_init cdef void* handle = NULL with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_nvvm_init: + return 0 + # Load function global __nvvmGetErrorString __nvvmGetErrorString = dlsym(RTLD_DEFAULT, 'nvvmGetErrorString') @@ -179,11 +185,11 @@ cdef int __check_or_init_nvvm() except -1 nogil: return 0 -cdef int _check_or_init_nvvm() except -1 nogil: +cdef inline int _check_or_init_nvvm() except -1 nogil: if __py_nvvm_init: return 0 - return __check_or_init_nvvm() + return _init_nvvm() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index a667642958..de3e789a41 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from libc.stdint cimport intptr_t @@ -15,7 +15,7 @@ from libc.stddef cimport wchar_t from libc.stdint cimport uintptr_t from cpython cimport PyUnicode_AsWideCharString, PyMem_Free -from .utils import NotSupportedError +# You must 'from .utils import NotSupportedError' before using this template cdef extern from "windows.h" nogil: ctypedef void* HMODULE @@ -61,10 +61,10 @@ cdef int get_cuda_version(): raise NotSupportedError('CUDA driver is not found') cuDriverGetVersion = GetProcAddress(handle, 'cuDriverGetVersion') if cuDriverGetVersion == NULL: - raise RuntimeError('something went wrong') + raise RuntimeError('Did not find cuDriverGetVersion symbol in nvcuda.dll') err = (cuDriverGetVersion)(&driver_ver) if err != 0: - raise RuntimeError('something went wrong') + raise RuntimeError(f'cuDriverGetVersion returned error code {err}') return driver_ver @@ -92,10 +92,14 @@ cdef void* __nvvmGetProgramLogSize = NULL cdef void* __nvvmGetProgramLog = NULL -cdef int __check_or_init_nvvm() except -1 nogil: +cdef int _init_nvvm() except -1 nogil: global __py_nvvm_init with gil, __symbol_lock: + # Recheck the flag after obtaining the locks + if __py_nvvm_init: + return 0 + # Load library handle = load_nvidia_dynamic_lib("nvvm")._handle_uint @@ -147,7 +151,7 @@ cdef inline int _check_or_init_nvvm() except -1 nogil: if __py_nvvm_init: return 0 - return __check_or_init_nvvm() + return _init_nvvm() cdef dict func_ptrs = None diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index 176149a6e3..1a3c21cc46 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -12,6 +12,7 @@ import numpy as _numpy from cpython cimport buffer as _buffer from cpython.memoryview cimport PyMemoryView_FromMemory from enum import IntEnum as _IntEnum +cimport cpython import cython @@ -1254,7 +1255,7 @@ cpdef str get_parameter_string(int param, int len): with nogil: status = cuFileGetParameterString(<_StringConfigParameter>param, desc_str, len) check_status(status) - return _desc_str_.decode() + return cpython.PyUnicode_FromString(desc_str) cpdef set_parameter_size_t(int param, size_t value): diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index c1ba67a517..17d5e83e61 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index cfaeff2dc4..516bbceead 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from ._internal cimport nvjitlink as _nvjitlink diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/cuda/bindings/cynvvm.pxd index 5453b09219..58c77f1e02 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pxd +++ b/cuda_bindings/cuda/bindings/cynvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. ############################################################################### diff --git a/cuda_bindings/cuda/bindings/cynvvm.pyx b/cuda_bindings/cuda/bindings/cynvvm.pyx index bb5b5b4c05..608c6d0a9e 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings/cuda/bindings/cynvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from ._internal cimport nvvm as _nvvm diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index 1279de9b48..067c3cf4c9 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index 6dd8770d7a..bf85453459 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. cimport cython # NOQA @@ -116,8 +116,8 @@ cpdef intptr_t create(uint32_t num_options, options) except -1: get_nested_resource_ptr[char](_options_, options, NULL) cdef Handle handle with nogil: - status = nvJitLinkCreate(&handle, num_options, (_options_.ptrs.data())) - check_status(status) + __status__ = nvJitLinkCreate(&handle, num_options, (_options_.ptrs.data())) + check_status(__status__) return handle @@ -139,8 +139,8 @@ cpdef add_data(intptr_t handle, int input_type, data, size_t size, name): cdef bytes _temp_name_ = (name).encode() cdef char* _name_ = _temp_name_ with nogil: - status = nvJitLinkAddData(handle, <_InputType>input_type, _data_, size, _name_) - check_status(status) + __status__ = nvJitLinkAddData(handle, <_InputType>input_type, _data_, size, _name_) + check_status(__status__) cpdef add_file(intptr_t handle, int input_type, file_name): @@ -158,8 +158,8 @@ cpdef add_file(intptr_t handle, int input_type, file_name): cdef bytes _temp_file_name_ = (file_name).encode() cdef char* _file_name_ = _temp_file_name_ with nogil: - status = nvJitLinkAddFile(handle, <_InputType>input_type, _file_name_) - check_status(status) + __status__ = nvJitLinkAddFile(handle, <_InputType>input_type, _file_name_) + check_status(__status__) cpdef complete(intptr_t handle): @@ -171,8 +171,8 @@ cpdef complete(intptr_t handle): .. seealso:: `nvJitLinkComplete` """ with nogil: - status = nvJitLinkComplete(handle) - check_status(status) + __status__ = nvJitLinkComplete(handle) + check_status(__status__) cpdef size_t get_linked_cubin_size(intptr_t handle) except? 0: @@ -188,8 +188,8 @@ cpdef size_t get_linked_cubin_size(intptr_t handle) except? 0: """ cdef size_t size with nogil: - status = nvJitLinkGetLinkedCubinSize(handle, &size) - check_status(status) + __status__ = nvJitLinkGetLinkedCubinSize(handle, &size) + check_status(__status__) return size @@ -204,8 +204,8 @@ cpdef get_linked_cubin(intptr_t handle, cubin): """ cdef void* _cubin_ = get_buffer_pointer(cubin, -1, readonly=False) with nogil: - status = nvJitLinkGetLinkedCubin(handle, _cubin_) - check_status(status) + __status__ = nvJitLinkGetLinkedCubin(handle, _cubin_) + check_status(__status__) cpdef size_t get_linked_ptx_size(intptr_t handle) except? 0: @@ -221,8 +221,8 @@ cpdef size_t get_linked_ptx_size(intptr_t handle) except? 0: """ cdef size_t size with nogil: - status = nvJitLinkGetLinkedPtxSize(handle, &size) - check_status(status) + __status__ = nvJitLinkGetLinkedPtxSize(handle, &size) + check_status(__status__) return size @@ -237,8 +237,8 @@ cpdef get_linked_ptx(intptr_t handle, ptx): """ cdef void* _ptx_ = get_buffer_pointer(ptx, -1, readonly=False) with nogil: - status = nvJitLinkGetLinkedPtx(handle, _ptx_) - check_status(status) + __status__ = nvJitLinkGetLinkedPtx(handle, _ptx_) + check_status(__status__) cpdef size_t get_error_log_size(intptr_t handle) except? 0: @@ -254,8 +254,8 @@ cpdef size_t get_error_log_size(intptr_t handle) except? 0: """ cdef size_t size with nogil: - status = nvJitLinkGetErrorLogSize(handle, &size) - check_status(status) + __status__ = nvJitLinkGetErrorLogSize(handle, &size) + check_status(__status__) return size @@ -270,8 +270,8 @@ cpdef get_error_log(intptr_t handle, log): """ cdef void* _log_ = get_buffer_pointer(log, -1, readonly=False) with nogil: - status = nvJitLinkGetErrorLog(handle, _log_) - check_status(status) + __status__ = nvJitLinkGetErrorLog(handle, _log_) + check_status(__status__) cpdef size_t get_info_log_size(intptr_t handle) except? 0: @@ -287,8 +287,8 @@ cpdef size_t get_info_log_size(intptr_t handle) except? 0: """ cdef size_t size with nogil: - status = nvJitLinkGetInfoLogSize(handle, &size) - check_status(status) + __status__ = nvJitLinkGetInfoLogSize(handle, &size) + check_status(__status__) return size @@ -303,8 +303,8 @@ cpdef get_info_log(intptr_t handle, log): """ cdef void* _log_ = get_buffer_pointer(log, -1, readonly=False) with nogil: - status = nvJitLinkGetInfoLog(handle, _log_) - check_status(status) + __status__ = nvJitLinkGetInfoLog(handle, _log_) + check_status(__status__) cpdef tuple version(): @@ -321,6 +321,6 @@ cpdef tuple version(): cdef unsigned int major cdef unsigned int minor with nogil: - status = nvJitLinkVersion(&major, &minor) - check_status(status) + __status__ = nvJitLinkVersion(&major, &minor) + check_status(__status__) return (major, minor) diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index 1b3bb6fdf6..ece8e75890 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. from libc.stdint cimport intptr_t diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index 5c03f2a698..72df74c3a6 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.0.1 to 12.9.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.0.2. Do not modify it directly. cimport cython # NOQA @@ -100,8 +100,8 @@ cpdef tuple version(): cdef int major cdef int minor with nogil: - status = nvvmVersion(&major, &minor) - check_status(status) + __status__ = nvvmVersion(&major, &minor) + check_status(__status__) return (major, minor) @@ -123,8 +123,8 @@ cpdef tuple ir_version(): cdef int major_dbg cdef int minor_dbg with nogil: - status = nvvmIRVersion(&major_ir, &minor_ir, &major_dbg, &minor_dbg) - check_status(status) + __status__ = nvvmIRVersion(&major_ir, &minor_ir, &major_dbg, &minor_dbg) + check_status(__status__) return (major_ir, minor_ir, major_dbg, minor_dbg) @@ -138,8 +138,8 @@ cpdef intptr_t create_program() except? 0: """ cdef Program prog with nogil: - status = nvvmCreateProgram(&prog) - check_status(status) + __status__ = nvvmCreateProgram(&prog) + check_status(__status__) return prog @@ -160,8 +160,8 @@ cpdef add_module_to_program(intptr_t prog, buffer, size_t size, name): cdef bytes _temp_name_ = (name).encode() cdef char* _name_ = _temp_name_ with nogil: - status = nvvmAddModuleToProgram(prog, _buffer_, size, _name_) - check_status(status) + __status__ = nvvmAddModuleToProgram(prog, _buffer_, size, _name_) + check_status(__status__) cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name): @@ -181,8 +181,8 @@ cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name): cdef bytes _temp_name_ = (name).encode() cdef char* _name_ = _temp_name_ with nogil: - status = nvvmLazyAddModuleToProgram(prog, _buffer_, size, _name_) - check_status(status) + __status__ = nvvmLazyAddModuleToProgram(prog, _buffer_, size, _name_) + check_status(__status__) cpdef compile_program(intptr_t prog, int num_options, options): @@ -204,8 +204,8 @@ cpdef compile_program(intptr_t prog, int num_options, options): cdef nested_resource[ char ] _options_ get_nested_resource_ptr[char](_options_, options, NULL) with nogil: - status = nvvmCompileProgram(prog, num_options, (_options_.ptrs.data())) - check_status(status) + __status__ = nvvmCompileProgram(prog, num_options, (_options_.ptrs.data())) + check_status(__status__) cpdef verify_program(intptr_t prog, int num_options, options): @@ -227,8 +227,8 @@ cpdef verify_program(intptr_t prog, int num_options, options): cdef nested_resource[ char ] _options_ get_nested_resource_ptr[char](_options_, options, NULL) with nogil: - status = nvvmVerifyProgram(prog, num_options, (_options_.ptrs.data())) - check_status(status) + __status__ = nvvmVerifyProgram(prog, num_options, (_options_.ptrs.data())) + check_status(__status__) cpdef size_t get_compiled_result_size(intptr_t prog) except? 0: @@ -244,8 +244,8 @@ cpdef size_t get_compiled_result_size(intptr_t prog) except? 0: """ cdef size_t buffer_size_ret with nogil: - status = nvvmGetCompiledResultSize(prog, &buffer_size_ret) - check_status(status) + __status__ = nvvmGetCompiledResultSize(prog, &buffer_size_ret) + check_status(__status__) return buffer_size_ret @@ -260,8 +260,8 @@ cpdef get_compiled_result(intptr_t prog, buffer): """ cdef void* _buffer_ = get_buffer_pointer(buffer, -1, readonly=False) with nogil: - status = nvvmGetCompiledResult(prog, _buffer_) - check_status(status) + __status__ = nvvmGetCompiledResult(prog, _buffer_) + check_status(__status__) cpdef size_t get_program_log_size(intptr_t prog) except? 0: @@ -277,8 +277,8 @@ cpdef size_t get_program_log_size(intptr_t prog) except? 0: """ cdef size_t buffer_size_ret with nogil: - status = nvvmGetProgramLogSize(prog, &buffer_size_ret) - check_status(status) + __status__ = nvvmGetProgramLogSize(prog, &buffer_size_ret) + check_status(__status__) return buffer_size_ret @@ -293,5 +293,5 @@ cpdef get_program_log(intptr_t prog, buffer): """ cdef void* _buffer_ = get_buffer_pointer(buffer, -1, readonly=False) with nogil: - status = nvvmGetProgramLog(prog, _buffer_) - check_status(status) + __status__ = nvvmGetProgramLog(prog, _buffer_) + check_status(__status__) diff --git a/cuda_bindings/tests/test_cufile.py b/cuda_bindings/tests/test_cufile.py index 32b07a802f..d2ec94af78 100644 --- a/cuda_bindings/tests/test_cufile.py +++ b/cuda_bindings/tests/test_cufile.py @@ -124,20 +124,6 @@ def isSupportedFilesystem(): pytestmark = pytest.mark.skipif(not cufileLibraryAvailable(), reason="cuFile library not available on this system") -def safe_decode_string(raw_value): - """Safely decode a string value from ctypes buffer.""" - # Find null terminator if present - null_pos = raw_value.find(b"\x00") - if null_pos != -1: - raw_value = raw_value[:null_pos] - # Decode with error handling - try: - return raw_value.decode("utf-8", errors="ignore") - except UnicodeDecodeError: - # If UTF-8 fails, try to decode as bytes - return str(raw_value) - - def test_cufile_success_defined(): """Check if CUFILE_SUCCESS is defined in OpError enum.""" assert hasattr(cufile.OpError, "SUCCESS") @@ -1829,9 +1815,7 @@ def test_set_get_parameter_string(): cufile.set_parameter_string( cufile.StringConfigParameter.LOGGING_LEVEL, int(ctypes.addressof(logging_level_buffer)) ) - retrieved_value_raw = cufile.get_parameter_string(cufile.StringConfigParameter.LOGGING_LEVEL, 256) - # Use safe_decode_string to handle null terminators and padding - retrieved_value = safe_decode_string(retrieved_value_raw.encode("utf-8")) + retrieved_value = cufile.get_parameter_string(cufile.StringConfigParameter.LOGGING_LEVEL, 256) logging.info(f"Logging level test: set {logging_level}, got {retrieved_value}") # The retrieved value should be a string, so we can compare directly assert retrieved_value == logging_level, ( @@ -1851,9 +1835,7 @@ def test_set_get_parameter_string(): cufile.set_parameter_string( cufile.StringConfigParameter.ENV_LOGFILE_PATH, int(ctypes.addressof(logfile_buffer)) ) - retrieved_value_raw = cufile.get_parameter_string(cufile.StringConfigParameter.ENV_LOGFILE_PATH, 256) - # Use safe_decode_string to handle null terminators and padding - retrieved_value = safe_decode_string(retrieved_value_raw.encode("utf-8")) + retrieved_value = cufile.get_parameter_string(cufile.StringConfigParameter.ENV_LOGFILE_PATH, 256) logging.info(f"Log file path test: set {logfile_path}, got {retrieved_value}") # The retrieved value should be a string, so we can compare directly assert retrieved_value == logfile_path, f"Log file path mismatch: set {logfile_path}, got {retrieved_value}" @@ -1869,9 +1851,7 @@ def test_set_get_parameter_string(): log_dir_bytes = log_dir.encode("utf-8") + b"\x00" log_dir_buffer = ctypes.create_string_buffer(log_dir_bytes) cufile.set_parameter_string(cufile.StringConfigParameter.LOG_DIR, int(ctypes.addressof(log_dir_buffer))) - retrieved_value_raw = cufile.get_parameter_string(cufile.StringConfigParameter.LOG_DIR, 256) - # Use safe_decode_string to handle null terminators and padding - retrieved_value = safe_decode_string(retrieved_value_raw.encode("utf-8")) + retrieved_value = cufile.get_parameter_string(cufile.StringConfigParameter.LOG_DIR, 256) logging.info(f"Log directory test: set {log_dir}, got {retrieved_value}") # The retrieved value should be a string, so we can compare directly assert retrieved_value == log_dir, f"Log directory mismatch: set {log_dir}, got {retrieved_value}" diff --git a/cuda_pathfinder/pyproject.toml b/cuda_pathfinder/pyproject.toml index ac6724277e..62c5ee5154 100644 --- a/cuda_pathfinder/pyproject.toml +++ b/cuda_pathfinder/pyproject.toml @@ -6,7 +6,7 @@ name = "cuda-pathfinder" description = "Pathfinder for CUDA components" authors = [{ name = "NVIDIA Corporation", email = "cuda-python-conduct@nvidia.com" }] license = "Apache-2.0" -requires-python = ">=3.9" +requires-python = ">=3.10" dynamic = ["version"] dependencies = [] @@ -97,7 +97,7 @@ inline-quotes = "double" [tool.mypy] # Basic settings -python_version = "3.9" +python_version = "3.10" explicit_package_bases = true warn_return_any = true warn_unused_configs = true diff --git a/cuda_python/pyproject.toml b/cuda_python/pyproject.toml index c60021e7e2..15d9b0f9a3 100644 --- a/cuda_python/pyproject.toml +++ b/cuda_python/pyproject.toml @@ -22,11 +22,11 @@ classifiers = [ "Intended Audience :: Science/Research", "Intended Audience :: End Users/Desktop", "Programming Language :: Python :: 3 :: Only", - "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Programming Language :: Python :: 3.13", + "Programming Language :: Python :: 3.14", "Programming Language :: Python :: Implementation :: CPython", "Environment :: GPU :: NVIDIA CUDA", "Environment :: GPU :: NVIDIA CUDA :: 12",