diff --git a/cuda_bindings/cuda/bindings/cudla.pxd b/cuda_bindings/cuda/bindings/cudla.pxd index 90cddb7e342..9b30ff4beaa 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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f6b70193e4ca3c62bd5749b3d19d305f0e268225bf1a6dcf6b95091cb0511791 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6eb337830ce6124c51007631ed0be6c3232fcd43f6d1e53f28b060ec0adf97f8 # <<<< PREAMBLE CONTENT >>>> @@ -56,7 +56,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 f06f010d2f8..67a5a8f1e5a 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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=dacac686fe1821a7d01ad45a8337f4d35d53fc8fafa3892cd3fdcf4b0ec83b1a +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=88aaad5ca6606a0c26d3f7c948ab76a2695b97c973cbd771bbb66b2f6c29fef2 # <<<< PREAMBLE CONTENT >>>> @@ -1814,9 +1814,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 1970c4f614a..ac4a24851f5 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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=616e51ad15aa071792eceba5db17a6fb2b845b219395e2fdcc6278d3621f52de +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5b9d3a05eab53628d366c602ae3125fede0d25b2cc48137e2b1f7dcb29068650 @@ -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 d6fc3e3b69b..5215e9adc49 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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=28643e63cf615e30409047a61ccc54e84bb0739fdec43d3e0ed10ef3759c013f +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=df140bcd5b3c6cfb01ff11bc6275a6048c37bee1db8d80a1da19b176df6af870 # <<<< 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): @@ -1247,9 +1249,10 @@ cdef class IOVec: 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): @@ -1405,9 +1408,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): @@ -2604,9 +2608,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): @@ -3324,7 +3329,7 @@ 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: @@ -3335,9 +3340,10 @@ cpdef intptr_t handle_register(intptr_t descr) except? 0: .. 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 @@ -3480,15 +3486,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__) @@ -3666,7 +3674,7 @@ cpdef stats_reset(): check_status(__status__) -cpdef get_stats_l1(intptr_t stats): +cpdef get_stats_l1(stats): """Get Level 1 cuFile statistics. Args: @@ -3675,12 +3683,13 @@ cpdef get_stats_l1(intptr_t stats): .. 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: @@ -3689,12 +3698,13 @@ cpdef get_stats_l2(intptr_t stats): .. 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: @@ -3703,8 +3713,9 @@ cpdef get_stats_l3(intptr_t stats): .. seealso:: `cuFileGetStatsL3` """ + cdef intptr_t _stats_ptr_ = int(stats) with nogil: - __status__ = cuFileGetStatsL3(stats) + __status__ = cuFileGetStatsL3(_stats_ptr_) check_status(__status__) diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/cuda/bindings/nvml.pxd index 6f35132912f..dfaa71d8a5a 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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=635b329217b9c57fce06de4ffd743372a120b5039eb247f49205bd4d2baf663c +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=61e90d2304af3d2c6e4146a16977ae5514a560d909ea67c778cd955aafc29642 @@ -241,7 +241,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 @@ -338,16 +338,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) @@ -385,7 +385,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) @@ -393,7 +393,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) @@ -407,7 +407,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) @@ -415,7 +415,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) @@ -431,26 +431,26 @@ 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) cpdef object device_get_remapped_rows_v2(intptr_t device) cpdef device_set_adaptive_tgp_mode_v1(intptr_t device, int mode) cpdef object device_get_adaptive_tgp_mode_info_v1(intptr_t device) -cpdef device_set_memory_limits_v1(intptr_t device, intptr_t limits) +cpdef device_set_memory_limits_v1(intptr_t device, limits) cpdef object device_get_memory_limits_v1(intptr_t device) cpdef object device_get_gpu_fabric_info_v4(intptr_t device) cpdef object device_perf_metrics_get_samples_v1(intptr_t device) cpdef object device_set_nvlink_bw_mode_async_v1(intptr_t device) cpdef object device_get_nv_link_telemetry_samples_v1(intptr_t device) -cpdef event_set_register_gpu_operational_events_v1(intptr_t event_set, intptr_t config) +cpdef event_set_register_gpu_operational_events_v1(intptr_t event_set, config) cpdef object event_set_get_context_count_v1(intptr_t set) cpdef object device_get_bank_remapper_status_v1(intptr_t device) diff --git a/cuda_bindings/cuda/bindings/nvml.pyx b/cuda_bindings/cuda/bindings/nvml.pyx index 1834b0237c5..2ced3893b30 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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=42baa8fa2cca9ddd517acada08429135ae729799383efe63d2547b9e2dc92327 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=215448c94725d076d53cf599f903b9cf658abfe2bc4ab2db648eda0e72e20f40 # <<<< PREAMBLE CONTENT >>>> @@ -3537,9 +3537,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): @@ -3719,9 +3720,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): @@ -4446,9 +4448,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): @@ -4809,9 +4812,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): @@ -5166,9 +5170,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): @@ -5518,9 +5523,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): @@ -5725,9 +5731,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): @@ -6679,9 +6686,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): @@ -7188,9 +7196,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): @@ -7709,9 +7718,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): @@ -9300,9 +9310,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): @@ -9956,9 +9967,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): @@ -10292,9 +10304,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): @@ -10647,9 +10660,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): @@ -11035,9 +11049,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): @@ -13474,9 +13489,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): @@ -13910,9 +13926,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): @@ -15047,9 +15064,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): @@ -15613,9 +15631,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): @@ -16095,9 +16114,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): @@ -17533,9 +17553,10 @@ cdef class PmgrPwrTuple: 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): @@ -17679,9 +17700,10 @@ cdef class RailMetrics: 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): @@ -17835,9 +17857,10 @@ cdef class PwrModelMetricsDlppm1xPerf: 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): @@ -17981,9 +18004,10 @@ cdef class PwrModelMetricsSamplePfpp1x: 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): @@ -18136,9 +18160,10 @@ cdef class PwrModelOperatingPointPfpp1x: 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): @@ -19812,9 +19837,10 @@ cdef class NvlinkTelemetrySample_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): @@ -20609,9 +20635,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): @@ -20768,9 +20795,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): @@ -20967,9 +20995,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): @@ -21183,9 +21212,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): @@ -22818,9 +22848,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): @@ -24405,9 +24436,10 @@ cdef class CoreRailMetrics: 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): @@ -24554,9 +24586,10 @@ cdef class PwrModelMetricsPfpp1x: 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): @@ -25465,9 +25498,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): @@ -26895,9 +26929,10 @@ cdef class PwrModelMetricsDlppm1x: 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): @@ -27076,9 +27111,10 @@ cdef class PerfMetricsPfpp1xSample: 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): @@ -27221,9 +27257,10 @@ cdef class PwrModelMetricsDlppm1xDramclkEstimates: 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): @@ -27381,9 +27418,10 @@ cdef class ObservedMetrics: 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): @@ -27571,9 +27609,10 @@ cdef class PerfMetricsDlppc2xSample: 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): @@ -27870,9 +27909,10 @@ cdef class PerfMetricControllerSample: 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): @@ -28026,9 +28066,10 @@ cdef class PerfMetricsSample: 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): @@ -29864,7 +29905,7 @@ 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: @@ -29874,8 +29915,9 @@ cpdef device_set_clock_offsets(intptr_t device, intptr_t info): .. seealso:: `nvmlDeviceSetClockOffsets` """ + cdef intptr_t _info_ptr_ = int(info) with nogil: - __status__ = nvmlDeviceSetClockOffsets(device, info) + __status__ = nvmlDeviceSetClockOffsets(device, _info_ptr_) check_status(__status__) @@ -31725,7 +31767,7 @@ 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: @@ -31734,9 +31776,10 @@ cpdef device_set_nvlink_bw_mode(intptr_t device, intptr_t set_bw_mode): .. 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__) @@ -31824,7 +31867,7 @@ 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: @@ -31835,12 +31878,13 @@ cpdef device_modify_drain_state(intptr_t pci_info, int new_state): .. 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: @@ -31853,14 +31897,15 @@ 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: @@ -31872,12 +31917,13 @@ cpdef device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state): .. 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: @@ -31886,8 +31932,9 @@ cpdef device_discover_gpus(intptr_t pci_info): .. 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__) @@ -32637,7 +32684,7 @@ 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: @@ -32647,9 +32694,10 @@ cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_sc .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState` """ - (p_scheduler).version = NVML_VERSION_STRUCT(sizeof(nvmlVgpuSchedulerState_v1_t), 1) + cdef intptr_t _p_scheduler_ptr_ = int(p_scheduler) + (_p_scheduler_ptr_).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__) @@ -32795,7 +32843,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: @@ -32804,8 +32852,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__) @@ -33088,7 +33137,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: @@ -33103,9 +33152,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 @@ -33260,7 +33310,7 @@ 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: @@ -33276,9 +33326,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 @@ -33551,7 +33602,7 @@ 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: @@ -33561,8 +33612,9 @@ cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t 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__) @@ -33659,7 +33711,7 @@ 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: @@ -33668,12 +33720,13 @@ cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_s .. 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: @@ -33683,8 +33736,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__) @@ -33802,7 +33856,7 @@ cpdef object device_get_adaptive_tgp_mode_info_v1(intptr_t device): return info_py -cpdef device_set_memory_limits_v1(intptr_t device, intptr_t limits): +cpdef device_set_memory_limits_v1(intptr_t device, limits): """Set the memory limits of the device for the cgroup partition. Args: @@ -33812,8 +33866,9 @@ cpdef device_set_memory_limits_v1(intptr_t device, intptr_t limits): .. seealso:: `nvmlDeviceSetMemoryLimits_v1` """ + cdef intptr_t _limits_ptr_ = int(limits) with nogil: - __status__ = nvmlDeviceSetMemoryLimits_v1(device, limits) + __status__ = nvmlDeviceSetMemoryLimits_v1(device, _limits_ptr_) check_status(__status__) @@ -33918,7 +33973,7 @@ cpdef object device_get_nv_link_telemetry_samples_v1(intptr_t device): return samples_py -cpdef event_set_register_gpu_operational_events_v1(intptr_t event_set, intptr_t config): +cpdef event_set_register_gpu_operational_events_v1(intptr_t event_set, config): """Adds a GPU Operational Event subscription to an event set. Args: @@ -33928,8 +33983,9 @@ cpdef event_set_register_gpu_operational_events_v1(intptr_t event_set, intptr_t .. seealso:: `nvmlEventSetRegisterGpuOperationalEvents_v1` """ + cdef intptr_t _config_ptr_ = int(config) with nogil: - __status__ = nvmlEventSetRegisterGpuOperationalEvents_v1(event_set, config) + __status__ = nvmlEventSetRegisterGpuOperationalEvents_v1(event_set, _config_ptr_) check_status(__status__) diff --git a/cuda_bindings/docs/source/release/13.5.0-notes.rst b/cuda_bindings/docs/source/release/13.5.0-notes.rst index eb6edfbfa1e..f00852517fd 100644 --- a/cuda_bindings/docs/source/release/13.5.0-notes.rst +++ b/cuda_bindings/docs/source/release/13.5.0-notes.rst @@ -22,6 +22,7 @@ Enhancements - ``nvjitlink.get_linked_ltoir`` (``ltoir``) - ``nvjitlink.get_linked_ptx`` (``ptx``) - ``nvvm.add_module_to_program``, ``nvvm.lazy_add_module_to_program``, ``nvvm.get_compiled_result``, ``nvvm.get_program_log`` (``buffer``) +- For all ``cuda-bindings`` APIs, functions that accept a struct wrapper will accept the struct wrapper directly, rather than requiring getting the ``.ptr`` property. Behavior changes ----------------