diff --git a/cuda_bindings/cuda/bindings/_internal/nvml.pxd b/cuda_bindings/cuda/bindings/_internal/nvml.pxd index 697687c46b..1664d4cc01 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvml.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1406+gd8426ea19.d20260316. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. from ..cynvml cimport * @@ -139,6 +139,7 @@ cdef nvmlReturn_t _nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverMo cdef nvmlReturn_t _nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil @@ -354,3 +355,10 @@ cdef nvmlReturn_t _nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t cdef nvmlReturn_t _nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx index 2eab899835..825931d756 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1406+gd8426ea19.d20260316. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. from libc.stdint cimport intptr_t, uintptr_t @@ -188,6 +188,7 @@ cdef void* __nvmlDeviceGetDriverModel_v2 = NULL cdef void* __nvmlDeviceGetVbiosVersion = NULL cdef void* __nvmlDeviceGetBridgeChipInfo = NULL cdef void* __nvmlDeviceGetComputeRunningProcesses_v3 = NULL +cdef void* __nvmlDeviceGetGraphicsRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetMPSComputeRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetRunningProcessDetailList = NULL cdef void* __nvmlDeviceOnSameBoard = NULL @@ -403,6 +404,13 @@ cdef void* __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = NULL cdef void* __nvmlDeviceGetUnrepairableMemoryFlag_v1 = NULL cdef void* __nvmlDeviceReadPRMCounters_v1 = NULL cdef void* __nvmlDeviceSetRusdSettings_v1 = NULL +cdef void* __nvmlDeviceVgpuForceGspUnload = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlDeviceSetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceSetVgpuSchedulerState_v2 = NULL cdef void* load_library() except* with gil: @@ -1316,6 +1324,13 @@ cdef int _init_nvml() except -1 nogil: handle = load_library() __nvmlDeviceGetComputeRunningProcesses_v3 = dlsym(handle, 'nvmlDeviceGetComputeRunningProcesses_v3') + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + __nvmlDeviceGetGraphicsRunningProcesses_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + if __nvmlDeviceGetGraphicsRunningProcesses_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGraphicsRunningProcesses_v3 = dlsym(handle, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 __nvmlDeviceGetMPSComputeRunningProcesses_v3 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetMPSComputeRunningProcesses_v3') if __nvmlDeviceGetMPSComputeRunningProcesses_v3 == NULL: @@ -2821,6 +2836,55 @@ cdef int _init_nvml() except -1 nogil: handle = load_library() __nvmlDeviceSetRusdSettings_v1 = dlsym(handle, 'nvmlDeviceSetRusdSettings_v1') + global __nvmlDeviceVgpuForceGspUnload + __nvmlDeviceVgpuForceGspUnload = dlsym(RTLD_DEFAULT, 'nvmlDeviceVgpuForceGspUnload') + if __nvmlDeviceVgpuForceGspUnload == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceVgpuForceGspUnload = dlsym(handle, 'nvmlDeviceVgpuForceGspUnload') + + global __nvmlDeviceGetVgpuSchedulerState_v2 + __nvmlDeviceGetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerState_v2') + if __nvmlDeviceGetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlDeviceGetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + if __nvmlGpuInstanceGetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + __nvmlDeviceGetVgpuSchedulerLog_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceGetVgpuSchedulerLog_v2') + if __nvmlDeviceGetVgpuSchedulerLog_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetVgpuSchedulerLog_v2 = dlsym(handle, 'nvmlDeviceGetVgpuSchedulerLog_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + if __nvmlGpuInstanceGetVgpuSchedulerLog_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = dlsym(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + + global __nvmlDeviceSetVgpuSchedulerState_v2 + __nvmlDeviceSetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlDeviceSetVgpuSchedulerState_v2') + if __nvmlDeviceSetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlDeviceSetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = dlsym(RTLD_DEFAULT, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + if __nvmlGpuInstanceSetVgpuSchedulerState_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = dlsym(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + __py_nvml_init = True return 0 @@ -3227,6 +3291,9 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetComputeRunningProcesses_v3 data["__nvmlDeviceGetComputeRunningProcesses_v3"] = __nvmlDeviceGetComputeRunningProcesses_v3 + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = __nvmlDeviceGetGraphicsRunningProcesses_v3 + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = __nvmlDeviceGetMPSComputeRunningProcesses_v3 @@ -3872,6 +3939,27 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceSetRusdSettings_v1 data["__nvmlDeviceSetRusdSettings_v1"] = __nvmlDeviceSetRusdSettings_v1 + global __nvmlDeviceVgpuForceGspUnload + data["__nvmlDeviceVgpuForceGspUnload"] = __nvmlDeviceVgpuForceGspUnload + + global __nvmlDeviceGetVgpuSchedulerState_v2 + data["__nvmlDeviceGetVgpuSchedulerState_v2"] = __nvmlDeviceGetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = __nvmlGpuInstanceGetVgpuSchedulerState_v2 + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = __nvmlDeviceGetVgpuSchedulerLog_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + + global __nvmlDeviceSetVgpuSchedulerState_v2 + data["__nvmlDeviceSetVgpuSchedulerState_v2"] = __nvmlDeviceSetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = __nvmlGpuInstanceSetVgpuSchedulerState_v2 + func_ptrs = data return data @@ -5167,6 +5255,16 @@ cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, device, infoCount, infos) +cdef nvmlReturn_t _nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + _check_or_init_nvml() + if __nvmlDeviceGetGraphicsRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGraphicsRunningProcesses_v3 is not found") + return (__nvmlDeviceGetGraphicsRunningProcesses_v3)( + device, infoCount, infos) + + cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: global __nvmlDeviceGetMPSComputeRunningProcesses_v3 _check_or_init_nvml() @@ -7315,3 +7413,73 @@ cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSet raise FunctionNotFoundError("function nvmlDeviceSetRusdSettings_v1 is not found") return (__nvmlDeviceSetRusdSettings_v1)( device, settings) + + +cdef nvmlReturn_t _nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceVgpuForceGspUnload + _check_or_init_nvml() + if __nvmlDeviceVgpuForceGspUnload == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceVgpuForceGspUnload is not found") + return (__nvmlDeviceVgpuForceGspUnload)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerState_v2)( + device, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerLog_v2)( + device, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerLog_v2)( + gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceSetVgpuSchedulerState_v2)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceSetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerState) diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx index cedae45ada..301f14e747 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1406+gd8426ea19.d20260316. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. from libc.stdint cimport intptr_t @@ -207,6 +207,7 @@ cdef void* __nvmlDeviceGetDriverModel_v2 = NULL cdef void* __nvmlDeviceGetVbiosVersion = NULL cdef void* __nvmlDeviceGetBridgeChipInfo = NULL cdef void* __nvmlDeviceGetComputeRunningProcesses_v3 = NULL +cdef void* __nvmlDeviceGetGraphicsRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetMPSComputeRunningProcesses_v3 = NULL cdef void* __nvmlDeviceGetRunningProcessDetailList = NULL cdef void* __nvmlDeviceOnSameBoard = NULL @@ -422,6 +423,13 @@ cdef void* __nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts = NULL cdef void* __nvmlDeviceGetUnrepairableMemoryFlag_v1 = NULL cdef void* __nvmlDeviceReadPRMCounters_v1 = NULL cdef void* __nvmlDeviceSetRusdSettings_v1 = NULL +cdef void* __nvmlDeviceVgpuForceGspUnload = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlDeviceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = NULL +cdef void* __nvmlDeviceSetVgpuSchedulerState_v2 = NULL +cdef void* __nvmlGpuInstanceSetVgpuSchedulerState_v2 = NULL cdef uintptr_t load_library() except* with gil: @@ -822,6 +830,9 @@ cdef int _init_nvml() except -1 nogil: global __nvmlDeviceGetComputeRunningProcesses_v3 __nvmlDeviceGetComputeRunningProcesses_v3 = GetProcAddress(handle, 'nvmlDeviceGetComputeRunningProcesses_v3') + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + __nvmlDeviceGetGraphicsRunningProcesses_v3 = GetProcAddress(handle, 'nvmlDeviceGetGraphicsRunningProcesses_v3') + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 __nvmlDeviceGetMPSComputeRunningProcesses_v3 = GetProcAddress(handle, 'nvmlDeviceGetMPSComputeRunningProcesses_v3') @@ -1467,6 +1478,27 @@ cdef int _init_nvml() except -1 nogil: global __nvmlDeviceSetRusdSettings_v1 __nvmlDeviceSetRusdSettings_v1 = GetProcAddress(handle, 'nvmlDeviceSetRusdSettings_v1') + global __nvmlDeviceVgpuForceGspUnload + __nvmlDeviceVgpuForceGspUnload = GetProcAddress(handle, 'nvmlDeviceVgpuForceGspUnload') + + global __nvmlDeviceGetVgpuSchedulerState_v2 + __nvmlDeviceGetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + __nvmlGpuInstanceGetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerState_v2') + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + __nvmlDeviceGetVgpuSchedulerLog_v2 = GetProcAddress(handle, 'nvmlDeviceGetVgpuSchedulerLog_v2') + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = GetProcAddress(handle, 'nvmlGpuInstanceGetVgpuSchedulerLog_v2') + + global __nvmlDeviceSetVgpuSchedulerState_v2 + __nvmlDeviceSetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlDeviceSetVgpuSchedulerState_v2') + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + __nvmlGpuInstanceSetVgpuSchedulerState_v2 = GetProcAddress(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + __py_nvml_init = True return 0 @@ -1873,6 +1905,9 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetComputeRunningProcesses_v3 data["__nvmlDeviceGetComputeRunningProcesses_v3"] = __nvmlDeviceGetComputeRunningProcesses_v3 + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + data["__nvmlDeviceGetGraphicsRunningProcesses_v3"] = __nvmlDeviceGetGraphicsRunningProcesses_v3 + global __nvmlDeviceGetMPSComputeRunningProcesses_v3 data["__nvmlDeviceGetMPSComputeRunningProcesses_v3"] = __nvmlDeviceGetMPSComputeRunningProcesses_v3 @@ -2518,6 +2553,27 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceSetRusdSettings_v1 data["__nvmlDeviceSetRusdSettings_v1"] = __nvmlDeviceSetRusdSettings_v1 + global __nvmlDeviceVgpuForceGspUnload + data["__nvmlDeviceVgpuForceGspUnload"] = __nvmlDeviceVgpuForceGspUnload + + global __nvmlDeviceGetVgpuSchedulerState_v2 + data["__nvmlDeviceGetVgpuSchedulerState_v2"] = __nvmlDeviceGetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerState_v2"] = __nvmlGpuInstanceGetVgpuSchedulerState_v2 + + global __nvmlDeviceGetVgpuSchedulerLog_v2 + data["__nvmlDeviceGetVgpuSchedulerLog_v2"] = __nvmlDeviceGetVgpuSchedulerLog_v2 + + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + data["__nvmlGpuInstanceGetVgpuSchedulerLog_v2"] = __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + + global __nvmlDeviceSetVgpuSchedulerState_v2 + data["__nvmlDeviceSetVgpuSchedulerState_v2"] = __nvmlDeviceSetVgpuSchedulerState_v2 + + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = __nvmlGpuInstanceSetVgpuSchedulerState_v2 + func_ptrs = data return data @@ -3813,6 +3869,16 @@ cdef nvmlReturn_t _nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, device, infoCount, infos) +cdef nvmlReturn_t _nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGraphicsRunningProcesses_v3 + _check_or_init_nvml() + if __nvmlDeviceGetGraphicsRunningProcesses_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGraphicsRunningProcesses_v3 is not found") + return (__nvmlDeviceGetGraphicsRunningProcesses_v3)( + device, infoCount, infos) + + cdef nvmlReturn_t _nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: global __nvmlDeviceGetMPSComputeRunningProcesses_v3 _check_or_init_nvml() @@ -5961,3 +6027,73 @@ cdef nvmlReturn_t _nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSet raise FunctionNotFoundError("function nvmlDeviceSetRusdSettings_v1 is not found") return (__nvmlDeviceSetRusdSettings_v1)( device, settings) + + +cdef nvmlReturn_t _nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceVgpuForceGspUnload + _check_or_init_nvml() + if __nvmlDeviceVgpuForceGspUnload == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceVgpuForceGspUnload is not found") + return (__nvmlDeviceVgpuForceGspUnload)( + device) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerState_v2)( + device, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlDeviceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlDeviceGetVgpuSchedulerLog_v2)( + device, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceGetVgpuSchedulerLog_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceGetVgpuSchedulerLog_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceGetVgpuSchedulerLog_v2 is not found") + return (__nvmlGpuInstanceGetVgpuSchedulerLog_v2)( + gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlDeviceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetVgpuSchedulerState_v2 is not found") + return (__nvmlDeviceSetVgpuSchedulerState_v2)( + device, pSchedulerState) + + +cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlGpuInstanceSetVgpuSchedulerState_v2 + _check_or_init_nvml() + if __nvmlGpuInstanceSetVgpuSchedulerState_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState_v2 is not found") + return (__nvmlGpuInstanceSetVgpuSchedulerState_v2)( + gpuInstance, pSchedulerState) diff --git a/cuda_bindings/cuda/bindings/cynvml.pxd b/cuda_bindings/cuda/bindings/cynvml.pxd index 2a95fc96c8..db04f04d76 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pxd +++ b/cuda_bindings/cuda/bindings/cynvml.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1406+gd8426ea19.d20260316. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. from libc.stdint cimport int64_t @@ -1947,6 +1947,7 @@ cdef nvmlReturn_t nvmlDeviceGetDriverModel_v2(nvmlDevice_t device, nvmlDriverMod cdef nvmlReturn_t nvmlDeviceGetVbiosVersion(nvmlDevice_t device, char* version, unsigned int length) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetBridgeChipInfo(nvmlDevice_t device, nvmlBridgeChipHierarchy_t* bridgeHierarchy) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetRunningProcessDetailList(nvmlDevice_t device, nvmlProcessDetailList_t* plist) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceOnSameBoard(nvmlDevice_t device1, nvmlDevice_t device2, int* onSameBoard) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil @@ -2162,3 +2163,10 @@ cdef nvmlReturn_t nvmlDeviceGetSramUniqueUncorrectedEccErrorCounts(nvmlDevice_t cdef nvmlReturn_t nvmlDeviceGetUnrepairableMemoryFlag_v1(nvmlDevice_t device, nvmlUnrepairableMemoryStatus_v1_t* unrepairableMemoryStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCounterList_v1_t* counterList) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cynvml.pyx b/cuda_bindings/cuda/bindings/cynvml.pyx index 0066265458..2ba3a2a21e 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pyx +++ b/cuda_bindings/cuda/bindings/cynvml.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1406+gd8426ea19.d20260316. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. from ._internal cimport nvml as _nvml @@ -523,6 +523,10 @@ cdef nvmlReturn_t nvmlDeviceGetComputeRunningProcesses_v3(nvmlDevice_t device, u return _nvml._nvmlDeviceGetComputeRunningProcesses_v3(device, infoCount, infos) +cdef nvmlReturn_t nvmlDeviceGetGraphicsRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGraphicsRunningProcesses_v3(device, infoCount, infos) + + cdef nvmlReturn_t nvmlDeviceGetMPSComputeRunningProcesses_v3(nvmlDevice_t device, unsigned int* infoCount, nvmlProcessInfo_t* infos) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: return _nvml._nvmlDeviceGetMPSComputeRunningProcesses_v3(device, infoCount, infos) @@ -1381,3 +1385,31 @@ cdef nvmlReturn_t nvmlDeviceReadPRMCounters_v1(nvmlDevice_t device, nvmlPRMCount cdef nvmlReturn_t nvmlDeviceSetRusdSettings_v1(nvmlDevice_t device, nvmlRusdSettings_v1_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: return _nvml._nvmlDeviceSetRusdSettings_v1(device, settings) + + +cdef nvmlReturn_t nvmlDeviceVgpuForceGspUnload(nvmlDevice_t device) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceVgpuForceGspUnload(device) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuSchedulerState_v2(device, pSchedulerStateInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerStateInfo_v2_t* pSchedulerStateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuSchedulerState_v2(gpuInstance, pSchedulerStateInfo) + + +cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetVgpuSchedulerLog_v2(device, pSchedulerLogInfo) + + +cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceGetVgpuSchedulerLog_v2(gpuInstance, pSchedulerLogInfo) + + +cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetVgpuSchedulerState_v2(device, pSchedulerState) + + +cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlGpuInstanceSetVgpuSchedulerState_v2(gpuInstance, pSchedulerState) diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/cuda/bindings/nvml.pxd index f75b26edeb..2176561bc4 100644 --- a/cuda_bindings/cuda/bindings/nvml.pxd +++ b/cuda_bindings/cuda/bindings/nvml.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1406+gd8426ea19.d20260316. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. from libc.stdint cimport intptr_t @@ -52,9 +52,6 @@ ctypedef nvmlMask255_t Mask255 ctypedef nvmlHostname_v1_t Hostname_v1 ctypedef nvmlUnrepairableMemoryStatus_v1_t UnrepairableMemoryStatus_v1 ctypedef nvmlRusdSettings_v1_t RusdSettings_v1 -ctypedef nvmlVgpuSchedulerStateInfo_v2_t VgpuSchedulerStateInfo_v2 -ctypedef nvmlVgpuSchedulerLogEntry_v2_t VgpuSchedulerLogEntry_v2 -ctypedef nvmlVgpuSchedulerState_v2_t VgpuSchedulerState_v2 ctypedef nvmlPowerValue_v2_t PowerValue_v2 ctypedef nvmlVgpuTypeMaxInstance_v1_t VgpuTypeMaxInstance_v1 ctypedef nvmlVgpuProcessUtilizationSample_t VgpuProcessUtilizationSample @@ -70,7 +67,6 @@ ctypedef nvmlWorkloadPowerProfileCurrentProfiles_v1_t WorkloadPowerProfileCurren ctypedef nvmlWorkloadPowerProfileRequestedProfiles_v1_t WorkloadPowerProfileRequestedProfiles_v1 ctypedef nvmlWorkloadPowerProfileUpdateProfiles_v1_t WorkloadPowerProfileUpdateProfiles_v1 ctypedef nvmlPRMTLV_v1_t PRMTLV_v1 -ctypedef nvmlVgpuSchedulerLogInfo_v2_t VgpuSchedulerLogInfo_v2 ctypedef nvmlVgpuSchedulerSetState_t VgpuSchedulerSetState ctypedef nvmlGpmMetricsGet_t GpmMetricsGet ctypedef nvmlPRMCounterList_v1_t PRMCounterList_v1 @@ -261,6 +257,7 @@ cpdef tuple device_get_driver_model_v2(intptr_t device) cpdef str device_get_vbios_version(intptr_t device) cpdef object device_get_bridge_chip_info(intptr_t device) cpdef object device_get_compute_running_processes_v3(intptr_t device) +cpdef object device_get_graphics_running_processes_v3(intptr_t device) cpdef object device_get_mps_compute_running_processes_v3(intptr_t device) cpdef int device_on_same_board(intptr_t device1, intptr_t device2) except? 0 cpdef int device_get_api_restriction(intptr_t device, int api_type) except? -1 @@ -420,3 +417,10 @@ 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_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) diff --git a/cuda_bindings/cuda/bindings/nvml.pyx b/cuda_bindings/cuda/bindings/nvml.pyx index 95c408e7f6..981a6a05e4 100644 --- a/cuda_bindings/cuda/bindings/nvml.pyx +++ b/cuda_bindings/cuda/bindings/nvml.pyx @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: LicenseRef-NVIDIA-SOFTWARE-LICENSE # -# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1406+gd8426ea19.d20260316. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.2.0, generator version 0.3.1.dev1422+gf4812259e.d20260318. Do not modify it directly. cimport cython # NOQA @@ -15491,6 +15491,557 @@ cdef class PRMCounterInput_v1: return obj +cdef _get_vgpu_scheduler_state_info_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerStateInfo_v2_t pod = nvmlVgpuSchedulerStateInfo_v2_t() + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.avgFactor)) - (&pod), + (&(pod.timeslice)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v2_t), + }) + +vgpu_scheduler_state_info_v2_dtype = _get_vgpu_scheduler_state_info_v2_dtype_offsets() + +cdef class VgpuSchedulerStateInfo_v2: + """Empty-initialize an instance of `nvmlVgpuSchedulerStateInfo_v2_t`. + + + .. seealso:: `nvmlVgpuSchedulerStateInfo_v2_t` + """ + cdef: + nvmlVgpuSchedulerStateInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerStateInfo_v2_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerStateInfo_v2 object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef VgpuSchedulerStateInfo_v2 other_ + if not isinstance(other, VgpuSchedulerStateInfo_v2): + return False + other_ = other + return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) == 0) + + def __getbuffer__(self, Py_buffer *buffer, int flags): + __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerStateInfo_v2_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = malloc(sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v2") + memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def engine_id(self): + """int: IN: Engine whose software scheduler state info is fetched. One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*.""" + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].engineId = val + + @property + def scheduler_policy(self): + """int: OUT: Scheduler policy.""" + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def avg_factor(self): + """int: OUT: Average factor in compensating the timeslice for Adaptive Round Robin mode.""" + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].avgFactor = val + + @property + def timeslice(self): + """int: OUT: The timeslice in ns for each software run list as configured, or the default value otherwise.""" + return self._ptr[0].timeslice + + @timeslice.setter + def timeslice(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v2 instance is read-only") + self._ptr[0].timeslice = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerStateInfo_v2 instance with the memory from the given buffer.""" + return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerStateInfo_v2_t), VgpuSchedulerStateInfo_v2) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerStateInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_info_v2_dtype` holding the data. + """ + return __from_data(data, "vgpu_scheduler_state_info_v2_dtype", vgpu_scheduler_state_info_v2_dtype, VgpuSchedulerStateInfo_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerStateInfo_v2 instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerStateInfo_v2 obj = VgpuSchedulerStateInfo_v2.__new__(VgpuSchedulerStateInfo_v2) + if owner is None: + obj._ptr = malloc(sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v2") + memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerStateInfo_v2_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_vgpu_scheduler_log_entry_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerLogEntry_v2_t pod = nvmlVgpuSchedulerLogEntry_v2_t() + return _numpy.dtype({ + 'names': ['timestamp', 'time_run_total', 'time_run', 'sw_runlist_id', 'target_time_slice', 'cumulative_preemption_time', 'weight'], + 'formats': [_numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint32], + 'offsets': [ + (&(pod.timestamp)) - (&pod), + (&(pod.timeRunTotal)) - (&pod), + (&(pod.timeRun)) - (&pod), + (&(pod.swRunlistId)) - (&pod), + (&(pod.targetTimeSlice)) - (&pod), + (&(pod.cumulativePreemptionTime)) - (&pod), + (&(pod.weight)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogEntry_v2_t), + }) + +vgpu_scheduler_log_entry_v2_dtype = _get_vgpu_scheduler_log_entry_v2_dtype_offsets() + +cdef class VgpuSchedulerLogEntry_v2: + """Empty-initialize an array of `nvmlVgpuSchedulerLogEntry_v2_t`. + + The resulting object is of length `size` and of dtype `vgpu_scheduler_log_entry_v2_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + + .. seealso:: `nvmlVgpuSchedulerLogEntry_v2_t` + """ + cdef: + readonly object _data + + + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_scheduler_log_entry_v2_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuSchedulerLogEntry_v2_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuSchedulerLogEntry_v2_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuSchedulerLogEntry_v2_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuSchedulerLogEntry_v2 object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return self._data.ctypes.data + + cdef intptr_t _get_ptr(self): + 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") + return self._data.ctypes.data + + def __len__(self): + return self._data.size + + def __eq__(self, other): + cdef object self_data = self._data + if (not isinstance(other, VgpuSchedulerLogEntry_v2)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + return False + return bool((self_data == other._data).all()) + + def __getbuffer__(self, Py_buffer *buffer, int flags): + cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + cpython.PyBuffer_Release(buffer) + + @property + def timestamp(self): + """Union[~_numpy.uint64, int]: OUT: Timestamp in ns when this software runlist was preeempted.""" + if self._data.size == 1: + return int(self._data.timestamp[0]) + return self._data.timestamp + + @timestamp.setter + def timestamp(self, val): + self._data.timestamp = val + + @property + def time_run_total(self): + """Union[~_numpy.uint64, int]: OUT: Total time in ns this software runlist has run.""" + if self._data.size == 1: + return int(self._data.time_run_total[0]) + return self._data.time_run_total + + @time_run_total.setter + def time_run_total(self, val): + self._data.time_run_total = val + + @property + def time_run(self): + """Union[~_numpy.uint64, int]: OUT: Time in ns this software runlist ran before preemption.""" + if self._data.size == 1: + return int(self._data.time_run[0]) + return self._data.time_run + + @time_run.setter + def time_run(self, val): + self._data.time_run = val + + @property + def sw_runlist_id(self): + """Union[~_numpy.uint32, int]: OUT: Software runlist Id.""" + if self._data.size == 1: + return int(self._data.sw_runlist_id[0]) + return self._data.sw_runlist_id + + @sw_runlist_id.setter + def sw_runlist_id(self, val): + self._data.sw_runlist_id = val + + @property + def target_time_slice(self): + """Union[~_numpy.uint64, int]: OUT: The actual timeslice after deduction.""" + if self._data.size == 1: + return int(self._data.target_time_slice[0]) + return self._data.target_time_slice + + @target_time_slice.setter + def target_time_slice(self, val): + self._data.target_time_slice = val + + @property + def cumulative_preemption_time(self): + """Union[~_numpy.uint64, int]: OUT: Preemption time in ns for this SW runlist.""" + if self._data.size == 1: + return int(self._data.cumulative_preemption_time[0]) + return self._data.cumulative_preemption_time + + @cumulative_preemption_time.setter + def cumulative_preemption_time(self, val): + self._data.cumulative_preemption_time = val + + @property + def weight(self): + """Union[~_numpy.uint32, int]: OUT: Current weight of this SW runlist.""" + if self._data.size == 1: + return int(self._data.weight[0]) + return self._data.weight + + @weight.setter + def weight(self, val): + self._data.weight = val + + def __getitem__(self, key): + cdef ssize_t key_ + cdef ssize_t size + if isinstance(key, int): + key_ = key + size = self._data.size + if key_ >= size or key_ <= -(size+1): + raise IndexError("index is out of bounds") + if key_ < 0: + key_ += size + return VgpuSchedulerLogEntry_v2.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_scheduler_log_entry_v2_dtype: + return VgpuSchedulerLogEntry_v2.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerLogEntry_v2 instance with the memory from the given buffer.""" + return VgpuSchedulerLogEntry_v2.from_data(_numpy.frombuffer(buffer, dtype=vgpu_scheduler_log_entry_v2_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerLogEntry_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_scheduler_log_entry_v2_dtype` holding the data. + """ + cdef VgpuSchedulerLogEntry_v2 obj = VgpuSchedulerLogEntry_v2.__new__(VgpuSchedulerLogEntry_v2) + if not isinstance(data, _numpy.ndarray): + raise TypeError("data argument must be a NumPy ndarray") + if data.ndim != 1: + raise ValueError("data array must be 1D") + if data.dtype != vgpu_scheduler_log_entry_v2_dtype: + raise ValueError("data array must be of dtype vgpu_scheduler_log_entry_v2_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + """Create an VgpuSchedulerLogEntry_v2 instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + size (int): number of structs, default=1. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerLogEntry_v2 obj = VgpuSchedulerLogEntry_v2.__new__(VgpuSchedulerLogEntry_v2) + cdef flag = cpython.buffer.PyBUF_READ if readonly else cpython.buffer.PyBUF_WRITE + cdef object buf = cpython.memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlVgpuSchedulerLogEntry_v2_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_scheduler_log_entry_v2_dtype) + obj._data = data.view(_numpy.recarray) + + return obj + + +cdef _get_vgpu_scheduler_state_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerState_v2_t pod = nvmlVgpuSchedulerState_v2_t() + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'frequency'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.avgFactor)) - (&pod), + (&(pod.frequency)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v2_t), + }) + +vgpu_scheduler_state_v2_dtype = _get_vgpu_scheduler_state_v2_dtype_offsets() + +cdef class VgpuSchedulerState_v2: + """Empty-initialize an instance of `nvmlVgpuSchedulerState_v2_t`. + + + .. seealso:: `nvmlVgpuSchedulerState_v2_t` + """ + cdef: + nvmlVgpuSchedulerState_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerState_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerState_v2_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerState_v2 object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef VgpuSchedulerState_v2 other_ + if not isinstance(other, VgpuSchedulerState_v2): + return False + other_ = other + return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerState_v2_t)) == 0) + + def __getbuffer__(self, Py_buffer *buffer, int flags): + __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerState_v2_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = malloc(sizeof(nvmlVgpuSchedulerState_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v2") + memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerState_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def engine_id(self): + """int: IN: One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*.""" + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].engineId = val + + @property + def scheduler_policy(self): + """int: IN: Scheduler policy.""" + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def avg_factor(self): + """int: IN: Average factor in compensating the timeslice for Adaptive Round Robin mode. 0 or unspecified uses default.""" + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].avgFactor = val + + @property + def frequency(self): + """int: IN: Frequency for Adaptive Round Robin mode. 0 or unspecified uses default.""" + return self._ptr[0].frequency + + @frequency.setter + def frequency(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v2 instance is read-only") + self._ptr[0].frequency = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerState_v2 instance with the memory from the given buffer.""" + return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerState_v2_t), VgpuSchedulerState_v2) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerState_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_v2_dtype` holding the data. + """ + return __from_data(data, "vgpu_scheduler_state_v2_dtype", vgpu_scheduler_state_v2_dtype, VgpuSchedulerState_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerState_v2 instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerState_v2 obj = VgpuSchedulerState_v2.__new__(VgpuSchedulerState_v2) + if owner is None: + obj._ptr = malloc(sizeof(nvmlVgpuSchedulerState_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v2") + memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerState_v2_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + cdef _get_excluded_device_info_dtype_offsets(): cdef nvmlExcludedDeviceInfo_t pod = nvmlExcludedDeviceInfo_t() return _numpy.dtype({ @@ -19291,6 +19842,200 @@ cdef class NvlinkFirmwareInfo: return obj +cdef _get_vgpu_scheduler_log_info_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerLogInfo_v2_t pod = nvmlVgpuSchedulerLogInfo_v2_t() + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'avg_factor', 'timeslice', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, (vgpu_scheduler_log_entry_v2_dtype, 200)], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.avgFactor)) - (&pod), + (&(pod.timeslice)) - (&pod), + (&(pod.entriesCount)) - (&pod), + (&(pod.logEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), + }) + +vgpu_scheduler_log_info_v2_dtype = _get_vgpu_scheduler_log_info_v2_dtype_offsets() + +cdef class VgpuSchedulerLogInfo_v2: + """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v2_t`. + + + .. seealso:: `nvmlVgpuSchedulerLogInfo_v2_t` + """ + cdef: + nvmlVgpuSchedulerLogInfo_v2_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerLogInfo_v2_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerLogInfo_v2 object at {hex(id(self))}>" + + @property + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return (self._ptr) + + cdef intptr_t _get_ptr(self): + return (self._ptr) + + def __int__(self): + return (self._ptr) + + def __eq__(self, other): + cdef VgpuSchedulerLogInfo_v2 other_ + if not isinstance(other, VgpuSchedulerLogInfo_v2): + return False + other_ = other + return (memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) == 0) + + def __getbuffer__(self, Py_buffer *buffer, int flags): + __getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLogInfo_v2_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def log_entries(self): + """VgpuSchedulerLogEntry_v2: OUT: Structure to store the state and logs of a software runlist.""" + return VgpuSchedulerLogEntry_v2.from_ptr(&(self._ptr[0].logEntries), 200, self._readonly) + + @log_entries.setter + def log_entries(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + cdef VgpuSchedulerLogEntry_v2 val_ = val + if len(val) != 200: + raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") + memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_v2_t) * 200) + + @property + def engine_id(self): + """int: IN: Engine whose software runlist log entries are fetched. One of One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*.""" + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].engineId = val + + @property + def scheduler_policy(self): + """int: OUT: Scheduler policy.""" + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def avg_factor(self): + """int: OUT: Average factor in compensating the timeslice for Adaptive Round Robin mode.""" + return self._ptr[0].avgFactor + + @avg_factor.setter + def avg_factor(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].avgFactor = val + + @property + def timeslice(self): + """int: OUT: The timeslice in ns for each software run list as configured, or the default value otherwise.""" + return self._ptr[0].timeslice + + @timeslice.setter + def timeslice(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].timeslice = val + + @property + def entries_count(self): + """int: OUT: Count of log entries fetched.""" + return self._ptr[0].entriesCount + + @entries_count.setter + def entries_count(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") + self._ptr[0].entriesCount = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerLogInfo_v2 instance with the memory from the given buffer.""" + return __from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v2_t), VgpuSchedulerLogInfo_v2) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerLogInfo_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_info_v2_dtype` holding the data. + """ + return __from_data(data, "vgpu_scheduler_log_info_v2_dtype", vgpu_scheduler_log_info_v2_dtype, VgpuSchedulerLogInfo_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerLogInfo_v2 instance wrapping the given pointer. + + Args: + ptr (intptr_t): pointer address as Python :class:`int` to the data. + owner (object): The Python object that owns the pointer. If not provided, data will be copied. + readonly (bool): whether the data is read-only (to the user). default is `False`. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuSchedulerLogInfo_v2 obj = VgpuSchedulerLogInfo_v2.__new__(VgpuSchedulerLogInfo_v2) + if owner is None: + obj._ptr = malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + cdef _get_vgpu_instances_utilization_info_v1_dtype_offsets(): cdef nvmlVgpuInstancesUtilizationInfo_v1_t pod = nvmlVgpuInstancesUtilizationInfo_v1_t() return _numpy.dtype({ @@ -22973,6 +23718,28 @@ cpdef object device_get_compute_running_processes_v3(intptr_t device): return infos +cpdef object device_get_graphics_running_processes_v3(intptr_t device): + """Get information about processes with a graphics context on a device. + + Args: + device (intptr_t): The device handle or MIG device handle. + + .. seealso:: `nvmlDeviceGetGraphicsRunningProcesses_v3` + """ + cdef unsigned int[1] info_count = [0] + with nogil: + __status__ = nvmlDeviceGetGraphicsRunningProcesses_v3(device, info_count, NULL) + check_status_size(__status__) + cdef ProcessInfo infos = ProcessInfo(info_count[0]) + cdef nvmlProcessInfo_t *infos_ptr = (infos._get_ptr()) + if info_count[0] == 0: + return infos + with nogil: + __status__ = nvmlDeviceGetGraphicsRunningProcesses_v3(device, info_count, infos_ptr) + check_status(__status__) + return infos + + cpdef object device_get_mps_compute_running_processes_v3(intptr_t device): """Get information about processes with a Multi-Process Service (MPS) compute context on a device. @@ -24411,7 +25178,7 @@ cpdef unsigned int device_get_vgpu_capabilities(intptr_t device, int capability) cpdef str vgpu_type_get_class(unsigned int vgpu_type_id): - """Retrieve the class of a vGPU type. It will not exceed 64 characters in length (including the NUL terminator). See ``nvmlConstants.NVML_DEVICE_NAME_BUFFER_SIZE``. + """Retrieve the class of a vGPU type. It will not exceed 64 characters in length (including the NUL terminator). See nvmlConstants::NVML_DEVICE_NAME_BUFFER_SIZE. Args: vgpu_type_id (unsigned int): Handle to vGPU type. @@ -25799,6 +26566,123 @@ cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode) check_status(__status__) +cpdef device_vgpu_force_gsp_unload(intptr_t device): + """Executes a forced GSP unload operation on a device. + + Args: + device (intptr_t): The identifier of the target device. + + .. seealso:: `nvmlDeviceVgpuForceGspUnload` + """ + with nogil: + __status__ = nvmlDeviceVgpuForceGspUnload(device) + check_status(__status__) + + +cpdef object device_get_vgpu_scheduler_state_v2(intptr_t device): + """Returns the vGPU scheduler state. The information returned in ``nvmlVgpuSchedulerStateInfo_v2_t`` is not relevant if the BEST EFFORT policy is set. + + Args: + device (intptr_t): The identifier of the target ``device``. + + Returns: + nvmlVgpuSchedulerStateInfo_v2_t: Reference in which ``pSchedulerStateInfo`` is returned. + + .. seealso:: `nvmlDeviceGetVgpuSchedulerState_v2` + """ + cdef VgpuSchedulerStateInfo_v2 p_scheduler_state_info_py = VgpuSchedulerStateInfo_v2() + cdef nvmlVgpuSchedulerStateInfo_v2_t *p_scheduler_state_info = (p_scheduler_state_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetVgpuSchedulerState_v2(device, p_scheduler_state_info) + check_status(__status__) + return p_scheduler_state_info_py + + +cpdef object gpu_instance_get_vgpu_scheduler_state_v2(intptr_t gpu_instance): + """Returns the vGPU scheduler state for the given GPU instance. The information returned in ``nvmlVgpuSchedulerStateInfo_v2_t`` is not relevant if the BEST EFFORT policy is set. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + Returns: + nvmlVgpuSchedulerStateInfo_v2_t: Reference in which ``pSchedulerStateInfo`` is returned. + + .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerState_v2` + """ + cdef VgpuSchedulerStateInfo_v2 p_scheduler_state_info_py = VgpuSchedulerStateInfo_v2() + cdef nvmlVgpuSchedulerStateInfo_v2_t *p_scheduler_state_info = (p_scheduler_state_info_py._get_ptr()) + with nogil: + __status__ = nvmlGpuInstanceGetVgpuSchedulerState_v2(gpu_instance, p_scheduler_state_info) + check_status(__status__) + return p_scheduler_state_info_py + + +cpdef object device_get_vgpu_scheduler_log_v2(intptr_t device): + """Returns the vGPU Software scheduler logs for the device. ``pSchedulerLogInfo`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. + + Args: + device (intptr_t): The identifier of the target ``device``. + + Returns: + nvmlVgpuSchedulerLogInfo_v2_t: Reference in which ``pSchedulerLogInfo`` is written. + + .. seealso:: `nvmlDeviceGetVgpuSchedulerLog_v2` + """ + cdef VgpuSchedulerLogInfo_v2 p_scheduler_log_info_py = VgpuSchedulerLogInfo_v2() + cdef nvmlVgpuSchedulerLogInfo_v2_t *p_scheduler_log_info = (p_scheduler_log_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetVgpuSchedulerLog_v2(device, p_scheduler_log_info) + check_status(__status__) + return p_scheduler_log_info_py + + +cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance): + """Returns the vGPU scheduler logs for the given GPU instance. ``pSchedulerLogInfo`` points to a caller-allocated structure to contain the logs. The number of elements returned will never exceed ``NVML_SCHEDULER_SW_MAX_LOG_ENTRIES``. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + + Returns: + nvmlVgpuSchedulerLogInfo_v2_t: Reference in which ``pSchedulerLogInfo`` is written. + + .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerLog_v2` + """ + cdef VgpuSchedulerLogInfo_v2 p_scheduler_log_info_py = VgpuSchedulerLogInfo_v2() + cdef nvmlVgpuSchedulerLogInfo_v2_t *p_scheduler_log_info = (p_scheduler_log_info_py._get_ptr()) + with nogil: + __status__ = nvmlGpuInstanceGetVgpuSchedulerLog_v2(gpu_instance, p_scheduler_log_info) + check_status(__status__) + return p_scheduler_log_info_py + + +cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t 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. + + .. seealso:: `nvmlDeviceSetVgpuSchedulerState_v2` + """ + with nogil: + __status__ = nvmlDeviceSetVgpuSchedulerState_v2(device, p_scheduler_state) + check_status(__status__) + + +cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p_scheduler_state): + """Set vGPU scheduler state for the given GPU instance. + + Args: + gpu_instance (intptr_t): The GPU instance handle. + p_scheduler_state (intptr_t): Pointer to the caller-provided structure of ``nvmlVgpuSchedulerState_v2_t``. + + .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState_v2` + """ + with nogil: + __status__ = nvmlGpuInstanceSetVgpuSchedulerState_v2(gpu_instance, p_scheduler_state) + check_status(__status__) + + cpdef object system_get_topology_gpu_set(unsigned int cpuNumber): """Retrieve the set of GPUs that have a CPU affinity with the given CPU number