From da283d55bb079fc4ffa4a893b878263145d0ddd2 Mon Sep 17 00:00:00 2001 From: Michael Droettboom Date: Tue, 25 Aug 2026 10:25:14 -0400 Subject: [PATCH] Convert objects to int --- cuda_bindings/cuda/bindings/_v2/nvrtc.pyx | 34 +- cuda_bindings/cuda/bindings/cudla.pxd | 4 +- cuda_bindings/cuda/bindings/cudla.pyx | 7 +- cuda_bindings/cuda/bindings/cufile.pxd | 14 +- cuda_bindings/cuda/bindings/cufile.pyx | 104 +-- cuda_bindings/cuda/bindings/nvfatbin.pyx | 32 +- cuda_bindings/cuda/bindings/nvjitlink.pyx | 7 +- cuda_bindings/cuda/bindings/nvml.pxd | 28 +- cuda_bindings/cuda/bindings/nvml.pyx | 842 +++++++++++----------- cuda_bindings/cuda/bindings/nvvm.pyx | 27 +- 10 files changed, 543 insertions(+), 556 deletions(-) diff --git a/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx b/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx index ffa3973e950..ba84c6040d1 100644 --- a/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx +++ b/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a36c7e54cf29166832dd9aebc1fa71cc3649498794a2846e707396419caebe10 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e48732452ebf6c1dda859086b349512cf0f2ef367fc16c46e887817a122d2e02 # <<<< PREAMBLE CONTENT >>>> @@ -640,7 +640,6 @@ cpdef tuple version(): Returns: A 2-tuple containing: - - int: CUDA Runtime Compilation major version number. - int: CUDA Runtime Compilation minor version number. @@ -657,6 +656,7 @@ cpdef tuple version(): cpdef int get_num_supported_archs() except? -1: """nvrtcGetNumSupportedArchs sets the output parameter ``num_archs`` with the number of architectures supported by NVRTC. This can then be used to pass an array to ``nvrtcGetSupportedArchs`` to get the supported architectures. + see ``nvrtcGetSupportedArchs``. Returns: int: number of supported architectures. @@ -672,6 +672,7 @@ cpdef int get_num_supported_archs() except? -1: cpdef object get_supported_archs(): """nvrtcGetSupportedArchs populates the array passed via the output parameter ``supported_archs`` with the architectures supported by NVRTC. The array is sorted in the ascending order. The size of the array to be passed can be determined using ``nvrtcGetNumSupportedArchs``. + see ``nvrtcGetNumSupportedArchs``. Returns: int: sorted array of supported architectures. @@ -881,6 +882,8 @@ cpdef bytes get_optix_ir(intptr_t prog): cpdef size_t get_program_log_size(intptr_t prog) except? 0: """nvrtcGetProgramLogSize sets ``log_size_ret`` with the size of the log generated by the previous compilation of ``prog`` (including the trailing ``NULL``). + Note that compilation log may be generated with warnings and informative + messages, even when the compilation of ``prog`` succeeds. Args: prog (intptr_t): CUDA Runtime Compilation program. @@ -925,11 +928,12 @@ cpdef bytes get_program_log(intptr_t prog): cpdef add_name_expression(intptr_t prog, name_expression): """nvrtcAddNameExpression notes the given name expression denoting the address of a global function or device/__constant__ variable. + The identical name expression string must be provided on a subsequent call to + nvrtcGetLoweredName to extract the lowered name. Args: prog (intptr_t): CUDA Runtime Compilation program. - name_expression (str): constant expression denoting the - address of a global function or device/__constant__ - variable. + name_expression (str): constant expression denoting the address of + a global function or device/__constant__ variable. .. seealso:: `nvrtcAddNameExpression` """ @@ -946,8 +950,8 @@ cpdef size_t get_pch_heap_size() except? 0: """retrieve the current size of the PCH Heap. Returns: - size_t: pointer to location where the size of the PCH Heap - will be stored. + size_t: pointer to location where the size of the PCH Heap will be + stored. .. seealso:: `nvrtcGetPCHHeapSize` """ @@ -961,6 +965,9 @@ cpdef size_t get_pch_heap_size() except? 0: cpdef set_pch_heap_size(size_t size): """set the size of the PCH Heap. + The requested size may be rounded up to a platform dependent alignment (e.g. + page size). If the PCH Heap has already been allocated, the heap memory will be + freed and a new PCH Heap will be allocated. Args: size (size_t): requested size of the PCH Heap, in bytes. @@ -974,6 +981,19 @@ cpdef set_pch_heap_size(size_t size): cpdef int get_pch_create_status(intptr_t prog) except? -1: """returns the PCH creation status. + NVRTC_SUCCESS indicates that the PCH was successfully created. + NVRTC_ERROR_NO_PCH_CREATE_ATTEMPTED indicates that no PCH creation was + attempted, either because PCH functionality was not requested during the + preceding nvrtcCompileProgram call, or automatic PCH processing was requested, + and compiler chose not to create a PCH file. + NVRTC_ERROR_PCH_CREATE_HEAP_EXHAUSTED indicates that a PCH file could + potentially have been created, but the compiler ran out space in the PCH heap. + In this scenario, the :func:`get_pch_heap_size_required` can be used to query + the required heap size, the heap can be reallocated for this size with + :func:`set_pch_heap_size` and PCH creation may be reattempted again invoking + :func:`compile_program` with a new NVRTC program instance. + NVRTC_ERROR_PCH_CREATE indicates that an error condition prevented the PCH file + from being created. Args: prog (intptr_t): CUDA Runtime Compilation program. diff --git a/cuda_bindings/cuda/bindings/cudla.pxd b/cuda_bindings/cuda/bindings/cudla.pxd index bb11235cbb6..e33867b912f 100644 --- a/cuda_bindings/cuda/bindings/cudla.pxd +++ b/cuda_bindings/cuda/bindings/cudla.pxd @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b82680ec867e23638b173760105c35030e0cba5c9a8b3bb536ce5bb3381ec1fb +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3b52467aafbb78d33c99d8be6d3acdd552c8aa0851758d01932080aebaec5213 # <<<< PREAMBLE CONTENT >>>> @@ -55,7 +55,7 @@ cpdef intptr_t create_device(uint64_t device, uint32_t flags) except * cpdef intptr_t mem_register(intptr_t dev_handle, intptr_t ptr, size_t size, uint32_t flags) except * cpdef intptr_t module_load_from_memory(intptr_t dev_handle, p_module, size_t module_size, uint32_t flags) except * cpdef module_unload(intptr_t h_module, uint32_t flags) -cpdef submit_task(intptr_t dev_handle, intptr_t ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags) +cpdef submit_task(intptr_t dev_handle, ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags) cpdef object device_get_attribute(intptr_t dev_handle, int attrib) cpdef mem_unregister(intptr_t dev_handle, intptr_t dev_ptr) cpdef int get_last_error(intptr_t dev_handle) except? 0 diff --git a/cuda_bindings/cuda/bindings/cudla.pyx b/cuda_bindings/cuda/bindings/cudla.pyx index 75b1f05f2ca..f4cc4da1a4e 100644 --- a/cuda_bindings/cuda/bindings/cudla.pyx +++ b/cuda_bindings/cuda/bindings/cudla.pyx @@ -2,7 +2,7 @@ # SPDX-License-Identifier: Apache-2.0 # This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3c177b7a0328c0f6f16067c8c9f4e5a002bd019e8c17c017ba9f77af21da8d75 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6448344915220edf6a2a1f4aee3377cee10c3c0a05db19c5ce37c6595bb52a5c # <<<< PREAMBLE CONTENT >>>> @@ -1804,9 +1804,10 @@ cpdef module_unload(intptr_t h_module, uint32_t flags): check_status(__status__) -cpdef submit_task(intptr_t dev_handle, intptr_t ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags): +cpdef submit_task(intptr_t dev_handle, ptr_to_tasks, uint32_t num_tasks, intptr_t stream, uint32_t flags): + cdef intptr_t _ptr_to_tasks_ptr_ = int(ptr_to_tasks) with nogil: - __status__ = cudlaSubmitTask(dev_handle, ptr_to_tasks, num_tasks, stream, flags) + __status__ = cudlaSubmitTask(dev_handle, _ptr_to_tasks_ptr_, num_tasks, stream, flags) check_status(__status__) diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/cuda/bindings/cufile.pxd index 74633880658..2d212e02ca0 100644 --- a/cuda_bindings/cuda/bindings/cufile.pxd +++ b/cuda_bindings/cuda/bindings/cufile.pxd @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b10e4f1751ee5423db23c6fc953cb0ae37bff7e8937bf1d39ac5fd6eeb0e4e87 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=232c1336341a3bd41bdcac568f24b320c839206e07a249bb4425ab726c1838be @@ -53,7 +53,7 @@ ctypedef CUfileP2PFlags_t _P2PFlags # Functions ############################################################################### -cpdef intptr_t handle_register(intptr_t descr) except? 0 +cpdef intptr_t handle_register(descr) except? 0 cpdef void handle_deregister(intptr_t fh) except* cpdef buf_register(intptr_t buf_ptr_base, size_t length, int flags) cpdef buf_deregister(intptr_t buf_ptr_base) @@ -65,8 +65,8 @@ cpdef driver_set_max_direct_io_size(size_t max_direct_io_size) cpdef driver_set_max_cache_size(size_t max_cache_size) cpdef driver_set_max_pinned_mem_size(size_t max_pinned_size) cpdef intptr_t batch_io_set_up(unsigned nr) except? 0 -cpdef batch_io_submit(intptr_t batch_idp, unsigned nr, intptr_t iocbp, unsigned int flags) -cpdef batch_io_get_status(intptr_t batch_idp, unsigned min_nr, intptr_t nr, intptr_t iocbp, intptr_t timeout) +cpdef batch_io_submit(intptr_t batch_idp, unsigned nr, iocbp, unsigned int flags) +cpdef batch_io_get_status(intptr_t batch_idp, unsigned min_nr, intptr_t nr, iocbp, intptr_t timeout) cpdef batch_io_cancel(intptr_t batch_idp) cpdef void batch_io_destroy(intptr_t batch_idp) except* cpdef read_async(intptr_t fh, intptr_t buf_ptr_base, intptr_t size_p, intptr_t file_offset_p, intptr_t buf_ptr_offset_p, intptr_t bytes_read_p, intptr_t stream) @@ -86,9 +86,9 @@ cpdef int get_stats_level() except? 0 cpdef stats_start() cpdef stats_stop() cpdef stats_reset() -cpdef get_stats_l1(intptr_t stats) -cpdef get_stats_l2(intptr_t stats) -cpdef get_stats_l3(intptr_t stats) +cpdef get_stats_l1(stats) +cpdef get_stats_l2(stats) +cpdef get_stats_l3(stats) cpdef size_t get_bar_size_in_kb(int gpu_index) except? 0 cpdef set_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len) cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_values, int len) diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index e8127feb6c3..69f86270d96 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=df46a6921d93f83249134c7705b2809f57145b6fb72f6f40c4657ecd1b443b81 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3f53b4aef109461d93dd698a71700a3429c3e7e7889aaaeb6e3d63cb8f57645e # <<<< PREAMBLE CONTENT >>>> @@ -445,9 +445,10 @@ cdef class IOEvents: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -784,9 +785,10 @@ cdef class PerGpuStats: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -1248,9 +1250,10 @@ cdef class Descr: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -2293,9 +2296,10 @@ cdef class IOParams: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -3009,22 +3013,21 @@ cdef int check_status(ReturnT status) except 1 nogil: # Wrapper functions ############################################################################### -cpdef intptr_t handle_register(intptr_t descr) except? 0: +cpdef intptr_t handle_register(descr) except? 0: """cuFileHandleRegister is required, and performs extra checking that is memoized to provide increased performance on later cuFile operations. Args: - descr (intptr_t): ``CUfileDescr_t`` file descriptor (OS - agnostic). + descr (intptr_t): ``CUfileDescr_t`` file descriptor (OS agnostic). Returns: - intptr_t: ``CUfileHandle_t`` opaque file handle for IO - operations. + intptr_t: ``CUfileHandle_t`` opaque file handle for IO operations. .. seealso:: `cuFileHandleRegister` """ + cdef intptr_t _descr_ptr_ = int(descr) cdef Handle fh with nogil: - __status__ = cuFileHandleRegister(&fh, descr) + __status__ = cuFileHandleRegister(&fh, _descr_ptr_) check_status(__status__) return fh @@ -3046,8 +3049,8 @@ cpdef buf_register(intptr_t buf_ptr_base, size_t length, int flags): Args: buf_ptr_base (intptr_t): buffer pointer allocated. - length (size_t): size of memory region from the above - specified bufPtr. + length (size_t): size of memory region from the above specified + bufPtr. flags (int): CU_FILE_RDMA_REGISTER. .. seealso:: `cuFileBufRegister` @@ -3107,10 +3110,9 @@ cpdef driver_set_poll_mode(bint poll, size_t poll_threshold_size): """Sets whether the Read/Write APIs use polling to do IO operations This takes place before the driver is opened. No-op if driver is already open. Args: - poll (bint): boolean to indicate whether to use poll mode or - not. - poll_threshold_size (size_t): max IO size to use for POLLING - mode in KB. + poll (bint): boolean to indicate whether to use poll mode or not. + poll_threshold_size (size_t): max IO size to use for POLLING mode + in KB. .. seealso:: `cuFileDriverSetPollMode` """ @@ -3123,8 +3125,7 @@ cpdef driver_set_max_direct_io_size(size_t max_direct_io_size): """Control parameter to set max IO size(KB) used by the library to talk to nvidia-fs driver This takes place before the driver is opened. No-op if driver is already open. Args: - max_direct_io_size (size_t): maximum allowed direct io size in - KB. + max_direct_io_size (size_t): maximum allowed direct io size in KB. .. seealso:: `cuFileDriverSetMaxDirectIOSize` """ @@ -3137,8 +3138,8 @@ cpdef driver_set_max_cache_size(size_t max_cache_size): """Control parameter to set maximum GPU memory reserved per device by the library for internal buffering This takes place before the driver is opened. No-op if driver is already open. Args: - max_cache_size (size_t): The maximum GPU buffer space per - device used for internal use in KB. + max_cache_size (size_t): The maximum GPU buffer space per device + used for internal use in KB. .. seealso:: `cuFileDriverSetMaxCacheSize` """ @@ -3151,8 +3152,8 @@ cpdef driver_set_max_pinned_mem_size(size_t max_pinned_size): """Sets maximum buffer space that is pinned in KB for use by ``cuFileBufRegister`` This takes place before the driver is opened. No-op if driver is already open. Args: - max_pinned_size (size_t): maximum buffer space that is pinned - in KB. + max_pinned_size (size_t): maximum buffer space that is pinned in + KB. .. seealso:: `cuFileDriverSetMaxPinnedMemSize` """ @@ -3169,15 +3170,17 @@ cpdef intptr_t batch_io_set_up(unsigned nr) except? 0: return batch_idp -cpdef batch_io_submit(intptr_t batch_idp, unsigned nr, intptr_t iocbp, unsigned int flags): +cpdef batch_io_submit(intptr_t batch_idp, unsigned nr, iocbp, unsigned int flags): + cdef intptr_t _iocbp_ptr_ = int(iocbp) with nogil: - __status__ = cuFileBatchIOSubmit(batch_idp, nr, iocbp, flags) + __status__ = cuFileBatchIOSubmit(batch_idp, nr, _iocbp_ptr_, flags) check_status(__status__) -cpdef batch_io_get_status(intptr_t batch_idp, unsigned min_nr, intptr_t nr, intptr_t iocbp, intptr_t timeout): +cpdef batch_io_get_status(intptr_t batch_idp, unsigned min_nr, intptr_t nr, iocbp, intptr_t timeout): + cdef intptr_t _iocbp_ptr_ = int(iocbp) with nogil: - __status__ = cuFileBatchIOGetStatus(batch_idp, min_nr, nr, iocbp, timeout) + __status__ = cuFileBatchIOGetStatus(batch_idp, min_nr, nr, _iocbp_ptr_, timeout) check_status(__status__) @@ -3283,7 +3286,6 @@ cpdef tuple get_parameter_min_max_value(int param): Returns: A 2-tuple containing: - - size_t: Pointer to store the minimum value. - size_t: Pointer to store the maximum value. @@ -3356,45 +3358,48 @@ cpdef stats_reset(): check_status(__status__) -cpdef get_stats_l1(intptr_t stats): +cpdef get_stats_l1(stats): """Get Level 1 cuFile statistics. Args: - stats (intptr_t): Pointer to ``CUfileStatsLevel1_t`` structure - to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel1_t`` structure to + be filled. .. seealso:: `cuFileGetStatsL1` """ + cdef intptr_t _stats_ptr_ = int(stats) with nogil: - __status__ = cuFileGetStatsL1(stats) + __status__ = cuFileGetStatsL1(_stats_ptr_) check_status(__status__) -cpdef get_stats_l2(intptr_t stats): +cpdef get_stats_l2(stats): """Get Level 2 cuFile statistics. Args: - stats (intptr_t): Pointer to ``CUfileStatsLevel2_t`` structure - to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel2_t`` structure to + be filled. .. seealso:: `cuFileGetStatsL2` """ + cdef intptr_t _stats_ptr_ = int(stats) with nogil: - __status__ = cuFileGetStatsL2(stats) + __status__ = cuFileGetStatsL2(_stats_ptr_) check_status(__status__) -cpdef get_stats_l3(intptr_t stats): +cpdef get_stats_l3(stats): """Get Level 3 cuFile statistics. Args: - stats (intptr_t): Pointer to ``CUfileStatsLevel3_t`` structure - to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel3_t`` structure to + be filled. .. seealso:: `cuFileGetStatsL3` """ + cdef intptr_t _stats_ptr_ = int(stats) with nogil: - __status__ = cuFileGetStatsL3(stats) + __status__ = cuFileGetStatsL3(_stats_ptr_) check_status(__status__) @@ -3427,8 +3432,7 @@ cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_v Args: size_values (intptr_t): Buffer to receive slab sizes in KB. count_values (intptr_t): Buffer to receive slab counts. - len (int): Buffer size (must match the actual parameter - length). + len (int): Buffer size (must match the actual parameter length). .. seealso:: `cuFileGetParameterPosixPoolSlabArray` """ diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pyx b/cuda_bindings/cuda/bindings/nvfatbin.pyx index 0e485dd80dc..95c2fd6708c 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/nvfatbin.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=464151e9be344b663eb001d24b780328f477470afca263a03384394a057b74bd +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0d7db39224d376ca4c7d93b2716af3f1cec1e519d8155f50e9317f11724619d1 # <<<< PREAMBLE CONTENT >>>> @@ -149,14 +149,13 @@ cpdef intptr_t create(options, size_t options_count) except -1: """nvFatbinCreate creates a new handle. Args: - options (object): An array of strings, each containing a - single option. It can be: + options (object): An array of strings, each containing a single + option. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address to a valid sequence of 'char', or - a nested Python sequence of ``str``. - options_count (size_t): Number of options. Returns: @@ -180,8 +179,8 @@ cpdef add_ptx(intptr_t handle, code, size_t size, arch, identifier, options_cmd_ handle (intptr_t): nvFatbin handle. code (bytes): The PTX code. size (size_t): The size of the PTX code. - arch (str): The numerical architecture that this PTX is for - (the XX of any sm_XX, lto_XX, or compute_XX). + arch (str): The numerical architecture that this PTX is for (the + XX of any sm_XX, lto_XX, or compute_XX). identifier (str): Name of the PTX, useful when extracting the fatbin with tools like cuobjdump. options_cmd_line (str): Options used during JIT compilation. @@ -213,10 +212,10 @@ cpdef add_cubin(intptr_t handle, code, size_t size, arch, identifier): handle (intptr_t): nvFatbin handle. code (bytes): The cubin. size (size_t): The size of the cubin. - arch (str): The numerical architecture that this cubin is for - (the XX of any sm_XX, lto_XX, or compute_XX). - identifier (str): Name of the cubin, useful when extracting - the fatbin with tools like cuobjdump. + arch (str): The numerical architecture that this cubin is for (the + XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the cubin, useful when extracting the + fatbin with tools like cuobjdump. .. seealso:: `nvFatbinAddCubin` """ @@ -241,10 +240,10 @@ cpdef add_ltoir(intptr_t handle, code, size_t size, arch, identifier, options_cm handle (intptr_t): nvFatbin handle. code (bytes): The LTOIR code. size (size_t): The size of the LTOIR code. - arch (str): The numerical architecture that this LTOIR is for - (the XX of any sm_XX, lto_XX, or compute_XX). - identifier (str): Name of the LTOIR, useful when extracting - the fatbin with tools like cuobjdump. + arch (str): The numerical architecture that this LTOIR is for (the + XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the LTOIR, useful when extracting the + fatbin with tools like cuobjdump. options_cmd_line (str): Options used during JIT compilation. .. seealso:: `nvFatbinAddLTOIR` @@ -305,7 +304,6 @@ cpdef tuple version(): Returns: A 2-tuple containing: - - unsigned int: The major version. - unsigned int: The minor version. @@ -353,8 +351,8 @@ cpdef add_tile_ir(intptr_t handle, code, size_t size, identifier, options_cmd_li handle (intptr_t): nvFatbin handle. code (bytes): The Tile IR. size (size_t): The size of the Tile IR. - identifier (str): Name of the Tile IR, useful when extracting - the fatbin with tools like cuobjdump. + identifier (str): Name of the Tile IR, useful when extracting the + fatbin with tools like cuobjdump. options_cmd_line (str): Options used during JIT compilation. .. seealso:: `nvFatbinAddTileIR` diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index 89076249cf9..0f0c33b4a7f 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4f142d6dd069dd459052ff17e4e585b764e7a8b4298051df3c6c0d39e1c67ded +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fa774b6dac9d07a3603aade2da0c4ce2a51718017f77aa984c9cb6b73034ca83 # <<<< PREAMBLE CONTENT >>>> @@ -152,15 +152,13 @@ cpdef intptr_t create(uint32_t num_options, options) except -1: Args: num_options (uint32_t): Number of options passed. - options (object): Array of size ``num_options`` of option - strings. It can be: + options (object): Array of size ``num_options`` of option strings. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address to a valid sequence of 'char', or - a nested Python sequence of ``str``. - Returns: intptr_t: Address of nvJitLink handle. @@ -366,7 +364,6 @@ cpdef tuple version(): Returns: A 2-tuple containing: - - unsigned int: The major version. - unsigned int: The minor version. diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/cuda/bindings/nvml.pxd index ce3c1db4852..23dfac89a4c 100644 --- a/cuda_bindings/cuda/bindings/nvml.pxd +++ b/cuda_bindings/cuda/bindings/nvml.pxd @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b6fe9a4efd0077f8c09ef4f826880ad0a54100455d4465953c4127d3de8c4d91 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=51a2b8a51378dcd6cd3a2b71f3cde510bf92aabb41a5f6ee9441833f7aea3cf3 @@ -236,7 +236,7 @@ cpdef int device_get_mem_clk_vf_offset(intptr_t device) except? 0 cpdef tuple device_get_min_max_clock_of_p_state(intptr_t device, int type, int pstate) cpdef tuple device_get_gpc_clk_min_max_vf_offset(intptr_t device) cpdef tuple device_get_mem_clk_min_max_vf_offset(intptr_t device) -cpdef device_set_clock_offsets(intptr_t device, intptr_t info) +cpdef device_set_clock_offsets(intptr_t device, info) cpdef unsigned int device_get_power_management_limit(intptr_t device) except? 0 cpdef tuple device_get_power_management_limit_constraints(intptr_t device) cpdef unsigned int device_get_power_management_default_limit(intptr_t device) except? 0 @@ -333,16 +333,16 @@ cpdef system_set_nvlink_bw_mode(unsigned int nvlink_bw_mode) cpdef unsigned int system_get_nvlink_bw_mode() except? 0 cpdef object device_get_nvlink_supported_bw_modes(intptr_t device) cpdef object device_get_nvlink_bw_mode(intptr_t device) -cpdef device_set_nvlink_bw_mode(intptr_t device, intptr_t set_bw_mode) +cpdef device_set_nvlink_bw_mode(intptr_t device, set_bw_mode) cpdef intptr_t event_set_create() except? 0 cpdef device_register_events(intptr_t device, unsigned long long event_types, intptr_t set) cpdef unsigned long long device_get_supported_event_types(intptr_t device) except? 0 cpdef object event_set_wait_v2(intptr_t set, unsigned int timeoutms) cpdef event_set_free(intptr_t set) -cpdef device_modify_drain_state(intptr_t pci_info, int new_state) -cpdef int device_query_drain_state(intptr_t pci_info) except? -1 -cpdef device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state) -cpdef device_discover_gpus(intptr_t pci_info) +cpdef device_modify_drain_state(pci_info, int new_state) +cpdef int device_query_drain_state(pci_info) except? -1 +cpdef device_remove_gpu_v2(pci_info, int gpu_state, int link_state) +cpdef device_discover_gpus(pci_info) cpdef int device_get_virtualization_mode(intptr_t device) except? -1 cpdef int device_get_host_vgpu_mode(intptr_t device) except? -1 cpdef device_set_virtualization_mode(intptr_t device, int virtual_mode) @@ -380,7 +380,7 @@ cpdef unsigned int vgpu_instance_get_gpu_instance_id(unsigned int vgpu_instance) cpdef str vgpu_instance_get_gpu_pci_id(unsigned int vgpu_instance) cpdef unsigned int vgpu_type_get_capabilities(unsigned int vgpu_type_id, int capability) except? 0 cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance) -cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_scheduler) +cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, p_scheduler) cpdef object gpu_instance_get_vgpu_scheduler_state(intptr_t gpu_instance) cpdef object gpu_instance_get_vgpu_scheduler_log(intptr_t gpu_instance) cpdef str device_get_pgpu_metadata_string(intptr_t device) @@ -388,7 +388,7 @@ cpdef object device_get_vgpu_scheduler_log(intptr_t device) cpdef object device_get_vgpu_scheduler_state(intptr_t device) cpdef object device_get_vgpu_scheduler_capabilities(intptr_t device) cpdef device_set_vgpu_scheduler_state(intptr_t device, intptr_t p_scheduler_state) -cpdef set_vgpu_version(intptr_t vgpu_version) +cpdef set_vgpu_version(vgpu_version) cpdef tuple device_get_vgpu_process_utilization(intptr_t device, unsigned long long last_seen_time_stamp) cpdef int vgpu_instance_get_accounting_mode(unsigned int vgpu_instance) except? -1 cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance) @@ -402,7 +402,7 @@ cpdef tuple device_get_mig_mode(intptr_t device) cpdef object device_get_gpu_instance_possible_placements_v2(intptr_t device, unsigned int profile_id) cpdef unsigned int device_get_gpu_instance_remaining_capacity(intptr_t device, unsigned int profile_id) except? 0 cpdef intptr_t device_create_gpu_instance(intptr_t device, unsigned int profile_id) except? 0 -cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsigned int profile_id, intptr_t placement) except? 0 +cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsigned int profile_id, placement) except? 0 cpdef gpu_instance_destroy(intptr_t gpu_instance) cpdef intptr_t device_get_gpu_instance_by_id(intptr_t device, unsigned int id) except? 0 cpdef object gpu_instance_get_info(intptr_t gpu_instance) @@ -410,7 +410,7 @@ cpdef object gpu_instance_get_compute_instance_profile_info_v(intptr_t gpu_insta cpdef unsigned int gpu_instance_get_compute_instance_remaining_capacity(intptr_t gpu_instance, unsigned int profile_id) except? 0 cpdef object gpu_instance_get_compute_instance_possible_placements(intptr_t gpu_instance, unsigned int profile_id) cpdef intptr_t gpu_instance_create_compute_instance(intptr_t gpu_instance, unsigned int profile_id) except? 0 -cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_instance, unsigned int profile_id, intptr_t placement) except? 0 +cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_instance, unsigned int profile_id, placement) except? 0 cpdef compute_instance_destroy(intptr_t compute_instance) cpdef intptr_t gpu_instance_get_compute_instance_by_id(intptr_t gpu_instance, unsigned int id) except? 0 cpdef object compute_instance_get_info_v2(intptr_t compute_instance) @@ -426,14 +426,14 @@ cpdef device_power_smoothing_set_state(intptr_t device, intptr_t state) cpdef object device_get_addressing_mode(intptr_t device) cpdef object device_get_repair_status(intptr_t device) cpdef object device_get_power_mizer_mode_v1(intptr_t device) -cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode) +cpdef device_set_power_mizer_mode_v1(intptr_t device, power_mizer_mode) cpdef device_vgpu_force_gsp_unload(intptr_t device) cpdef object device_get_vgpu_scheduler_state_v2(intptr_t device) cpdef object gpu_instance_get_vgpu_scheduler_state_v2(intptr_t gpu_instance) cpdef object device_get_vgpu_scheduler_log_v2(intptr_t device) cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance) -cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_state) -cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p_scheduler_state) +cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, p_scheduler_state) +cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, p_scheduler_state) cpdef object system_get_cper_v1() cpdef object device_get_bbx_time_data_v1(intptr_t device) cpdef object device_get_accounting_stats_v2(intptr_t device) diff --git a/cuda_bindings/cuda/bindings/nvml.pyx b/cuda_bindings/cuda/bindings/nvml.pyx index c5a45d8c6c5..6ea90472067 100644 --- a/cuda_bindings/cuda/bindings/nvml.pyx +++ b/cuda_bindings/cuda/bindings/nvml.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e6b2e2f1456e0ba7ef3201063d4e670ba71db9334bb671005b63224aeecded0a +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cfae25ff5c213261cfb20dfa5163547f3f625d576f6ef8b4b08a2cc9bd6cbe7f # <<<< PREAMBLE CONTENT >>>> @@ -3287,9 +3287,10 @@ cdef class ProcessInfo: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -3469,9 +3470,10 @@ cdef class ProcessDetail_v1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -4196,9 +4198,10 @@ cdef class BridgeChipInfo: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -4559,9 +4562,10 @@ cdef class _py_anon_pod0: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -4916,9 +4920,10 @@ cdef class ClkMonFaultInfo: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -5268,9 +5273,10 @@ cdef class ProcessUtilizationSample: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -5475,9 +5481,10 @@ cdef class ProcessUtilizationInfo_v1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -6429,9 +6436,10 @@ cdef class _py_anon_pod1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -6938,9 +6946,10 @@ cdef class VgpuProcessUtilizationInfo_v1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -7459,9 +7468,10 @@ cdef class VgpuSchedulerLogEntry: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -9050,9 +9060,10 @@ cdef class HwbcEntry: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -9706,9 +9717,10 @@ cdef class UnitFanInfo: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -10042,9 +10054,10 @@ cdef class SystemEventData_v1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -10397,9 +10410,10 @@ cdef class EncoderSessionInfo: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -10785,9 +10799,10 @@ cdef class FBCSessionInfo: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -13224,9 +13239,10 @@ cdef class GpuInstancePlacement: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -13660,9 +13676,10 @@ cdef class ComputeInstancePlacement: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -14797,9 +14814,10 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -15363,9 +15381,10 @@ cdef class NvlinkFirmwareVersion: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -15845,9 +15864,10 @@ cdef class VgpuSchedulerLogEntry_v2: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -17408,9 +17428,10 @@ cdef class Sample: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -17567,9 +17588,10 @@ cdef class VgpuInstanceUtilizationSample: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -17766,9 +17788,10 @@ cdef class VgpuInstanceUtilizationInfo_v1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -17982,9 +18005,10 @@ cdef class FieldValue: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -19617,9 +19641,10 @@ cdef class GridLicensableFeature: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -21387,9 +21412,10 @@ cdef class PRMCounter_v1: return self._data.ctypes.data def __int__(self): - if self._data.size > 1: - raise TypeError("int() argument must be a bytes-like object of size 1. " - "To get the pointer address of an array, use .ptr") + if self._data.size > 1 and not self._data.flags["C_CONTIGUOUS"]: + raise TypeError("int() argument must be a bytes-like object of size 1, or a " + "C-contiguous array. To get the pointer address of a " + "non-contiguous array, use .ptr") return self._data.ctypes.data def __len__(self): @@ -22921,8 +22947,7 @@ cpdef unsigned int unit_get_count() except? 0: """Retrieves the number of units in the system. Returns: - unsigned int: Reference in which to return the number of - units. + unsigned int: Reference in which to return the number of units. .. seealso:: `nvmlUnitGetCount` """ @@ -22959,8 +22984,7 @@ cpdef object unit_get_unit_info(intptr_t unit): unit (intptr_t): The identifier of the target unit. Returns: - nvmlUnitInfo_t: Reference in which to return the unit - information. + nvmlUnitInfo_t: Reference in which to return the unit information. .. seealso:: `nvmlUnitGetUnitInfo` """ @@ -22999,8 +23023,7 @@ cpdef object unit_get_psu_info(intptr_t unit): unit (intptr_t): The identifier of the target unit. Returns: - nvmlPSUInfo_t: Reference in which to return the PSU - information. + nvmlPSUInfo_t: Reference in which to return the PSU information. .. seealso:: `nvmlUnitGetPsuInfo` """ @@ -23020,8 +23043,7 @@ cpdef unsigned int unit_get_temperature(intptr_t unit, unsigned int type) except type (unsigned int): The type of reading to take. Returns: - unsigned int: Reference in which to return the intake - temperature. + unsigned int: Reference in which to return the intake temperature. .. seealso:: `nvmlUnitGetTemperature` """ @@ -23039,8 +23061,8 @@ cpdef object unit_get_fan_speed_info(intptr_t unit): unit (intptr_t): The identifier of the target unit. Returns: - nvmlUnitFanSpeeds_t: Reference in which to return the fan - speed information. + nvmlUnitFanSpeeds_t: Reference in which to return the fan speed + information. .. seealso:: `nvmlUnitGetFanSpeedInfo` """ @@ -23135,8 +23157,8 @@ cpdef intptr_t device_get_handle_by_uuid(uuid) except? 0: uuid (str): The UUID of the target GPU or MIG instance. Returns: - intptr_t: Reference in which to return the device handle or - MIG device handle. + intptr_t: Reference in which to return the device handle or MIG + device handle. .. seealso:: `nvmlDeviceGetHandleByUUID` """ @@ -23157,9 +23179,8 @@ cpdef intptr_t device_get_handle_by_pci_bus_id_v2(pci_bus_id) except? 0: Args: pci_bus_id (str): The PCI bus id of the target GPU Accept the following formats (all numbers in hexadecimal): - domain:bus:device.function in format x:x:x.x - domain:bus:device in format x:x:x bus:device.function in - format x:x.x. + domain:bus:device.function in format x:x:x.x domain:bus:device + in format x:x:x bus:device.function in format x:x.x. Returns: intptr_t: Reference in which to return the device handle. @@ -23221,8 +23242,8 @@ cpdef unsigned int device_get_index(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the NVML index of - the device. + unsigned int: Reference in which to return the NVML index of the + device. .. seealso:: `nvmlDeviceGetIndex` """ @@ -23240,8 +23261,7 @@ cpdef str device_get_serial(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - char: Reference in which to return the board/module serial - number. + char: Reference in which to return the board/module serial number. .. seealso:: `nvmlDeviceGetSerial` """ @@ -23278,8 +23298,8 @@ cpdef object device_get_c2c_mode_info_v(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlC2cModeInfo_v1_t: Output struct containing the device's - C2C Mode info. + nvmlC2cModeInfo_v1_t: Output struct containing the device's C2C + Mode info. .. seealso:: `nvmlDeviceGetC2cModeInfoV` """ @@ -23296,14 +23316,14 @@ cpdef object device_get_memory_affinity(intptr_t device, unsigned int node_set_s Args: device (intptr_t): The identifier of the target device. - node_set_size (unsigned int): The size of the node_set array - that is safe to access. + node_set_size (unsigned int): The size of the node_set array that + is safe to access. scope (unsigned int): Scope that change the default behavior. Returns: unsigned long: Array reference in which to return a bitmask of - NODEs, 64 NODEs per unsigned long on 64-bit machines, 32 - on 32-bit machines. + NODEs, 64 NODEs per unsigned long on 64-bit machines, 32 on + 32-bit machines. .. seealso:: `nvmlDeviceGetMemoryAffinity` """ @@ -23322,8 +23342,8 @@ cpdef object device_get_cpu_affinity_within_scope(intptr_t device, unsigned int Args: device (intptr_t): The identifier of the target device. - cpu_set_size (unsigned int): The size of the cpu_set array - that is safe to access. + cpu_set_size (unsigned int): The size of the cpu_set array that is + safe to access. scope (unsigned int): Scope that change the default behavior. Returns: @@ -23348,8 +23368,8 @@ cpdef object device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size) Args: device (intptr_t): The identifier of the target device. - cpu_set_size (unsigned int): The size of the cpu_set array - that is safe to access. + cpu_set_size (unsigned int): The size of the cpu_set array that is + safe to access. Returns: unsigned long: Array reference in which to return a bitmask of @@ -23437,12 +23457,12 @@ cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_inde Args: device1 (intptr_t): The first device. device2 (intptr_t): The second device. - p2p_index (GpuP2PCapsIndex): p2p Capability Index being looked - for between ``device1`` and ``device2``. + p2p_index (GpuP2PCapsIndex): p2p Capability Index being looked for + between ``device1`` and ``device2``. Returns: - int: Reference in which to return the status of the - ``p2p_index`` between ``device1`` and ``device2``. + int: Reference in which to return the status of the ``p2p_index`` + between ``device1`` and ``device2``. .. seealso:: `nvmlDeviceGetP2PStatus` """ @@ -23479,8 +23499,8 @@ cpdef unsigned int device_get_minor_number(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the minor number - for the device. + unsigned int: Reference in which to return the minor number for + the device. .. seealso:: `nvmlDeviceGetMinorNumber` """ @@ -23589,7 +23609,6 @@ cpdef tuple device_get_last_bbx_flush_time(intptr_t device): Returns: A 2-tuple containing: - - unsigned long long: The start timestamp of the last BBX Flush. - unsigned long: The duration (us) of the last BBX Flush. @@ -23646,8 +23665,8 @@ cpdef int device_get_persistence_mode(intptr_t device) except? -1: device (intptr_t): The identifier of the target device. Returns: - int: Reference in which to return the current driver - persistence mode. + int: Reference in which to return the current driver persistence + mode. .. seealso:: `nvmlDeviceGetPersistenceMode` """ @@ -23665,8 +23684,7 @@ cpdef object device_get_pci_info_ext(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlPciInfoExt_v1_t: Reference in which to return the PCI - info. + nvmlPciInfoExt_v1_t: Reference in which to return the PCI info. .. seealso:: `nvmlDeviceGetPciInfoExt` """ @@ -23762,8 +23780,8 @@ cpdef unsigned int device_get_curr_pcie_link_generation(intptr_t device) except? device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the current PCIe - link generation. + unsigned int: Reference in which to return the current PCIe link + generation. .. seealso:: `nvmlDeviceGetCurrPcieLinkGeneration` """ @@ -23781,8 +23799,8 @@ cpdef unsigned int device_get_curr_pcie_link_width(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the current PCIe - link generation. + unsigned int: Reference in which to return the current PCIe link + generation. .. seealso:: `nvmlDeviceGetCurrPcieLinkWidth` """ @@ -23820,8 +23838,7 @@ cpdef unsigned int device_get_pcie_replay_counter(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the counter's - value. + unsigned int: Reference in which to return the counter's value. .. seealso:: `nvmlDeviceGetPcieReplayCounter` """ @@ -23840,8 +23857,7 @@ cpdef unsigned int device_get_clock_info(intptr_t device, int type) except? 0: type (ClockType): Identify which clock domain to query. Returns: - unsigned int: Reference in which to return the clock speed in - MHz. + unsigned int: Reference in which to return the clock speed in MHz. .. seealso:: `nvmlDeviceGetClockInfo` """ @@ -23860,8 +23876,7 @@ cpdef unsigned int device_get_max_clock_info(intptr_t device, int type) except? type (ClockType): Identify which clock domain to query. Returns: - unsigned int: Reference in which to return the clock speed in - MHz. + unsigned int: Reference in which to return the clock speed in MHz. .. seealso:: `nvmlDeviceGetMaxClockInfo` """ @@ -23896,8 +23911,7 @@ cpdef unsigned int device_get_clock(intptr_t device, int clock_type, int clock_i Args: device (intptr_t): The identifier of the target device. clock_type (ClockType): Identify which clock domain to query. - clock_id (ClockId): Identify which clock in the domain to - query. + clock_id (ClockId): Identify which clock in the domain to query. Returns: unsigned int: Reference in which to return the clock in MHz. @@ -23960,8 +23974,8 @@ cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int Args: device (intptr_t): The identifier of the target device. - memory_clock_m_hz (unsigned int): Memory clock for which to - return possible graphics clocks. + memory_clock_m_hz (unsigned int): Memory clock for which to return + possible graphics clocks. Returns: unsigned int: Reference in which to return the clocks in MHz. @@ -23990,12 +24004,11 @@ cpdef tuple device_get_auto_boosted_clocks_enabled(intptr_t device): Returns: A 2-tuple containing: - - - int: Where to store the current state of Auto Boosted clocks - of the target device. - - int: Where to store the default Auto Boosted clocks behavior - of the target device that the device will revert to when - no applications are using the GPU. + - int: Where to store the current state of Auto Boosted clocks of + the target device. + - int: Where to store the default Auto Boosted clocks behavior of + the target device that the device will revert to when no + applications are using the GPU. .. seealso:: `nvmlDeviceGetAutoBoostedClocksEnabled` """ @@ -24074,7 +24087,6 @@ cpdef tuple device_get_min_max_fan_speed(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: The minimum speed allowed to set. - unsigned int: The maximum speed allowed to set. @@ -24134,8 +24146,8 @@ cpdef object device_get_cooler_info(intptr_t device): Returns: nvmlCoolerInfo_v1_t: Structure specifying the cooler's control - signal characteristics (out) and the target that cooler - cools (out). + signal characteristics (out) and the target that cooler cools + (out). .. seealso:: `nvmlDeviceGetCoolerInfo` """ @@ -24177,8 +24189,8 @@ cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_in sensor_index (unsigned int): The index of the thermal sensor. Returns: - nvmlGpuThermalSettings_t: Reference in which to return the - thermal sensor information. + nvmlGpuThermalSettings_t: Reference in which to return the thermal + sensor information. .. seealso:: `nvmlDeviceGetThermalSettings` """ @@ -24197,8 +24209,7 @@ cpdef int device_get_performance_state(intptr_t device) except? -1: device (intptr_t): The identifier of the target device. Returns: - int: Reference in which to return the performance state - reading. + int: Reference in which to return the performance state reading. .. seealso:: `nvmlDeviceGetPerformanceState` """ @@ -24216,8 +24227,8 @@ cpdef unsigned long long device_get_current_clocks_event_reasons(intptr_t device device (intptr_t): The identifier of the target device. Returns: - unsigned long long: Reference in which to return bitmask of - active clocks event reasons. + unsigned long long: Reference in which to return bitmask of active + clocks event reasons. .. seealso:: `nvmlDeviceGetCurrentClocksEventReasons` """ @@ -24254,8 +24265,7 @@ cpdef int device_get_power_state(intptr_t device) except? -1: device (intptr_t): The identifier of the target device. Returns: - int: Reference in which to return the performance state - reading. + int: Reference in which to return the performance state reading. .. seealso:: `nvmlDeviceGetPowerState` """ @@ -24313,11 +24323,8 @@ cpdef tuple device_get_min_max_clock_of_p_state(intptr_t device, int type, int p Returns: A 2-tuple containing: - - - unsigned int: Reference in which to return min clock - frequency. - - unsigned int: Reference in which to return max clock - frequency. + - unsigned int: Reference in which to return min clock frequency. + - unsigned int: Reference in which to return max clock frequency. .. seealso:: `nvmlDeviceGetMinMaxClockOfPState` """ @@ -24337,7 +24344,6 @@ cpdef tuple device_get_gpc_clk_min_max_vf_offset(intptr_t device): Returns: A 2-tuple containing: - - int: The retrieved GPCCLK VF min offset value. - int: The retrieved GPCCLK VF max offset value. @@ -24359,7 +24365,6 @@ cpdef tuple device_get_mem_clk_min_max_vf_offset(intptr_t device): Returns: A 2-tuple containing: - - int: The retrieved MemClk VF min offset value. - int: The retrieved MemClk VF max offset value. @@ -24373,18 +24378,19 @@ cpdef tuple device_get_mem_clk_min_max_vf_offset(intptr_t device): return (min_offset, max_offset) -cpdef device_set_clock_offsets(intptr_t device, intptr_t info): +cpdef device_set_clock_offsets(intptr_t device, info): """Control current clock offset of some clock domain for a given PState. Args: device (intptr_t): The identifier of the target device. - info (intptr_t): Structure specifying the clock type (input), - the pstate (input) and clock offset value (input). + info (intptr_t): Structure specifying the clock type (input), the + pstate (input) and clock offset value (input). .. seealso:: `nvmlDeviceSetClockOffsets` """ + cdef intptr_t _info_ptr_ = int(info) with nogil: - __status__ = nvmlDeviceSetClockOffsets(device, info) + __status__ = nvmlDeviceSetClockOffsets(device, _info_ptr_) check_status(__status__) @@ -24395,8 +24401,8 @@ cpdef unsigned int device_get_power_management_limit(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the power - management limit in milliwatts. + unsigned int: Reference in which to return the power management + limit in milliwatts. .. seealso:: `nvmlDeviceGetPowerManagementLimit` """ @@ -24415,11 +24421,10 @@ cpdef tuple device_get_power_management_limit_constraints(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference in which to return the minimum power - management limit in milliwatts. + management limit in milliwatts. - unsigned int: Reference in which to return the maximum power - management limit in milliwatts. + management limit in milliwatts. .. seealso:: `nvmlDeviceGetPowerManagementLimitConstraints` """ @@ -24495,8 +24500,8 @@ cpdef unsigned int device_get_enforced_power_limit(intptr_t device) except? 0: device (intptr_t): The device to communicate with. Returns: - unsigned int: Reference in which to return the power - management limit in milliwatts. + unsigned int: Reference in which to return the power management + limit in milliwatts. .. seealso:: `nvmlDeviceGetEnforcedPowerLimit` """ @@ -24515,7 +24520,6 @@ cpdef tuple device_get_gpu_operation_mode(intptr_t device): Returns: A 2-tuple containing: - - int: Reference in which to return the current GOM. - int: Reference in which to return the pending GOM. @@ -24554,8 +24558,8 @@ cpdef int device_get_compute_mode(intptr_t device) except? -1: """Retrieves the current compute mode for the device or MIG device. Args: - device (intptr_t): The identifier of the target device handle - or MIG device handle. + device (intptr_t): The identifier of the target device handle or + MIG device handle. Returns: int: Reference in which to return the current compute mode. @@ -24577,11 +24581,10 @@ cpdef tuple device_get_cuda_compute_capability(intptr_t device): Returns: A 2-tuple containing: - - int: Reference in which to return the major CUDA compute - capability. + capability. - int: Reference in which to return the minor CUDA compute - capability. + capability. .. seealso:: `nvmlDeviceGetCudaComputeCapability` """ @@ -24601,7 +24604,6 @@ cpdef tuple device_get_ecc_mode(intptr_t device): Returns: A 2-tuple containing: - - int: Reference in which to return the current ECC mode. - int: Reference in which to return the pending ECC mode. @@ -24640,8 +24642,7 @@ cpdef unsigned int device_get_board_id(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the device's board - ID. + unsigned int: Reference in which to return the device's board ID. .. seealso:: `nvmlDeviceGetBoardId` """ @@ -24660,8 +24661,7 @@ cpdef unsigned int device_get_multi_gpu_board(intptr_t device) except? 0: Returns: unsigned int: Reference in which to return a zero or non-zero - value to indicate whether the device is on a multi GPU - board. + value to indicate whether the device is on a multi GPU board. .. seealso:: `nvmlDeviceGetMultiGpuBoard` """ @@ -24677,14 +24677,14 @@ cpdef unsigned long long device_get_total_ecc_errors(intptr_t device, int error_ Args: device (intptr_t): The identifier of the target device. - error_type (MemoryErrorType): Flag that specifies the type of - the errors. - counter_type (EccCounterType): Flag that specifies the - counter-type of the errors. + error_type (MemoryErrorType): Flag that specifies the type of the + errors. + counter_type (EccCounterType): Flag that specifies the counter- + type of the errors. Returns: - unsigned long long: Reference in which to return the specified - ECC errors. + unsigned long long: Reference in which to return the specified ECC + errors. .. seealso:: `nvmlDeviceGetTotalEccErrors` """ @@ -24702,14 +24702,13 @@ cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int er device (intptr_t): The identifier of the target device. error_type (MemoryErrorType): Flag that specifies the type of error. - counter_type (EccCounterType): Flag that specifies the - counter-type of the errors. + counter_type (EccCounterType): Flag that specifies the counter- + type of the errors. location_type (MemoryLocation): Specifies the location of the counter. Returns: - unsigned long long: Reference in which to return the ECC - counter. + unsigned long long: Reference in which to return the ECC counter. .. seealso:: `nvmlDeviceGetMemoryErrorCounter` """ @@ -24727,8 +24726,8 @@ cpdef object device_get_utilization_rates(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlUtilization_t: Reference in which to return the - utilization information. + nvmlUtilization_t: Reference in which to return the utilization + information. .. seealso:: `nvmlDeviceGetUtilizationRates` """ @@ -24748,11 +24747,10 @@ cpdef tuple device_get_encoder_utilization(intptr_t device): Returns: A 2-tuple containing: - - - unsigned int: Reference to an unsigned int for encoder - utilization info. - - unsigned int: Reference to an unsigned int for the sampling - period in US. + - unsigned int: Reference to an unsigned int for encoder utilization + info. + - unsigned int: Reference to an unsigned int for the sampling period + in US. .. seealso:: `nvmlDeviceGetEncoderUtilization` """ @@ -24792,13 +24790,12 @@ cpdef tuple device_get_encoder_stats(intptr_t device): Returns: A 3-tuple containing: - - unsigned int: Reference to an unsigned int for count of active - encoder sessions. - - unsigned int: Reference to an unsigned int for trailing - average FPS of all active sessions. - - unsigned int: Reference to an unsigned int for encode latency - in microseconds. + encoder sessions. + - unsigned int: Reference to an unsigned int for trailing average + FPS of all active sessions. + - unsigned int: Reference to an unsigned int for encode latency in + microseconds. .. seealso:: `nvmlDeviceGetEncoderStats` """ @@ -24818,8 +24815,8 @@ cpdef object device_get_encoder_sessions(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlEncoderSessionInfo_t: Reference in which to return the - session information. + nvmlEncoderSessionInfo_t: Reference in which to return the session + information. .. seealso:: `nvmlDeviceGetEncoderSessions` """ @@ -24845,11 +24842,10 @@ cpdef tuple device_get_decoder_utilization(intptr_t device): Returns: A 2-tuple containing: - - - unsigned int: Reference to an unsigned int for decoder - utilization info. - - unsigned int: Reference to an unsigned int for the sampling - period in US. + - unsigned int: Reference to an unsigned int for decoder utilization + info. + - unsigned int: Reference to an unsigned int for the sampling period + in US. .. seealso:: `nvmlDeviceGetDecoderUtilization` """ @@ -24869,11 +24865,10 @@ cpdef tuple device_get_jpg_utilization(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference to an unsigned int for jpg utilization - info. - - unsigned int: Reference to an unsigned int for the sampling - period in US. + info. + - unsigned int: Reference to an unsigned int for the sampling period + in US. .. seealso:: `nvmlDeviceGetJpgUtilization` """ @@ -24893,11 +24888,10 @@ cpdef tuple device_get_ofa_utilization(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference to an unsigned int for ofa utilization - info. - - unsigned int: Reference to an unsigned int for the sampling - period in US. + info. + - unsigned int: Reference to an unsigned int for the sampling period + in US. .. seealso:: `nvmlDeviceGetOfaUtilization` """ @@ -24963,7 +24957,6 @@ cpdef tuple device_get_driver_model_v2(intptr_t device): Returns: A 2-tuple containing: - - int: Reference in which to return the current driver model. - int: Reference in which to return the pending driver model. @@ -25003,8 +24996,8 @@ cpdef object device_get_bridge_chip_info(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlBridgeChipHierarchy_t: Reference to the returned bridge - chip Hierarchy. + nvmlBridgeChipHierarchy_t: Reference to the returned bridge chip + Hierarchy. .. seealso:: `nvmlDeviceGetBridgeChipInfo` """ @@ -25102,8 +25095,8 @@ cpdef int device_on_same_board(intptr_t device1, intptr_t device2) except? 0: device2 (intptr_t): The second GPU device. Returns: - int: Reference in which to return the status. Non-zero - indicates that the GPUs are on the same board. + int: Reference in which to return the status. Non-zero indicates + that the GPUs are on the same board. .. seealso:: `nvmlDeviceOnSameBoard` """ @@ -25124,8 +25117,8 @@ cpdef int device_get_api_restriction(intptr_t device, int api_type) except? -1: Returns: int: Reference in which to return the current restriction NVML_FEATURE_ENABLED indicates that the API is root-only - NVML_FEATURE_DISABLED indicates that the API is accessible - to all users. + NVML_FEATURE_DISABLED indicates that the API is accessible to + all users. .. seealso:: `nvmlDeviceGetAPIRestriction` """ @@ -25143,8 +25136,8 @@ cpdef object device_get_bar1_memory_info(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlBAR1Memory_t: Reference in which BAR1 memory information - is returned. + nvmlBAR1Memory_t: Reference in which BAR1 memory information is + returned. .. seealso:: `nvmlDeviceGetBAR1MemoryInfo` """ @@ -25163,8 +25156,8 @@ cpdef unsigned int device_get_irq_num(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: The interrupt number associated with the - specified device. + unsigned int: The interrupt number associated with the specified + device. .. seealso:: `nvmlDeviceGetIrqNum` """ @@ -25342,8 +25335,7 @@ cpdef object device_get_conf_compute_mem_size_info(intptr_t device): device (intptr_t): Device handle. Returns: - nvmlConfComputeMemSizeInfo_t: Protected/Unprotected Memory - sizes. + nvmlConfComputeMemSizeInfo_t: Protected/Unprotected Memory sizes. .. seealso:: `nvmlDeviceGetConfComputeMemSizeInfo` """ @@ -25379,8 +25371,7 @@ cpdef object device_get_conf_compute_protected_memory_usage(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlMemory_t: Reference in which to return the memory - information. + nvmlMemory_t: Reference in which to return the memory information. .. seealso:: `nvmlDeviceGetConfComputeProtectedMemoryUsage` """ @@ -25399,8 +25390,8 @@ cpdef object device_get_conf_compute_gpu_certificate(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlConfComputeGpuCertificate_t: Reference in which to return - the gpu certificate information. + nvmlConfComputeGpuCertificate_t: Reference in which to return the + gpu certificate information. .. seealso:: `nvmlDeviceGetConfComputeGpuCertificate` """ @@ -25417,8 +25408,8 @@ cpdef device_set_conf_compute_unprotected_mem_size(intptr_t device, unsigned lon Args: device (intptr_t): Device Handle. - size_ki_b (unsigned long long): Unprotected Memory size to be - set in KiB. + size_ki_b (unsigned long long): Unprotected Memory size to be set + in KiB. .. seealso:: `nvmlDeviceSetConfComputeUnprotectedMemSize` """ @@ -25485,10 +25476,9 @@ cpdef tuple device_get_gsp_firmware_mode(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Pointer to specify if GSP firmware is enabled. - - unsigned int: Pointer to specify if GSP firmware is supported - by default on ``device``. + - unsigned int: Pointer to specify if GSP firmware is supported by + default on ``device``. .. seealso:: `nvmlDeviceGetGspFirmwareMode` """ @@ -25547,8 +25537,8 @@ cpdef object device_get_accounting_stats(intptr_t device, unsigned int pid): stats for. Returns: - nvmlAccountingStats_t: Reference in which to return the - process's accounting stats. + nvmlAccountingStats_t: Reference in which to return the process's + accounting stats. .. seealso:: `nvmlDeviceGetAccountingStats` """ @@ -25567,8 +25557,7 @@ cpdef object device_get_accounting_pids(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return list of process - ids. + unsigned int: Reference in which to return list of process ids. .. seealso:: `nvmlDeviceGetAccountingPids` """ @@ -25593,9 +25582,8 @@ cpdef unsigned int device_get_accounting_buffer_size(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to provide the size (in - number of elements) of the circular buffer for accounting - stats. + unsigned int: Reference in which to provide the size (in number of + elements) of the circular buffer for accounting stats. .. seealso:: `nvmlDeviceGetAccountingBufferSize` """ @@ -25659,15 +25647,13 @@ cpdef tuple device_get_remapped_rows(intptr_t device): Returns: A 4-tuple containing: - - unsigned int: Reference for number of rows remapped due to - correctable errors. + correctable errors. - unsigned int: Reference for number of rows remapped due to - uncorrectable errors. - - unsigned int: Reference for whether or not remappings are - pending. - - unsigned int: Reference that is set when a remapping has - failed in the past. + uncorrectable errors. + - unsigned int: Reference for whether or not remappings are pending. + - unsigned int: Reference that is set when a remapping has failed in + the past. .. seealso:: `nvmlDeviceGetRemappedRows` """ @@ -25707,8 +25693,8 @@ cpdef unsigned int device_get_architecture(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference where architecture is returned, if - call successful. Set to NVML_DEVICE_ARCH_* upon success. + unsigned int: Reference where architecture is returned, if call + successful. Set to NVML_DEVICE_ARCH_* upon success. .. seealso:: `nvmlDeviceGetArchitecture` """ @@ -25726,8 +25712,8 @@ cpdef object device_get_clk_mon_status(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlClkMonStatus_t: Reference in which to return the clkmon - fault status. + nvmlClkMonStatus_t: Reference in which to return the clkmon fault + status. .. seealso:: `nvmlDeviceGetClkMonStatus` """ @@ -25748,9 +25734,8 @@ cpdef object device_get_process_utilization(intptr_t device, unsigned long long with timestamp greater than last_seen_time_stamp. Returns: - nvmlProcessUtilizationSample_t: Pointer to caller-supplied - buffer in which guest process utilization samples are - returned. + nvmlProcessUtilizationSample_t: Pointer to caller-supplied buffer + in which guest process utilization samples are returned. .. seealso:: `nvmlDeviceGetProcessUtilization` """ @@ -25800,8 +25785,8 @@ cpdef device_set_compute_mode(intptr_t device, int mode): """Set the compute mode for the device or MIG device. Args: - device (intptr_t): The identifier of the target device handle - or MIG device handle. + device (intptr_t): The identifier of the target device handle or + MIG device handle. mode (ComputeMode): The target compute mode. .. seealso:: `nvmlDeviceSetComputeMode` @@ -25830,8 +25815,8 @@ cpdef device_clear_ecc_error_counts(intptr_t device, int counter_type): Args: device (intptr_t): The identifier of the target device. - counter_type (EccCounterType): Flag that indicates which type - of errors should be cleared. + counter_type (EccCounterType): Flag that indicates which type of + errors should be cleared. .. seealso:: `nvmlDeviceClearEccErrorCounts` """ @@ -25860,10 +25845,10 @@ cpdef device_set_gpu_locked_clocks(intptr_t device, unsigned int min_gpu_clock_m Args: device (intptr_t): The identifier of the target device. - min_gpu_clock_m_hz (unsigned int): Requested minimum gpu clock - in MHz. - max_gpu_clock_m_hz (unsigned int): Requested maximum gpu clock - in MHz. + min_gpu_clock_m_hz (unsigned int): Requested minimum gpu clock in + MHz. + max_gpu_clock_m_hz (unsigned int): Requested maximum gpu clock in + MHz. .. seealso:: `nvmlDeviceSetGpuLockedClocks` """ @@ -25890,10 +25875,10 @@ cpdef device_set_memory_locked_clocks(intptr_t device, unsigned int min_mem_cloc Args: device (intptr_t): The identifier of the target device. - min_mem_clock_m_hz (unsigned int): Requested minimum memory - clock in MHz. - max_mem_clock_m_hz (unsigned int): Requested maximum memory - clock in MHz. + min_mem_clock_m_hz (unsigned int): Requested minimum memory clock + in MHz. + max_mem_clock_m_hz (unsigned int): Requested maximum memory clock + in MHz. .. seealso:: `nvmlDeviceSetMemoryLockedClocks` """ @@ -26011,8 +25996,8 @@ cpdef device_set_fan_speed_v2(intptr_t device, unsigned int fan, unsigned int sp Args: device (intptr_t): The identifier of the target device. fan (unsigned int): The index of the fan, starting at zero. - speed (unsigned int): The target speed of the fan [0-100] in % - of max speed. + speed (unsigned int): The target speed of the fan [0-100] in % of + max speed. .. seealso:: `nvmlDeviceSetFanSpeed_v2` """ @@ -26056,9 +26041,9 @@ cpdef int device_get_nvlink_state(intptr_t device, unsigned int link) except? -1 link (unsigned int): Specifies the NvLink link to be queried. Returns: - int: ``nvmlEnableState_t`` where NVML_FEATURE_ENABLED - indicates that the link is active and - NVML_FEATURE_DISABLED indicates it is inactive. + int: ``nvmlEnableState_t`` where NVML_FEATURE_ENABLED indicates + that the link is active and NVML_FEATURE_DISABLED indicates it + is inactive. .. seealso:: `nvmlDeviceGetNvLinkState` """ @@ -26099,8 +26084,8 @@ cpdef unsigned int device_get_nvlink_capability(intptr_t device, unsigned int li ``nvmlNvLinkCapability_t`` to be queried. Returns: - unsigned int: A boolean for the queried capability indicating - that feature is available. + unsigned int: A boolean for the queried capability indicating that + feature is available. .. seealso:: `nvmlDeviceGetNvLinkCapability` """ @@ -26138,8 +26123,8 @@ cpdef unsigned long long device_get_nvlink_error_counter(intptr_t device, unsign Args: device (intptr_t): The identifier of the target device. link (unsigned int): Specifies the NvLink link to be queried. - counter (NvLinkErrorCounter): Specifies the NvLink counter to - be queried. + counter (NvLinkErrorCounter): Specifies the NvLink counter to be + queried. Returns: unsigned long long: Returned counter value. @@ -26175,8 +26160,7 @@ cpdef int device_get_nvlink_remote_device_type(intptr_t device, unsigned int lin link (unsigned int): The NVLink link index on the target GPU. Returns: - int: Pointer in which the output remote device type is - returned. + int: Pointer in which the output remote device type is returned. .. seealso:: `nvmlDeviceGetNvLinkRemoteDeviceType` """ @@ -26243,8 +26227,7 @@ cpdef object device_get_nvlink_bw_mode(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlNvlinkGetBwMode_v1_t: Reference to - ``nvmlNvlinkGetBwMode_t``. + nvmlNvlinkGetBwMode_v1_t: Reference to ``nvmlNvlinkGetBwMode_t``. .. seealso:: `nvmlDeviceGetNvlinkBwMode` """ @@ -26257,19 +26240,19 @@ cpdef object device_get_nvlink_bw_mode(intptr_t device): return get_bw_mode_py -cpdef device_set_nvlink_bw_mode(intptr_t device, intptr_t set_bw_mode): +cpdef device_set_nvlink_bw_mode(intptr_t device, set_bw_mode): """Set the NvLink Reduced Bandwidth Mode for the device. Args: device (intptr_t): The identifier of the target device. - set_bw_mode (intptr_t): Reference to - ``nvmlNvlinkSetBwMode_t``. + set_bw_mode (intptr_t): Reference to ``nvmlNvlinkSetBwMode_t``. .. seealso:: `nvmlDeviceSetNvlinkBwMode` """ + cdef intptr_t _set_bw_mode_ptr_ = int(set_bw_mode) set_bw_mode.version = NVML_VERSION_STRUCT(sizeof(nvmlNvlinkSetBwMode_v1_t), 1) with nogil: - __status__ = nvmlDeviceSetNvlinkBwMode(device, set_bw_mode) + __status__ = nvmlDeviceSetNvlinkBwMode(device, _set_bw_mode_ptr_) check_status(__status__) @@ -26293,8 +26276,8 @@ cpdef device_register_events(intptr_t device, unsigned long long event_types, in Args: device (intptr_t): The identifier of the target device. - event_types (unsigned long long): Bitmask of ``Event Types`` - to record. + event_types (unsigned long long): Bitmask of ``Event Types`` to + record. set (intptr_t): Set to which add new event types. .. seealso:: `nvmlDeviceRegisterEvents` @@ -26357,28 +26340,29 @@ cpdef event_set_free(intptr_t set): check_status(__status__) -cpdef device_modify_drain_state(intptr_t pci_info, int new_state): +cpdef device_modify_drain_state(pci_info, int new_state): """Modify the drain state of a GPU. This method forces a GPU to no longer accept new incoming requests. Any new NVML process will no longer see this GPU. Persistence mode for this GPU must be turned off before this call is made. Must be called as administrator. For Linux only. Args: - pci_info (intptr_t): The PCI address of the GPU drain state to - be modified. - new_state (EnableState): The drain state that should be - entered, see ``nvmlEnableState_t``. + pci_info (intptr_t): The PCI address of the GPU drain state to be + modified. + new_state (EnableState): The drain state that should be entered, + see ``nvmlEnableState_t``. .. seealso:: `nvmlDeviceModifyDrainState` """ + cdef intptr_t _pci_info_ptr_ = int(pci_info) with nogil: - __status__ = nvmlDeviceModifyDrainState(pci_info, <_EnableState>new_state) + __status__ = nvmlDeviceModifyDrainState(_pci_info_ptr_, <_EnableState>new_state) check_status(__status__) -cpdef int device_query_drain_state(intptr_t pci_info) except? -1: +cpdef int device_query_drain_state(pci_info) except? -1: """Query the drain state of a GPU. This method is used to check if a GPU is in a currently draining state. For Linux only. Args: - pci_info (intptr_t): The PCI address of the GPU drain state to - be queried. + pci_info (intptr_t): The PCI address of the GPU drain state to be + queried. Returns: int: The current drain state for this GPU, see @@ -26386,41 +26370,44 @@ cpdef int device_query_drain_state(intptr_t pci_info) except? -1: .. seealso:: `nvmlDeviceQueryDrainState` """ + cdef intptr_t _pci_info_ptr_ = int(pci_info) cdef _EnableState current_state with nogil: - __status__ = nvmlDeviceQueryDrainState(pci_info, ¤t_state) + __status__ = nvmlDeviceQueryDrainState(_pci_info_ptr_, ¤t_state) check_status(__status__) return current_state -cpdef device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state): +cpdef device_remove_gpu_v2(pci_info, int gpu_state, int link_state): """This method will remove the specified GPU from the view of both NVML and the NVIDIA kernel driver as long as no other processes are attached. If other processes are attached, this call will return NVML_ERROR_IN_USE and the GPU will be returned to its original "draining" state. Note: the only situation where a process can still be attached after :func:`device_modify_drain_state` is called to initiate the draining state is if that process was using, and is still using, a GPU before the call was made. Also note, persistence mode counts as an attachment to the GPU thus it must be disabled prior to this call. Args: pci_info (intptr_t): The PCI address of the GPU to be removed. - gpu_state (DetachGpuState): Whether the GPU is to be removed, - from the OS see ``nvmlDetachGpuState_t``. - link_state (PcieLinkState): Requested upstream PCIe link - state, see ``nvmlPcieLinkState_t``. + gpu_state (DetachGpuState): Whether the GPU is to be removed, from + the OS see ``nvmlDetachGpuState_t``. + link_state (PcieLinkState): Requested upstream PCIe link state, + see ``nvmlPcieLinkState_t``. .. seealso:: `nvmlDeviceRemoveGpu_v2` """ + cdef intptr_t _pci_info_ptr_ = int(pci_info) with nogil: - __status__ = nvmlDeviceRemoveGpu_v2(pci_info, <_DetachGpuState>gpu_state, <_PcieLinkState>link_state) + __status__ = nvmlDeviceRemoveGpu_v2(_pci_info_ptr_, <_DetachGpuState>gpu_state, <_PcieLinkState>link_state) check_status(__status__) -cpdef device_discover_gpus(intptr_t pci_info): +cpdef device_discover_gpus(pci_info): """Request the OS and the NVIDIA kernel driver to rediscover a portion of the PCI subsystem looking for GPUs that were previously removed. The portion of the PCI tree can be narrowed by specifying a domain, bus, and device. If all are zeroes then the entire PCI tree will be searched. Please note that for long-running NVML processes the enumeration will change based on how many GPUs are discovered and where they are inserted in bus order. Args: - pci_info (intptr_t): The PCI tree to be searched. Only the - domain, bus, and device fields are used in this call. + pci_info (intptr_t): The PCI tree to be searched. Only the domain, + bus, and device fields are used in this call. .. seealso:: `nvmlDeviceDiscoverGpus` """ + cdef intptr_t _pci_info_ptr_ = int(pci_info) with nogil: - __status__ = nvmlDeviceDiscoverGpus(pci_info) + __status__ = nvmlDeviceDiscoverGpus(_pci_info_ptr_) check_status(__status__) @@ -26466,8 +26453,8 @@ cpdef device_set_virtualization_mode(intptr_t device, int virtual_mode): Args: device (intptr_t): Identifier of the target device. - virtual_mode (GpuVirtualizationMode): virtualization mode. One - of ``NVML_GPU_VIRTUALIZATION_?``. + virtual_mode (GpuVirtualizationMode): virtualization mode. One of + ``NVML_GPU_VIRTUALIZATION_?``. .. seealso:: `nvmlDeviceSetVirtualizationMode` """ @@ -26483,8 +26470,7 @@ cpdef unsigned long long vgpu_type_get_gsp_heap_size(unsigned int vgpu_type_id) vgpu_type_id (unsigned int): Handle to vGPU type. Returns: - unsigned long long: Reference to return the GSP heap size - value. + unsigned long long: Reference to return the GSP heap size value. .. seealso:: `nvmlVgpuTypeGetGspHeapSize` """ @@ -26537,8 +26523,8 @@ cpdef object device_get_grid_licensable_features_v4(intptr_t device): device (intptr_t): Identifier of the target device. Returns: - nvmlGridLicensableFeatures_t: Pointer to structure in which - vGPU software licensable features are returned. + nvmlGridLicensableFeatures_t: Pointer to structure in which vGPU + software licensable features are returned. .. seealso:: `nvmlDeviceGetGridLicensableFeatures_v4` """ @@ -26558,8 +26544,8 @@ cpdef unsigned int get_vgpu_driver_capabilities(int capability) except? 0: ``nvmlVgpuDriverCapability_t`` to be queried. Returns: - unsigned int: A boolean for the queried capability indicating - that feature is supported. + unsigned int: A boolean for the queried capability indicating that + feature is supported. .. seealso:: `nvmlGetVgpuDriverCapabilities` """ @@ -26579,8 +26565,8 @@ cpdef unsigned int device_get_vgpu_capabilities(intptr_t device, int capability) ``nvmlDeviceVgpuCapability_t`` to be queried. Returns: - unsigned int: Specifies that the queried capability is - supported, and also returns capability's data. + unsigned int: Specifies that the queried capability is supported, + and also returns capability's data. .. seealso:: `nvmlDeviceGetVgpuCapabilities` """ @@ -26642,11 +26628,10 @@ cpdef tuple vgpu_type_get_device_id(unsigned int vgpu_type_id): Returns: A 2-tuple containing: - - unsigned long long: Device ID and vendor ID of the device - contained in single 32 bit value. - - unsigned long long: Subsystem ID and subsystem vendor ID of - the device contained in single 32 bit value. + contained in single 32 bit value. + - unsigned long long: Subsystem ID and subsystem vendor ID of the + device contained in single 32 bit value. .. seealso:: `nvmlVgpuTypeGetDeviceID` """ @@ -26699,16 +26684,12 @@ cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int dis Args: vgpu_type_id (unsigned int): Handle to vGPU type. - display_index (unsigned int): Zero-based index of display - head. + display_index (unsigned int): Zero-based index of display head. Returns: A 2-tuple containing: - - - unsigned int: Pointer to maximum number of pixels in X - dimension. - - unsigned int: Pointer to maximum number of pixels in Y - dimension. + - unsigned int: Pointer to maximum number of pixels in X dimension. + - unsigned int: Pointer to maximum number of pixels in Y dimension. .. seealso:: `nvmlVgpuTypeGetResolution` """ @@ -26765,8 +26746,8 @@ cpdef unsigned int vgpu_type_get_max_instances(intptr_t device, unsigned int vgp vgpu_type_id (unsigned int): Handle to vGPU type. Returns: - unsigned int: Pointer to get the max number of vGPU instances - that can be created on a deicve for given vgpu_type_id. + unsigned int: Pointer to get the max number of vGPU instances that + can be created on a deicve for given vgpu_type_id. .. seealso:: `nvmlVgpuTypeGetMaxInstances` """ @@ -26937,8 +26918,8 @@ cpdef int vgpu_instance_get_ecc_mode(unsigned int vgpu_instance) except? -1: """Retrieve the current ECC mode of vGPU instance. Args: - vgpu_instance (unsigned int): The identifier of the target - vGPU instance. + vgpu_instance (unsigned int): The identifier of the target vGPU + instance. Returns: int: Reference in which to return the current ECC mode. @@ -26997,13 +26978,12 @@ cpdef tuple vgpu_instance_get_encoder_stats(unsigned int vgpu_instance): Returns: A 3-tuple containing: - - unsigned int: Reference to an unsigned int for count of active - encoder sessions. - - unsigned int: Reference to an unsigned int for trailing - average FPS of all active sessions. - - unsigned int: Reference to an unsigned int for encode latency - in microseconds. + encoder sessions. + - unsigned int: Reference to an unsigned int for trailing average + FPS of all active sessions. + - unsigned int: Reference to an unsigned int for encode latency in + microseconds. .. seealso:: `nvmlVgpuInstanceGetEncoderStats` """ @@ -27024,8 +27004,8 @@ cpdef object vgpu_instance_get_encoder_sessions(unsigned int vgpu_instance): instance. Returns: - nvmlEncoderSessionInfo_t: Reference to caller supplied array - in which the list of session information us returned. + nvmlEncoderSessionInfo_t: Reference to caller supplied array in + which the list of session information us returned. .. seealso:: `nvmlVgpuInstanceGetEncoderSessions` """ @@ -27145,8 +27125,8 @@ cpdef unsigned int vgpu_type_get_capabilities(unsigned int vgpu_type_id, int cap ``nvmlVgpuCapability_t`` to be queried. Returns: - unsigned int: A boolean for the queried capability indicating - that feature is supported. + unsigned int: A boolean for the queried capability indicating that + feature is supported. .. seealso:: `nvmlVgpuTypeGetCapabilities` """ @@ -27177,19 +27157,20 @@ cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance): return _cyb_cpython.PyUnicode_FromString(mdev_uuid) -cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_scheduler): +cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, p_scheduler): """Set vGPU scheduler state for the given GPU instance. Args: gpu_instance (intptr_t): The GPU instance handle. - p_scheduler (intptr_t): Pointer to the caller-provided - structure of ``nvmlVgpuSchedulerState_t``. + p_scheduler (intptr_t): Pointer to the caller-provided structure + of ``nvmlVgpuSchedulerState_t``. .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState` """ + cdef intptr_t _p_scheduler_ptr_ = int(p_scheduler) (p_scheduler).version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuSchedulerState_v1_t), 1) with nogil: - __status__ = nvmlGpuInstanceSetVgpuSchedulerState(gpu_instance, p_scheduler) + __status__ = nvmlGpuInstanceSetVgpuSchedulerState(gpu_instance, _p_scheduler_ptr_) check_status(__status__) @@ -27268,8 +27249,8 @@ cpdef object device_get_vgpu_scheduler_log(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerLog_t: Reference in which ``p_scheduler_log`` - is written. + nvmlVgpuSchedulerLog_t: Reference in which ``p_scheduler_log`` is + written. .. seealso:: `nvmlDeviceGetVgpuSchedulerLog` """ @@ -27326,8 +27307,7 @@ cpdef device_set_vgpu_scheduler_state(intptr_t device, intptr_t p_scheduler_stat Args: device (intptr_t): The identifier of the target ``device``. - p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to - set. + p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to set. .. seealso:: `nvmlDeviceSetVgpuSchedulerState` """ @@ -27336,7 +27316,7 @@ cpdef device_set_vgpu_scheduler_state(intptr_t device, intptr_t p_scheduler_stat check_status(__status__) -cpdef set_vgpu_version(intptr_t vgpu_version): +cpdef set_vgpu_version(vgpu_version): """Override the preset range of vGPU versions supported by the NVIDIA vGPU Manager with a range set by an administrator. Args: @@ -27345,8 +27325,9 @@ cpdef set_vgpu_version(intptr_t vgpu_version): .. seealso:: `nvmlSetVgpuVersion` """ + cdef intptr_t _vgpu_version_ptr_ = int(vgpu_version) with nogil: - __status__ = nvmlSetVgpuVersion(vgpu_version) + __status__ = nvmlSetVgpuVersion(_vgpu_version_ptr_) check_status(__status__) @@ -27360,12 +27341,11 @@ cpdef tuple device_get_vgpu_process_utilization(intptr_t device, unsigned long l Returns: A 2-tuple containing: - - - unsigned int: Pointer to caller-supplied array size, and - returns number of processes running on vGPU instances. + - unsigned int: Pointer to caller-supplied array size, and returns + number of processes running on vGPU instances. - nvmlVgpuProcessUtilizationSample_t: Pointer to caller-supplied - buffer in which vGPU sub process utilization samples are - returned. + buffer in which vGPU sub process utilization samples are + returned. .. seealso:: `nvmlDeviceGetVgpuProcessUtilization` """ @@ -27381,8 +27361,8 @@ cpdef int vgpu_instance_get_accounting_mode(unsigned int vgpu_instance) except? """Queries the state of per process accounting mode on vGPU. Args: - vgpu_instance (unsigned int): The identifier of the target - vGPU instance. + vgpu_instance (unsigned int): The identifier of the target vGPU + instance. Returns: int: Reference in which to return the current accounting mode. @@ -27400,12 +27380,11 @@ cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance): """Queries list of processes running on vGPU that can be queried for accounting stats. The list of processes returned can be in running or terminated state. Args: - vgpu_instance (unsigned int): The identifier of the target - vGPU instance. + vgpu_instance (unsigned int): The identifier of the target vGPU + instance. Returns: - unsigned int: Reference in which to return list of process - ids. + unsigned int: Reference in which to return list of process ids. .. seealso:: `nvmlVgpuInstanceGetAccountingPids` """ @@ -27427,14 +27406,14 @@ cpdef object vgpu_instance_get_accounting_stats(unsigned int vgpu_instance, unsi """Queries process's accounting stats. Args: - vgpu_instance (unsigned int): The identifier of the target - vGPU instance. + vgpu_instance (unsigned int): The identifier of the target vGPU + instance. pid (unsigned int): Process Id of the target process to query stats for. Returns: - nvmlAccountingStats_t: Reference in which to return the - process's accounting stats. + nvmlAccountingStats_t: Reference in which to return the process's + accounting stats. .. seealso:: `nvmlVgpuInstanceGetAccountingStats` """ @@ -27450,8 +27429,8 @@ cpdef vgpu_instance_clear_accounting_pids(unsigned int vgpu_instance): """Clears accounting information of the vGPU instance that have already terminated. Args: - vgpu_instance (unsigned int): The identifier of the target - vGPU instance. + vgpu_instance (unsigned int): The identifier of the target vGPU + instance. .. seealso:: `nvmlVgpuInstanceClearAccountingPids` """ @@ -27485,8 +27464,8 @@ cpdef unsigned int get_excluded_device_count() except? 0: """Retrieves the number of excluded GPU devices in the system. Returns: - unsigned int: Reference in which to return the number of - excluded devices. + unsigned int: Reference in which to return the number of excluded + devices. .. seealso:: `nvmlGetExcludedDeviceCount` """ @@ -27505,8 +27484,8 @@ cpdef object get_excluded_device_info_by_index(unsigned int index): ``deviceCount``. Returns: - nvmlExcludedDeviceInfo_t: Reference in which to return the - device information. + nvmlExcludedDeviceInfo_t: Reference in which to return the device + information. .. seealso:: `nvmlGetExcludedDeviceInfoByIndex` """ @@ -27546,11 +27525,10 @@ cpdef tuple device_get_mig_mode(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Returns the current mode, - ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. - unsigned int: Returns the pending mode, - ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. .. seealso:: `nvmlDeviceGetMigMode` """ @@ -27572,10 +27550,9 @@ cpdef object device_get_gpu_instance_possible_placements_v2(intptr_t device, uns Returns: nvmlGpuInstancePlacement_t: Returns placements allowed for the - profile. Can be NULL to discover number of allowed - placements for this profile. If non-NULL must be large - enough to accommodate the placements supported by the - profile. + profile. Can be NULL to discover number of allowed placements + for this profile. If non-NULL must be large enough to + accommodate the placements supported by the profile. .. seealso:: `nvmlDeviceGetGpuInstancePossiblePlacements_v2` """ @@ -27602,8 +27579,7 @@ cpdef unsigned int device_get_gpu_instance_remaining_capacity(intptr_t device, u ``nvmlDeviceGetGpuInstanceProfileInfo``. Returns: - unsigned int: Returns remaining instance count for the profile - ID. + unsigned int: Returns remaining instance count for the profile ID. .. seealso:: `nvmlDeviceGetGpuInstanceRemainingCapacity` """ @@ -27634,7 +27610,7 @@ cpdef intptr_t device_create_gpu_instance(intptr_t device, unsigned int profile_ return gpu_instance -cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsigned int profile_id, intptr_t placement) except? 0: +cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsigned int profile_id, placement) except? 0: """Create GPU instance with the specified placement. Args: @@ -27649,9 +27625,10 @@ cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsign .. seealso:: `nvmlDeviceCreateGpuInstanceWithPlacement` """ + cdef intptr_t _placement_ptr_ = int(placement) cdef GpuInstance gpu_instance with nogil: - __status__ = nvmlDeviceCreateGpuInstanceWithPlacement(device, profile_id, placement, &gpu_instance) + __status__ = nvmlDeviceCreateGpuInstanceWithPlacement(device, profile_id, _placement_ptr_, &gpu_instance) check_status(__status__) return gpu_instance @@ -27739,12 +27716,11 @@ cpdef unsigned int gpu_instance_get_compute_instance_remaining_capacity(intptr_t Args: gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. - See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + profile_id (unsigned int): The compute instance profile ID. See + ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. Returns: - unsigned int: Returns remaining instance count for the profile - ID. + unsigned int: Returns remaining instance count for the profile ID. .. seealso:: `nvmlGpuInstanceGetComputeInstanceRemainingCapacity` """ @@ -27761,15 +27737,14 @@ cpdef object gpu_instance_get_compute_instance_possible_placements(intptr_t gpu_ Args: gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. - See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + profile_id (unsigned int): The compute instance profile ID. See + ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. Returns: - nvmlComputeInstancePlacement_t: Returns placements allowed for - the profile. Can be NULL to discover number of allowed - placements for this profile. If non-NULL must be large - enough to accommodate the placements supported by the - profile. + nvmlComputeInstancePlacement_t: Returns placements allowed for the + profile. Can be NULL to discover number of allowed placements + for this profile. If non-NULL must be large enough to + accommodate the placements supported by the profile. .. seealso:: `nvmlGpuInstanceGetComputeInstancePossiblePlacements` """ @@ -27793,8 +27768,8 @@ cpdef intptr_t gpu_instance_create_compute_instance(intptr_t gpu_instance, unsig Args: gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. - See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + profile_id (unsigned int): The compute instance profile ID. See + ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. Returns: intptr_t: Returns the compute instance handle. @@ -27808,14 +27783,14 @@ cpdef intptr_t gpu_instance_create_compute_instance(intptr_t gpu_instance, unsig return compute_instance -cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_instance, unsigned int profile_id, intptr_t placement) except? 0: +cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_instance, unsigned int profile_id, placement) except? 0: """Create compute instance with the specified placement. Args: gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. - See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + profile_id (unsigned int): The compute instance profile ID. See + ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. placement (intptr_t): The requested placement. See ``nvmlGpuInstanceGetComputeInstancePossiblePlacements``. @@ -27824,9 +27799,10 @@ cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_ .. seealso:: `nvmlGpuInstanceCreateComputeInstanceWithPlacement` """ + cdef intptr_t _placement_ptr_ = int(placement) cdef ComputeInstance compute_instance with nogil: - __status__ = nvmlGpuInstanceCreateComputeInstanceWithPlacement(gpu_instance, profile_id, placement, &compute_instance) + __status__ = nvmlGpuInstanceCreateComputeInstanceWithPlacement(gpu_instance, profile_id, _placement_ptr_, &compute_instance) check_status(__status__) return compute_instance @@ -27871,8 +27847,7 @@ cpdef object compute_instance_get_info_v2(intptr_t compute_instance): compute_instance (intptr_t): The compute instance handle. Returns: - nvmlComputeInstanceInfo_t: Return compute instance - information. + nvmlComputeInstanceInfo_t: Return compute instance information. .. seealso:: `nvmlComputeInstanceGetInfo_v2` """ @@ -28000,8 +27975,8 @@ cpdef device_power_smoothing_activate_preset_profile(intptr_t device, intptr_t p device (intptr_t): The identifier of the target device. profile (intptr_t): Reference to ``nvmlPowerSmoothingProfile_v1_t``. Note that only - ``profile->profileId`` is used and the rest of the - structure is ignored. + ``profile->profileId`` is used and the rest of the structure + is ignored. .. seealso:: `nvmlDevicePowerSmoothingActivatePresetProfile` """ @@ -28030,8 +28005,7 @@ cpdef device_power_smoothing_set_state(intptr_t device, intptr_t state): Args: device (intptr_t): The identifier of the target device. - state (intptr_t): Reference to - ``nvmlPowerSmoothingState_v1_t``. + state (intptr_t): Reference to ``nvmlPowerSmoothingState_v1_t``. .. seealso:: `nvmlDevicePowerSmoothingSetState` """ @@ -28047,8 +28021,8 @@ cpdef object device_get_addressing_mode(intptr_t device): device (intptr_t): The device handle. Returns: - nvmlDeviceAddressingMode_v1_t: Pointer to addressing mode of - the device. + nvmlDeviceAddressingMode_v1_t: Pointer to addressing mode of the + device. .. seealso:: `nvmlDeviceGetAddressingMode` """ @@ -28088,8 +28062,8 @@ cpdef object device_get_power_mizer_mode_v1(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlDevicePowerMizerModes_v1_t: Reference in which to return - the power mizer mode. + nvmlDevicePowerMizerModes_v1_t: Reference in which to return the + power mizer mode. .. seealso:: `nvmlDeviceGetPowerMizerMode_v1` """ @@ -28101,18 +28075,19 @@ cpdef object device_get_power_mizer_mode_v1(intptr_t device): return power_mizer_mode_py -cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode): +cpdef device_set_power_mizer_mode_v1(intptr_t device, power_mizer_mode): """Sets the new power mizer mode. Args: device (intptr_t): The identifier of the target device. - power_mizer_mode (intptr_t): Reference in which to set the - power mizer mode. + power_mizer_mode (intptr_t): Reference in which to set the power + mizer mode. .. seealso:: `nvmlDeviceSetPowerMizerMode_v1` """ + cdef intptr_t _power_mizer_mode_ptr_ = int(power_mizer_mode) with nogil: - __status__ = nvmlDeviceSetPowerMizerMode_v1(device, power_mizer_mode) + __status__ = nvmlDeviceSetPowerMizerMode_v1(device, _power_mizer_mode_ptr_) check_status(__status__) @@ -28209,22 +28184,22 @@ cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance): return p_scheduler_log_info_py -cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_state): +cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, p_scheduler_state): """Sets the vGPU scheduler state. Args: device (intptr_t): The identifier of the target ``device``. - p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to - set. + p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to set. .. seealso:: `nvmlDeviceSetVgpuSchedulerState_v2` """ + cdef intptr_t _p_scheduler_state_ptr_ = int(p_scheduler_state) with nogil: - __status__ = nvmlDeviceSetVgpuSchedulerState_v2(device, p_scheduler_state) + __status__ = nvmlDeviceSetVgpuSchedulerState_v2(device, _p_scheduler_state_ptr_) check_status(__status__) -cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p_scheduler_state): +cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, p_scheduler_state): """Set vGPU scheduler state for the given GPU instance. Args: @@ -28234,8 +28209,9 @@ cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState_v2` """ + cdef intptr_t _p_scheduler_state_ptr_ = int(p_scheduler_state) with nogil: - __status__ = nvmlGpuInstanceSetVgpuSchedulerState_v2(gpu_instance, p_scheduler_state) + __status__ = nvmlGpuInstanceSetVgpuSchedulerState_v2(gpu_instance, _p_scheduler_state_ptr_) check_status(__status__) @@ -28243,12 +28219,11 @@ cpdef object system_get_cper_v1(): """Retrieves Common Platform Error Record (CPER) data. Returns: - nvmlGetCPER_v1_t: Pointer to an ``nvmlGetCPER_v1_t``. On entry - set ``cursor.cperTypeMask``, ``cursor.uuid`` (empty string - for all), ``cursor.handle`` (to - ``NVML_CPER_CURSOR_HANDLE_INIT`` for first call), - ``buffer`` (or NULL), ``bufferSize``. On return - ``cursor.handle`` and ``bufferSize`` are updated. + nvmlGetCPER_v1_t: Pointer to an ``nvmlGetCPER_v1_t``. On entry set + ``cursor.cperTypeMask``, ``cursor.uuid`` (empty string for + all), ``cursor.handle`` (to ``NVML_CPER_CURSOR_HANDLE_INIT`` + for first call), ``buffer`` (or NULL), ``bufferSize``. On + return ``cursor.handle`` and ``bufferSize`` are updated. .. seealso:: `nvmlSystemGetCPER_v1` """ @@ -28267,9 +28242,8 @@ cpdef object device_get_bbx_time_data_v1(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlBBXTimeData_v1_t: Reference in which to return the - cumulative number of seconds the GPU has had the driver - loaded. + nvmlBBXTimeData_v1_t: Reference in which to return the cumulative + number of seconds the GPU has had the driver loaded. .. seealso:: `nvmlDeviceGetBBXTimeData_v1` """ diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index b6e8a13f1cb..87a46973662 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -3,7 +3,7 @@ # SPDX-License-Identifier: Apache-2.0 # # This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a82258bb2654bea18f6bce657324bdbbee8b8b0b30d2a0021e792ba5f95fa9a4 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e3e61247c2cf12c872ed9714fba87737127dd56003145ff4734e98003fcf25ae # <<<< PREAMBLE CONTENT >>>> @@ -137,7 +137,6 @@ cpdef tuple version(): Returns: A 2-tuple containing: - - int: NVVM major version number. - int: NVVM minor version number. @@ -156,7 +155,6 @@ cpdef tuple ir_version(): Returns: A 4-tuple containing: - - int: NVVM IR major version number. - int: NVVM IR minor version number. - int: NVVM IR debug metadata major version number. @@ -197,8 +195,8 @@ cpdef add_module_to_program(intptr_t prog, buffer, size_t size, name): buffer (bytes): NVVM IR module in the bitcode or text representation. size (size_t): Size of the NVVM IR module. - name (str): Name of the NVVM IR module. If NULL, "" - is used as the name. + name (str): Name of the NVVM IR module. If NULL, "" is + used as the name. .. seealso:: `nvvmAddModuleToProgram` """ @@ -219,8 +217,8 @@ cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name): prog (intptr_t): NVVM program. buffer (bytes): NVVM IR module in the bitcode representation. size (size_t): Size of the NVVM IR module. - name (str): Name of the NVVM IR module. If NULL, "" - is used as the name. + name (str): Name of the NVVM IR module. If NULL, "" is + used as the name. .. seealso:: `nvvmLazyAddModuleToProgram` """ @@ -240,15 +238,13 @@ cpdef compile_program(intptr_t prog, int num_options, options): Args: prog (intptr_t): NVVM program. num_options (int): Number of compiler ``options`` passed. - options (object): Compiler options in the form of C string - array. It can be: + options (object): Compiler options in the form of C string array. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address to a valid sequence of 'char', or - a nested Python sequence of ``str``. - .. seealso:: `nvvmCompileProgram` """ cdef nested_resource[ char ] _options_ @@ -264,15 +260,13 @@ cpdef verify_program(intptr_t prog, int num_options, options): Args: prog (intptr_t): NVVM program. num_options (int): Number of compiler ``options`` passed. - options (object): Compiler options in the form of C string - array. It can be: + options (object): Compiler options in the form of C string array. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address to a valid sequence of 'char', or - a nested Python sequence of ``str``. - .. seealso:: `nvvmVerifyProgram` """ cdef nested_resource[ char ] _options_ @@ -289,8 +283,7 @@ cpdef size_t get_compiled_result_size(intptr_t prog) except? 0: prog (intptr_t): NVVM program. Returns: - size_t: Size of the compiled result (including the trailing - NULL). + size_t: Size of the compiled result (including the trailing NULL). .. seealso:: `nvvmGetCompiledResultSize` """ @@ -323,8 +316,8 @@ cpdef size_t get_program_log_size(intptr_t prog) except? 0: prog (intptr_t): NVVM program. Returns: - size_t: Size of the compilation/verification log (including - the trailing NULL). + size_t: Size of the compilation/verification log (including the + trailing NULL). .. seealso:: `nvvmGetProgramLogSize` """