cuda-bindings 12.9.11 Release notes¶
Breaking Changes¶
nvml.NvlinkFirmwareInfo.firmware_versionnow exposes only valid entries, rather than all 100 slots in the underlying buffer. Set this member to update the valid-entry count; the separatenum_valid_entriesmember has been removed. Uselen(info.firmware_version)to query the count. (PR #3429)Reserved members of
runtimestruct wrappers are no longer exposed as Python attributes. Accessing these members now raisesAttributeError:cudaArraySparseProperties.reserved,cudaArrayMemoryRequirements.reserved,cudaMemcpyNodeParams.reserved,cudaFuncAttributes.reserved,cudaMemPoolProps.reserved,cudaMemPoolPtrExportData.reserved,cudaDeviceProp.reserved,cudaEglPlaneDesc_st.reservedcudaIpcEventHandle_st.reserved,cudaIpcMemHandle_st.reserved,cudaMemFabricHandle_st.reserved(also removed from their_taliases)cudaExternalSemaphoreSignalParams.params.nvSciSync.reserved,cudaExternalSemaphoreSignalParams.params.reserved,cudaExternalSemaphoreSignalParams.reserved,cudaExternalSemaphoreWaitParams.params.nvSciSync.reserved,cudaExternalSemaphoreWaitParams.params.reserved,cudaExternalSemaphoreWaitParams.reservedcudaGraphNodeParams.reserved0,cudaGraphNodeParams.reserved1,cudaGraphNodeParams.reserved2,cudaGraphEdgeData_st.reserved
Storage allocated by these wrappers is zero-initialized, including reserved fields, so callers do not need to zero these fields explicitly.
To serialize IPC handles previously accessed through
handle.reserved, copy their raw bytes usinggetPtr()andctypesinstead:import ctypes from cuda.bindings import runtime # handle was returned by runtime.cudaIpcGetMemHandle(). payload = ctypes.string_at(handle.getPtr(), runtime.CUDA_IPC_HANDLE_SIZE) restored = runtime.cudaIpcMemHandle_t() ctypes.memmove(restored.getPtr(), payload, runtime.CUDA_IPC_HANDLE_SIZE)
When restoring a payload received from another process, ensure it contains exactly
runtime.CUDA_IPC_HANDLE_SIZEbytes before copying it.
Enhancements¶
Expanded NVML coverage with
device_get_gpu_uptime_v1,system_get_conf_compute_settings_v2,device_get_nvlink_info_v3,device_get_nvlink_remap_table_info_v1,device_set_nvlink_nvle_ready_v1,device_lock_nvlink_remap_table_v1,device_setup_nvlink_nvle_encryption_key_v1, anddevice_get_nvlink_nvle_private_info_v1, together with their struct wrappers. These APIs require an NVML library that provides the corresponding functions. (PR #3429)Buffer-like pointer arguments in
nvfatbin,nvjitlink, andnvvmnow accept contiguous buffers of any dimensionality, including ctypes objects and multidimensional NumPy arrays. Previously these buffers had to be 1D. (PR #3429)Pointer arguments in
cufileandnvml, such asdescrincufile.handle_registerandinfoinnvml.device_set_clock_offsets, now acceptNoneasNULL. (PR #3429)
Bug Fixes¶
driver.cuLaunchHostFuncandruntime.cudaLaunchHostFuncnow pass the host function and its user data to CUDA unchanged. The previous internal trampoline freed its state after the first invocation, causing a captured host function to crash on the second launch of a CUDA graph. Callers must retain the callback object and user data storage until all uses have completed, including the lifetime of graphs and their executables; see Host functions. (PR #3107)Corrected the driver-version lookup for
cuLogs*functions to CUDA 12.9, preventing spuriousFunctionNotFoundErrorfailures on supported drivers. (PR #3377, PR #3395)Fixed crashes when registering or unregistering
cuLogs*and asynchronous notification callbacks concurrently under free-threaded Python. (PR #3429)Nested
driverandruntimestruct and union views now retain their owning wrapper, and struct-array getters in these modules return independent copies, avoiding access to freed backing storage. Mutating a returned element no longer updates the parent struct: read the array, modify its elements, then assign it back (for example,attrs = cfg.attrs, updateattrs[0], thencfg.attrs = attrs).cufileandnvmlstruct wrappers also retain owners correctly when indexing and slicing arrays. (PR #3429)cufileandnvmlstruct arrays are now zero-initialized, and assigning to a member of a read-only array wrapper raisesValueError. (PR #3429)nvml.device_get_field_valuesinitializes per-query status toERROR_UNKNOWNso entries left unpopulated by NVML do not appear successful. Integer field IDs now explicitly use scope ID zero. (PR #3429)nvml.PwrModelMetricsPfpp1xandnvml.PwrModelMetricsDlppm1xnow populate their nestedestimated_metricsarrays using each element’snum_vf_pointsandnum_estimated_metrics, respectively. (PR #3429)Moved cuFile and NVML dtype layout calculations to heap storage to avoid placing large temporary structs on the stack during module initialization. (PR #3473)
Nested resource pointer conversion accepts both
strandbytesoptions, matching the CUDA 13 bindings behavior.Coredump settings retain borrowed string buffers for the duration of the call and free the buffers allocated for getters.
get_cuda_native_handlepreserves aKeyErrorraised inside a registered getter instead of reporting an unknown type. (PR #3315)
Deprecations¶
The NVML exception classes
nvml.TimeoutErrorandnvml.MemoryErrorhave been renamed tonvml.NvmlTimeoutErrorandnvml.NvmlMemoryErrorto avoid shadowing Python builtins. The old names remain available as compatibility aliases. Both classes still derive fromnvml.NvmlError. (PR #3429)
End of Life¶
Python 3.10 support dropped (end of life); the supported range is Python 3.11-3.15.
Packaging and Source Builds¶
Wheels omit
.pyximplementation sources and.ingeneration templates, following the CUDA 13 packaging policy. Cython declarations and includes (.pxdand.pxi), and required headers, remain available for downstream Cython builds. Source distributions retain the inputs needed to build the package.All binding sources, including the runtime’s internal and Cython layers, are now pre-generated. Source builds no longer parse CUDA headers or expand templates, removing the
pyclibrarybuild dependency and theCUDA_PYTHON_PARSER_CACHINGsetting. (PR #3429, PR #3437)Source builds use the monorepo’s shared compiler and Cython-cache tooling and check for CUDA 12.9 headers before Cythonization, reporting a clear error when the selected toolkit’s major.minor version does not match the generated sources. (PR #3173)
Development and test dependencies are now provided through dependency groups; use
python -m pip install -v -e . --group testfromcuda_bindings_12for an editable installation with test dependencies. (PR #3315)
Documentation and Maintenance¶
CUDA 12.9 maintenance sources now live in
cuda_bindings_12onmain. The historical12.9.xbranch is frozen except for emergency fixes, which must also be reconciled intomain. Main-tree CUDA 12 releases are built and tested alongside CUDA 13. Old-layout CUDA 12 tags are released from a validated workflow on the appropriate maintenance branch or historical tag, not frommain.Corrected the CUDA 12 driver guidance to its existing minor-version compatibility baseline: Linux 525.60.13 and Windows 528.33. This is a documentation correction, not a new runtime version check. Newer features and PTX compilation can still require a newer driver.
Known Issues¶
Updating from v12.6.2.post1 and older via
pip install -U cuda-pythonmight not work. Uninstall withpip uninstall -y cuda-python, then install the CUDA 12 line withpip install "cuda-python~=12.9.0".nvml.system_get_process_nameon WSL can return incorrect values. Set the locale to"C"before callingnvml.device_get_compute_running_processes_v3(which sets the process names) andnvml.system_get_process_name.