diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 1c7d40b3a1a..3ef2d692564 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -112,7 +112,7 @@ jobs: if-no-files-found: error - name: Build cuda.core wheel - uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" @@ -155,7 +155,7 @@ jobs: cuda-version: ${{ inputs.cuda-version }} - name: Build cuda.bindings wheel - uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 + uses: pypa/cibuildwheel@1828c10ab37f080699c7b81cea34097c684a7074 # v4.2.0 env: CIBW_BUILD: ${{ env.CIBW_BUILD }} CIBW_ARCHS_LINUX: "native" @@ -259,61 +259,6 @@ jobs: mv "/c/Program Files/Git/usr/bin/link.exe" "/c/Program Files/Git/usr/bin/link.exe.bak" fi - - name: Download and patch numpy sdist (pre-release Python) - if: ${{ startsWith(matrix.python-version, '3.15') }} - run: | - pip download --no-binary numpy --no-deps "numpy>=1.21.1" -d numpy-sdist/ - cd numpy-sdist && tar xf numpy-*.tar.gz && rm numpy-*.tar.gz - # WAR: numpy 2.4.x ships [tool.cibuildwheel] config that is - # incompatible with cibuildwheel v4.0 (cpython-freethreading enable - # group, OpenBLAS before-build scripts, etc.). Strip the cibuildwheel - # sections but preserve [tool.meson-python] (vendored meson path). - python -c " - import glob - for f in glob.glob('numpy-*/pyproject.toml'): - lines, skip = open(f).readlines(), False - out = [] - for line in lines: - hdr = line.strip() - if hdr.startswith('[tool.cibuildwheel') or hdr.startswith('[[tool.cibuildwheel'): - skip = True - continue - if skip and hdr.startswith('[') and 'cibuildwheel' not in hdr: - skip = False - if not skip: - out.append(line) - open(f, 'w').writelines(out) - " - echo "NUMPY_SRC_DIR=$(pwd)/$(ls -d numpy-*/)" >> $GITHUB_ENV - - - name: Build numpy wheel (pre-release Python) - if: ${{ startsWith(matrix.python-version, '3.15') }} - uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 - env: - CIBW_BUILD: ${{ env.CIBW_BUILD }} - CIBW_ARCHS_LINUX: "native" - CIBW_BUILD_VERBOSITY: 1 - CIBW_CONFIG_SETTINGS: "setup-args=-Dallow-noblas=true" - CIBW_CONFIG_SETTINGS_WINDOWS: "setup-args=--vsenv setup-args=-Dallow-noblas=true" - CIBW_BEFORE_BUILD_WINDOWS: "pip install delvewheel" - CIBW_REPAIR_WHEEL_COMMAND_WINDOWS: "delvewheel repair -w {dest_dir} {wheel}" - CIBW_ENABLE: "cpython-prerelease" - with: - package-dir: ${{ env.NUMPY_SRC_DIR }} - output-dir: numpy-wheel/ - - - name: Upload numpy wheel - if: ${{ startsWith(matrix.python-version, '3.15') }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 - with: - name: numpy-python${{ env.PYTHON_VERSION_FORMATTED }}-${{ inputs.host-platform }} - path: numpy-wheel/*.whl - if-no-files-found: error - - - name: Install numpy wheel - if: ${{ startsWith(matrix.python-version, '3.15') }} - run: pip install numpy-wheel/*.whl - - name: Build cuda.bindings Cython tests run: | pip install $(ls ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl)[test] diff --git a/.github/workflows/test-wheel-linux.yml b/.github/workflows/test-wheel-linux.yml index 9b74f246cbb..1556823c9b2 100644 --- a/.github/workflows/test-wheel-linux.yml +++ b/.github/workflows/test-wheel-linux.yml @@ -244,17 +244,6 @@ jobs: - name: Set up compute-sanitizer run: setup-sanitizer - - name: Download numpy wheel (pre-release Python) - if: ${{ startsWith(matrix.PY_VER, '3.15') }} - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: numpy-python${{ env.PYTHON_VERSION_FORMATTED }}-${{ inputs.host-platform }} - path: numpy-wheel - - - name: Install numpy wheel (pre-release Python) - if: ${{ startsWith(matrix.PY_VER, '3.15') }} - run: pip install numpy-wheel/*.whl - - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: diff --git a/.github/workflows/test-wheel-windows.yml b/.github/workflows/test-wheel-windows.yml index 2b401167356..2fe2fee8f46 100644 --- a/.github/workflows/test-wheel-windows.yml +++ b/.github/workflows/test-wheel-windows.yml @@ -228,18 +228,6 @@ jobs: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ matrix.CUDA_VER }} - - name: Download numpy wheel (pre-release Python) - if: ${{ startsWith(matrix.PY_VER, '3.15') }} - uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 - with: - name: numpy-python${{ env.PYTHON_VERSION_FORMATTED }}-${{ inputs.host-platform }} - path: numpy-wheel - - - name: Install numpy wheel (pre-release Python) - if: ${{ startsWith(matrix.PY_VER, '3.15') }} - shell: bash --noprofile --norc -xeuo pipefail {0} - run: pip install numpy-wheel/*.whl - - name: Run cuda.bindings tests if: ${{ env.SKIP_CUDA_BINDINGS_TEST == '0' }} env: diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd b/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd index b712a3087b8..4eadeab01c8 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b52d99b7f07615d6c5ecb869a5c632e6e9cb4d0cb4f6cb1e43977d29ecd9995c +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4fc8b05be8a1a25737a1940a53339f6af3b7a1d4e513558109aaac48b3222681 from ..cynvfatbin cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx index d4c54124e52..937878b5a15 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7d6e928f56af8543c123889e5337a34f9270cbd554c699a8e013f720362988c1 +# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6b42b70b945f3898a53f87261fcdb5a688cb9ab93476427781e1838a3ffffaf9 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx index 272cc3b0fbf..03453560c4e 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5af6a32f057cc5814e89a97c876285101fa636ac38928e7d11b7ada35db98a91 +# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4f4711d1bf4600663e9a7958c75666ad7c7785248afdef1c701d58c78ce81bfe # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index 4a391792fd0..bb1419ae946 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8bcbd5ba3e12e16d974e141ec43ddce440ac7c84e5aaa746607daa43557f54fb +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f54caf5830f0b76772ca6e06487bc94eef354c725f6e6f3c908b993860ba6787 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 1469d9ea9e9..4c21693caf7 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3088e90760487963484f2cb5230ddc1177d3a1b6d89213f9f368e8eec4a57eb8 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a286ec6ed7fcdd0d82d6624d68c700cc3678e1e26f3ba1243df518cdeea5a992 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index f6eb942a5dd..9ce2fc111be 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=50c5a9ae5e2cdd364766f02b98517d019e582ea862643113d20416393e76dfe6 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=eef6c33c425f24828307c7fc62c45dcdd8b98e5dd47be467709f64eadfd432b2 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvml.pxd b/cuda_bindings/cuda/bindings/_internal/nvml.pxd index 272a77d24db..11504e0f41d 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvml.pxd @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# 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=c2cc3cd086b5aeea5fad7ca17600d0102691a3cb354b916f5c086c383d77df19 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=25a9a64fc7aed96ba4ab9be2bd7b2c8c2b464e7d8fb7dab7b2dd85b32da0efe3 from ..cynvml cimport * @@ -367,3 +367,18 @@ cdef nvmlReturn_t _nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETU cdef nvmlReturn_t _nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetAdaptiveTgpMode_v1(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetAdaptiveTgpModeInfo_v1(nvmlDevice_t device, nvmlAdaptiveTgpModeInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetMemoryLimits_v1(nvmlDevice_t device, nvmlSetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetMemoryLimits_v1(nvmlDevice_t device, nvmlGetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfo_v4(nvmlDevice_t device, nvmlGpuFabricInfo_v4_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDevicePerfMetricsGetSamples_v1(nvmlDevice_t device, nvmlPerfMetricsSamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwModeAsync_v1(nvmlDevice_t device, nvmlNvlinkSetBwModeAsync_v1_t* setBwModeAsync) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkTelemetrySamples_v1(nvmlDevice_t device, nvmlNvlinkTelemetrySamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetRegisterGpuOperationalEvents_v1(nvmlEventSet_t eventSet, const nvmlGpuOperationalEventConfig_v1_t* config) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetWait_v3(nvmlEventSet_t set, nvmlEventSetWait_v3_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, nvmlEventSetGetContextCount_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, nvmlEventSetGetContextInfo_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetContextData_v1(nvmlEventSet_t set, nvmlEventSetGetContextData_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlEccBankRemapperStatus_v1_t* pBankRemapperStatus) 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 3ac1218e8c3..ab251a57fe1 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0f1c15a761a6c0fbd8dd543ce35fa436cc64eadee9d7018f9eca3869d2ead415 +# 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=77c516adfddaab32e14f7d0bf80b78c33d928198af0be5ea18ec7b880c9c09c9 # <<<< PREAMBLE CONTENT >>>> @@ -419,6 +419,21 @@ cdef void* __nvmlSystemGetCPER_v1 = NULL cdef void* __nvmlDeviceGetBBXTimeData_v1 = NULL cdef void* __nvmlDeviceGetAccountingStats_v2 = NULL cdef void* __nvmlDeviceGetRemappedRows_v2 = NULL +cdef void* __nvmlDeviceSetAdaptiveTgpMode_v1 = NULL +cdef void* __nvmlDeviceGetAdaptiveTgpModeInfo_v1 = NULL +cdef void* __nvmlDeviceSetMemoryLimits_v1 = NULL +cdef void* __nvmlDeviceGetMemoryLimits_v1 = NULL +cdef void* __nvmlDeviceGetGpuFabricInfo_v4 = NULL +cdef void* __nvmlDevicePerfMetricsGetSamples_v1 = NULL +cdef void* __nvmlDeviceSetNvlinkBwModeAsync_v1 = NULL +cdef void* __nvmlDeviceGetNvLinkTelemetrySamples_v1 = NULL +cdef void* __nvmlEventSetRegisterGpuOperationalEvents_v1 = NULL +cdef void* __nvmlEventSetWait_v3 = NULL +cdef void* __nvmlEventSetGetContextCount_v1 = NULL +cdef void* __nvmlEventSetGetContextInfo_v1 = NULL +cdef void* __nvmlEventSetGetContextData_v1 = NULL +cdef void* __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 = NULL +cdef void* __nvmlDeviceGetBankRemapperStatus_v1 = NULL cdef int _init_nvml() except -1 nogil: global _cyb___py_nvml_init @@ -2911,6 +2926,111 @@ cdef int _init_nvml() except -1 nogil: handle = load_library() __nvmlDeviceGetRemappedRows_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetRemappedRows_v2') + global __nvmlDeviceSetAdaptiveTgpMode_v1 + __nvmlDeviceSetAdaptiveTgpMode_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetAdaptiveTgpMode_v1') + if __nvmlDeviceSetAdaptiveTgpMode_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetAdaptiveTgpMode_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetAdaptiveTgpMode_v1') + + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + __nvmlDeviceGetAdaptiveTgpModeInfo_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAdaptiveTgpModeInfo_v1') + if __nvmlDeviceGetAdaptiveTgpModeInfo_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAdaptiveTgpModeInfo_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetAdaptiveTgpModeInfo_v1') + + global __nvmlDeviceSetMemoryLimits_v1 + __nvmlDeviceSetMemoryLimits_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetMemoryLimits_v1') + if __nvmlDeviceSetMemoryLimits_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetMemoryLimits_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetMemoryLimits_v1') + + global __nvmlDeviceGetMemoryLimits_v1 + __nvmlDeviceGetMemoryLimits_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetMemoryLimits_v1') + if __nvmlDeviceGetMemoryLimits_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetMemoryLimits_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetMemoryLimits_v1') + + global __nvmlDeviceGetGpuFabricInfo_v4 + __nvmlDeviceGetGpuFabricInfo_v4 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuFabricInfo_v4') + if __nvmlDeviceGetGpuFabricInfo_v4 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuFabricInfo_v4 = _cyb_dlsym(handle, 'nvmlDeviceGetGpuFabricInfo_v4') + + global __nvmlDevicePerfMetricsGetSamples_v1 + __nvmlDevicePerfMetricsGetSamples_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDevicePerfMetricsGetSamples_v1') + if __nvmlDevicePerfMetricsGetSamples_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDevicePerfMetricsGetSamples_v1 = _cyb_dlsym(handle, 'nvmlDevicePerfMetricsGetSamples_v1') + + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + __nvmlDeviceSetNvlinkBwModeAsync_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetNvlinkBwModeAsync_v1') + if __nvmlDeviceSetNvlinkBwModeAsync_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetNvlinkBwModeAsync_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetNvlinkBwModeAsync_v1') + + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + __nvmlDeviceGetNvLinkTelemetrySamples_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkTelemetrySamples_v1') + if __nvmlDeviceGetNvLinkTelemetrySamples_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkTelemetrySamples_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkTelemetrySamples_v1') + + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + __nvmlEventSetRegisterGpuOperationalEvents_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetRegisterGpuOperationalEvents_v1') + if __nvmlEventSetRegisterGpuOperationalEvents_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetRegisterGpuOperationalEvents_v1 = _cyb_dlsym(handle, 'nvmlEventSetRegisterGpuOperationalEvents_v1') + + global __nvmlEventSetWait_v3 + __nvmlEventSetWait_v3 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetWait_v3') + if __nvmlEventSetWait_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetWait_v3 = _cyb_dlsym(handle, 'nvmlEventSetWait_v3') + + global __nvmlEventSetGetContextCount_v1 + __nvmlEventSetGetContextCount_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetGetContextCount_v1') + if __nvmlEventSetGetContextCount_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetGetContextCount_v1 = _cyb_dlsym(handle, 'nvmlEventSetGetContextCount_v1') + + global __nvmlEventSetGetContextInfo_v1 + __nvmlEventSetGetContextInfo_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetGetContextInfo_v1') + if __nvmlEventSetGetContextInfo_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetGetContextInfo_v1 = _cyb_dlsym(handle, 'nvmlEventSetGetContextInfo_v1') + + global __nvmlEventSetGetContextData_v1 + __nvmlEventSetGetContextData_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetGetContextData_v1') + if __nvmlEventSetGetContextData_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetGetContextData_v1 = _cyb_dlsym(handle, 'nvmlEventSetGetContextData_v1') + + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1') + if __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 = _cyb_dlsym(handle, 'nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1') + + global __nvmlDeviceGetBankRemapperStatus_v1 + __nvmlDeviceGetBankRemapperStatus_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBankRemapperStatus_v1') + if __nvmlDeviceGetBankRemapperStatus_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBankRemapperStatus_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetBankRemapperStatus_v1') + _cyb_atomic_int_store(&_cyb___py_nvml_init, 1) return 0 @@ -3992,6 +4112,51 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetRemappedRows_v2 data["__nvmlDeviceGetRemappedRows_v2"] = __nvmlDeviceGetRemappedRows_v2 + + global __nvmlDeviceSetAdaptiveTgpMode_v1 + data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = __nvmlDeviceSetAdaptiveTgpMode_v1 + + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + + global __nvmlDeviceSetMemoryLimits_v1 + data["__nvmlDeviceSetMemoryLimits_v1"] = __nvmlDeviceSetMemoryLimits_v1 + + global __nvmlDeviceGetMemoryLimits_v1 + data["__nvmlDeviceGetMemoryLimits_v1"] = __nvmlDeviceGetMemoryLimits_v1 + + global __nvmlDeviceGetGpuFabricInfo_v4 + data["__nvmlDeviceGetGpuFabricInfo_v4"] = __nvmlDeviceGetGpuFabricInfo_v4 + + global __nvmlDevicePerfMetricsGetSamples_v1 + data["__nvmlDevicePerfMetricsGetSamples_v1"] = __nvmlDevicePerfMetricsGetSamples_v1 + + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = __nvmlDeviceSetNvlinkBwModeAsync_v1 + + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = __nvmlDeviceGetNvLinkTelemetrySamples_v1 + + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = __nvmlEventSetRegisterGpuOperationalEvents_v1 + + global __nvmlEventSetWait_v3 + data["__nvmlEventSetWait_v3"] = __nvmlEventSetWait_v3 + + global __nvmlEventSetGetContextCount_v1 + data["__nvmlEventSetGetContextCount_v1"] = __nvmlEventSetGetContextCount_v1 + + global __nvmlEventSetGetContextInfo_v1 + data["__nvmlEventSetGetContextInfo_v1"] = __nvmlEventSetGetContextInfo_v1 + + global __nvmlEventSetGetContextData_v1 + data["__nvmlEventSetGetContextData_v1"] = __nvmlEventSetGetContextData_v1 + + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + + global __nvmlDeviceGetBankRemapperStatus_v1 + data["__nvmlDeviceGetBankRemapperStatus_v1"] = __nvmlDeviceGetBankRemapperStatus_v1 _cyb_func_ptrs = data return data @@ -7562,3 +7727,153 @@ cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappe raise FunctionNotFoundError("function nvmlDeviceGetRemappedRows_v2 is not found") return (__nvmlDeviceGetRemappedRows_v2)( device, info) + + +cdef nvmlReturn_t _nvmlDeviceSetAdaptiveTgpMode_v1(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAdaptiveTgpMode_v1 + _check_or_init_nvml() + if __nvmlDeviceSetAdaptiveTgpMode_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAdaptiveTgpMode_v1 is not found") + return (__nvmlDeviceSetAdaptiveTgpMode_v1)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetAdaptiveTgpModeInfo_v1(nvmlDevice_t device, nvmlAdaptiveTgpModeInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + _check_or_init_nvml() + if __nvmlDeviceGetAdaptiveTgpModeInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAdaptiveTgpModeInfo_v1 is not found") + return (__nvmlDeviceGetAdaptiveTgpModeInfo_v1)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceSetMemoryLimits_v1(nvmlDevice_t device, nvmlSetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetMemoryLimits_v1 + _check_or_init_nvml() + if __nvmlDeviceSetMemoryLimits_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetMemoryLimits_v1 is not found") + return (__nvmlDeviceSetMemoryLimits_v1)( + device, limits) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryLimits_v1(nvmlDevice_t device, nvmlGetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryLimits_v1 + _check_or_init_nvml() + if __nvmlDeviceGetMemoryLimits_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryLimits_v1 is not found") + return (__nvmlDeviceGetMemoryLimits_v1)( + device, limits) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfo_v4(nvmlDevice_t device, nvmlGpuFabricInfo_v4_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuFabricInfo_v4 + _check_or_init_nvml() + if __nvmlDeviceGetGpuFabricInfo_v4 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuFabricInfo_v4 is not found") + return (__nvmlDeviceGetGpuFabricInfo_v4)( + device, gpuFabricInfo) + + +cdef nvmlReturn_t _nvmlDevicePerfMetricsGetSamples_v1(nvmlDevice_t device, nvmlPerfMetricsSamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePerfMetricsGetSamples_v1 + _check_or_init_nvml() + if __nvmlDevicePerfMetricsGetSamples_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePerfMetricsGetSamples_v1 is not found") + return (__nvmlDevicePerfMetricsGetSamples_v1)( + device, samples) + + +cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwModeAsync_v1(nvmlDevice_t device, nvmlNvlinkSetBwModeAsync_v1_t* setBwModeAsync) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + _check_or_init_nvml() + if __nvmlDeviceSetNvlinkBwModeAsync_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvlinkBwModeAsync_v1 is not found") + return (__nvmlDeviceSetNvlinkBwModeAsync_v1)( + device, setBwModeAsync) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkTelemetrySamples_v1(nvmlDevice_t device, nvmlNvlinkTelemetrySamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkTelemetrySamples_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkTelemetrySamples_v1 is not found") + return (__nvmlDeviceGetNvLinkTelemetrySamples_v1)( + device, samples) + + +cdef nvmlReturn_t _nvmlEventSetRegisterGpuOperationalEvents_v1(nvmlEventSet_t eventSet, const nvmlGpuOperationalEventConfig_v1_t* config) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + _check_or_init_nvml() + if __nvmlEventSetRegisterGpuOperationalEvents_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetRegisterGpuOperationalEvents_v1 is not found") + return (__nvmlEventSetRegisterGpuOperationalEvents_v1)( + eventSet, config) + + +cdef nvmlReturn_t _nvmlEventSetWait_v3(nvmlEventSet_t set, nvmlEventSetWait_v3_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetWait_v3 + _check_or_init_nvml() + if __nvmlEventSetWait_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetWait_v3 is not found") + return (__nvmlEventSetWait_v3)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, nvmlEventSetGetContextCount_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetContextCount_v1 + _check_or_init_nvml() + if __nvmlEventSetGetContextCount_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetContextCount_v1 is not found") + return (__nvmlEventSetGetContextCount_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, nvmlEventSetGetContextInfo_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetContextInfo_v1 + _check_or_init_nvml() + if __nvmlEventSetGetContextInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetContextInfo_v1 is not found") + return (__nvmlEventSetGetContextInfo_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetContextData_v1(nvmlEventSet_t set, nvmlEventSetGetContextData_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetContextData_v1 + _check_or_init_nvml() + if __nvmlEventSetGetContextData_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetContextData_v1 is not found") + return (__nvmlEventSetGetContextData_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + _check_or_init_nvml() + if __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 is not found") + return (__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlEccBankRemapperStatus_v1_t* pBankRemapperStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBankRemapperStatus_v1 + _check_or_init_nvml() + if __nvmlDeviceGetBankRemapperStatus_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBankRemapperStatus_v1 is not found") + return (__nvmlDeviceGetBankRemapperStatus_v1)( + device, pBankRemapperStatus) diff --git a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx index 14462225e14..e5a7cf53a78 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=dfef5d61e23406c9104db88966dea7813becf53ad5e89fca63b78d618097e15a +# 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=5e4dabf79550bbf99149a55b67542f1b6bf20a48f3dbfd922848c16115418f5e # <<<< PREAMBLE CONTENT >>>> @@ -419,6 +419,21 @@ cdef void* __nvmlSystemGetCPER_v1 = NULL cdef void* __nvmlDeviceGetBBXTimeData_v1 = NULL cdef void* __nvmlDeviceGetAccountingStats_v2 = NULL cdef void* __nvmlDeviceGetRemappedRows_v2 = NULL +cdef void* __nvmlDeviceSetAdaptiveTgpMode_v1 = NULL +cdef void* __nvmlDeviceGetAdaptiveTgpModeInfo_v1 = NULL +cdef void* __nvmlDeviceSetMemoryLimits_v1 = NULL +cdef void* __nvmlDeviceGetMemoryLimits_v1 = NULL +cdef void* __nvmlDeviceGetGpuFabricInfo_v4 = NULL +cdef void* __nvmlDevicePerfMetricsGetSamples_v1 = NULL +cdef void* __nvmlDeviceSetNvlinkBwModeAsync_v1 = NULL +cdef void* __nvmlDeviceGetNvLinkTelemetrySamples_v1 = NULL +cdef void* __nvmlEventSetRegisterGpuOperationalEvents_v1 = NULL +cdef void* __nvmlEventSetWait_v3 = NULL +cdef void* __nvmlEventSetGetContextCount_v1 = NULL +cdef void* __nvmlEventSetGetContextInfo_v1 = NULL +cdef void* __nvmlEventSetGetContextData_v1 = NULL +cdef void* __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 = NULL +cdef void* __nvmlDeviceGetBankRemapperStatus_v1 = NULL cdef int _init_nvml() except -1 nogil: global _cyb___py_nvml_init @@ -1494,6 +1509,51 @@ cdef int _init_nvml() except -1 nogil: global __nvmlDeviceGetRemappedRows_v2 __nvmlDeviceGetRemappedRows_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetRemappedRows_v2') + global __nvmlDeviceSetAdaptiveTgpMode_v1 + __nvmlDeviceSetAdaptiveTgpMode_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetAdaptiveTgpMode_v1') + + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + __nvmlDeviceGetAdaptiveTgpModeInfo_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAdaptiveTgpModeInfo_v1') + + global __nvmlDeviceSetMemoryLimits_v1 + __nvmlDeviceSetMemoryLimits_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetMemoryLimits_v1') + + global __nvmlDeviceGetMemoryLimits_v1 + __nvmlDeviceGetMemoryLimits_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetMemoryLimits_v1') + + global __nvmlDeviceGetGpuFabricInfo_v4 + __nvmlDeviceGetGpuFabricInfo_v4 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuFabricInfo_v4') + + global __nvmlDevicePerfMetricsGetSamples_v1 + __nvmlDevicePerfMetricsGetSamples_v1 = _cyb_GetProcAddress(handle, 'nvmlDevicePerfMetricsGetSamples_v1') + + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + __nvmlDeviceSetNvlinkBwModeAsync_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetNvlinkBwModeAsync_v1') + + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + __nvmlDeviceGetNvLinkTelemetrySamples_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkTelemetrySamples_v1') + + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + __nvmlEventSetRegisterGpuOperationalEvents_v1 = _cyb_GetProcAddress(handle, 'nvmlEventSetRegisterGpuOperationalEvents_v1') + + global __nvmlEventSetWait_v3 + __nvmlEventSetWait_v3 = _cyb_GetProcAddress(handle, 'nvmlEventSetWait_v3') + + global __nvmlEventSetGetContextCount_v1 + __nvmlEventSetGetContextCount_v1 = _cyb_GetProcAddress(handle, 'nvmlEventSetGetContextCount_v1') + + global __nvmlEventSetGetContextInfo_v1 + __nvmlEventSetGetContextInfo_v1 = _cyb_GetProcAddress(handle, 'nvmlEventSetGetContextInfo_v1') + + global __nvmlEventSetGetContextData_v1 + __nvmlEventSetGetContextData_v1 = _cyb_GetProcAddress(handle, 'nvmlEventSetGetContextData_v1') + + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 = _cyb_GetProcAddress(handle, 'nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1') + + global __nvmlDeviceGetBankRemapperStatus_v1 + __nvmlDeviceGetBankRemapperStatus_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBankRemapperStatus_v1') + _cyb_atomic_int_store(&_cyb___py_nvml_init, 1) return 0 @@ -2575,6 +2635,51 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetRemappedRows_v2 data["__nvmlDeviceGetRemappedRows_v2"] = __nvmlDeviceGetRemappedRows_v2 + + global __nvmlDeviceSetAdaptiveTgpMode_v1 + data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = __nvmlDeviceSetAdaptiveTgpMode_v1 + + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + + global __nvmlDeviceSetMemoryLimits_v1 + data["__nvmlDeviceSetMemoryLimits_v1"] = __nvmlDeviceSetMemoryLimits_v1 + + global __nvmlDeviceGetMemoryLimits_v1 + data["__nvmlDeviceGetMemoryLimits_v1"] = __nvmlDeviceGetMemoryLimits_v1 + + global __nvmlDeviceGetGpuFabricInfo_v4 + data["__nvmlDeviceGetGpuFabricInfo_v4"] = __nvmlDeviceGetGpuFabricInfo_v4 + + global __nvmlDevicePerfMetricsGetSamples_v1 + data["__nvmlDevicePerfMetricsGetSamples_v1"] = __nvmlDevicePerfMetricsGetSamples_v1 + + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = __nvmlDeviceSetNvlinkBwModeAsync_v1 + + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = __nvmlDeviceGetNvLinkTelemetrySamples_v1 + + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = __nvmlEventSetRegisterGpuOperationalEvents_v1 + + global __nvmlEventSetWait_v3 + data["__nvmlEventSetWait_v3"] = __nvmlEventSetWait_v3 + + global __nvmlEventSetGetContextCount_v1 + data["__nvmlEventSetGetContextCount_v1"] = __nvmlEventSetGetContextCount_v1 + + global __nvmlEventSetGetContextInfo_v1 + data["__nvmlEventSetGetContextInfo_v1"] = __nvmlEventSetGetContextInfo_v1 + + global __nvmlEventSetGetContextData_v1 + data["__nvmlEventSetGetContextData_v1"] = __nvmlEventSetGetContextData_v1 + + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + + global __nvmlDeviceGetBankRemapperStatus_v1 + data["__nvmlDeviceGetBankRemapperStatus_v1"] = __nvmlDeviceGetBankRemapperStatus_v1 _cyb_func_ptrs = data return data @@ -6144,3 +6249,153 @@ cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappe raise FunctionNotFoundError("function nvmlDeviceGetRemappedRows_v2 is not found") return (__nvmlDeviceGetRemappedRows_v2)( device, info) + + +cdef nvmlReturn_t _nvmlDeviceSetAdaptiveTgpMode_v1(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetAdaptiveTgpMode_v1 + _check_or_init_nvml() + if __nvmlDeviceSetAdaptiveTgpMode_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetAdaptiveTgpMode_v1 is not found") + return (__nvmlDeviceSetAdaptiveTgpMode_v1)( + device, mode) + + +cdef nvmlReturn_t _nvmlDeviceGetAdaptiveTgpModeInfo_v1(nvmlDevice_t device, nvmlAdaptiveTgpModeInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + _check_or_init_nvml() + if __nvmlDeviceGetAdaptiveTgpModeInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAdaptiveTgpModeInfo_v1 is not found") + return (__nvmlDeviceGetAdaptiveTgpModeInfo_v1)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceSetMemoryLimits_v1(nvmlDevice_t device, nvmlSetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetMemoryLimits_v1 + _check_or_init_nvml() + if __nvmlDeviceSetMemoryLimits_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetMemoryLimits_v1 is not found") + return (__nvmlDeviceSetMemoryLimits_v1)( + device, limits) + + +cdef nvmlReturn_t _nvmlDeviceGetMemoryLimits_v1(nvmlDevice_t device, nvmlGetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetMemoryLimits_v1 + _check_or_init_nvml() + if __nvmlDeviceGetMemoryLimits_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetMemoryLimits_v1 is not found") + return (__nvmlDeviceGetMemoryLimits_v1)( + device, limits) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuFabricInfo_v4(nvmlDevice_t device, nvmlGpuFabricInfo_v4_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuFabricInfo_v4 + _check_or_init_nvml() + if __nvmlDeviceGetGpuFabricInfo_v4 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuFabricInfo_v4 is not found") + return (__nvmlDeviceGetGpuFabricInfo_v4)( + device, gpuFabricInfo) + + +cdef nvmlReturn_t _nvmlDevicePerfMetricsGetSamples_v1(nvmlDevice_t device, nvmlPerfMetricsSamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDevicePerfMetricsGetSamples_v1 + _check_or_init_nvml() + if __nvmlDevicePerfMetricsGetSamples_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDevicePerfMetricsGetSamples_v1 is not found") + return (__nvmlDevicePerfMetricsGetSamples_v1)( + device, samples) + + +cdef nvmlReturn_t _nvmlDeviceSetNvlinkBwModeAsync_v1(nvmlDevice_t device, nvmlNvlinkSetBwModeAsync_v1_t* setBwModeAsync) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + _check_or_init_nvml() + if __nvmlDeviceSetNvlinkBwModeAsync_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvlinkBwModeAsync_v1 is not found") + return (__nvmlDeviceSetNvlinkBwModeAsync_v1)( + device, setBwModeAsync) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkTelemetrySamples_v1(nvmlDevice_t device, nvmlNvlinkTelemetrySamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkTelemetrySamples_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkTelemetrySamples_v1 is not found") + return (__nvmlDeviceGetNvLinkTelemetrySamples_v1)( + device, samples) + + +cdef nvmlReturn_t _nvmlEventSetRegisterGpuOperationalEvents_v1(nvmlEventSet_t eventSet, const nvmlGpuOperationalEventConfig_v1_t* config) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + _check_or_init_nvml() + if __nvmlEventSetRegisterGpuOperationalEvents_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetRegisterGpuOperationalEvents_v1 is not found") + return (__nvmlEventSetRegisterGpuOperationalEvents_v1)( + eventSet, config) + + +cdef nvmlReturn_t _nvmlEventSetWait_v3(nvmlEventSet_t set, nvmlEventSetWait_v3_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetWait_v3 + _check_or_init_nvml() + if __nvmlEventSetWait_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetWait_v3 is not found") + return (__nvmlEventSetWait_v3)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, nvmlEventSetGetContextCount_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetContextCount_v1 + _check_or_init_nvml() + if __nvmlEventSetGetContextCount_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetContextCount_v1 is not found") + return (__nvmlEventSetGetContextCount_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, nvmlEventSetGetContextInfo_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetContextInfo_v1 + _check_or_init_nvml() + if __nvmlEventSetGetContextInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetContextInfo_v1 is not found") + return (__nvmlEventSetGetContextInfo_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetContextData_v1(nvmlEventSet_t set, nvmlEventSetGetContextData_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetContextData_v1 + _check_or_init_nvml() + if __nvmlEventSetGetContextData_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetContextData_v1 is not found") + return (__nvmlEventSetGetContextData_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + _check_or_init_nvml() + if __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 is not found") + return (__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1)( + set, params) + + +cdef nvmlReturn_t _nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlEccBankRemapperStatus_v1_t* pBankRemapperStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBankRemapperStatus_v1 + _check_or_init_nvml() + if __nvmlDeviceGetBankRemapperStatus_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBankRemapperStatus_v1 is not found") + return (__nvmlDeviceGetBankRemapperStatus_v1)( + device, pBankRemapperStatus) diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd index e4ac3cf1258..5b9abafa5df 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a27b041eb470b98bf5b1a0a92ace9467c5f3921d47ee10557a4f00ff1e4ac411 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6be47c668a3a1086937075cb5f4798941232ec81027841b98ee6ca66c277ff0c from ..cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index 9ca6695547c..39329bc9b64 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5d1c4358f6dd269e4a5313c7a717acafaebf90ab58acc30002affa060c8389b4 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cf645e79d2d72cd4c10d5f4fcd6bab245f292559ac432180554c0d944aa03dae # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index bebeae150a7..047c99f2b9f 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fb154012a5a055db532eb391202398888c164eb266582ebc67ce3b5f8eb2c485 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d826369ce197164240eae2ca22bc88bb193a3ec936946b9d3b5b906b503fb446 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pxd b/cuda_bindings/cuda/bindings/cynvfatbin.pxd index 503520b21c6..b61707a47c8 100644 --- a/cuda_bindings/cuda/bindings/cynvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/cynvfatbin.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. @@ -11,7 +11,7 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=98d5f975bf907917386bb6f6ef0dd0f6dc1a52c8068be876935a0a80554a8d8e +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4eaac7021af14308210cbd9dd8bf938f0b09d395ef079368750627da493fa06e ctypedef enum nvFatbinResult "nvFatbinResult": NVFATBIN_SUCCESS "NVFATBIN_SUCCESS" = 0 NVFATBIN_ERROR_INTERNAL "NVFATBIN_ERROR_INTERNAL" diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pyx b/cuda_bindings/cuda/bindings/cynvfatbin.pyx index 86bdd89f0f3..a943e7bbf01 100644 --- a/cuda_bindings/cuda/bindings/cynvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/cynvfatbin.pyx @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bae30bbdaff2009b86c05de2a46bbaecad9e63327c93a10b6f2e8a2d95fd6a60 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ac4e507008fec5a9a6963e6539b4a783ca1908452fc4bdb300119af7a1312ff0 from ._internal cimport nvfatbin as _nvfatbin diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index 6a93bc269de..1c240342c91 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. @@ -11,7 +11,7 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d5650f46aa9baca8a379aa5dece6b9069474ad81e53b0af898fe89e0095f4e8f +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7bd3a5876758225a37a98b496a1423047d3a446a4a0956ebc11b17f0abe2128a # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index ecf4cafbaf8..0359f23f216 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7618d44448c6e1142afb5ad6cb3b7e15e1d775705ff4aaadbb8fe8744cccb1a4 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3abd933ead70f75181084a0ac8ea01c523839c18b93820a2c560e9b945de6d3e # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/cynvml.pxd b/cuda_bindings/cuda/bindings/cynvml.pxd index 9b2cd749775..780241c5a3a 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pxd +++ b/cuda_bindings/cuda/bindings/cynvml.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.4.1. Do not modify it directly. @@ -11,7 +11,7 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=54d380973e59fbf316058a81b2026313f3564008841e322dd7dc3c7915e4ee87 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=60a5b20aeb8f2f1b807c72675995ed6bf5943e58f3b9ab24933f51d4a7246f6f ctypedef enum nvmlBridgeChipType_t "nvmlBridgeChipType_t": NVML_BRIDGE_CHIP_PLX "NVML_BRIDGE_CHIP_PLX" = 0 NVML_BRIDGE_CHIP_BRO4 "NVML_BRIDGE_CHIP_BRO4" = 1 @@ -197,7 +197,10 @@ ctypedef enum nvmlBrandType_t "nvmlBrandType_t": NVML_BRAND_NVIDIA "NVML_BRAND_NVIDIA" = 14 NVML_BRAND_GEFORCE_RTX "NVML_BRAND_GEFORCE_RTX" = 15 NVML_BRAND_TITAN_RTX "NVML_BRAND_TITAN_RTX" = 16 - NVML_BRAND_COUNT "NVML_BRAND_COUNT" = 18 + NVML_BRAND_NVIDIA_DLA "NVML_BRAND_NVIDIA_DLA" = 17 + NVML_BRAND_NVIDIA_VGAMEDEV "NVML_BRAND_NVIDIA_VGAMEDEV" = 18 + NVML_BRAND_NVIDIA_NPU "NVML_BRAND_NVIDIA_NPU" = 19 + NVML_BRAND_COUNT "NVML_BRAND_COUNT" = 20 ctypedef enum nvmlTemperatureThresholds_t "nvmlTemperatureThresholds_t": NVML_TEMPERATURE_THRESHOLD_SHUTDOWN "NVML_TEMPERATURE_THRESHOLD_SHUTDOWN" = 0 @@ -212,6 +215,7 @@ ctypedef enum nvmlTemperatureThresholds_t "nvmlTemperatureThresholds_t": ctypedef enum nvmlTemperatureSensors_t "nvmlTemperatureSensors_t": NVML_TEMPERATURE_GPU "NVML_TEMPERATURE_GPU" = 0 + NVML_TEMPERATURE_GPU_MAX "NVML_TEMPERATURE_GPU_MAX" = 1 NVML_TEMPERATURE_COUNT "NVML_TEMPERATURE_COUNT" ctypedef enum nvmlComputeMode_t "nvmlComputeMode_t": @@ -381,6 +385,7 @@ ctypedef enum nvmlGridLicenseFeatureCode_t "nvmlGridLicenseFeatureCode_t": NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION "NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION" = NVML_GRID_LICENSE_FEATURE_CODE_NVIDIA_RTX NVML_GRID_LICENSE_FEATURE_CODE_GAMING "NVML_GRID_LICENSE_FEATURE_CODE_GAMING" = 3 NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE "NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE" = 4 + NVML_GRID_LICENSE_FEATURE_CODE_VGAMEDEV "NVML_GRID_LICENSE_FEATURE_CODE_VGAMEDEV" = 5 ctypedef enum nvmlVgpuCapability_t "nvmlVgpuCapability_t": NVML_VGPU_CAP_NVLINK_P2P "NVML_VGPU_CAP_NVLINK_P2P" = 0 @@ -417,6 +422,8 @@ ctypedef enum nvmlDeviceGpuRecoveryAction_t "nvmlDeviceGpuRecoveryAction_t": NVML_GPU_RECOVERY_ACTION_DRAIN_P2P "NVML_GPU_RECOVERY_ACTION_DRAIN_P2P" = 3 NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET "NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET" = 4 NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN "NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN" = 5 + NVML_GPU_RECOVERY_ACTION_BUS_RESET "NVML_GPU_RECOVERY_ACTION_BUS_RESET" = 6 + NVML_GPU_RECOVERY_ACTION_SYSTEM_REBOOT "NVML_GPU_RECOVERY_ACTION_SYSTEM_REBOOT" = 7 ctypedef enum nvmlFanState_t "nvmlFanState_t": NVML_FAN_NORMAL "NVML_FAN_NORMAL" = 0 @@ -769,7 +776,151 @@ ctypedef enum nvmlGpmMetricId_t "nvmlGpmMetricId_t": NVML_GPM_METRIC_NVLINK_L34_TX "NVML_GPM_METRIC_NVLINK_L34_TX" = 330 NVML_GPM_METRIC_NVLINK_L35_RX "NVML_GPM_METRIC_NVLINK_L35_RX" = 331 NVML_GPM_METRIC_NVLINK_L35_TX "NVML_GPM_METRIC_NVLINK_L35_TX" = 332 - NVML_GPM_METRIC_MAX "NVML_GPM_METRIC_MAX" = 333 + NVML_GPM_METRIC_NVLINK_L36_RX "NVML_GPM_METRIC_NVLINK_L36_RX" = 333 + NVML_GPM_METRIC_NVLINK_L36_TX "NVML_GPM_METRIC_NVLINK_L36_TX" = 334 + NVML_GPM_METRIC_NVLINK_L37_RX "NVML_GPM_METRIC_NVLINK_L37_RX" = 335 + NVML_GPM_METRIC_NVLINK_L37_TX "NVML_GPM_METRIC_NVLINK_L37_TX" = 336 + NVML_GPM_METRIC_NVLINK_L38_RX "NVML_GPM_METRIC_NVLINK_L38_RX" = 337 + NVML_GPM_METRIC_NVLINK_L38_TX "NVML_GPM_METRIC_NVLINK_L38_TX" = 338 + NVML_GPM_METRIC_NVLINK_L39_RX "NVML_GPM_METRIC_NVLINK_L39_RX" = 339 + NVML_GPM_METRIC_NVLINK_L39_TX "NVML_GPM_METRIC_NVLINK_L39_TX" = 340 + NVML_GPM_METRIC_NVLINK_L40_RX "NVML_GPM_METRIC_NVLINK_L40_RX" = 341 + NVML_GPM_METRIC_NVLINK_L40_TX "NVML_GPM_METRIC_NVLINK_L40_TX" = 342 + NVML_GPM_METRIC_NVLINK_L41_RX "NVML_GPM_METRIC_NVLINK_L41_RX" = 343 + NVML_GPM_METRIC_NVLINK_L41_TX "NVML_GPM_METRIC_NVLINK_L41_TX" = 344 + NVML_GPM_METRIC_NVLINK_L42_RX "NVML_GPM_METRIC_NVLINK_L42_RX" = 345 + NVML_GPM_METRIC_NVLINK_L42_TX "NVML_GPM_METRIC_NVLINK_L42_TX" = 346 + NVML_GPM_METRIC_NVLINK_L43_RX "NVML_GPM_METRIC_NVLINK_L43_RX" = 347 + NVML_GPM_METRIC_NVLINK_L43_TX "NVML_GPM_METRIC_NVLINK_L43_TX" = 348 + NVML_GPM_METRIC_NVLINK_L44_RX "NVML_GPM_METRIC_NVLINK_L44_RX" = 349 + NVML_GPM_METRIC_NVLINK_L44_TX "NVML_GPM_METRIC_NVLINK_L44_TX" = 350 + NVML_GPM_METRIC_NVLINK_L45_RX "NVML_GPM_METRIC_NVLINK_L45_RX" = 351 + NVML_GPM_METRIC_NVLINK_L45_TX "NVML_GPM_METRIC_NVLINK_L45_TX" = 352 + NVML_GPM_METRIC_NVLINK_L46_RX "NVML_GPM_METRIC_NVLINK_L46_RX" = 353 + NVML_GPM_METRIC_NVLINK_L46_TX "NVML_GPM_METRIC_NVLINK_L46_TX" = 354 + NVML_GPM_METRIC_NVLINK_L47_RX "NVML_GPM_METRIC_NVLINK_L47_RX" = 355 + NVML_GPM_METRIC_NVLINK_L47_TX "NVML_GPM_METRIC_NVLINK_L47_TX" = 356 + NVML_GPM_METRIC_NVLINK_L48_RX "NVML_GPM_METRIC_NVLINK_L48_RX" = 357 + NVML_GPM_METRIC_NVLINK_L48_TX "NVML_GPM_METRIC_NVLINK_L48_TX" = 358 + NVML_GPM_METRIC_NVLINK_L49_RX "NVML_GPM_METRIC_NVLINK_L49_RX" = 359 + NVML_GPM_METRIC_NVLINK_L49_TX "NVML_GPM_METRIC_NVLINK_L49_TX" = 360 + NVML_GPM_METRIC_NVLINK_L50_RX "NVML_GPM_METRIC_NVLINK_L50_RX" = 361 + NVML_GPM_METRIC_NVLINK_L50_TX "NVML_GPM_METRIC_NVLINK_L50_TX" = 362 + NVML_GPM_METRIC_NVLINK_L51_RX "NVML_GPM_METRIC_NVLINK_L51_RX" = 363 + NVML_GPM_METRIC_NVLINK_L51_TX "NVML_GPM_METRIC_NVLINK_L51_TX" = 364 + NVML_GPM_METRIC_NVLINK_L52_RX "NVML_GPM_METRIC_NVLINK_L52_RX" = 365 + NVML_GPM_METRIC_NVLINK_L52_TX "NVML_GPM_METRIC_NVLINK_L52_TX" = 366 + NVML_GPM_METRIC_NVLINK_L53_RX "NVML_GPM_METRIC_NVLINK_L53_RX" = 367 + NVML_GPM_METRIC_NVLINK_L53_TX "NVML_GPM_METRIC_NVLINK_L53_TX" = 368 + NVML_GPM_METRIC_NVLINK_L54_RX "NVML_GPM_METRIC_NVLINK_L54_RX" = 369 + NVML_GPM_METRIC_NVLINK_L54_TX "NVML_GPM_METRIC_NVLINK_L54_TX" = 370 + NVML_GPM_METRIC_NVLINK_L55_RX "NVML_GPM_METRIC_NVLINK_L55_RX" = 371 + NVML_GPM_METRIC_NVLINK_L55_TX "NVML_GPM_METRIC_NVLINK_L55_TX" = 372 + NVML_GPM_METRIC_NVLINK_L56_RX "NVML_GPM_METRIC_NVLINK_L56_RX" = 373 + NVML_GPM_METRIC_NVLINK_L56_TX "NVML_GPM_METRIC_NVLINK_L56_TX" = 374 + NVML_GPM_METRIC_NVLINK_L57_RX "NVML_GPM_METRIC_NVLINK_L57_RX" = 375 + NVML_GPM_METRIC_NVLINK_L57_TX "NVML_GPM_METRIC_NVLINK_L57_TX" = 376 + NVML_GPM_METRIC_NVLINK_L58_RX "NVML_GPM_METRIC_NVLINK_L58_RX" = 377 + NVML_GPM_METRIC_NVLINK_L58_TX "NVML_GPM_METRIC_NVLINK_L58_TX" = 378 + NVML_GPM_METRIC_NVLINK_L59_RX "NVML_GPM_METRIC_NVLINK_L59_RX" = 379 + NVML_GPM_METRIC_NVLINK_L59_TX "NVML_GPM_METRIC_NVLINK_L59_TX" = 380 + NVML_GPM_METRIC_NVLINK_L60_RX "NVML_GPM_METRIC_NVLINK_L60_RX" = 381 + NVML_GPM_METRIC_NVLINK_L60_TX "NVML_GPM_METRIC_NVLINK_L60_TX" = 382 + NVML_GPM_METRIC_NVLINK_L61_RX "NVML_GPM_METRIC_NVLINK_L61_RX" = 383 + NVML_GPM_METRIC_NVLINK_L61_TX "NVML_GPM_METRIC_NVLINK_L61_TX" = 384 + NVML_GPM_METRIC_NVLINK_L62_RX "NVML_GPM_METRIC_NVLINK_L62_RX" = 385 + NVML_GPM_METRIC_NVLINK_L62_TX "NVML_GPM_METRIC_NVLINK_L62_TX" = 386 + NVML_GPM_METRIC_NVLINK_L63_RX "NVML_GPM_METRIC_NVLINK_L63_RX" = 387 + NVML_GPM_METRIC_NVLINK_L63_TX "NVML_GPM_METRIC_NVLINK_L63_TX" = 388 + NVML_GPM_METRIC_NVLINK_L64_RX "NVML_GPM_METRIC_NVLINK_L64_RX" = 389 + NVML_GPM_METRIC_NVLINK_L64_TX "NVML_GPM_METRIC_NVLINK_L64_TX" = 390 + NVML_GPM_METRIC_NVLINK_L65_RX "NVML_GPM_METRIC_NVLINK_L65_RX" = 391 + NVML_GPM_METRIC_NVLINK_L65_TX "NVML_GPM_METRIC_NVLINK_L65_TX" = 392 + NVML_GPM_METRIC_NVLINK_L66_RX "NVML_GPM_METRIC_NVLINK_L66_RX" = 393 + NVML_GPM_METRIC_NVLINK_L66_TX "NVML_GPM_METRIC_NVLINK_L66_TX" = 394 + NVML_GPM_METRIC_NVLINK_L67_RX "NVML_GPM_METRIC_NVLINK_L67_RX" = 395 + NVML_GPM_METRIC_NVLINK_L67_TX "NVML_GPM_METRIC_NVLINK_L67_TX" = 396 + NVML_GPM_METRIC_NVLINK_L68_RX "NVML_GPM_METRIC_NVLINK_L68_RX" = 397 + NVML_GPM_METRIC_NVLINK_L68_TX "NVML_GPM_METRIC_NVLINK_L68_TX" = 398 + NVML_GPM_METRIC_NVLINK_L69_RX "NVML_GPM_METRIC_NVLINK_L69_RX" = 399 + NVML_GPM_METRIC_NVLINK_L69_TX "NVML_GPM_METRIC_NVLINK_L69_TX" = 400 + NVML_GPM_METRIC_NVLINK_L70_RX "NVML_GPM_METRIC_NVLINK_L70_RX" = 401 + NVML_GPM_METRIC_NVLINK_L70_TX "NVML_GPM_METRIC_NVLINK_L70_TX" = 402 + NVML_GPM_METRIC_NVLINK_L71_RX "NVML_GPM_METRIC_NVLINK_L71_RX" = 403 + NVML_GPM_METRIC_NVLINK_L71_TX "NVML_GPM_METRIC_NVLINK_L71_TX" = 404 + NVML_GPM_METRIC_NVLINK_L36_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L36_RX_PER_SEC" = 405 + NVML_GPM_METRIC_NVLINK_L36_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L36_TX_PER_SEC" = 406 + NVML_GPM_METRIC_NVLINK_L37_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L37_RX_PER_SEC" = 407 + NVML_GPM_METRIC_NVLINK_L37_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L37_TX_PER_SEC" = 408 + NVML_GPM_METRIC_NVLINK_L38_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L38_RX_PER_SEC" = 409 + NVML_GPM_METRIC_NVLINK_L38_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L38_TX_PER_SEC" = 410 + NVML_GPM_METRIC_NVLINK_L39_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L39_RX_PER_SEC" = 411 + NVML_GPM_METRIC_NVLINK_L39_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L39_TX_PER_SEC" = 412 + NVML_GPM_METRIC_NVLINK_L40_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L40_RX_PER_SEC" = 413 + NVML_GPM_METRIC_NVLINK_L40_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L40_TX_PER_SEC" = 414 + NVML_GPM_METRIC_NVLINK_L41_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L41_RX_PER_SEC" = 415 + NVML_GPM_METRIC_NVLINK_L41_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L41_TX_PER_SEC" = 416 + NVML_GPM_METRIC_NVLINK_L42_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L42_RX_PER_SEC" = 417 + NVML_GPM_METRIC_NVLINK_L42_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L42_TX_PER_SEC" = 418 + NVML_GPM_METRIC_NVLINK_L43_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L43_RX_PER_SEC" = 419 + NVML_GPM_METRIC_NVLINK_L43_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L43_TX_PER_SEC" = 420 + NVML_GPM_METRIC_NVLINK_L44_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L44_RX_PER_SEC" = 421 + NVML_GPM_METRIC_NVLINK_L44_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L44_TX_PER_SEC" = 422 + NVML_GPM_METRIC_NVLINK_L45_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L45_RX_PER_SEC" = 423 + NVML_GPM_METRIC_NVLINK_L45_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L45_TX_PER_SEC" = 424 + NVML_GPM_METRIC_NVLINK_L46_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L46_RX_PER_SEC" = 425 + NVML_GPM_METRIC_NVLINK_L46_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L46_TX_PER_SEC" = 426 + NVML_GPM_METRIC_NVLINK_L47_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L47_RX_PER_SEC" = 427 + NVML_GPM_METRIC_NVLINK_L47_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L47_TX_PER_SEC" = 428 + NVML_GPM_METRIC_NVLINK_L48_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L48_RX_PER_SEC" = 429 + NVML_GPM_METRIC_NVLINK_L48_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L48_TX_PER_SEC" = 430 + NVML_GPM_METRIC_NVLINK_L49_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L49_RX_PER_SEC" = 431 + NVML_GPM_METRIC_NVLINK_L49_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L49_TX_PER_SEC" = 432 + NVML_GPM_METRIC_NVLINK_L50_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L50_RX_PER_SEC" = 433 + NVML_GPM_METRIC_NVLINK_L50_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L50_TX_PER_SEC" = 434 + NVML_GPM_METRIC_NVLINK_L51_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L51_RX_PER_SEC" = 435 + NVML_GPM_METRIC_NVLINK_L51_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L51_TX_PER_SEC" = 436 + NVML_GPM_METRIC_NVLINK_L52_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L52_RX_PER_SEC" = 437 + NVML_GPM_METRIC_NVLINK_L52_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L52_TX_PER_SEC" = 438 + NVML_GPM_METRIC_NVLINK_L53_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L53_RX_PER_SEC" = 439 + NVML_GPM_METRIC_NVLINK_L53_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L53_TX_PER_SEC" = 440 + NVML_GPM_METRIC_NVLINK_L54_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L54_RX_PER_SEC" = 441 + NVML_GPM_METRIC_NVLINK_L54_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L54_TX_PER_SEC" = 442 + NVML_GPM_METRIC_NVLINK_L55_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L55_RX_PER_SEC" = 443 + NVML_GPM_METRIC_NVLINK_L55_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L55_TX_PER_SEC" = 444 + NVML_GPM_METRIC_NVLINK_L56_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L56_RX_PER_SEC" = 445 + NVML_GPM_METRIC_NVLINK_L56_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L56_TX_PER_SEC" = 446 + NVML_GPM_METRIC_NVLINK_L57_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L57_RX_PER_SEC" = 447 + NVML_GPM_METRIC_NVLINK_L57_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L57_TX_PER_SEC" = 448 + NVML_GPM_METRIC_NVLINK_L58_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L58_RX_PER_SEC" = 449 + NVML_GPM_METRIC_NVLINK_L58_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L58_TX_PER_SEC" = 450 + NVML_GPM_METRIC_NVLINK_L59_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L59_RX_PER_SEC" = 451 + NVML_GPM_METRIC_NVLINK_L59_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L59_TX_PER_SEC" = 452 + NVML_GPM_METRIC_NVLINK_L60_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L60_RX_PER_SEC" = 453 + NVML_GPM_METRIC_NVLINK_L60_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L60_TX_PER_SEC" = 454 + NVML_GPM_METRIC_NVLINK_L61_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L61_RX_PER_SEC" = 455 + NVML_GPM_METRIC_NVLINK_L61_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L61_TX_PER_SEC" = 456 + NVML_GPM_METRIC_NVLINK_L62_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L62_RX_PER_SEC" = 457 + NVML_GPM_METRIC_NVLINK_L62_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L62_TX_PER_SEC" = 458 + NVML_GPM_METRIC_NVLINK_L63_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L63_RX_PER_SEC" = 459 + NVML_GPM_METRIC_NVLINK_L63_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L63_TX_PER_SEC" = 460 + NVML_GPM_METRIC_NVLINK_L64_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L64_RX_PER_SEC" = 461 + NVML_GPM_METRIC_NVLINK_L64_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L64_TX_PER_SEC" = 462 + NVML_GPM_METRIC_NVLINK_L65_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L65_RX_PER_SEC" = 463 + NVML_GPM_METRIC_NVLINK_L65_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L65_TX_PER_SEC" = 464 + NVML_GPM_METRIC_NVLINK_L66_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L66_RX_PER_SEC" = 465 + NVML_GPM_METRIC_NVLINK_L66_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L66_TX_PER_SEC" = 466 + NVML_GPM_METRIC_NVLINK_L67_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L67_RX_PER_SEC" = 467 + NVML_GPM_METRIC_NVLINK_L67_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L67_TX_PER_SEC" = 468 + NVML_GPM_METRIC_NVLINK_L68_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L68_RX_PER_SEC" = 469 + NVML_GPM_METRIC_NVLINK_L68_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L68_TX_PER_SEC" = 470 + NVML_GPM_METRIC_NVLINK_L69_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L69_RX_PER_SEC" = 471 + NVML_GPM_METRIC_NVLINK_L69_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L69_TX_PER_SEC" = 472 + NVML_GPM_METRIC_NVLINK_L70_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L70_RX_PER_SEC" = 473 + NVML_GPM_METRIC_NVLINK_L70_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L70_TX_PER_SEC" = 474 + NVML_GPM_METRIC_NVLINK_L71_RX_PER_SEC "NVML_GPM_METRIC_NVLINK_L71_RX_PER_SEC" = 475 + NVML_GPM_METRIC_NVLINK_L71_TX_PER_SEC "NVML_GPM_METRIC_NVLINK_L71_TX_PER_SEC" = 476 + NVML_GPM_METRIC_MAX "NVML_GPM_METRIC_MAX" = 477 ctypedef enum nvmlPowerProfileType_t "nvmlPowerProfileType_t": NVML_POWER_PROFILE_MAX_P "NVML_POWER_PROFILE_MAX_P" = 0 @@ -787,7 +938,17 @@ ctypedef enum nvmlPowerProfileType_t "nvmlPowerProfileType_t": NVML_POWER_PROFILE_SYNC_BALANCED "NVML_POWER_PROFILE_SYNC_BALANCED" = 12 NVML_POWER_PROFILE_HPC "NVML_POWER_PROFILE_HPC" = 13 NVML_POWER_PROFILE_MIG "NVML_POWER_PROFILE_MIG" = 14 - NVML_POWER_PROFILE_MAX "NVML_POWER_PROFILE_MAX" = 15 + NVML_POWER_PROFILE_MAX_Q_1 "NVML_POWER_PROFILE_MAX_Q_1" = 15 + NVML_POWER_PROFILE_NETWORK_BOUND "NVML_POWER_PROFILE_NETWORK_BOUND" = 16 + NVML_POWER_PROFILE_HIGH_THROUGHPUT_INFERENCE "NVML_POWER_PROFILE_HIGH_THROUGHPUT_INFERENCE" = 17 + NVML_POWER_PROFILE_MEDIUM_THROUGHPUT_INFERENCE "NVML_POWER_PROFILE_MEDIUM_THROUGHPUT_INFERENCE" = 18 + NVML_POWER_PROFILE_LOW_LATENCY_INFERENCE "NVML_POWER_PROFILE_LOW_LATENCY_INFERENCE" = 19 + NVML_POWER_PROFILE_TRAINING "NVML_POWER_PROFILE_TRAINING" = 20 + NVML_POWER_PROFILE_INFERENCE "NVML_POWER_PROFILE_INFERENCE" = 21 + NVML_POWER_PROFILE_MAX_Q_2 "NVML_POWER_PROFILE_MAX_Q_2" = 22 + NVML_POWER_PROFILE_MAX_Q_3 "NVML_POWER_PROFILE_MAX_Q_3" = 23 + NVML_POWER_PROFILE_LOW_PRIORITY_BACKGROUND "NVML_POWER_PROFILE_LOW_PRIORITY_BACKGROUND" = 24 + NVML_POWER_PROFILE_MAX "NVML_POWER_PROFILE_MAX" = 25 ctypedef enum nvmlDeviceAddressingModeType_t "nvmlDeviceAddressingModeType_t": NVML_DEVICE_ADDRESSING_MODE_NONE "NVML_DEVICE_ADDRESSING_MODE_NONE" = 0 @@ -801,6 +962,14 @@ ctypedef enum nvmlPRMCounterId_t "nvmlPRMCounterId_t": NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS" = 101 NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY" = 102 NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES" = 103 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_IN_LAST_HOST_SERDES_FEQ_RECOVERY "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_IN_LAST_HOST_SERDES_FEQ_RECOVERY" = 104 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_TIME_IN_HOST_SERDES_FEQ_RECOVERY "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_TIME_IN_HOST_SERDES_FEQ_RECOVERY" = 105 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_RECOVERY_COUNT "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_RECOVERY_COUNT" = 106 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_SUCCESSFUL_RECOVERY_COUNT "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_SUCCESSFUL_RECOVERY_COUNT" = 107 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_HOST_SERDES_FEQ_ATTEMPTS_COUNT "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_HOST_SERDES_FEQ_ATTEMPTS_COUNT" = 108 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_STEP_ATTEMPTS "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_STEP_ATTEMPTS" = 109 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_TIME "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_TIME" = 110 + NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_TIME "NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_TIME" = 111 NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT "NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT" = 201 NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES" = 301 NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR "NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR" = 302 @@ -827,6 +996,34 @@ ctypedef enum nvmlProcessMode_t "nvmlProcessMode_t": ctypedef enum nvmlCPERType_t "nvmlCPERType_t": NVML_CPER_ACCESS_TYPE_GPU "NVML_CPER_ACCESS_TYPE_GPU" = (1 << 0) +ctypedef enum nvmlGpuOperationalEventLogLevel_t "nvmlGpuOperationalEventLogLevel_t": + NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ALL "NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ALL" = 0 + NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_TELEMETRY "NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_TELEMETRY" = 10 + NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_DIAG "NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_DIAG" = 20 + NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_NOTICE "NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_NOTICE" = 30 + NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_WARNING "NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_WARNING" = 40 + NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ERROR "NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ERROR" = 50 + +ctypedef enum nvmlOperationalEventSeverity_t "nvmlOperationalEventSeverity_t": + NVML_OPERATIONAL_EVENT_SEVERITY_ALL "NVML_OPERATIONAL_EVENT_SEVERITY_ALL" = 0 + NVML_OPERATIONAL_EVENT_SEVERITY_INFORMATIONAL "NVML_OPERATIONAL_EVENT_SEVERITY_INFORMATIONAL" = 10 + NVML_OPERATIONAL_EVENT_SEVERITY_CORRECTED "NVML_OPERATIONAL_EVENT_SEVERITY_CORRECTED" = 20 + NVML_OPERATIONAL_EVENT_SEVERITY_RECOVERABLE "NVML_OPERATIONAL_EVENT_SEVERITY_RECOVERABLE" = 30 + NVML_OPERATIONAL_EVENT_SEVERITY_FATAL "NVML_OPERATIONAL_EVENT_SEVERITY_FATAL" = 40 + +ctypedef enum nvmlEventDataType_t "nvmlEventDataType_t": + NVML_EVENT_DATA_TYPE_NVML_EVENT "NVML_EVENT_DATA_TYPE_NVML_EVENT" = 0 + NVML_EVENT_DATA_TYPE_GPU_OPERATIONAL_EVENT "NVML_EVENT_DATA_TYPE_GPU_OPERATIONAL_EVENT" = 1 + +ctypedef enum nvmlGpuOperationalEventContextType_t "nvmlGpuOperationalEventContextType_t": + NVML_GPU_OPERATIONAL_EVENT_CONTEXT_TYPE_UNKNOWN "NVML_GPU_OPERATIONAL_EVENT_CONTEXT_TYPE_UNKNOWN" = 0 + NVML_GPU_OPERATIONAL_EVENT_CONTEXT_TYPE_LEGACY_XID "NVML_GPU_OPERATIONAL_EVENT_CONTEXT_TYPE_LEGACY_XID" = 1 + +ctypedef enum nvmlNvlinkTelemetrySampleType_t "nvmlNvlinkTelemetrySampleType_t": + NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_TX "NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_TX" = 0 + NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_RX "NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_RX" = 1 + NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_COUNT "NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_COUNT" = 2 + # types ctypedef struct nvmlPciInfoExt_v1_t 'nvmlPciInfoExt_v1_t': @@ -1507,6 +1704,113 @@ ctypedef struct nvmlAccountingStats_v2_t 'nvmlAccountingStats_v2_t': unsigned long long time unsigned long long startTime +ctypedef struct nvmlSetMemoryLimits_v1_t 'nvmlSetMemoryLimits_v1_t': + char* nameSpace + unsigned long long softLimit + unsigned long long hardLimit + +ctypedef struct nvmlGetMemoryLimits_v1_t 'nvmlGetMemoryLimits_v1_t': + char* nameSpace + unsigned long long softLimit + unsigned long long hardLimit + unsigned long long currentUsed + +ctypedef struct nvmlPmgrPwrTuple_t 'nvmlPmgrPwrTuple_t': + unsigned int pwrmW + +ctypedef struct nvmlRailMetrics_t 'nvmlRailMetrics_t': + unsigned int freqkHz + unsigned long long utilPct + +ctypedef struct nvmlPwrModelMetricsDlppm1xPerf_t 'nvmlPwrModelMetricsDlppm1xPerf_t': + unsigned int perfms + +ctypedef struct nvmlPwrModelMetricsSamplePfpp1x_t 'nvmlPwrModelMetricsSamplePfpp1x_t': + unsigned int freqkHz[16] + unsigned int estTgpPwrmW + +ctypedef struct nvmlPwrModelOperatingPointPfpp1x_t 'nvmlPwrModelOperatingPointPfpp1x_t': + unsigned int freqkHz + unsigned int pwrmW + +ctypedef struct nvmlAdaptiveTgpModeInfo_v1_t 'nvmlAdaptiveTgpModeInfo_v1_t': + nvmlEnableState_t inBandEnableRequest + nvmlEnableState_t featureAllowedByAdmin + nvmlEnableState_t adminOverrideEnabled + nvmlEnableState_t enablementStatus + unsigned int adjustedLimitMw + +ctypedef struct nvmlEventSetGetContextCount_v1_t 'nvmlEventSetGetContextCount_v1_t': + unsigned int count + +ctypedef struct nvmlEventSetGetContextInfo_v1_t 'nvmlEventSetGetContextInfo_v1_t': + unsigned int index + unsigned int nvmlGpuOperationalEventContextType + unsigned int sourceEventContextType + unsigned int dataSize + unsigned short dataFormatVersion + +ctypedef struct nvmlEventSetGetContextData_v1_t 'nvmlEventSetGetContextData_v1_t': + void* data + unsigned int index + unsigned int dataSize + +ctypedef struct nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t 'nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t': + unsigned int index + unsigned int xidCode + +ctypedef struct nvmlGpuFabricClique_v1_t 'nvmlGpuFabricClique_v1_t': + unsigned char type + unsigned int id + +ctypedef struct nvmlGpuOperationalEventConfig_v1_t 'nvmlGpuOperationalEventConfig_v1_t': + char uuid[96] + unsigned int minLogLevel + unsigned int minSeverity + +ctypedef struct nvmlEventSetWait_v3_t 'nvmlEventSetWait_v3_t': + unsigned int timeoutMs + unsigned int dataType + char uuid[96] + char sourceModule[16] + unsigned long long eventType + unsigned long long eventData + unsigned long long groupCursor + unsigned long long instanceId + unsigned long long timestampUsec + unsigned long long traceId + unsigned int gpuInstanceId + unsigned int computeInstanceId + unsigned int severity + unsigned int categoryId + unsigned int moduleEventCode + unsigned int scope + unsigned int originator + unsigned int moduleInstance + unsigned int chipletId + unsigned int logLevel + unsigned int attributes + unsigned int groupCperSize + unsigned int groupAttributes + unsigned char groupSize + unsigned char groupIndex + +ctypedef struct nvmlNvlinkSetBwModeAsync_v1_t 'nvmlNvlinkSetBwModeAsync_v1_t': + unsigned int bSetBest + unsigned int bwMode + unsigned int asyncPollTimeoutMs + +ctypedef struct nvmlNvlinkTelemetrySample_v1_t 'nvmlNvlinkTelemetrySample_v1_t': + unsigned int linkId + unsigned int sampleType + unsigned int sampleCount + unsigned long long* samples + nvmlReturn_t nvmlReturn + +ctypedef struct nvmlEccBankRemapperHistogram_v1_t 'nvmlEccBankRemapperHistogram_v1_t': + unsigned int maxSpareGroupCount + unsigned int noSpareGroupCount + ctypedef nvmlPciInfoExt_v1_t nvmlPciInfoExt_t 'nvmlPciInfoExt_t' ctypedef nvmlCoolerInfo_v1_t nvmlCoolerInfo_t 'nvmlCoolerInfo_t' @@ -1864,6 +2168,36 @@ ctypedef struct nvmlVgpuSchedulerLogInfo_v2_t 'nvmlVgpuSchedulerLogInfo_v2_t': unsigned int entriesCount nvmlVgpuSchedulerLogEntry_v2_t logEntries[200] +ctypedef struct nvmlCoreRailMetrics_t 'nvmlCoreRailMetrics_t': + nvmlRailMetrics_t rails[2] + +ctypedef struct nvmlPwrModelMetricsPfpp1x_t 'nvmlPwrModelMetricsPfpp1x_t': + unsigned char numVfPoints + nvmlPwrModelMetricsSamplePfpp1x_t estimatedMetrics[32] + unsigned char bValid + nvmlPwrModelOperatingPointPfpp1x_t maxPerfPerWattPoint + nvmlPwrModelOperatingPointPfpp1x_t fmaxAtVmaxPoint + unsigned int tgpHeadroommW + +ctypedef struct nvmlGpuFabricInfo_v4_t 'nvmlGpuFabricInfo_v4_t': + unsigned char clusterUuid[16] + nvmlReturn_t status + nvmlGpuFabricClique_v1_t cliques[64] + unsigned int numCliques + nvmlGpuFabricState_t state + unsigned int healthMask + unsigned char healthSummary + +ctypedef struct nvmlNvlinkTelemetrySamples_v1_t 'nvmlNvlinkTelemetrySamples_v1_t': + unsigned int telemetryCount + nvmlNvlinkTelemetrySample_v1_t* telemetrySamples + +ctypedef struct nvmlEccBankRemapperStatus_v1_t 'nvmlEccBankRemapperStatus_v1_t': + unsigned int activeRemappings + unsigned int inactiveRemappings + unsigned int bPending + nvmlEccBankRemapperHistogram_v1_t histogram + ctypedef nvmlVgpuTypeIdInfo_v1_t nvmlVgpuTypeIdInfo_t 'nvmlVgpuTypeIdInfo_t' ctypedef nvmlVgpuTypeMaxInstance_v1_t nvmlVgpuTypeMaxInstance_t 'nvmlVgpuTypeMaxInstance_t' @@ -1962,7 +2296,7 @@ ctypedef struct nvmlGpmMetricsGet_t 'nvmlGpmMetricsGet_t': unsigned int numMetrics nvmlGpmSample_t sample1 nvmlGpmSample_t sample2 - nvmlGpmMetric_t metrics[333] + nvmlGpmMetric_t metrics[477] ctypedef nvmlWorkloadPowerProfileInfo_v1_t nvmlWorkloadPowerProfileInfo_t 'nvmlWorkloadPowerProfileInfo_t' @@ -1977,6 +2311,16 @@ ctypedef struct nvmlNvLinkInfo_v2_t 'nvmlNvLinkInfo_v2_t': unsigned int isNvleEnabled nvmlNvlinkFirmwareInfo_t firmwareInfo +ctypedef struct nvmlPwrModelMetricsDlppm1x_t 'nvmlPwrModelMetricsDlppm1x_t': + unsigned char bValid + nvmlCoreRailMetrics_t coreRail + nvmlRailMetrics_t fbRail + nvmlPmgrPwrTuple_t tgpPwrTuple + nvmlPwrModelMetricsDlppm1xPerf_t perfMetrics + +ctypedef struct nvmlPerfMetricsPfpp1xSample_t 'nvmlPerfMetricsPfpp1xSample_t': + nvmlPwrModelMetricsPfpp1x_t estimatedMetrics + ctypedef nvmlVgpuProcessesUtilizationInfo_v1_t nvmlVgpuProcessesUtilizationInfo_t 'nvmlVgpuProcessesUtilizationInfo_t' ctypedef nvmlVgpuInstancesUtilizationInfo_v1_t nvmlVgpuInstancesUtilizationInfo_t 'nvmlVgpuInstancesUtilizationInfo_t' @@ -1998,8 +2342,39 @@ ctypedef struct nvmlWorkloadPowerProfileProfilesInfo_v1_t 'nvmlWorkloadPowerProf ctypedef nvmlNvLinkInfo_v2_t nvmlNvLinkInfo_t 'nvmlNvLinkInfo_t' +ctypedef struct nvmlPwrModelMetricsDlppm1xDramclkEstimates_t 'nvmlPwrModelMetricsDlppm1xDramclkEstimates_t': + nvmlPwrModelMetricsDlppm1x_t estimatedMetrics[8] + unsigned char numEstimatedMetrics + ctypedef nvmlWorkloadPowerProfileProfilesInfo_v1_t nvmlWorkloadPowerProfileProfilesInfo_t 'nvmlWorkloadPowerProfileProfilesInfo_t' +ctypedef struct nvmlObservedMetrics_t 'nvmlObservedMetrics_t': + nvmlPwrModelMetricsDlppm1xDramclkEstimates_t initialDramclkEst[3] + unsigned char bValid + nvmlCoreRailMetrics_t coreRail + nvmlRailMetrics_t fbRail + nvmlPmgrPwrTuple_t tgpPwrTuple + nvmlPwrModelMetricsDlppm1xPerf_t perfMetrics + +ctypedef struct nvmlPerfMetricsDlppc2xSample_t 'nvmlPerfMetricsDlppc2xSample_t': + nvmlObservedMetrics_t observedMetrics + +ctypedef union cuda_bindings_nvml__anon_pod8: + nvmlPerfMetricsDlppc2xSample_t dlppc2x + nvmlPerfMetricsPfpp1xSample_t pfpp1x + +ctypedef struct nvmlPerfMetricControllerSample_t 'nvmlPerfMetricControllerSample_t': + unsigned int controllerType + cuda_bindings_nvml__anon_pod8 data + +ctypedef struct nvmlPerfMetricsSample_t 'nvmlPerfMetricsSample_t': + unsigned char numControllerData + nvmlPerfMetricControllerSample_t controllerData[4] + +ctypedef struct nvmlPerfMetricsSamples_v1_t 'nvmlPerfMetricsSamples_v1_t': + unsigned int numSamples + nvmlPerfMetricsSample_t samples[13] + ############################################################################### # Functions @@ -2360,3 +2735,18 @@ cdef nvmlReturn_t nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETUR cdef nvmlReturn_t nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetAdaptiveTgpMode_v1(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetAdaptiveTgpModeInfo_v1(nvmlDevice_t device, nvmlAdaptiveTgpModeInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetMemoryLimits_v1(nvmlDevice_t device, nvmlSetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetMemoryLimits_v1(nvmlDevice_t device, nvmlGetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuFabricInfo_v4(nvmlDevice_t device, nvmlGpuFabricInfo_v4_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDevicePerfMetricsGetSamples_v1(nvmlDevice_t device, nvmlPerfMetricsSamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetNvlinkBwModeAsync_v1(nvmlDevice_t device, nvmlNvlinkSetBwModeAsync_v1_t* setBwModeAsync) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkTelemetrySamples_v1(nvmlDevice_t device, nvmlNvlinkTelemetrySamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetRegisterGpuOperationalEvents_v1(nvmlEventSet_t eventSet, const nvmlGpuOperationalEventConfig_v1_t* config) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetWait_v3(nvmlEventSet_t set, nvmlEventSetWait_v3_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, nvmlEventSetGetContextCount_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, nvmlEventSetGetContextInfo_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetContextData_v1(nvmlEventSet_t set, nvmlEventSetGetContextData_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlEccBankRemapperStatus_v1_t* pBankRemapperStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings/cuda/bindings/cynvml.pyx b/cuda_bindings/cuda/bindings/cynvml.pyx index 9b2f7df7c54..c309bc66eaa 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pyx +++ b/cuda_bindings/cuda/bindings/cynvml.pyx @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. +# 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=b30ca4e9dfac73d38cb872e4dc7d80d69cbb7e516c50e048cb34234a6c0198a6 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f5af75e5d248a615a2165cbd490ef48486c2b9e3a3957aec27050eda3de5f329 from ._internal cimport nvml as _nvml @@ -1430,3 +1430,63 @@ cdef nvmlReturn_t nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccou cdef nvmlReturn_t nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: return _nvml._nvmlDeviceGetRemappedRows_v2(device, info) + + +cdef nvmlReturn_t nvmlDeviceSetAdaptiveTgpMode_v1(nvmlDevice_t device, nvmlEnableState_t mode) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetAdaptiveTgpMode_v1(device, mode) + + +cdef nvmlReturn_t nvmlDeviceGetAdaptiveTgpModeInfo_v1(nvmlDevice_t device, nvmlAdaptiveTgpModeInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAdaptiveTgpModeInfo_v1(device, info) + + +cdef nvmlReturn_t nvmlDeviceSetMemoryLimits_v1(nvmlDevice_t device, nvmlSetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetMemoryLimits_v1(device, limits) + + +cdef nvmlReturn_t nvmlDeviceGetMemoryLimits_v1(nvmlDevice_t device, nvmlGetMemoryLimits_v1_t* limits) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetMemoryLimits_v1(device, limits) + + +cdef nvmlReturn_t nvmlDeviceGetGpuFabricInfo_v4(nvmlDevice_t device, nvmlGpuFabricInfo_v4_t* gpuFabricInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuFabricInfo_v4(device, gpuFabricInfo) + + +cdef nvmlReturn_t nvmlDevicePerfMetricsGetSamples_v1(nvmlDevice_t device, nvmlPerfMetricsSamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDevicePerfMetricsGetSamples_v1(device, samples) + + +cdef nvmlReturn_t nvmlDeviceSetNvlinkBwModeAsync_v1(nvmlDevice_t device, nvmlNvlinkSetBwModeAsync_v1_t* setBwModeAsync) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetNvlinkBwModeAsync_v1(device, setBwModeAsync) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkTelemetrySamples_v1(nvmlDevice_t device, nvmlNvlinkTelemetrySamples_v1_t* samples) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkTelemetrySamples_v1(device, samples) + + +cdef nvmlReturn_t nvmlEventSetRegisterGpuOperationalEvents_v1(nvmlEventSet_t eventSet, const nvmlGpuOperationalEventConfig_v1_t* config) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetRegisterGpuOperationalEvents_v1(eventSet, config) + + +cdef nvmlReturn_t nvmlEventSetWait_v3(nvmlEventSet_t set, nvmlEventSetWait_v3_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetWait_v3(set, params) + + +cdef nvmlReturn_t nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, nvmlEventSetGetContextCount_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetContextCount_v1(set, params) + + +cdef nvmlReturn_t nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, nvmlEventSetGetContextInfo_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetContextInfo_v1(set, params) + + +cdef nvmlReturn_t nvmlEventSetGetContextData_v1(nvmlEventSet_t set, nvmlEventSetGetContextData_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetContextData_v1(set, params) + + +cdef nvmlReturn_t nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(set, params) + + +cdef nvmlReturn_t nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlEccBankRemapperStatus_v1_t* pBankRemapperStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBankRemapperStatus_v1(device, pBankRemapperStatus) diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/cuda/bindings/cynvvm.pxd index f25e7e84b3b..1dea8578b40 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pxd +++ b/cuda_bindings/cuda/bindings/cynvvm.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. ############################################################################### @@ -10,7 +10,7 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=79be0fd21f7c6b6112743eb60ce9e69287a66999ecaaa063d87a52ab64982bce +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=060a4e1d735676d6239664555a8a07b292481085ca0f5b5f362ce5289f20ca6d ctypedef enum nvvmResult "nvvmResult": NVVM_SUCCESS "NVVM_SUCCESS" = 0 NVVM_ERROR_OUT_OF_MEMORY "NVVM_ERROR_OUT_OF_MEMORY" = 1 diff --git a/cuda_bindings/cuda/bindings/cynvvm.pyx b/cuda_bindings/cuda/bindings/cynvvm.pyx index 43f036a36c0..45028385633 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings/cuda/bindings/cynvvm.pyx @@ -2,9 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7ea5803be62646c287bad43350e27d3254f35d25ab50b9c54f7ac5695b4c3114 +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f235b24d553d40a065b8e5df12f584994d30eb6a3f52fc0dd35d7202c703f05b from ._internal cimport nvvm as _nvvm diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pxd b/cuda_bindings/cuda/bindings/nvfatbin.pxd index d27d4002320..192e7f55fde 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/nvfatbin.pxd @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d9fd5ffb6adedf403c2fee0594d979c6ad2221c94f886cdaaa5efb01c1fa1421 +# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9ead77b928fe2009e92249025e5b38bf079a25fc0d9737aafd3cbeddb5c86661 diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pyx b/cuda_bindings/cuda/bindings/nvfatbin.pyx index 0e485dd80dc..477026d721e 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/nvfatbin.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=464151e9be344b663eb001d24b780328f477470afca263a03384394a057b74bd +# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a696e744ee4520d7a8db8937f28c9ae9b92ff208900c1aba6b3dcf866a960e64 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index 714bbbc33ee..b383554eaca 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b3986e82e5ac57f70277f1ab470024ff95d353999f98723724c7eb62f6a409a1 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bdd807ca03377f36b064e28eaa2421255316987c009a65a55f05fbc1a22e2bf3 diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index 89076249cf9..5476ab63c89 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4f142d6dd069dd459052ff17e4e585b764e7a8b4298051df3c6c0d39e1c67ded +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=930ba914df7615926a16dd5224f9250eb512e83c1b85e8282470f252706359a8 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/cuda/bindings/nvml.pxd index ce3c1db4852..6f35132912f 100644 --- a/cuda_bindings/cuda/bindings/nvml.pxd +++ b/cuda_bindings/cuda/bindings/nvml.pxd @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b6fe9a4efd0077f8c09ef4f826880ad0a54100455d4465953c4127d3de8c4d91 +# 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 @@ -147,6 +147,11 @@ ctypedef nvmlPRMCounterId_t _PRMCounterId ctypedef nvmlPowerProfileOperation_t _PowerProfileOperation ctypedef nvmlProcessMode_t _ProcessMode ctypedef nvmlCPERType_t _CPERType +ctypedef nvmlGpuOperationalEventLogLevel_t _GpuOperationalEventLogLevel +ctypedef nvmlOperationalEventSeverity_t _OperationalEventSeverity +ctypedef nvmlEventDataType_t _EventDataType +ctypedef nvmlGpuOperationalEventContextType_t _GpuOperationalEventContextType +ctypedef nvmlNvlinkTelemetrySampleType_t _NvlinkTelemetrySampleType ############################################################################### @@ -438,3 +443,14 @@ 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 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 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 4378e667d06..9f0d104abba 100644 --- a/cuda_bindings/cuda/bindings/nvml.pyx +++ b/cuda_bindings/cuda/bindings/nvml.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9167da2a3d3194c67c44a0fe8d4d34b3dbd3c0f43061c50b7d238d2044c75509 +# 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=7447d022b0937ff32b98e8a8a6f0a3e0564884c4a217b51e9312290015c7a406 # <<<< PREAMBLE CONTENT >>>> @@ -374,6 +374,9 @@ class BrandType(_cyb_FastEnum): BRAND_NVIDIA = NVML_BRAND_NVIDIA BRAND_GEFORCE_RTX = NVML_BRAND_GEFORCE_RTX BRAND_TITAN_RTX = NVML_BRAND_TITAN_RTX + BRAND_NVIDIA_DLA = NVML_BRAND_NVIDIA_DLA + BRAND_NVIDIA_VGAMEDEV = NVML_BRAND_NVIDIA_VGAMEDEV + BRAND_NVIDIA_NPU = NVML_BRAND_NVIDIA_NPU BRAND_COUNT = NVML_BRAND_COUNT class TemperatureThresholds(_cyb_FastEnum): @@ -382,14 +385,14 @@ class TemperatureThresholds(_cyb_FastEnum): See `nvmlTemperatureThresholds_t`. """ - TEMPERATURE_THRESHOLD_SHUTDOWN = NVML_TEMPERATURE_THRESHOLD_SHUTDOWN - TEMPERATURE_THRESHOLD_SLOWDOWN = NVML_TEMPERATURE_THRESHOLD_SLOWDOWN - TEMPERATURE_THRESHOLD_MEM_MAX = NVML_TEMPERATURE_THRESHOLD_MEM_MAX - TEMPERATURE_THRESHOLD_GPU_MAX = NVML_TEMPERATURE_THRESHOLD_GPU_MAX - TEMPERATURE_THRESHOLD_ACOUSTIC_MIN = NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN - TEMPERATURE_THRESHOLD_ACOUSTIC_CURR = NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR - TEMPERATURE_THRESHOLD_ACOUSTIC_MAX = NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX - TEMPERATURE_THRESHOLD_GPS_CURR = NVML_TEMPERATURE_THRESHOLD_GPS_CURR + TEMPERATURE_THRESHOLD_SHUTDOWN = (NVML_TEMPERATURE_THRESHOLD_SHUTDOWN, 'Temperature at which the GPU will shut down for HW protection') + TEMPERATURE_THRESHOLD_SLOWDOWN = (NVML_TEMPERATURE_THRESHOLD_SLOWDOWN, 'Temperature at which the GPU will begin HW slowdown') + TEMPERATURE_THRESHOLD_MEM_MAX = (NVML_TEMPERATURE_THRESHOLD_MEM_MAX, 'Memory Temperature at which the GPU will begin SW slowdown') + TEMPERATURE_THRESHOLD_GPU_MAX = (NVML_TEMPERATURE_THRESHOLD_GPU_MAX, 'GPU Temperature at which the GPU can be throttled below base clock') + TEMPERATURE_THRESHOLD_ACOUSTIC_MIN = (NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MIN, 'Minimum GPU Temperature that can be set as acoustic threshold') + TEMPERATURE_THRESHOLD_ACOUSTIC_CURR = (NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_CURR, 'Current temperature that is set as acoustic threshold.') + TEMPERATURE_THRESHOLD_ACOUSTIC_MAX = (NVML_TEMPERATURE_THRESHOLD_ACOUSTIC_MAX, 'Maximum GPU temperature that can be set as acoustic threshold.') + TEMPERATURE_THRESHOLD_GPS_CURR = (NVML_TEMPERATURE_THRESHOLD_GPS_CURR, 'Current temperature that is set as gps threshold.') TEMPERATURE_THRESHOLD_COUNT = NVML_TEMPERATURE_THRESHOLD_COUNT class TemperatureSensors(_cyb_FastEnum): @@ -399,6 +402,7 @@ class TemperatureSensors(_cyb_FastEnum): See `nvmlTemperatureSensors_t`. """ TEMPERATURE_GPU = (NVML_TEMPERATURE_GPU, 'Temperature sensor for the GPU die.') + TEMPERATURE_GPU_MAX = (NVML_TEMPERATURE_GPU_MAX, 'Temperature from the hottest part of the GPU die.') TEMPERATURE_COUNT = NVML_TEMPERATURE_COUNT class ComputeMode(_cyb_FastEnum): @@ -677,6 +681,7 @@ class GridLicenseFeatureCode(_cyb_FastEnum): VWORKSTATION = (NVML_GRID_LICENSE_FEATURE_CODE_VWORKSTATION, 'Deprecated, do not use.') GAMING = (NVML_GRID_LICENSE_FEATURE_CODE_GAMING, 'Gaming.') COMPUTE = (NVML_GRID_LICENSE_FEATURE_CODE_COMPUTE, 'Compute.') + VGAMEDEV = (NVML_GRID_LICENSE_FEATURE_CODE_VGAMEDEV, 'vGameDev') class VgpuCapability(_cyb_FastEnum): """ @@ -733,6 +738,8 @@ class DeviceGpuRecoveryAction(_cyb_FastEnum): GPU_RECOVERY_ACTION_DRAIN_P2P = (NVML_GPU_RECOVERY_ACTION_DRAIN_P2P, 'Drain P2P.') GPU_RECOVERY_ACTION_DRAIN_AND_RESET = (NVML_GPU_RECOVERY_ACTION_DRAIN_AND_RESET, 'Drain P2P and Reset Gpu.') GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN = (NVML_GPU_RECOVERY_ACTION_RECOVER_IMEX_DOMAIN, 'Recover IMEX Domain.') + GPU_RECOVERY_ACTION_BUS_RESET = (NVML_GPU_RECOVERY_ACTION_BUS_RESET, "Reset the GPU's PCIe bus.") + GPU_RECOVERY_ACTION_SYSTEM_REBOOT = (NVML_GPU_RECOVERY_ACTION_SYSTEM_REBOOT, 'Reboot the system.') class FanState(_cyb_FastEnum): """ @@ -903,152 +910,152 @@ class GpmMetricId(_cyb_FastEnum): GPM_METRIC_NVLINK_L16_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L16_TX_PER_SEC, 'NvLink write bandwidth for link 16 in MiB/sec.') GPM_METRIC_NVLINK_L17_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L17_RX_PER_SEC, 'NvLink read bandwidth for link 17 in MiB/sec.') GPM_METRIC_NVLINK_L17_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L17_TX_PER_SEC, 'NvLink write bandwidth for link 17 in MiB/sec.') - GPM_METRIC_C2C_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC - GPM_METRIC_C2C_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC - GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC - GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC - GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC - GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC = NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC - GPM_METRIC_HOSTMEM_CACHE_HIT = NVML_GPM_METRIC_HOSTMEM_CACHE_HIT - GPM_METRIC_HOSTMEM_CACHE_MISS = NVML_GPM_METRIC_HOSTMEM_CACHE_MISS - GPM_METRIC_PEERMEM_CACHE_HIT = NVML_GPM_METRIC_PEERMEM_CACHE_HIT - GPM_METRIC_PEERMEM_CACHE_MISS = NVML_GPM_METRIC_PEERMEM_CACHE_MISS - GPM_METRIC_DRAM_CACHE_HIT = NVML_GPM_METRIC_DRAM_CACHE_HIT - GPM_METRIC_DRAM_CACHE_MISS = NVML_GPM_METRIC_DRAM_CACHE_MISS - GPM_METRIC_NVENC_0_UTIL = NVML_GPM_METRIC_NVENC_0_UTIL - GPM_METRIC_NVENC_1_UTIL = NVML_GPM_METRIC_NVENC_1_UTIL - GPM_METRIC_NVENC_2_UTIL = NVML_GPM_METRIC_NVENC_2_UTIL - GPM_METRIC_NVENC_3_UTIL = NVML_GPM_METRIC_NVENC_3_UTIL - GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR0_CTXSW_REQUESTS = NVML_GPM_METRIC_GR0_CTXSW_REQUESTS - GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR0_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT - GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR1_CTXSW_REQUESTS = NVML_GPM_METRIC_GR1_CTXSW_REQUESTS - GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR1_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT - GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR2_CTXSW_REQUESTS = NVML_GPM_METRIC_GR2_CTXSW_REQUESTS - GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR2_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT - GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR3_CTXSW_REQUESTS = NVML_GPM_METRIC_GR3_CTXSW_REQUESTS - GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR3_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT - GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR4_CTXSW_REQUESTS = NVML_GPM_METRIC_GR4_CTXSW_REQUESTS - GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR4_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT - GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR5_CTXSW_REQUESTS = NVML_GPM_METRIC_GR5_CTXSW_REQUESTS - GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR5_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT - GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR6_CTXSW_REQUESTS = NVML_GPM_METRIC_GR6_CTXSW_REQUESTS - GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR6_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT - GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED = NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED - GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE = NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE - GPM_METRIC_GR7_CTXSW_REQUESTS = NVML_GPM_METRIC_GR7_CTXSW_REQUESTS - GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ = NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ - GPM_METRIC_GR7_CTXSW_ACTIVE_PCT = NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT - GPM_METRIC_NVLINK_L18_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L18_RX_PER_SEC - GPM_METRIC_NVLINK_L18_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L18_TX_PER_SEC - GPM_METRIC_NVLINK_L19_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L19_RX_PER_SEC - GPM_METRIC_NVLINK_L19_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L19_TX_PER_SEC - GPM_METRIC_NVLINK_L20_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L20_RX_PER_SEC - GPM_METRIC_NVLINK_L20_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L20_TX_PER_SEC - GPM_METRIC_NVLINK_L21_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L21_RX_PER_SEC - GPM_METRIC_NVLINK_L21_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L21_TX_PER_SEC - GPM_METRIC_NVLINK_L22_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L22_RX_PER_SEC - GPM_METRIC_NVLINK_L22_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L22_TX_PER_SEC - GPM_METRIC_NVLINK_L23_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L23_RX_PER_SEC - GPM_METRIC_NVLINK_L23_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L23_TX_PER_SEC - GPM_METRIC_NVLINK_L24_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L24_RX_PER_SEC - GPM_METRIC_NVLINK_L24_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L24_TX_PER_SEC - GPM_METRIC_NVLINK_L25_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L25_RX_PER_SEC - GPM_METRIC_NVLINK_L25_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L25_TX_PER_SEC - GPM_METRIC_NVLINK_L26_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L26_RX_PER_SEC - GPM_METRIC_NVLINK_L26_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L26_TX_PER_SEC - GPM_METRIC_NVLINK_L27_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L27_RX_PER_SEC - GPM_METRIC_NVLINK_L27_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L27_TX_PER_SEC - GPM_METRIC_NVLINK_L28_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L28_RX_PER_SEC - GPM_METRIC_NVLINK_L28_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L28_TX_PER_SEC - GPM_METRIC_NVLINK_L29_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L29_RX_PER_SEC - GPM_METRIC_NVLINK_L29_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L29_TX_PER_SEC - GPM_METRIC_NVLINK_L30_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L30_RX_PER_SEC - GPM_METRIC_NVLINK_L30_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L30_TX_PER_SEC - GPM_METRIC_NVLINK_L31_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L31_RX_PER_SEC - GPM_METRIC_NVLINK_L31_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L31_TX_PER_SEC - GPM_METRIC_NVLINK_L32_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L32_RX_PER_SEC - GPM_METRIC_NVLINK_L32_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L32_TX_PER_SEC - GPM_METRIC_NVLINK_L33_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L33_RX_PER_SEC - GPM_METRIC_NVLINK_L33_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L33_TX_PER_SEC - GPM_METRIC_NVLINK_L34_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L34_RX_PER_SEC - GPM_METRIC_NVLINK_L34_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L34_TX_PER_SEC - GPM_METRIC_NVLINK_L35_RX_PER_SEC = NVML_GPM_METRIC_NVLINK_L35_RX_PER_SEC - GPM_METRIC_NVLINK_L35_TX_PER_SEC = NVML_GPM_METRIC_NVLINK_L35_TX_PER_SEC + GPM_METRIC_C2C_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_TOTAL_TX_PER_SEC, 'C2C total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_TOTAL_RX_PER_SEC, 'C2C total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_DATA_TX_PER_SEC, 'C2C data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_DATA_RX_PER_SEC, 'C2C data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK0_TOTAL_TX_PER_SEC, 'C2C link 0 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK0_TOTAL_RX_PER_SEC, 'C2C link 0 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK0_DATA_TX_PER_SEC, 'C2C link 0 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK0_DATA_RX_PER_SEC, 'C2C link 0 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK1_TOTAL_TX_PER_SEC, 'C2C link 1 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK1_TOTAL_RX_PER_SEC, 'C2C link 1 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK1_DATA_TX_PER_SEC, 'C2C link 1 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK1_DATA_RX_PER_SEC, 'C2C link 1 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK2_TOTAL_TX_PER_SEC, 'C2C link 2 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK2_TOTAL_RX_PER_SEC, 'C2C link 2 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK2_DATA_TX_PER_SEC, 'C2C link 2 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK2_DATA_RX_PER_SEC, 'C2C link 2 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK3_TOTAL_TX_PER_SEC, 'C2C link 3 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK3_TOTAL_RX_PER_SEC, 'C2C link 3 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK3_DATA_TX_PER_SEC, 'C2C link 3 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK3_DATA_RX_PER_SEC, 'C2C link 3 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK4_TOTAL_TX_PER_SEC, 'C2C link 4 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK4_TOTAL_RX_PER_SEC, 'C2C link 4 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK4_DATA_TX_PER_SEC, 'C2C link 4 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK4_DATA_RX_PER_SEC, 'C2C link 4 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK5_TOTAL_TX_PER_SEC, 'C2C link 5 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK5_TOTAL_RX_PER_SEC, 'C2C link 5 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK5_DATA_TX_PER_SEC, 'C2C link 5 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK5_DATA_RX_PER_SEC, 'C2C link 5 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK6_TOTAL_TX_PER_SEC, 'C2C link 6 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK6_TOTAL_RX_PER_SEC, 'C2C link 6 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK6_DATA_TX_PER_SEC, 'C2C link 6 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK6_DATA_RX_PER_SEC, 'C2C link 6 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK7_TOTAL_TX_PER_SEC, 'C2C link 7 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK7_TOTAL_RX_PER_SEC, 'C2C link 7 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK7_DATA_TX_PER_SEC, 'C2C link 7 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK7_DATA_RX_PER_SEC, 'C2C link 7 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK8_TOTAL_TX_PER_SEC, 'C2C link 8 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK8_TOTAL_RX_PER_SEC, 'C2C link 8 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK8_DATA_TX_PER_SEC, 'C2C link 8 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK8_DATA_RX_PER_SEC, 'C2C link 8 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK9_TOTAL_TX_PER_SEC, 'C2C link 9 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK9_TOTAL_RX_PER_SEC, 'C2C link 9 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK9_DATA_TX_PER_SEC, 'C2C link 9 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK9_DATA_RX_PER_SEC, 'C2C link 9 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK10_TOTAL_TX_PER_SEC, 'C2C link 10 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK10_TOTAL_RX_PER_SEC, 'C2C link 10 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK10_DATA_TX_PER_SEC, 'C2C link 10 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK10_DATA_RX_PER_SEC, 'C2C link 10 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK11_TOTAL_TX_PER_SEC, 'C2C link 11 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK11_TOTAL_RX_PER_SEC, 'C2C link 11 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK11_DATA_TX_PER_SEC, 'C2C link 11 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK11_DATA_RX_PER_SEC, 'C2C link 11 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK12_TOTAL_TX_PER_SEC, 'C2C link 12 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK12_TOTAL_RX_PER_SEC, 'C2C link 12 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK12_DATA_TX_PER_SEC, 'C2C link 12 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK12_DATA_RX_PER_SEC, 'C2C link 12 data receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK13_TOTAL_TX_PER_SEC, 'C2C link 13 total transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK13_TOTAL_RX_PER_SEC, 'C2C link 13 total receive bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK13_DATA_TX_PER_SEC, 'C2C link 13 data transmit bandwidth in MiB/sec.') + GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC = (NVML_GPM_METRIC_C2C_LINK13_DATA_RX_PER_SEC, 'C2C link 13 data receive bandwidth in MiB/sec.') + GPM_METRIC_HOSTMEM_CACHE_HIT = (NVML_GPM_METRIC_HOSTMEM_CACHE_HIT, 'Percentage of host memory cache hits. 0.0 - 100.0.') + GPM_METRIC_HOSTMEM_CACHE_MISS = (NVML_GPM_METRIC_HOSTMEM_CACHE_MISS, 'Percentage of host memory cache misses. 0.0 - 100.0.') + GPM_METRIC_PEERMEM_CACHE_HIT = (NVML_GPM_METRIC_PEERMEM_CACHE_HIT, 'Percentage of peer memory cache hits. 0.0 - 100.0.') + GPM_METRIC_PEERMEM_CACHE_MISS = (NVML_GPM_METRIC_PEERMEM_CACHE_MISS, 'Percentage of peer memory cache misses. 0.0 - 100.0.') + GPM_METRIC_DRAM_CACHE_HIT = (NVML_GPM_METRIC_DRAM_CACHE_HIT, 'Percentage of DRAM cache hits. 0.0 - 100.0.') + GPM_METRIC_DRAM_CACHE_MISS = (NVML_GPM_METRIC_DRAM_CACHE_MISS, 'Percentage of DRAM cache misses. 0.0 - 100.0.') + GPM_METRIC_NVENC_0_UTIL = (NVML_GPM_METRIC_NVENC_0_UTIL, 'Percent utilization of NVENC 0. 0.0 - 100.0.') + GPM_METRIC_NVENC_1_UTIL = (NVML_GPM_METRIC_NVENC_1_UTIL, 'Percent utilization of NVENC 1. 0.0 - 100.0.') + GPM_METRIC_NVENC_2_UTIL = (NVML_GPM_METRIC_NVENC_2_UTIL, 'Percent utilization of NVENC 2. 0.0 - 100.0.') + GPM_METRIC_NVENC_3_UTIL = (NVML_GPM_METRIC_NVENC_3_UTIL, 'Percent utilization of NVENC 3. 0.0 - 100.0.') + GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 0.') + GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR0_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 0.') + GPM_METRIC_GR0_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR0_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 0.') + GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR0_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 0.') + GPM_METRIC_GR0_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR0_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 0 context switches were active. 0.0 - 100.0.') + GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 1.') + GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR1_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 1.') + GPM_METRIC_GR1_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR1_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 1.') + GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR1_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 1.') + GPM_METRIC_GR1_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR1_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 1 context switches were active. 0.0 - 100.0.') + GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 2.') + GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR2_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 2.') + GPM_METRIC_GR2_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR2_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 2.') + GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR2_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 2.') + GPM_METRIC_GR2_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR2_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 2 context switches were active. 0.0 - 100.0.') + GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 3.') + GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR3_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 3.') + GPM_METRIC_GR3_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR3_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 3.') + GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR3_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 3.') + GPM_METRIC_GR3_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR3_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 3 context switches were active. 0.0 - 100.0.') + GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 4.') + GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR4_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 4.') + GPM_METRIC_GR4_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR4_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 4.') + GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR4_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 4.') + GPM_METRIC_GR4_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR4_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 4 context switches were active. 0.0 - 100.0.') + GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 5.') + GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR5_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 5.') + GPM_METRIC_GR5_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR5_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 5.') + GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR5_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 5.') + GPM_METRIC_GR5_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR5_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 5 context switches were active. 0.0 - 100.0.') + GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 6.') + GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR6_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 6.') + GPM_METRIC_GR6_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR6_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 6.') + GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR6_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 6.') + GPM_METRIC_GR6_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR6_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 6 context switches were active. 0.0 - 100.0.') + GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED = (NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ELAPSED, 'Total context switch cycles elapsed for GR engine 7.') + GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE = (NVML_GPM_METRIC_GR7_CTXSW_CYCLES_ACTIVE, 'Active context switch cycles for GR engine 7.') + GPM_METRIC_GR7_CTXSW_REQUESTS = (NVML_GPM_METRIC_GR7_CTXSW_REQUESTS, 'Number of context switch requests for GR engine 7.') + GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ = (NVML_GPM_METRIC_GR7_CTXSW_CYCLES_PER_REQ, 'Average context switch cycles per request for GR engine 7.') + GPM_METRIC_GR7_CTXSW_ACTIVE_PCT = (NVML_GPM_METRIC_GR7_CTXSW_ACTIVE_PCT, 'Percentage of time GR engine 7 context switches were active. 0.0 - 100.0.') + GPM_METRIC_NVLINK_L18_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L18_RX_PER_SEC, 'NvLink read bandwidth for link 18 in MiB/sec.') + GPM_METRIC_NVLINK_L18_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L18_TX_PER_SEC, 'NvLink write bandwidth for link 18 in MiB/sec.') + GPM_METRIC_NVLINK_L19_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L19_RX_PER_SEC, 'NvLink read bandwidth for link 19 in MiB/sec.') + GPM_METRIC_NVLINK_L19_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L19_TX_PER_SEC, 'NvLink write bandwidth for link 19 in MiB/sec.') + GPM_METRIC_NVLINK_L20_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L20_RX_PER_SEC, 'NvLink read bandwidth for link 20 in MiB/sec.') + GPM_METRIC_NVLINK_L20_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L20_TX_PER_SEC, 'NvLink write bandwidth for link 20 in MiB/sec.') + GPM_METRIC_NVLINK_L21_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L21_RX_PER_SEC, 'NvLink read bandwidth for link 21 in MiB/sec.') + GPM_METRIC_NVLINK_L21_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L21_TX_PER_SEC, 'NvLink write bandwidth for link 21 in MiB/sec.') + GPM_METRIC_NVLINK_L22_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L22_RX_PER_SEC, 'NvLink read bandwidth for link 22 in MiB/sec.') + GPM_METRIC_NVLINK_L22_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L22_TX_PER_SEC, 'NvLink write bandwidth for link 22 in MiB/sec.') + GPM_METRIC_NVLINK_L23_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L23_RX_PER_SEC, 'NvLink read bandwidth for link 23 in MiB/sec.') + GPM_METRIC_NVLINK_L23_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L23_TX_PER_SEC, 'NvLink write bandwidth for link 23 in MiB/sec.') + GPM_METRIC_NVLINK_L24_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L24_RX_PER_SEC, 'NvLink read bandwidth for link 24 in MiB/sec.') + GPM_METRIC_NVLINK_L24_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L24_TX_PER_SEC, 'NvLink write bandwidth for link 24 in MiB/sec.') + GPM_METRIC_NVLINK_L25_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L25_RX_PER_SEC, 'NvLink read bandwidth for link 25 in MiB/sec.') + GPM_METRIC_NVLINK_L25_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L25_TX_PER_SEC, 'NvLink write bandwidth for link 25 in MiB/sec.') + GPM_METRIC_NVLINK_L26_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L26_RX_PER_SEC, 'NvLink read bandwidth for link 26 in MiB/sec.') + GPM_METRIC_NVLINK_L26_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L26_TX_PER_SEC, 'NvLink write bandwidth for link 26 in MiB/sec.') + GPM_METRIC_NVLINK_L27_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L27_RX_PER_SEC, 'NvLink read bandwidth for link 27 in MiB/sec.') + GPM_METRIC_NVLINK_L27_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L27_TX_PER_SEC, 'NvLink write bandwidth for link 27 in MiB/sec.') + GPM_METRIC_NVLINK_L28_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L28_RX_PER_SEC, 'NvLink read bandwidth for link 28 in MiB/sec.') + GPM_METRIC_NVLINK_L28_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L28_TX_PER_SEC, 'NvLink write bandwidth for link 28 in MiB/sec.') + GPM_METRIC_NVLINK_L29_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L29_RX_PER_SEC, 'NvLink read bandwidth for link 29 in MiB/sec.') + GPM_METRIC_NVLINK_L29_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L29_TX_PER_SEC, 'NvLink write bandwidth for link 29 in MiB/sec.') + GPM_METRIC_NVLINK_L30_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L30_RX_PER_SEC, 'NvLink read bandwidth for link 30 in MiB/sec.') + GPM_METRIC_NVLINK_L30_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L30_TX_PER_SEC, 'NvLink write bandwidth for link 30 in MiB/sec.') + GPM_METRIC_NVLINK_L31_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L31_RX_PER_SEC, 'NvLink read bandwidth for link 31 in MiB/sec.') + GPM_METRIC_NVLINK_L31_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L31_TX_PER_SEC, 'NvLink write bandwidth for link 31 in MiB/sec.') + GPM_METRIC_NVLINK_L32_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L32_RX_PER_SEC, 'NvLink read bandwidth for link 32 in MiB/sec.') + GPM_METRIC_NVLINK_L32_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L32_TX_PER_SEC, 'NvLink write bandwidth for link 32 in MiB/sec.') + GPM_METRIC_NVLINK_L33_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L33_RX_PER_SEC, 'NvLink read bandwidth for link 33 in MiB/sec.') + GPM_METRIC_NVLINK_L33_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L33_TX_PER_SEC, 'NvLink write bandwidth for link 33 in MiB/sec.') + GPM_METRIC_NVLINK_L34_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L34_RX_PER_SEC, 'NvLink read bandwidth for link 34 in MiB/sec.') + GPM_METRIC_NVLINK_L34_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L34_TX_PER_SEC, 'NvLink write bandwidth for link 34 in MiB/sec.') + GPM_METRIC_NVLINK_L35_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L35_RX_PER_SEC, 'NvLink read bandwidth for link 35 in MiB/sec.') + GPM_METRIC_NVLINK_L35_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L35_TX_PER_SEC, 'NvLink write bandwidth for link 35 in MiB/sec.') GPM_METRIC_SM_CYCLES_ELAPSED = (NVML_GPM_METRIC_SM_CYCLES_ELAPSED, "The GPU's SM cycles elapsed since reboot.") GPM_METRIC_SM_CYCLES_ACTIVE = (NVML_GPM_METRIC_SM_CYCLES_ACTIVE, "The GPU's SM activity since reboot.") GPM_METRIC_MMA_CYCLES_ACTIVE = (NVML_GPM_METRIC_MMA_CYCLES_ACTIVE, "The GPU's SM MMA tensor activity since reboot.") @@ -1060,8 +1067,8 @@ class GpmMetricId(_cyb_FastEnum): GPM_METRIC_PCIE_RX = (NVML_GPM_METRIC_PCIE_RX, 'The PCIe RX traffic since reboot.') GPM_METRIC_INTEGER_CYCLES_ACTIVE = (NVML_GPM_METRIC_INTEGER_CYCLES_ACTIVE, "The GPU's SM integer activity since reboot.") GPM_METRIC_FP64_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP64_CYCLES_ACTIVE, "The GPU's SM FP64 activity since reboot.") - GPM_METRIC_FP32_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP32_CYCLES_ACTIVE, "The GPU's SM FP64 activity since reboot.") - GPM_METRIC_FP16_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP16_CYCLES_ACTIVE, "The GPU's SM FP64 activity since reboot.") + GPM_METRIC_FP32_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP32_CYCLES_ACTIVE, "The GPU's SM FP32 activity since reboot.") + GPM_METRIC_FP16_CYCLES_ACTIVE = (NVML_GPM_METRIC_FP16_CYCLES_ACTIVE, "The GPU's SM FP16 activity since reboot.") GPM_METRIC_NVLINK_L0_RX = (NVML_GPM_METRIC_NVLINK_L0_RX, 'NvLink read for link 0 in bytes since reboot.') GPM_METRIC_NVLINK_L0_TX = (NVML_GPM_METRIC_NVLINK_L0_TX, 'NvLink write for link 0 in bytes since reboot.') GPM_METRIC_NVLINK_L1_RX = (NVML_GPM_METRIC_NVLINK_L1_RX, 'NvLink read for link 1 in bytes since reboot.') @@ -1134,6 +1141,150 @@ class GpmMetricId(_cyb_FastEnum): GPM_METRIC_NVLINK_L34_TX = (NVML_GPM_METRIC_NVLINK_L34_TX, 'NvLink write for link 34 in bytes since reboot.') GPM_METRIC_NVLINK_L35_RX = (NVML_GPM_METRIC_NVLINK_L35_RX, 'NvLink read for link 35 in bytes since reboot.') GPM_METRIC_NVLINK_L35_TX = (NVML_GPM_METRIC_NVLINK_L35_TX, 'NvLink write for link 35 in bytes since reboot.') + GPM_METRIC_NVLINK_L36_RX = (NVML_GPM_METRIC_NVLINK_L36_RX, 'NvLink read for link 36 in bytes since reboot.') + GPM_METRIC_NVLINK_L36_TX = (NVML_GPM_METRIC_NVLINK_L36_TX, 'NvLink write for link 36 in bytes since reboot.') + GPM_METRIC_NVLINK_L37_RX = (NVML_GPM_METRIC_NVLINK_L37_RX, 'NvLink read for link 37 in bytes since reboot.') + GPM_METRIC_NVLINK_L37_TX = (NVML_GPM_METRIC_NVLINK_L37_TX, 'NvLink write for link 37 in bytes since reboot.') + GPM_METRIC_NVLINK_L38_RX = (NVML_GPM_METRIC_NVLINK_L38_RX, 'NvLink read for link 38 in bytes since reboot.') + GPM_METRIC_NVLINK_L38_TX = (NVML_GPM_METRIC_NVLINK_L38_TX, 'NvLink write for link 38 in bytes since reboot.') + GPM_METRIC_NVLINK_L39_RX = (NVML_GPM_METRIC_NVLINK_L39_RX, 'NvLink read for link 39 in bytes since reboot.') + GPM_METRIC_NVLINK_L39_TX = (NVML_GPM_METRIC_NVLINK_L39_TX, 'NvLink write for link 39 in bytes since reboot.') + GPM_METRIC_NVLINK_L40_RX = (NVML_GPM_METRIC_NVLINK_L40_RX, 'NvLink read for link 40 in bytes since reboot.') + GPM_METRIC_NVLINK_L40_TX = (NVML_GPM_METRIC_NVLINK_L40_TX, 'NvLink write for link 40 in bytes since reboot.') + GPM_METRIC_NVLINK_L41_RX = (NVML_GPM_METRIC_NVLINK_L41_RX, 'NvLink read for link 41 in bytes since reboot.') + GPM_METRIC_NVLINK_L41_TX = (NVML_GPM_METRIC_NVLINK_L41_TX, 'NvLink write for link 41 in bytes since reboot.') + GPM_METRIC_NVLINK_L42_RX = (NVML_GPM_METRIC_NVLINK_L42_RX, 'NvLink read for link 42 in bytes since reboot.') + GPM_METRIC_NVLINK_L42_TX = (NVML_GPM_METRIC_NVLINK_L42_TX, 'NvLink write for link 42 in bytes since reboot.') + GPM_METRIC_NVLINK_L43_RX = (NVML_GPM_METRIC_NVLINK_L43_RX, 'NvLink read for link 43 in bytes since reboot.') + GPM_METRIC_NVLINK_L43_TX = (NVML_GPM_METRIC_NVLINK_L43_TX, 'NvLink write for link 43 in bytes since reboot.') + GPM_METRIC_NVLINK_L44_RX = (NVML_GPM_METRIC_NVLINK_L44_RX, 'NvLink read for link 44 in bytes since reboot.') + GPM_METRIC_NVLINK_L44_TX = (NVML_GPM_METRIC_NVLINK_L44_TX, 'NvLink write for link 44 in bytes since reboot.') + GPM_METRIC_NVLINK_L45_RX = (NVML_GPM_METRIC_NVLINK_L45_RX, 'NvLink read for link 45 in bytes since reboot.') + GPM_METRIC_NVLINK_L45_TX = (NVML_GPM_METRIC_NVLINK_L45_TX, 'NvLink write for link 45 in bytes since reboot.') + GPM_METRIC_NVLINK_L46_RX = (NVML_GPM_METRIC_NVLINK_L46_RX, 'NvLink read for link 46 in bytes since reboot.') + GPM_METRIC_NVLINK_L46_TX = (NVML_GPM_METRIC_NVLINK_L46_TX, 'NvLink write for link 46 in bytes since reboot.') + GPM_METRIC_NVLINK_L47_RX = (NVML_GPM_METRIC_NVLINK_L47_RX, 'NvLink read for link 47 in bytes since reboot.') + GPM_METRIC_NVLINK_L47_TX = (NVML_GPM_METRIC_NVLINK_L47_TX, 'NvLink write for link 47 in bytes since reboot.') + GPM_METRIC_NVLINK_L48_RX = (NVML_GPM_METRIC_NVLINK_L48_RX, 'NvLink read for link 48 in bytes since reboot.') + GPM_METRIC_NVLINK_L48_TX = (NVML_GPM_METRIC_NVLINK_L48_TX, 'NvLink write for link 48 in bytes since reboot.') + GPM_METRIC_NVLINK_L49_RX = (NVML_GPM_METRIC_NVLINK_L49_RX, 'NvLink read for link 49 in bytes since reboot.') + GPM_METRIC_NVLINK_L49_TX = (NVML_GPM_METRIC_NVLINK_L49_TX, 'NvLink write for link 49 in bytes since reboot.') + GPM_METRIC_NVLINK_L50_RX = (NVML_GPM_METRIC_NVLINK_L50_RX, 'NvLink read for link 50 in bytes since reboot.') + GPM_METRIC_NVLINK_L50_TX = (NVML_GPM_METRIC_NVLINK_L50_TX, 'NvLink write for link 50 in bytes since reboot.') + GPM_METRIC_NVLINK_L51_RX = (NVML_GPM_METRIC_NVLINK_L51_RX, 'NvLink read for link 51 in bytes since reboot.') + GPM_METRIC_NVLINK_L51_TX = (NVML_GPM_METRIC_NVLINK_L51_TX, 'NvLink write for link 51 in bytes since reboot.') + GPM_METRIC_NVLINK_L52_RX = (NVML_GPM_METRIC_NVLINK_L52_RX, 'NvLink read for link 52 in bytes since reboot.') + GPM_METRIC_NVLINK_L52_TX = (NVML_GPM_METRIC_NVLINK_L52_TX, 'NvLink write for link 52 in bytes since reboot.') + GPM_METRIC_NVLINK_L53_RX = (NVML_GPM_METRIC_NVLINK_L53_RX, 'NvLink read for link 53 in bytes since reboot.') + GPM_METRIC_NVLINK_L53_TX = (NVML_GPM_METRIC_NVLINK_L53_TX, 'NvLink write for link 53 in bytes since reboot.') + GPM_METRIC_NVLINK_L54_RX = (NVML_GPM_METRIC_NVLINK_L54_RX, 'NvLink read for link 54 in bytes since reboot.') + GPM_METRIC_NVLINK_L54_TX = (NVML_GPM_METRIC_NVLINK_L54_TX, 'NvLink write for link 54 in bytes since reboot.') + GPM_METRIC_NVLINK_L55_RX = (NVML_GPM_METRIC_NVLINK_L55_RX, 'NvLink read for link 55 in bytes since reboot.') + GPM_METRIC_NVLINK_L55_TX = (NVML_GPM_METRIC_NVLINK_L55_TX, 'NvLink write for link 55 in bytes since reboot.') + GPM_METRIC_NVLINK_L56_RX = (NVML_GPM_METRIC_NVLINK_L56_RX, 'NvLink read for link 56 in bytes since reboot.') + GPM_METRIC_NVLINK_L56_TX = (NVML_GPM_METRIC_NVLINK_L56_TX, 'NvLink write for link 56 in bytes since reboot.') + GPM_METRIC_NVLINK_L57_RX = (NVML_GPM_METRIC_NVLINK_L57_RX, 'NvLink read for link 57 in bytes since reboot.') + GPM_METRIC_NVLINK_L57_TX = (NVML_GPM_METRIC_NVLINK_L57_TX, 'NvLink write for link 57 in bytes since reboot.') + GPM_METRIC_NVLINK_L58_RX = (NVML_GPM_METRIC_NVLINK_L58_RX, 'NvLink read for link 58 in bytes since reboot.') + GPM_METRIC_NVLINK_L58_TX = (NVML_GPM_METRIC_NVLINK_L58_TX, 'NvLink write for link 58 in bytes since reboot.') + GPM_METRIC_NVLINK_L59_RX = (NVML_GPM_METRIC_NVLINK_L59_RX, 'NvLink read for link 59 in bytes since reboot.') + GPM_METRIC_NVLINK_L59_TX = (NVML_GPM_METRIC_NVLINK_L59_TX, 'NvLink write for link 59 in bytes since reboot.') + GPM_METRIC_NVLINK_L60_RX = (NVML_GPM_METRIC_NVLINK_L60_RX, 'NvLink read for link 60 in bytes since reboot.') + GPM_METRIC_NVLINK_L60_TX = (NVML_GPM_METRIC_NVLINK_L60_TX, 'NvLink write for link 60 in bytes since reboot.') + GPM_METRIC_NVLINK_L61_RX = (NVML_GPM_METRIC_NVLINK_L61_RX, 'NvLink read for link 61 in bytes since reboot.') + GPM_METRIC_NVLINK_L61_TX = (NVML_GPM_METRIC_NVLINK_L61_TX, 'NvLink write for link 61 in bytes since reboot.') + GPM_METRIC_NVLINK_L62_RX = (NVML_GPM_METRIC_NVLINK_L62_RX, 'NvLink read for link 62 in bytes since reboot.') + GPM_METRIC_NVLINK_L62_TX = (NVML_GPM_METRIC_NVLINK_L62_TX, 'NvLink write for link 62 in bytes since reboot.') + GPM_METRIC_NVLINK_L63_RX = (NVML_GPM_METRIC_NVLINK_L63_RX, 'NvLink read for link 63 in bytes since reboot.') + GPM_METRIC_NVLINK_L63_TX = (NVML_GPM_METRIC_NVLINK_L63_TX, 'NvLink write for link 63 in bytes since reboot.') + GPM_METRIC_NVLINK_L64_RX = (NVML_GPM_METRIC_NVLINK_L64_RX, 'NvLink read for link 64 in bytes since reboot.') + GPM_METRIC_NVLINK_L64_TX = (NVML_GPM_METRIC_NVLINK_L64_TX, 'NvLink write for link 64 in bytes since reboot.') + GPM_METRIC_NVLINK_L65_RX = (NVML_GPM_METRIC_NVLINK_L65_RX, 'NvLink read for link 65 in bytes since reboot.') + GPM_METRIC_NVLINK_L65_TX = (NVML_GPM_METRIC_NVLINK_L65_TX, 'NvLink write for link 65 in bytes since reboot.') + GPM_METRIC_NVLINK_L66_RX = (NVML_GPM_METRIC_NVLINK_L66_RX, 'NvLink read for link 66 in bytes since reboot.') + GPM_METRIC_NVLINK_L66_TX = (NVML_GPM_METRIC_NVLINK_L66_TX, 'NvLink write for link 66 in bytes since reboot.') + GPM_METRIC_NVLINK_L67_RX = (NVML_GPM_METRIC_NVLINK_L67_RX, 'NvLink read for link 67 in bytes since reboot.') + GPM_METRIC_NVLINK_L67_TX = (NVML_GPM_METRIC_NVLINK_L67_TX, 'NvLink write for link 67 in bytes since reboot.') + GPM_METRIC_NVLINK_L68_RX = (NVML_GPM_METRIC_NVLINK_L68_RX, 'NvLink read for link 68 in bytes since reboot.') + GPM_METRIC_NVLINK_L68_TX = (NVML_GPM_METRIC_NVLINK_L68_TX, 'NvLink write for link 68 in bytes since reboot.') + GPM_METRIC_NVLINK_L69_RX = (NVML_GPM_METRIC_NVLINK_L69_RX, 'NvLink read for link 69 in bytes since reboot.') + GPM_METRIC_NVLINK_L69_TX = (NVML_GPM_METRIC_NVLINK_L69_TX, 'NvLink write for link 69 in bytes since reboot.') + GPM_METRIC_NVLINK_L70_RX = (NVML_GPM_METRIC_NVLINK_L70_RX, 'NvLink read for link 70 in bytes since reboot.') + GPM_METRIC_NVLINK_L70_TX = (NVML_GPM_METRIC_NVLINK_L70_TX, 'NvLink write for link 70 in bytes since reboot.') + GPM_METRIC_NVLINK_L71_RX = (NVML_GPM_METRIC_NVLINK_L71_RX, 'NvLink read for link 71 in bytes since reboot.') + GPM_METRIC_NVLINK_L71_TX = (NVML_GPM_METRIC_NVLINK_L71_TX, 'NvLink write for link 71 in bytes since reboot.') + GPM_METRIC_NVLINK_L36_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L36_RX_PER_SEC, 'NvLink read bandwidth for link 36 in MiB/sec.') + GPM_METRIC_NVLINK_L36_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L36_TX_PER_SEC, 'NvLink write bandwidth for link 36 in MiB/sec.') + GPM_METRIC_NVLINK_L37_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L37_RX_PER_SEC, 'NvLink read bandwidth for link 37 in MiB/sec.') + GPM_METRIC_NVLINK_L37_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L37_TX_PER_SEC, 'NvLink write bandwidth for link 37 in MiB/sec.') + GPM_METRIC_NVLINK_L38_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L38_RX_PER_SEC, 'NvLink read bandwidth for link 38 in MiB/sec.') + GPM_METRIC_NVLINK_L38_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L38_TX_PER_SEC, 'NvLink write bandwidth for link 38 in MiB/sec.') + GPM_METRIC_NVLINK_L39_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L39_RX_PER_SEC, 'NvLink read bandwidth for link 39 in MiB/sec.') + GPM_METRIC_NVLINK_L39_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L39_TX_PER_SEC, 'NvLink write bandwidth for link 39 in MiB/sec.') + GPM_METRIC_NVLINK_L40_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L40_RX_PER_SEC, 'NvLink read bandwidth for link 40 in MiB/sec.') + GPM_METRIC_NVLINK_L40_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L40_TX_PER_SEC, 'NvLink write bandwidth for link 40 in MiB/sec.') + GPM_METRIC_NVLINK_L41_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L41_RX_PER_SEC, 'NvLink read bandwidth for link 41 in MiB/sec.') + GPM_METRIC_NVLINK_L41_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L41_TX_PER_SEC, 'NvLink write bandwidth for link 41 in MiB/sec.') + GPM_METRIC_NVLINK_L42_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L42_RX_PER_SEC, 'NvLink read bandwidth for link 42 in MiB/sec.') + GPM_METRIC_NVLINK_L42_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L42_TX_PER_SEC, 'NvLink write bandwidth for link 42 in MiB/sec.') + GPM_METRIC_NVLINK_L43_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L43_RX_PER_SEC, 'NvLink read bandwidth for link 43 in MiB/sec.') + GPM_METRIC_NVLINK_L43_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L43_TX_PER_SEC, 'NvLink write bandwidth for link 43 in MiB/sec.') + GPM_METRIC_NVLINK_L44_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L44_RX_PER_SEC, 'NvLink read bandwidth for link 44 in MiB/sec.') + GPM_METRIC_NVLINK_L44_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L44_TX_PER_SEC, 'NvLink write bandwidth for link 44 in MiB/sec.') + GPM_METRIC_NVLINK_L45_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L45_RX_PER_SEC, 'NvLink read bandwidth for link 45 in MiB/sec.') + GPM_METRIC_NVLINK_L45_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L45_TX_PER_SEC, 'NvLink write bandwidth for link 45 in MiB/sec.') + GPM_METRIC_NVLINK_L46_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L46_RX_PER_SEC, 'NvLink read bandwidth for link 46 in MiB/sec.') + GPM_METRIC_NVLINK_L46_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L46_TX_PER_SEC, 'NvLink write bandwidth for link 46 in MiB/sec.') + GPM_METRIC_NVLINK_L47_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L47_RX_PER_SEC, 'NvLink read bandwidth for link 47 in MiB/sec.') + GPM_METRIC_NVLINK_L47_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L47_TX_PER_SEC, 'NvLink write bandwidth for link 47 in MiB/sec.') + GPM_METRIC_NVLINK_L48_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L48_RX_PER_SEC, 'NvLink read bandwidth for link 48 in MiB/sec.') + GPM_METRIC_NVLINK_L48_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L48_TX_PER_SEC, 'NvLink write bandwidth for link 48 in MiB/sec.') + GPM_METRIC_NVLINK_L49_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L49_RX_PER_SEC, 'NvLink read bandwidth for link 49 in MiB/sec.') + GPM_METRIC_NVLINK_L49_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L49_TX_PER_SEC, 'NvLink write bandwidth for link 49 in MiB/sec.') + GPM_METRIC_NVLINK_L50_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L50_RX_PER_SEC, 'NvLink read bandwidth for link 50 in MiB/sec.') + GPM_METRIC_NVLINK_L50_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L50_TX_PER_SEC, 'NvLink write bandwidth for link 50 in MiB/sec.') + GPM_METRIC_NVLINK_L51_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L51_RX_PER_SEC, 'NvLink read bandwidth for link 51 in MiB/sec.') + GPM_METRIC_NVLINK_L51_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L51_TX_PER_SEC, 'NvLink write bandwidth for link 51 in MiB/sec.') + GPM_METRIC_NVLINK_L52_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L52_RX_PER_SEC, 'NvLink read bandwidth for link 52 in MiB/sec.') + GPM_METRIC_NVLINK_L52_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L52_TX_PER_SEC, 'NvLink write bandwidth for link 52 in MiB/sec.') + GPM_METRIC_NVLINK_L53_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L53_RX_PER_SEC, 'NvLink read bandwidth for link 53 in MiB/sec.') + GPM_METRIC_NVLINK_L53_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L53_TX_PER_SEC, 'NvLink write bandwidth for link 53 in MiB/sec.') + GPM_METRIC_NVLINK_L54_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L54_RX_PER_SEC, 'NvLink read bandwidth for link 54 in MiB/sec.') + GPM_METRIC_NVLINK_L54_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L54_TX_PER_SEC, 'NvLink write bandwidth for link 54 in MiB/sec.') + GPM_METRIC_NVLINK_L55_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L55_RX_PER_SEC, 'NvLink read bandwidth for link 55 in MiB/sec.') + GPM_METRIC_NVLINK_L55_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L55_TX_PER_SEC, 'NvLink write bandwidth for link 55 in MiB/sec.') + GPM_METRIC_NVLINK_L56_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L56_RX_PER_SEC, 'NvLink read bandwidth for link 56 in MiB/sec.') + GPM_METRIC_NVLINK_L56_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L56_TX_PER_SEC, 'NvLink write bandwidth for link 56 in MiB/sec.') + GPM_METRIC_NVLINK_L57_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L57_RX_PER_SEC, 'NvLink read bandwidth for link 57 in MiB/sec.') + GPM_METRIC_NVLINK_L57_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L57_TX_PER_SEC, 'NvLink write bandwidth for link 57 in MiB/sec.') + GPM_METRIC_NVLINK_L58_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L58_RX_PER_SEC, 'NvLink read bandwidth for link 58 in MiB/sec.') + GPM_METRIC_NVLINK_L58_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L58_TX_PER_SEC, 'NvLink write bandwidth for link 58 in MiB/sec.') + GPM_METRIC_NVLINK_L59_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L59_RX_PER_SEC, 'NvLink read bandwidth for link 59 in MiB/sec.') + GPM_METRIC_NVLINK_L59_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L59_TX_PER_SEC, 'NvLink write bandwidth for link 59 in MiB/sec.') + GPM_METRIC_NVLINK_L60_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L60_RX_PER_SEC, 'NvLink read bandwidth for link 60 in MiB/sec.') + GPM_METRIC_NVLINK_L60_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L60_TX_PER_SEC, 'NvLink write bandwidth for link 60 in MiB/sec.') + GPM_METRIC_NVLINK_L61_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L61_RX_PER_SEC, 'NvLink read bandwidth for link 61 in MiB/sec.') + GPM_METRIC_NVLINK_L61_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L61_TX_PER_SEC, 'NvLink write bandwidth for link 61 in MiB/sec.') + GPM_METRIC_NVLINK_L62_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L62_RX_PER_SEC, 'NvLink read bandwidth for link 62 in MiB/sec.') + GPM_METRIC_NVLINK_L62_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L62_TX_PER_SEC, 'NvLink write bandwidth for link 62 in MiB/sec.') + GPM_METRIC_NVLINK_L63_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L63_RX_PER_SEC, 'NvLink read bandwidth for link 63 in MiB/sec.') + GPM_METRIC_NVLINK_L63_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L63_TX_PER_SEC, 'NvLink write bandwidth for link 63 in MiB/sec.') + GPM_METRIC_NVLINK_L64_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L64_RX_PER_SEC, 'NvLink read bandwidth for link 64 in MiB/sec.') + GPM_METRIC_NVLINK_L64_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L64_TX_PER_SEC, 'NvLink write bandwidth for link 64 in MiB/sec.') + GPM_METRIC_NVLINK_L65_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L65_RX_PER_SEC, 'NvLink read bandwidth for link 65 in MiB/sec.') + GPM_METRIC_NVLINK_L65_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L65_TX_PER_SEC, 'NvLink write bandwidth for link 65 in MiB/sec.') + GPM_METRIC_NVLINK_L66_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L66_RX_PER_SEC, 'NvLink read bandwidth for link 66 in MiB/sec.') + GPM_METRIC_NVLINK_L66_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L66_TX_PER_SEC, 'NvLink write bandwidth for link 66 in MiB/sec.') + GPM_METRIC_NVLINK_L67_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L67_RX_PER_SEC, 'NvLink read bandwidth for link 67 in MiB/sec.') + GPM_METRIC_NVLINK_L67_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L67_TX_PER_SEC, 'NvLink write bandwidth for link 67 in MiB/sec.') + GPM_METRIC_NVLINK_L68_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L68_RX_PER_SEC, 'NvLink read bandwidth for link 68 in MiB/sec.') + GPM_METRIC_NVLINK_L68_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L68_TX_PER_SEC, 'NvLink write bandwidth for link 68 in MiB/sec.') + GPM_METRIC_NVLINK_L69_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L69_RX_PER_SEC, 'NvLink read bandwidth for link 69 in MiB/sec.') + GPM_METRIC_NVLINK_L69_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L69_TX_PER_SEC, 'NvLink write bandwidth for link 69 in MiB/sec.') + GPM_METRIC_NVLINK_L70_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L70_RX_PER_SEC, 'NvLink read bandwidth for link 70 in MiB/sec.') + GPM_METRIC_NVLINK_L70_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L70_TX_PER_SEC, 'NvLink write bandwidth for link 70 in MiB/sec.') + GPM_METRIC_NVLINK_L71_RX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L71_RX_PER_SEC, 'NvLink read bandwidth for link 71 in MiB/sec.') + GPM_METRIC_NVLINK_L71_TX_PER_SEC = (NVML_GPM_METRIC_NVLINK_L71_TX_PER_SEC, 'NvLink write bandwidth for link 71 in MiB/sec.') GPM_METRIC_MAX = (NVML_GPM_METRIC_MAX, 'Maximum value above +1.') class PowerProfileType(_cyb_FastEnum): @@ -1155,6 +1306,16 @@ class PowerProfileType(_cyb_FastEnum): POWER_PROFILE_SYNC_BALANCED = NVML_POWER_PROFILE_SYNC_BALANCED POWER_PROFILE_HPC = NVML_POWER_PROFILE_HPC POWER_PROFILE_MIG = NVML_POWER_PROFILE_MIG + POWER_PROFILE_MAX_Q_1 = NVML_POWER_PROFILE_MAX_Q_1 + POWER_PROFILE_NETWORK_BOUND = NVML_POWER_PROFILE_NETWORK_BOUND + POWER_PROFILE_HIGH_THROUGHPUT_INFERENCE = NVML_POWER_PROFILE_HIGH_THROUGHPUT_INFERENCE + POWER_PROFILE_MEDIUM_THROUGHPUT_INFERENCE = NVML_POWER_PROFILE_MEDIUM_THROUGHPUT_INFERENCE + POWER_PROFILE_LOW_LATENCY_INFERENCE = NVML_POWER_PROFILE_LOW_LATENCY_INFERENCE + POWER_PROFILE_TRAINING = NVML_POWER_PROFILE_TRAINING + POWER_PROFILE_INFERENCE = NVML_POWER_PROFILE_INFERENCE + POWER_PROFILE_MAX_Q_2 = NVML_POWER_PROFILE_MAX_Q_2 + POWER_PROFILE_MAX_Q_3 = NVML_POWER_PROFILE_MAX_Q_3 + POWER_PROFILE_LOW_PRIORITY_BACKGROUND = NVML_POWER_PROFILE_LOW_PRIORITY_BACKGROUND POWER_PROFILE_MAX = NVML_POWER_PROFILE_MAX class DeviceAddressingModeType(_cyb_FastEnum): @@ -1173,21 +1334,29 @@ class PRMCounterId(_cyb_FastEnum): See `nvmlPRMCounterId_t`. """ - NONE = NVML_PRM_COUNTER_ID_NONE - PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS - PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS - PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS - PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY = NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY - PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES = NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES - PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT = NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT - PPCNT_PLR_RCV_CODES = NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES - PPCNT_PLR_RCV_CODE_ERR = NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR - PPCNT_PLR_RCV_UNCORRECTABLE_CODE = NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_UNCORRECTABLE_CODE - PPCNT_PLR_XMIT_CODES = NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_CODES - PPCNT_PLR_XMIT_RETRY_CODES = NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_CODES - PPCNT_PLR_XMIT_RETRY_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_EVENTS - PPCNT_PLR_SYNC_EVENTS = NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS - PPRM_OPER_RECOVERY = NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY + NONE = (NVML_PRM_COUNTER_ID_NONE, 'Sentinel.') + PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS = (NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_LINK_DOWN_EVENTS, 'PPCNT group 0x12, link_down_events.') + PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS = (NVML_PRM_COUNTER_ID_PPCNT_PHYSICAL_LAYER_CTRS_SUCCESSFUL_RECOVERY_EVENTS, 'PPCNT group 0x12, successful_recovery_events.') + PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_EVENTS, 'PPCNT group 0x1A, total_successful_recovery_events.') + PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_SINCE_LAST_RECOVERY, 'PPCNT group 0x1A, time_since_last_recovery.') + PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_BETWEEN_LAST_TWO_RECOVERIES, 'PPCNT group 0x1A, time_between_last_two_recoveries.') + PPCNT_RECOVERY_CTRS_TIME_IN_LAST_HOST_SERDES_FEQ_RECOVERY = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TIME_IN_LAST_HOST_SERDES_FEQ_RECOVERY, 'PPCNT group 0x1A, time_in_last_host_serdes_feq_recovery.') + PPCNT_RECOVERY_CTRS_TOTAL_TIME_IN_HOST_SERDES_FEQ_RECOVERY = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_TIME_IN_HOST_SERDES_FEQ_RECOVERY, 'PPCNT group 0x1A, total_time_in_host_serdes_feq_recovery.') + PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_RECOVERY_COUNT = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_RECOVERY_COUNT, 'PPCNT group 0x1A, total_host_serdes_feq_recovery_count.') + PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_SUCCESSFUL_RECOVERY_COUNT = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_HOST_SERDES_FEQ_SUCCESSFUL_RECOVERY_COUNT, 'PPCNT group 0x1A, total_host_serdes_feq_successful_recovery_count.') + PPCNT_RECOVERY_CTRS_LAST_HOST_SERDES_FEQ_ATTEMPTS_COUNT = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_HOST_SERDES_FEQ_ATTEMPTS_COUNT, 'PPCNT group 0x1A, last_host_serdes_feq_attempts_count.') + PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_STEP_ATTEMPTS = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_STEP_ATTEMPTS, 'PPCNT group 0x1A, last_successful_recovery_step_attempts.') + PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_TIME = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_LAST_SUCCESSFUL_RECOVERY_TIME, 'PPCNT group 0x1A, last_successful_recovery_time.') + PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_TIME = (NVML_PRM_COUNTER_ID_PPCNT_RECOVERY_CTRS_TOTAL_SUCCESSFUL_RECOVERY_TIME, 'PPCNT group 0x1A, total_successful_recovery_time.') + PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT = (NVML_PRM_COUNTER_ID_PPCNT_PORTCOUNTERS_PORT_XMIT_WAIT, 'PPCNT group 0x20, port_xmit_wait.') + PPCNT_PLR_RCV_CODES = (NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODES, 'PPCNT group 0x22, plr_rcv_codes.') + PPCNT_PLR_RCV_CODE_ERR = (NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_CODE_ERR, 'PPCNT group 0x22, plr_rcv_code_err.') + PPCNT_PLR_RCV_UNCORRECTABLE_CODE = (NVML_PRM_COUNTER_ID_PPCNT_PLR_RCV_UNCORRECTABLE_CODE, 'PPCNT group 0x22, plr_rcv_uncorrectable_code.') + PPCNT_PLR_XMIT_CODES = (NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_CODES, 'PPCNT group 0x22, plr_xmit_codes.') + PPCNT_PLR_XMIT_RETRY_CODES = (NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_CODES, 'PPCNT group 0x22, plr_xmit_retry_codes.') + PPCNT_PLR_XMIT_RETRY_EVENTS = (NVML_PRM_COUNTER_ID_PPCNT_PLR_XMIT_RETRY_EVENTS, 'PPCNT group 0x22, plr_xmit_retry_events.') + PPCNT_PLR_SYNC_EVENTS = (NVML_PRM_COUNTER_ID_PPCNT_PLR_SYNC_EVENTS, 'PPCNT group 0x22, plr_sync_events.') + PPRM_OPER_RECOVERY = (NVML_PRM_COUNTER_ID_PPRM_OPER_RECOVERY, 'PPRM, oper_recovery.') class PowerProfileOperation(_cyb_FastEnum): """ @@ -1221,6 +1390,76 @@ class CPERType(_cyb_FastEnum): """ CPER_ACCESS_TYPE_GPU = (NVML_CPER_ACCESS_TYPE_GPU, 'Access GPU CPER records.') +class GpuOperationalEventLogLevel(_cyb_FastEnum): + """ + Log-level values used by GPU Operational Events. These values are used + both for event reporting in `nvmlEventSetWait_v3_t` and for + subscription filtering in `nvmlGpuOperationalEventConfig_v1_t`. Higher + numeric values represent more selective log levels. + `NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ALL` disables log-level filtering + when used as a subscription threshold. Event data may contain newer + log-level values that are not named in this header; clients should + handle unrecognized numeric values. + + See `nvmlGpuOperationalEventLogLevel_t`. + """ + ALL = (NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ALL, 'Matches all GPU Operational Event log levels.') + TELEMETRY = (NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_TELEMETRY, 'High-volume telemetry events.') + DIAG = (NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_DIAG, 'Diagnostic events.') + NOTICE = (NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_NOTICE, 'Notable operational events.') + WARNING = (NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_WARNING, 'Warning events.') + ERROR = (NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ERROR, 'Error events.') + +class OperationalEventSeverity(_cyb_FastEnum): + """ + Severity values used by Operational Events. These values are used both + for event reporting in `nvmlEventSetWait_v3_t` and for subscription + filtering in `nvmlGpuOperationalEventConfig_v1_t`. Higher numeric + values represent more selective severities. + `NVML_OPERATIONAL_EVENT_SEVERITY_ALL` disables severity filtering when + used as a subscription threshold. Event data may contain newer severity + values that are not named in this header; clients should handle + unrecognized numeric values. + + See `nvmlOperationalEventSeverity_t`. + """ + ALL = (NVML_OPERATIONAL_EVENT_SEVERITY_ALL, 'Matches all Operational Event severities.') + INFORMATIONAL = (NVML_OPERATIONAL_EVENT_SEVERITY_INFORMATIONAL, 'Informational event.') + CORRECTED = (NVML_OPERATIONAL_EVENT_SEVERITY_CORRECTED, 'Corrected error event.') + RECOVERABLE = (NVML_OPERATIONAL_EVENT_SEVERITY_RECOVERABLE, 'Recoverable error event.') + FATAL = (NVML_OPERATIONAL_EVENT_SEVERITY_FATAL, 'Fatal error event.') + +class EventDataType(_cyb_FastEnum): + """ + Event data formats returned by `nvmlEventSetWait_v3`. + + See `nvmlEventDataType_t`. + """ + EVENT = (NVML_EVENT_DATA_TYPE_NVML_EVENT, 'NVML event-bit data. `eventType` contains an NVML event bit.') + GPU_OPERATIONAL_EVENT = (NVML_EVENT_DATA_TYPE_GPU_OPERATIONAL_EVENT, 'Structured GPU Operational Event data.') + +class GpuOperationalEventContextType(_cyb_FastEnum): + """ + NVML-defined GPU Operational Event context classifications. These + values describe the NVML public interpretation of a context payload. + The original source-defined context type is returned separately in + `nvmlEventSetGetContextInfo_v1_t.sourceEventContextType`. + + See `nvmlGpuOperationalEventContextType_t`. + """ + UNKNOWN = (NVML_GPU_OPERATIONAL_EVENT_CONTEXT_TYPE_UNKNOWN, 'No NVML public interpretation is defined for this context payload.') + LEGACY_XID = (NVML_GPU_OPERATIONAL_EVENT_CONTEXT_TYPE_LEGACY_XID, 'Context payload can be decoded with `nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1`.') + +class NvlinkTelemetrySampleType(_cyb_FastEnum): + """ + Per-link NVLink telemetry sample types. + + See `nvmlNvlinkTelemetrySampleType_t`. + """ + THROUGHPUT_RAW_TX = (NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_TX, 'Raw TX flit counter for a single link.') + THROUGHPUT_RAW_RX = (NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_THROUGHPUT_RAW_RX, 'Raw RX flit counter for a single link.') + COUNT = (NVML_NVLINK_TELEMETRY_SAMPLE_TYPE_COUNT, 'Number of valid sample types.') + class AffinityScope(_FastEnum): NODE = (0, "Scope of NUMA node for affinity queries") @@ -1608,6 +1847,11 @@ class FieldId(_FastEnum): PWR_SMOOTHING_ADMIN_OVERRIDE_PRIMARY_FLOOR_TAR_WIN_MULT = (287, "Current primary floor target window multiplier value for admin override") PWR_SMOOTHING_ADMIN_OVERRIDE_PRIMARY_FLOOR_ACT_OFFSET = (288, "Current primary floor activation offset value in Watts for admin override") + DEV_ACTIVE_BANK_REMAPPINGS = (303, "Number of active bank remappings") + DEV_INACTIVE_BANK_REMAPPINGS = (304, "Number of inactive bank remappings") + DEV_BANK_REMAPPER_HISTOGRAM_MAX = (305, "Number of groups with full bank remap availability") + DEV_BANK_REMAPPER_HISTOGRAM_NONE = (306, "Number of groups with no spare bank remap availability") + DEV_PENDING_BANK_REMAPPING = (307, "If any banks are pending remapping. 1=yes 0=no") NVLINK_MAX_LINKS = 18 @@ -1643,6 +1887,9 @@ class DeviceArch(_FastEnum): ADA = 8 HOPPER = 9 BLACKWELL = 10 + DLA = 11 + DLA2 = 12 + NPU3 = 15 UNKNOWN = 0xFFFFFFFF @@ -1804,6 +2051,8 @@ class ClocksEventReasons(_FastEnum): THROTTLE_REASON_HW_THERMAL_SLOWDOWN = 0x0000000000000040 THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN = 0x0000000000000080 EVENT_REASON_DISPLAY_CLOCK_SETTING = 0x0000000000000100 + EVENT_REASON_BOARD_LIMIT = 0x0000000000000200 + EVENT_REASON_RELIABILITY = 0x0000000000000400 EVENT_REASON_NONE = 0x0000000000000000 @@ -1920,6 +2169,7 @@ class NvlinkState(_FastEnum): INACTIVE = 0x0 ACTIVE = 0x1 SLEEP = 0x2 + ACTIVE_TRAFFIC_DISABLED = 0x3 class NvlinkFirmwareUcodeType(_FastEnum): @@ -15047,7 +15297,7 @@ cdef class GpuFabricInfo_v3: @property def version(self): - """int: Structure version identifier (set to nvmlGpuFabricInfo_v2).""" + """int: Structure version identifier (set to nvmlGpuFabricInfo_v3).""" return self._ptr[0].version @version.setter @@ -16895,49 +17145,52 @@ cdef class CPERCursor_v1: return obj -cdef _get_excluded_device_info_dtype_offsets(): - cdef nvmlExcludedDeviceInfo_t pod +cdef _get_set_memory_limits_v1_dtype_offsets(): + cdef nvmlSetMemoryLimits_v1_t pod return _numpy.dtype({ - 'names': ['pci_info', 'uuid'], - 'formats': [pci_info_dtype, (_numpy.int8, 80)], + 'names': ['name_space', 'soft_limit', 'hard_limit'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64], 'offsets': [ - (&(pod.pciInfo)) - (&pod), - (&(pod.uuid)) - (&pod), + (&(pod.nameSpace)) - (&pod), + (&(pod.softLimit)) - (&pod), + (&(pod.hardLimit)) - (&pod), ], - 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), + 'itemsize': sizeof(nvmlSetMemoryLimits_v1_t), }) -excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() +set_memory_limits_v1_dtype = _get_set_memory_limits_v1_dtype_offsets() -cdef class ExcludedDeviceInfo: - """Empty-initialize an instance of `nvmlExcludedDeviceInfo_t`. +cdef class SetMemoryLimits_v1: + """Empty-initialize an instance of `nvmlSetMemoryLimits_v1_t`. - .. seealso:: `nvmlExcludedDeviceInfo_t` + .. seealso:: `nvmlSetMemoryLimits_v1_t` """ cdef: - nvmlExcludedDeviceInfo_t *_ptr + nvmlSetMemoryLimits_v1_t *_ptr object _owner bint _owned bint _readonly + dict _refs def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlExcludedDeviceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlSetMemoryLimits_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ExcludedDeviceInfo") + raise MemoryError("Error allocating SetMemoryLimits_v1") self._owner = None self._owned = True self._readonly = False + self._refs = {} def __dealloc__(self): - cdef nvmlExcludedDeviceInfo_t *ptr + cdef nvmlSetMemoryLimits_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.ExcludedDeviceInfo object at {hex(id(self))}>" + return f"<{__name__}.SetMemoryLimits_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -16951,24 +17204,24 @@ cdef class ExcludedDeviceInfo: return (self._ptr) def __eq__(self, other): - cdef ExcludedDeviceInfo other_ - if not isinstance(other, ExcludedDeviceInfo): + cdef SetMemoryLimits_v1 other_ + if not isinstance(other, SetMemoryLimits_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlExcludedDeviceInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlSetMemoryLimits_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlExcludedDeviceInfo_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlSetMemoryLimits_v1_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 = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlSetMemoryLimits_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ExcludedDeviceInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlExcludedDeviceInfo_t)) + raise MemoryError("Error allocating SetMemoryLimits_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlSetMemoryLimits_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -16976,53 +17229,61 @@ cdef class ExcludedDeviceInfo: setattr(self, key, val) @property - def pci_info(self): - """PciInfo: """ - return PciInfo.from_ptr( - &(self._ptr[0].pciInfo), - readonly=self._readonly, - owner=self, - ) + def name_space(self): + """str: [in] Full path to sysfs cgroup file name""" + cdef char* ptr = self._ptr[0].nameSpace + if ptr: + return _cyb_cpython.PyUnicode_FromString(ptr) + return "" - @pci_info.setter - def pci_info(self, val): + @name_space.setter + def name_space(self, val): if self._readonly: - raise ValueError("This ExcludedDeviceInfo instance is read-only") - cdef PciInfo val_ = val - _cyb_memcpy(&(self._ptr[0].pciInfo), (val_._get_ptr()), sizeof(nvmlPciInfo_t) * 1) + raise ValueError("This SetMemoryLimits_v1 instance is read-only") + cdef bytes buf = val.encode() + cdef char *ptr = buf + self._refs["name_space"] = buf + self._ptr[0].nameSpace = ptr @property - def uuid(self): - """~_numpy.int8: (array of length 80).""" - return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) + def soft_limit(self): + """int: [in] Soft memory limit in Bytes.""" + return self._ptr[0].softLimit - @uuid.setter - def uuid(self, val): + @soft_limit.setter + def soft_limit(self, val): if self._readonly: - raise ValueError("This ExcludedDeviceInfo instance is read-only") - cdef bytes buf = val.encode() - if len(buf) >= 80: - raise ValueError("String too long for field uuid, max length is 79") - cdef char *ptr = buf - _cyb_memcpy((self._ptr[0].uuid), ptr, 80) + raise ValueError("This SetMemoryLimits_v1 instance is read-only") + self._ptr[0].softLimit = val + + @property + def hard_limit(self): + """int: [in] Hard memory limit in Bytes.""" + return self._ptr[0].hardLimit + + @hard_limit.setter + def hard_limit(self, val): + if self._readonly: + raise ValueError("This SetMemoryLimits_v1 instance is read-only") + self._ptr[0].hardLimit = val @staticmethod def from_buffer(buffer): - """Create an ExcludedDeviceInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlExcludedDeviceInfo_t), ExcludedDeviceInfo) + """Create an SetMemoryLimits_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlSetMemoryLimits_v1_t), SetMemoryLimits_v1) @staticmethod def from_data(data): - """Create an ExcludedDeviceInfo instance wrapping the given NumPy array. + """Create an SetMemoryLimits_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `excluded_device_info_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `set_memory_limits_v1_dtype` holding the data. """ - return _cyb_from_data(data, "excluded_device_info_dtype", excluded_device_info_dtype, ExcludedDeviceInfo) + return _cyb_from_data(data, "set_memory_limits_v1_dtype", set_memory_limits_v1_dtype, SetMemoryLimits_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an ExcludedDeviceInfo instance wrapping the given pointer. + """Create an SetMemoryLimits_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -17031,69 +17292,70 @@ cdef class ExcludedDeviceInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef ExcludedDeviceInfo obj = ExcludedDeviceInfo.__new__(ExcludedDeviceInfo) + cdef SetMemoryLimits_v1 obj = SetMemoryLimits_v1.__new__(SetMemoryLimits_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlSetMemoryLimits_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ExcludedDeviceInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlExcludedDeviceInfo_t)) + raise MemoryError("Error allocating SetMemoryLimits_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlSetMemoryLimits_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly + obj._refs = {} return obj -cdef _get_process_detail_list_v1_dtype_offsets(): - cdef nvmlProcessDetailList_v1_t pod +cdef _get_get_memory_limits_v1_dtype_offsets(): + cdef nvmlGetMemoryLimits_v1_t pod return _numpy.dtype({ - 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], + 'names': ['name_space', 'soft_limit', 'hard_limit', 'current_used'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.mode)) - (&pod), - (&(pod.numProcArrayEntries)) - (&pod), - (&(pod.procArray)) - (&pod), + (&(pod.nameSpace)) - (&pod), + (&(pod.softLimit)) - (&pod), + (&(pod.hardLimit)) - (&pod), + (&(pod.currentUsed)) - (&pod), ], - 'itemsize': sizeof(nvmlProcessDetailList_v1_t), + 'itemsize': sizeof(nvmlGetMemoryLimits_v1_t), }) -process_detail_list_v1_dtype = _get_process_detail_list_v1_dtype_offsets() +get_memory_limits_v1_dtype = _get_get_memory_limits_v1_dtype_offsets() -cdef class ProcessDetailList_v1: - """Empty-initialize an instance of `nvmlProcessDetailList_v1_t`. +cdef class GetMemoryLimits_v1: + """Empty-initialize an instance of `nvmlGetMemoryLimits_v1_t`. - .. seealso:: `nvmlProcessDetailList_v1_t` + .. seealso:: `nvmlGetMemoryLimits_v1_t` """ cdef: - nvmlProcessDetailList_v1_t *_ptr + nvmlGetMemoryLimits_v1_t *_ptr object _owner bint _owned bint _readonly dict _refs def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlProcessDetailList_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGetMemoryLimits_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ProcessDetailList_v1") + raise MemoryError("Error allocating GetMemoryLimits_v1") self._owner = None self._owned = True self._readonly = False self._refs = {} def __dealloc__(self): - cdef nvmlProcessDetailList_v1_t *ptr + cdef nvmlGetMemoryLimits_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.ProcessDetailList_v1 object at {hex(id(self))}>" + return f"<{__name__}.GetMemoryLimits_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -17107,24 +17369,24 @@ cdef class ProcessDetailList_v1: return (self._ptr) def __eq__(self, other): - cdef ProcessDetailList_v1 other_ - if not isinstance(other, ProcessDetailList_v1): + cdef GetMemoryLimits_v1 other_ + if not isinstance(other, GetMemoryLimits_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessDetailList_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGetMemoryLimits_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessDetailList_v1_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGetMemoryLimits_v1_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 = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGetMemoryLimits_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ProcessDetailList_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessDetailList_v1_t)) + raise MemoryError("Error allocating GetMemoryLimits_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGetMemoryLimits_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -17132,65 +17394,72 @@ cdef class ProcessDetailList_v1: setattr(self, key, val) @property - def version(self): - """int: Struct version, MUST be nvmlProcessDetailList_v1.""" - return self._ptr[0].version + def name_space(self): + """str: [in] Full path to sysfs cgroup file name""" + cdef char* ptr = self._ptr[0].nameSpace + if ptr: + return _cyb_cpython.PyUnicode_FromString(ptr) + return "" - @version.setter - def version(self, val): + @name_space.setter + def name_space(self, val): if self._readonly: - raise ValueError("This ProcessDetailList_v1 instance is read-only") - self._ptr[0].version = val + raise ValueError("This GetMemoryLimits_v1 instance is read-only") + cdef bytes buf = val.encode() + cdef char *ptr = buf + self._refs["name_space"] = buf + self._ptr[0].nameSpace = ptr @property - def mode(self): - """int: Process mode, One of `nvmlProcessMode_t`.""" - return self._ptr[0].mode + def soft_limit(self): + """int: [out] Currently set soft memory limit in Bytes.""" + return self._ptr[0].softLimit - @mode.setter - def mode(self, val): + @soft_limit.setter + def soft_limit(self, val): if self._readonly: - raise ValueError("This ProcessDetailList_v1 instance is read-only") - self._ptr[0].mode = val + raise ValueError("This GetMemoryLimits_v1 instance is read-only") + self._ptr[0].softLimit = val @property - def proc_array(self): - """int: Process array.""" - if self._ptr[0].procArray == NULL or self._ptr[0].numProcArrayEntries == 0: - return [] - return ProcessDetail_v1.from_ptr( - (self._ptr[0].procArray), - self._ptr[0].numProcArrayEntries, - owner=self, - readonly=self._readonly - ) + def hard_limit(self): + """int: [out] Currently set hard memory limit in Bytes.""" + return self._ptr[0].hardLimit - @proc_array.setter - def proc_array(self, val): + @hard_limit.setter + def hard_limit(self, val): if self._readonly: - raise ValueError("This ProcessDetailList_v1 instance is read-only") - cdef ProcessDetail_v1 arr = val - self._ptr[0].procArray = (arr._get_ptr()) - self._ptr[0].numProcArrayEntries = len(arr) - self._refs["proc_array"] = arr + raise ValueError("This GetMemoryLimits_v1 instance is read-only") + self._ptr[0].hardLimit = val + + @property + def current_used(self): + """int: [out] Currently used memory in Bytes.""" + return self._ptr[0].currentUsed + + @current_used.setter + def current_used(self, val): + if self._readonly: + raise ValueError("This GetMemoryLimits_v1 instance is read-only") + self._ptr[0].currentUsed = val @staticmethod def from_buffer(buffer): - """Create an ProcessDetailList_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlProcessDetailList_v1_t), ProcessDetailList_v1) + """Create an GetMemoryLimits_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGetMemoryLimits_v1_t), GetMemoryLimits_v1) @staticmethod def from_data(data): - """Create an ProcessDetailList_v1 instance wrapping the given NumPy array. + """Create an GetMemoryLimits_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `process_detail_list_v1_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `get_memory_limits_v1_dtype` holding the data. """ - return _cyb_from_data(data, "process_detail_list_v1_dtype", process_detail_list_v1_dtype, ProcessDetailList_v1) + return _cyb_from_data(data, "get_memory_limits_v1_dtype", get_memory_limits_v1_dtype, GetMemoryLimits_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an ProcessDetailList_v1 instance wrapping the given pointer. + """Create an GetMemoryLimits_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -17199,16 +17468,16 @@ cdef class ProcessDetailList_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef ProcessDetailList_v1 obj = ProcessDetailList_v1.__new__(ProcessDetailList_v1) + cdef GetMemoryLimits_v1 obj = GetMemoryLimits_v1.__new__(GetMemoryLimits_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGetMemoryLimits_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ProcessDetailList_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessDetailList_v1_t)) + raise MemoryError("Error allocating GetMemoryLimits_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGetMemoryLimits_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -17216,188 +17485,190 @@ cdef class ProcessDetailList_v1: return obj -cdef _get_bridge_chip_hierarchy_dtype_offsets(): - cdef nvmlBridgeChipHierarchy_t pod +cdef _get_pmgr_pwr_tuple_dtype_offsets(): + cdef nvmlPmgrPwrTuple_t pod return _numpy.dtype({ - 'names': ['bridge_count', 'bridge_chip_info'], - 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], + 'names': ['pwrm_w'], + 'formats': [_numpy.uint32], 'offsets': [ - (&(pod.bridgeCount)) - (&pod), - (&(pod.bridgeChipInfo)) - (&pod), + (&(pod.pwrmW)) - (&pod), ], - 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), + 'itemsize': sizeof(nvmlPmgrPwrTuple_t), }) -bridge_chip_hierarchy_dtype = _get_bridge_chip_hierarchy_dtype_offsets() +pmgr_pwr_tuple_dtype = _get_pmgr_pwr_tuple_dtype_offsets() -cdef class BridgeChipHierarchy: - """Empty-initialize an instance of `nvmlBridgeChipHierarchy_t`. +cdef class PmgrPwrTuple: + """Empty-initialize an array of `nvmlPmgrPwrTuple_t`. + The resulting object is of length `size` and of dtype `pmgr_pwr_tuple_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlBridgeChipHierarchy_t` + .. seealso:: `nvmlPmgrPwrTuple_t` """ cdef: - nvmlBridgeChipHierarchy_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating BridgeChipHierarchy") - self._owner = None - self._owned = True - self._readonly = False - def __dealloc__(self): - cdef nvmlBridgeChipHierarchy_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=pmgr_pwr_tuple_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPmgrPwrTuple_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPmgrPwrTuple_t) }" def __repr__(self): - return f"<{__name__}.BridgeChipHierarchy object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PmgrPwrTuple_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PmgrPwrTuple object at {hex(id(self))}>" @property def ptr(self): """Get the pointer address to the data as Python :class:`int`.""" - return (self._ptr) + return self._data.ctypes.data cdef intptr_t _get_ptr(self): - return (self._ptr) + return self._data.ctypes.data def __int__(self): - return (self._ptr) + 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 BridgeChipHierarchy other_ - if not isinstance(other, BridgeChipHierarchy): + cdef object self_data = self._data + if (not isinstance(other, PmgrPwrTuple)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBridgeChipHierarchy_t)) == 0) + return bool((self_data == other._data).all()) - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlBridgeChipHierarchy_t), self._readonly) + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - pass - - def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating BridgeChipHierarchy") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBridgeChipHierarchy_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + _cyb_cpython.PyBuffer_Release(buffer) @property - def bridge_chip_info(self): - """BridgeChipInfo: """ - return BridgeChipInfo.from_ptr( - &(self._ptr[0].bridgeChipInfo), - self._ptr[0].bridgeCount, - readonly=self._readonly, - owner=self, - ) + def pwrm_w(self): + """Union[~_numpy.uint32, int]: Power consumption in milliwatts.""" + if self._data.size == 1: + return int(self._data.pwrm_w[0]) + return self._data.pwrm_w - @bridge_chip_info.setter - def bridge_chip_info(self, val): - if self._readonly: - raise ValueError("This BridgeChipHierarchy instance is read-only") - cdef BridgeChipInfo val_ = val - if len(val) > 128: - raise ValueError(f"Expected length < 128 for field bridge_chip_info, got {len(val)}") - self._ptr[0].bridgeCount = len(val) - if len(val) == 0: - return - _cyb_memcpy(&(self._ptr[0].bridgeChipInfo), (val_._get_ptr()), sizeof(nvmlBridgeChipInfo_t) * self._ptr[0].bridgeCount) + @pwrm_w.setter + def pwrm_w(self, val): + self._data.pwrm_w = 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 PmgrPwrTuple.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == pmgr_pwr_tuple_dtype: + return PmgrPwrTuple.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an BridgeChipHierarchy instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlBridgeChipHierarchy_t), BridgeChipHierarchy) + """Create an PmgrPwrTuple instance with the memory from the given buffer.""" + return PmgrPwrTuple.from_data(_numpy.frombuffer(buffer, dtype=pmgr_pwr_tuple_dtype)) @staticmethod def from_data(data): - """Create an BridgeChipHierarchy instance wrapping the given NumPy array. + """Create an PmgrPwrTuple instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `bridge_chip_hierarchy_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `pmgr_pwr_tuple_dtype` holding the data. """ - return _cyb_from_data(data, "bridge_chip_hierarchy_dtype", bridge_chip_hierarchy_dtype, BridgeChipHierarchy) + cdef PmgrPwrTuple obj = PmgrPwrTuple.__new__(PmgrPwrTuple) + 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 != pmgr_pwr_tuple_dtype: + raise ValueError("data array must be of dtype pmgr_pwr_tuple_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an BridgeChipHierarchy instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PmgrPwrTuple 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. + size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef BridgeChipHierarchy obj = BridgeChipHierarchy.__new__(BridgeChipHierarchy) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating BridgeChipHierarchy") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBridgeChipHierarchy_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + cdef PmgrPwrTuple obj = PmgrPwrTuple.__new__(PmgrPwrTuple) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPmgrPwrTuple_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=pmgr_pwr_tuple_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj -cdef _get_sample_dtype_offsets(): - cdef nvmlSample_t pod +cdef _get_rail_metrics_dtype_offsets(): + cdef nvmlRailMetrics_t pod return _numpy.dtype({ - 'names': ['time_stamp', 'sample_value'], - 'formats': [_numpy.uint64, value_dtype], + 'names': ['freqk_hz', 'util_pct'], + 'formats': [_numpy.uint32, _numpy.uint64], 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.sampleValue)) - (&pod), + (&(pod.freqkHz)) - (&pod), + (&(pod.utilPct)) - (&pod), ], - 'itemsize': sizeof(nvmlSample_t), + 'itemsize': sizeof(nvmlRailMetrics_t), }) -sample_dtype = _get_sample_dtype_offsets() +rail_metrics_dtype = _get_rail_metrics_dtype_offsets() -cdef class Sample: - """Empty-initialize an array of `nvmlSample_t`. - The resulting object is of length `size` and of dtype `sample_dtype`. +cdef class RailMetrics: + """Empty-initialize an array of `nvmlRailMetrics_t`. + The resulting object is of length `size` and of dtype `rail_metrics_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlSample_t` + .. seealso:: `nvmlRailMetrics_t` """ cdef: readonly object _data object _owner def __init__(self, size=1): - arr = _numpy.empty(size, dtype=sample_dtype) + arr = _numpy.empty(size, dtype=rail_metrics_dtype) self._data = arr.view(_numpy.recarray) - assert self._data.itemsize == sizeof(nvmlSample_t), \ - f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlSample_t) }" + assert self._data.itemsize == sizeof(nvmlRailMetrics_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlRailMetrics_t) }" def __repr__(self): if self._data.size > 1: - return f"<{__name__}.Sample_Array_{self._data.size} object at {hex(id(self))}>" + return f"<{__name__}.RailMetrics_Array_{self._data.size} object at {hex(id(self))}>" else: - return f"<{__name__}.Sample object at {hex(id(self))}>" + return f"<{__name__}.RailMetrics object at {hex(id(self))}>" @property def ptr(self): @@ -17418,7 +17689,7 @@ cdef class Sample: def __eq__(self, other): cdef object self_data = self._data - if (not isinstance(other, Sample)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + if (not isinstance(other, RailMetrics)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False return bool((self_data == other._data).all()) @@ -17429,24 +17700,26 @@ cdef class Sample: _cyb_cpython.PyBuffer_Release(buffer) @property - def time_stamp(self): - """Union[~_numpy.uint64, int]: """ + def freqk_hz(self): + """Union[~_numpy.uint32, int]: Frequency in kilohertz.""" if self._data.size == 1: - return int(self._data.time_stamp[0]) - return self._data.time_stamp + return int(self._data.freqk_hz[0]) + return self._data.freqk_hz - @time_stamp.setter - def time_stamp(self, val): - self._data.time_stamp = val + @freqk_hz.setter + def freqk_hz(self, val): + self._data.freqk_hz = val @property - def sample_value(self): - """value_dtype: """ - return self._data.sample_value + def util_pct(self): + """Union[~_numpy.uint64, int]: Utilization percentage (fixed-point).""" + if self._data.size == 1: + return int(self._data.util_pct[0]) + return self._data.util_pct - @sample_value.setter - def sample_value(self, val): - self._data.sample_value = val + @util_pct.setter + def util_pct(self, val): + self._data.util_pct = val def __getitem__(self, key): cdef ssize_t key_ @@ -17458,10 +17731,10 @@ cdef class Sample: raise IndexError("index is out of bounds") if key_ < 0: key_ += size - return Sample.from_data(self._data[key_:key_+1]) + return RailMetrics.from_data(self._data[key_:key_+1]) out = self._data[key] - if isinstance(out, _numpy.recarray) and out.dtype == sample_dtype: - return Sample.from_data(out) + if isinstance(out, _numpy.recarray) and out.dtype == rail_metrics_dtype: + return RailMetrics.from_data(out) return out def __setitem__(self, key, val): @@ -17469,30 +17742,30 @@ cdef class Sample: @staticmethod def from_buffer(buffer): - """Create an Sample instance with the memory from the given buffer.""" - return Sample.from_data(_numpy.frombuffer(buffer, dtype=sample_dtype)) + """Create an RailMetrics instance with the memory from the given buffer.""" + return RailMetrics.from_data(_numpy.frombuffer(buffer, dtype=rail_metrics_dtype)) @staticmethod def from_data(data): - """Create an Sample instance wrapping the given NumPy array. + """Create an RailMetrics instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a 1D array of dtype `sample_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `rail_metrics_dtype` holding the data. """ - cdef Sample obj = Sample.__new__(Sample) + cdef RailMetrics obj = RailMetrics.__new__(RailMetrics) 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 != sample_dtype: - raise ValueError("data array must be of dtype sample_dtype") + if data.dtype != rail_metrics_dtype: + raise ValueError("data array must be of dtype rail_metrics_dtype") obj._data = data.view(_numpy.recarray) return obj @staticmethod def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): - """Create an Sample instance wrapping the given pointer. + """Create an RailMetrics instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -17503,60 +17776,55 @@ cdef class Sample: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef Sample obj = Sample.__new__(Sample) + cdef RailMetrics obj = RailMetrics.__new__(RailMetrics) cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( - ptr, sizeof(nvmlSample_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=sample_dtype) + ptr, sizeof(nvmlRailMetrics_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=rail_metrics_dtype) obj._data = data.view(_numpy.recarray) obj._owner = owner return obj -cdef _get_vgpu_instance_utilization_sample_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationSample_t pod +cdef _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets(): + cdef nvmlPwrModelMetricsDlppm1xPerf_t pod return _numpy.dtype({ - 'names': ['vgpu_instance', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], - 'formats': [_numpy.uint32, _numpy.uint64, value_dtype, value_dtype, value_dtype, value_dtype], + 'names': ['perfms'], + 'formats': [_numpy.uint32], 'offsets': [ - (&(pod.vgpuInstance)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), + (&(pod.perfms)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), }) -vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_dtype_offsets() +pwr_model_metrics_dlppm1x_perf_dtype = _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets() -cdef class VgpuInstanceUtilizationSample: - """Empty-initialize an array of `nvmlVgpuInstanceUtilizationSample_t`. - The resulting object is of length `size` and of dtype `vgpu_instance_utilization_sample_dtype`. +cdef class PwrModelMetricsDlppm1xPerf: + """Empty-initialize an array of `nvmlPwrModelMetricsDlppm1xPerf_t`. + The resulting object is of length `size` and of dtype `pwr_model_metrics_dlppm1x_perf_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuInstanceUtilizationSample_t` + .. seealso:: `nvmlPwrModelMetricsDlppm1xPerf_t` """ cdef: readonly object _data object _owner def __init__(self, size=1): - arr = _numpy.empty(size, dtype=vgpu_instance_utilization_sample_dtype) + arr = _numpy.empty(size, dtype=pwr_model_metrics_dlppm1x_perf_dtype) self._data = arr.view(_numpy.recarray) - assert self._data.itemsize == sizeof(nvmlVgpuInstanceUtilizationSample_t), \ - f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuInstanceUtilizationSample_t) }" + assert self._data.itemsize == sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelMetricsDlppm1xPerf_t) }" def __repr__(self): if self._data.size > 1: - return f"<{__name__}.VgpuInstanceUtilizationSample_Array_{self._data.size} object at {hex(id(self))}>" + return f"<{__name__}.PwrModelMetricsDlppm1xPerf_Array_{self._data.size} object at {hex(id(self))}>" else: - return f"<{__name__}.VgpuInstanceUtilizationSample object at {hex(id(self))}>" + return f"<{__name__}.PwrModelMetricsDlppm1xPerf object at {hex(id(self))}>" @property def ptr(self): @@ -17577,7 +17845,7 @@ cdef class VgpuInstanceUtilizationSample: def __eq__(self, other): cdef object self_data = self._data - if (not isinstance(other, VgpuInstanceUtilizationSample)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + if (not isinstance(other, PwrModelMetricsDlppm1xPerf)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False return bool((self_data == other._data).all()) @@ -17588,62 +17856,15 @@ cdef class VgpuInstanceUtilizationSample: _cyb_cpython.PyBuffer_Release(buffer) @property - def vgpu_instance(self): - """Union[~_numpy.uint32, int]: """ - if self._data.size == 1: - return int(self._data.vgpu_instance[0]) - return self._data.vgpu_instance - - @vgpu_instance.setter - def vgpu_instance(self, val): - self._data.vgpu_instance = val - - @property - def time_stamp(self): - """Union[~_numpy.uint64, int]: """ + def perfms(self): + """Union[~_numpy.uint32, int]: Performance metric in milliseconds.""" if self._data.size == 1: - return int(self._data.time_stamp[0]) - return self._data.time_stamp - - @time_stamp.setter - def time_stamp(self, val): - self._data.time_stamp = val - - @property - def sm_util(self): - """value_dtype: """ - return self._data.sm_util - - @sm_util.setter - def sm_util(self, val): - self._data.sm_util = val - - @property - def mem_util(self): - """value_dtype: """ - return self._data.mem_util - - @mem_util.setter - def mem_util(self, val): - self._data.mem_util = val + return int(self._data.perfms[0]) + return self._data.perfms - @property - def enc_util(self): - """value_dtype: """ - return self._data.enc_util - - @enc_util.setter - def enc_util(self, val): - self._data.enc_util = val - - @property - def dec_util(self): - """value_dtype: """ - return self._data.dec_util - - @dec_util.setter - def dec_util(self, val): - self._data.dec_util = val + @perfms.setter + def perfms(self, val): + self._data.perfms = val def __getitem__(self, key): cdef ssize_t key_ @@ -17655,10 +17876,10 @@ cdef class VgpuInstanceUtilizationSample: raise IndexError("index is out of bounds") if key_ < 0: key_ += size - return VgpuInstanceUtilizationSample.from_data(self._data[key_:key_+1]) + return PwrModelMetricsDlppm1xPerf.from_data(self._data[key_:key_+1]) out = self._data[key] - if isinstance(out, _numpy.recarray) and out.dtype == vgpu_instance_utilization_sample_dtype: - return VgpuInstanceUtilizationSample.from_data(out) + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_metrics_dlppm1x_perf_dtype: + return PwrModelMetricsDlppm1xPerf.from_data(out) return out def __setitem__(self, key, val): @@ -17666,30 +17887,30 @@ cdef class VgpuInstanceUtilizationSample: @staticmethod def from_buffer(buffer): - """Create an VgpuInstanceUtilizationSample instance with the memory from the given buffer.""" - return VgpuInstanceUtilizationSample.from_data(_numpy.frombuffer(buffer, dtype=vgpu_instance_utilization_sample_dtype)) + """Create an PwrModelMetricsDlppm1xPerf instance with the memory from the given buffer.""" + return PwrModelMetricsDlppm1xPerf.from_data(_numpy.frombuffer(buffer, dtype=pwr_model_metrics_dlppm1x_perf_dtype)) @staticmethod def from_data(data): - """Create an VgpuInstanceUtilizationSample instance wrapping the given NumPy array. + """Create an PwrModelMetricsDlppm1xPerf instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a 1D array of dtype `vgpu_instance_utilization_sample_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `pwr_model_metrics_dlppm1x_perf_dtype` holding the data. """ - cdef VgpuInstanceUtilizationSample obj = VgpuInstanceUtilizationSample.__new__(VgpuInstanceUtilizationSample) + cdef PwrModelMetricsDlppm1xPerf obj = PwrModelMetricsDlppm1xPerf.__new__(PwrModelMetricsDlppm1xPerf) 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_instance_utilization_sample_dtype: - raise ValueError("data array must be of dtype vgpu_instance_utilization_sample_dtype") + if data.dtype != pwr_model_metrics_dlppm1x_perf_dtype: + raise ValueError("data array must be of dtype pwr_model_metrics_dlppm1x_perf_dtype") obj._data = data.view(_numpy.recarray) return obj @staticmethod def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): - """Create an VgpuInstanceUtilizationSample instance wrapping the given pointer. + """Create an PwrModelMetricsDlppm1xPerf instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -17700,62 +17921,56 @@ cdef class VgpuInstanceUtilizationSample: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuInstanceUtilizationSample obj = VgpuInstanceUtilizationSample.__new__(VgpuInstanceUtilizationSample) + cdef PwrModelMetricsDlppm1xPerf obj = PwrModelMetricsDlppm1xPerf.__new__(PwrModelMetricsDlppm1xPerf) cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( - ptr, sizeof(nvmlVgpuInstanceUtilizationSample_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_instance_utilization_sample_dtype) + ptr, sizeof(nvmlPwrModelMetricsDlppm1xPerf_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=pwr_model_metrics_dlppm1x_perf_dtype) obj._data = data.view(_numpy.recarray) obj._owner = owner return obj -cdef _get_vgpu_instance_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationInfo_v1_t pod +cdef _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets(): + cdef nvmlPwrModelMetricsSamplePfpp1x_t pod return _numpy.dtype({ - 'names': ['time_stamp', 'vgpu_instance', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], - 'formats': [_numpy.uint64, _numpy.uint32, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype], + 'names': ['freqk_hz', 'est_tgp_pwrm_w'], + 'formats': [(_numpy.uint32, 16), _numpy.uint32], 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.vgpuInstance)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), - (&(pod.jpgUtil)) - (&pod), - (&(pod.ofaUtil)) - (&pod), + (&(pod.freqkHz)) - (&pod), + (&(pod.estTgpPwrmW)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), + 'itemsize': sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), }) -vgpu_instance_utilization_info_v1_dtype = _get_vgpu_instance_utilization_info_v1_dtype_offsets() +pwr_model_metrics_sample_pfpp1x_dtype = _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets() -cdef class VgpuInstanceUtilizationInfo_v1: - """Empty-initialize an array of `nvmlVgpuInstanceUtilizationInfo_v1_t`. - The resulting object is of length `size` and of dtype `vgpu_instance_utilization_info_v1_dtype`. +cdef class PwrModelMetricsSamplePfpp1x: + """Empty-initialize an array of `nvmlPwrModelMetricsSamplePfpp1x_t`. + The resulting object is of length `size` and of dtype `pwr_model_metrics_sample_pfpp1x_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuInstanceUtilizationInfo_v1_t` + .. seealso:: `nvmlPwrModelMetricsSamplePfpp1x_t` """ cdef: readonly object _data object _owner def __init__(self, size=1): - arr = _numpy.empty(size, dtype=vgpu_instance_utilization_info_v1_dtype) + arr = _numpy.empty(size, dtype=pwr_model_metrics_sample_pfpp1x_dtype) self._data = arr.view(_numpy.recarray) - assert self._data.itemsize == sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), \ - f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t) }" + assert self._data.itemsize == sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelMetricsSamplePfpp1x_t) }" def __repr__(self): if self._data.size > 1: - return f"<{__name__}.VgpuInstanceUtilizationInfo_v1_Array_{self._data.size} object at {hex(id(self))}>" + return f"<{__name__}.PwrModelMetricsSamplePfpp1x_Array_{self._data.size} object at {hex(id(self))}>" else: - return f"<{__name__}.VgpuInstanceUtilizationInfo_v1 object at {hex(id(self))}>" + return f"<{__name__}.PwrModelMetricsSamplePfpp1x object at {hex(id(self))}>" @property def ptr(self): @@ -17776,7 +17991,7 @@ cdef class VgpuInstanceUtilizationInfo_v1: def __eq__(self, other): cdef object self_data = self._data - if (not isinstance(other, VgpuInstanceUtilizationInfo_v1)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + if (not isinstance(other, PwrModelMetricsSamplePfpp1x)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False return bool((self_data == other._data).all()) @@ -17787,126 +18002,70 @@ cdef class VgpuInstanceUtilizationInfo_v1: _cyb_cpython.PyBuffer_Release(buffer) @property - def time_stamp(self): - """Union[~_numpy.uint64, int]: CPU Timestamp in microseconds.""" - if self._data.size == 1: - return int(self._data.time_stamp[0]) - return self._data.time_stamp + def freqk_hz(self): + """~_numpy.uint32: (array of length 16).Array of input frequencies in kilohertz for each domain.""" + return self._data.freqk_hz - @time_stamp.setter - def time_stamp(self, val): - self._data.time_stamp = val + @freqk_hz.setter + def freqk_hz(self, val): + self._data.freqk_hz = val @property - def vgpu_instance(self): - """Union[~_numpy.uint32, int]: vGPU Instance""" + def est_tgp_pwrm_w(self): + """Union[~_numpy.uint32, int]: Estimated Total Graphics Power in milliwatts.""" if self._data.size == 1: - return int(self._data.vgpu_instance[0]) - return self._data.vgpu_instance - - @vgpu_instance.setter - def vgpu_instance(self, val): - self._data.vgpu_instance = val + return int(self._data.est_tgp_pwrm_w[0]) + return self._data.est_tgp_pwrm_w - @property - def sm_util(self): - """value_dtype: SM (3D/Compute) Util Value.""" - return self._data.sm_util + @est_tgp_pwrm_w.setter + def est_tgp_pwrm_w(self, val): + self._data.est_tgp_pwrm_w = val - @sm_util.setter - def sm_util(self, val): - self._data.sm_util = 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 PwrModelMetricsSamplePfpp1x.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_metrics_sample_pfpp1x_dtype: + return PwrModelMetricsSamplePfpp1x.from_data(out) + return out - @property - def mem_util(self): - """value_dtype: Frame Buffer Memory Util Value.""" - return self._data.mem_util - - @mem_util.setter - def mem_util(self, val): - self._data.mem_util = val - - @property - def enc_util(self): - """value_dtype: Encoder Util Value.""" - return self._data.enc_util - - @enc_util.setter - def enc_util(self, val): - self._data.enc_util = val - - @property - def dec_util(self): - """value_dtype: Decoder Util Value.""" - return self._data.dec_util - - @dec_util.setter - def dec_util(self, val): - self._data.dec_util = val - - @property - def jpg_util(self): - """value_dtype: Jpeg Util Value.""" - return self._data.jpg_util - - @jpg_util.setter - def jpg_util(self, val): - self._data.jpg_util = val - - @property - def ofa_util(self): - """value_dtype: Ofa Util Value.""" - return self._data.ofa_util - - @ofa_util.setter - def ofa_util(self, val): - self._data.ofa_util = 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 VgpuInstanceUtilizationInfo_v1.from_data(self._data[key_:key_+1]) - out = self._data[key] - if isinstance(out, _numpy.recarray) and out.dtype == vgpu_instance_utilization_info_v1_dtype: - return VgpuInstanceUtilizationInfo_v1.from_data(out) - return out - - def __setitem__(self, key, val): - self._data[key] = val + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an VgpuInstanceUtilizationInfo_v1 instance with the memory from the given buffer.""" - return VgpuInstanceUtilizationInfo_v1.from_data(_numpy.frombuffer(buffer, dtype=vgpu_instance_utilization_info_v1_dtype)) + """Create an PwrModelMetricsSamplePfpp1x instance with the memory from the given buffer.""" + return PwrModelMetricsSamplePfpp1x.from_data(_numpy.frombuffer(buffer, dtype=pwr_model_metrics_sample_pfpp1x_dtype)) @staticmethod def from_data(data): - """Create an VgpuInstanceUtilizationInfo_v1 instance wrapping the given NumPy array. + """Create an PwrModelMetricsSamplePfpp1x instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a 1D array of dtype `vgpu_instance_utilization_info_v1_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `pwr_model_metrics_sample_pfpp1x_dtype` holding the data. """ - cdef VgpuInstanceUtilizationInfo_v1 obj = VgpuInstanceUtilizationInfo_v1.__new__(VgpuInstanceUtilizationInfo_v1) + cdef PwrModelMetricsSamplePfpp1x obj = PwrModelMetricsSamplePfpp1x.__new__(PwrModelMetricsSamplePfpp1x) 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_instance_utilization_info_v1_dtype: - raise ValueError("data array must be of dtype vgpu_instance_utilization_info_v1_dtype") + if data.dtype != pwr_model_metrics_sample_pfpp1x_dtype: + raise ValueError("data array must be of dtype pwr_model_metrics_sample_pfpp1x_dtype") obj._data = data.view(_numpy.recarray) return obj @staticmethod def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): - """Create an VgpuInstanceUtilizationInfo_v1 instance wrapping the given pointer. + """Create an PwrModelMetricsSamplePfpp1x instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -17917,61 +18076,56 @@ cdef class VgpuInstanceUtilizationInfo_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuInstanceUtilizationInfo_v1 obj = VgpuInstanceUtilizationInfo_v1.__new__(VgpuInstanceUtilizationInfo_v1) + cdef PwrModelMetricsSamplePfpp1x obj = PwrModelMetricsSamplePfpp1x.__new__(PwrModelMetricsSamplePfpp1x) cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( - ptr, sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_instance_utilization_info_v1_dtype) + ptr, sizeof(nvmlPwrModelMetricsSamplePfpp1x_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=pwr_model_metrics_sample_pfpp1x_dtype) obj._data = data.view(_numpy.recarray) obj._owner = owner return obj -cdef _get_field_value_dtype_offsets(): - cdef nvmlFieldValue_t pod +cdef _get_pwr_model_operating_point_pfpp1x_dtype_offsets(): + cdef nvmlPwrModelOperatingPointPfpp1x_t pod return _numpy.dtype({ - 'names': ['field_id', 'scope_id', 'timestamp', 'latency_usec', 'value_type', 'nvml_return', 'value'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int64, _numpy.int64, _numpy.int32, _numpy.int32, value_dtype], + 'names': ['freqk_hz', 'pwrm_w'], + 'formats': [_numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.fieldId)) - (&pod), - (&(pod.scopeId)) - (&pod), - (&(pod.timestamp)) - (&pod), - (&(pod.latencyUsec)) - (&pod), - (&(pod.valueType)) - (&pod), - (&(pod.nvmlReturn)) - (&pod), - (&(pod.value)) - (&pod), + (&(pod.freqkHz)) - (&pod), + (&(pod.pwrmW)) - (&pod), ], - 'itemsize': sizeof(nvmlFieldValue_t), + 'itemsize': sizeof(nvmlPwrModelOperatingPointPfpp1x_t), }) -field_value_dtype = _get_field_value_dtype_offsets() +pwr_model_operating_point_pfpp1x_dtype = _get_pwr_model_operating_point_pfpp1x_dtype_offsets() -cdef class FieldValue: - """Empty-initialize an array of `nvmlFieldValue_t`. - The resulting object is of length `size` and of dtype `field_value_dtype`. +cdef class PwrModelOperatingPointPfpp1x: + """Empty-initialize an array of `nvmlPwrModelOperatingPointPfpp1x_t`. + The resulting object is of length `size` and of dtype `pwr_model_operating_point_pfpp1x_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlFieldValue_t` + .. seealso:: `nvmlPwrModelOperatingPointPfpp1x_t` """ cdef: readonly object _data object _owner def __init__(self, size=1): - arr = _numpy.empty(size, dtype=field_value_dtype) + arr = _numpy.empty(size, dtype=pwr_model_operating_point_pfpp1x_dtype) self._data = arr.view(_numpy.recarray) - assert self._data.itemsize == sizeof(nvmlFieldValue_t), \ - f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlFieldValue_t) }" + assert self._data.itemsize == sizeof(nvmlPwrModelOperatingPointPfpp1x_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelOperatingPointPfpp1x_t) }" def __repr__(self): if self._data.size > 1: - return f"<{__name__}.FieldValue_Array_{self._data.size} object at {hex(id(self))}>" + return f"<{__name__}.PwrModelOperatingPointPfpp1x_Array_{self._data.size} object at {hex(id(self))}>" else: - return f"<{__name__}.FieldValue object at {hex(id(self))}>" + return f"<{__name__}.PwrModelOperatingPointPfpp1x object at {hex(id(self))}>" @property def ptr(self): @@ -17992,7 +18146,7 @@ cdef class FieldValue: def __eq__(self, other): cdef object self_data = self._data - if (not isinstance(other, FieldValue)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + if (not isinstance(other, PwrModelOperatingPointPfpp1x)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False return bool((self_data == other._data).all()) @@ -18003,79 +18157,26 @@ cdef class FieldValue: _cyb_cpython.PyBuffer_Release(buffer) @property - def field_id(self): - """Union[~_numpy.uint32, int]: """ - if self._data.size == 1: - return int(self._data.field_id[0]) - return self._data.field_id - - @field_id.setter - def field_id(self, val): - self._data.field_id = val - - @property - def scope_id(self): - """Union[~_numpy.uint32, int]: """ - if self._data.size == 1: - return int(self._data.scope_id[0]) - return self._data.scope_id - - @scope_id.setter - def scope_id(self, val): - self._data.scope_id = val - - @property - def timestamp(self): - """Union[~_numpy.int64, int]: """ - 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 latency_usec(self): - """Union[~_numpy.int64, int]: """ - if self._data.size == 1: - return int(self._data.latency_usec[0]) - return self._data.latency_usec - - @latency_usec.setter - def latency_usec(self, val): - self._data.latency_usec = val - - @property - def value_type(self): - """Union[~_numpy.int32, int]: """ + def freqk_hz(self): + """Union[~_numpy.uint32, int]: Operating frequency in kilohertz.""" if self._data.size == 1: - return int(self._data.value_type[0]) - return self._data.value_type + return int(self._data.freqk_hz[0]) + return self._data.freqk_hz - @value_type.setter - def value_type(self, val): - self._data.value_type = val + @freqk_hz.setter + def freqk_hz(self, val): + self._data.freqk_hz = val @property - def nvml_return(self): - """Union[~_numpy.int32, int]: """ + def pwrm_w(self): + """Union[~_numpy.uint32, int]: Power consumption at this frequency in milliwatts.""" if self._data.size == 1: - return int(self._data.nvml_return[0]) - return self._data.nvml_return - - @nvml_return.setter - def nvml_return(self, val): - self._data.nvml_return = val - - @property - def value(self): - """value_dtype: """ - return self._data.value + return int(self._data.pwrm_w[0]) + return self._data.pwrm_w - @value.setter - def value(self, val): - self._data.value = val + @pwrm_w.setter + def pwrm_w(self, val): + self._data.pwrm_w = val def __getitem__(self, key): cdef ssize_t key_ @@ -18087,10 +18188,10 @@ cdef class FieldValue: raise IndexError("index is out of bounds") if key_ < 0: key_ += size - return FieldValue.from_data(self._data[key_:key_+1]) + return PwrModelOperatingPointPfpp1x.from_data(self._data[key_:key_+1]) out = self._data[key] - if isinstance(out, _numpy.recarray) and out.dtype == field_value_dtype: - return FieldValue.from_data(out) + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_operating_point_pfpp1x_dtype: + return PwrModelOperatingPointPfpp1x.from_data(out) return out def __setitem__(self, key, val): @@ -18098,30 +18199,30 @@ cdef class FieldValue: @staticmethod def from_buffer(buffer): - """Create an FieldValue instance with the memory from the given buffer.""" - return FieldValue.from_data(_numpy.frombuffer(buffer, dtype=field_value_dtype)) + """Create an PwrModelOperatingPointPfpp1x instance with the memory from the given buffer.""" + return PwrModelOperatingPointPfpp1x.from_data(_numpy.frombuffer(buffer, dtype=pwr_model_operating_point_pfpp1x_dtype)) @staticmethod def from_data(data): - """Create an FieldValue instance wrapping the given NumPy array. + """Create an PwrModelOperatingPointPfpp1x instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a 1D array of dtype `field_value_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `pwr_model_operating_point_pfpp1x_dtype` holding the data. """ - cdef FieldValue obj = FieldValue.__new__(FieldValue) + cdef PwrModelOperatingPointPfpp1x obj = PwrModelOperatingPointPfpp1x.__new__(PwrModelOperatingPointPfpp1x) 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 != field_value_dtype: - raise ValueError("data array must be of dtype field_value_dtype") + if data.dtype != pwr_model_operating_point_pfpp1x_dtype: + raise ValueError("data array must be of dtype pwr_model_operating_point_pfpp1x_dtype") obj._data = data.view(_numpy.recarray) return obj @staticmethod def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): - """Create an FieldValue instance wrapping the given pointer. + """Create an PwrModelOperatingPointPfpp1x instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18132,61 +18233,63 @@ cdef class FieldValue: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef FieldValue obj = FieldValue.__new__(FieldValue) + cdef PwrModelOperatingPointPfpp1x obj = PwrModelOperatingPointPfpp1x.__new__(PwrModelOperatingPointPfpp1x) cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( - ptr, sizeof(nvmlFieldValue_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=field_value_dtype) + ptr, sizeof(nvmlPwrModelOperatingPointPfpp1x_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=pwr_model_operating_point_pfpp1x_dtype) obj._data = data.view(_numpy.recarray) obj._owner = owner return obj -cdef _get_prm_counter_value_v1_dtype_offsets(): - cdef nvmlPRMCounterValue_v1_t pod +cdef _get_adaptive_tgp_mode_info_v1_dtype_offsets(): + cdef nvmlAdaptiveTgpModeInfo_v1_t pod return _numpy.dtype({ - 'names': ['status', 'output_type', 'output_value'], - 'formats': [_numpy.int32, _numpy.int32, value_dtype], + 'names': ['in_band_enable_request', 'feature_allowed_by_admin', 'admin_override_enabled', 'enablement_status', 'adjusted_limit_mw'], + 'formats': [_numpy.int32, _numpy.int32, _numpy.int32, _numpy.int32, _numpy.uint32], 'offsets': [ - (&(pod.status)) - (&pod), - (&(pod.outputType)) - (&pod), - (&(pod.outputValue)) - (&pod), + (&(pod.inBandEnableRequest)) - (&pod), + (&(pod.featureAllowedByAdmin)) - (&pod), + (&(pod.adminOverrideEnabled)) - (&pod), + (&(pod.enablementStatus)) - (&pod), + (&(pod.adjustedLimitMw)) - (&pod), ], - 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), + 'itemsize': sizeof(nvmlAdaptiveTgpModeInfo_v1_t), }) -prm_counter_value_v1_dtype = _get_prm_counter_value_v1_dtype_offsets() +adaptive_tgp_mode_info_v1_dtype = _get_adaptive_tgp_mode_info_v1_dtype_offsets() -cdef class PRMCounterValue_v1: - """Empty-initialize an instance of `nvmlPRMCounterValue_v1_t`. +cdef class AdaptiveTgpModeInfo_v1: + """Empty-initialize an instance of `nvmlAdaptiveTgpModeInfo_v1_t`. - .. seealso:: `nvmlPRMCounterValue_v1_t` + .. seealso:: `nvmlAdaptiveTgpModeInfo_v1_t` """ cdef: - nvmlPRMCounterValue_v1_t *_ptr + nvmlAdaptiveTgpModeInfo_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlPRMCounterValue_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating PRMCounterValue_v1") + raise MemoryError("Error allocating AdaptiveTgpModeInfo_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlPRMCounterValue_v1_t *ptr + cdef nvmlAdaptiveTgpModeInfo_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.PRMCounterValue_v1 object at {hex(id(self))}>" + return f"<{__name__}.AdaptiveTgpModeInfo_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18200,24 +18303,24 @@ cdef class PRMCounterValue_v1: return (self._ptr) def __eq__(self, other): - cdef PRMCounterValue_v1 other_ - if not isinstance(other, PRMCounterValue_v1): + cdef AdaptiveTgpModeInfo_v1 other_ + if not isinstance(other, AdaptiveTgpModeInfo_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterValue_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPRMCounterValue_v1_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlAdaptiveTgpModeInfo_v1_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 = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating PRMCounterValue_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterValue_v1_t)) + raise MemoryError("Error allocating AdaptiveTgpModeInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18225,60 +18328,77 @@ cdef class PRMCounterValue_v1: setattr(self, key, val) @property - def output_value(self): - """Value: Output value.""" - return Value.from_ptr( - &(self._ptr[0].outputValue), - readonly=self._readonly, - owner=self, - ) + def in_band_enable_request(self): + """int: [out] In-band enable requested (NVML_FEATURE_ENABLED) or not requested (NVML_FEATURE_DISABLED)""" + return (self._ptr[0].inBandEnableRequest) - @output_value.setter - def output_value(self, val): + @in_band_enable_request.setter + def in_band_enable_request(self, val): if self._readonly: - raise ValueError("This PRMCounterValue_v1 instance is read-only") - cdef Value val_ = val - _cyb_memcpy(&(self._ptr[0].outputValue), (val_._get_ptr()), sizeof(nvmlValue_t) * 1) + raise ValueError("This AdaptiveTgpModeInfo_v1 instance is read-only") + self._ptr[0].inBandEnableRequest = val @property - def status(self): - """int: Status of the PRM counter read.""" - return (self._ptr[0].status) + def feature_allowed_by_admin(self): + """int: [out] Feature allowed by out-of-band/admin (NVML_FEATURE_ENABLED) or not allowed (NVML_FEATURE_DISABLED)""" + return (self._ptr[0].featureAllowedByAdmin) - @status.setter - def status(self, val): + @feature_allowed_by_admin.setter + def feature_allowed_by_admin(self, val): if self._readonly: - raise ValueError("This PRMCounterValue_v1 instance is read-only") - self._ptr[0].status = val + raise ValueError("This AdaptiveTgpModeInfo_v1 instance is read-only") + self._ptr[0].featureAllowedByAdmin = val @property - def output_type(self): - """int: Output value type.""" - return (self._ptr[0].outputType) + def admin_override_enabled(self): + """int: [out] Out-of-band/admin override active (NVML_FEATURE_ENABLED) or inactive (NVML_FEATURE_DISABLED)""" + return (self._ptr[0].adminOverrideEnabled) - @output_type.setter - def output_type(self, val): + @admin_override_enabled.setter + def admin_override_enabled(self, val): if self._readonly: - raise ValueError("This PRMCounterValue_v1 instance is read-only") - self._ptr[0].outputType = val + raise ValueError("This AdaptiveTgpModeInfo_v1 instance is read-only") + self._ptr[0].adminOverrideEnabled = val + + @property + def enablement_status(self): + """int: [out] Enablement after arbitration: active (NVML_FEATURE_ENABLED) or inactive (NVML_FEATURE_DISABLED)""" + return (self._ptr[0].enablementStatus) + + @enablement_status.setter + def enablement_status(self, val): + if self._readonly: + raise ValueError("This AdaptiveTgpModeInfo_v1 instance is read-only") + self._ptr[0].enablementStatus = val + + @property + def adjusted_limit_mw(self): + """int: [out] Adjusted TGP limit in milliwatts (valid only when feature is enabled)""" + return self._ptr[0].adjustedLimitMw + + @adjusted_limit_mw.setter + def adjusted_limit_mw(self, val): + if self._readonly: + raise ValueError("This AdaptiveTgpModeInfo_v1 instance is read-only") + self._ptr[0].adjustedLimitMw = val @staticmethod def from_buffer(buffer): - """Create an PRMCounterValue_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlPRMCounterValue_v1_t), PRMCounterValue_v1) + """Create an AdaptiveTgpModeInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlAdaptiveTgpModeInfo_v1_t), AdaptiveTgpModeInfo_v1) @staticmethod def from_data(data): - """Create an PRMCounterValue_v1 instance wrapping the given NumPy array. + """Create an AdaptiveTgpModeInfo_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `prm_counter_value_v1_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `adaptive_tgp_mode_info_v1_dtype` holding the data. """ - return _cyb_from_data(data, "prm_counter_value_v1_dtype", prm_counter_value_v1_dtype, PRMCounterValue_v1) + return _cyb_from_data(data, "adaptive_tgp_mode_info_v1_dtype", adaptive_tgp_mode_info_v1_dtype, AdaptiveTgpModeInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an PRMCounterValue_v1 instance wrapping the given pointer. + """Create an AdaptiveTgpModeInfo_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18287,65 +18407,64 @@ cdef class PRMCounterValue_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef PRMCounterValue_v1 obj = PRMCounterValue_v1.__new__(PRMCounterValue_v1) + cdef AdaptiveTgpModeInfo_v1 obj = AdaptiveTgpModeInfo_v1.__new__(AdaptiveTgpModeInfo_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating PRMCounterValue_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterValue_v1_t)) + raise MemoryError("Error allocating AdaptiveTgpModeInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_gpu_thermal_settings_dtype_offsets(): - cdef nvmlGpuThermalSettings_t pod +cdef _get_event_set_get_context_count_v1_dtype_offsets(): + cdef nvmlEventSetGetContextCount_v1_t pod return _numpy.dtype({ - 'names': ['count', 'sensor'], - 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], + 'names': ['count'], + 'formats': [_numpy.uint32], 'offsets': [ (&(pod.count)) - (&pod), - (&(pod.sensor)) - (&pod), ], - 'itemsize': sizeof(nvmlGpuThermalSettings_t), + 'itemsize': sizeof(nvmlEventSetGetContextCount_v1_t), }) -gpu_thermal_settings_dtype = _get_gpu_thermal_settings_dtype_offsets() +event_set_get_context_count_v1_dtype = _get_event_set_get_context_count_v1_dtype_offsets() -cdef class GpuThermalSettings: - """Empty-initialize an instance of `nvmlGpuThermalSettings_t`. +cdef class EventSetGetContextCount_v1: + """Empty-initialize an instance of `nvmlEventSetGetContextCount_v1_t`. - .. seealso:: `nvmlGpuThermalSettings_t` + .. seealso:: `nvmlEventSetGetContextCount_v1_t` """ cdef: - nvmlGpuThermalSettings_t *_ptr + nvmlEventSetGetContextCount_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlGpuThermalSettings_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEventSetGetContextCount_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuThermalSettings") + raise MemoryError("Error allocating EventSetGetContextCount_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlGpuThermalSettings_t *ptr + cdef nvmlEventSetGetContextCount_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.GpuThermalSettings object at {hex(id(self))}>" + return f"<{__name__}.EventSetGetContextCount_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18359,77 +18478,58 @@ cdef class GpuThermalSettings: return (self._ptr) def __eq__(self, other): - cdef GpuThermalSettings other_ - if not isinstance(other, GpuThermalSettings): + cdef EventSetGetContextCount_v1 other_ + if not isinstance(other, EventSetGetContextCount_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuThermalSettings_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventSetGetContextCount_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuThermalSettings_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEventSetGetContextCount_v1_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 = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEventSetGetContextCount_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuThermalSettings") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuThermalSettings_t)) + raise MemoryError("Error allocating EventSetGetContextCount_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventSetGetContextCount_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable else: setattr(self, key, val) - @property - def sensor(self): - """_py_anon_pod0: """ - return _py_anon_pod0.from_ptr( - &(self._ptr[0].sensor), - 3, - readonly=self._readonly, - owner=self, - ) - - @sensor.setter - def sensor(self, val): - if self._readonly: - raise ValueError("This GpuThermalSettings instance is read-only") - cdef _py_anon_pod0 val_ = val - if len(val) != 3: - raise ValueError(f"Expected length { 3 } for field sensor, got {len(val)}") - _cyb_memcpy(&(self._ptr[0].sensor), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod0) * 3) - @property def count(self): - """int: """ + """int: [out] Number of context records associated with the most recent event.""" return self._ptr[0].count @count.setter def count(self, val): if self._readonly: - raise ValueError("This GpuThermalSettings instance is read-only") + raise ValueError("This EventSetGetContextCount_v1 instance is read-only") self._ptr[0].count = val @staticmethod def from_buffer(buffer): - """Create an GpuThermalSettings instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlGpuThermalSettings_t), GpuThermalSettings) + """Create an EventSetGetContextCount_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEventSetGetContextCount_v1_t), EventSetGetContextCount_v1) @staticmethod def from_data(data): - """Create an GpuThermalSettings instance wrapping the given NumPy array. + """Create an EventSetGetContextCount_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `gpu_thermal_settings_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `event_set_get_context_count_v1_dtype` holding the data. """ - return _cyb_from_data(data, "gpu_thermal_settings_dtype", gpu_thermal_settings_dtype, GpuThermalSettings) + return _cyb_from_data(data, "event_set_get_context_count_v1_dtype", event_set_get_context_count_v1_dtype, EventSetGetContextCount_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an GpuThermalSettings instance wrapping the given pointer. + """Create an EventSetGetContextCount_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18438,66 +18538,68 @@ cdef class GpuThermalSettings: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GpuThermalSettings obj = GpuThermalSettings.__new__(GpuThermalSettings) + cdef EventSetGetContextCount_v1 obj = EventSetGetContextCount_v1.__new__(EventSetGetContextCount_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEventSetGetContextCount_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating GpuThermalSettings") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuThermalSettings_t)) + raise MemoryError("Error allocating EventSetGetContextCount_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEventSetGetContextCount_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_clk_mon_status_dtype_offsets(): - cdef nvmlClkMonStatus_t pod +cdef _get_event_set_get_context_info_v1_dtype_offsets(): + cdef nvmlEventSetGetContextInfo_v1_t pod return _numpy.dtype({ - 'names': ['b_global_status', 'clk_mon_list_size', 'clk_mon_list'], - 'formats': [_numpy.uint32, _numpy.uint32, (clk_mon_fault_info_dtype, 32)], + 'names': ['index', 'nvml_gpu_operational_event_context_type', 'source_event_context_type', 'data_size', 'data_format_version'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint16], 'offsets': [ - (&(pod.bGlobalStatus)) - (&pod), - (&(pod.clkMonListSize)) - (&pod), - (&(pod.clkMonList)) - (&pod), + (&(pod.index)) - (&pod), + (&(pod.nvmlGpuOperationalEventContextType)) - (&pod), + (&(pod.sourceEventContextType)) - (&pod), + (&(pod.dataSize)) - (&pod), + (&(pod.dataFormatVersion)) - (&pod), ], - 'itemsize': sizeof(nvmlClkMonStatus_t), + 'itemsize': sizeof(nvmlEventSetGetContextInfo_v1_t), }) -clk_mon_status_dtype = _get_clk_mon_status_dtype_offsets() +event_set_get_context_info_v1_dtype = _get_event_set_get_context_info_v1_dtype_offsets() -cdef class ClkMonStatus: - """Empty-initialize an instance of `nvmlClkMonStatus_t`. +cdef class EventSetGetContextInfo_v1: + """Empty-initialize an instance of `nvmlEventSetGetContextInfo_v1_t`. - .. seealso:: `nvmlClkMonStatus_t` + .. seealso:: `nvmlEventSetGetContextInfo_v1_t` """ cdef: - nvmlClkMonStatus_t *_ptr + nvmlEventSetGetContextInfo_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlClkMonStatus_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEventSetGetContextInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ClkMonStatus") + raise MemoryError("Error allocating EventSetGetContextInfo_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlClkMonStatus_t *ptr + cdef nvmlEventSetGetContextInfo_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.ClkMonStatus object at {hex(id(self))}>" + return f"<{__name__}.EventSetGetContextInfo_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18511,24 +18613,24 @@ cdef class ClkMonStatus: return (self._ptr) def __eq__(self, other): - cdef ClkMonStatus other_ - if not isinstance(other, ClkMonStatus): + cdef EventSetGetContextInfo_v1 other_ + if not isinstance(other, EventSetGetContextInfo_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlClkMonStatus_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventSetGetContextInfo_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlClkMonStatus_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEventSetGetContextInfo_v1_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 = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEventSetGetContextInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ClkMonStatus") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClkMonStatus_t)) + raise MemoryError("Error allocating EventSetGetContextInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventSetGetContextInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18536,55 +18638,77 @@ cdef class ClkMonStatus: setattr(self, key, val) @property - def clk_mon_list(self): - """ClkMonFaultInfo: """ - return ClkMonFaultInfo.from_ptr( - &(self._ptr[0].clkMonList), - self._ptr[0].clkMonListSize, - readonly=self._readonly, - owner=self, - ) + def index(self): + """int: [in] Zero-based context index.""" + return self._ptr[0].index - @clk_mon_list.setter - def clk_mon_list(self, val): + @index.setter + def index(self, val): if self._readonly: - raise ValueError("This ClkMonStatus instance is read-only") - cdef ClkMonFaultInfo val_ = val - if len(val) > 32: - raise ValueError(f"Expected length < 32 for field clk_mon_list, got {len(val)}") - self._ptr[0].clkMonListSize = len(val) - if len(val) == 0: - return - _cyb_memcpy(&(self._ptr[0].clkMonList), (val_._get_ptr()), sizeof(nvmlClkMonFaultInfo_t) * self._ptr[0].clkMonListSize) + raise ValueError("This EventSetGetContextInfo_v1 instance is read-only") + self._ptr[0].index = val @property - def b_global_status(self): - """int: """ - return self._ptr[0].bGlobalStatus + def nvml_gpu_operational_event_context_type(self): + """int: [out] `nvmlGpuOperationalEventContextType_t` value describing the NVML public interpretation of the context payload.""" + return self._ptr[0].nvmlGpuOperationalEventContextType - @b_global_status.setter - def b_global_status(self, val): + @nvml_gpu_operational_event_context_type.setter + def nvml_gpu_operational_event_context_type(self, val): if self._readonly: - raise ValueError("This ClkMonStatus instance is read-only") - self._ptr[0].bGlobalStatus = val + raise ValueError("This EventSetGetContextInfo_v1 instance is read-only") + self._ptr[0].nvmlGpuOperationalEventContextType = val + + @property + def source_event_context_type(self): + """int: [out] Source-defined context payload type identifier carried by the event.""" + return self._ptr[0].sourceEventContextType + + @source_event_context_type.setter + def source_event_context_type(self, val): + if self._readonly: + raise ValueError("This EventSetGetContextInfo_v1 instance is read-only") + self._ptr[0].sourceEventContextType = val + + @property + def data_size(self): + """int: [out] Context payload size in bytes, excluding alignment padding.""" + return self._ptr[0].dataSize + + @data_size.setter + def data_size(self, val): + if self._readonly: + raise ValueError("This EventSetGetContextInfo_v1 instance is read-only") + self._ptr[0].dataSize = val + + @property + def data_format_version(self): + """int: [out] Payload format version for `sourceEventContextType`.""" + return self._ptr[0].dataFormatVersion + + @data_format_version.setter + def data_format_version(self, val): + if self._readonly: + raise ValueError("This EventSetGetContextInfo_v1 instance is read-only") + self._ptr[0].dataFormatVersion = val @staticmethod def from_buffer(buffer): - """Create an ClkMonStatus instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlClkMonStatus_t), ClkMonStatus) + """Create an EventSetGetContextInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEventSetGetContextInfo_v1_t), EventSetGetContextInfo_v1) @staticmethod def from_data(data): - """Create an ClkMonStatus instance wrapping the given NumPy array. + """Create an EventSetGetContextInfo_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `clk_mon_status_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `event_set_get_context_info_v1_dtype` holding the data. """ - return _cyb_from_data(data, "clk_mon_status_dtype", clk_mon_status_dtype, ClkMonStatus) + return _cyb_from_data(data, "event_set_get_context_info_v1_dtype", event_set_get_context_info_v1_dtype, EventSetGetContextInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an ClkMonStatus instance wrapping the given pointer. + """Create an EventSetGetContextInfo_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18593,69 +18717,65 @@ cdef class ClkMonStatus: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef ClkMonStatus obj = ClkMonStatus.__new__(ClkMonStatus) + cdef EventSetGetContextInfo_v1 obj = EventSetGetContextInfo_v1.__new__(EventSetGetContextInfo_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEventSetGetContextInfo_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ClkMonStatus") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlClkMonStatus_t)) + raise MemoryError("Error allocating EventSetGetContextInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEventSetGetContextInfo_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessesUtilizationInfo_v1_t pod +cdef _get_event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets(): + cdef nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t pod return _numpy.dtype({ - 'names': ['version', 'process_samples_count', 'last_seen_time_stamp', 'proc_util_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'names': ['index', 'xid_code'], + 'formats': [_numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.processSamplesCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.procUtilArray)) - (&pod), + (&(pod.index)) - (&pod), + (&(pod.xidCode)) - (&pod), ], - 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), + 'itemsize': sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t), }) -processes_utilization_info_v1_dtype = _get_processes_utilization_info_v1_dtype_offsets() +event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype = _get_event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets() -cdef class ProcessesUtilizationInfo_v1: - """Empty-initialize an instance of `nvmlProcessesUtilizationInfo_v1_t`. +cdef class EventSetGetGpuOperationalEventContextLegacyXid_v1: + """Empty-initialize an instance of `nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t`. - .. seealso:: `nvmlProcessesUtilizationInfo_v1_t` + .. seealso:: `nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t` """ cdef: - nvmlProcessesUtilizationInfo_v1_t *_ptr + nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t *_ptr object _owner bint _owned bint _readonly - dict _refs def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") + raise MemoryError("Error allocating EventSetGetGpuOperationalEventContextLegacyXid_v1") self._owner = None self._owned = True self._readonly = False - self._refs = {} def __dealloc__(self): - cdef nvmlProcessesUtilizationInfo_v1_t *ptr + cdef nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.ProcessesUtilizationInfo_v1 object at {hex(id(self))}>" + return f"<{__name__}.EventSetGetGpuOperationalEventContextLegacyXid_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18669,24 +18789,24 @@ cdef class ProcessesUtilizationInfo_v1: return (self._ptr) def __eq__(self, other): - cdef ProcessesUtilizationInfo_v1 other_ - if not isinstance(other, ProcessesUtilizationInfo_v1): + cdef EventSetGetGpuOperationalEventContextLegacyXid_v1 other_ + if not isinstance(other, EventSetGetGpuOperationalEventContextLegacyXid_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessesUtilizationInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_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 = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + raise MemoryError("Error allocating EventSetGetGpuOperationalEventContextLegacyXid_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18694,65 +18814,44 @@ cdef class ProcessesUtilizationInfo_v1: setattr(self, key, val) @property - def version(self): - """int: The version number of this struct.""" - return self._ptr[0].version - - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") - self._ptr[0].version = val - - @property - def last_seen_time_stamp(self): - """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" - return self._ptr[0].lastSeenTimeStamp + def index(self): + """int: [in] Zero-based context index.""" + return self._ptr[0].index - @last_seen_time_stamp.setter - def last_seen_time_stamp(self, val): + @index.setter + def index(self, val): if self._readonly: - raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") - self._ptr[0].lastSeenTimeStamp = val + raise ValueError("This EventSetGetGpuOperationalEventContextLegacyXid_v1 instance is read-only") + self._ptr[0].index = val @property - def proc_util_array(self): - """int: The array (allocated by caller) of the utilization of GPU SM, framebuffer, video encoder, video decoder, JPEG, and OFA.""" - if self._ptr[0].procUtilArray == NULL or self._ptr[0].processSamplesCount == 0: - return [] - return ProcessUtilizationInfo_v1.from_ptr( - (self._ptr[0].procUtilArray), - self._ptr[0].processSamplesCount, - owner=self, - readonly=self._readonly - ) + def xid_code(self): + """int: [out] Legacy Xid code carried in a GPU Operational Event context.""" + return self._ptr[0].xidCode - @proc_util_array.setter - def proc_util_array(self, val): + @xid_code.setter + def xid_code(self, val): if self._readonly: - raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") - cdef ProcessUtilizationInfo_v1 arr = val - self._ptr[0].procUtilArray = (arr._get_ptr()) - self._ptr[0].processSamplesCount = len(arr) - self._refs["proc_util_array"] = arr + raise ValueError("This EventSetGetGpuOperationalEventContextLegacyXid_v1 instance is read-only") + self._ptr[0].xidCode = val @staticmethod def from_buffer(buffer): - """Create an ProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlProcessesUtilizationInfo_v1_t), ProcessesUtilizationInfo_v1) + """Create an EventSetGetGpuOperationalEventContextLegacyXid_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t), EventSetGetGpuOperationalEventContextLegacyXid_v1) @staticmethod def from_data(data): - """Create an ProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + """Create an EventSetGetGpuOperationalEventContextLegacyXid_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `processes_utilization_info_v1_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype` holding the data. """ - return _cyb_from_data(data, "processes_utilization_info_v1_dtype", processes_utilization_info_v1_dtype, ProcessesUtilizationInfo_v1) + return _cyb_from_data(data, "event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype", event_set_get_gpu_operational_event_context_legacy_xid_v1_dtype, EventSetGetGpuOperationalEventContextLegacyXid_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an ProcessesUtilizationInfo_v1 instance wrapping the given pointer. + """Create an EventSetGetGpuOperationalEventContextLegacyXid_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18761,66 +18860,65 @@ cdef class ProcessesUtilizationInfo_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef ProcessesUtilizationInfo_v1 obj = ProcessesUtilizationInfo_v1.__new__(ProcessesUtilizationInfo_v1) + cdef EventSetGetGpuOperationalEventContextLegacyXid_v1 obj = EventSetGetGpuOperationalEventContextLegacyXid_v1.__new__(EventSetGetGpuOperationalEventContextLegacyXid_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + raise MemoryError("Error allocating EventSetGetGpuOperationalEventContextLegacyXid_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly - obj._refs = {} return obj -cdef _get_gpu_dynamic_pstates_info_dtype_offsets(): - cdef nvmlGpuDynamicPstatesInfo_t pod +cdef _get_gpu_fabric_clique_v1_dtype_offsets(): + cdef nvmlGpuFabricClique_v1_t pod return _numpy.dtype({ - 'names': ['flags_', 'utilization'], - 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], + 'names': ['type', 'id'], + 'formats': [_numpy.uint8, _numpy.uint32], 'offsets': [ - (&(pod.flags)) - (&pod), - (&(pod.utilization)) - (&pod), + (&(pod.type)) - (&pod), + (&(pod.id)) - (&pod), ], - 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), + 'itemsize': sizeof(nvmlGpuFabricClique_v1_t), }) -gpu_dynamic_pstates_info_dtype = _get_gpu_dynamic_pstates_info_dtype_offsets() +gpu_fabric_clique_v1_dtype = _get_gpu_fabric_clique_v1_dtype_offsets() -cdef class GpuDynamicPstatesInfo: - """Empty-initialize an instance of `nvmlGpuDynamicPstatesInfo_t`. +cdef class GpuFabricClique_v1: + """Empty-initialize an instance of `nvmlGpuFabricClique_v1_t`. - .. seealso:: `nvmlGpuDynamicPstatesInfo_t` + .. seealso:: `nvmlGpuFabricClique_v1_t` """ cdef: - nvmlGpuDynamicPstatesInfo_t *_ptr + nvmlGpuFabricClique_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlGpuDynamicPstatesInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuFabricClique_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuDynamicPstatesInfo") + raise MemoryError("Error allocating GpuFabricClique_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlGpuDynamicPstatesInfo_t *ptr + cdef nvmlGpuFabricClique_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.GpuDynamicPstatesInfo object at {hex(id(self))}>" + return f"<{__name__}.GpuFabricClique_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18834,24 +18932,24 @@ cdef class GpuDynamicPstatesInfo: return (self._ptr) def __eq__(self, other): - cdef GpuDynamicPstatesInfo other_ - if not isinstance(other, GpuDynamicPstatesInfo): + cdef GpuFabricClique_v1 other_ + if not isinstance(other, GpuFabricClique_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuDynamicPstatesInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricClique_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuDynamicPstatesInfo_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuFabricClique_v1_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 = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuFabricClique_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuDynamicPstatesInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuDynamicPstatesInfo_t)) + raise MemoryError("Error allocating GpuFabricClique_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricClique_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18859,52 +18957,44 @@ cdef class GpuDynamicPstatesInfo: setattr(self, key, val) @property - def utilization(self): - """_py_anon_pod1: """ - return _py_anon_pod1.from_ptr( - &(self._ptr[0].utilization), - 8, - readonly=self._readonly, - owner=self, - ) + def type(self): + """int: Clique type. See NVML_GPU_FABRIC_CLIQUE_TYPE_*.""" + return self._ptr[0].type - @utilization.setter - def utilization(self, val): + @type.setter + def type(self, val): if self._readonly: - raise ValueError("This GpuDynamicPstatesInfo instance is read-only") - cdef _py_anon_pod1 val_ = val - if len(val) != 8: - raise ValueError(f"Expected length { 8 } for field utilization, got {len(val)}") - _cyb_memcpy(&(self._ptr[0].utilization), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod1) * 8) + raise ValueError("This GpuFabricClique_v1 instance is read-only") + self._ptr[0].type = val @property - def flags_(self): - """int: """ - return self._ptr[0].flags + def id(self): + """int: Clique ID assigned by the Fabric Manager.""" + return self._ptr[0].id - @flags_.setter - def flags_(self, val): + @id.setter + def id(self, val): if self._readonly: - raise ValueError("This GpuDynamicPstatesInfo instance is read-only") - self._ptr[0].flags = val + raise ValueError("This GpuFabricClique_v1 instance is read-only") + self._ptr[0].id = val @staticmethod def from_buffer(buffer): - """Create an GpuDynamicPstatesInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlGpuDynamicPstatesInfo_t), GpuDynamicPstatesInfo) + """Create an GpuFabricClique_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuFabricClique_v1_t), GpuFabricClique_v1) @staticmethod def from_data(data): - """Create an GpuDynamicPstatesInfo instance wrapping the given NumPy array. + """Create an GpuFabricClique_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `gpu_dynamic_pstates_info_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `gpu_fabric_clique_v1_dtype` holding the data. """ - return _cyb_from_data(data, "gpu_dynamic_pstates_info_dtype", gpu_dynamic_pstates_info_dtype, GpuDynamicPstatesInfo) + return _cyb_from_data(data, "gpu_fabric_clique_v1_dtype", gpu_fabric_clique_v1_dtype, GpuFabricClique_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an GpuDynamicPstatesInfo instance wrapping the given pointer. + """Create an GpuFabricClique_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18913,69 +19003,66 @@ cdef class GpuDynamicPstatesInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GpuDynamicPstatesInfo obj = GpuDynamicPstatesInfo.__new__(GpuDynamicPstatesInfo) + cdef GpuFabricClique_v1 obj = GpuFabricClique_v1.__new__(GpuFabricClique_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuFabricClique_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating GpuDynamicPstatesInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuDynamicPstatesInfo_t)) + raise MemoryError("Error allocating GpuFabricClique_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricClique_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_vgpu_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessesUtilizationInfo_v1_t pod +cdef _get_gpu_operational_event_config_v1_dtype_offsets(): + cdef nvmlGpuOperationalEventConfig_v1_t pod return _numpy.dtype({ - 'names': ['version', 'vgpu_process_count', 'last_seen_time_stamp', 'vgpu_proc_util_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'names': ['uuid', 'min_log_level', 'min_severity'], + 'formats': [(_numpy.int8, 96), _numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuProcessCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.vgpuProcUtilArray)) - (&pod), + (&(pod.uuid)) - (&pod), + (&(pod.minLogLevel)) - (&pod), + (&(pod.minSeverity)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), + 'itemsize': sizeof(nvmlGpuOperationalEventConfig_v1_t), }) -vgpu_processes_utilization_info_v1_dtype = _get_vgpu_processes_utilization_info_v1_dtype_offsets() +gpu_operational_event_config_v1_dtype = _get_gpu_operational_event_config_v1_dtype_offsets() -cdef class VgpuProcessesUtilizationInfo_v1: - """Empty-initialize an instance of `nvmlVgpuProcessesUtilizationInfo_v1_t`. +cdef class GpuOperationalEventConfig_v1: + """Empty-initialize an instance of `nvmlGpuOperationalEventConfig_v1_t`. - .. seealso:: `nvmlVgpuProcessesUtilizationInfo_v1_t` + .. seealso:: `nvmlGpuOperationalEventConfig_v1_t` """ cdef: - nvmlVgpuProcessesUtilizationInfo_v1_t *_ptr + nvmlGpuOperationalEventConfig_v1_t *_ptr object _owner bint _owned bint _readonly - dict _refs def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuOperationalEventConfig_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + raise MemoryError("Error allocating GpuOperationalEventConfig_v1") self._owner = None self._owned = True self._readonly = False - self._refs = {} def __dealloc__(self): - cdef nvmlVgpuProcessesUtilizationInfo_v1_t *ptr + cdef nvmlGpuOperationalEventConfig_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.VgpuProcessesUtilizationInfo_v1 object at {hex(id(self))}>" + return f"<{__name__}.GpuOperationalEventConfig_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18989,24 +19076,24 @@ cdef class VgpuProcessesUtilizationInfo_v1: return (self._ptr) def __eq__(self, other): - cdef VgpuProcessesUtilizationInfo_v1 other_ - if not isinstance(other, VgpuProcessesUtilizationInfo_v1): + cdef GpuOperationalEventConfig_v1 other_ + if not isinstance(other, GpuOperationalEventConfig_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuOperationalEventConfig_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuOperationalEventConfig_v1_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 = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuOperationalEventConfig_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + raise MemoryError("Error allocating GpuOperationalEventConfig_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuOperationalEventConfig_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19014,65 +19101,59 @@ cdef class VgpuProcessesUtilizationInfo_v1: setattr(self, key, val) @property - def version(self): - """int: The version number of this struct.""" - return self._ptr[0].version + def uuid(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) - @version.setter - def version(self, val): + @uuid.setter + def uuid(self, val): if self._readonly: - raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") - self._ptr[0].version = val + raise ValueError("This GpuOperationalEventConfig_v1 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field uuid, max length is 95") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].uuid), ptr, 96) @property - def last_seen_time_stamp(self): - """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" - return self._ptr[0].lastSeenTimeStamp + def min_log_level(self): + """int: """ + return self._ptr[0].minLogLevel - @last_seen_time_stamp.setter - def last_seen_time_stamp(self, val): + @min_log_level.setter + def min_log_level(self, val): if self._readonly: - raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") - self._ptr[0].lastSeenTimeStamp = val + raise ValueError("This GpuOperationalEventConfig_v1 instance is read-only") + self._ptr[0].minLogLevel = val @property - def vgpu_proc_util_array(self): - """int: The array (allocated by caller) in which utilization of processes running on vGPU instances are returned.""" - if self._ptr[0].vgpuProcUtilArray == NULL or self._ptr[0].vgpuProcessCount == 0: - return [] - return VgpuProcessUtilizationInfo_v1.from_ptr( - (self._ptr[0].vgpuProcUtilArray), - self._ptr[0].vgpuProcessCount, - owner=self, - readonly=self._readonly - ) + def min_severity(self): + """int: """ + return self._ptr[0].minSeverity - @vgpu_proc_util_array.setter - def vgpu_proc_util_array(self, val): + @min_severity.setter + def min_severity(self, val): if self._readonly: - raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") - cdef VgpuProcessUtilizationInfo_v1 arr = val - self._ptr[0].vgpuProcUtilArray = (arr._get_ptr()) - self._ptr[0].vgpuProcessCount = len(arr) - self._refs["vgpu_proc_util_array"] = arr + raise ValueError("This GpuOperationalEventConfig_v1 instance is read-only") + self._ptr[0].minSeverity = val @staticmethod def from_buffer(buffer): - """Create an VgpuProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), VgpuProcessesUtilizationInfo_v1) + """Create an GpuOperationalEventConfig_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuOperationalEventConfig_v1_t), GpuOperationalEventConfig_v1) @staticmethod def from_data(data): - """Create an VgpuProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + """Create an GpuOperationalEventConfig_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_processes_utilization_info_v1_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `gpu_operational_event_config_v1_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_processes_utilization_info_v1_dtype", vgpu_processes_utilization_info_v1_dtype, VgpuProcessesUtilizationInfo_v1) + return _cyb_from_data(data, "gpu_operational_event_config_v1_dtype", gpu_operational_event_config_v1_dtype, GpuOperationalEventConfig_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuProcessesUtilizationInfo_v1 instance wrapping the given pointer. + """Create an GpuOperationalEventConfig_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -19081,66 +19162,88 @@ cdef class VgpuProcessesUtilizationInfo_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuProcessesUtilizationInfo_v1 obj = VgpuProcessesUtilizationInfo_v1.__new__(VgpuProcessesUtilizationInfo_v1) + cdef GpuOperationalEventConfig_v1 obj = GpuOperationalEventConfig_v1.__new__(GpuOperationalEventConfig_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuOperationalEventConfig_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + raise MemoryError("Error allocating GpuOperationalEventConfig_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuOperationalEventConfig_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly - obj._refs = {} return obj -cdef _get_vgpu_scheduler_params_dtype_offsets(): - cdef nvmlVgpuSchedulerParams_t pod +cdef _get_event_set_wait_v3_dtype_offsets(): + cdef nvmlEventSetWait_v3_t pod return _numpy.dtype({ - 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], - 'formats': [_py_anon_pod2_dtype, _py_anon_pod3_dtype], + 'names': ['timeout_ms', 'data_type', 'uuid', 'source_module', 'event_type', 'event_data', 'group_cursor', 'instance_id', 'timestamp_usec', 'trace_id', 'gpu_instance_id', 'compute_instance_id', 'severity', 'category_id', 'module_event_code', 'scope', 'originator', 'module_instance', 'chiplet_id', 'log_level', 'attributes', 'group_cper_size', 'group_attributes', 'group_size', 'group_index'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 96), (_numpy.int8, 16), _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint8, _numpy.uint8], 'offsets': [ - (&(pod.vgpuSchedDataWithARR)) - (&pod), - (&(pod.vgpuSchedData)) - (&pod), + (&(pod.timeoutMs)) - (&pod), + (&(pod.dataType)) - (&pod), + (&(pod.uuid)) - (&pod), + (&(pod.sourceModule)) - (&pod), + (&(pod.eventType)) - (&pod), + (&(pod.eventData)) - (&pod), + (&(pod.groupCursor)) - (&pod), + (&(pod.instanceId)) - (&pod), + (&(pod.timestampUsec)) - (&pod), + (&(pod.traceId)) - (&pod), + (&(pod.gpuInstanceId)) - (&pod), + (&(pod.computeInstanceId)) - (&pod), + (&(pod.severity)) - (&pod), + (&(pod.categoryId)) - (&pod), + (&(pod.moduleEventCode)) - (&pod), + (&(pod.scope)) - (&pod), + (&(pod.originator)) - (&pod), + (&(pod.moduleInstance)) - (&pod), + (&(pod.chipletId)) - (&pod), + (&(pod.logLevel)) - (&pod), + (&(pod.attributes)) - (&pod), + (&(pod.groupCperSize)) - (&pod), + (&(pod.groupAttributes)) - (&pod), + (&(pod.groupSize)) - (&pod), + (&(pod.groupIndex)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerParams_t), + 'itemsize': sizeof(nvmlEventSetWait_v3_t), }) -vgpu_scheduler_params_dtype = _get_vgpu_scheduler_params_dtype_offsets() +event_set_wait_v3_dtype = _get_event_set_wait_v3_dtype_offsets() -cdef class VgpuSchedulerParams: - """Empty-initialize an instance of `nvmlVgpuSchedulerParams_t`. +cdef class EventSetWait_v3: + """Empty-initialize an instance of `nvmlEventSetWait_v3_t`. - .. seealso:: `nvmlVgpuSchedulerParams_t` + .. seealso:: `nvmlEventSetWait_v3_t` """ cdef: - nvmlVgpuSchedulerParams_t *_ptr + nvmlEventSetWait_v3_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerParams_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEventSetWait_v3_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerParams") + raise MemoryError("Error allocating EventSetWait_v3") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuSchedulerParams_t *ptr + cdef nvmlEventSetWait_v3_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.VgpuSchedulerParams object at {hex(id(self))}>" + return f"<{__name__}.EventSetWait_v3 object at {hex(id(self))}>" @property def ptr(self): @@ -19154,24 +19257,24 @@ cdef class VgpuSchedulerParams: return (self._ptr) def __eq__(self, other): - cdef VgpuSchedulerParams other_ - if not isinstance(other, VgpuSchedulerParams): + cdef EventSetWait_v3 other_ + if not isinstance(other, EventSetWait_v3): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerParams_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventSetWait_v3_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerParams_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEventSetWait_v3_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEventSetWait_v3_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerParams") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerParams_t)) + raise MemoryError("Error allocating EventSetWait_v3") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventSetWait_v3_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19179,207 +19282,305 @@ cdef class VgpuSchedulerParams: setattr(self, key, val) @property - def vgpu_sched_data_with_arr(self): - """_py_anon_pod2: """ - return _py_anon_pod2.from_ptr( - &(self._ptr[0].vgpuSchedDataWithARR), - readonly=self._readonly, - owner=self, - ) + def timeout_ms(self): + """int: [in] Maximum amount of time to wait, in milliseconds.""" + return self._ptr[0].timeoutMs - @vgpu_sched_data_with_arr.setter - def vgpu_sched_data_with_arr(self, val): + @timeout_ms.setter + def timeout_ms(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerParams instance is read-only") - cdef _py_anon_pod2 val_ = val - _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod2) * 1) + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].timeoutMs = val @property - def vgpu_sched_data(self): - """_py_anon_pod3: """ - return _py_anon_pod3.from_ptr( - &(self._ptr[0].vgpuSchedData), - readonly=self._readonly, - owner=self, - ) + def data_type(self): + """int: [out] `nvmlEventDataType_t` value indicating which event-data format is populated.""" + return self._ptr[0].dataType - @vgpu_sched_data.setter - def vgpu_sched_data(self, val): + @data_type.setter + def data_type(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerParams instance is read-only") - cdef _py_anon_pod3 val_ = val - _cyb_memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod3) * 1) + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].dataType = val - @staticmethod - def from_buffer(buffer): - """Create an VgpuSchedulerParams instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerParams_t), VgpuSchedulerParams) + @property + def uuid(self): + """~_numpy.int8: (array of length 96).[out] UUID for the GPU where the event occurred. Empty if unavailable.""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) - @staticmethod - def from_data(data): - """Create an VgpuSchedulerParams instance wrapping the given NumPy array. + @uuid.setter + def uuid(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 96: + raise ValueError("String too long for field uuid, max length is 95") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].uuid), ptr, 96) - Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_params_dtype` holding the data. - """ - return _cyb_from_data(data, "vgpu_scheduler_params_dtype", vgpu_scheduler_params_dtype, VgpuSchedulerParams) + @property + def source_module(self): + """~_numpy.int8: (array of length 16).[out] Source module signature for structured events. Not guaranteed to be NULL-terminated. Empty for NVML event-bit events.""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].sourceModule) - @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerParams instance wrapping the given pointer. + @source_module.setter + def source_module(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 16: + raise ValueError("String too long for field source_module, max length is 15") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].sourceModule), ptr, 16) - 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 VgpuSchedulerParams obj = VgpuSchedulerParams.__new__(VgpuSchedulerParams) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerParams") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerParams_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly - return obj + @property + def event_type(self): + """int: [out] NVML event bit for `NVML_EVENT_DATA_TYPE_NVML_EVENT` events; `nvmlEventTypeNone` for structured events.""" + return self._ptr[0].eventType + @event_type.setter + def event_type(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].eventType = val -cdef _get_vgpu_scheduler_set_params_dtype_offsets(): - cdef nvmlVgpuSchedulerSetParams_t pod - return _numpy.dtype({ - 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], - 'formats': [_py_anon_pod4_dtype, _py_anon_pod5_dtype], - 'offsets': [ - (&(pod.vgpuSchedDataWithARR)) - (&pod), - (&(pod.vgpuSchedData)) - (&pod), - ], - 'itemsize': sizeof(nvmlVgpuSchedulerSetParams_t), - }) + @property + def event_data(self): + """int: [out] Xid code for `nvmlEventTypeXidCriticalError`, or 0 when not applicable.""" + return self._ptr[0].eventData -vgpu_scheduler_set_params_dtype = _get_vgpu_scheduler_set_params_dtype_offsets() + @event_data.setter + def event_data(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].eventData = val -cdef class VgpuSchedulerSetParams: - """Empty-initialize an instance of `nvmlVgpuSchedulerSetParams_t`. + @property + def group_cursor(self): + """int: [out] Structured event group identifier. 0 for NVML event-bit events.""" + return self._ptr[0].groupCursor + @group_cursor.setter + def group_cursor(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].groupCursor = val - .. seealso:: `nvmlVgpuSchedulerSetParams_t` - """ - cdef: - nvmlVgpuSchedulerSetParams_t *_ptr - object _owner - bint _owned - bint _readonly + @property + def instance_id(self): + """int: [out] Structured event sequence identifier. 0 for NVML event-bit events.""" + return self._ptr[0].instanceId - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerSetParams") - self._owner = None - self._owned = True - self._readonly = False + @instance_id.setter + def instance_id(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].instanceId = val - def __dealloc__(self): - cdef nvmlVgpuSchedulerSetParams_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) + @property + def timestamp_usec(self): + """int: [out] Event timestamp in microseconds. 0 if unavailable.""" + return self._ptr[0].timestampUsec - def __repr__(self): - return f"<{__name__}.VgpuSchedulerSetParams object at {hex(id(self))}>" + @timestamp_usec.setter + def timestamp_usec(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].timestampUsec = val @property - def ptr(self): - """Get the pointer address to the data as Python :class:`int`.""" - return (self._ptr) + def trace_id(self): + """int: [out] Structured event trace identifier. 0 for NVML event-bit events.""" + return self._ptr[0].traceId - cdef intptr_t _get_ptr(self): - return (self._ptr) + @trace_id.setter + def trace_id(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].traceId = val - def __int__(self): - return (self._ptr) + @property + def gpu_instance_id(self): + """int: [out] MIG GPU instance ID for NVML event-bit data, or `NVML_GPU_INSTANCE_ID_ANY` when not applicable.""" + return self._ptr[0].gpuInstanceId - def __eq__(self, other): - cdef VgpuSchedulerSetParams other_ - if not isinstance(other, VgpuSchedulerSetParams): - return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerSetParams_t)) == 0) + @gpu_instance_id.setter + def gpu_instance_id(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].gpuInstanceId = val - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerSetParams_t), self._readonly) + @property + def compute_instance_id(self): + """int: [out] MIG compute instance ID for NVML event-bit data, or `NVML_COMPUTE_INSTANCE_ID_ANY` when not applicable.""" + return self._ptr[0].computeInstanceId - def __releasebuffer__(self, Py_buffer *buffer): - pass + @compute_instance_id.setter + def compute_instance_id(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].computeInstanceId = val - def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerSetParams") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerSetParams_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + @property + def severity(self): + """int: [out] `nvmlOperationalEventSeverity_t` value for structured events. May contain newer severity values not named in this header. `NVML_OPERATIONAL_EVENT_SEVERITY_ALL` for NVML event-bit events.""" + return self._ptr[0].severity + + @severity.setter + def severity(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].severity = val @property - def vgpu_sched_data_with_arr(self): - """_py_anon_pod4: """ - return _py_anon_pod4.from_ptr( - &(self._ptr[0].vgpuSchedDataWithARR), - readonly=self._readonly, - owner=self, - ) + def category_id(self): + """int: [out] Source-defined structured event category identifier. 0 for NVML event-bit events.""" + return self._ptr[0].categoryId - @vgpu_sched_data_with_arr.setter - def vgpu_sched_data_with_arr(self, val): + @category_id.setter + def category_id(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerSetParams instance is read-only") - cdef _py_anon_pod4 val_ = val - _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod4) * 1) + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].categoryId = val @property - def vgpu_sched_data(self): - """_py_anon_pod5: """ - return _py_anon_pod5.from_ptr( - &(self._ptr[0].vgpuSchedData), - readonly=self._readonly, - owner=self, - ) + def module_event_code(self): + """int: [out] Source-module-defined event code. Interpret with `sourceModule`. 0 for NVML event-bit events.""" + return self._ptr[0].moduleEventCode - @vgpu_sched_data.setter - def vgpu_sched_data(self, val): + @module_event_code.setter + def module_event_code(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerSetParams instance is read-only") - cdef _py_anon_pod5 val_ = val - _cyb_memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod5) * 1) + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].moduleEventCode = val + + @property + def scope(self): + """int: [out] Structured event scope identifier. 0 for NVML event-bit events.""" + return self._ptr[0].scope + + @scope.setter + def scope(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].scope = val + + @property + def originator(self): + """int: [out] Structured event originator identifier. 0 for NVML event-bit events.""" + return self._ptr[0].originator + + @originator.setter + def originator(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].originator = val + + @property + def module_instance(self): + """int: [out] Structured event module instance identifier. 0 for NVML event-bit events.""" + return self._ptr[0].moduleInstance + + @module_instance.setter + def module_instance(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].moduleInstance = val + + @property + def chiplet_id(self): + """int: [out] Structured event chiplet identifier. 0 for NVML event-bit events.""" + return self._ptr[0].chipletId + + @chiplet_id.setter + def chiplet_id(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].chipletId = val + + @property + def log_level(self): + """int: [out] `nvmlGpuOperationalEventLogLevel_t` value for structured GPU Operational Events. May contain newer log-level values not named in this header. `NVML_GPU_OPERATIONAL_EVENT_LOG_LEVEL_ALL` for NVML event-bit events.""" + return self._ptr[0].logLevel + + @log_level.setter + def log_level(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].logLevel = val + + @property + def attributes(self): + """int: [out] Bitmask of `NVML_OPERATIONAL_EVENT_ATTR_*` values for structured events. May contain newer bits not named in this header. 0 for NVML event-bit events. May include `NVML_OPERATIONAL_EVENT_ATTR_OVERFLOW` if events or associated payloads were dropped.""" + return self._ptr[0].attributes + + @attributes.setter + def attributes(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].attributes = val + + @property + def group_cper_size(self): + """int: [out] Associated CPER record size in bytes. 0 when unavailable.""" + return self._ptr[0].groupCperSize + + @group_cper_size.setter + def group_cper_size(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].groupCperSize = val + + @property + def group_attributes(self): + """int: [out] Bitmask of `NVML_OPERATIONAL_EVENT_GROUP_ATTR_*` values for structured events. May contain newer bits not named in this header. 0 for NVML event-bit events.""" + return self._ptr[0].groupAttributes + + @group_attributes.setter + def group_attributes(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].groupAttributes = val + + @property + def group_size(self): + """int: [out] Total number of events in the structured event group. 0 for NVML event-bit events.""" + return self._ptr[0].groupSize + + @group_size.setter + def group_size(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].groupSize = val + + @property + def group_index(self): + """int: [out] Zero-based index within the structured event group. 0 for NVML event-bit events.""" + return self._ptr[0].groupIndex + + @group_index.setter + def group_index(self, val): + if self._readonly: + raise ValueError("This EventSetWait_v3 instance is read-only") + self._ptr[0].groupIndex = val @staticmethod def from_buffer(buffer): - """Create an VgpuSchedulerSetParams instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerSetParams_t), VgpuSchedulerSetParams) + """Create an EventSetWait_v3 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEventSetWait_v3_t), EventSetWait_v3) @staticmethod def from_data(data): - """Create an VgpuSchedulerSetParams instance wrapping the given NumPy array. + """Create an EventSetWait_v3 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_set_params_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `event_set_wait_v3_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_set_params_dtype", vgpu_scheduler_set_params_dtype, VgpuSchedulerSetParams) + return _cyb_from_data(data, "event_set_wait_v3_dtype", event_set_wait_v3_dtype, EventSetWait_v3) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerSetParams instance wrapping the given pointer. + """Create an EventSetWait_v3 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -19388,66 +19589,66 @@ cdef class VgpuSchedulerSetParams: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerSetParams obj = VgpuSchedulerSetParams.__new__(VgpuSchedulerSetParams) + cdef EventSetWait_v3 obj = EventSetWait_v3.__new__(EventSetWait_v3) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEventSetWait_v3_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerSetParams") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerSetParams_t)) + raise MemoryError("Error allocating EventSetWait_v3") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEventSetWait_v3_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_vgpu_license_info_dtype_offsets(): - cdef nvmlVgpuLicenseInfo_t pod +cdef _get_nvlink_set_bw_mode_async_v1_dtype_offsets(): + cdef nvmlNvlinkSetBwModeAsync_v1_t pod return _numpy.dtype({ - 'names': ['is_licensed', 'license_expiry', 'current_state'], - 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], + 'names': ['b_set_best', 'bw_mode', 'async_poll_timeout_ms'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.isLicensed)) - (&pod), - (&(pod.licenseExpiry)) - (&pod), - (&(pod.currentState)) - (&pod), + (&(pod.bSetBest)) - (&pod), + (&(pod.bwMode)) - (&pod), + (&(pod.asyncPollTimeoutMs)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), + 'itemsize': sizeof(nvmlNvlinkSetBwModeAsync_v1_t), }) -vgpu_license_info_dtype = _get_vgpu_license_info_dtype_offsets() +nvlink_set_bw_mode_async_v1_dtype = _get_nvlink_set_bw_mode_async_v1_dtype_offsets() -cdef class VgpuLicenseInfo: - """Empty-initialize an instance of `nvmlVgpuLicenseInfo_t`. +cdef class NvlinkSetBwModeAsync_v1: + """Empty-initialize an instance of `nvmlNvlinkSetBwModeAsync_v1_t`. - .. seealso:: `nvmlVgpuLicenseInfo_t` + .. seealso:: `nvmlNvlinkSetBwModeAsync_v1_t` """ cdef: - nvmlVgpuLicenseInfo_t *_ptr + nvmlNvlinkSetBwModeAsync_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuLicenseInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuLicenseInfo") + raise MemoryError("Error allocating NvlinkSetBwModeAsync_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuLicenseInfo_t *ptr + cdef nvmlNvlinkSetBwModeAsync_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.VgpuLicenseInfo object at {hex(id(self))}>" + return f"<{__name__}.NvlinkSetBwModeAsync_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -19461,24 +19662,24 @@ cdef class VgpuLicenseInfo: return (self._ptr) def __eq__(self, other): - cdef VgpuLicenseInfo other_ - if not isinstance(other, VgpuLicenseInfo): + cdef NvlinkSetBwModeAsync_v1 other_ + if not isinstance(other, NvlinkSetBwModeAsync_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuLicenseInfo_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkSetBwModeAsync_v1_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 = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuLicenseInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseInfo_t)) + raise MemoryError("Error allocating NvlinkSetBwModeAsync_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19486,60 +19687,55 @@ cdef class VgpuLicenseInfo: setattr(self, key, val) @property - def license_expiry(self): - """VgpuLicenseExpiry: """ - return VgpuLicenseExpiry.from_ptr( - &(self._ptr[0].licenseExpiry), - readonly=self._readonly, - owner=self, - ) + def b_set_best(self): + """int: [in] - Set to the best available Bandwidth mode""" + return self._ptr[0].bSetBest - @license_expiry.setter - def license_expiry(self, val): + @b_set_best.setter + def b_set_best(self, val): if self._readonly: - raise ValueError("This VgpuLicenseInfo instance is read-only") - cdef VgpuLicenseExpiry val_ = val - _cyb_memcpy(&(self._ptr[0].licenseExpiry), (val_._get_ptr()), sizeof(nvmlVgpuLicenseExpiry_t) * 1) + raise ValueError("This NvlinkSetBwModeAsync_v1 instance is read-only") + self._ptr[0].bSetBest = val @property - def is_licensed(self): - """int: """ - return self._ptr[0].isLicensed + def bw_mode(self): + """int: [in] - Requested Bandwidth mode to set. Values can be found from `nvmlDeviceGetNvlinkSupportedBwModes()`""" + return self._ptr[0].bwMode - @is_licensed.setter - def is_licensed(self, val): + @bw_mode.setter + def bw_mode(self, val): if self._readonly: - raise ValueError("This VgpuLicenseInfo instance is read-only") - self._ptr[0].isLicensed = val + raise ValueError("This NvlinkSetBwModeAsync_v1 instance is read-only") + self._ptr[0].bwMode = val @property - def current_state(self): - """int: """ - return self._ptr[0].currentState + def async_poll_timeout_ms(self): + """int: [out] - Time in ms to poll to validate bandwidth setting.""" + return self._ptr[0].asyncPollTimeoutMs - @current_state.setter - def current_state(self, val): + @async_poll_timeout_ms.setter + def async_poll_timeout_ms(self, val): if self._readonly: - raise ValueError("This VgpuLicenseInfo instance is read-only") - self._ptr[0].currentState = val + raise ValueError("This NvlinkSetBwModeAsync_v1 instance is read-only") + self._ptr[0].asyncPollTimeoutMs = val @staticmethod def from_buffer(buffer): - """Create an VgpuLicenseInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuLicenseInfo_t), VgpuLicenseInfo) + """Create an NvlinkSetBwModeAsync_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkSetBwModeAsync_v1_t), NvlinkSetBwModeAsync_v1) @staticmethod def from_data(data): - """Create an VgpuLicenseInfo instance wrapping the given NumPy array. + """Create an NvlinkSetBwModeAsync_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_license_info_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `nvlink_set_bw_mode_async_v1_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_license_info_dtype", vgpu_license_info_dtype, VgpuLicenseInfo) + return _cyb_from_data(data, "nvlink_set_bw_mode_async_v1_dtype", nvlink_set_bw_mode_async_v1_dtype, NvlinkSetBwModeAsync_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuLicenseInfo instance wrapping the given pointer. + """Create an NvlinkSetBwModeAsync_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -19548,65 +19744,64 @@ cdef class VgpuLicenseInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuLicenseInfo obj = VgpuLicenseInfo.__new__(VgpuLicenseInfo) + cdef NvlinkSetBwModeAsync_v1 obj = NvlinkSetBwModeAsync_v1.__new__(NvlinkSetBwModeAsync_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuLicenseInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseInfo_t)) + raise MemoryError("Error allocating NvlinkSetBwModeAsync_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_grid_licensable_feature_dtype_offsets(): - cdef nvmlGridLicensableFeature_t pod +cdef _get_nvlink_telemetry_sample_v1_dtype_offsets(): + cdef nvmlNvlinkTelemetrySample_v1_t pod return _numpy.dtype({ - 'names': ['feature_code', 'feature_state', 'license_info', 'product_name', 'feature_enabled', 'license_expiry'], - 'formats': [_numpy.int32, _numpy.uint32, (_numpy.int8, 128), (_numpy.int8, 128), _numpy.uint32, grid_license_expiry_dtype], + 'names': ['link_id', 'sample_type', 'sample_count', 'samples', 'nvml_return'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.int32], 'offsets': [ - (&(pod.featureCode)) - (&pod), - (&(pod.featureState)) - (&pod), - (&(pod.licenseInfo)) - (&pod), - (&(pod.productName)) - (&pod), - (&(pod.featureEnabled)) - (&pod), - (&(pod.licenseExpiry)) - (&pod), + (&(pod.linkId)) - (&pod), + (&(pod.sampleType)) - (&pod), + (&(pod.sampleCount)) - (&pod), + (&(pod.samples)) - (&pod), + (&(pod.nvmlReturn)) - (&pod), ], - 'itemsize': sizeof(nvmlGridLicensableFeature_t), + 'itemsize': sizeof(nvmlNvlinkTelemetrySample_v1_t), }) -grid_licensable_feature_dtype = _get_grid_licensable_feature_dtype_offsets() +nvlink_telemetry_sample_v1_dtype = _get_nvlink_telemetry_sample_v1_dtype_offsets() -cdef class GridLicensableFeature: - """Empty-initialize an array of `nvmlGridLicensableFeature_t`. - The resulting object is of length `size` and of dtype `grid_licensable_feature_dtype`. +cdef class NvlinkTelemetrySample_v1: + """Empty-initialize an array of `nvmlNvlinkTelemetrySample_v1_t`. + The resulting object is of length `size` and of dtype `nvlink_telemetry_sample_v1_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlGridLicensableFeature_t` + .. seealso:: `nvmlNvlinkTelemetrySample_v1_t` """ cdef: readonly object _data object _owner def __init__(self, size=1): - arr = _numpy.empty(size, dtype=grid_licensable_feature_dtype) + arr = _numpy.empty(size, dtype=nvlink_telemetry_sample_v1_dtype) self._data = arr.view(_numpy.recarray) - assert self._data.itemsize == sizeof(nvmlGridLicensableFeature_t), \ - f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlGridLicensableFeature_t) }" + assert self._data.itemsize == sizeof(nvmlNvlinkTelemetrySample_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlNvlinkTelemetrySample_v1_t) }" def __repr__(self): if self._data.size > 1: - return f"<{__name__}.GridLicensableFeature_Array_{self._data.size} object at {hex(id(self))}>" + return f"<{__name__}.NvlinkTelemetrySample_v1_Array_{self._data.size} object at {hex(id(self))}>" else: - return f"<{__name__}.GridLicensableFeature object at {hex(id(self))}>" + return f"<{__name__}.NvlinkTelemetrySample_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -19627,7 +19822,7 @@ cdef class GridLicensableFeature: def __eq__(self, other): cdef object self_data = self._data - if (not isinstance(other, GridLicensableFeature)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + if (not isinstance(other, NvlinkTelemetrySample_v1)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False return bool((self_data == other._data).all()) @@ -19638,64 +19833,59 @@ cdef class GridLicensableFeature: _cyb_cpython.PyBuffer_Release(buffer) @property - def feature_code(self): - """Union[~_numpy.int32, int]: """ + def link_id(self): + """Union[~_numpy.uint32, int]: [in] LinkId""" if self._data.size == 1: - return int(self._data.feature_code[0]) - return self._data.feature_code + return int(self._data.link_id[0]) + return self._data.link_id - @feature_code.setter - def feature_code(self, val): - self._data.feature_code = val + @link_id.setter + def link_id(self, val): + self._data.link_id = val @property - def feature_state(self): - """Union[~_numpy.uint32, int]: """ + def sample_type(self): + """Union[~_numpy.uint32, int]: [in] Type of telemetry to sample, specified by `nvmlNvlinkTelemetrySampleType_t`""" if self._data.size == 1: - return int(self._data.feature_state[0]) - return self._data.feature_state + return int(self._data.sample_type[0]) + return self._data.sample_type - @feature_state.setter - def feature_state(self, val): - self._data.feature_state = val + @sample_type.setter + def sample_type(self, val): + self._data.sample_type = val @property - def license_info(self): - """~_numpy.int8: (array of length 128).""" - return self._data.license_info + def sample_count(self): + """Union[~_numpy.uint32, int]: [in,out]: Number of samples users need to allocate. If set to 0, will return max supported count of samples without touching the ``samples`` pointer.""" + if self._data.size == 1: + return int(self._data.sample_count[0]) + return self._data.sample_count - @license_info.setter - def license_info(self, val): - self._data.license_info = val + @sample_count.setter + def sample_count(self, val): + self._data.sample_count = val @property - def product_name(self): - """~_numpy.int8: (array of length 128).""" - return self._data.product_name + def samples(self): + """Union[~_numpy.intp, int]: [in,out]: Array of samples allocated by the user. Can be set to NULL when getting count""" + if self._data.size == 1: + return int(self._data.samples[0]) + return self._data.samples - @product_name.setter - def product_name(self, val): - self._data.product_name = val + @samples.setter + def samples(self, val): + self._data.samples = val @property - def feature_enabled(self): - """Union[~_numpy.uint32, int]: """ + def nvml_return(self): + """Union[~_numpy.int32, int]: [out]: Return code for retrieving this sample. This must be checked by the client before looking at any output values, as they are invalid if ``nvmlReturn != NVML_SUCCESS``.""" if self._data.size == 1: - return int(self._data.feature_enabled[0]) - return self._data.feature_enabled - - @feature_enabled.setter - def feature_enabled(self, val): - self._data.feature_enabled = val + return int(self._data.nvml_return[0]) + return self._data.nvml_return - @property - def license_expiry(self): - """grid_license_expiry_dtype: """ - return self._data.license_expiry - - @license_expiry.setter - def license_expiry(self, val): - self._data.license_expiry = val + @nvml_return.setter + def nvml_return(self, val): + self._data.nvml_return = val def __getitem__(self, key): cdef ssize_t key_ @@ -19707,10 +19897,10 @@ cdef class GridLicensableFeature: raise IndexError("index is out of bounds") if key_ < 0: key_ += size - return GridLicensableFeature.from_data(self._data[key_:key_+1]) + return NvlinkTelemetrySample_v1.from_data(self._data[key_:key_+1]) out = self._data[key] - if isinstance(out, _numpy.recarray) and out.dtype == grid_licensable_feature_dtype: - return GridLicensableFeature.from_data(out) + if isinstance(out, _numpy.recarray) and out.dtype == nvlink_telemetry_sample_v1_dtype: + return NvlinkTelemetrySample_v1.from_data(out) return out def __setitem__(self, key, val): @@ -19718,30 +19908,30 @@ cdef class GridLicensableFeature: @staticmethod def from_buffer(buffer): - """Create an GridLicensableFeature instance with the memory from the given buffer.""" - return GridLicensableFeature.from_data(_numpy.frombuffer(buffer, dtype=grid_licensable_feature_dtype)) + """Create an NvlinkTelemetrySample_v1 instance with the memory from the given buffer.""" + return NvlinkTelemetrySample_v1.from_data(_numpy.frombuffer(buffer, dtype=nvlink_telemetry_sample_v1_dtype)) @staticmethod def from_data(data): - """Create an GridLicensableFeature instance wrapping the given NumPy array. + """Create an NvlinkTelemetrySample_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a 1D array of dtype `grid_licensable_feature_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `nvlink_telemetry_sample_v1_dtype` holding the data. """ - cdef GridLicensableFeature obj = GridLicensableFeature.__new__(GridLicensableFeature) + cdef NvlinkTelemetrySample_v1 obj = NvlinkTelemetrySample_v1.__new__(NvlinkTelemetrySample_v1) 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 != grid_licensable_feature_dtype: - raise ValueError("data array must be of dtype grid_licensable_feature_dtype") + if data.dtype != nvlink_telemetry_sample_v1_dtype: + raise ValueError("data array must be of dtype nvlink_telemetry_sample_v1_dtype") obj._data = data.view(_numpy.recarray) return obj @staticmethod def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): - """Create an GridLicensableFeature instance wrapping the given pointer. + """Create an NvlinkTelemetrySample_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -19752,60 +19942,60 @@ cdef class GridLicensableFeature: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GridLicensableFeature obj = GridLicensableFeature.__new__(GridLicensableFeature) + cdef NvlinkTelemetrySample_v1 obj = NvlinkTelemetrySample_v1.__new__(NvlinkTelemetrySample_v1) cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( - ptr, sizeof(nvmlGridLicensableFeature_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=grid_licensable_feature_dtype) + ptr, sizeof(nvmlNvlinkTelemetrySample_v1_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=nvlink_telemetry_sample_v1_dtype) obj._data = data.view(_numpy.recarray) obj._owner = owner return obj -cdef _get_unit_fan_speeds_dtype_offsets(): - cdef nvmlUnitFanSpeeds_t pod +cdef _get_ecc_bank_remapper_histogram_v1_dtype_offsets(): + cdef nvmlEccBankRemapperHistogram_v1_t pod return _numpy.dtype({ - 'names': ['fans', 'count'], - 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], + 'names': ['max_spare_group_count', 'no_spare_group_count'], + 'formats': [_numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.fans)) - (&pod), - (&(pod.count)) - (&pod), + (&(pod.maxSpareGroupCount)) - (&pod), + (&(pod.noSpareGroupCount)) - (&pod), ], - 'itemsize': sizeof(nvmlUnitFanSpeeds_t), + 'itemsize': sizeof(nvmlEccBankRemapperHistogram_v1_t), }) -unit_fan_speeds_dtype = _get_unit_fan_speeds_dtype_offsets() +ecc_bank_remapper_histogram_v1_dtype = _get_ecc_bank_remapper_histogram_v1_dtype_offsets() -cdef class UnitFanSpeeds: - """Empty-initialize an instance of `nvmlUnitFanSpeeds_t`. +cdef class EccBankRemapperHistogram_v1: + """Empty-initialize an instance of `nvmlEccBankRemapperHistogram_v1_t`. - .. seealso:: `nvmlUnitFanSpeeds_t` + .. seealso:: `nvmlEccBankRemapperHistogram_v1_t` """ cdef: - nvmlUnitFanSpeeds_t *_ptr + nvmlEccBankRemapperHistogram_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlUnitFanSpeeds_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEccBankRemapperHistogram_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating UnitFanSpeeds") + raise MemoryError("Error allocating EccBankRemapperHistogram_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlUnitFanSpeeds_t *ptr + cdef nvmlEccBankRemapperHistogram_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.UnitFanSpeeds object at {hex(id(self))}>" + return f"<{__name__}.EccBankRemapperHistogram_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -19819,24 +20009,24 @@ cdef class UnitFanSpeeds: return (self._ptr) def __eq__(self, other): - cdef UnitFanSpeeds other_ - if not isinstance(other, UnitFanSpeeds): + cdef EccBankRemapperHistogram_v1 other_ + if not isinstance(other, EccBankRemapperHistogram_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitFanSpeeds_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccBankRemapperHistogram_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlUnitFanSpeeds_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEccBankRemapperHistogram_v1_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 = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEccBankRemapperHistogram_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating UnitFanSpeeds") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitFanSpeeds_t)) + raise MemoryError("Error allocating EccBankRemapperHistogram_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccBankRemapperHistogram_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -19844,52 +20034,44 @@ cdef class UnitFanSpeeds: setattr(self, key, val) @property - def fans(self): - """UnitFanInfo: """ - return UnitFanInfo.from_ptr( - &(self._ptr[0].fans), - 24, - readonly=self._readonly, - owner=self, - ) + def max_spare_group_count(self): + """int: Number of groups that have maximum spare.""" + return self._ptr[0].maxSpareGroupCount - @fans.setter - def fans(self, val): + @max_spare_group_count.setter + def max_spare_group_count(self, val): if self._readonly: - raise ValueError("This UnitFanSpeeds instance is read-only") - cdef UnitFanInfo val_ = val - if len(val) != 24: - raise ValueError(f"Expected length { 24 } for field fans, got {len(val)}") - _cyb_memcpy(&(self._ptr[0].fans), (val_._get_ptr()), sizeof(nvmlUnitFanInfo_t) * 24) + raise ValueError("This EccBankRemapperHistogram_v1 instance is read-only") + self._ptr[0].maxSpareGroupCount = val @property - def count(self): - """int: """ - return self._ptr[0].count + def no_spare_group_count(self): + """int: Number of groups that have not spare.""" + return self._ptr[0].noSpareGroupCount - @count.setter - def count(self, val): + @no_spare_group_count.setter + def no_spare_group_count(self, val): if self._readonly: - raise ValueError("This UnitFanSpeeds instance is read-only") - self._ptr[0].count = val + raise ValueError("This EccBankRemapperHistogram_v1 instance is read-only") + self._ptr[0].noSpareGroupCount = val @staticmethod def from_buffer(buffer): - """Create an UnitFanSpeeds instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlUnitFanSpeeds_t), UnitFanSpeeds) + """Create an EccBankRemapperHistogram_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEccBankRemapperHistogram_v1_t), EccBankRemapperHistogram_v1) @staticmethod def from_data(data): - """Create an UnitFanSpeeds instance wrapping the given NumPy array. + """Create an EccBankRemapperHistogram_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `unit_fan_speeds_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `ecc_bank_remapper_histogram_v1_dtype` holding the data. """ - return _cyb_from_data(data, "unit_fan_speeds_dtype", unit_fan_speeds_dtype, UnitFanSpeeds) + return _cyb_from_data(data, "ecc_bank_remapper_histogram_v1_dtype", ecc_bank_remapper_histogram_v1_dtype, EccBankRemapperHistogram_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an UnitFanSpeeds instance wrapping the given pointer. + """Create an EccBankRemapperHistogram_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -19898,71 +20080,65 @@ cdef class UnitFanSpeeds: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef UnitFanSpeeds obj = UnitFanSpeeds.__new__(UnitFanSpeeds) + cdef EccBankRemapperHistogram_v1 obj = EccBankRemapperHistogram_v1.__new__(EccBankRemapperHistogram_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEccBankRemapperHistogram_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating UnitFanSpeeds") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUnitFanSpeeds_t)) + raise MemoryError("Error allocating EccBankRemapperHistogram_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccBankRemapperHistogram_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_vgpu_pgpu_metadata_dtype_offsets(): - cdef nvmlVgpuPgpuMetadata_t pod +cdef _get_excluded_device_info_dtype_offsets(): + cdef nvmlExcludedDeviceInfo_t pod return _numpy.dtype({ - 'names': ['version', 'revision', 'host_driver_version', 'pgpu_virtualization_caps', 'reserved', 'host_supported_vgpu_range', 'opaque_data_size', 'opaque_data'], - 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 80), _numpy.uint32, (_numpy.uint32, 5), vgpu_version_dtype, _numpy.uint32, (_numpy.int8, 4)], + 'names': ['pci_info', 'uuid'], + 'formats': [pci_info_dtype, (_numpy.int8, 80)], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.revision)) - (&pod), - (&(pod.hostDriverVersion)) - (&pod), - (&(pod.pgpuVirtualizationCaps)) - (&pod), - (&(pod.reserved)) - (&pod), - (&(pod.hostSupportedVgpuRange)) - (&pod), - (&(pod.opaqueDataSize)) - (&pod), - (&(pod.opaqueData)) - (&pod), + (&(pod.pciInfo)) - (&pod), + (&(pod.uuid)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), + 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), }) -vgpu_pgpu_metadata_dtype = _get_vgpu_pgpu_metadata_dtype_offsets() +excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() -cdef class VgpuPgpuMetadata: - """Empty-initialize an instance of `nvmlVgpuPgpuMetadata_t`. +cdef class ExcludedDeviceInfo: + """Empty-initialize an instance of `nvmlExcludedDeviceInfo_t`. - .. seealso:: `nvmlVgpuPgpuMetadata_t` + .. seealso:: `nvmlExcludedDeviceInfo_t` """ cdef: - nvmlVgpuPgpuMetadata_t *_ptr + nvmlExcludedDeviceInfo_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPgpuMetadata_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlExcludedDeviceInfo_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuPgpuMetadata") + raise MemoryError("Error allocating ExcludedDeviceInfo") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuPgpuMetadata_t *ptr + cdef nvmlExcludedDeviceInfo_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.VgpuPgpuMetadata object at {hex(id(self))}>" + return f"<{__name__}.ExcludedDeviceInfo object at {hex(id(self))}>" @property def ptr(self): @@ -19976,24 +20152,24 @@ cdef class VgpuPgpuMetadata: return (self._ptr) def __eq__(self, other): - cdef VgpuPgpuMetadata other_ - if not isinstance(other, VgpuPgpuMetadata): + cdef ExcludedDeviceInfo other_ + if not isinstance(other, ExcludedDeviceInfo): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuMetadata_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlExcludedDeviceInfo_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPgpuMetadata_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlExcludedDeviceInfo_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 = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + self._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuPgpuMetadata") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuMetadata_t)) + raise MemoryError("Error allocating ExcludedDeviceInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlExcludedDeviceInfo_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20001,112 +20177,53 @@ cdef class VgpuPgpuMetadata: setattr(self, key, val) @property - def host_supported_vgpu_range(self): - """VgpuVersion: """ - return VgpuVersion.from_ptr( - &(self._ptr[0].hostSupportedVgpuRange), + def pci_info(self): + """PciInfo: """ + return PciInfo.from_ptr( + &(self._ptr[0].pciInfo), readonly=self._readonly, owner=self, ) - @host_supported_vgpu_range.setter - def host_supported_vgpu_range(self, val): - if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - cdef VgpuVersion val_ = val - _cyb_memcpy(&(self._ptr[0].hostSupportedVgpuRange), (val_._get_ptr()), sizeof(nvmlVgpuVersion_t) * 1) - - @property - def version(self): - """int: """ - return self._ptr[0].version - - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - self._ptr[0].version = val - - @property - def revision(self): - """int: """ - return self._ptr[0].revision - - @revision.setter - def revision(self, val): + @pci_info.setter + def pci_info(self, val): if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - self._ptr[0].revision = val + raise ValueError("This ExcludedDeviceInfo instance is read-only") + cdef PciInfo val_ = val + _cyb_memcpy(&(self._ptr[0].pciInfo), (val_._get_ptr()), sizeof(nvmlPciInfo_t) * 1) @property - def host_driver_version(self): + def uuid(self): """~_numpy.int8: (array of length 80).""" - return _cyb_cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) - @host_driver_version.setter - def host_driver_version(self, val): + @uuid.setter + def uuid(self, val): if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") + raise ValueError("This ExcludedDeviceInfo instance is read-only") cdef bytes buf = val.encode() if len(buf) >= 80: - raise ValueError("String too long for field host_driver_version, max length is 79") - cdef char *ptr = buf - _cyb_memcpy((self._ptr[0].hostDriverVersion), ptr, 80) - - @property - def pgpu_virtualization_caps(self): - """int: """ - return self._ptr[0].pgpuVirtualizationCaps - - @pgpu_virtualization_caps.setter - def pgpu_virtualization_caps(self, val): - if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - self._ptr[0].pgpuVirtualizationCaps = val - - @property - def opaque_data_size(self): - """int: """ - return self._ptr[0].opaqueDataSize - - @opaque_data_size.setter - def opaque_data_size(self, val): - if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - self._ptr[0].opaqueDataSize = val - - @property - def opaque_data(self): - """~_numpy.int8: (array of length 4).""" - return _cyb_cpython.PyUnicode_FromString(self._ptr[0].opaqueData) - - @opaque_data.setter - def opaque_data(self, val): - if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - cdef bytes buf = val.encode() - if len(buf) >= 4: - raise ValueError("String too long for field opaque_data, max length is 3") + raise ValueError("String too long for field uuid, max length is 79") cdef char *ptr = buf - _cyb_memcpy((self._ptr[0].opaqueData), ptr, 4) + _cyb_memcpy((self._ptr[0].uuid), ptr, 80) @staticmethod def from_buffer(buffer): - """Create an VgpuPgpuMetadata instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuPgpuMetadata_t), VgpuPgpuMetadata) + """Create an ExcludedDeviceInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlExcludedDeviceInfo_t), ExcludedDeviceInfo) @staticmethod def from_data(data): - """Create an VgpuPgpuMetadata instance wrapping the given NumPy array. + """Create an ExcludedDeviceInfo instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_pgpu_metadata_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `excluded_device_info_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_pgpu_metadata_dtype", vgpu_pgpu_metadata_dtype, VgpuPgpuMetadata) + return _cyb_from_data(data, "excluded_device_info_dtype", excluded_device_info_dtype, ExcludedDeviceInfo) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuPgpuMetadata instance wrapping the given pointer. + """Create an ExcludedDeviceInfo instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -20115,67 +20232,69 @@ cdef class VgpuPgpuMetadata: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuPgpuMetadata obj = VgpuPgpuMetadata.__new__(VgpuPgpuMetadata) + cdef ExcludedDeviceInfo obj = ExcludedDeviceInfo.__new__(ExcludedDeviceInfo) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuPgpuMetadata") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuMetadata_t)) + raise MemoryError("Error allocating ExcludedDeviceInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlExcludedDeviceInfo_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_gpu_instance_info_dtype_offsets(): - cdef nvmlGpuInstanceInfo_t pod +cdef _get_process_detail_list_v1_dtype_offsets(): + cdef nvmlProcessDetailList_v1_t pod return _numpy.dtype({ - 'names': ['device_', 'id', 'profile_id', 'placement'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], + 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), + (&(pod.version)) - (&pod), + (&(pod.mode)) - (&pod), + (&(pod.numProcArrayEntries)) - (&pod), + (&(pod.procArray)) - (&pod), ], - 'itemsize': sizeof(nvmlGpuInstanceInfo_t), + 'itemsize': sizeof(nvmlProcessDetailList_v1_t), }) -gpu_instance_info_dtype = _get_gpu_instance_info_dtype_offsets() +process_detail_list_v1_dtype = _get_process_detail_list_v1_dtype_offsets() -cdef class GpuInstanceInfo: - """Empty-initialize an instance of `nvmlGpuInstanceInfo_t`. +cdef class ProcessDetailList_v1: + """Empty-initialize an instance of `nvmlProcessDetailList_v1_t`. - .. seealso:: `nvmlGpuInstanceInfo_t` + .. seealso:: `nvmlProcessDetailList_v1_t` """ cdef: - nvmlGpuInstanceInfo_t *_ptr + nvmlProcessDetailList_v1_t *_ptr object _owner bint _owned bint _readonly + dict _refs def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlGpuInstanceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlProcessDetailList_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuInstanceInfo") + raise MemoryError("Error allocating ProcessDetailList_v1") self._owner = None self._owned = True self._readonly = False + self._refs = {} def __dealloc__(self): - cdef nvmlGpuInstanceInfo_t *ptr + cdef nvmlProcessDetailList_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.GpuInstanceInfo object at {hex(id(self))}>" + return f"<{__name__}.ProcessDetailList_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -20189,24 +20308,24 @@ cdef class GpuInstanceInfo: return (self._ptr) def __eq__(self, other): - cdef GpuInstanceInfo other_ - if not isinstance(other, GpuInstanceInfo): + cdef ProcessDetailList_v1 other_ + if not isinstance(other, ProcessDetailList_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessDetailList_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuInstanceInfo_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessDetailList_v1_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 = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuInstanceInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceInfo_t)) + raise MemoryError("Error allocating ProcessDetailList_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessDetailList_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20214,72 +20333,65 @@ cdef class GpuInstanceInfo: setattr(self, key, val) @property - def placement(self): - """GpuInstancePlacement: """ - return GpuInstancePlacement.from_ptr( - &(self._ptr[0].placement), - 1, - readonly=self._readonly, - owner=self, - ) - - @placement.setter - def placement(self, val): - if self._readonly: - raise ValueError("This GpuInstanceInfo instance is read-only") - cdef GpuInstancePlacement val_ = val - _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlGpuInstancePlacement_t) * 1) - - @property - def device_(self): - """int: """ - return (self._ptr[0].device) + def version(self): + """int: Struct version, MUST be nvmlProcessDetailList_v1.""" + return self._ptr[0].version - @device_.setter - def device_(self, val): + @version.setter + def version(self, val): if self._readonly: - raise ValueError("This GpuInstanceInfo instance is read-only") - self._ptr[0].device = val + raise ValueError("This ProcessDetailList_v1 instance is read-only") + self._ptr[0].version = val @property - def id(self): - """int: """ - return self._ptr[0].id + def mode(self): + """int: Process mode, One of `nvmlProcessMode_t`.""" + return self._ptr[0].mode - @id.setter - def id(self, val): + @mode.setter + def mode(self, val): if self._readonly: - raise ValueError("This GpuInstanceInfo instance is read-only") - self._ptr[0].id = val + raise ValueError("This ProcessDetailList_v1 instance is read-only") + self._ptr[0].mode = val @property - def profile_id(self): - """int: """ - return self._ptr[0].profileId + def proc_array(self): + """int: Process array.""" + if self._ptr[0].procArray == NULL or self._ptr[0].numProcArrayEntries == 0: + return [] + return ProcessDetail_v1.from_ptr( + (self._ptr[0].procArray), + self._ptr[0].numProcArrayEntries, + owner=self, + readonly=self._readonly + ) - @profile_id.setter - def profile_id(self, val): + @proc_array.setter + def proc_array(self, val): if self._readonly: - raise ValueError("This GpuInstanceInfo instance is read-only") - self._ptr[0].profileId = val + raise ValueError("This ProcessDetailList_v1 instance is read-only") + cdef ProcessDetail_v1 arr = val + self._ptr[0].procArray = (arr._get_ptr()) + self._ptr[0].numProcArrayEntries = len(arr) + self._refs["proc_array"] = arr @staticmethod def from_buffer(buffer): - """Create an GpuInstanceInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlGpuInstanceInfo_t), GpuInstanceInfo) + """Create an ProcessDetailList_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlProcessDetailList_v1_t), ProcessDetailList_v1) @staticmethod def from_data(data): - """Create an GpuInstanceInfo instance wrapping the given NumPy array. + """Create an ProcessDetailList_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `gpu_instance_info_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `process_detail_list_v1_dtype` holding the data. """ - return _cyb_from_data(data, "gpu_instance_info_dtype", gpu_instance_info_dtype, GpuInstanceInfo) + return _cyb_from_data(data, "process_detail_list_v1_dtype", process_detail_list_v1_dtype, ProcessDetailList_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an GpuInstanceInfo instance wrapping the given pointer. + """Create an ProcessDetailList_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -20288,68 +20400,66 @@ cdef class GpuInstanceInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GpuInstanceInfo obj = GpuInstanceInfo.__new__(GpuInstanceInfo) + cdef ProcessDetailList_v1 obj = ProcessDetailList_v1.__new__(ProcessDetailList_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating GpuInstanceInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceInfo_t)) + raise MemoryError("Error allocating ProcessDetailList_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessDetailList_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly + obj._refs = {} return obj -cdef _get_compute_instance_info_dtype_offsets(): - cdef nvmlComputeInstanceInfo_t pod +cdef _get_bridge_chip_hierarchy_dtype_offsets(): + cdef nvmlBridgeChipHierarchy_t pod return _numpy.dtype({ - 'names': ['device_', 'gpu_instance', 'id', 'profile_id', 'placement'], - 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, compute_instance_placement_dtype], + 'names': ['bridge_count', 'bridge_chip_info'], + 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.gpuInstance)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), + (&(pod.bridgeCount)) - (&pod), + (&(pod.bridgeChipInfo)) - (&pod), ], - 'itemsize': sizeof(nvmlComputeInstanceInfo_t), + 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), }) -compute_instance_info_dtype = _get_compute_instance_info_dtype_offsets() +bridge_chip_hierarchy_dtype = _get_bridge_chip_hierarchy_dtype_offsets() -cdef class ComputeInstanceInfo: - """Empty-initialize an instance of `nvmlComputeInstanceInfo_t`. +cdef class BridgeChipHierarchy: + """Empty-initialize an instance of `nvmlBridgeChipHierarchy_t`. - .. seealso:: `nvmlComputeInstanceInfo_t` + .. seealso:: `nvmlBridgeChipHierarchy_t` """ cdef: - nvmlComputeInstanceInfo_t *_ptr + nvmlBridgeChipHierarchy_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ComputeInstanceInfo") + raise MemoryError("Error allocating BridgeChipHierarchy") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlComputeInstanceInfo_t *ptr + cdef nvmlBridgeChipHierarchy_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.ComputeInstanceInfo object at {hex(id(self))}>" + return f"<{__name__}.BridgeChipHierarchy object at {hex(id(self))}>" @property def ptr(self): @@ -20363,24 +20473,24 @@ cdef class ComputeInstanceInfo: return (self._ptr) def __eq__(self, other): - cdef ComputeInstanceInfo other_ - if not isinstance(other, ComputeInstanceInfo): + cdef BridgeChipHierarchy other_ + if not isinstance(other, BridgeChipHierarchy): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBridgeChipHierarchy_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceInfo_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlBridgeChipHierarchy_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 = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ComputeInstanceInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceInfo_t)) + raise MemoryError("Error allocating BridgeChipHierarchy") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBridgeChipHierarchy_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20388,83 +20498,44 @@ cdef class ComputeInstanceInfo: setattr(self, key, val) @property - def placement(self): - """ComputeInstancePlacement: """ - return ComputeInstancePlacement.from_ptr( - &(self._ptr[0].placement), - 1, + def bridge_chip_info(self): + """BridgeChipInfo: """ + return BridgeChipInfo.from_ptr( + &(self._ptr[0].bridgeChipInfo), + self._ptr[0].bridgeCount, readonly=self._readonly, owner=self, ) - @placement.setter - def placement(self, val): - if self._readonly: - raise ValueError("This ComputeInstanceInfo instance is read-only") - cdef ComputeInstancePlacement val_ = val - _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlComputeInstancePlacement_t) * 1) - - @property - def device_(self): - """int: """ - return (self._ptr[0].device) - - @device_.setter - def device_(self, val): - if self._readonly: - raise ValueError("This ComputeInstanceInfo instance is read-only") - self._ptr[0].device = val - - @property - def gpu_instance(self): - """int: """ - return (self._ptr[0].gpuInstance) - - @gpu_instance.setter - def gpu_instance(self, val): - if self._readonly: - raise ValueError("This ComputeInstanceInfo instance is read-only") - self._ptr[0].gpuInstance = val - - @property - def id(self): - """int: """ - return self._ptr[0].id - - @id.setter - def id(self, val): - if self._readonly: - raise ValueError("This ComputeInstanceInfo instance is read-only") - self._ptr[0].id = val - - @property - def profile_id(self): - """int: """ - return self._ptr[0].profileId - - @profile_id.setter - def profile_id(self, val): + @bridge_chip_info.setter + def bridge_chip_info(self, val): if self._readonly: - raise ValueError("This ComputeInstanceInfo instance is read-only") - self._ptr[0].profileId = val + raise ValueError("This BridgeChipHierarchy instance is read-only") + cdef BridgeChipInfo val_ = val + if len(val) > 128: + raise ValueError(f"Expected length < 128 for field bridge_chip_info, got {len(val)}") + self._ptr[0].bridgeCount = len(val) + if len(val) == 0: + return + _cyb_memcpy(&(self._ptr[0].bridgeChipInfo), (val_._get_ptr()), sizeof(nvmlBridgeChipInfo_t) * self._ptr[0].bridgeCount) @staticmethod def from_buffer(buffer): - """Create an ComputeInstanceInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceInfo_t), ComputeInstanceInfo) + """Create an BridgeChipHierarchy instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlBridgeChipHierarchy_t), BridgeChipHierarchy) @staticmethod def from_data(data): - """Create an ComputeInstanceInfo instance wrapping the given NumPy array. + """Create an BridgeChipHierarchy instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `compute_instance_info_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `bridge_chip_hierarchy_dtype` holding the data. """ - return _cyb_from_data(data, "compute_instance_info_dtype", compute_instance_info_dtype, ComputeInstanceInfo) + return _cyb_from_data(data, "bridge_chip_hierarchy_dtype", bridge_chip_hierarchy_dtype, BridgeChipHierarchy) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an ComputeInstanceInfo instance wrapping the given pointer. + """Create an BridgeChipHierarchy instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -20473,222 +20544,5638 @@ cdef class ComputeInstanceInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef ComputeInstanceInfo obj = ComputeInstanceInfo.__new__(ComputeInstanceInfo) + cdef BridgeChipHierarchy obj = BridgeChipHierarchy.__new__(BridgeChipHierarchy) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ComputeInstanceInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceInfo_t)) + raise MemoryError("Error allocating BridgeChipHierarchy") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBridgeChipHierarchy_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod +cdef _get_sample_dtype_offsets(): + cdef nvmlSample_t pod return _numpy.dtype({ - 'names': ['version', 'entry_count', 'entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'names': ['time_stamp', 'sample_value'], + 'formats': [_numpy.uint64, value_dtype], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.entryCount)) - (&pod), - (&(pod.entries)) - (&pod), + (&(pod.timeStamp)) - (&pod), + (&(pod.sampleValue)) - (&pod), ], - 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), + 'itemsize': sizeof(nvmlSample_t), }) -ecc_sram_unique_uncorrected_error_counts_v1_dtype = _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets() +sample_dtype = _get_sample_dtype_offsets() -cdef class EccSramUniqueUncorrectedErrorCounts_v1: - """Empty-initialize an instance of `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t`. +cdef class Sample: + """Empty-initialize an array of `nvmlSample_t`. + The resulting object is of length `size` and of dtype `sample_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t` + .. seealso:: `nvmlSample_t` """ cdef: - nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - dict _refs - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") - self._owner = None - self._owned = True - self._readonly = False - self._refs = {} - def __dealloc__(self): - cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlSample_t) }" def __repr__(self): - return f"<{__name__}.EccSramUniqueUncorrectedErrorCounts_v1 object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.Sample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.Sample object at {hex(id(self))}>" @property def ptr(self): """Get the pointer address to the data as Python :class:`int`.""" - return (self._ptr) + return self._data.ctypes.data cdef intptr_t _get_ptr(self): - return (self._ptr) + return self._data.ctypes.data def __int__(self): - return (self._ptr) + 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 EccSramUniqueUncorrectedErrorCounts_v1 other_ - if not isinstance(other, EccSramUniqueUncorrectedErrorCounts_v1): + cdef object self_data = self._data + if (not isinstance(other, Sample)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) == 0) + return bool((self_data == other._data).all()) - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), self._readonly) + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - pass - - def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + _cyb_cpython.PyBuffer_Release(buffer) @property - def version(self): - """int: the API version number""" - return self._ptr[0].version + def time_stamp(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This EccSramUniqueUncorrectedErrorCounts_v1 instance is read-only") - self._ptr[0].version = val + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val @property - def entries(self): - """int: pointer to caller-supplied buffer to return the SRAM unique uncorrected ECC error count entries""" - if self._ptr[0].entries == NULL or self._ptr[0].entryCount == 0: - return [] - return EccSramUniqueUncorrectedErrorEntry_v1.from_ptr( - (self._ptr[0].entries), - self._ptr[0].entryCount, - owner=self, - readonly=self._readonly - ) + def sample_value(self): + """value_dtype: """ + return self._data.sample_value - @entries.setter - def entries(self, val): - if self._readonly: - raise ValueError("This EccSramUniqueUncorrectedErrorCounts_v1 instance is read-only") - cdef EccSramUniqueUncorrectedErrorEntry_v1 arr = val - self._ptr[0].entries = (arr._get_ptr()) - self._ptr[0].entryCount = len(arr) - self._refs["entries"] = arr + @sample_value.setter + def sample_value(self, val): + self._data.sample_value = 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 Sample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == sample_dtype: + return Sample.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), EccSramUniqueUncorrectedErrorCounts_v1) + """Create an Sample instance with the memory from the given buffer.""" + return Sample.from_data(_numpy.frombuffer(buffer, dtype=sample_dtype)) @staticmethod def from_data(data): - """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance wrapping the given NumPy array. + """Create an Sample instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `ecc_sram_unique_uncorrected_error_counts_v1_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `sample_dtype` holding the data. """ - return _cyb_from_data(data, "ecc_sram_unique_uncorrected_error_counts_v1_dtype", ecc_sram_unique_uncorrected_error_counts_v1_dtype, EccSramUniqueUncorrectedErrorCounts_v1) + cdef Sample obj = Sample.__new__(Sample) + 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 != sample_dtype: + raise ValueError("data array must be of dtype sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an Sample 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. + size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef EccSramUniqueUncorrectedErrorCounts_v1 obj = EccSramUniqueUncorrectedErrorCounts_v1.__new__(EccSramUniqueUncorrectedErrorCounts_v1) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly - obj._refs = {} + cdef Sample obj = Sample.__new__(Sample) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlSample_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=sample_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj -cdef _get_nvlink_firmware_info_dtype_offsets(): - cdef nvmlNvlinkFirmwareInfo_t pod +cdef _get_vgpu_instance_utilization_sample_dtype_offsets(): + cdef nvmlVgpuInstanceUtilizationSample_t pod return _numpy.dtype({ - 'names': ['firmware_version', 'num_valid_entries'], - 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], + 'names': ['vgpu_instance', 'time_stamp', 'sm_util', 'mem_util', 'enc_util', 'dec_util'], + 'formats': [_numpy.uint32, _numpy.uint64, value_dtype, value_dtype, value_dtype, value_dtype], 'offsets': [ - (&(pod.firmwareVersion)) - (&pod), - (&(pod.numValidEntries)) - (&pod), + (&(pod.vgpuInstance)) - (&pod), + (&(pod.timeStamp)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), ], - 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), }) -nvlink_firmware_info_dtype = _get_nvlink_firmware_info_dtype_offsets() +vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_dtype_offsets() -cdef class NvlinkFirmwareInfo: - """Empty-initialize an instance of `nvmlNvlinkFirmwareInfo_t`. +cdef class VgpuInstanceUtilizationSample: + """Empty-initialize an array of `nvmlVgpuInstanceUtilizationSample_t`. + The resulting object is of length `size` and of dtype `vgpu_instance_utilization_sample_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlNvlinkFirmwareInfo_t` + .. seealso:: `nvmlVgpuInstanceUtilizationSample_t` """ cdef: - nvmlNvlinkFirmwareInfo_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_instance_utilization_sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuInstanceUtilizationSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuInstanceUtilizationSample_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuInstanceUtilizationSample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuInstanceUtilizationSample 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, VgpuInstanceUtilizationSample)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def vgpu_instance(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.vgpu_instance[0]) + return self._data.vgpu_instance + + @vgpu_instance.setter + def vgpu_instance(self, val): + self._data.vgpu_instance = val + + @property + def time_stamp(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def sm_util(self): + """value_dtype: """ + return self._data.sm_util + + @sm_util.setter + def sm_util(self, val): + self._data.sm_util = val + + @property + def mem_util(self): + """value_dtype: """ + return self._data.mem_util + + @mem_util.setter + def mem_util(self, val): + self._data.mem_util = val + + @property + def enc_util(self): + """value_dtype: """ + return self._data.enc_util + + @enc_util.setter + def enc_util(self, val): + self._data.enc_util = val + + @property + def dec_util(self): + """value_dtype: """ + return self._data.dec_util + + @dec_util.setter + def dec_util(self, val): + self._data.dec_util = 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 VgpuInstanceUtilizationSample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_instance_utilization_sample_dtype: + return VgpuInstanceUtilizationSample.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuInstanceUtilizationSample instance with the memory from the given buffer.""" + return VgpuInstanceUtilizationSample.from_data(_numpy.frombuffer(buffer, dtype=vgpu_instance_utilization_sample_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuInstanceUtilizationSample instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_instance_utilization_sample_dtype` holding the data. + """ + cdef VgpuInstanceUtilizationSample obj = VgpuInstanceUtilizationSample.__new__(VgpuInstanceUtilizationSample) + 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_instance_utilization_sample_dtype: + raise ValueError("data array must be of dtype vgpu_instance_utilization_sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an VgpuInstanceUtilizationSample 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuInstanceUtilizationSample obj = VgpuInstanceUtilizationSample.__new__(VgpuInstanceUtilizationSample) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlVgpuInstanceUtilizationSample_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_instance_utilization_sample_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_vgpu_instance_utilization_info_v1_dtype_offsets(): + cdef nvmlVgpuInstanceUtilizationInfo_v1_t pod + return _numpy.dtype({ + 'names': ['time_stamp', 'vgpu_instance', 'sm_util', 'mem_util', 'enc_util', 'dec_util', 'jpg_util', 'ofa_util'], + 'formats': [_numpy.uint64, _numpy.uint32, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype, value_dtype], + 'offsets': [ + (&(pod.timeStamp)) - (&pod), + (&(pod.vgpuInstance)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), + (&(pod.jpgUtil)) - (&pod), + (&(pod.ofaUtil)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), + }) + +vgpu_instance_utilization_info_v1_dtype = _get_vgpu_instance_utilization_info_v1_dtype_offsets() + +cdef class VgpuInstanceUtilizationInfo_v1: + """Empty-initialize an array of `nvmlVgpuInstanceUtilizationInfo_v1_t`. + The resulting object is of length `size` and of dtype `vgpu_instance_utilization_info_v1_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlVgpuInstanceUtilizationInfo_v1_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=vgpu_instance_utilization_info_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.VgpuInstanceUtilizationInfo_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.VgpuInstanceUtilizationInfo_v1 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, VgpuInstanceUtilizationInfo_v1)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def time_stamp(self): + """Union[~_numpy.uint64, int]: CPU Timestamp in microseconds.""" + if self._data.size == 1: + return int(self._data.time_stamp[0]) + return self._data.time_stamp + + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = val + + @property + def vgpu_instance(self): + """Union[~_numpy.uint32, int]: vGPU Instance""" + if self._data.size == 1: + return int(self._data.vgpu_instance[0]) + return self._data.vgpu_instance + + @vgpu_instance.setter + def vgpu_instance(self, val): + self._data.vgpu_instance = val + + @property + def sm_util(self): + """value_dtype: SM (3D/Compute) Util Value.""" + return self._data.sm_util + + @sm_util.setter + def sm_util(self, val): + self._data.sm_util = val + + @property + def mem_util(self): + """value_dtype: Frame Buffer Memory Util Value.""" + return self._data.mem_util + + @mem_util.setter + def mem_util(self, val): + self._data.mem_util = val + + @property + def enc_util(self): + """value_dtype: Encoder Util Value.""" + return self._data.enc_util + + @enc_util.setter + def enc_util(self, val): + self._data.enc_util = val + + @property + def dec_util(self): + """value_dtype: Decoder Util Value.""" + return self._data.dec_util + + @dec_util.setter + def dec_util(self, val): + self._data.dec_util = val + + @property + def jpg_util(self): + """value_dtype: Jpeg Util Value.""" + return self._data.jpg_util + + @jpg_util.setter + def jpg_util(self, val): + self._data.jpg_util = val + + @property + def ofa_util(self): + """value_dtype: Ofa Util Value.""" + return self._data.ofa_util + + @ofa_util.setter + def ofa_util(self, val): + self._data.ofa_util = 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 VgpuInstanceUtilizationInfo_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == vgpu_instance_utilization_info_v1_dtype: + return VgpuInstanceUtilizationInfo_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuInstanceUtilizationInfo_v1 instance with the memory from the given buffer.""" + return VgpuInstanceUtilizationInfo_v1.from_data(_numpy.frombuffer(buffer, dtype=vgpu_instance_utilization_info_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an VgpuInstanceUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `vgpu_instance_utilization_info_v1_dtype` holding the data. + """ + cdef VgpuInstanceUtilizationInfo_v1 obj = VgpuInstanceUtilizationInfo_v1.__new__(VgpuInstanceUtilizationInfo_v1) + 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_instance_utilization_info_v1_dtype: + raise ValueError("data array must be of dtype vgpu_instance_utilization_info_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an VgpuInstanceUtilizationInfo_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef VgpuInstanceUtilizationInfo_v1 obj = VgpuInstanceUtilizationInfo_v1.__new__(VgpuInstanceUtilizationInfo_v1) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_instance_utilization_info_v1_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_field_value_dtype_offsets(): + cdef nvmlFieldValue_t pod + return _numpy.dtype({ + 'names': ['field_id', 'scope_id', 'timestamp', 'latency_usec', 'value_type', 'nvml_return', 'value'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.int64, _numpy.int64, _numpy.int32, _numpy.int32, value_dtype], + 'offsets': [ + (&(pod.fieldId)) - (&pod), + (&(pod.scopeId)) - (&pod), + (&(pod.timestamp)) - (&pod), + (&(pod.latencyUsec)) - (&pod), + (&(pod.valueType)) - (&pod), + (&(pod.nvmlReturn)) - (&pod), + (&(pod.value)) - (&pod), + ], + 'itemsize': sizeof(nvmlFieldValue_t), + }) + +field_value_dtype = _get_field_value_dtype_offsets() + +cdef class FieldValue: + """Empty-initialize an array of `nvmlFieldValue_t`. + The resulting object is of length `size` and of dtype `field_value_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlFieldValue_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=field_value_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlFieldValue_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlFieldValue_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.FieldValue_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.FieldValue 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, FieldValue)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def field_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.field_id[0]) + return self._data.field_id + + @field_id.setter + def field_id(self, val): + self._data.field_id = val + + @property + def scope_id(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.scope_id[0]) + return self._data.scope_id + + @scope_id.setter + def scope_id(self, val): + self._data.scope_id = val + + @property + def timestamp(self): + """Union[~_numpy.int64, int]: """ + 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 latency_usec(self): + """Union[~_numpy.int64, int]: """ + if self._data.size == 1: + return int(self._data.latency_usec[0]) + return self._data.latency_usec + + @latency_usec.setter + def latency_usec(self, val): + self._data.latency_usec = val + + @property + def value_type(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.value_type[0]) + return self._data.value_type + + @value_type.setter + def value_type(self, val): + self._data.value_type = val + + @property + def nvml_return(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.nvml_return[0]) + return self._data.nvml_return + + @nvml_return.setter + def nvml_return(self, val): + self._data.nvml_return = val + + @property + def value(self): + """value_dtype: """ + return self._data.value + + @value.setter + def value(self, val): + self._data.value = 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 FieldValue.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == field_value_dtype: + return FieldValue.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an FieldValue instance with the memory from the given buffer.""" + return FieldValue.from_data(_numpy.frombuffer(buffer, dtype=field_value_dtype)) + + @staticmethod + def from_data(data): + """Create an FieldValue instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `field_value_dtype` holding the data. + """ + cdef FieldValue obj = FieldValue.__new__(FieldValue) + 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 != field_value_dtype: + raise ValueError("data array must be of dtype field_value_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an FieldValue 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef FieldValue obj = FieldValue.__new__(FieldValue) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlFieldValue_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=field_value_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_prm_counter_value_v1_dtype_offsets(): + cdef nvmlPRMCounterValue_v1_t pod + return _numpy.dtype({ + 'names': ['status', 'output_type', 'output_value'], + 'formats': [_numpy.int32, _numpy.int32, value_dtype], + 'offsets': [ + (&(pod.status)) - (&pod), + (&(pod.outputType)) - (&pod), + (&(pod.outputValue)) - (&pod), + ], + 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), + }) + +prm_counter_value_v1_dtype = _get_prm_counter_value_v1_dtype_offsets() + +cdef class PRMCounterValue_v1: + """Empty-initialize an instance of `nvmlPRMCounterValue_v1_t`. + + + .. seealso:: `nvmlPRMCounterValue_v1_t` + """ + cdef: + nvmlPRMCounterValue_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlPRMCounterValue_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PRMCounterValue_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlPRMCounterValue_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.PRMCounterValue_v1 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 PRMCounterValue_v1 other_ + if not isinstance(other, PRMCounterValue_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPRMCounterValue_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPRMCounterValue_v1_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 = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating PRMCounterValue_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPRMCounterValue_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def output_value(self): + """Value: Output value.""" + return Value.from_ptr( + &(self._ptr[0].outputValue), + readonly=self._readonly, + owner=self, + ) + + @output_value.setter + def output_value(self, val): + if self._readonly: + raise ValueError("This PRMCounterValue_v1 instance is read-only") + cdef Value val_ = val + _cyb_memcpy(&(self._ptr[0].outputValue), (val_._get_ptr()), sizeof(nvmlValue_t) * 1) + + @property + def status(self): + """int: Status of the PRM counter read.""" + return (self._ptr[0].status) + + @status.setter + def status(self, val): + if self._readonly: + raise ValueError("This PRMCounterValue_v1 instance is read-only") + self._ptr[0].status = val + + @property + def output_type(self): + """int: Output value type.""" + return (self._ptr[0].outputType) + + @output_type.setter + def output_type(self, val): + if self._readonly: + raise ValueError("This PRMCounterValue_v1 instance is read-only") + self._ptr[0].outputType = val + + @staticmethod + def from_buffer(buffer): + """Create an PRMCounterValue_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlPRMCounterValue_v1_t), PRMCounterValue_v1) + + @staticmethod + def from_data(data): + """Create an PRMCounterValue_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `prm_counter_value_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "prm_counter_value_v1_dtype", prm_counter_value_v1_dtype, PRMCounterValue_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an PRMCounterValue_v1 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 PRMCounterValue_v1 obj = PRMCounterValue_v1.__new__(PRMCounterValue_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlPRMCounterValue_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating PRMCounterValue_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPRMCounterValue_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_gpu_thermal_settings_dtype_offsets(): + cdef nvmlGpuThermalSettings_t pod + return _numpy.dtype({ + 'names': ['count', 'sensor'], + 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], + 'offsets': [ + (&(pod.count)) - (&pod), + (&(pod.sensor)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuThermalSettings_t), + }) + +gpu_thermal_settings_dtype = _get_gpu_thermal_settings_dtype_offsets() + +cdef class GpuThermalSettings: + """Empty-initialize an instance of `nvmlGpuThermalSettings_t`. + + + .. seealso:: `nvmlGpuThermalSettings_t` + """ + cdef: + nvmlGpuThermalSettings_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuThermalSettings_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuThermalSettings") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuThermalSettings_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuThermalSettings 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 GpuThermalSettings other_ + if not isinstance(other, GpuThermalSettings): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuThermalSettings_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuThermalSettings_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 = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuThermalSettings") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuThermalSettings_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def sensor(self): + """_py_anon_pod0: """ + return _py_anon_pod0.from_ptr( + &(self._ptr[0].sensor), + 3, + readonly=self._readonly, + owner=self, + ) + + @sensor.setter + def sensor(self, val): + if self._readonly: + raise ValueError("This GpuThermalSettings instance is read-only") + cdef _py_anon_pod0 val_ = val + if len(val) != 3: + raise ValueError(f"Expected length { 3 } for field sensor, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].sensor), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod0) * 3) + + @property + def count(self): + """int: """ + return self._ptr[0].count + + @count.setter + def count(self, val): + if self._readonly: + raise ValueError("This GpuThermalSettings instance is read-only") + self._ptr[0].count = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuThermalSettings instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuThermalSettings_t), GpuThermalSettings) + + @staticmethod + def from_data(data): + """Create an GpuThermalSettings instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_thermal_settings_dtype` holding the data. + """ + return _cyb_from_data(data, "gpu_thermal_settings_dtype", gpu_thermal_settings_dtype, GpuThermalSettings) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GpuThermalSettings 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 GpuThermalSettings obj = GpuThermalSettings.__new__(GpuThermalSettings) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuThermalSettings_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuThermalSettings") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuThermalSettings_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_clk_mon_status_dtype_offsets(): + cdef nvmlClkMonStatus_t pod + return _numpy.dtype({ + 'names': ['b_global_status', 'clk_mon_list_size', 'clk_mon_list'], + 'formats': [_numpy.uint32, _numpy.uint32, (clk_mon_fault_info_dtype, 32)], + 'offsets': [ + (&(pod.bGlobalStatus)) - (&pod), + (&(pod.clkMonListSize)) - (&pod), + (&(pod.clkMonList)) - (&pod), + ], + 'itemsize': sizeof(nvmlClkMonStatus_t), + }) + +clk_mon_status_dtype = _get_clk_mon_status_dtype_offsets() + +cdef class ClkMonStatus: + """Empty-initialize an instance of `nvmlClkMonStatus_t`. + + + .. seealso:: `nvmlClkMonStatus_t` + """ + cdef: + nvmlClkMonStatus_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlClkMonStatus_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ClkMonStatus") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlClkMonStatus_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ClkMonStatus 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 ClkMonStatus other_ + if not isinstance(other, ClkMonStatus): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlClkMonStatus_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlClkMonStatus_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 = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ClkMonStatus") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlClkMonStatus_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def clk_mon_list(self): + """ClkMonFaultInfo: """ + return ClkMonFaultInfo.from_ptr( + &(self._ptr[0].clkMonList), + self._ptr[0].clkMonListSize, + readonly=self._readonly, + owner=self, + ) + + @clk_mon_list.setter + def clk_mon_list(self, val): + if self._readonly: + raise ValueError("This ClkMonStatus instance is read-only") + cdef ClkMonFaultInfo val_ = val + if len(val) > 32: + raise ValueError(f"Expected length < 32 for field clk_mon_list, got {len(val)}") + self._ptr[0].clkMonListSize = len(val) + if len(val) == 0: + return + _cyb_memcpy(&(self._ptr[0].clkMonList), (val_._get_ptr()), sizeof(nvmlClkMonFaultInfo_t) * self._ptr[0].clkMonListSize) + + @property + def b_global_status(self): + """int: """ + return self._ptr[0].bGlobalStatus + + @b_global_status.setter + def b_global_status(self, val): + if self._readonly: + raise ValueError("This ClkMonStatus instance is read-only") + self._ptr[0].bGlobalStatus = val + + @staticmethod + def from_buffer(buffer): + """Create an ClkMonStatus instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlClkMonStatus_t), ClkMonStatus) + + @staticmethod + def from_data(data): + """Create an ClkMonStatus instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `clk_mon_status_dtype` holding the data. + """ + return _cyb_from_data(data, "clk_mon_status_dtype", clk_mon_status_dtype, ClkMonStatus) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an ClkMonStatus 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 ClkMonStatus obj = ClkMonStatus.__new__(ClkMonStatus) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlClkMonStatus_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ClkMonStatus") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlClkMonStatus_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_processes_utilization_info_v1_dtype_offsets(): + cdef nvmlProcessesUtilizationInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'process_samples_count', 'last_seen_time_stamp', 'proc_util_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.processSamplesCount)) - (&pod), + (&(pod.lastSeenTimeStamp)) - (&pod), + (&(pod.procUtilArray)) - (&pod), + ], + 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), + }) + +processes_utilization_info_v1_dtype = _get_processes_utilization_info_v1_dtype_offsets() + +cdef class ProcessesUtilizationInfo_v1: + """Empty-initialize an instance of `nvmlProcessesUtilizationInfo_v1_t`. + + + .. seealso:: `nvmlProcessesUtilizationInfo_v1_t` + """ + cdef: + nvmlProcessesUtilizationInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlProcessesUtilizationInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ProcessesUtilizationInfo_v1 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 ProcessesUtilizationInfo_v1 other_ + if not isinstance(other, ProcessesUtilizationInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessesUtilizationInfo_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlProcessesUtilizationInfo_v1_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 = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def last_seen_time_stamp(self): + """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" + return self._ptr[0].lastSeenTimeStamp + + @last_seen_time_stamp.setter + def last_seen_time_stamp(self, val): + if self._readonly: + raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].lastSeenTimeStamp = val + + @property + def proc_util_array(self): + """int: The array (allocated by caller) of the utilization of GPU SM, framebuffer, video encoder, video decoder, JPEG, and OFA.""" + if self._ptr[0].procUtilArray == NULL or self._ptr[0].processSamplesCount == 0: + return [] + return ProcessUtilizationInfo_v1.from_ptr( + (self._ptr[0].procUtilArray), + self._ptr[0].processSamplesCount, + owner=self, + readonly=self._readonly + ) + + @proc_util_array.setter + def proc_util_array(self, val): + if self._readonly: + raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") + cdef ProcessUtilizationInfo_v1 arr = val + self._ptr[0].procUtilArray = (arr._get_ptr()) + self._ptr[0].processSamplesCount = len(arr) + self._refs["proc_util_array"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an ProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlProcessesUtilizationInfo_v1_t), ProcessesUtilizationInfo_v1) + + @staticmethod + def from_data(data): + """Create an ProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `processes_utilization_info_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "processes_utilization_info_v1_dtype", processes_utilization_info_v1_dtype, ProcessesUtilizationInfo_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an ProcessesUtilizationInfo_v1 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 ProcessesUtilizationInfo_v1 obj = ProcessesUtilizationInfo_v1.__new__(ProcessesUtilizationInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlProcessesUtilizationInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ProcessesUtilizationInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessesUtilizationInfo_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +cdef _get_gpu_dynamic_pstates_info_dtype_offsets(): + cdef nvmlGpuDynamicPstatesInfo_t pod + return _numpy.dtype({ + 'names': ['flags_', 'utilization'], + 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], + 'offsets': [ + (&(pod.flags)) - (&pod), + (&(pod.utilization)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), + }) + +gpu_dynamic_pstates_info_dtype = _get_gpu_dynamic_pstates_info_dtype_offsets() + +cdef class GpuDynamicPstatesInfo: + """Empty-initialize an instance of `nvmlGpuDynamicPstatesInfo_t`. + + + .. seealso:: `nvmlGpuDynamicPstatesInfo_t` + """ + cdef: + nvmlGpuDynamicPstatesInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuDynamicPstatesInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuDynamicPstatesInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuDynamicPstatesInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuDynamicPstatesInfo 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 GpuDynamicPstatesInfo other_ + if not isinstance(other, GpuDynamicPstatesInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuDynamicPstatesInfo_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuDynamicPstatesInfo_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 = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuDynamicPstatesInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuDynamicPstatesInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def utilization(self): + """_py_anon_pod1: """ + return _py_anon_pod1.from_ptr( + &(self._ptr[0].utilization), + 8, + readonly=self._readonly, + owner=self, + ) + + @utilization.setter + def utilization(self, val): + if self._readonly: + raise ValueError("This GpuDynamicPstatesInfo instance is read-only") + cdef _py_anon_pod1 val_ = val + if len(val) != 8: + raise ValueError(f"Expected length { 8 } for field utilization, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].utilization), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod1) * 8) + + @property + def flags_(self): + """int: """ + return self._ptr[0].flags + + @flags_.setter + def flags_(self, val): + if self._readonly: + raise ValueError("This GpuDynamicPstatesInfo instance is read-only") + self._ptr[0].flags = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuDynamicPstatesInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuDynamicPstatesInfo_t), GpuDynamicPstatesInfo) + + @staticmethod + def from_data(data): + """Create an GpuDynamicPstatesInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_dynamic_pstates_info_dtype` holding the data. + """ + return _cyb_from_data(data, "gpu_dynamic_pstates_info_dtype", gpu_dynamic_pstates_info_dtype, GpuDynamicPstatesInfo) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GpuDynamicPstatesInfo 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 GpuDynamicPstatesInfo obj = GpuDynamicPstatesInfo.__new__(GpuDynamicPstatesInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuDynamicPstatesInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuDynamicPstatesInfo_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_processes_utilization_info_v1_dtype_offsets(): + cdef nvmlVgpuProcessesUtilizationInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'vgpu_process_count', 'last_seen_time_stamp', 'vgpu_proc_util_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.vgpuProcessCount)) - (&pod), + (&(pod.lastSeenTimeStamp)) - (&pod), + (&(pod.vgpuProcUtilArray)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), + }) + +vgpu_processes_utilization_info_v1_dtype = _get_vgpu_processes_utilization_info_v1_dtype_offsets() + +cdef class VgpuProcessesUtilizationInfo_v1: + """Empty-initialize an instance of `nvmlVgpuProcessesUtilizationInfo_v1_t`. + + + .. seealso:: `nvmlVgpuProcessesUtilizationInfo_v1_t` + """ + cdef: + nvmlVgpuProcessesUtilizationInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlVgpuProcessesUtilizationInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuProcessesUtilizationInfo_v1 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 VgpuProcessesUtilizationInfo_v1 other_ + if not isinstance(other, VgpuProcessesUtilizationInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_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 = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def last_seen_time_stamp(self): + """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" + return self._ptr[0].lastSeenTimeStamp + + @last_seen_time_stamp.setter + def last_seen_time_stamp(self, val): + if self._readonly: + raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") + self._ptr[0].lastSeenTimeStamp = val + + @property + def vgpu_proc_util_array(self): + """int: The array (allocated by caller) in which utilization of processes running on vGPU instances are returned.""" + if self._ptr[0].vgpuProcUtilArray == NULL or self._ptr[0].vgpuProcessCount == 0: + return [] + return VgpuProcessUtilizationInfo_v1.from_ptr( + (self._ptr[0].vgpuProcUtilArray), + self._ptr[0].vgpuProcessCount, + owner=self, + readonly=self._readonly + ) + + @vgpu_proc_util_array.setter + def vgpu_proc_util_array(self, val): + if self._readonly: + raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") + cdef VgpuProcessUtilizationInfo_v1 arr = val + self._ptr[0].vgpuProcUtilArray = (arr._get_ptr()) + self._ptr[0].vgpuProcessCount = len(arr) + self._refs["vgpu_proc_util_array"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an VgpuProcessesUtilizationInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), VgpuProcessesUtilizationInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_processes_utilization_info_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_processes_utilization_info_v1_dtype", vgpu_processes_utilization_info_v1_dtype, VgpuProcessesUtilizationInfo_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuProcessesUtilizationInfo_v1 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 VgpuProcessesUtilizationInfo_v1 obj = VgpuProcessesUtilizationInfo_v1.__new__(VgpuProcessesUtilizationInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +cdef _get_vgpu_scheduler_params_dtype_offsets(): + cdef nvmlVgpuSchedulerParams_t pod + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod2_dtype, _py_anon_pod3_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (&pod), + (&(pod.vgpuSchedData)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerParams_t), + }) + +vgpu_scheduler_params_dtype = _get_vgpu_scheduler_params_dtype_offsets() + +cdef class VgpuSchedulerParams: + """Empty-initialize an instance of `nvmlVgpuSchedulerParams_t`. + + + .. seealso:: `nvmlVgpuSchedulerParams_t` + """ + cdef: + nvmlVgpuSchedulerParams_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerParams") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerParams_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerParams 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 VgpuSchedulerParams other_ + if not isinstance(other, VgpuSchedulerParams): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerParams_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerParams_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerParams") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerParams_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def vgpu_sched_data_with_arr(self): + """_py_anon_pod2: """ + return _py_anon_pod2.from_ptr( + &(self._ptr[0].vgpuSchedDataWithARR), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data_with_arr.setter + def vgpu_sched_data_with_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerParams instance is read-only") + cdef _py_anon_pod2 val_ = val + _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod2) * 1) + + @property + def vgpu_sched_data(self): + """_py_anon_pod3: """ + return _py_anon_pod3.from_ptr( + &(self._ptr[0].vgpuSchedData), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data.setter + def vgpu_sched_data(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerParams instance is read-only") + cdef _py_anon_pod3 val_ = val + _cyb_memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod3) * 1) + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerParams instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerParams_t), VgpuSchedulerParams) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerParams instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_params_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_scheduler_params_dtype", vgpu_scheduler_params_dtype, VgpuSchedulerParams) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerParams 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 VgpuSchedulerParams obj = VgpuSchedulerParams.__new__(VgpuSchedulerParams) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerParams") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerParams_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_set_params_dtype_offsets(): + cdef nvmlVgpuSchedulerSetParams_t pod + return _numpy.dtype({ + 'names': ['vgpu_sched_data_with_arr', 'vgpu_sched_data'], + 'formats': [_py_anon_pod4_dtype, _py_anon_pod5_dtype], + 'offsets': [ + (&(pod.vgpuSchedDataWithARR)) - (&pod), + (&(pod.vgpuSchedData)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerSetParams_t), + }) + +vgpu_scheduler_set_params_dtype = _get_vgpu_scheduler_set_params_dtype_offsets() + +cdef class VgpuSchedulerSetParams: + """Empty-initialize an instance of `nvmlVgpuSchedulerSetParams_t`. + + + .. seealso:: `nvmlVgpuSchedulerSetParams_t` + """ + cdef: + nvmlVgpuSchedulerSetParams_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerSetParams") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerSetParams_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerSetParams 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 VgpuSchedulerSetParams other_ + if not isinstance(other, VgpuSchedulerSetParams): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerSetParams_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerSetParams_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerSetParams") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerSetParams_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def vgpu_sched_data_with_arr(self): + """_py_anon_pod4: """ + return _py_anon_pod4.from_ptr( + &(self._ptr[0].vgpuSchedDataWithARR), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data_with_arr.setter + def vgpu_sched_data_with_arr(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerSetParams instance is read-only") + cdef _py_anon_pod4 val_ = val + _cyb_memcpy(&(self._ptr[0].vgpuSchedDataWithARR), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod4) * 1) + + @property + def vgpu_sched_data(self): + """_py_anon_pod5: """ + return _py_anon_pod5.from_ptr( + &(self._ptr[0].vgpuSchedData), + readonly=self._readonly, + owner=self, + ) + + @vgpu_sched_data.setter + def vgpu_sched_data(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerSetParams instance is read-only") + cdef _py_anon_pod5 val_ = val + _cyb_memcpy(&(self._ptr[0].vgpuSchedData), (val_._get_ptr()), sizeof(cuda_bindings_nvml__anon_pod5) * 1) + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerSetParams instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerSetParams_t), VgpuSchedulerSetParams) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerSetParams instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_set_params_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_scheduler_set_params_dtype", vgpu_scheduler_set_params_dtype, VgpuSchedulerSetParams) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerSetParams 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 VgpuSchedulerSetParams obj = VgpuSchedulerSetParams.__new__(VgpuSchedulerSetParams) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerSetParams") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerSetParams_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_license_info_dtype_offsets(): + cdef nvmlVgpuLicenseInfo_t pod + return _numpy.dtype({ + 'names': ['is_licensed', 'license_expiry', 'current_state'], + 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.isLicensed)) - (&pod), + (&(pod.licenseExpiry)) - (&pod), + (&(pod.currentState)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), + }) + +vgpu_license_info_dtype = _get_vgpu_license_info_dtype_offsets() + +cdef class VgpuLicenseInfo: + """Empty-initialize an instance of `nvmlVgpuLicenseInfo_t`. + + + .. seealso:: `nvmlVgpuLicenseInfo_t` + """ + cdef: + nvmlVgpuLicenseInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuLicenseInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuLicenseInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuLicenseInfo 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 VgpuLicenseInfo other_ + if not isinstance(other, VgpuLicenseInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseInfo_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuLicenseInfo_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 = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuLicenseInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def license_expiry(self): + """VgpuLicenseExpiry: """ + return VgpuLicenseExpiry.from_ptr( + &(self._ptr[0].licenseExpiry), + readonly=self._readonly, + owner=self, + ) + + @license_expiry.setter + def license_expiry(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseInfo instance is read-only") + cdef VgpuLicenseExpiry val_ = val + _cyb_memcpy(&(self._ptr[0].licenseExpiry), (val_._get_ptr()), sizeof(nvmlVgpuLicenseExpiry_t) * 1) + + @property + def is_licensed(self): + """int: """ + return self._ptr[0].isLicensed + + @is_licensed.setter + def is_licensed(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseInfo instance is read-only") + self._ptr[0].isLicensed = val + + @property + def current_state(self): + """int: """ + return self._ptr[0].currentState + + @current_state.setter + def current_state(self, val): + if self._readonly: + raise ValueError("This VgpuLicenseInfo instance is read-only") + self._ptr[0].currentState = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuLicenseInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuLicenseInfo_t), VgpuLicenseInfo) + + @staticmethod + def from_data(data): + """Create an VgpuLicenseInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_license_info_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_license_info_dtype", vgpu_license_info_dtype, VgpuLicenseInfo) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuLicenseInfo 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 VgpuLicenseInfo obj = VgpuLicenseInfo.__new__(VgpuLicenseInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuLicenseInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_grid_licensable_feature_dtype_offsets(): + cdef nvmlGridLicensableFeature_t pod + return _numpy.dtype({ + 'names': ['feature_code', 'feature_state', 'license_info', 'product_name', 'feature_enabled', 'license_expiry'], + 'formats': [_numpy.int32, _numpy.uint32, (_numpy.int8, 128), (_numpy.int8, 128), _numpy.uint32, grid_license_expiry_dtype], + 'offsets': [ + (&(pod.featureCode)) - (&pod), + (&(pod.featureState)) - (&pod), + (&(pod.licenseInfo)) - (&pod), + (&(pod.productName)) - (&pod), + (&(pod.featureEnabled)) - (&pod), + (&(pod.licenseExpiry)) - (&pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeature_t), + }) + +grid_licensable_feature_dtype = _get_grid_licensable_feature_dtype_offsets() + +cdef class GridLicensableFeature: + """Empty-initialize an array of `nvmlGridLicensableFeature_t`. + The resulting object is of length `size` and of dtype `grid_licensable_feature_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlGridLicensableFeature_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=grid_licensable_feature_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlGridLicensableFeature_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlGridLicensableFeature_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.GridLicensableFeature_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.GridLicensableFeature 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, GridLicensableFeature)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def feature_code(self): + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.feature_code[0]) + return self._data.feature_code + + @feature_code.setter + def feature_code(self, val): + self._data.feature_code = val + + @property + def feature_state(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.feature_state[0]) + return self._data.feature_state + + @feature_state.setter + def feature_state(self, val): + self._data.feature_state = val + + @property + def license_info(self): + """~_numpy.int8: (array of length 128).""" + return self._data.license_info + + @license_info.setter + def license_info(self, val): + self._data.license_info = val + + @property + def product_name(self): + """~_numpy.int8: (array of length 128).""" + return self._data.product_name + + @product_name.setter + def product_name(self, val): + self._data.product_name = val + + @property + def feature_enabled(self): + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.feature_enabled[0]) + return self._data.feature_enabled + + @feature_enabled.setter + def feature_enabled(self, val): + self._data.feature_enabled = val + + @property + def license_expiry(self): + """grid_license_expiry_dtype: """ + return self._data.license_expiry + + @license_expiry.setter + def license_expiry(self, val): + self._data.license_expiry = 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 GridLicensableFeature.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == grid_licensable_feature_dtype: + return GridLicensableFeature.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an GridLicensableFeature instance with the memory from the given buffer.""" + return GridLicensableFeature.from_data(_numpy.frombuffer(buffer, dtype=grid_licensable_feature_dtype)) + + @staticmethod + def from_data(data): + """Create an GridLicensableFeature instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `grid_licensable_feature_dtype` holding the data. + """ + cdef GridLicensableFeature obj = GridLicensableFeature.__new__(GridLicensableFeature) + 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 != grid_licensable_feature_dtype: + raise ValueError("data array must be of dtype grid_licensable_feature_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an GridLicensableFeature 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef GridLicensableFeature obj = GridLicensableFeature.__new__(GridLicensableFeature) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlGridLicensableFeature_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=grid_licensable_feature_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_unit_fan_speeds_dtype_offsets(): + cdef nvmlUnitFanSpeeds_t pod + return _numpy.dtype({ + 'names': ['fans', 'count'], + 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], + 'offsets': [ + (&(pod.fans)) - (&pod), + (&(pod.count)) - (&pod), + ], + 'itemsize': sizeof(nvmlUnitFanSpeeds_t), + }) + +unit_fan_speeds_dtype = _get_unit_fan_speeds_dtype_offsets() + +cdef class UnitFanSpeeds: + """Empty-initialize an instance of `nvmlUnitFanSpeeds_t`. + + + .. seealso:: `nvmlUnitFanSpeeds_t` + """ + cdef: + nvmlUnitFanSpeeds_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlUnitFanSpeeds_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating UnitFanSpeeds") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlUnitFanSpeeds_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.UnitFanSpeeds 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 UnitFanSpeeds other_ + if not isinstance(other, UnitFanSpeeds): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitFanSpeeds_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlUnitFanSpeeds_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 = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating UnitFanSpeeds") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlUnitFanSpeeds_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def fans(self): + """UnitFanInfo: """ + return UnitFanInfo.from_ptr( + &(self._ptr[0].fans), + 24, + readonly=self._readonly, + owner=self, + ) + + @fans.setter + def fans(self, val): + if self._readonly: + raise ValueError("This UnitFanSpeeds instance is read-only") + cdef UnitFanInfo val_ = val + if len(val) != 24: + raise ValueError(f"Expected length { 24 } for field fans, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].fans), (val_._get_ptr()), sizeof(nvmlUnitFanInfo_t) * 24) + + @property + def count(self): + """int: """ + return self._ptr[0].count + + @count.setter + def count(self, val): + if self._readonly: + raise ValueError("This UnitFanSpeeds instance is read-only") + self._ptr[0].count = val + + @staticmethod + def from_buffer(buffer): + """Create an UnitFanSpeeds instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlUnitFanSpeeds_t), UnitFanSpeeds) + + @staticmethod + def from_data(data): + """Create an UnitFanSpeeds instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `unit_fan_speeds_dtype` holding the data. + """ + return _cyb_from_data(data, "unit_fan_speeds_dtype", unit_fan_speeds_dtype, UnitFanSpeeds) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an UnitFanSpeeds 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 UnitFanSpeeds obj = UnitFanSpeeds.__new__(UnitFanSpeeds) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating UnitFanSpeeds") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUnitFanSpeeds_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_pgpu_metadata_dtype_offsets(): + cdef nvmlVgpuPgpuMetadata_t pod + return _numpy.dtype({ + 'names': ['version', 'revision', 'host_driver_version', 'pgpu_virtualization_caps', 'reserved', 'host_supported_vgpu_range', 'opaque_data_size', 'opaque_data'], + 'formats': [_numpy.uint32, _numpy.uint32, (_numpy.int8, 80), _numpy.uint32, (_numpy.uint32, 5), vgpu_version_dtype, _numpy.uint32, (_numpy.int8, 4)], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.revision)) - (&pod), + (&(pod.hostDriverVersion)) - (&pod), + (&(pod.pgpuVirtualizationCaps)) - (&pod), + (&(pod.reserved)) - (&pod), + (&(pod.hostSupportedVgpuRange)) - (&pod), + (&(pod.opaqueDataSize)) - (&pod), + (&(pod.opaqueData)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), + }) + +vgpu_pgpu_metadata_dtype = _get_vgpu_pgpu_metadata_dtype_offsets() + +cdef class VgpuPgpuMetadata: + """Empty-initialize an instance of `nvmlVgpuPgpuMetadata_t`. + + + .. seealso:: `nvmlVgpuPgpuMetadata_t` + """ + cdef: + nvmlVgpuPgpuMetadata_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuPgpuMetadata_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuMetadata") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuPgpuMetadata_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuPgpuMetadata 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 VgpuPgpuMetadata other_ + if not isinstance(other, VgpuPgpuMetadata): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuPgpuMetadata_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuPgpuMetadata_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 = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuMetadata") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuPgpuMetadata_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def host_supported_vgpu_range(self): + """VgpuVersion: """ + return VgpuVersion.from_ptr( + &(self._ptr[0].hostSupportedVgpuRange), + readonly=self._readonly, + owner=self, + ) + + @host_supported_vgpu_range.setter + def host_supported_vgpu_range(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + cdef VgpuVersion val_ = val + _cyb_memcpy(&(self._ptr[0].hostSupportedVgpuRange), (val_._get_ptr()), sizeof(nvmlVgpuVersion_t) * 1) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].version = val + + @property + def revision(self): + """int: """ + return self._ptr[0].revision + + @revision.setter + def revision(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].revision = val + + @property + def host_driver_version(self): + """~_numpy.int8: (array of length 80).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) + + @host_driver_version.setter + def host_driver_version(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 80: + raise ValueError("String too long for field host_driver_version, max length is 79") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].hostDriverVersion), ptr, 80) + + @property + def pgpu_virtualization_caps(self): + """int: """ + return self._ptr[0].pgpuVirtualizationCaps + + @pgpu_virtualization_caps.setter + def pgpu_virtualization_caps(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].pgpuVirtualizationCaps = val + + @property + def opaque_data_size(self): + """int: """ + return self._ptr[0].opaqueDataSize + + @opaque_data_size.setter + def opaque_data_size(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + self._ptr[0].opaqueDataSize = val + + @property + def opaque_data(self): + """~_numpy.int8: (array of length 4).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].opaqueData) + + @opaque_data.setter + def opaque_data(self, val): + if self._readonly: + raise ValueError("This VgpuPgpuMetadata instance is read-only") + cdef bytes buf = val.encode() + if len(buf) >= 4: + raise ValueError("String too long for field opaque_data, max length is 3") + cdef char *ptr = buf + _cyb_memcpy((self._ptr[0].opaqueData), ptr, 4) + + @staticmethod + def from_buffer(buffer): + """Create an VgpuPgpuMetadata instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuPgpuMetadata_t), VgpuPgpuMetadata) + + @staticmethod + def from_data(data): + """Create an VgpuPgpuMetadata instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_pgpu_metadata_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_pgpu_metadata_dtype", vgpu_pgpu_metadata_dtype, VgpuPgpuMetadata) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuPgpuMetadata 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 VgpuPgpuMetadata obj = VgpuPgpuMetadata.__new__(VgpuPgpuMetadata) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuPgpuMetadata_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuPgpuMetadata") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuPgpuMetadata_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_gpu_instance_info_dtype_offsets(): + cdef nvmlGpuInstanceInfo_t pod + return _numpy.dtype({ + 'names': ['device_', 'id', 'profile_id', 'placement'], + 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], + 'offsets': [ + (&(pod.device)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.profileId)) - (&pod), + (&(pod.placement)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuInstanceInfo_t), + }) + +gpu_instance_info_dtype = _get_gpu_instance_info_dtype_offsets() + +cdef class GpuInstanceInfo: + """Empty-initialize an instance of `nvmlGpuInstanceInfo_t`. + + + .. seealso:: `nvmlGpuInstanceInfo_t` + """ + cdef: + nvmlGpuInstanceInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuInstanceInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuInstanceInfo 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 GpuInstanceInfo other_ + if not isinstance(other, GpuInstanceInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceInfo_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuInstanceInfo_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 = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuInstanceInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def placement(self): + """GpuInstancePlacement: """ + return GpuInstancePlacement.from_ptr( + &(self._ptr[0].placement), + 1, + readonly=self._readonly, + owner=self, + ) + + @placement.setter + def placement(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + cdef GpuInstancePlacement val_ = val + _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlGpuInstancePlacement_t) * 1) + + @property + def device_(self): + """int: """ + return (self._ptr[0].device) + + @device_.setter + def device_(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + self._ptr[0].device = val + + @property + def id(self): + """int: """ + return self._ptr[0].id + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + self._ptr[0].id = val + + @property + def profile_id(self): + """int: """ + return self._ptr[0].profileId + + @profile_id.setter + def profile_id(self, val): + if self._readonly: + raise ValueError("This GpuInstanceInfo instance is read-only") + self._ptr[0].profileId = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuInstanceInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuInstanceInfo_t), GpuInstanceInfo) + + @staticmethod + def from_data(data): + """Create an GpuInstanceInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_instance_info_dtype` holding the data. + """ + return _cyb_from_data(data, "gpu_instance_info_dtype", gpu_instance_info_dtype, GpuInstanceInfo) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GpuInstanceInfo 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 GpuInstanceInfo obj = GpuInstanceInfo.__new__(GpuInstanceInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuInstanceInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_compute_instance_info_dtype_offsets(): + cdef nvmlComputeInstanceInfo_t pod + return _numpy.dtype({ + 'names': ['device_', 'gpu_instance', 'id', 'profile_id', 'placement'], + 'formats': [_numpy.intp, _numpy.intp, _numpy.uint32, _numpy.uint32, compute_instance_placement_dtype], + 'offsets': [ + (&(pod.device)) - (&pod), + (&(pod.gpuInstance)) - (&pod), + (&(pod.id)) - (&pod), + (&(pod.profileId)) - (&pod), + (&(pod.placement)) - (&pod), + ], + 'itemsize': sizeof(nvmlComputeInstanceInfo_t), + }) + +compute_instance_info_dtype = _get_compute_instance_info_dtype_offsets() + +cdef class ComputeInstanceInfo: + """Empty-initialize an instance of `nvmlComputeInstanceInfo_t`. + + + .. seealso:: `nvmlComputeInstanceInfo_t` + """ + cdef: + nvmlComputeInstanceInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlComputeInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlComputeInstanceInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.ComputeInstanceInfo 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 ComputeInstanceInfo other_ + if not isinstance(other, ComputeInstanceInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceInfo_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlComputeInstanceInfo_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 = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def placement(self): + """ComputeInstancePlacement: """ + return ComputeInstancePlacement.from_ptr( + &(self._ptr[0].placement), + 1, + readonly=self._readonly, + owner=self, + ) + + @placement.setter + def placement(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + cdef ComputeInstancePlacement val_ = val + _cyb_memcpy(&(self._ptr[0].placement), (val_._get_ptr()), sizeof(nvmlComputeInstancePlacement_t) * 1) + + @property + def device_(self): + """int: """ + return (self._ptr[0].device) + + @device_.setter + def device_(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].device = val + + @property + def gpu_instance(self): + """int: """ + return (self._ptr[0].gpuInstance) + + @gpu_instance.setter + def gpu_instance(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].gpuInstance = val + + @property + def id(self): + """int: """ + return self._ptr[0].id + + @id.setter + def id(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].id = val + + @property + def profile_id(self): + """int: """ + return self._ptr[0].profileId + + @profile_id.setter + def profile_id(self, val): + if self._readonly: + raise ValueError("This ComputeInstanceInfo instance is read-only") + self._ptr[0].profileId = val + + @staticmethod + def from_buffer(buffer): + """Create an ComputeInstanceInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlComputeInstanceInfo_t), ComputeInstanceInfo) + + @staticmethod + def from_data(data): + """Create an ComputeInstanceInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `compute_instance_info_dtype` holding the data. + """ + return _cyb_from_data(data, "compute_instance_info_dtype", compute_instance_info_dtype, ComputeInstanceInfo) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an ComputeInstanceInfo 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 ComputeInstanceInfo obj = ComputeInstanceInfo.__new__(ComputeInstanceInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating ComputeInstanceInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceInfo_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets(): + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'entry_count', 'entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.entryCount)) - (&pod), + (&(pod.entries)) - (&pod), + ], + 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), + }) + +ecc_sram_unique_uncorrected_error_counts_v1_dtype = _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets() + +cdef class EccSramUniqueUncorrectedErrorCounts_v1: + """Empty-initialize an instance of `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t`. + + + .. seealso:: `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t` + """ + cdef: + nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.EccSramUniqueUncorrectedErrorCounts_v1 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 EccSramUniqueUncorrectedErrorCounts_v1 other_ + if not isinstance(other, EccSramUniqueUncorrectedErrorCounts_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_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 = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: the API version number""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This EccSramUniqueUncorrectedErrorCounts_v1 instance is read-only") + self._ptr[0].version = val + + @property + def entries(self): + """int: pointer to caller-supplied buffer to return the SRAM unique uncorrected ECC error count entries""" + if self._ptr[0].entries == NULL or self._ptr[0].entryCount == 0: + return [] + return EccSramUniqueUncorrectedErrorEntry_v1.from_ptr( + (self._ptr[0].entries), + self._ptr[0].entryCount, + owner=self, + readonly=self._readonly + ) + + @entries.setter + def entries(self, val): + if self._readonly: + raise ValueError("This EccSramUniqueUncorrectedErrorCounts_v1 instance is read-only") + cdef EccSramUniqueUncorrectedErrorEntry_v1 arr = val + self._ptr[0].entries = (arr._get_ptr()) + self._ptr[0].entryCount = len(arr) + self._refs["entries"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), EccSramUniqueUncorrectedErrorCounts_v1) + + @staticmethod + def from_data(data): + """Create an EccSramUniqueUncorrectedErrorCounts_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `ecc_sram_unique_uncorrected_error_counts_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "ecc_sram_unique_uncorrected_error_counts_v1_dtype", ecc_sram_unique_uncorrected_error_counts_v1_dtype, EccSramUniqueUncorrectedErrorCounts_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an EccSramUniqueUncorrectedErrorCounts_v1 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 EccSramUniqueUncorrectedErrorCounts_v1 obj = EccSramUniqueUncorrectedErrorCounts_v1.__new__(EccSramUniqueUncorrectedErrorCounts_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +cdef _get_nvlink_firmware_info_dtype_offsets(): + cdef nvmlNvlinkFirmwareInfo_t pod + return _numpy.dtype({ + 'names': ['firmware_version', 'num_valid_entries'], + 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], + 'offsets': [ + (&(pod.firmwareVersion)) - (&pod), + (&(pod.numValidEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), + }) + +nvlink_firmware_info_dtype = _get_nvlink_firmware_info_dtype_offsets() + +cdef class NvlinkFirmwareInfo: + """Empty-initialize an instance of `nvmlNvlinkFirmwareInfo_t`. + + + .. seealso:: `nvmlNvlinkFirmwareInfo_t` + """ + cdef: + nvmlNvlinkFirmwareInfo_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkFirmwareInfo") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvlinkFirmwareInfo_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvlinkFirmwareInfo 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 NvlinkFirmwareInfo other_ + if not isinstance(other, NvlinkFirmwareInfo): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkFirmwareInfo_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkFirmwareInfo_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 = _cyb_malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkFirmwareInfo") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareInfo_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def firmware_version(self): + """NvlinkFirmwareVersion: OUT - NVLINK firmware version.""" + return NvlinkFirmwareVersion.from_ptr( + &(self._ptr[0].firmwareVersion), + 100, + readonly=self._readonly, + owner=self, + ) + + @firmware_version.setter + def firmware_version(self, val): + if self._readonly: + raise ValueError("This NvlinkFirmwareInfo instance is read-only") + cdef NvlinkFirmwareVersion val_ = val + if len(val) != 100: + raise ValueError(f"Expected length { 100 } for field firmware_version, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].firmwareVersion), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareVersion_t) * 100) + + @property + def num_valid_entries(self): + """int: OUT - Number of valid firmware entries.""" + return self._ptr[0].numValidEntries + + @num_valid_entries.setter + def num_valid_entries(self, val): + if self._readonly: + raise ValueError("This NvlinkFirmwareInfo instance is read-only") + self._ptr[0].numValidEntries = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkFirmwareInfo instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkFirmwareInfo_t), NvlinkFirmwareInfo) + + @staticmethod + def from_data(data): + """Create an NvlinkFirmwareInfo instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_firmware_info_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_firmware_info_dtype", nvlink_firmware_info_dtype, NvlinkFirmwareInfo) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkFirmwareInfo 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 NvlinkFirmwareInfo obj = NvlinkFirmwareInfo.__new__(NvlinkFirmwareInfo) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvlinkFirmwareInfo") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareInfo_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_info_v2_dtype_offsets(): + cdef nvmlVgpuSchedulerLogInfo_v2_t pod + 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 = _cyb_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 + _cyb_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 (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + _cyb_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, + readonly=self._readonly, + owner=self, + ) + + @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)}") + _cyb_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. 0 when there is no active scheduling.""" + 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. 0 when there is no active scheduling.""" + 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 _cyb_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 _cyb_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + _cyb_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_get_cper_v1_dtype_offsets(): + cdef nvmlGetCPER_v1_t pod + return _numpy.dtype({ + 'names': ['cursor', 'buffer', 'buffer_size'], + 'formats': [cper_cursor_v1_dtype, _numpy.intp, _numpy.uint32], + 'offsets': [ + (&(pod.cursor)) - (&pod), + (&(pod.buffer)) - (&pod), + (&(pod.bufferSize)) - (&pod), + ], + 'itemsize': sizeof(nvmlGetCPER_v1_t), + }) + +get_cper_v1_dtype = _get_get_cper_v1_dtype_offsets() + +cdef class GetCPER_v1: + """Empty-initialize an instance of `nvmlGetCPER_v1_t`. + + + .. seealso:: `nvmlGetCPER_v1_t` + """ + cdef: + nvmlGetCPER_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGetCPER_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GetCPER_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGetCPER_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GetCPER_v1 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 GetCPER_v1 other_ + if not isinstance(other, GetCPER_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGetCPER_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGetCPER_v1_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 = _cyb_malloc(sizeof(nvmlGetCPER_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GetCPER_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGetCPER_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def cursor(self): + """CPERCursor_v1: [IN/OUT] Query parameters and cursor. See `nvmlCPERCursor_v1_t`""" + return CPERCursor_v1.from_ptr( + &(self._ptr[0].cursor), + readonly=self._readonly, + owner=self, + ) + + @cursor.setter + def cursor(self, val): + if self._readonly: + raise ValueError("This GetCPER_v1 instance is read-only") + cdef CPERCursor_v1 val_ = val + _cyb_memcpy(&(self._ptr[0].cursor), (val_._get_ptr()), sizeof(nvmlCPERCursor_v1_t) * 1) + + @property + def buffer(self): + """str: [OUT] Buffer to be filled (allocated by client). May be NULL for size query.""" + return (self._ptr[0].buffer) + + @buffer.setter + def buffer(self, val): + if self._readonly: + raise ValueError("This GetCPER_v1 instance is read-only") + self._ptr[0].buffer = val + + @property + def buffer_size(self): + """int: [IN/OUT] Size of `buffer`. Set to 0 with `buffer` NULL to query required size. On return, set to required or used size; 0 means no (more) records.""" + return self._ptr[0].bufferSize + + @buffer_size.setter + def buffer_size(self, val): + if self._readonly: + raise ValueError("This GetCPER_v1 instance is read-only") + self._ptr[0].bufferSize = val + + @staticmethod + def from_buffer(buffer): + """Create an GetCPER_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGetCPER_v1_t), GetCPER_v1) + + @staticmethod + def from_data(data): + """Create an GetCPER_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `get_cper_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "get_cper_v1_dtype", get_cper_v1_dtype, GetCPER_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GetCPER_v1 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 GetCPER_v1 obj = GetCPER_v1.__new__(GetCPER_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGetCPER_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GetCPER_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGetCPER_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_core_rail_metrics_dtype_offsets(): + cdef nvmlCoreRailMetrics_t pod + return _numpy.dtype({ + 'names': ['rails'], + 'formats': [(rail_metrics_dtype, 2)], + 'offsets': [ + (&(pod.rails)) - (&pod), + ], + 'itemsize': sizeof(nvmlCoreRailMetrics_t), + }) + +core_rail_metrics_dtype = _get_core_rail_metrics_dtype_offsets() + +cdef class CoreRailMetrics: + """Empty-initialize an array of `nvmlCoreRailMetrics_t`. + The resulting object is of length `size` and of dtype `core_rail_metrics_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlCoreRailMetrics_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=core_rail_metrics_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlCoreRailMetrics_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlCoreRailMetrics_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.CoreRailMetrics_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.CoreRailMetrics 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, CoreRailMetrics)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def rails(self): + """rail_metrics_dtype: (array of length 2).Array of core rail metrics.""" + return self._data.rails + + @rails.setter + def rails(self, val): + self._data.rails = 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 CoreRailMetrics.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == core_rail_metrics_dtype: + return CoreRailMetrics.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an CoreRailMetrics instance with the memory from the given buffer.""" + return CoreRailMetrics.from_data(_numpy.frombuffer(buffer, dtype=core_rail_metrics_dtype)) + + @staticmethod + def from_data(data): + """Create an CoreRailMetrics instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `core_rail_metrics_dtype` holding the data. + """ + cdef CoreRailMetrics obj = CoreRailMetrics.__new__(CoreRailMetrics) + 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 != core_rail_metrics_dtype: + raise ValueError("data array must be of dtype core_rail_metrics_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an CoreRailMetrics 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef CoreRailMetrics obj = CoreRailMetrics.__new__(CoreRailMetrics) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlCoreRailMetrics_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=core_rail_metrics_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_pwr_model_metrics_pfpp1x_dtype_offsets(): + cdef nvmlPwrModelMetricsPfpp1x_t pod + return _numpy.dtype({ + 'names': ['num_vf_points', 'estimated_metrics', 'b_valid', 'max_perf_per_watt_point', 'fmax_at_vmax_point', 'tgp_headroomm_w'], + 'formats': [_numpy.uint8, (pwr_model_metrics_sample_pfpp1x_dtype, 32), _numpy.uint8, pwr_model_operating_point_pfpp1x_dtype, pwr_model_operating_point_pfpp1x_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.numVfPoints)) - (&pod), + (&(pod.estimatedMetrics)) - (&pod), + (&(pod.bValid)) - (&pod), + (&(pod.maxPerfPerWattPoint)) - (&pod), + (&(pod.fmaxAtVmaxPoint)) - (&pod), + (&(pod.tgpHeadroommW)) - (&pod), + ], + 'itemsize': sizeof(nvmlPwrModelMetricsPfpp1x_t), + }) + +pwr_model_metrics_pfpp1x_dtype = _get_pwr_model_metrics_pfpp1x_dtype_offsets() + +cdef class PwrModelMetricsPfpp1x: + """Empty-initialize an array of `nvmlPwrModelMetricsPfpp1x_t`. + The resulting object is of length `size` and of dtype `pwr_model_metrics_pfpp1x_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlPwrModelMetricsPfpp1x_t` + """ + cdef: + readonly object _data + object _owner + readonly tuple _estimated_metrics + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=pwr_model_metrics_pfpp1x_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPwrModelMetricsPfpp1x_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelMetricsPfpp1x_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.PwrModelMetricsPfpp1x_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PwrModelMetricsPfpp1x 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, PwrModelMetricsPfpp1x)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def estimated_metrics(self): + """PwrModelMetricsSamplePfpp1x: Array of estimated metrics for different operating points.""" + if self._data.size == 1: + return self._estimated_metrics[0] + return self._estimated_metrics + + @property + def b_valid(self): + """Union[~_numpy.uint8, int]: Validity flag: non-zero if metrics are valid.""" + if self._data.size == 1: + return int(self._data.b_valid[0]) + return self._data.b_valid + + @b_valid.setter + def b_valid(self, val): + self._data.b_valid = val + + @property + def max_perf_per_watt_point(self): + """pwr_model_operating_point_pfpp1x_dtype: Operating point with maximum performance per watt.""" + return self._data.max_perf_per_watt_point + + @max_perf_per_watt_point.setter + def max_perf_per_watt_point(self, val): + self._data.max_perf_per_watt_point = val + + @property + def fmax_at_vmax_point(self): + """pwr_model_operating_point_pfpp1x_dtype: Operating point at maximum frequency and voltage.""" + return self._data.fmax_at_vmax_point + + @fmax_at_vmax_point.setter + def fmax_at_vmax_point(self, val): + self._data.fmax_at_vmax_point = val + + @property + def tgp_headroomm_w(self): + """Union[~_numpy.uint32, int]: TGP headroom in milliwatts.""" + if self._data.size == 1: + return int(self._data.tgp_headroomm_w[0]) + return self._data.tgp_headroomm_w + + @tgp_headroomm_w.setter + def tgp_headroomm_w(self, val): + self._data.tgp_headroomm_w = 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 PwrModelMetricsPfpp1x.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_metrics_pfpp1x_dtype: + return PwrModelMetricsPfpp1x.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an PwrModelMetricsPfpp1x instance with the memory from the given buffer.""" + return PwrModelMetricsPfpp1x.from_data(_numpy.frombuffer(buffer, dtype=pwr_model_metrics_pfpp1x_dtype)) + + @staticmethod + def from_data(data): + """Create an PwrModelMetricsPfpp1x instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `pwr_model_metrics_pfpp1x_dtype` holding the data. + """ + cdef PwrModelMetricsPfpp1x obj = PwrModelMetricsPfpp1x.__new__(PwrModelMetricsPfpp1x) + 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 != pwr_model_metrics_pfpp1x_dtype: + raise ValueError("data array must be of dtype pwr_model_metrics_pfpp1x_dtype") + obj._data = data.view(_numpy.recarray) + + estimatedMetrics_list = list() + for i in range(obj._data.size): + addr = obj._data.estimatedMetrics[i].__array_interface__['data'][0] + n = int(obj._data.num_vf_points[i]) + estimatedMetrics_obj = PwrModelMetricsSamplePfpp1x.from_ptr(addr, n, owner=obj, readonly=False) + estimatedMetrics_list.append(estimatedMetrics_obj) + obj._estimatedMetrics = tuple(estimatedMetrics_list) + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PwrModelMetricsPfpp1x 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef PwrModelMetricsPfpp1x obj = PwrModelMetricsPfpp1x.__new__(PwrModelMetricsPfpp1x) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPwrModelMetricsPfpp1x_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=pwr_model_metrics_pfpp1x_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + estimatedMetrics_list = list() + for i in range(obj._data.size): + addr = obj._data.estimatedMetrics[i].__array_interface__['data'][0] + n = int(obj._data.num_vf_points[i]) + estimatedMetrics_obj = PwrModelMetricsSamplePfpp1x.from_ptr(addr, n, owner=obj, readonly=readonly) + estimatedMetrics_list.append(estimatedMetrics_obj) + obj._estimatedMetrics = tuple(estimatedMetrics_list) + return obj + + +cdef _get_gpu_fabric_info_v4_dtype_offsets(): + cdef nvmlGpuFabricInfo_v4_t pod + return _numpy.dtype({ + 'names': ['cluster_uuid', 'status', 'cliques', 'num_cliques', 'state', 'health_mask', 'health_summary'], + 'formats': [(_numpy.uint8, 16), _numpy.int32, (gpu_fabric_clique_v1_dtype, 64), _numpy.uint32, _numpy.uint8, _numpy.uint32, _numpy.uint8], + 'offsets': [ + (&(pod.clusterUuid)) - (&pod), + (&(pod.status)) - (&pod), + (&(pod.cliques)) - (&pod), + (&(pod.numCliques)) - (&pod), + (&(pod.state)) - (&pod), + (&(pod.healthMask)) - (&pod), + (&(pod.healthSummary)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuFabricInfo_v4_t), + }) + +gpu_fabric_info_v4_dtype = _get_gpu_fabric_info_v4_dtype_offsets() + +cdef class GpuFabricInfo_v4: + """Empty-initialize an instance of `nvmlGpuFabricInfo_v4_t`. + + + .. seealso:: `nvmlGpuFabricInfo_v4_t` + """ + cdef: + nvmlGpuFabricInfo_v4_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuFabricInfo_v4_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v4") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlGpuFabricInfo_v4_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.GpuFabricInfo_v4 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 GpuFabricInfo_v4 other_ + if not isinstance(other, GpuFabricInfo_v4): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuFabricInfo_v4_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuFabricInfo_v4_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 = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v4_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v4") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuFabricInfo_v4_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def cliques(self): + """GpuFabricClique_v1: Clique entries, sorted by ascending type then ascending id.""" + return GpuFabricClique_v1.from_ptr( + &(self._ptr[0].cliques), + readonly=self._readonly, + owner=self, + ) + + @cliques.setter + def cliques(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v4 instance is read-only") + cdef GpuFabricClique_v1 val_ = val + if len(val) != 64: + raise ValueError(f"Expected length { 64 } for field cliques, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].cliques), (val_._get_ptr()), sizeof(nvmlGpuFabricClique_v1_t) * 64) + + @property + def cluster_uuid(self): + """~_numpy.uint8: (array of length 16).Uuid of the cluster to which this GPU belongs.""" + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + arr.data = (&(self._ptr[0].clusterUuid)) + return _numpy.asarray(arr) + + @cluster_uuid.setter + def cluster_uuid(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v4 instance is read-only") + if len(val) != 16: + raise ValueError(f"Expected length { 16 } for field cluster_uuid, got {len(val)}") + cdef _cyb_view.array arr = _cyb_view.array(shape=(16,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _cyb_memcpy((&(self._ptr[0].clusterUuid)), (arr.data), sizeof(unsigned char) * len(val)) + + @property + def status(self): + """int: Probe Error status, if any. Must be checked only if state returns "complete".""" + return (self._ptr[0].status) + + @status.setter + def status(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v4 instance is read-only") + self._ptr[0].status = val + + @property + def num_cliques(self): + """int: Number of valid entries in cliques[].""" + return self._ptr[0].numCliques + + @num_cliques.setter + def num_cliques(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v4 instance is read-only") + self._ptr[0].numCliques = val + + @property + def state(self): + """int: Current Probe State. See NVML_GPU_FABRIC_STATE_*.""" + return (self._ptr[0].state) + + @state.setter + def state(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v4 instance is read-only") + self._ptr[0].state = val + + @property + def health_mask(self): + """int: GPU Fabric health Status Mask. See NVML_GPU_FABRIC_HEALTH_MASK_*.""" + return self._ptr[0].healthMask + + @health_mask.setter + def health_mask(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v4 instance is read-only") + self._ptr[0].healthMask = val + + @property + def health_summary(self): + """int: GPU Fabric health summary. See NVML_GPU_FABRIC_HEALTH_SUMMARY_*.""" + return self._ptr[0].healthSummary + + @health_summary.setter + def health_summary(self, val): + if self._readonly: + raise ValueError("This GpuFabricInfo_v4 instance is read-only") + self._ptr[0].healthSummary = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuFabricInfo_v4 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuFabricInfo_v4_t), GpuFabricInfo_v4) + + @staticmethod + def from_data(data): + """Create an GpuFabricInfo_v4 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_fabric_info_v4_dtype` holding the data. + """ + return _cyb_from_data(data, "gpu_fabric_info_v4_dtype", gpu_fabric_info_v4_dtype, GpuFabricInfo_v4) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GpuFabricInfo_v4 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 GpuFabricInfo_v4 obj = GpuFabricInfo_v4.__new__(GpuFabricInfo_v4) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGpuFabricInfo_v4_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating GpuFabricInfo_v4") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuFabricInfo_v4_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + return obj + + +cdef _get_nvlink_telemetry_samples_v1_dtype_offsets(): + cdef nvmlNvlinkTelemetrySamples_v1_t pod + return _numpy.dtype({ + 'names': ['telemetry_count', 'telemetry_samples'], + 'formats': [_numpy.uint32, _numpy.intp], + 'offsets': [ + (&(pod.telemetryCount)) - (&pod), + (&(pod.telemetrySamples)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkTelemetrySamples_v1_t), + }) + +nvlink_telemetry_samples_v1_dtype = _get_nvlink_telemetry_samples_v1_dtype_offsets() + +cdef class NvlinkTelemetrySamples_v1: + """Empty-initialize an instance of `nvmlNvlinkTelemetrySamples_v1_t`. + + + .. seealso:: `nvmlNvlinkTelemetrySamples_v1_t` + """ + cdef: + nvmlNvlinkTelemetrySamples_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkTelemetrySamples_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkTelemetrySamples_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlNvlinkTelemetrySamples_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvlinkTelemetrySamples_v1 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 NvlinkTelemetrySamples_v1 other_ + if not isinstance(other, NvlinkTelemetrySamples_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkTelemetrySamples_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkTelemetrySamples_v1_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 = _cyb_malloc(sizeof(nvmlNvlinkTelemetrySamples_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkTelemetrySamples_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkTelemetrySamples_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def telemetry_samples(self): + """int: [in,out] Caller-allocated array of `telemetryCount` request slots""" + if self._ptr[0].telemetrySamples == NULL or self._ptr[0].telemetryCount == 0: + return [] + return NvlinkTelemetrySample_v1.from_ptr( + (self._ptr[0].telemetrySamples), + self._ptr[0].telemetryCount, + owner=self, + readonly=self._readonly + ) + + @telemetry_samples.setter + def telemetry_samples(self, val): + if self._readonly: + raise ValueError("This NvlinkTelemetrySamples_v1 instance is read-only") + cdef NvlinkTelemetrySample_v1 arr = val + self._ptr[0].telemetrySamples = (arr._get_ptr()) + self._ptr[0].telemetryCount = len(arr) + self._refs["telemetry_samples"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkTelemetrySamples_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkTelemetrySamples_v1_t), NvlinkTelemetrySamples_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkTelemetrySamples_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_telemetry_samples_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_telemetry_samples_v1_dtype", nvlink_telemetry_samples_v1_dtype, NvlinkTelemetrySamples_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkTelemetrySamples_v1 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 NvlinkTelemetrySamples_v1 obj = NvlinkTelemetrySamples_v1.__new__(NvlinkTelemetrySamples_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkTelemetrySamples_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvlinkTelemetrySamples_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkTelemetrySamples_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +cdef _get_ecc_bank_remapper_status_v1_dtype_offsets(): + cdef nvmlEccBankRemapperStatus_v1_t pod + return _numpy.dtype({ + 'names': ['active_remappings', 'inactive_remappings', 'b_pending', 'histogram'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, ecc_bank_remapper_histogram_v1_dtype], + 'offsets': [ + (&(pod.activeRemappings)) - (&pod), + (&(pod.inactiveRemappings)) - (&pod), + (&(pod.bPending)) - (&pod), + (&(pod.histogram)) - (&pod), + ], + 'itemsize': sizeof(nvmlEccBankRemapperStatus_v1_t), + }) + +ecc_bank_remapper_status_v1_dtype = _get_ecc_bank_remapper_status_v1_dtype_offsets() + +cdef class EccBankRemapperStatus_v1: + """Empty-initialize an instance of `nvmlEccBankRemapperStatus_v1_t`. + + + .. seealso:: `nvmlEccBankRemapperStatus_v1_t` + """ + cdef: + nvmlEccBankRemapperStatus_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlEccBankRemapperStatus_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccBankRemapperStatus_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlEccBankRemapperStatus_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.EccBankRemapperStatus_v1 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 EccBankRemapperStatus_v1 other_ + if not isinstance(other, EccBankRemapperStatus_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccBankRemapperStatus_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEccBankRemapperStatus_v1_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 = _cyb_malloc(sizeof(nvmlEccBankRemapperStatus_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EccBankRemapperStatus_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccBankRemapperStatus_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def histogram(self): + """EccBankRemapperHistogram_v1: Bank remapper histogram.""" + return EccBankRemapperHistogram_v1.from_ptr( + &(self._ptr[0].histogram), + readonly=self._readonly, + owner=self, + ) + + @histogram.setter + def histogram(self, val): + if self._readonly: + raise ValueError("This EccBankRemapperStatus_v1 instance is read-only") + cdef EccBankRemapperHistogram_v1 val_ = val + _cyb_memcpy(&(self._ptr[0].histogram), (val_._get_ptr()), sizeof(nvmlEccBankRemapperHistogram_v1_t) * 1) + + @property + def active_remappings(self): + """int: Number of active remappings.""" + return self._ptr[0].activeRemappings + + @active_remappings.setter + def active_remappings(self, val): + if self._readonly: + raise ValueError("This EccBankRemapperStatus_v1 instance is read-only") + self._ptr[0].activeRemappings = val + + @property + def inactive_remappings(self): + """int: Number of inactive remappings.""" + return self._ptr[0].inactiveRemappings + + @inactive_remappings.setter + def inactive_remappings(self, val): + if self._readonly: + raise ValueError("This EccBankRemapperStatus_v1 instance is read-only") + self._ptr[0].inactiveRemappings = val + + @property + def b_pending(self): + """int: Whether there exists any pending bank remapping. 0 for no pending remapping, 1 for pending remapping.""" + return self._ptr[0].bPending + + @b_pending.setter + def b_pending(self, val): + if self._readonly: + raise ValueError("This EccBankRemapperStatus_v1 instance is read-only") + self._ptr[0].bPending = val + + @staticmethod + def from_buffer(buffer): + """Create an EccBankRemapperStatus_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEccBankRemapperStatus_v1_t), EccBankRemapperStatus_v1) + + @staticmethod + def from_data(data): + """Create an EccBankRemapperStatus_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `ecc_bank_remapper_status_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "ecc_bank_remapper_status_v1_dtype", ecc_bank_remapper_status_v1_dtype, EccBankRemapperStatus_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an EccBankRemapperStatus_v1 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 EccBankRemapperStatus_v1 obj = EccBankRemapperStatus_v1.__new__(EccBankRemapperStatus_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlEccBankRemapperStatus_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating EccBankRemapperStatus_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccBankRemapperStatus_v1_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 + return _numpy.dtype({ + 'names': ['version', 'sample_val_type', 'vgpu_instance_count', 'last_seen_time_stamp', 'vgpu_util_array'], + 'formats': [_numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.sampleValType)) - (&pod), + (&(pod.vgpuInstanceCount)) - (&pod), + (&(pod.lastSeenTimeStamp)) - (&pod), + (&(pod.vgpuUtilArray)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), + }) + +vgpu_instances_utilization_info_v1_dtype = _get_vgpu_instances_utilization_info_v1_dtype_offsets() + +cdef class VgpuInstancesUtilizationInfo_v1: + """Empty-initialize an instance of `nvmlVgpuInstancesUtilizationInfo_v1_t`. + + + .. seealso:: `nvmlVgpuInstancesUtilizationInfo_v1_t` + """ + cdef: + nvmlVgpuInstancesUtilizationInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlVgpuInstancesUtilizationInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuInstancesUtilizationInfo_v1 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 VgpuInstancesUtilizationInfo_v1 other_ + if not isinstance(other, VgpuInstancesUtilizationInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_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 = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def version(self): + """int: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + self._ptr[0].version = val + + @property + def sample_val_type(self): + """int: Hold the type of returned sample values.""" + return (self._ptr[0].sampleValType) + + @sample_val_type.setter + def sample_val_type(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + self._ptr[0].sampleValType = val + + @property + def last_seen_time_stamp(self): + """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" + return self._ptr[0].lastSeenTimeStamp + + @last_seen_time_stamp.setter + def last_seen_time_stamp(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + self._ptr[0].lastSeenTimeStamp = val + + @property + def vgpu_util_array(self): + """int: The array (allocated by caller) in which vGPU utilization are returned.""" + if self._ptr[0].vgpuUtilArray == NULL or self._ptr[0].vgpuInstanceCount == 0: + return [] + return VgpuInstanceUtilizationInfo_v1.from_ptr( + (self._ptr[0].vgpuUtilArray), + self._ptr[0].vgpuInstanceCount, + owner=self, + readonly=self._readonly + ) + + @vgpu_util_array.setter + def vgpu_util_array(self, val): + if self._readonly: + raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + cdef VgpuInstanceUtilizationInfo_v1 arr = val + self._ptr[0].vgpuUtilArray = (arr._get_ptr()) + self._ptr[0].vgpuInstanceCount = len(arr) + self._refs["vgpu_util_array"] = arr + + @staticmethod + def from_buffer(buffer): + """Create an VgpuInstancesUtilizationInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), VgpuInstancesUtilizationInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuInstancesUtilizationInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_instances_utilization_info_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_instances_utilization_info_v1_dtype", vgpu_instances_utilization_info_v1_dtype, VgpuInstancesUtilizationInfo_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuInstancesUtilizationInfo_v1 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 VgpuInstancesUtilizationInfo_v1 obj = VgpuInstancesUtilizationInfo_v1.__new__(VgpuInstancesUtilizationInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + obj._owner = None + obj._owned = True + else: + obj._ptr = ptr + obj._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} + return obj + + +cdef _get_prm_counter_v1_dtype_offsets(): + cdef nvmlPRMCounter_v1_t pod + return _numpy.dtype({ + 'names': ['counter_id', 'in_data', 'counter_value'], + 'formats': [_numpy.uint32, prm_counter_input_v1_dtype, prm_counter_value_v1_dtype], + 'offsets': [ + (&(pod.counterId)) - (&pod), + (&(pod.inData)) - (&pod), + (&(pod.counterValue)) - (&pod), + ], + 'itemsize': sizeof(nvmlPRMCounter_v1_t), + }) + +prm_counter_v1_dtype = _get_prm_counter_v1_dtype_offsets() + +cdef class PRMCounter_v1: + """Empty-initialize an array of `nvmlPRMCounter_v1_t`. + The resulting object is of length `size` and of dtype `prm_counter_v1_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlPRMCounter_v1_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=prm_counter_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPRMCounter_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPRMCounter_v1_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.PRMCounter_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PRMCounter_v1 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, PRMCounter_v1)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def counter_id(self): + """Union[~_numpy.uint32, int]: Counter ID, one of `nvmlPRMCounterId_t`.""" + if self._data.size == 1: + return int(self._data.counter_id[0]) + return self._data.counter_id + + @counter_id.setter + def counter_id(self, val): + self._data.counter_id = val + + @property + def in_data(self): + """prm_counter_input_v1_dtype: PRM input values.""" + return self._data.in_data + + @in_data.setter + def in_data(self, val): + self._data.in_data = val + + @property + def counter_value(self): + """prm_counter_value_v1_dtype: Counter value.""" + return self._data.counter_value + + @counter_value.setter + def counter_value(self, val): + self._data.counter_value = 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 PRMCounter_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == prm_counter_v1_dtype: + return PRMCounter_v1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an PRMCounter_v1 instance with the memory from the given buffer.""" + return PRMCounter_v1.from_data(_numpy.frombuffer(buffer, dtype=prm_counter_v1_dtype)) + + @staticmethod + def from_data(data): + """Create an PRMCounter_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `prm_counter_v1_dtype` holding the data. + """ + cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) + 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 != prm_counter_v1_dtype: + raise ValueError("data array must be of dtype prm_counter_v1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PRMCounter_v1 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPRMCounter_v1_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=prm_counter_v1_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_vgpu_scheduler_log_dtype_offsets(): + cdef nvmlVgpuSchedulerLog_t pod + return _numpy.dtype({ + 'names': ['engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'offsets': [ + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + (&(pod.entriesCount)) - (&pod), + (&(pod.logEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), + }) + +vgpu_scheduler_log_dtype = _get_vgpu_scheduler_log_dtype_offsets() + +cdef class VgpuSchedulerLog: + """Empty-initialize an instance of `nvmlVgpuSchedulerLog_t`. + + + .. seealso:: `nvmlVgpuSchedulerLog_t` + """ + cdef: + nvmlVgpuSchedulerLog_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLog_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLog") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerLog_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerLog 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 VgpuSchedulerLog other_ + if not isinstance(other, VgpuSchedulerLog): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLog_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLog_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLog") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLog_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerParams: """ + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + + @property + def log_entries(self): + """VgpuSchedulerLogEntry: """ + return VgpuSchedulerLogEntry.from_ptr( + &(self._ptr[0].logEntries), + 200, + readonly=self._readonly, + owner=self, + ) + + @log_entries.setter + def log_entries(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + cdef VgpuSchedulerLogEntry val_ = val + if len(val) != 200: + raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) + + @property + def engine_id(self): + """int: """ + return self._ptr[0].engineId + + @engine_id.setter + def engine_id(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].engineId = val + + @property + def scheduler_policy(self): + """int: """ + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: """ + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].arrMode = val + + @property + def entries_count(self): + """int: """ + return self._ptr[0].entriesCount + + @entries_count.setter + def entries_count(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLog instance is read-only") + self._ptr[0].entriesCount = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerLog instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLog_t), VgpuSchedulerLog) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerLog instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_scheduler_log_dtype", vgpu_scheduler_log_dtype, VgpuSchedulerLog) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerLog 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 VgpuSchedulerLog obj = VgpuSchedulerLog.__new__(VgpuSchedulerLog) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerLog") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLog_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_get_state_dtype_offsets(): + cdef nvmlVgpuSchedulerGetState_t pod + return _numpy.dtype({ + 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'offsets': [ + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerGetState_t), + }) + +vgpu_scheduler_get_state_dtype = _get_vgpu_scheduler_get_state_dtype_offsets() + +cdef class VgpuSchedulerGetState: + """Empty-initialize an instance of `nvmlVgpuSchedulerGetState_t`. + + + .. seealso:: `nvmlVgpuSchedulerGetState_t` + """ + cdef: + nvmlVgpuSchedulerGetState_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerGetState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerGetState") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerGetState_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerGetState 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 VgpuSchedulerGetState other_ + if not isinstance(other, VgpuSchedulerGetState): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerGetState_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerGetState_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerGetState") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerGetState_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerParams: """ + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerGetState instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + + @property + def scheduler_policy(self): + """int: """ + return self._ptr[0].schedulerPolicy + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerGetState instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: """ + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerGetState instance is read-only") + self._ptr[0].arrMode = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerGetState instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerGetState_t), VgpuSchedulerGetState) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerGetState instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_get_state_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_scheduler_get_state_dtype", vgpu_scheduler_get_state_dtype, VgpuSchedulerGetState) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerGetState 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 VgpuSchedulerGetState obj = VgpuSchedulerGetState.__new__(VgpuSchedulerGetState) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerGetState") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerGetState_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_state_info_v1_dtype_offsets(): + cdef nvmlVgpuSchedulerStateInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), + }) + +vgpu_scheduler_state_info_v1_dtype = _get_vgpu_scheduler_state_info_v1_dtype_offsets() + +cdef class VgpuSchedulerStateInfo_v1: + """Empty-initialize an instance of `nvmlVgpuSchedulerStateInfo_v1_t`. + + + .. seealso:: `nvmlVgpuSchedulerStateInfo_v1_t` + """ + cdef: + nvmlVgpuSchedulerStateInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlVgpuSchedulerStateInfo_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.VgpuSchedulerStateInfo_v1 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_v1 other_ + if not isinstance(other, VgpuSchedulerStateInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) + + @property + def scheduler_params(self): + """VgpuSchedulerParams: OUT: vGPU Scheduler Parameters.""" + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), + readonly=self._readonly, + owner=self, + ) + + @scheduler_params.setter + def scheduler_params(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") + self._ptr[0].version = 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_v1 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_v1 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*.""" + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") + self._ptr[0].arrMode = val + + @staticmethod + def from_buffer(buffer): + """Create an VgpuSchedulerStateInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), VgpuSchedulerStateInfo_v1) + + @staticmethod + def from_data(data): + """Create an VgpuSchedulerStateInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_info_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "vgpu_scheduler_state_info_v1_dtype", vgpu_scheduler_state_info_v1_dtype, VgpuSchedulerStateInfo_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an VgpuSchedulerStateInfo_v1 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_v1 obj = VgpuSchedulerStateInfo_v1.__new__(VgpuSchedulerStateInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_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_info_v1_dtype_offsets(): + cdef nvmlVgpuSchedulerLogInfo_v1_t pod + return _numpy.dtype({ + 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.arrMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + (&(pod.entriesCount)) - (&pod), + (&(pod.logEntries)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), + }) + +vgpu_scheduler_log_info_v1_dtype = _get_vgpu_scheduler_log_info_v1_dtype_offsets() + +cdef class VgpuSchedulerLogInfo_v1: + """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v1_t`. + + + .. seealso:: `nvmlVgpuSchedulerLogInfo_v1_t` + """ + cdef: + nvmlVgpuSchedulerLogInfo_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlNvlinkFirmwareInfo_t *ptr + cdef nvmlVgpuSchedulerLogInfo_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.NvlinkFirmwareInfo object at {hex(id(self))}>" + return f"<{__name__}.VgpuSchedulerLogInfo_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -20702,24 +26189,24 @@ cdef class NvlinkFirmwareInfo: return (self._ptr) def __eq__(self, other): - cdef NvlinkFirmwareInfo other_ - if not isinstance(other, NvlinkFirmwareInfo): + cdef VgpuSchedulerLogInfo_v1 other_ + if not isinstance(other, VgpuSchedulerLogInfo_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkFirmwareInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkFirmwareInfo_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_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 = _cyb_malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareInfo_t)) + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20727,52 +26214,112 @@ cdef class NvlinkFirmwareInfo: setattr(self, key, val) @property - def firmware_version(self): - """NvlinkFirmwareVersion: OUT - NVLINK firmware version.""" - return NvlinkFirmwareVersion.from_ptr( - &(self._ptr[0].firmwareVersion), - 100, + def scheduler_params(self): + """VgpuSchedulerParams: OUT: vGPU Scheduler Parameters.""" + return VgpuSchedulerParams.from_ptr( + &(self._ptr[0].schedulerParams), readonly=self._readonly, owner=self, ) - @firmware_version.setter - def firmware_version(self, val): + @scheduler_params.setter + def scheduler_params(self, val): if self._readonly: - raise ValueError("This NvlinkFirmwareInfo instance is read-only") - cdef NvlinkFirmwareVersion val_ = val - if len(val) != 100: - raise ValueError(f"Expected length { 100 } for field firmware_version, got {len(val)}") - _cyb_memcpy(&(self._ptr[0].firmwareVersion), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareVersion_t) * 100) + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + cdef VgpuSchedulerParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) @property - def num_valid_entries(self): - """int: OUT - Number of valid firmware entries.""" - return self._ptr[0].numValidEntries + def log_entries(self): + """VgpuSchedulerLogEntry: OUT: Structure to store the state and logs of a software runlist.""" + return VgpuSchedulerLogEntry.from_ptr( + &(self._ptr[0].logEntries), + 200, + readonly=self._readonly, + owner=self, + ) - @num_valid_entries.setter - def num_valid_entries(self, val): + @log_entries.setter + def log_entries(self, val): if self._readonly: - raise ValueError("This NvlinkFirmwareInfo instance is read-only") - self._ptr[0].numValidEntries = val + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + cdef VgpuSchedulerLogEntry val_ = val + if len(val) != 200: + raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") + _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + self._ptr[0].version = val + + @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_v1 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_v1 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def arr_mode(self): + """int: OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*.""" + return self._ptr[0].arrMode + + @arr_mode.setter + def arr_mode(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") + self._ptr[0].arrMode = 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_v1 instance is read-only") + self._ptr[0].entriesCount = val @staticmethod def from_buffer(buffer): - """Create an NvlinkFirmwareInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkFirmwareInfo_t), NvlinkFirmwareInfo) + """Create an VgpuSchedulerLogInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), VgpuSchedulerLogInfo_v1) @staticmethod def from_data(data): - """Create an NvlinkFirmwareInfo instance wrapping the given NumPy array. + """Create an VgpuSchedulerLogInfo_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `nvlink_firmware_info_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_info_v1_dtype` holding the data. """ - return _cyb_from_data(data, "nvlink_firmware_info_dtype", nvlink_firmware_info_dtype, NvlinkFirmwareInfo) + return _cyb_from_data(data, "vgpu_scheduler_log_info_v1_dtype", vgpu_scheduler_log_info_v1_dtype, VgpuSchedulerLogInfo_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an NvlinkFirmwareInfo instance wrapping the given pointer. + """Create an VgpuSchedulerLogInfo_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -20781,69 +26328,68 @@ cdef class NvlinkFirmwareInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef NvlinkFirmwareInfo obj = NvlinkFirmwareInfo.__new__(NvlinkFirmwareInfo) + cdef VgpuSchedulerLogInfo_v1 obj = VgpuSchedulerLogInfo_v1.__new__(VgpuSchedulerLogInfo_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareInfo_t)) + raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_vgpu_scheduler_log_info_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v2_t pod +cdef _get_vgpu_scheduler_state_v1_dtype_offsets(): + cdef nvmlVgpuSchedulerState_v1_t pod 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)], + 'names': ['version', 'engine_id', 'scheduler_policy', 'enable_arr_mode', 'scheduler_params'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_set_params_dtype], 'offsets': [ + (&(pod.version)) - (&pod), (&(pod.engineId)) - (&pod), (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), + (&(pod.enableARRMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), + 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), }) -vgpu_scheduler_log_info_v2_dtype = _get_vgpu_scheduler_log_info_v2_dtype_offsets() +vgpu_scheduler_state_v1_dtype = _get_vgpu_scheduler_state_v1_dtype_offsets() -cdef class VgpuSchedulerLogInfo_v2: - """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v2_t`. +cdef class VgpuSchedulerState_v1: + """Empty-initialize an instance of `nvmlVgpuSchedulerState_v1_t`. - .. seealso:: `nvmlVgpuSchedulerLogInfo_v2_t` + .. seealso:: `nvmlVgpuSchedulerState_v1_t` """ cdef: - nvmlVgpuSchedulerLogInfo_v2_t *_ptr + nvmlVgpuSchedulerState_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") + raise MemoryError("Error allocating VgpuSchedulerState_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuSchedulerLogInfo_v2_t *ptr + cdef nvmlVgpuSchedulerState_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.VgpuSchedulerLogInfo_v2 object at {hex(id(self))}>" + return f"<{__name__}.VgpuSchedulerState_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -20857,24 +26403,24 @@ cdef class VgpuSchedulerLogInfo_v2: return (self._ptr) def __eq__(self, other): - cdef VgpuSchedulerLogInfo_v2 other_ - if not isinstance(other, VgpuSchedulerLogInfo_v2): + cdef VgpuSchedulerState_v1 other_ + if not isinstance(other, VgpuSchedulerState_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerState_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLogInfo_v2_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerState_v1_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + raise MemoryError("Error allocating VgpuSchedulerState_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerState_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -20882,96 +26428,82 @@ cdef class VgpuSchedulerLogInfo_v2: 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, + def scheduler_params(self): + """VgpuSchedulerSetParams: IN: vGPU Scheduler Parameters.""" + return VgpuSchedulerSetParams.from_ptr( + &(self._ptr[0].schedulerParams), readonly=self._readonly, owner=self, ) - @log_entries.setter - def log_entries(self, val): + @scheduler_params.setter + def scheduler_params(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)}") - _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_v2_t) * 200) + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") + cdef VgpuSchedulerSetParams val_ = val + _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerSetParams_t) * 1) + + @property + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") + self._ptr[0].version = val @property def engine_id(self): - """int: IN: Engine whose software runlist log entries are fetched. One of One of NVML_VGPU_SCHEDULER_ENGINE_TYPE_*.""" + """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 VgpuSchedulerLogInfo_v2 instance is read-only") + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") self._ptr[0].engineId = val @property def scheduler_policy(self): - """int: OUT: Scheduler policy.""" + """int: IN: 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") + raise ValueError("This VgpuSchedulerState_v1 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. 0 when there is no active scheduling.""" - 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. 0 when there is no active scheduling.""" - 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 + def enable_arr_mode(self): + """int: IN: Adaptive Round Robin scheduler.""" + return self._ptr[0].enableARRMode - @entries_count.setter - def entries_count(self, val): + @enable_arr_mode.setter + def enable_arr_mode(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v2 instance is read-only") - self._ptr[0].entriesCount = val + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") + self._ptr[0].enableARRMode = val @staticmethod def from_buffer(buffer): - """Create an VgpuSchedulerLogInfo_v2 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v2_t), VgpuSchedulerLogInfo_v2) + """Create an VgpuSchedulerState_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerState_v1_t), VgpuSchedulerState_v1) @staticmethod def from_data(data): - """Create an VgpuSchedulerLogInfo_v2 instance wrapping the given NumPy array. + """Create an VgpuSchedulerState_v1 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. + data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_v1_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_log_info_v2_dtype", vgpu_scheduler_log_info_v2_dtype, VgpuSchedulerLogInfo_v2) + return _cyb_from_data(data, "vgpu_scheduler_state_v1_dtype", vgpu_scheduler_state_v1_dtype, VgpuSchedulerState_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerLogInfo_v2 instance wrapping the given pointer. + """Create an VgpuSchedulerState_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -20980,66 +26512,66 @@ cdef class VgpuSchedulerLogInfo_v2: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerLogInfo_v2 obj = VgpuSchedulerLogInfo_v2.__new__(VgpuSchedulerLogInfo_v2) + cdef VgpuSchedulerState_v1 obj = VgpuSchedulerState_v1.__new__(VgpuSchedulerState_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v2") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v2_t)) + raise MemoryError("Error allocating VgpuSchedulerState_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerState_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_get_cper_v1_dtype_offsets(): - cdef nvmlGetCPER_v1_t pod +cdef _get_grid_licensable_features_dtype_offsets(): + cdef nvmlGridLicensableFeatures_t pod return _numpy.dtype({ - 'names': ['cursor', 'buffer', 'buffer_size'], - 'formats': [cper_cursor_v1_dtype, _numpy.intp, _numpy.uint32], + 'names': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], + 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], 'offsets': [ - (&(pod.cursor)) - (&pod), - (&(pod.buffer)) - (&pod), - (&(pod.bufferSize)) - (&pod), + (&(pod.isGridLicenseSupported)) - (&pod), + (&(pod.licensableFeaturesCount)) - (&pod), + (&(pod.gridLicensableFeatures)) - (&pod), ], - 'itemsize': sizeof(nvmlGetCPER_v1_t), + 'itemsize': sizeof(nvmlGridLicensableFeatures_t), }) -get_cper_v1_dtype = _get_get_cper_v1_dtype_offsets() +grid_licensable_features_dtype = _get_grid_licensable_features_dtype_offsets() -cdef class GetCPER_v1: - """Empty-initialize an instance of `nvmlGetCPER_v1_t`. +cdef class GridLicensableFeatures: + """Empty-initialize an instance of `nvmlGridLicensableFeatures_t`. - .. seealso:: `nvmlGetCPER_v1_t` + .. seealso:: `nvmlGridLicensableFeatures_t` """ cdef: - nvmlGetCPER_v1_t *_ptr + nvmlGridLicensableFeatures_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlGetCPER_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGridLicensableFeatures_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GetCPER_v1") + raise MemoryError("Error allocating GridLicensableFeatures") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlGetCPER_v1_t *ptr + cdef nvmlGridLicensableFeatures_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.GetCPER_v1 object at {hex(id(self))}>" + return f"<{__name__}.GridLicensableFeatures object at {hex(id(self))}>" @property def ptr(self): @@ -21053,24 +26585,24 @@ cdef class GetCPER_v1: return (self._ptr) def __eq__(self, other): - cdef GetCPER_v1 other_ - if not isinstance(other, GetCPER_v1): + cdef GridLicensableFeatures other_ + if not isinstance(other, GridLicensableFeatures): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGetCPER_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicensableFeatures_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGetCPER_v1_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGridLicensableFeatures_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 = _cyb_malloc(sizeof(nvmlGetCPER_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GetCPER_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGetCPER_v1_t)) + raise MemoryError("Error allocating GridLicensableFeatures") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicensableFeatures_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -21078,60 +26610,55 @@ cdef class GetCPER_v1: setattr(self, key, val) @property - def cursor(self): - """CPERCursor_v1: [IN/OUT] Query parameters and cursor. See `nvmlCPERCursor_v1_t`""" - return CPERCursor_v1.from_ptr( - &(self._ptr[0].cursor), + def grid_licensable_features(self): + """GridLicensableFeature: """ + return GridLicensableFeature.from_ptr( + &(self._ptr[0].gridLicensableFeatures), + self._ptr[0].licensableFeaturesCount, readonly=self._readonly, owner=self, ) - @cursor.setter - def cursor(self, val): - if self._readonly: - raise ValueError("This GetCPER_v1 instance is read-only") - cdef CPERCursor_v1 val_ = val - _cyb_memcpy(&(self._ptr[0].cursor), (val_._get_ptr()), sizeof(nvmlCPERCursor_v1_t) * 1) - - @property - def buffer(self): - """str: [OUT] Buffer to be filled (allocated by client). May be NULL for size query.""" - return (self._ptr[0].buffer) - - @buffer.setter - def buffer(self, val): + @grid_licensable_features.setter + def grid_licensable_features(self, val): if self._readonly: - raise ValueError("This GetCPER_v1 instance is read-only") - self._ptr[0].buffer = val + raise ValueError("This GridLicensableFeatures instance is read-only") + cdef GridLicensableFeature val_ = val + if len(val) > 3: + raise ValueError(f"Expected length < 3 for field grid_licensable_features, got {len(val)}") + self._ptr[0].licensableFeaturesCount = len(val) + if len(val) == 0: + return + _cyb_memcpy(&(self._ptr[0].gridLicensableFeatures), (val_._get_ptr()), sizeof(nvmlGridLicensableFeature_t) * self._ptr[0].licensableFeaturesCount) @property - def buffer_size(self): - """int: [IN/OUT] Size of `buffer`. Set to 0 with `buffer` NULL to query required size. On return, set to required or used size; 0 means no (more) records.""" - return self._ptr[0].bufferSize + def is_grid_license_supported(self): + """int: """ + return self._ptr[0].isGridLicenseSupported - @buffer_size.setter - def buffer_size(self, val): + @is_grid_license_supported.setter + def is_grid_license_supported(self, val): if self._readonly: - raise ValueError("This GetCPER_v1 instance is read-only") - self._ptr[0].bufferSize = val + raise ValueError("This GridLicensableFeatures instance is read-only") + self._ptr[0].isGridLicenseSupported = val @staticmethod def from_buffer(buffer): - """Create an GetCPER_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlGetCPER_v1_t), GetCPER_v1) + """Create an GridLicensableFeatures instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGridLicensableFeatures_t), GridLicensableFeatures) @staticmethod def from_data(data): - """Create an GetCPER_v1 instance wrapping the given NumPy array. + """Create an GridLicensableFeatures instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `get_cper_v1_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `grid_licensable_features_dtype` holding the data. """ - return _cyb_from_data(data, "get_cper_v1_dtype", get_cper_v1_dtype, GetCPER_v1) + return _cyb_from_data(data, "grid_licensable_features_dtype", grid_licensable_features_dtype, GridLicensableFeatures) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an GetCPER_v1 instance wrapping the given pointer. + """Create an GridLicensableFeatures instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -21140,70 +26667,66 @@ cdef class GetCPER_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GetCPER_v1 obj = GetCPER_v1.__new__(GetCPER_v1) + cdef GridLicensableFeatures obj = GridLicensableFeatures.__new__(GridLicensableFeatures) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlGetCPER_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating GetCPER_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGetCPER_v1_t)) + raise MemoryError("Error allocating GridLicensableFeatures") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGridLicensableFeatures_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + 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 +cdef _get_nv_link_info_v2_dtype_offsets(): + cdef nvmlNvLinkInfo_v2_t pod return _numpy.dtype({ - 'names': ['version', 'sample_val_type', 'vgpu_instance_count', 'last_seen_time_stamp', 'vgpu_util_array'], - 'formats': [_numpy.uint32, _numpy.int32, _numpy.uint32, _numpy.uint64, _numpy.intp], + 'names': ['version', 'is_nvle_enabled', 'firmware_info'], + 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], 'offsets': [ (&(pod.version)) - (&pod), - (&(pod.sampleValType)) - (&pod), - (&(pod.vgpuInstanceCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.vgpuUtilArray)) - (&pod), + (&(pod.isNvleEnabled)) - (&pod), + (&(pod.firmwareInfo)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), + 'itemsize': sizeof(nvmlNvLinkInfo_v2_t), }) -vgpu_instances_utilization_info_v1_dtype = _get_vgpu_instances_utilization_info_v1_dtype_offsets() +nv_link_info_v2_dtype = _get_nv_link_info_v2_dtype_offsets() -cdef class VgpuInstancesUtilizationInfo_v1: - """Empty-initialize an instance of `nvmlVgpuInstancesUtilizationInfo_v1_t`. +cdef class NvLinkInfo_v2: + """Empty-initialize an instance of `nvmlNvLinkInfo_v2_t`. - .. seealso:: `nvmlVgpuInstancesUtilizationInfo_v1_t` + .. seealso:: `nvmlNvLinkInfo_v2_t` """ cdef: - nvmlVgpuInstancesUtilizationInfo_v1_t *_ptr + nvmlNvLinkInfo_v2_t *_ptr object _owner bint _owned bint _readonly - dict _refs def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v2_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") + raise MemoryError("Error allocating NvLinkInfo_v2") self._owner = None self._owned = True self._readonly = False - self._refs = {} def __dealloc__(self): - cdef nvmlVgpuInstancesUtilizationInfo_v1_t *ptr + cdef nvmlNvLinkInfo_v2_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.VgpuInstancesUtilizationInfo_v1 object at {hex(id(self))}>" + return f"<{__name__}.NvLinkInfo_v2 object at {hex(id(self))}>" @property def ptr(self): @@ -21217,101 +26740,85 @@ cdef class VgpuInstancesUtilizationInfo_v1: return (self._ptr) def __eq__(self, other): - cdef VgpuInstancesUtilizationInfo_v1 other_ - if not isinstance(other, VgpuInstancesUtilizationInfo_v1): + cdef NvLinkInfo_v2 other_ + if not isinstance(other, NvLinkInfo_v2): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v2_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvLinkInfo_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 = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + raise MemoryError("Error allocating NvLinkInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable else: setattr(self, key, val) + @property + def firmware_info(self): + """NvlinkFirmwareInfo: OUT - NVLINK Firmware info.""" + return NvlinkFirmwareInfo.from_ptr( + &(self._ptr[0].firmwareInfo), + readonly=self._readonly, + owner=self, + ) + + @firmware_info.setter + def firmware_info(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v2 instance is read-only") + cdef NvlinkFirmwareInfo val_ = val + _cyb_memcpy(&(self._ptr[0].firmwareInfo), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareInfo_t) * 1) + @property def version(self): - """int: The version number of this struct.""" + """int: IN - the API version number.""" return self._ptr[0].version @version.setter def version(self, val): if self._readonly: - raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") + raise ValueError("This NvLinkInfo_v2 instance is read-only") self._ptr[0].version = val @property - def sample_val_type(self): - """int: Hold the type of returned sample values.""" - return (self._ptr[0].sampleValType) - - @sample_val_type.setter - def sample_val_type(self, val): - if self._readonly: - raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") - self._ptr[0].sampleValType = val - - @property - def last_seen_time_stamp(self): - """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" - return self._ptr[0].lastSeenTimeStamp - - @last_seen_time_stamp.setter - def last_seen_time_stamp(self, val): - if self._readonly: - raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") - self._ptr[0].lastSeenTimeStamp = val - - @property - def vgpu_util_array(self): - """int: The array (allocated by caller) in which vGPU utilization are returned.""" - if self._ptr[0].vgpuUtilArray == NULL or self._ptr[0].vgpuInstanceCount == 0: - return [] - return VgpuInstanceUtilizationInfo_v1.from_ptr( - (self._ptr[0].vgpuUtilArray), - self._ptr[0].vgpuInstanceCount, - owner=self, - readonly=self._readonly - ) + def is_nvle_enabled(self): + """int: OUT - NVLINK encryption enablement.""" + return self._ptr[0].isNvleEnabled - @vgpu_util_array.setter - def vgpu_util_array(self, val): + @is_nvle_enabled.setter + def is_nvle_enabled(self, val): if self._readonly: - raise ValueError("This VgpuInstancesUtilizationInfo_v1 instance is read-only") - cdef VgpuInstanceUtilizationInfo_v1 arr = val - self._ptr[0].vgpuUtilArray = (arr._get_ptr()) - self._ptr[0].vgpuInstanceCount = len(arr) - self._refs["vgpu_util_array"] = arr + raise ValueError("This NvLinkInfo_v2 instance is read-only") + self._ptr[0].isNvleEnabled = val @staticmethod def from_buffer(buffer): - """Create an VgpuInstancesUtilizationInfo_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t), VgpuInstancesUtilizationInfo_v1) + """Create an NvLinkInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvLinkInfo_v2_t), NvLinkInfo_v2) @staticmethod def from_data(data): - """Create an VgpuInstancesUtilizationInfo_v1 instance wrapping the given NumPy array. + """Create an NvLinkInfo_v2 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_instances_utilization_info_v1_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `nv_link_info_v2_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_instances_utilization_info_v1_dtype", vgpu_instances_utilization_info_v1_dtype, VgpuInstancesUtilizationInfo_v1) + return _cyb_from_data(data, "nv_link_info_v2_dtype", nv_link_info_v2_dtype, NvLinkInfo_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuInstancesUtilizationInfo_v1 instance wrapping the given pointer. + """Create an NvLinkInfo_v2 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -21320,63 +26827,64 @@ cdef class VgpuInstancesUtilizationInfo_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuInstancesUtilizationInfo_v1 obj = VgpuInstancesUtilizationInfo_v1.__new__(VgpuInstancesUtilizationInfo_v1) + cdef NvLinkInfo_v2 obj = NvLinkInfo_v2.__new__(NvLinkInfo_v2) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuInstancesUtilizationInfo_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuInstancesUtilizationInfo_v1_t)) + raise MemoryError("Error allocating NvLinkInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v2_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly - obj._refs = {} return obj -cdef _get_prm_counter_v1_dtype_offsets(): - cdef nvmlPRMCounter_v1_t pod +cdef _get_pwr_model_metrics_dlppm1x_dtype_offsets(): + cdef nvmlPwrModelMetricsDlppm1x_t pod return _numpy.dtype({ - 'names': ['counter_id', 'in_data', 'counter_value'], - 'formats': [_numpy.uint32, prm_counter_input_v1_dtype, prm_counter_value_v1_dtype], + 'names': ['b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], + 'formats': [_numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], 'offsets': [ - (&(pod.counterId)) - (&pod), - (&(pod.inData)) - (&pod), - (&(pod.counterValue)) - (&pod), + (&(pod.bValid)) - (&pod), + (&(pod.coreRail)) - (&pod), + (&(pod.fbRail)) - (&pod), + (&(pod.tgpPwrTuple)) - (&pod), + (&(pod.perfMetrics)) - (&pod), ], - 'itemsize': sizeof(nvmlPRMCounter_v1_t), + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1x_t), }) -prm_counter_v1_dtype = _get_prm_counter_v1_dtype_offsets() +pwr_model_metrics_dlppm1x_dtype = _get_pwr_model_metrics_dlppm1x_dtype_offsets() -cdef class PRMCounter_v1: - """Empty-initialize an array of `nvmlPRMCounter_v1_t`. - The resulting object is of length `size` and of dtype `prm_counter_v1_dtype`. +cdef class PwrModelMetricsDlppm1x: + """Empty-initialize an array of `nvmlPwrModelMetricsDlppm1x_t`. + The resulting object is of length `size` and of dtype `pwr_model_metrics_dlppm1x_dtype`. If default-constructed, the instance represents a single struct. Args: size (int): number of structs, default=1. - .. seealso:: `nvmlPRMCounter_v1_t` + .. seealso:: `nvmlPwrModelMetricsDlppm1x_t` """ cdef: readonly object _data object _owner def __init__(self, size=1): - arr = _numpy.empty(size, dtype=prm_counter_v1_dtype) + arr = _numpy.empty(size, dtype=pwr_model_metrics_dlppm1x_dtype) self._data = arr.view(_numpy.recarray) - assert self._data.itemsize == sizeof(nvmlPRMCounter_v1_t), \ - f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPRMCounter_v1_t) }" + assert self._data.itemsize == sizeof(nvmlPwrModelMetricsDlppm1x_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelMetricsDlppm1x_t) }" def __repr__(self): if self._data.size > 1: - return f"<{__name__}.PRMCounter_v1_Array_{self._data.size} object at {hex(id(self))}>" + return f"<{__name__}.PwrModelMetricsDlppm1x_Array_{self._data.size} object at {hex(id(self))}>" else: - return f"<{__name__}.PRMCounter_v1 object at {hex(id(self))}>" + return f"<{__name__}.PwrModelMetricsDlppm1x object at {hex(id(self))}>" @property def ptr(self): @@ -21397,7 +26905,7 @@ cdef class PRMCounter_v1: def __eq__(self, other): cdef object self_data = self._data - if (not isinstance(other, PRMCounter_v1)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + if (not isinstance(other, PwrModelMetricsDlppm1x)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False return bool((self_data == other._data).all()) @@ -21408,33 +26916,51 @@ cdef class PRMCounter_v1: _cyb_cpython.PyBuffer_Release(buffer) @property - def counter_id(self): - """Union[~_numpy.uint32, int]: Counter ID, one of `nvmlPRMCounterId_t`.""" + def b_valid(self): + """Union[~_numpy.uint8, int]: Validity flag: non-zero if metrics are valid.""" if self._data.size == 1: - return int(self._data.counter_id[0]) - return self._data.counter_id + return int(self._data.b_valid[0]) + return self._data.b_valid - @counter_id.setter - def counter_id(self, val): - self._data.counter_id = val + @b_valid.setter + def b_valid(self, val): + self._data.b_valid = val @property - def in_data(self): - """prm_counter_input_v1_dtype: PRM input values.""" - return self._data.in_data + def core_rail(self): + """core_rail_metrics_dtype: Core rail metrics.""" + return self._data.core_rail - @in_data.setter - def in_data(self, val): - self._data.in_data = val + @core_rail.setter + def core_rail(self, val): + self._data.core_rail = val @property - def counter_value(self): - """prm_counter_value_v1_dtype: Counter value.""" - return self._data.counter_value + def fb_rail(self): + """rail_metrics_dtype: Fb rail metrics.""" + return self._data.fb_rail - @counter_value.setter - def counter_value(self, val): - self._data.counter_value = val + @fb_rail.setter + def fb_rail(self, val): + self._data.fb_rail = val + + @property + def tgp_pwr_tuple(self): + """pmgr_pwr_tuple_dtype: Total Graphics Power (TGP) in milliwatts.""" + return self._data.tgp_pwr_tuple + + @tgp_pwr_tuple.setter + def tgp_pwr_tuple(self, val): + self._data.tgp_pwr_tuple = val + + @property + def perf_metrics(self): + """pwr_model_metrics_dlppm1x_perf_dtype: Performance metrics.""" + return self._data.perf_metrics + + @perf_metrics.setter + def perf_metrics(self, val): + self._data.perf_metrics = val def __getitem__(self, key): cdef ssize_t key_ @@ -21446,10 +26972,10 @@ cdef class PRMCounter_v1: raise IndexError("index is out of bounds") if key_ < 0: key_ += size - return PRMCounter_v1.from_data(self._data[key_:key_+1]) + return PwrModelMetricsDlppm1x.from_data(self._data[key_:key_+1]) out = self._data[key] - if isinstance(out, _numpy.recarray) and out.dtype == prm_counter_v1_dtype: - return PRMCounter_v1.from_data(out) + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_metrics_dlppm1x_dtype: + return PwrModelMetricsDlppm1x.from_data(out) return out def __setitem__(self, key, val): @@ -21457,30 +26983,30 @@ cdef class PRMCounter_v1: @staticmethod def from_buffer(buffer): - """Create an PRMCounter_v1 instance with the memory from the given buffer.""" - return PRMCounter_v1.from_data(_numpy.frombuffer(buffer, dtype=prm_counter_v1_dtype)) + """Create an PwrModelMetricsDlppm1x instance with the memory from the given buffer.""" + return PwrModelMetricsDlppm1x.from_data(_numpy.frombuffer(buffer, dtype=pwr_model_metrics_dlppm1x_dtype)) @staticmethod def from_data(data): - """Create an PRMCounter_v1 instance wrapping the given NumPy array. + """Create an PwrModelMetricsDlppm1x instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a 1D array of dtype `prm_counter_v1_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `pwr_model_metrics_dlppm1x_dtype` holding the data. """ - cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) + cdef PwrModelMetricsDlppm1x obj = PwrModelMetricsDlppm1x.__new__(PwrModelMetricsDlppm1x) 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 != prm_counter_v1_dtype: - raise ValueError("data array must be of dtype prm_counter_v1_dtype") + if data.dtype != pwr_model_metrics_dlppm1x_dtype: + raise ValueError("data array must be of dtype pwr_model_metrics_dlppm1x_dtype") obj._data = data.view(_numpy.recarray) return obj @staticmethod def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): - """Create an PRMCounter_v1 instance wrapping the given pointer. + """Create an PwrModelMetricsDlppm1x instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -21491,827 +27017,698 @@ cdef class PRMCounter_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) + cdef PwrModelMetricsDlppm1x obj = PwrModelMetricsDlppm1x.__new__(PwrModelMetricsDlppm1x) cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( - ptr, sizeof(nvmlPRMCounter_v1_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=prm_counter_v1_dtype) + ptr, sizeof(nvmlPwrModelMetricsDlppm1x_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=pwr_model_metrics_dlppm1x_dtype) obj._data = data.view(_numpy.recarray) obj._owner = owner return obj -cdef _get_vgpu_scheduler_log_dtype_offsets(): - cdef nvmlVgpuSchedulerLog_t pod +cdef _get_perf_metrics_pfpp1x_sample_dtype_offsets(): + cdef nvmlPerfMetricsPfpp1xSample_t pod return _numpy.dtype({ - 'names': ['engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'names': ['estimated_metrics'], + 'formats': [pwr_model_metrics_pfpp1x_dtype], 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), + (&(pod.estimatedMetrics)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), + 'itemsize': sizeof(nvmlPerfMetricsPfpp1xSample_t), }) -vgpu_scheduler_log_dtype = _get_vgpu_scheduler_log_dtype_offsets() +perf_metrics_pfpp1x_sample_dtype = _get_perf_metrics_pfpp1x_sample_dtype_offsets() -cdef class VgpuSchedulerLog: - """Empty-initialize an instance of `nvmlVgpuSchedulerLog_t`. +cdef class PerfMetricsPfpp1xSample: + """Empty-initialize an array of `nvmlPerfMetricsPfpp1xSample_t`. + The resulting object is of length `size` and of dtype `perf_metrics_pfpp1x_sample_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuSchedulerLog_t` + .. seealso:: `nvmlPerfMetricsPfpp1xSample_t` """ cdef: - nvmlVgpuSchedulerLog_t *_ptr - object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLog_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLog") - self._owner = None - self._owned = True - self._readonly = False - - def __dealloc__(self): - cdef nvmlVgpuSchedulerLog_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) - - def __repr__(self): - return f"<{__name__}.VgpuSchedulerLog 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 VgpuSchedulerLog other_ - if not isinstance(other, VgpuSchedulerLog): - return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLog_t)) == 0) - - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLog_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 = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLog") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLog_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + readonly object _data + object _owner - @property - def scheduler_params(self): - """VgpuSchedulerParams: """ - return VgpuSchedulerParams.from_ptr( - &(self._ptr[0].schedulerParams), - readonly=self._readonly, - owner=self, - ) + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=perf_metrics_pfpp1x_sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPerfMetricsPfpp1xSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPerfMetricsPfpp1xSample_t) }" - @scheduler_params.setter - def scheduler_params(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLog instance is read-only") - cdef VgpuSchedulerParams val_ = val - _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.PerfMetricsPfpp1xSample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PerfMetricsPfpp1xSample object at {hex(id(self))}>" @property - def log_entries(self): - """VgpuSchedulerLogEntry: """ - return VgpuSchedulerLogEntry.from_ptr( - &(self._ptr[0].logEntries), - 200, - readonly=self._readonly, - owner=self, - ) + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return self._data.ctypes.data - @log_entries.setter - def log_entries(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLog instance is read-only") - cdef VgpuSchedulerLogEntry val_ = val - if len(val) != 200: - raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") - _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) + cdef intptr_t _get_ptr(self): + return self._data.ctypes.data - @property - def engine_id(self): - """int: """ - return self._ptr[0].engineId + 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 - @engine_id.setter - def engine_id(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLog instance is read-only") - self._ptr[0].engineId = val + def __len__(self): + return self._data.size - @property - def scheduler_policy(self): - """int: """ - return self._ptr[0].schedulerPolicy + def __eq__(self, other): + cdef object self_data = self._data + if (not isinstance(other, PerfMetricsPfpp1xSample)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: + return False + return bool((self_data == other._data).all()) - @scheduler_policy.setter - def scheduler_policy(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLog instance is read-only") - self._ptr[0].schedulerPolicy = val + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) @property - def arr_mode(self): - """int: """ - return self._ptr[0].arrMode + def estimated_metrics(self): + """pwr_model_metrics_pfpp1x_dtype: Estimated metrics from the PFPP 1x controller.""" + return self._data.estimated_metrics - @arr_mode.setter - def arr_mode(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLog instance is read-only") - self._ptr[0].arrMode = val + @estimated_metrics.setter + def estimated_metrics(self, val): + self._data.estimated_metrics = val - @property - def entries_count(self): - """int: """ - return self._ptr[0].entriesCount + 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 PerfMetricsPfpp1xSample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == perf_metrics_pfpp1x_sample_dtype: + return PerfMetricsPfpp1xSample.from_data(out) + return out - @entries_count.setter - def entries_count(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLog instance is read-only") - self._ptr[0].entriesCount = val + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an VgpuSchedulerLog instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLog_t), VgpuSchedulerLog) + """Create an PerfMetricsPfpp1xSample instance with the memory from the given buffer.""" + return PerfMetricsPfpp1xSample.from_data(_numpy.frombuffer(buffer, dtype=perf_metrics_pfpp1x_sample_dtype)) @staticmethod def from_data(data): - """Create an VgpuSchedulerLog instance wrapping the given NumPy array. + """Create an PerfMetricsPfpp1xSample instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `perf_metrics_pfpp1x_sample_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_log_dtype", vgpu_scheduler_log_dtype, VgpuSchedulerLog) + cdef PerfMetricsPfpp1xSample obj = PerfMetricsPfpp1xSample.__new__(PerfMetricsPfpp1xSample) + 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 != perf_metrics_pfpp1x_sample_dtype: + raise ValueError("data array must be of dtype perf_metrics_pfpp1x_sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerLog instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PerfMetricsPfpp1xSample 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. + size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerLog obj = VgpuSchedulerLog.__new__(VgpuSchedulerLog) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLog_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLog") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLog_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + cdef PerfMetricsPfpp1xSample obj = PerfMetricsPfpp1xSample.__new__(PerfMetricsPfpp1xSample) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPerfMetricsPfpp1xSample_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=perf_metrics_pfpp1x_sample_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj -cdef _get_vgpu_scheduler_get_state_dtype_offsets(): - cdef nvmlVgpuSchedulerGetState_t pod +cdef _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets(): + cdef nvmlPwrModelMetricsDlppm1xDramclkEstimates_t pod return _numpy.dtype({ - 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'names': ['estimated_metrics', 'num_estimated_metrics'], + 'formats': [(pwr_model_metrics_dlppm1x_dtype, 8), _numpy.uint8], 'offsets': [ - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), + (&(pod.estimatedMetrics)) - (&pod), + (&(pod.numEstimatedMetrics)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerGetState_t), + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t), }) -vgpu_scheduler_get_state_dtype = _get_vgpu_scheduler_get_state_dtype_offsets() +pwr_model_metrics_dlppm1x_dramclk_estimates_dtype = _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets() -cdef class VgpuSchedulerGetState: - """Empty-initialize an instance of `nvmlVgpuSchedulerGetState_t`. +cdef class PwrModelMetricsDlppm1xDramclkEstimates: + """Empty-initialize an array of `nvmlPwrModelMetricsDlppm1xDramclkEstimates_t`. + The resulting object is of length `size` and of dtype `pwr_model_metrics_dlppm1x_dramclk_estimates_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuSchedulerGetState_t` + .. seealso:: `nvmlPwrModelMetricsDlppm1xDramclkEstimates_t` """ cdef: - nvmlVgpuSchedulerGetState_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerGetState_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerGetState") - self._owner = None - self._owned = True - self._readonly = False + readonly tuple _estimated_metrics - def __dealloc__(self): - cdef nvmlVgpuSchedulerGetState_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=pwr_model_metrics_dlppm1x_dramclk_estimates_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t) }" def __repr__(self): - return f"<{__name__}.VgpuSchedulerGetState object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PwrModelMetricsDlppm1xDramclkEstimates_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PwrModelMetricsDlppm1xDramclkEstimates object at {hex(id(self))}>" @property def ptr(self): """Get the pointer address to the data as Python :class:`int`.""" - return (self._ptr) + return self._data.ctypes.data cdef intptr_t _get_ptr(self): - return (self._ptr) + return self._data.ctypes.data def __int__(self): - return (self._ptr) + 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 VgpuSchedulerGetState other_ - if not isinstance(other, VgpuSchedulerGetState): + cdef object self_data = self._data + if (not isinstance(other, PwrModelMetricsDlppm1xDramclkEstimates)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerGetState_t)) == 0) + return bool((self_data == other._data).all()) - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerGetState_t), self._readonly) + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - pass - - def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerGetState") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerGetState_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) - - @property - def scheduler_params(self): - """VgpuSchedulerParams: """ - return VgpuSchedulerParams.from_ptr( - &(self._ptr[0].schedulerParams), - readonly=self._readonly, - owner=self, - ) - - @scheduler_params.setter - def scheduler_params(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerGetState instance is read-only") - cdef VgpuSchedulerParams val_ = val - _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + _cyb_cpython.PyBuffer_Release(buffer) @property - def scheduler_policy(self): - """int: """ - return self._ptr[0].schedulerPolicy - - @scheduler_policy.setter - def scheduler_policy(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerGetState instance is read-only") - self._ptr[0].schedulerPolicy = val + def estimated_metrics(self): + """PwrModelMetricsDlppm1x: Array of estimated metrics for each inference loop.""" + if self._data.size == 1: + return self._estimated_metrics[0] + return self._estimated_metrics - @property - def arr_mode(self): - """int: """ - return self._ptr[0].arrMode + 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 PwrModelMetricsDlppm1xDramclkEstimates.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_metrics_dlppm1x_dramclk_estimates_dtype: + return PwrModelMetricsDlppm1xDramclkEstimates.from_data(out) + return out - @arr_mode.setter - def arr_mode(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerGetState instance is read-only") - self._ptr[0].arrMode = val + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an VgpuSchedulerGetState instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerGetState_t), VgpuSchedulerGetState) + """Create an PwrModelMetricsDlppm1xDramclkEstimates instance with the memory from the given buffer.""" + return PwrModelMetricsDlppm1xDramclkEstimates.from_data(_numpy.frombuffer(buffer, dtype=pwr_model_metrics_dlppm1x_dramclk_estimates_dtype)) @staticmethod def from_data(data): - """Create an VgpuSchedulerGetState instance wrapping the given NumPy array. + """Create an PwrModelMetricsDlppm1xDramclkEstimates instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_get_state_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `pwr_model_metrics_dlppm1x_dramclk_estimates_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_get_state_dtype", vgpu_scheduler_get_state_dtype, VgpuSchedulerGetState) + cdef PwrModelMetricsDlppm1xDramclkEstimates obj = PwrModelMetricsDlppm1xDramclkEstimates.__new__(PwrModelMetricsDlppm1xDramclkEstimates) + 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 != pwr_model_metrics_dlppm1x_dramclk_estimates_dtype: + raise ValueError("data array must be of dtype pwr_model_metrics_dlppm1x_dramclk_estimates_dtype") + obj._data = data.view(_numpy.recarray) + + estimatedMetrics_list = list() + for i in range(obj._data.size): + addr = obj._data.estimatedMetrics[i].__array_interface__['data'][0] + n = int(obj._data.num_estimated_metrics[i]) + estimatedMetrics_obj = PwrModelMetricsDlppm1x.from_ptr(addr, n, owner=obj, readonly=False) + estimatedMetrics_list.append(estimatedMetrics_obj) + obj._estimatedMetrics = tuple(estimatedMetrics_list) + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerGetState instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PwrModelMetricsDlppm1xDramclkEstimates 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. + size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerGetState obj = VgpuSchedulerGetState.__new__(VgpuSchedulerGetState) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerGetState_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerGetState") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerGetState_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + cdef PwrModelMetricsDlppm1xDramclkEstimates obj = PwrModelMetricsDlppm1xDramclkEstimates.__new__(PwrModelMetricsDlppm1xDramclkEstimates) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=pwr_model_metrics_dlppm1x_dramclk_estimates_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + estimatedMetrics_list = list() + for i in range(obj._data.size): + addr = obj._data.estimatedMetrics[i].__array_interface__['data'][0] + n = int(obj._data.num_estimated_metrics[i]) + estimatedMetrics_obj = PwrModelMetricsDlppm1x.from_ptr(addr, n, owner=obj, readonly=readonly) + estimatedMetrics_list.append(estimatedMetrics_obj) + obj._estimatedMetrics = tuple(estimatedMetrics_list) return obj -cdef _get_vgpu_scheduler_state_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerStateInfo_v1_t pod +cdef _get_observed_metrics_dtype_offsets(): + cdef nvmlObservedMetrics_t pod return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'names': ['initial_dramclk_est', 'b_valid', 'core_rail', 'fb_rail', 'tgp_pwr_tuple', 'perf_metrics'], + 'formats': [(pwr_model_metrics_dlppm1x_dramclk_estimates_dtype, 3), _numpy.uint8, core_rail_metrics_dtype, rail_metrics_dtype, pmgr_pwr_tuple_dtype, pwr_model_metrics_dlppm1x_perf_dtype], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), + (&(pod.initialDramclkEst)) - (&pod), + (&(pod.bValid)) - (&pod), + (&(pod.coreRail)) - (&pod), + (&(pod.fbRail)) - (&pod), + (&(pod.tgpPwrTuple)) - (&pod), + (&(pod.perfMetrics)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), + 'itemsize': sizeof(nvmlObservedMetrics_t), }) -vgpu_scheduler_state_info_v1_dtype = _get_vgpu_scheduler_state_info_v1_dtype_offsets() +observed_metrics_dtype = _get_observed_metrics_dtype_offsets() -cdef class VgpuSchedulerStateInfo_v1: - """Empty-initialize an instance of `nvmlVgpuSchedulerStateInfo_v1_t`. +cdef class ObservedMetrics: + """Empty-initialize an array of `nvmlObservedMetrics_t`. + The resulting object is of length `size` and of dtype `observed_metrics_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuSchedulerStateInfo_v1_t` + .. seealso:: `nvmlObservedMetrics_t` """ cdef: - nvmlVgpuSchedulerStateInfo_v1_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") - self._owner = None - self._owned = True - self._readonly = False - def __dealloc__(self): - cdef nvmlVgpuSchedulerStateInfo_v1_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=observed_metrics_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlObservedMetrics_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlObservedMetrics_t) }" def __repr__(self): - return f"<{__name__}.VgpuSchedulerStateInfo_v1 object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.ObservedMetrics_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.ObservedMetrics object at {hex(id(self))}>" @property def ptr(self): """Get the pointer address to the data as Python :class:`int`.""" - return (self._ptr) + return self._data.ctypes.data cdef intptr_t _get_ptr(self): - return (self._ptr) + return self._data.ctypes.data def __int__(self): - return (self._ptr) + 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 VgpuSchedulerStateInfo_v1 other_ - if not isinstance(other, VgpuSchedulerStateInfo_v1): + cdef object self_data = self._data + if (not isinstance(other, ObservedMetrics)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) == 0) + return bool((self_data == other._data).all()) - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), self._readonly) + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - pass + _cyb_cpython.PyBuffer_Release(buffer) - def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + @property + def initial_dramclk_est(self): + """pwr_model_metrics_dlppm1x_dramclk_estimates_dtype: (array of length 3).Initial DRAMCLK estimates for different scenarios.""" + return self._data.initial_dramclk_est + + @initial_dramclk_est.setter + def initial_dramclk_est(self, val): + self._data.initial_dramclk_est = val @property - def scheduler_params(self): - """VgpuSchedulerParams: OUT: vGPU Scheduler Parameters.""" - return VgpuSchedulerParams.from_ptr( - &(self._ptr[0].schedulerParams), - readonly=self._readonly, - owner=self, - ) + def b_valid(self): + """Union[~_numpy.uint8, int]: Validity flag: non-zero if observed metrics are valid.""" + if self._data.size == 1: + return int(self._data.b_valid[0]) + return self._data.b_valid - @scheduler_params.setter - def scheduler_params(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") - cdef VgpuSchedulerParams val_ = val - _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) + @b_valid.setter + def b_valid(self, val): + self._data.b_valid = val @property - def version(self): - """int: IN: The version number of this struct.""" - return self._ptr[0].version + def core_rail(self): + """core_rail_metrics_dtype: Observed core rail metrics.""" + return self._data.core_rail - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") - self._ptr[0].version = val + @core_rail.setter + def core_rail(self, val): + self._data.core_rail = 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 + def fb_rail(self): + """rail_metrics_dtype: Observed fb rail metrics.""" + return self._data.fb_rail - @engine_id.setter - def engine_id(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") - self._ptr[0].engineId = val + @fb_rail.setter + def fb_rail(self, val): + self._data.fb_rail = val @property - def scheduler_policy(self): - """int: OUT: Scheduler policy.""" - return self._ptr[0].schedulerPolicy + def tgp_pwr_tuple(self): + """pmgr_pwr_tuple_dtype: Observed Total Graphics Power (TGP) in milliwatts.""" + return self._data.tgp_pwr_tuple - @scheduler_policy.setter - def scheduler_policy(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") - self._ptr[0].schedulerPolicy = val + @tgp_pwr_tuple.setter + def tgp_pwr_tuple(self, val): + self._data.tgp_pwr_tuple = val @property - def arr_mode(self): - """int: OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*.""" - return self._ptr[0].arrMode + def perf_metrics(self): + """pwr_model_metrics_dlppm1x_perf_dtype: Observed performance metrics.""" + return self._data.perf_metrics - @arr_mode.setter - def arr_mode(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerStateInfo_v1 instance is read-only") - self._ptr[0].arrMode = val + @perf_metrics.setter + def perf_metrics(self, val): + self._data.perf_metrics = 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 ObservedMetrics.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == observed_metrics_dtype: + return ObservedMetrics.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an VgpuSchedulerStateInfo_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerStateInfo_v1_t), VgpuSchedulerStateInfo_v1) + """Create an ObservedMetrics instance with the memory from the given buffer.""" + return ObservedMetrics.from_data(_numpy.frombuffer(buffer, dtype=observed_metrics_dtype)) @staticmethod def from_data(data): - """Create an VgpuSchedulerStateInfo_v1 instance wrapping the given NumPy array. + """Create an ObservedMetrics instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_info_v1_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `observed_metrics_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_state_info_v1_dtype", vgpu_scheduler_state_info_v1_dtype, VgpuSchedulerStateInfo_v1) + cdef ObservedMetrics obj = ObservedMetrics.__new__(ObservedMetrics) + 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 != observed_metrics_dtype: + raise ValueError("data array must be of dtype observed_metrics_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerStateInfo_v1 instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an ObservedMetrics 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. + size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerStateInfo_v1 obj = VgpuSchedulerStateInfo_v1.__new__(VgpuSchedulerStateInfo_v1) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerStateInfo_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerStateInfo_v1_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + cdef ObservedMetrics obj = ObservedMetrics.__new__(ObservedMetrics) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlObservedMetrics_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=observed_metrics_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj -cdef _get_vgpu_scheduler_log_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v1_t pod +cdef _get_perf_metrics_dlppc2x_sample_dtype_offsets(): + cdef nvmlPerfMetricsDlppc2xSample_t pod return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'arr_mode', 'scheduler_params', 'entries_count', 'log_entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype, _numpy.uint32, (vgpu_scheduler_log_entry_dtype, 200)], + 'names': ['observed_metrics'], + 'formats': [observed_metrics_dtype], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), + (&(pod.observedMetrics)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), + 'itemsize': sizeof(nvmlPerfMetricsDlppc2xSample_t), }) -vgpu_scheduler_log_info_v1_dtype = _get_vgpu_scheduler_log_info_v1_dtype_offsets() - -cdef class VgpuSchedulerLogInfo_v1: - """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v1_t`. - +perf_metrics_dlppc2x_sample_dtype = _get_perf_metrics_dlppc2x_sample_dtype_offsets() - .. seealso:: `nvmlVgpuSchedulerLogInfo_v1_t` - """ - cdef: - nvmlVgpuSchedulerLogInfo_v1_t *_ptr - object _owner - bint _owned - bint _readonly +cdef class PerfMetricsDlppc2xSample: + """Empty-initialize an array of `nvmlPerfMetricsDlppc2xSample_t`. + The resulting object is of length `size` and of dtype `perf_metrics_dlppc2x_sample_dtype`. + If default-constructed, the instance represents a single struct. - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") - self._owner = None - self._owned = True - self._readonly = False + Args: + size (int): number of structs, default=1. - def __dealloc__(self): - cdef nvmlVgpuSchedulerLogInfo_v1_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) + .. seealso:: `nvmlPerfMetricsDlppc2xSample_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=perf_metrics_dlppc2x_sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPerfMetricsDlppc2xSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPerfMetricsDlppc2xSample_t) }" def __repr__(self): - return f"<{__name__}.VgpuSchedulerLogInfo_v1 object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PerfMetricsDlppc2xSample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PerfMetricsDlppc2xSample object at {hex(id(self))}>" @property def ptr(self): """Get the pointer address to the data as Python :class:`int`.""" - return (self._ptr) + return self._data.ctypes.data cdef intptr_t _get_ptr(self): - return (self._ptr) + return self._data.ctypes.data def __int__(self): - return (self._ptr) + 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 VgpuSchedulerLogInfo_v1 other_ - if not isinstance(other, VgpuSchedulerLogInfo_v1): + cdef object self_data = self._data + if (not isinstance(other, PerfMetricsDlppc2xSample)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) == 0) + return bool((self_data == other._data).all()) - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), self._readonly) + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - pass - - def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) - - @property - def scheduler_params(self): - """VgpuSchedulerParams: OUT: vGPU Scheduler Parameters.""" - return VgpuSchedulerParams.from_ptr( - &(self._ptr[0].schedulerParams), - readonly=self._readonly, - owner=self, - ) - - @scheduler_params.setter - def scheduler_params(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") - cdef VgpuSchedulerParams val_ = val - _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerParams_t) * 1) - - @property - def log_entries(self): - """VgpuSchedulerLogEntry: OUT: Structure to store the state and logs of a software runlist.""" - return VgpuSchedulerLogEntry.from_ptr( - &(self._ptr[0].logEntries), - 200, - readonly=self._readonly, - owner=self, - ) - - @log_entries.setter - def log_entries(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") - cdef VgpuSchedulerLogEntry val_ = val - if len(val) != 200: - raise ValueError(f"Expected length { 200 } for field log_entries, got {len(val)}") - _cyb_memcpy(&(self._ptr[0].logEntries), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerLogEntry_t) * 200) - - @property - def version(self): - """int: IN: The version number of this struct.""" - return self._ptr[0].version - - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") - self._ptr[0].version = val - - @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_v1 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_v1 instance is read-only") - self._ptr[0].schedulerPolicy = val + _cyb_cpython.PyBuffer_Release(buffer) @property - def arr_mode(self): - """int: OUT: Adaptive Round Robin scheduler mode. One of the NVML_VGPU_SCHEDULER_ARR_*.""" - return self._ptr[0].arrMode + def observed_metrics(self): + """observed_metrics_dtype: Observed metrics from the DLPPC 2x controller.""" + return self._data.observed_metrics - @arr_mode.setter - def arr_mode(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") - self._ptr[0].arrMode = val + @observed_metrics.setter + def observed_metrics(self, val): + self._data.observed_metrics = val - @property - def entries_count(self): - """int: OUT: Count of log entries fetched.""" - return self._ptr[0].entriesCount + 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 PerfMetricsDlppc2xSample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == perf_metrics_dlppc2x_sample_dtype: + return PerfMetricsDlppc2xSample.from_data(out) + return out - @entries_count.setter - def entries_count(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") - self._ptr[0].entriesCount = val + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an VgpuSchedulerLogInfo_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), VgpuSchedulerLogInfo_v1) + """Create an PerfMetricsDlppc2xSample instance with the memory from the given buffer.""" + return PerfMetricsDlppc2xSample.from_data(_numpy.frombuffer(buffer, dtype=perf_metrics_dlppc2x_sample_dtype)) @staticmethod def from_data(data): - """Create an VgpuSchedulerLogInfo_v1 instance wrapping the given NumPy array. + """Create an PerfMetricsDlppc2xSample instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_log_info_v1_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `perf_metrics_dlppc2x_sample_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_log_info_v1_dtype", vgpu_scheduler_log_info_v1_dtype, VgpuSchedulerLogInfo_v1) + cdef PerfMetricsDlppc2xSample obj = PerfMetricsDlppc2xSample.__new__(PerfMetricsDlppc2xSample) + 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 != perf_metrics_dlppc2x_sample_dtype: + raise ValueError("data array must be of dtype perf_metrics_dlppc2x_sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerLogInfo_v1 instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PerfMetricsDlppc2xSample 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. + size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerLogInfo_v1 obj = VgpuSchedulerLogInfo_v1.__new__(VgpuSchedulerLogInfo_v1) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + cdef PerfMetricsDlppc2xSample obj = PerfMetricsDlppc2xSample.__new__(PerfMetricsDlppc2xSample) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPerfMetricsDlppc2xSample_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=perf_metrics_dlppc2x_sample_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj -cdef _get_vgpu_scheduler_state_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerState_v1_t pod +cdef _get__py_anon_pod8_dtype_offsets(): + cdef cuda_bindings_nvml__anon_pod8 pod return _numpy.dtype({ - 'names': ['version', 'engine_id', 'scheduler_policy', 'enable_arr_mode', 'scheduler_params'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_set_params_dtype], + 'names': ['dlppc2x', 'pfpp1x'], + 'formats': [perf_metrics_dlppc2x_sample_dtype, perf_metrics_pfpp1x_sample_dtype], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.enableARRMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), + (&(pod.dlppc2x)) - (&pod), + (&(pod.pfpp1x)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod8), }) -vgpu_scheduler_state_v1_dtype = _get_vgpu_scheduler_state_v1_dtype_offsets() +_py_anon_pod8_dtype = _get__py_anon_pod8_dtype_offsets() -cdef class VgpuSchedulerState_v1: - """Empty-initialize an instance of `nvmlVgpuSchedulerState_v1_t`. +cdef class _py_anon_pod8: + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod8`. - .. seealso:: `nvmlVgpuSchedulerState_v1_t` + .. seealso:: `cuda_bindings_nvml__anon_pod8` """ cdef: - nvmlVgpuSchedulerState_v1_t *_ptr + cuda_bindings_nvml__anon_pod8 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod8)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerState_v1") + raise MemoryError("Error allocating _py_anon_pod8") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuSchedulerState_v1_t *ptr + cdef cuda_bindings_nvml__anon_pod8 *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.VgpuSchedulerState_v1 object at {hex(id(self))}>" + return f"<{__name__}._py_anon_pod8 object at {hex(id(self))}>" @property def ptr(self): @@ -22325,24 +27722,24 @@ cdef class VgpuSchedulerState_v1: return (self._ptr) def __eq__(self, other): - cdef VgpuSchedulerState_v1 other_ - if not isinstance(other, VgpuSchedulerState_v1): + cdef _py_anon_pod8 other_ + if not isinstance(other, _py_anon_pod8): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerState_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(cuda_bindings_nvml__anon_pod8)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlVgpuSchedulerState_v1_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(cuda_bindings_nvml__anon_pod8), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): pass def __setitem__(self, key, val): if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod8)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerState_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerState_v1_t)) + raise MemoryError("Error allocating _py_anon_pod8") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod8)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -22350,82 +27747,56 @@ cdef class VgpuSchedulerState_v1: setattr(self, key, val) @property - def scheduler_params(self): - """VgpuSchedulerSetParams: IN: vGPU Scheduler Parameters.""" - return VgpuSchedulerSetParams.from_ptr( - &(self._ptr[0].schedulerParams), + def dlppc2x(self): + """PerfMetricsDlppc2xSample: """ + return PerfMetricsDlppc2xSample.from_ptr( + &(self._ptr[0].dlppc2x), + 1, readonly=self._readonly, - owner=self, - ) - - @scheduler_params.setter - def scheduler_params(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerState_v1 instance is read-only") - cdef VgpuSchedulerSetParams val_ = val - _cyb_memcpy(&(self._ptr[0].schedulerParams), (val_._get_ptr()), sizeof(nvmlVgpuSchedulerSetParams_t) * 1) - - @property - def version(self): - """int: IN: The version number of this struct.""" - return self._ptr[0].version - - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerState_v1 instance is read-only") - self._ptr[0].version = 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_v1 instance is read-only") - self._ptr[0].engineId = val - - @property - def scheduler_policy(self): - """int: IN: Scheduler policy.""" - return self._ptr[0].schedulerPolicy + owner=self, + ) - @scheduler_policy.setter - def scheduler_policy(self, val): + @dlppc2x.setter + def dlppc2x(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerState_v1 instance is read-only") - self._ptr[0].schedulerPolicy = val + raise ValueError("This _py_anon_pod8 instance is read-only") + cdef PerfMetricsDlppc2xSample val_ = val + _cyb_memcpy(&(self._ptr[0].dlppc2x), (val_._get_ptr()), sizeof(nvmlPerfMetricsDlppc2xSample_t) * 1) @property - def enable_arr_mode(self): - """int: IN: Adaptive Round Robin scheduler.""" - return self._ptr[0].enableARRMode + def pfpp1x(self): + """PerfMetricsPfpp1xSample: """ + return PerfMetricsPfpp1xSample.from_ptr( + &(self._ptr[0].pfpp1x), + 1, + readonly=self._readonly, + owner=self, + ) - @enable_arr_mode.setter - def enable_arr_mode(self, val): + @pfpp1x.setter + def pfpp1x(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerState_v1 instance is read-only") - self._ptr[0].enableARRMode = val + raise ValueError("This _py_anon_pod8 instance is read-only") + cdef PerfMetricsPfpp1xSample val_ = val + _cyb_memcpy(&(self._ptr[0].pfpp1x), (val_._get_ptr()), sizeof(nvmlPerfMetricsPfpp1xSample_t) * 1) @staticmethod def from_buffer(buffer): - """Create an VgpuSchedulerState_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerState_v1_t), VgpuSchedulerState_v1) + """Create an _py_anon_pod8 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod8), _py_anon_pod8) @staticmethod def from_data(data): - """Create an VgpuSchedulerState_v1 instance wrapping the given NumPy array. + """Create an _py_anon_pod8 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_state_v1_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod8_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_state_v1_dtype", vgpu_scheduler_state_v1_dtype, VgpuSchedulerState_v1) + return _cyb_from_data(data, "_py_anon_pod8_dtype", _py_anon_pod8_dtype, _py_anon_pod8) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerState_v1 instance wrapping the given pointer. + """Create an _py_anon_pod8 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -22434,221 +27805,377 @@ cdef class VgpuSchedulerState_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerState_v1 obj = VgpuSchedulerState_v1.__new__(VgpuSchedulerState_v1) + cdef _py_anon_pod8 obj = _py_anon_pod8.__new__(_py_anon_pod8) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod8)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerState_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerState_v1_t)) + raise MemoryError("Error allocating _py_anon_pod8") + _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod8)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly return obj -cdef _get_grid_licensable_features_dtype_offsets(): - cdef nvmlGridLicensableFeatures_t pod +cdef _get_perf_metric_controller_sample_dtype_offsets(): + cdef nvmlPerfMetricControllerSample_t pod return _numpy.dtype({ - 'names': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], - 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], + 'names': ['controller_type', 'data_'], + 'formats': [_numpy.uint32, _py_anon_pod8_dtype], 'offsets': [ - (&(pod.isGridLicenseSupported)) - (&pod), - (&(pod.licensableFeaturesCount)) - (&pod), - (&(pod.gridLicensableFeatures)) - (&pod), + (&(pod.controllerType)) - (&pod), + (&(pod.data)) - (&pod), ], - 'itemsize': sizeof(nvmlGridLicensableFeatures_t), + 'itemsize': sizeof(nvmlPerfMetricControllerSample_t), }) -grid_licensable_features_dtype = _get_grid_licensable_features_dtype_offsets() +perf_metric_controller_sample_dtype = _get_perf_metric_controller_sample_dtype_offsets() -cdef class GridLicensableFeatures: - """Empty-initialize an instance of `nvmlGridLicensableFeatures_t`. +cdef class PerfMetricControllerSample: + """Empty-initialize an array of `nvmlPerfMetricControllerSample_t`. + The resulting object is of length `size` and of dtype `perf_metric_controller_sample_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlGridLicensableFeatures_t` + .. seealso:: `nvmlPerfMetricControllerSample_t` """ cdef: - nvmlGridLicensableFeatures_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlGridLicensableFeatures_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating GridLicensableFeatures") - self._owner = None - self._owned = True - self._readonly = False - def __dealloc__(self): - cdef nvmlGridLicensableFeatures_t *ptr - if self._owned and self._ptr != NULL: - ptr = self._ptr - self._ptr = NULL - _cyb_free(ptr) + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=perf_metric_controller_sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPerfMetricControllerSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPerfMetricControllerSample_t) }" def __repr__(self): - return f"<{__name__}.GridLicensableFeatures object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PerfMetricControllerSample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PerfMetricControllerSample object at {hex(id(self))}>" @property def ptr(self): """Get the pointer address to the data as Python :class:`int`.""" - return (self._ptr) + return self._data.ctypes.data cdef intptr_t _get_ptr(self): - return (self._ptr) + return self._data.ctypes.data def __int__(self): - return (self._ptr) + 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 GridLicensableFeatures other_ - if not isinstance(other, GridLicensableFeatures): + cdef object self_data = self._data + if (not isinstance(other, PerfMetricControllerSample)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False - other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGridLicensableFeatures_t)) == 0) + return bool((self_data == other._data).all()) - def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGridLicensableFeatures_t), self._readonly) + def __getbuffer__(self, Py_buffer *buffer, int flags): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) def __releasebuffer__(self, Py_buffer *buffer): - pass + _cyb_cpython.PyBuffer_Release(buffer) + + @property + def controller_type(self): + """Union[~_numpy.uint32, int]: Controller type: NVML_PERF_METRICS_CONTROLLER_TYPE_DLPPC_2X or NVML_PERF_METRICS_CONTROLLER_TYPE_PFPP_1X.""" + if self._data.size == 1: + return int(self._data.controller_type[0]) + return self._data.controller_type + + @controller_type.setter + def controller_type(self, val): + self._data.controller_type = val + + @property + def data_(self): + """_py_anon_pod8_dtype: Union containing controller-specific data.""" + return self._data.data_ + + @data_.setter + def data_(self, val): + self._data.data_ = 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 PerfMetricControllerSample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == perf_metric_controller_sample_dtype: + return PerfMetricControllerSample.from_data(out) + return out def __setitem__(self, key, val): - if key == 0 and isinstance(val, _numpy.ndarray): - self._ptr = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating GridLicensableFeatures") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGridLicensableFeatures_t)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an PerfMetricControllerSample instance with the memory from the given buffer.""" + return PerfMetricControllerSample.from_data(_numpy.frombuffer(buffer, dtype=perf_metric_controller_sample_dtype)) + + @staticmethod + def from_data(data): + """Create an PerfMetricControllerSample instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `perf_metric_controller_sample_dtype` holding the data. + """ + cdef PerfMetricControllerSample obj = PerfMetricControllerSample.__new__(PerfMetricControllerSample) + 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 != perf_metric_controller_sample_dtype: + raise ValueError("data array must be of dtype perf_metric_controller_sample_dtype") + obj._data = data.view(_numpy.recarray) + + return obj + + @staticmethod + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PerfMetricControllerSample 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`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. + """ + if ptr == 0: + raise ValueError("ptr must not be null (0)") + cdef PerfMetricControllerSample obj = PerfMetricControllerSample.__new__(PerfMetricControllerSample) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPerfMetricControllerSample_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=perf_metric_controller_sample_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_perf_metrics_sample_dtype_offsets(): + cdef nvmlPerfMetricsSample_t pod + return _numpy.dtype({ + 'names': ['num_controller_data', 'controller_data'], + 'formats': [_numpy.uint8, (perf_metric_controller_sample_dtype, 4)], + 'offsets': [ + (&(pod.numControllerData)) - (&pod), + (&(pod.controllerData)) - (&pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsSample_t), + }) + +perf_metrics_sample_dtype = _get_perf_metrics_sample_dtype_offsets() + +cdef class PerfMetricsSample: + """Empty-initialize an array of `nvmlPerfMetricsSample_t`. + The resulting object is of length `size` and of dtype `perf_metrics_sample_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlPerfMetricsSample_t` + """ + cdef: + readonly object _data + object _owner + readonly tuple _controller_data + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=perf_metrics_sample_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPerfMetricsSample_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPerfMetricsSample_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.PerfMetricsSample_Array_{self._data.size} object at {hex(id(self))}>" else: - setattr(self, key, val) + return f"<{__name__}.PerfMetricsSample object at {hex(id(self))}>" @property - def grid_licensable_features(self): - """GridLicensableFeature: """ - return GridLicensableFeature.from_ptr( - &(self._ptr[0].gridLicensableFeatures), - self._ptr[0].licensableFeaturesCount, - readonly=self._readonly, - owner=self, - ) + def ptr(self): + """Get the pointer address to the data as Python :class:`int`.""" + return self._data.ctypes.data - @grid_licensable_features.setter - def grid_licensable_features(self, val): - if self._readonly: - raise ValueError("This GridLicensableFeatures instance is read-only") - cdef GridLicensableFeature val_ = val - if len(val) > 3: - raise ValueError(f"Expected length < 3 for field grid_licensable_features, got {len(val)}") - self._ptr[0].licensableFeaturesCount = len(val) - if len(val) == 0: - return - _cyb_memcpy(&(self._ptr[0].gridLicensableFeatures), (val_._get_ptr()), sizeof(nvmlGridLicensableFeature_t) * self._ptr[0].licensableFeaturesCount) + 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, PerfMetricsSample)) 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): + _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + + def __releasebuffer__(self, Py_buffer *buffer): + _cyb_cpython.PyBuffer_Release(buffer) @property - def is_grid_license_supported(self): - """int: """ - return self._ptr[0].isGridLicenseSupported + def controller_data(self): + """PerfMetricControllerSample: Array of controller samples.""" + if self._data.size == 1: + return self._controller_data[0] + return self._controller_data - @is_grid_license_supported.setter - def is_grid_license_supported(self, val): - if self._readonly: - raise ValueError("This GridLicensableFeatures instance is read-only") - self._ptr[0].isGridLicenseSupported = 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 PerfMetricsSample.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == perf_metrics_sample_dtype: + return PerfMetricsSample.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): - """Create an GridLicensableFeatures instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlGridLicensableFeatures_t), GridLicensableFeatures) + """Create an PerfMetricsSample instance with the memory from the given buffer.""" + return PerfMetricsSample.from_data(_numpy.frombuffer(buffer, dtype=perf_metrics_sample_dtype)) @staticmethod def from_data(data): - """Create an GridLicensableFeatures instance wrapping the given NumPy array. + """Create an PerfMetricsSample instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `grid_licensable_features_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `perf_metrics_sample_dtype` holding the data. """ - return _cyb_from_data(data, "grid_licensable_features_dtype", grid_licensable_features_dtype, GridLicensableFeatures) + cdef PerfMetricsSample obj = PerfMetricsSample.__new__(PerfMetricsSample) + 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 != perf_metrics_sample_dtype: + raise ValueError("data array must be of dtype perf_metrics_sample_dtype") + obj._data = data.view(_numpy.recarray) + + controllerData_list = list() + for i in range(obj._data.size): + addr = obj._data.controllerData[i].__array_interface__['data'][0] + n = int(obj._data.num_controller_data[i]) + controllerData_obj = PerfMetricControllerSample.from_ptr(addr, n, owner=obj, readonly=False) + controllerData_list.append(controllerData_obj) + obj._controllerData = tuple(controllerData_list) + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an GridLicensableFeatures instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PerfMetricsSample 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. + size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + owner (object): object that owns the memory at *ptr*. A strong reference is + kept so the backing storage outlives this wrapper. """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GridLicensableFeatures obj = GridLicensableFeatures.__new__(GridLicensableFeatures) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlGridLicensableFeatures_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating GridLicensableFeatures") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGridLicensableFeatures_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + cdef PerfMetricsSample obj = PerfMetricsSample.__new__(PerfMetricsSample) + cdef flag = _cyb_cpython_buffer.PyBUF_READ if readonly else _cyb_cpython_buffer.PyBUF_WRITE + cdef object buf = _cyb_cpython_memoryview.PyMemoryView_FromMemory( + ptr, sizeof(nvmlPerfMetricsSample_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=perf_metrics_sample_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + + controllerData_list = list() + for i in range(obj._data.size): + addr = obj._data.controllerData[i].__array_interface__['data'][0] + n = int(obj._data.num_controller_data[i]) + controllerData_obj = PerfMetricControllerSample.from_ptr(addr, n, owner=obj, readonly=readonly) + controllerData_list.append(controllerData_obj) + obj._controllerData = tuple(controllerData_list) return obj -cdef _get_nv_link_info_v2_dtype_offsets(): - cdef nvmlNvLinkInfo_v2_t pod +cdef _get_perf_metrics_samples_v1_dtype_offsets(): + cdef nvmlPerfMetricsSamples_v1_t pod return _numpy.dtype({ - 'names': ['version', 'is_nvle_enabled', 'firmware_info'], - 'formats': [_numpy.uint32, _numpy.uint32, nvlink_firmware_info_dtype], + 'names': ['num_samples', 'samples'], + 'formats': [_numpy.uint32, (perf_metrics_sample_dtype, 13)], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.isNvleEnabled)) - (&pod), - (&(pod.firmwareInfo)) - (&pod), + (&(pod.numSamples)) - (&pod), + (&(pod.samples)) - (&pod), ], - 'itemsize': sizeof(nvmlNvLinkInfo_v2_t), + 'itemsize': sizeof(nvmlPerfMetricsSamples_v1_t), }) -nv_link_info_v2_dtype = _get_nv_link_info_v2_dtype_offsets() +perf_metrics_samples_v1_dtype = _get_perf_metrics_samples_v1_dtype_offsets() -cdef class NvLinkInfo_v2: - """Empty-initialize an instance of `nvmlNvLinkInfo_v2_t`. +cdef class PerfMetricsSamples_v1: + """Empty-initialize an instance of `nvmlPerfMetricsSamples_v1_t`. - .. seealso:: `nvmlNvLinkInfo_v2_t` + .. seealso:: `nvmlPerfMetricsSamples_v1_t` """ cdef: - nvmlNvLinkInfo_v2_t *_ptr + nvmlPerfMetricsSamples_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlNvLinkInfo_v2_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlPerfMetricsSamples_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating NvLinkInfo_v2") + raise MemoryError("Error allocating PerfMetricsSamples_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlNvLinkInfo_v2_t *ptr + cdef nvmlPerfMetricsSamples_v1_t *ptr if self._owned and self._ptr != NULL: ptr = self._ptr self._ptr = NULL _cyb_free(ptr) def __repr__(self): - return f"<{__name__}.NvLinkInfo_v2 object at {hex(id(self))}>" + return f"<{__name__}.PerfMetricsSamples_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -22662,24 +28189,24 @@ cdef class NvLinkInfo_v2: return (self._ptr) def __eq__(self, other): - cdef NvLinkInfo_v2 other_ - if not isinstance(other, NvLinkInfo_v2): + cdef PerfMetricsSamples_v1 other_ + if not isinstance(other, PerfMetricsSamples_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v2_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlPerfMetricsSamples_v1_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvLinkInfo_v2_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlPerfMetricsSamples_v1_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 = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) + self._ptr = _cyb_malloc(sizeof(nvmlPerfMetricsSamples_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating NvLinkInfo_v2") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvLinkInfo_v2_t)) + raise MemoryError("Error allocating PerfMetricsSamples_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlPerfMetricsSamples_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -22687,60 +28214,44 @@ cdef class NvLinkInfo_v2: setattr(self, key, val) @property - def firmware_info(self): - """NvlinkFirmwareInfo: OUT - NVLINK Firmware info.""" - return NvlinkFirmwareInfo.from_ptr( - &(self._ptr[0].firmwareInfo), + def samples(self): + """PerfMetricsSample: Array of performance metrics samples.""" + return PerfMetricsSample.from_ptr( + &(self._ptr[0].samples), + self._ptr[0].numSamples, readonly=self._readonly, owner=self, ) - @firmware_info.setter - def firmware_info(self, val): - if self._readonly: - raise ValueError("This NvLinkInfo_v2 instance is read-only") - cdef NvlinkFirmwareInfo val_ = val - _cyb_memcpy(&(self._ptr[0].firmwareInfo), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareInfo_t) * 1) - - @property - def version(self): - """int: IN - the API version number.""" - return self._ptr[0].version - - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This NvLinkInfo_v2 instance is read-only") - self._ptr[0].version = val - - @property - def is_nvle_enabled(self): - """int: OUT - NVLINK encryption enablement.""" - return self._ptr[0].isNvleEnabled - - @is_nvle_enabled.setter - def is_nvle_enabled(self, val): + @samples.setter + def samples(self, val): if self._readonly: - raise ValueError("This NvLinkInfo_v2 instance is read-only") - self._ptr[0].isNvleEnabled = val + raise ValueError("This PerfMetricsSamples_v1 instance is read-only") + cdef PerfMetricsSample val_ = val + if len(val) > 13: + raise ValueError(f"Expected length < 13 for field samples, got {len(val)}") + self._ptr[0].numSamples = len(val) + if len(val) == 0: + return + _cyb_memcpy(&(self._ptr[0].samples), (val_._get_ptr()), sizeof(nvmlPerfMetricsSample_t) * self._ptr[0].numSamples) @staticmethod def from_buffer(buffer): - """Create an NvLinkInfo_v2 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlNvLinkInfo_v2_t), NvLinkInfo_v2) + """Create an PerfMetricsSamples_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlPerfMetricsSamples_v1_t), PerfMetricsSamples_v1) @staticmethod def from_data(data): - """Create an NvLinkInfo_v2 instance wrapping the given NumPy array. + """Create an PerfMetricsSamples_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `nv_link_info_v2_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `perf_metrics_samples_v1_dtype` holding the data. """ - return _cyb_from_data(data, "nv_link_info_v2_dtype", nv_link_info_v2_dtype, NvLinkInfo_v2) + return _cyb_from_data(data, "perf_metrics_samples_v1_dtype", perf_metrics_samples_v1_dtype, PerfMetricsSamples_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an NvLinkInfo_v2 instance wrapping the given pointer. + """Create an PerfMetricsSamples_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -22749,16 +28260,16 @@ cdef class NvLinkInfo_v2: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef NvLinkInfo_v2 obj = NvLinkInfo_v2.__new__(NvLinkInfo_v2) + cdef PerfMetricsSamples_v1 obj = PerfMetricsSamples_v1.__new__(PerfMetricsSamples_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlNvLinkInfo_v2_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlPerfMetricsSamples_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating NvLinkInfo_v2") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvLinkInfo_v2_t)) + raise MemoryError("Error allocating PerfMetricsSamples_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlPerfMetricsSamples_v1_t)) obj._owner = None obj._owned = True else: - obj._ptr = ptr + obj._ptr = ptr obj._owner = owner obj._owned = False obj._readonly = readonly @@ -22766,7 +28277,7 @@ cdef class NvLinkInfo_v2: cpdef init_v2(): - """Initialize NVML, but don't initialize any GPUs yet. + """Initialize the NVML Library lazily, without allocating any device state. .. seealso:: `nvmlInit_v2` """ @@ -22776,10 +28287,11 @@ cpdef init_v2(): cpdef init_with_flags(unsigned int flags): - """nvmlInitWithFlags is a variant of ``nvmlInit()``, that allows passing a set of boolean values modifying the behaviour of ``nvmlInit()``. Other than the "flags" parameter it is completely similar to ``nvmlInit_v2``. + """Initialize the NVML Library lazily, without allocating any device state, with additional init flags. Args: - flags (unsigned int): behaviour modifier flags. + flags (unsigned int): NVML_INIT_FLAG_* flags that can modify + NVML Init behavior. .. seealso:: `nvmlInitWithFlags` """ @@ -22789,7 +28301,7 @@ cpdef init_with_flags(unsigned int flags): cpdef shutdown(): - """Shut down NVML by releasing all GPU resources previously allocated with :func:`init_v2`. + """Shut down and cleanup NVML Library state. .. seealso:: `nvmlShutdown` """ @@ -28321,6 +33833,214 @@ cpdef object device_get_remapped_rows_v2(intptr_t device): return info_py +cpdef device_set_adaptive_tgp_mode_v1(intptr_t device, int mode): + """Request to enable or disable Adaptive TGP Mode for a GPU. + + Args: + device (intptr_t): The identifier of the target device. + mode (EnableState): NVML_FEATURE_ENABLED or + NVML_FEATURE_DISABLED. + + .. seealso:: `nvmlDeviceSetAdaptiveTgpMode_v1` + """ + with nogil: + __status__ = nvmlDeviceSetAdaptiveTgpMode_v1(device, <_EnableState>mode) + check_status(__status__) + + +cpdef object device_get_adaptive_tgp_mode_info_v1(intptr_t device): + """Retrieves Adaptive TGP Mode state and telemetry for a GPU. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlAdaptiveTgpModeInfo_v1_t: Reference in which to return the + Adaptive TGP Mode information. + + .. seealso:: `nvmlDeviceGetAdaptiveTgpModeInfo_v1` + """ + cdef AdaptiveTgpModeInfo_v1 info_py = AdaptiveTgpModeInfo_v1() + cdef nvmlAdaptiveTgpModeInfo_v1_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetAdaptiveTgpModeInfo_v1(device, info) + check_status(__status__) + return info_py + + +cpdef device_set_memory_limits_v1(intptr_t device, intptr_t limits): + """Set the memory limits of the device for the cgroup partition. + + Args: + device (intptr_t): The identifier of the target device. + limits (intptr_t): A pointer to ``nvmlSetMemoryLimits_v1_t`` + where the limits can be set. + + .. seealso:: `nvmlDeviceSetMemoryLimits_v1` + """ + with nogil: + __status__ = nvmlDeviceSetMemoryLimits_v1(device, limits) + check_status(__status__) + + +cpdef object device_get_memory_limits_v1(intptr_t device): + """Get the memory limits of the device for the cgroup partition. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlGetMemoryLimits_v1_t: A pointer to + ``nvmlGetMemoryLimits_v1_t``. + + .. seealso:: `nvmlDeviceGetMemoryLimits_v1` + """ + cdef GetMemoryLimits_v1 limits_py = GetMemoryLimits_v1() + cdef nvmlGetMemoryLimits_v1_t *limits = (limits_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetMemoryLimits_v1(device, limits) + check_status(__status__) + return limits_py + + +cpdef object device_get_gpu_fabric_info_v4(intptr_t device): + """Retrieves GPU fabric information including per-type clique assignments. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlGpuFabricInfo_v4_t: Information about GPU fabric state + including per-type cliques. + + .. seealso:: `nvmlDeviceGetGpuFabricInfo_v4` + """ + cdef GpuFabricInfo_v4 gpu_fabric_info_py = GpuFabricInfo_v4() + cdef nvmlGpuFabricInfo_v4_t *gpu_fabric_info = (gpu_fabric_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetGpuFabricInfo_v4(device, gpu_fabric_info) + check_status(__status__) + return gpu_fabric_info_py + + +cpdef object device_perf_metrics_get_samples_v1(intptr_t device): + """Get Performance Metric samples. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlPerfMetricsSamples_v1_t: Reference to + ``nvmlPerfMetricsSamples_v1_t``. + + .. seealso:: `nvmlDevicePerfMetricsGetSamples_v1` + """ + cdef PerfMetricsSamples_v1 samples_py = PerfMetricsSamples_v1() + cdef nvmlPerfMetricsSamples_v1_t *samples = (samples_py._get_ptr()) + with nogil: + __status__ = nvmlDevicePerfMetricsGetSamples_v1(device, samples) + check_status(__status__) + return samples_py + + +cpdef object device_set_nvlink_bw_mode_async_v1(intptr_t device): + """Set the NvLink Reduced Bandwidth Mode asynchronously for the device. Polling should be done by checking for ``NVML_GPU_FABRIC_STATE_COMPLETED`` from :func:`device_get_gpu_fabric_info_v`. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlNvlinkSetBwModeAsync_v1_t: Reference to + ``nvmlNvlinkSetBwModeAsync_v1_t``. + + .. seealso:: `nvmlDeviceSetNvlinkBwModeAsync_v1` + """ + cdef NvlinkSetBwModeAsync_v1 set_bw_mode_async_py = NvlinkSetBwModeAsync_v1() + cdef nvmlNvlinkSetBwModeAsync_v1_t *set_bw_mode_async = (set_bw_mode_async_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceSetNvlinkBwModeAsync_v1(device, set_bw_mode_async) + check_status(__status__) + return set_bw_mode_async_py + + +cpdef object device_get_nv_link_telemetry_samples_v1(intptr_t device): + """Retrieve a batch of historical NVLink per-link telemetry samples. + + Args: + device (intptr_t): The device handle of the GPU to retrieve + samples for. + + Returns: + nvmlNvlinkTelemetrySamples_v1_t: Request/response batch (see + ``nvmlNvlinkTelemetrySamples_v1_t``). + + .. seealso:: `nvmlDeviceGetNvLinkTelemetrySamples_v1` + """ + cdef NvlinkTelemetrySamples_v1 samples_py = NvlinkTelemetrySamples_v1() + cdef nvmlNvlinkTelemetrySamples_v1_t *samples = (samples_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetNvLinkTelemetrySamples_v1(device, samples) + check_status(__status__) + return samples_py + + +cpdef event_set_register_gpu_operational_events_v1(intptr_t event_set, intptr_t config): + """Adds a GPU Operational Event subscription to an event set. + + Args: + event_set (intptr_t): Event set created by + ``nvmlEventSetCreate``. + config (intptr_t): GPU Operational Event subscription + configuration. + + .. seealso:: `nvmlEventSetRegisterGpuOperationalEvents_v1` + """ + with nogil: + __status__ = nvmlEventSetRegisterGpuOperationalEvents_v1(event_set, config) + check_status(__status__) + + +cpdef object event_set_get_context_count_v1(intptr_t set): + """Gets the number of context records for the most recent event returned by ``nvmlEventSetWait_v3`` on this event set. + + Args: + set (intptr_t): Event set previously used with + ``nvmlEventSetWait_v3``. + + Returns: + nvmlEventSetGetContextCount_v1_t: Parameters in which to + return the number of context records. + + .. seealso:: `nvmlEventSetGetContextCount_v1` + """ + cdef EventSetGetContextCount_v1 params_py = EventSetGetContextCount_v1() + cdef nvmlEventSetGetContextCount_v1_t *params = (params_py._get_ptr()) + with nogil: + __status__ = nvmlEventSetGetContextCount_v1(set, params) + check_status(__status__) + return params_py + + +cpdef object device_get_bank_remapper_status_v1(intptr_t device): + """Get bank remapper status. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlEccBankRemapperStatus_v1_t: Reference to + ``nvmlEccBankRemapperStatus_t``. + + .. seealso:: `nvmlDeviceGetBankRemapperStatus_v1` + """ + cdef EccBankRemapperStatus_v1 p_bank_remapper_status_py = EccBankRemapperStatus_v1() + cdef nvmlEccBankRemapperStatus_v1_t *p_bank_remapper_status = (p_bank_remapper_status_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetBankRemapperStatus_v1(device, p_bank_remapper_status) + check_status(__status__) + return p_bank_remapper_status_py + + 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 @@ -28660,7 +34380,7 @@ cpdef object device_get_field_values(intptr_t device, values): __status__ = nvmlDeviceGetFieldValues(device, valuesCount, ptr) check_status(__status__) - values_._data.resize((valuesCount,)) + values_._data = values_._data[:valuesCount] return values_ @@ -29304,7 +35024,7 @@ cpdef object system_event_set_wait(intptr_t event_set, unsigned int timeout_ms, request[0].dataSize = buffer_size __status__ = nvmlSystemEventSetWait(request) check_status(__status__) - event_data._data.resize((request[0].numEvent,)) + event_data._data = event_data._data[:request[0].numEvent] return event_data @@ -30004,4 +35724,112 @@ cpdef str vgpu_type_get_name(unsigned int vgpu_type_id): return cpython.PyUnicode_FromStringAndSize(vgpu_type_name, size[0]) +cpdef object event_set_wait_v3(intptr_t set, unsigned int timeout_ms): + """Wait for events of the specified type to occur for any device in the set, + returning a structured event record. + + For Turing™ or newer fully supported devices. + + For Linux only. + + Args: + set (EventSet): Handle to the event set. + timeout_ms (unsigned int): Maximum time to wait, in milliseconds. + + Returns: + EventSetWait_v3: Structured event data record. + + .. seealso:: `nvmlEventSetWait_v3` + """ + cdef EventSetWait_v3 params = EventSetWait_v3() + cdef nvmlEventSetWait_v3_t *ptr = params._get_ptr() + ptr.timeoutMs = timeout_ms + with nogil: + __status__ = nvmlEventSetWait_v3(set, ptr) + check_status(__status__) + return params + + +cpdef object event_set_get_context_info_v1(intptr_t set, unsigned int index): + """Retrieve context metadata for a context record from the most recent event + returned by :func:`event_set_wait_v3`. + + For Turing™ or newer fully supported devices. + + For Linux only. + + Args: + set (EventSet): Handle to the event set. + index (unsigned int): Zero-based index of the context record. + + Returns: + EventSetGetContextInfo_v1: Context metadata record. + + .. seealso:: `nvmlEventSetGetContextInfo_v1` + """ + cdef EventSetGetContextInfo_v1 params = EventSetGetContextInfo_v1() + cdef nvmlEventSetGetContextInfo_v1_t *ptr = params._get_ptr() + ptr.index = index + with nogil: + __status__ = nvmlEventSetGetContextInfo_v1(set, ptr) + check_status(__status__) + return params + + +cpdef object event_set_get_gpu_operational_event_context_legacy_xid_v1(intptr_t set, unsigned int index): + """Retrieve the decoded legacy-Xid context data for a context record from the + most recent event returned by :func:`event_set_wait_v3`. + + For Turing™ or newer fully supported devices. + + For Linux only. + + Args: + set (EventSet): Handle to the event set. + index (unsigned int): Zero-based index of the context record. + + Returns: + EventSetGetGpuOperationalEventContextLegacyXid_v1: Decoded Xid context record. + + .. seealso:: `nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1` + """ + cdef EventSetGetGpuOperationalEventContextLegacyXid_v1 params = EventSetGetGpuOperationalEventContextLegacyXid_v1() + cdef nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t *ptr = params._get_ptr() + ptr.index = index + with nogil: + __status__ = nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(set, ptr) + check_status(__status__) + return params + + +cpdef bytes event_set_get_context_data_v1(intptr_t set, unsigned int index): + """Copies the raw payload for a context record from the most recent event returned by + :func:`event_set_wait_v3`. + + For Turing™ or newer fully supported devices. + + For Linux only. + + Args: + set (EventSet): Handle to the event set. + index (unsigned int): Zero-based index of the context record to retrieve. + + Returns: + bytes: The context payload as a bytes object. + + .. seealso:: `nvmlEventSetGetContextData_v1` + """ + cdef nvmlEventSetGetContextData_v1_t params + params.index = index + params.data = NULL + params.dataSize = 0 + with nogil: + __status__ = nvmlEventSetGetContextData_v1(set, ¶ms) + check_status_size(__status__) + cdef bytes data = bytes(params.dataSize) + params.data = data + with nogil: + __status__ = nvmlEventSetGetContextData_v1(set, ¶ms) + check_status(__status__) + return data del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index ddff245c4ae..9e78ece8069 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8fba6eefce0839acab8433ec432e9759b576665fc20b6d977953041f18c0e1d2 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ee88a87ab53668207e31e3b38c1593a3cd3724e02300ebea7574aafb509bb3b6 diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index b6e8a13f1cb..cff0b446a52 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -2,8 +2,8 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a82258bb2654bea18f6bce657324bdbbee8b8b0b30d2a0021e792ba5f95fa9a4 +# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=37902d13a165dba391225d644f9ee67747150ede2f719ea5e0870618f6db50ec # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/docs/source/release/12.9.8-notes.rst b/cuda_bindings/docs/source/release/12.9.8-notes.rst new file mode 100644 index 00000000000..68461d936b2 --- /dev/null +++ b/cuda_bindings/docs/source/release/12.9.8-notes.rst @@ -0,0 +1,46 @@ +.. SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +.. SPDX-License-Identifier: Apache-2.0 + +.. module:: cuda.bindings + +``cuda-bindings`` 12.9.8 Release notes +====================================== + +Bugfixes +-------- + + (`PR #2581 `_) +* Fixed a crash in ``nvml.system_event_set_wait`` caused by calling + ``resize()`` on a non-owning ``SystemEventData_v1._data`` view. + (`PR #2690 `_) +* ``get_cuda_native_handle`` no longer misreports a ``KeyError`` raised from + within a registered getter as an "Unknown type" error. + (`PR #2551 `_) +* Fixed ``cuFile`` status checking to no longer raise ``cuFileError`` + spuriously when ``CUfileError_t.cu_err`` is set on a non-error path (for + example, BAR-size queries on GH200 systems). + (`PR #2530 `_) +* Made ``param_packer.feed()`` safe under free-threaded Python by moving its + internal state initialization to import time. + (`PR #2417 `_) + +Deprecation Notices +------------------- + +* Support for using ``cuda-bindings`` with Python 3.10 is deprecated and will be + removed in a future version. Python 3.10 reaches end of life in October 2026 + per the `CPython support cycle `_. + +Prerelease feature +------------------ + +A new version of the ``nvrtc`` API is available as ``cuda.bindings._v2.nvrtc``. The +primary improvements are: (1) raising exceptions rather than returning error +codes, (2) uses PEP8-compliant naming, and (3) more performance. This API is +still experimental and subject to change. + +Known issues +------------ + +* Updating from older versions (v12.6.2.post1 and below) via ``pip install -U cuda-python`` might not work. Please do a clean re-installation by uninstalling ``pip uninstall -y cuda-python`` followed by installing ``pip install cuda-python``. +* ``nvml.system_get_process_name`` on WSL can return incorrect values. To work around this, set the locale to "C" before calling ``nvml.device_get_compute_running_processes_v3`` (which sets the process names) and before calling ``nvml.system_get_process_name``. ``cuda_core`` does this automatically, but users of the raw NVML API will need to do this manually.