diff --git a/.github/actions/fetch_ctk/action.yml b/.github/actions/fetch_ctk/action.yml index b4a49789779..9a3a19fa0f3 100644 --- a/.github/actions/fetch_ctk/action.yml +++ b/.github/actions/fetch_ctk/action.yml @@ -11,6 +11,10 @@ inputs: required: true cuda-version: required: true + cuda-channel: + description: "CUDA package channel: stable redistributables or prerelease packages" + required: false + default: "stable" cuda-components: description: "A list of the CTK components to install as a comma-separated list. e.g. 'cuda_nvcc,cuda_nvrtc,cuda_cudart'" required: false @@ -30,17 +34,34 @@ runs: # Use the runtime workspace mount so this also works inside container jobs. CTK_REDIST_TOOL="${GITHUB_WORKSPACE}/ci/tools/fetch_ctk_redistrib.py" CTK_CACHE_COMPONENTS=${{ inputs.cuda-components }} - CTK_JSON_URL="https://developer.download.nvidia.com/compute/cuda/redist/redistrib_${{ inputs.cuda-version }}.json" - CTK_CACHE_COMPONENTS="$(python "$CTK_REDIST_TOOL" filter-components \ - --host-platform "${{ inputs.host-platform }}" \ - --cuda-version "${{ inputs.cuda-version }}" \ - --components "$CTK_CACHE_COMPONENTS" \ - --metadata-url "$CTK_JSON_URL")" + CTK_PREVIEW_PACKAGES= + if [[ "${{ inputs.cuda-channel }}" == "stable" ]]; then + CTK_JSON_URL="https://developer.download.nvidia.com/compute/cuda/redist/redistrib_${{ inputs.cuda-version }}.json" + CTK_CACHE_COMPONENTS="$(python "$CTK_REDIST_TOOL" filter-components \ + --host-platform "${{ inputs.host-platform }}" \ + --cuda-version "${{ inputs.cuda-version }}" \ + --components "$CTK_CACHE_COMPONENTS" \ + --metadata-url "$CTK_JSON_URL")" + elif [[ "${{ inputs.cuda-channel }}" == "prerelease" ]]; then + CTK_PREVIEW_PACKAGES="$(python "$CTK_REDIST_TOOL" preview-packages \ + --host-platform "${{ inputs.host-platform }}" \ + --cuda-version "${{ inputs.cuda-version }}" \ + --components "$CTK_CACHE_COMPONENTS")" + CTK_CACHE_COMPONENTS="$CTK_PREVIEW_PACKAGES" + else + echo "Unsupported CUDA package channel: ${{ inputs.cuda-channel }}" >&2 + exit 1 + fi HASH=$(echo -n "${CTK_CACHE_COMPONENTS}" | sha256sum | awk '{print $1}') - echo "CTK_CACHE_KEY=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV + CHANNEL_CACHE_SEGMENT= + if [[ "${{ inputs.cuda-channel }}" != "stable" ]]; then + CHANNEL_CACHE_SEGMENT="-${{ inputs.cuda-channel }}" + fi + echo "CTK_CACHE_KEY=mini-ctk${CHANNEL_CACHE_SEGMENT}-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH" >> $GITHUB_ENV echo "CTK_CACHE_FILENAME=mini-ctk-${{ inputs.cuda-version }}-${{ inputs.host-platform }}-$HASH.tar.gz" >> $GITHUB_ENV echo "CTK_CACHE_COMPONENTS=${CTK_CACHE_COMPONENTS}" >> $GITHUB_ENV + echo "CTK_PREVIEW_PACKAGES=${CTK_PREVIEW_PACKAGES}" >> $GITHUB_ENV - name: Install dependencies uses: ./.github/actions/install_unix_deps @@ -68,48 +89,92 @@ runs: rm -rf $CACHE_TMP_DIR mkdir $CACHE_TMP_DIR - # The binary archives (redist) are guaranteed to be updated as part of the release posting. - # Use the runtime workspace mount so this also works inside container jobs. - CTK_REDIST_TOOL="${GITHUB_WORKSPACE}/ci/tools/fetch_ctk_redistrib.py" - CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/" - CTK_JSON_URL="$CTK_BASE_URL/redistrib_${{ inputs.cuda-version }}.json" - CTK_JSON_FILE="$CACHE_TMP_DIR/redistrib.json" - curl -LSs "$CTK_JSON_URL" -o "$CTK_JSON_FILE" - if [[ "${{ inputs.host-platform }}" == linux* ]]; then - function extract() { - tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1 - } - elif [[ "${{ inputs.host-platform }}" == "win-64" ]]; then - function extract() { - _TEMP_DIR_=$(mktemp -d) - unzip $1 -d $_TEMP_DIR_ - cp -r $_TEMP_DIR_/*/* $CACHE_TMP_DIR - rm -rf $_TEMP_DIR_ - # see commit NVIDIA/cuda-python@69410f1d9228e775845ef6c8b4a9c7f37ffc68a5 - chmod 644 $CACHE_TMP_DIR/LICENSE + if [[ "${{ inputs.cuda-channel }}" == "prerelease" ]]; then + if [[ "${{ inputs.host-platform }}" != linux* ]]; then + echo "CUDA prerelease package extraction currently supports Linux only" >&2 + exit 1 + fi + + source /etc/os-release + DISTRO_CODENAME="${VERSION_CODENAME:-}" + case "$DISTRO_CODENAME" in + bookworm|jammy|noble|resolute|trixie) ;; + *) + echo "Unsupported distribution for CUDA prerelease packages: ${DISTRO_CODENAME:-unknown}" >&2 + exit 1 + ;; + esac + + KEYRING_DEB="$CACHE_TMP_DIR/nvidia-preview-keyring.deb" + curl -fLSs "https://packages.nvidia.com/${DISTRO_CODENAME}/nvidia-preview-keyring.deb" -o "$KEYRING_DEB" + sudo dpkg -i "$KEYRING_DEB" + sudo apt-get update + + DEB_DIR="$CACHE_TMP_DIR/debs" + DEB_ROOT="$CACHE_TMP_DIR/deb-root" + mkdir -p "$DEB_DIR/partial" "$DEB_ROOT" + DEB_DIR="$(realpath "$DEB_DIR")" + IFS=, read -ra PREVIEW_PACKAGES <<< "$CTK_PREVIEW_PACKAGES" + sudo apt-get install --yes --download-only --no-install-recommends \ + -o "Dir::Cache::archives=$DEB_DIR" \ + "${PREVIEW_PACKAGES[@]}" + for package in "$DEB_DIR"/*.deb; do + dpkg-deb -x "$package" "$DEB_ROOT" + done + + CUDA_SHORT_VERSION="${{ inputs.cuda-version }}" + CUDA_SHORT_VERSION="${CUDA_SHORT_VERSION%.*}" + CUDA_PACKAGE_ROOT="$DEB_ROOT/usr/local/cuda-${CUDA_SHORT_VERSION}" + if [[ ! -d "$CUDA_PACKAGE_ROOT/include" ]]; then + echo "CUDA prerelease packages did not provide $CUDA_PACKAGE_ROOT/include" >&2 + exit 1 + fi + cp -a "$CUDA_PACKAGE_ROOT/." "$CACHE_TMP_DIR/" + rm -rf "$DEB_DIR" "$DEB_ROOT" "$KEYRING_DEB" + else + # The binary archives (redist) are guaranteed to be updated as part of the release posting. + # Use the runtime workspace mount so this also works inside container jobs. + CTK_REDIST_TOOL="${GITHUB_WORKSPACE}/ci/tools/fetch_ctk_redistrib.py" + CTK_BASE_URL="https://developer.download.nvidia.com/compute/cuda/redist/" + CTK_JSON_URL="$CTK_BASE_URL/redistrib_${{ inputs.cuda-version }}.json" + CTK_JSON_FILE="$CACHE_TMP_DIR/redistrib.json" + curl -fLSs "$CTK_JSON_URL" -o "$CTK_JSON_FILE" + if [[ "${{ inputs.host-platform }}" == linux* ]]; then + function extract() { + tar -xvf $1 -C $CACHE_TMP_DIR --strip-components=1 + } + elif [[ "${{ inputs.host-platform }}" == "win-64" ]]; then + function extract() { + _TEMP_DIR_=$(mktemp -d) + unzip $1 -d $_TEMP_DIR_ + cp -r $_TEMP_DIR_/*/* $CACHE_TMP_DIR + rm -rf $_TEMP_DIR_ + # see commit NVIDIA/cuda-python@69410f1d9228e775845ef6c8b4a9c7f37ffc68a5 + chmod 644 $CACHE_TMP_DIR/LICENSE + } + fi + function populate_cuda_path() { + # take the component name as a argument + function download() { + curl -fLSs $1 -o $2 + } + CTK_COMPONENT=$1 + CTK_COMPONENT_REL_PATH="$(python "$CTK_REDIST_TOOL" component-relative-path \ + --host-platform "${{ inputs.host-platform }}" \ + --component "$CTK_COMPONENT" \ + --metadata-path "$CTK_JSON_FILE")" + CTK_COMPONENT_URL="${CTK_BASE_URL}/${CTK_COMPONENT_REL_PATH}" + CTK_COMPONENT_COMPONENT_FILENAME="$(basename $CTK_COMPONENT_REL_PATH)" + download $CTK_COMPONENT_URL $CTK_COMPONENT_COMPONENT_FILENAME + extract $CTK_COMPONENT_COMPONENT_FILENAME + rm $CTK_COMPONENT_COMPONENT_FILENAME } + + # Get headers and shared libraries in place + for item in $(echo $CTK_CACHE_COMPONENTS | tr ',' ' '); do + populate_cuda_path "$item" + done fi - function populate_cuda_path() { - # take the component name as a argument - function download() { - curl -LSs $1 -o $2 - } - CTK_COMPONENT=$1 - CTK_COMPONENT_REL_PATH="$(python "$CTK_REDIST_TOOL" component-relative-path \ - --host-platform "${{ inputs.host-platform }}" \ - --component "$CTK_COMPONENT" \ - --metadata-path "$CTK_JSON_FILE")" - CTK_COMPONENT_URL="${CTK_BASE_URL}/${CTK_COMPONENT_REL_PATH}" - CTK_COMPONENT_COMPONENT_FILENAME="$(basename $CTK_COMPONENT_REL_PATH)" - download $CTK_COMPONENT_URL $CTK_COMPONENT_COMPONENT_FILENAME - extract $CTK_COMPONENT_COMPONENT_FILENAME - rm $CTK_COMPONENT_COMPONENT_FILENAME - } - - # Get headers and shared libraries in place - for item in $(echo $CTK_CACHE_COMPONENTS | tr ',' ' '); do - populate_cuda_path "$item" - done # TODO: check Windows if [[ "${{ inputs.host-platform }}" == linux* && -d "${CACHE_TMP_DIR}/lib" ]]; then mv $CACHE_TMP_DIR/lib $CACHE_TMP_DIR/lib64 @@ -120,8 +185,12 @@ runs: # Note: try to escape | and > ... tar -czvf ${CTK_CACHE_FILENAME} ${CACHE_TMP_DIR} - # "Move" files from temp dir to CUDA_PATH - CUDA_PATH="./cuda_toolkit" + # Populate the final CUDA_PATH directly (never stage through ./cuda_toolkit + # unconditionally — a second call with a different cuda-path would leave + # symlinks from a prerelease CTK at ./cuda_toolkit/include etc., causing + # "cp: cannot overwrite non-directory" failures on the next restore). + CUDA_PATH="${{ inputs.cuda-path }}" + rm -rf $CUDA_PATH mkdir -p $CUDA_PATH # Unfortunately we cannot use "rsync -av $CACHE_TMP_DIR/ $CUDA_PATH" because # not all runners have rsync pre-installed (or even installable, such as @@ -144,7 +213,8 @@ runs: run: | ls -l CACHE_TMP_DIR="./cache_tmp_dir" - CUDA_PATH="./cuda_toolkit" + CUDA_PATH="${{ inputs.cuda-path }}" + rm -rf $CUDA_PATH mkdir -p $CUDA_PATH tar -xzvf $CTK_CACHE_FILENAME # Can't use rsync here, see above @@ -155,12 +225,6 @@ runs: exit 1 fi - - name: Move CTK to the specified location - if: ${{ inputs.cuda-path != './cuda_toolkit' }} - shell: bash --noprofile --norc -xeuo pipefail {0} - run: | - mv ./cuda_toolkit ${{ inputs.cuda-path }} - - name: Set output environment variables shell: bash --noprofile --norc -xeuo pipefail {0} run: | diff --git a/.github/workflows/build-docs.yml b/.github/workflows/build-docs.yml index 7bb70809556..32a92214648 100644 --- a/.github/workflows/build-docs.yml +++ b/.github/workflows/build-docs.yml @@ -64,8 +64,10 @@ jobs: run: | if [[ -f ci/versions.yml ]]; then BUILD_CTK_VER=$(yq '.cuda.build.version' ci/versions.yml) + BUILD_CTK_CHANNEL=$(yq '.cuda.build.channel // "stable"' ci/versions.yml) elif [[ -f ci/versions.json ]]; then BUILD_CTK_VER=$(jq -r '.cuda.build.version' ci/versions.json) + BUILD_CTK_CHANNEL=$(jq -r '.cuda.build.channel // "stable"' ci/versions.json) else echo "error: cannot find ci/versions.yml or ci/versions.json" >&2 exit 1 @@ -75,6 +77,7 @@ jobs: exit 1 fi echo "BUILD_CTK_VER=${BUILD_CTK_VER}" >> "$GITHUB_ENV" + echo "BUILD_CTK_CHANNEL=${BUILD_CTK_CHANNEL}" >> "$GITHUB_ENV" # TODO: This workflow runs on GH-hosted runner and cannot use the proxy cache @@ -100,6 +103,7 @@ jobs: with: host-platform: linux-64 cuda-version: ${{ env.BUILD_CTK_VER }} + cuda-channel: ${{ env.BUILD_CTK_CHANNEL }} - name: Set environment variables run: | diff --git a/.github/workflows/build-wheel.yml b/.github/workflows/build-wheel.yml index 4dac9c8eca9..07d253f5c11 100644 --- a/.github/workflows/build-wheel.yml +++ b/.github/workflows/build-wheel.yml @@ -11,6 +11,10 @@ on: cuda-version: required: true type: string + cuda-channel: + required: false + type: string + default: stable prev-cuda-version: required: true type: string @@ -164,6 +168,7 @@ jobs: with: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ inputs.cuda-version }} + cuda-channel: ${{ inputs.cuda-channel }} - name: Build cuda.bindings wheel uses: pypa/cibuildwheel@294735312765b09d24a2fbec22660ce817587d55 # v4.1.0 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fe43b52d01a..2452ff13b01 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -31,6 +31,7 @@ jobs: runs-on: ubuntu-latest outputs: CUDA_BUILD_VER: ${{ steps.get-vars.outputs.cuda_build_ver }} + CUDA_BUILD_CHANNEL: ${{ steps.get-vars.outputs.cuda_build_channel }} CUDA_PREV_BUILD_VER: ${{ steps.get-vars.outputs.cuda_prev_build_ver }} steps: - name: Checkout repository @@ -43,6 +44,9 @@ jobs: cuda_build_ver=$(yq '.cuda.build.version' ci/versions.yml) echo "cuda_build_ver=$cuda_build_ver" >> $GITHUB_OUTPUT + cuda_build_channel=$(yq '.cuda.build.channel // "stable"' ci/versions.yml) + echo "cuda_build_channel=$cuda_build_channel" >> $GITHUB_OUTPUT + cuda_prev_build_ver=$(yq '.cuda.prev_build.version' ci/versions.yml) echo "cuda_prev_build_ver=$cuda_prev_build_ver" >> $GITHUB_OUTPUT @@ -250,6 +254,7 @@ jobs: with: host-platform: ${{ matrix.host-platform }} cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + cuda-channel: ${{ needs.ci-vars.outputs.CUDA_BUILD_CHANNEL }} prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} # See build-linux-64 for why build jobs are split by platform. @@ -269,6 +274,7 @@ jobs: with: host-platform: ${{ matrix.host-platform }} cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + cuda-channel: ${{ needs.ci-vars.outputs.CUDA_BUILD_CHANNEL }} prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} # See build-linux-64 for why build jobs are split by platform. @@ -282,12 +288,13 @@ jobs: host-platform: - win-64 name: Build ${{ matrix.host-platform }}, CUDA ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} - if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }} + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) && needs.ci-vars.outputs.CUDA_BUILD_CHANNEL != 'prerelease' }} secrets: inherit uses: ./.github/workflows/build-wheel.yml with: host-platform: ${{ matrix.host-platform }} cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + cuda-channel: ${{ needs.ci-vars.outputs.CUDA_BUILD_CHANNEL }} prev-cuda-version: ${{ needs.ci-vars.outputs.CUDA_PREV_BUILD_VER }} # NOTE: test-sdist jobs are split by platform (mirroring build-* and test-wheel-*) @@ -307,6 +314,7 @@ jobs: with: host-platform: linux-64 cuda-version: ${{ needs.ci-vars.outputs.CUDA_BUILD_VER }} + cuda-channel: ${{ needs.ci-vars.outputs.CUDA_BUILD_CHANNEL }} # See test-sdist-linux for why sdist test jobs are split by platform. test-sdist-windows: @@ -314,7 +322,7 @@ jobs: - ci-vars - should-skip name: Test sdist win-64 - if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) }} + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.skip) && !fromJSON(needs.should-skip.outputs.doc-only) && needs.ci-vars.outputs.CUDA_BUILD_CHANNEL != 'prerelease' }} secrets: inherit uses: ./.github/workflows/test-sdist-windows.yml with: @@ -383,7 +391,7 @@ jobs: host-platform: - win-64 name: Test ${{ matrix.host-platform }} - if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.doc-only) }} + if: ${{ github.repository_owner == 'nvidia' && !fromJSON(needs.should-skip.outputs.doc-only) && needs.ci-vars.outputs.CUDA_BUILD_CHANNEL != 'prerelease' }} permissions: contents: read # This is required for actions/checkout needs: @@ -421,6 +429,7 @@ jobs: if: always() runs-on: ubuntu-latest needs: + - ci-vars - should-skip - detect-changes - test-sdist-linux @@ -447,6 +456,7 @@ jobs: fi doc_only="${{ needs.should-skip.outputs.doc-only }}" + cuda_build_channel="${{ needs.ci-vars.outputs.CUDA_BUILD_CHANNEL }}" status="success" check_result() { name=$1; expected=$2; result=$3 @@ -458,16 +468,28 @@ jobs: } # always expected to succeed (even in [doc-only] mode) + check_result "ci-vars" "success" "${{ needs.ci-vars.result }}" check_result "should-skip" "success" "${{ needs.should-skip.result }}" check_result "detect-changes" "success" "${{ needs.detect-changes.result }}" check_result "doc" "success" "${{ needs.doc.result }}" - # [doc-only] flips these from 'success' to 'skipped' - if [[ "$doc_only" == "true" ]]; then expected="skipped"; else expected="success"; fi - check_result "test-sdist-linux" "$expected" "${{ needs.test-sdist-linux.result }}" - check_result "test-sdist-windows" "$expected" "${{ needs.test-sdist-windows.result }}" - check_result "test-linux-64" "$expected" "${{ needs.test-linux-64.result }}" - check_result "test-linux-aarch64" "$expected" "${{ needs.test-linux-aarch64.result }}" - check_result "test-windows" "$expected" "${{ needs.test-windows.result }}" + # [doc-only] skips all tests. Prerelease CUDA packages currently support + # Linux only, so Windows tests are also skipped for that channel. + if [[ "$doc_only" == "true" ]]; then + linux_expected="skipped" + windows_expected="skipped" + else + linux_expected="success" + if [[ "$cuda_build_channel" == "prerelease" ]]; then + windows_expected="skipped" + else + windows_expected="success" + fi + fi + check_result "test-sdist-linux" "$linux_expected" "${{ needs.test-sdist-linux.result }}" + check_result "test-sdist-windows" "$windows_expected" "${{ needs.test-sdist-windows.result }}" + check_result "test-linux-64" "$linux_expected" "${{ needs.test-linux-64.result }}" + check_result "test-linux-aarch64" "$linux_expected" "${{ needs.test-linux-aarch64.result }}" + check_result "test-windows" "$windows_expected" "${{ needs.test-windows.result }}" [[ "$status" == "success" ]] diff --git a/.github/workflows/test-sdist-linux.yml b/.github/workflows/test-sdist-linux.yml index 9d077912f3c..cc00dfee680 100644 --- a/.github/workflows/test-sdist-linux.yml +++ b/.github/workflows/test-sdist-linux.yml @@ -11,6 +11,10 @@ on: cuda-version: required: true type: string + cuda-channel: + required: false + type: string + default: stable defaults: run: @@ -80,6 +84,7 @@ jobs: with: host-platform: ${{ inputs.host-platform }} cuda-version: ${{ inputs.cuda-version }} + cuda-channel: ${{ inputs.cuda-channel }} # cuda_bindings/setup.py parses CUDA headers at import time, so CUDA_PATH # (set by fetch_ctk) must be available for both sdist and wheel builds. diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 029e69da916..8a95d188070 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -80,6 +80,7 @@ repos: - --max-retries=3 - --no-progress files: '\.(md|rst)$' + exclude: ^qa/ # Standard hooks - repo: https://github.com/pre-commit/pre-commit-hooks diff --git a/ci/tools/fetch_ctk_redistrib.py b/ci/tools/fetch_ctk_redistrib.py index 5007765516e..7a40dc3010d 100644 --- a/ci/tools/fetch_ctk_redistrib.py +++ b/ci/tools/fetch_ctk_redistrib.py @@ -28,6 +28,21 @@ "cuda_cccl": ("cccl",), } +PREVIEW_COMPONENT_PACKAGES: dict[str, str] = { + "cuda_cccl": "cccl", + "cuda_crt": "cuda-crt", + "cuda_cudart": "cuda-cudart-dev", + "cuda_cupti": "cuda-cupti-dev", + "cuda_nvcc": "cuda-nvcc", + "cuda_nvrtc": "cuda-nvrtc-dev", + "cuda_profiler_api": "cuda-profiler-api", + "libcudla": "libcudla-dev", + "libcufile": "libcufile-dev", + "libnvfatbin": "libnvfatbin-dev", + "libnvjitlink": "libnvjitlink-dev", + "libnvvm": "libnvvm", +} + def host_platform_to_subdir(host_platform: str) -> str: try: @@ -108,6 +123,31 @@ def filter_components( return filtered, skipped +def get_preview_packages(*, host_platform: str, cuda_version: str, components: str) -> tuple[list[str], list[str]]: + if not host_platform.startswith("linux-"): + raise ValueError(f"CUDA prerelease packages are not supported for host-platform {host_platform!r}") + + version_parts = cuda_version.split(".") + if len(version_parts) != 3 or not all(part.isdigit() for part in version_parts): + raise ValueError(f"invalid cuda-version: {cuda_version!r}") + package_suffix = "-".join(version_parts[:2]) + + packages = [] + skipped = [] + for component in filter_static_components(split_components(components), host_platform, cuda_version): + if component == "libcudla" and host_platform != "linux-aarch64": + skipped.append(component) + continue + try: + package_base = PREVIEW_COMPONENT_PACKAGES[component] + except KeyError as exc: + raise ValueError(f"unsupported CUDA prerelease component: {component!r}") from exc + package = f"{package_base}-{package_suffix}" + if package not in packages: + packages.append(package) + return packages, skipped + + def get_component_relative_path(metadata: dict[str, Any], *, host_platform: str, component: str) -> str: ctk_subdir = host_platform_to_subdir(host_platform) component = resolve_component_name(metadata, component) @@ -142,6 +182,11 @@ def parse_args(argv: list[str] | None = None) -> argparse.Namespace: relpath_parser.add_argument("--metadata-path") relpath_parser.add_argument("--metadata-url") + preview_parser = subparsers.add_parser("preview-packages") + preview_parser.add_argument("--host-platform", required=True) + preview_parser.add_argument("--cuda-version", required=True) + preview_parser.add_argument("--components", required=True) + return parser.parse_args(argv) @@ -149,8 +194,22 @@ def main(argv: list[str] | None = None) -> int: args = parse_args(argv) try: - metadata = load_metadata(metadata_path=args.metadata_path, metadata_url=args.metadata_url) + if args.command == "preview-packages": + packages, skipped = get_preview_packages( + host_platform=args.host_platform, + cuda_version=args.cuda_version, + components=args.components, + ) + for component in skipped: + print( + f"Skipping unsupported CUDA prerelease component {component!r} " + f"for host-platform {args.host_platform!r}", + file=sys.stderr, + ) + print(",".join(packages)) + return 0 + metadata = load_metadata(metadata_path=args.metadata_path, metadata_url=args.metadata_url) if args.command == "filter-components": filtered, skipped = filter_components( metadata, diff --git a/ci/tools/tests/test_fetch_ctk_redistrib.py b/ci/tools/tests/test_fetch_ctk_redistrib.py new file mode 100644 index 00000000000..9dbd546b648 --- /dev/null +++ b/ci/tools/tests/test_fetch_ctk_redistrib.py @@ -0,0 +1,66 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +import pytest + +from ci.tools.fetch_ctk_redistrib import get_preview_packages + + +@pytest.mark.agent_authored(model="gpt-5.6-sol") +def test_get_preview_packages_linux_x86_64(): + packages, skipped = get_preview_packages( + host_platform="linux-64", + cuda_version="13.4.0", + components="cuda_cudart,cuda_nvrtc,cuda_cccl,libnvjitlink,libcudla", + ) + + assert packages == [ + "cuda-cudart-dev-13-4", + "cuda-nvrtc-dev-13-4", + "cccl-13-4", + "libnvjitlink-dev-13-4", + ] + assert skipped == ["libcudla"] + + +@pytest.mark.agent_authored(model="gpt-5.6-sol") +def test_get_preview_packages_linux_aarch64(): + packages, skipped = get_preview_packages( + host_platform="linux-aarch64", + cuda_version="13.4.0", + components="cuda_cudart,libcudla,libcufile", + ) + + assert packages == [ + "cuda-cudart-dev-13-4", + "libcudla-dev-13-4", + "libcufile-dev-13-4", + ] + assert skipped == [] + + +@pytest.mark.agent_authored(model="gpt-5.6-sol") +def test_get_preview_packages_rejects_windows(): + with pytest.raises(ValueError, match="not supported"): + get_preview_packages( + host_platform="win-64", + cuda_version="13.4.0", + components="cuda_cudart", + ) + + +@pytest.mark.agent_authored(model="gpt-5.6-sol") +@pytest.mark.parametrize( + ("cuda_version", "components", "message"), + [ + ("13.4", "cuda_cudart", "invalid cuda-version"), + ("13.4.0", "unknown", "unsupported CUDA prerelease component"), + ], +) +def test_get_preview_packages_rejects_invalid_input(cuda_version, components, message): + with pytest.raises(ValueError, match=message): + get_preview_packages( + host_platform="linux-64", + cuda_version=cuda_version, + components=components, + ) diff --git a/ci/versions.yml b/ci/versions.yml index 0f0ab251e50..4da77b95ef7 100644 --- a/ci/versions.yml +++ b/ci/versions.yml @@ -1,10 +1,11 @@ -# SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 backport_branch: "12.9.x" # keep in sync with target-branch in .github/dependabot.yml cuda: build: - version: "13.3.0" + version: "13.4.0" + channel: "prerelease" prev_build: version: "12.9.1" diff --git a/cuda_bindings/cuda/bindings/_internal/cudla.pxd b/cuda_bindings/cuda/bindings/_internal/cudla.pxd index 359cf8f486a..2594bb88da9 100644 --- a/cuda_bindings/cuda/bindings/_internal/cudla.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cudla.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=07f18bf6993a0d962a4e844aa9ea9a335534c669992d112dd12003b77015e5ba +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=496ca23b9a84c00538bab7ea91ea3789a1caece491349843387a706509454f43 from ..cycudla cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx index d65ecc2c9d4..284c90b15e1 100644 --- a/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cudla_linux.pyx @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=052aecd587e459179f49158c93f43cde9e327476eedfb5be12e98520f7401d94 +# This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b11294791915840a6cb53811f7ce9d81a295c011e6d3c7585aa0c4d45be6bf43 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx b/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx index 52a50e606ee..09c20781d71 100644 --- a/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cudla_windows.pyx @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=32765bada1ce206d4a0f4790d6c14563b07e79567fc4569c6a843ccb086ab620 +# This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e076e29e87500d2bdc0a65891978259cc1be746831c7b7177427daf7a970708e # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/cufile.pxd b/cuda_bindings/cuda/bindings/_internal/cufile.pxd index b8fe03b779d..b8c508e21de 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile.pxd +++ b/cuda_bindings/cuda/bindings/_internal/cufile.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b70fdd33eb00b70224c097fb28dd1031d82e8a2930356a4428c93e3bd1b52a86 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=aa4406f8a34fc4f1cf43294df5b80bcd84c0beb3b43dbcb66ecdbca3e17d439e from ..cycufile cimport * @@ -55,3 +56,5 @@ cdef CUfileError_t _cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t _cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil +cdef ssize_t _cuFileReadv(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil +cdef ssize_t _cuFileWritev(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil diff --git a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx index 1491c4588aa..baa2bd94858 100644 --- a/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/cufile_linux.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=73d6889e33bb56f1e0e63be7a0ba1f176c5c09e6e1adf9c4360d23335e131260 +# This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=84741b6deffabec746bbb6a7efa6a638e72579f8eae7731380ae3c1718f1854b # <<<< PREAMBLE CONTENT >>>> @@ -109,6 +110,8 @@ cdef void* __cuFileGetStatsL3 = NULL cdef void* __cuFileGetBARSizeInKB = NULL cdef void* __cuFileSetParameterPosixPoolSlabArray = NULL cdef void* __cuFileGetParameterPosixPoolSlabArray = NULL +cdef void* __cuFileReadv = NULL +cdef void* __cuFileWritev = NULL cdef int _init_cufile() except -1 nogil: global _cyb___py_cufile_init @@ -417,6 +420,20 @@ cdef int _init_cufile() except -1 nogil: handle = load_library() __cuFileGetParameterPosixPoolSlabArray = _cyb_dlsym(handle, 'cuFileGetParameterPosixPoolSlabArray') + global __cuFileReadv + __cuFileReadv = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileReadv') + if __cuFileReadv == NULL: + if handle == NULL: + handle = load_library() + __cuFileReadv = _cyb_dlsym(handle, 'cuFileReadv') + + global __cuFileWritev + __cuFileWritev = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'cuFileWritev') + if __cuFileWritev == NULL: + if handle == NULL: + handle = load_library() + __cuFileWritev = _cyb_dlsym(handle, 'cuFileWritev') + _cyb_atomic_int_store(&_cyb___py_cufile_init, 1) return 0 @@ -562,6 +579,12 @@ cpdef dict _inspect_function_pointers(): global __cuFileGetParameterPosixPoolSlabArray data["__cuFileGetParameterPosixPoolSlabArray"] = <_cyb_intptr_t>__cuFileGetParameterPosixPoolSlabArray + + global __cuFileReadv + data["__cuFileReadv"] = <_cyb_intptr_t>__cuFileReadv + + global __cuFileWritev + data["__cuFileWritev"] = <_cyb_intptr_t>__cuFileWritev _cyb_func_ptrs = data return data @@ -1013,3 +1036,23 @@ cdef CUfileError_t _cuFileGetParameterPosixPoolSlabArray(size_t* size_values, si raise FunctionNotFoundError("function cuFileGetParameterPosixPoolSlabArray is not found") return (__cuFileGetParameterPosixPoolSlabArray)( size_values, count_values, len) + + +cdef ssize_t _cuFileReadv(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil: + global __cuFileReadv + _check_or_init_cufile() + if __cuFileReadv == NULL: + with gil: + raise FunctionNotFoundError("function cuFileReadv is not found") + return (__cuFileReadv)( + fh, iov, iovcnt, file_offset, flags) + + +cdef ssize_t _cuFileWritev(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil: + global __cuFileWritev + _check_or_init_cufile() + if __cuFileWritev == NULL: + with gil: + raise FunctionNotFoundError("function cuFileWritev is not found") + return (__cuFileWritev)( + fh, iov, iovcnt, file_offset, flags) diff --git a/cuda_bindings/cuda/bindings/_internal/driver.pxd b/cuda_bindings/cuda/bindings/_internal/driver.pxd index d0d183d034c..2996ff8d559 100644 --- a/cuda_bindings/cuda/bindings/_internal/driver.pxd +++ b/cuda_bindings/cuda/bindings/_internal/driver.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a82b3f5dcb30b13294f6896a4d9d9f2f8d7be6b29c8f0a0c61677b1c622d4480 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d0aeaada84c702fe1713aefa6074c6d8154cfe31f48f0371403d941c41205d6b from ..cydriver cimport * @@ -529,3 +530,10 @@ cdef CUresult _cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* han cdef CUresult _cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult _cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetFabricClusterUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetCliqueCount(size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuDeviceGetCliqueInfo(CUcliqueInfo* cliqueInfo, size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuMemGetLocationInfo(CUdeviceptr ptr, size_t size, size_t summaryGranularity, size_t samplingGranularity, CUmemLocation* location_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphAddNode_v3(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuGraphNodeSetParams_v2(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx b/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx index 25b7e9330ac..9473f1d6afb 100644 --- a/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/driver_linux.pyx @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=93ad3ec4e08c2af84cb387a5321ad62c2ce683d690ad6865196771e4766eb127 +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1e5b152412ef388b8a785b8362155fef84faecf8a3575f95461cedb918b08fb0 # <<<< PREAMBLE CONTENT >>>> @@ -584,6 +585,13 @@ cdef void* __cuLogicalEndpointImport = NULL cdef void* __cuLogicalEndpointGetLimits = NULL cdef void* __cuLogicalEndpointQuery = NULL cdef void* __cuStreamBeginRecaptureToGraph = NULL +cdef void* __cuDeviceGetFabricClusterUuid = NULL +cdef void* __cuDeviceGetCliqueCount = NULL +cdef void* __cuDeviceGetCliqueInfo = NULL +cdef void* __cuMemGetLocationInfo = NULL +cdef void* __cuGraphAddNode_v3 = NULL +cdef void* __cuGraphNodeSetParams_v2 = NULL +cdef void* __cuCheckpointOperationComplete = NULL cdef int _init_driver() except -1 nogil: global _cyb___py_driver_init @@ -2155,6 +2163,27 @@ cdef int _init_driver() except -1 nogil: global __cuStreamBeginRecaptureToGraph cuGetProcAddress_v2('cuStreamBeginRecaptureToGraph', &__cuStreamBeginRecaptureToGraph, 13030, ptds_mode, NULL) + global __cuDeviceGetFabricClusterUuid + cuGetProcAddress_v2('cuDeviceGetFabricClusterUuid', &__cuDeviceGetFabricClusterUuid, 13040, ptds_mode, NULL) + + global __cuDeviceGetCliqueCount + cuGetProcAddress_v2('cuDeviceGetCliqueCount', &__cuDeviceGetCliqueCount, 13040, ptds_mode, NULL) + + global __cuDeviceGetCliqueInfo + cuGetProcAddress_v2('cuDeviceGetCliqueInfo', &__cuDeviceGetCliqueInfo, 13040, ptds_mode, NULL) + + global __cuMemGetLocationInfo + cuGetProcAddress_v2('cuMemGetLocationInfo', &__cuMemGetLocationInfo, 13040, ptds_mode, NULL) + + global __cuGraphAddNode_v3 + cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v3, 13040, ptds_mode, NULL) + + global __cuGraphNodeSetParams_v2 + cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams_v2, 13040, ptds_mode, NULL) + + global __cuCheckpointOperationComplete + cuGetProcAddress_v2('cuCheckpointOperationComplete', &__cuCheckpointOperationComplete, 13040, ptds_mode, NULL) + _cyb_atomic_int_store(&_cyb___py_driver_init, 1) return 0 @@ -3722,6 +3751,27 @@ cpdef dict _inspect_function_pointers(): global __cuStreamBeginRecaptureToGraph data["__cuStreamBeginRecaptureToGraph"] = <_cyb_intptr_t>__cuStreamBeginRecaptureToGraph + + global __cuDeviceGetFabricClusterUuid + data["__cuDeviceGetFabricClusterUuid"] = <_cyb_intptr_t>__cuDeviceGetFabricClusterUuid + + global __cuDeviceGetCliqueCount + data["__cuDeviceGetCliqueCount"] = <_cyb_intptr_t>__cuDeviceGetCliqueCount + + global __cuDeviceGetCliqueInfo + data["__cuDeviceGetCliqueInfo"] = <_cyb_intptr_t>__cuDeviceGetCliqueInfo + + global __cuMemGetLocationInfo + data["__cuMemGetLocationInfo"] = <_cyb_intptr_t>__cuMemGetLocationInfo + + global __cuGraphAddNode_v3 + data["__cuGraphAddNode_v3"] = <_cyb_intptr_t>__cuGraphAddNode_v3 + + global __cuGraphNodeSetParams_v2 + data["__cuGraphNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphNodeSetParams_v2 + + global __cuCheckpointOperationComplete + data["__cuCheckpointOperationComplete"] = <_cyb_intptr_t>__cuCheckpointOperationComplete _cyb_func_ptrs = data return data @@ -8912,3 +8962,73 @@ cdef CUresult _cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMo raise FunctionNotFoundError("function cuStreamBeginRecaptureToGraph is not found") return (__cuStreamBeginRecaptureToGraph)( hStream, mode, hGraph, callbackFunc, userData) + + +cdef CUresult _cuDeviceGetFabricClusterUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetFabricClusterUuid + _check_or_init_driver() + if __cuDeviceGetFabricClusterUuid == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetFabricClusterUuid is not found") + return (__cuDeviceGetFabricClusterUuid)( + uuid, dev) + + +cdef CUresult _cuDeviceGetCliqueCount(size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetCliqueCount + _check_or_init_driver() + if __cuDeviceGetCliqueCount == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetCliqueCount is not found") + return (__cuDeviceGetCliqueCount)( + count, dev) + + +cdef CUresult _cuDeviceGetCliqueInfo(CUcliqueInfo* cliqueInfo, size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetCliqueInfo + _check_or_init_driver() + if __cuDeviceGetCliqueInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetCliqueInfo is not found") + return (__cuDeviceGetCliqueInfo)( + cliqueInfo, count, dev) + + +cdef CUresult _cuMemGetLocationInfo(CUdeviceptr ptr, size_t size, size_t summaryGranularity, size_t samplingGranularity, CUmemLocation* location_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetLocationInfo + _check_or_init_driver() + if __cuMemGetLocationInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetLocationInfo is not found") + return (__cuMemGetLocationInfo)( + ptr, size, summaryGranularity, samplingGranularity, location_out) + + +cdef CUresult _cuGraphAddNode_v3(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddNode_v3 + _check_or_init_driver() + if __cuGraphAddNode_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddNode_v3 is not found") + return (__cuGraphAddNode_v3)( + phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) + + +cdef CUresult _cuGraphNodeSetParams_v2(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeSetParams_v2 + _check_or_init_driver() + if __cuGraphNodeSetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeSetParams_v2 is not found") + return (__cuGraphNodeSetParams_v2)( + hNode, nodeParams) + + +cdef CUresult _cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointOperationComplete + _check_or_init_driver() + if __cuCheckpointOperationComplete == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointOperationComplete is not found") + return (__cuCheckpointOperationComplete)( + handle) diff --git a/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx b/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx index 23ec74d7e6f..5bdc8edc360 100644 --- a/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/driver_windows.pyx @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=86a420a34dae5d88ef57070872a942cba79608505c6d67a2a77366185afcf6c6 +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=56597b55df27ab42b4557879c383d53e0cff68853d1802c993db0e9eb8a449c7 # <<<< PREAMBLE CONTENT >>>> @@ -585,6 +586,13 @@ cdef void* __cuLogicalEndpointImport = NULL cdef void* __cuLogicalEndpointGetLimits = NULL cdef void* __cuLogicalEndpointQuery = NULL cdef void* __cuStreamBeginRecaptureToGraph = NULL +cdef void* __cuDeviceGetFabricClusterUuid = NULL +cdef void* __cuDeviceGetCliqueCount = NULL +cdef void* __cuDeviceGetCliqueInfo = NULL +cdef void* __cuMemGetLocationInfo = NULL +cdef void* __cuGraphAddNode_v3 = NULL +cdef void* __cuGraphNodeSetParams_v2 = NULL +cdef void* __cuCheckpointOperationComplete = NULL cdef int _init_driver() except -1 nogil: global _cyb___py_driver_init @@ -2158,6 +2166,27 @@ cdef int _init_driver() except -1 nogil: global __cuStreamBeginRecaptureToGraph cuGetProcAddress_v2('cuStreamBeginRecaptureToGraph', &__cuStreamBeginRecaptureToGraph, 13030, ptds_mode, NULL) + global __cuDeviceGetFabricClusterUuid + cuGetProcAddress_v2('cuDeviceGetFabricClusterUuid', &__cuDeviceGetFabricClusterUuid, 13040, ptds_mode, NULL) + + global __cuDeviceGetCliqueCount + cuGetProcAddress_v2('cuDeviceGetCliqueCount', &__cuDeviceGetCliqueCount, 13040, ptds_mode, NULL) + + global __cuDeviceGetCliqueInfo + cuGetProcAddress_v2('cuDeviceGetCliqueInfo', &__cuDeviceGetCliqueInfo, 13040, ptds_mode, NULL) + + global __cuMemGetLocationInfo + cuGetProcAddress_v2('cuMemGetLocationInfo', &__cuMemGetLocationInfo, 13040, ptds_mode, NULL) + + global __cuGraphAddNode_v3 + cuGetProcAddress_v2('cuGraphAddNode', &__cuGraphAddNode_v3, 13040, ptds_mode, NULL) + + global __cuGraphNodeSetParams_v2 + cuGetProcAddress_v2('cuGraphNodeSetParams', &__cuGraphNodeSetParams_v2, 13040, ptds_mode, NULL) + + global __cuCheckpointOperationComplete + cuGetProcAddress_v2('cuCheckpointOperationComplete', &__cuCheckpointOperationComplete, 13040, ptds_mode, NULL) + _cyb_atomic_int_store(&_cyb___py_driver_init, 1) return 0 @@ -3725,6 +3754,27 @@ cpdef dict _inspect_function_pointers(): global __cuStreamBeginRecaptureToGraph data["__cuStreamBeginRecaptureToGraph"] = <_cyb_intptr_t>__cuStreamBeginRecaptureToGraph + + global __cuDeviceGetFabricClusterUuid + data["__cuDeviceGetFabricClusterUuid"] = <_cyb_intptr_t>__cuDeviceGetFabricClusterUuid + + global __cuDeviceGetCliqueCount + data["__cuDeviceGetCliqueCount"] = <_cyb_intptr_t>__cuDeviceGetCliqueCount + + global __cuDeviceGetCliqueInfo + data["__cuDeviceGetCliqueInfo"] = <_cyb_intptr_t>__cuDeviceGetCliqueInfo + + global __cuMemGetLocationInfo + data["__cuMemGetLocationInfo"] = <_cyb_intptr_t>__cuMemGetLocationInfo + + global __cuGraphAddNode_v3 + data["__cuGraphAddNode_v3"] = <_cyb_intptr_t>__cuGraphAddNode_v3 + + global __cuGraphNodeSetParams_v2 + data["__cuGraphNodeSetParams_v2"] = <_cyb_intptr_t>__cuGraphNodeSetParams_v2 + + global __cuCheckpointOperationComplete + data["__cuCheckpointOperationComplete"] = <_cyb_intptr_t>__cuCheckpointOperationComplete _cyb_func_ptrs = data return data @@ -8915,3 +8965,73 @@ cdef CUresult _cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMo raise FunctionNotFoundError("function cuStreamBeginRecaptureToGraph is not found") return (__cuStreamBeginRecaptureToGraph)( hStream, mode, hGraph, callbackFunc, userData) + + +cdef CUresult _cuDeviceGetFabricClusterUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetFabricClusterUuid + _check_or_init_driver() + if __cuDeviceGetFabricClusterUuid == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetFabricClusterUuid is not found") + return (__cuDeviceGetFabricClusterUuid)( + uuid, dev) + + +cdef CUresult _cuDeviceGetCliqueCount(size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetCliqueCount + _check_or_init_driver() + if __cuDeviceGetCliqueCount == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetCliqueCount is not found") + return (__cuDeviceGetCliqueCount)( + count, dev) + + +cdef CUresult _cuDeviceGetCliqueInfo(CUcliqueInfo* cliqueInfo, size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuDeviceGetCliqueInfo + _check_or_init_driver() + if __cuDeviceGetCliqueInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuDeviceGetCliqueInfo is not found") + return (__cuDeviceGetCliqueInfo)( + cliqueInfo, count, dev) + + +cdef CUresult _cuMemGetLocationInfo(CUdeviceptr ptr, size_t size, size_t summaryGranularity, size_t samplingGranularity, CUmemLocation* location_out) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuMemGetLocationInfo + _check_or_init_driver() + if __cuMemGetLocationInfo == NULL: + with gil: + raise FunctionNotFoundError("function cuMemGetLocationInfo is not found") + return (__cuMemGetLocationInfo)( + ptr, size, summaryGranularity, samplingGranularity, location_out) + + +cdef CUresult _cuGraphAddNode_v3(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphAddNode_v3 + _check_or_init_driver() + if __cuGraphAddNode_v3 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphAddNode_v3 is not found") + return (__cuGraphAddNode_v3)( + phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) + + +cdef CUresult _cuGraphNodeSetParams_v2(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuGraphNodeSetParams_v2 + _check_or_init_driver() + if __cuGraphNodeSetParams_v2 == NULL: + with gil: + raise FunctionNotFoundError("function cuGraphNodeSetParams_v2 is not found") + return (__cuGraphNodeSetParams_v2)( + hNode, nodeParams) + + +cdef CUresult _cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuCheckpointOperationComplete + _check_or_init_driver() + if __cuCheckpointOperationComplete == NULL: + with gil: + raise FunctionNotFoundError("function cuCheckpointOperationComplete is not found") + return (__cuCheckpointOperationComplete)( + handle) diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd b/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd index b712a3087b8..d8f087af7fb 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b52d99b7f07615d6c5ecb869a5c632e6e9cb4d0cb4f6cb1e43977d29ecd9995c +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4176ab61d2c088c30ef453fdc5aee9f5f66e0cf76732826ab900fd211c143e14 from ..cynvfatbin cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx index 01881a519b5..09cefc0c8f9 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_linux.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f86a7f7527aad594d7b2e67742165454729ecca3810c00e6786f772099b17850 +# This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5351e00f0cca82ccf833f27a4729a538b46110830393e49526539505d0fbe1e9 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx index 69d1417e8b5..e0abd202bbe 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvfatbin_windows.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3b89f4c5e0a102d65950a485dab14517cb67887864d22152311d76341701e667 +# This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=91a09cd316df7848a0f2c3fba5e516a6e94749e3259b0fbd6f57e9b9873fce55 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd index edfe717e649..21d527a3c16 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fd32577c0d6b922ff30c56dc4f3dcbed2251c393098c27d972ccc8688564fa50 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=05522f152eb6cf5e4b8fc2c0bd25362366a36c9d3c976321ba0155ba330c6209 from ..cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx index 6c515c54d0f..7458f5b88e8 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_linux.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=11665992d7c94100ae00600171ac56e9e99ee0c2c43c1cb720b4df27602ca829 +# This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=539829faeb71eb1d20a60f5e4ad835826eee873b96694b6db8809b9b904bc7b8 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx index 6c2ccbd0671..9e279570c8d 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvjitlink_windows.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=72ad04bbd206b13b7c53a4530a55f9c84369e5fcf1599164b18546e2176f16f8 +# This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d90e50b8ffd6f1d66aa26e5a0d38b9e3a3c7a801114de8feabe626d622d50f81 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvml.pxd b/cuda_bindings/cuda/bindings/_internal/nvml.pxd index eea80739f07..d8addb4612e 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvml.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ed4c433854399c2e4f1adc3ffcfc37901e1be29c5aa50728498c87225edf92b1 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=11f3b1735ed60584030439236109205020cc620c548d63cce0c15615e6334e4a from ..cynvml cimport * @@ -363,3 +364,22 @@ cdef nvmlReturn_t _nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgp cdef nvmlReturn_t _nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +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, nvmlEventData_v2_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, unsigned int index, nvmlOperationalEventContextInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetContextData_v1(nvmlEventSet_t set, unsigned int index, void* data, unsigned int* dataSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, unsigned int index, nvmlGpuOperationalEventContextLegacyXid_v1_t* xid) 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 d2882b251b0..c61714f77dd 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_linux.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=646d902675de6987cff08e5702d3b2bff889e6a827273e57413aa5de45a5897a +# This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=735d5128e04ed65d3517e4315b5c05f9f1731c2f4dd00460925bb30f7090f6f5 # <<<< PREAMBLE CONTENT >>>> @@ -415,6 +416,25 @@ cdef void* __nvmlDeviceGetVgpuSchedulerLog_v2 = NULL cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = NULL cdef void* __nvmlDeviceSetVgpuSchedulerState_v2 = NULL cdef void* __nvmlGpuInstanceSetVgpuSchedulerState_v2 = NULL +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 @@ -2879,6 +2899,139 @@ cdef int _init_nvml() except -1 nogil: handle = load_library() __nvmlGpuInstanceSetVgpuSchedulerState_v2 = _cyb_dlsym(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + global __nvmlSystemGetCPER_v1 + __nvmlSystemGetCPER_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetCPER_v1') + if __nvmlSystemGetCPER_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetCPER_v1 = _cyb_dlsym(handle, 'nvmlSystemGetCPER_v1') + + global __nvmlDeviceGetBBXTimeData_v1 + __nvmlDeviceGetBBXTimeData_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetBBXTimeData_v1') + if __nvmlDeviceGetBBXTimeData_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetBBXTimeData_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetBBXTimeData_v1') + + global __nvmlDeviceGetAccountingStats_v2 + __nvmlDeviceGetAccountingStats_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetAccountingStats_v2') + if __nvmlDeviceGetAccountingStats_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetAccountingStats_v2 = _cyb_dlsym(handle, 'nvmlDeviceGetAccountingStats_v2') + + global __nvmlDeviceGetRemappedRows_v2 + __nvmlDeviceGetRemappedRows_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetRemappedRows_v2') + if __nvmlDeviceGetRemappedRows_v2 == NULL: + if handle == NULL: + 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 @@ -3948,6 +4101,63 @@ cpdef dict _inspect_function_pointers(): global __nvmlGpuInstanceSetVgpuSchedulerState_v2 data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState_v2 + + global __nvmlSystemGetCPER_v1 + data["__nvmlSystemGetCPER_v1"] = <_cyb_intptr_t>__nvmlSystemGetCPER_v1 + + global __nvmlDeviceGetBBXTimeData_v1 + data["__nvmlDeviceGetBBXTimeData_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBBXTimeData_v1 + + global __nvmlDeviceGetAccountingStats_v2 + data["__nvmlDeviceGetAccountingStats_v2"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingStats_v2 + + global __nvmlDeviceGetRemappedRows_v2 + data["__nvmlDeviceGetRemappedRows_v2"] = <_cyb_intptr_t>__nvmlDeviceGetRemappedRows_v2 + + global __nvmlDeviceSetAdaptiveTgpMode_v1 + data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = <_cyb_intptr_t>__nvmlDeviceSetAdaptiveTgpMode_v1 + + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = <_cyb_intptr_t>__nvmlDeviceGetAdaptiveTgpModeInfo_v1 + + global __nvmlDeviceSetMemoryLimits_v1 + data["__nvmlDeviceSetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceSetMemoryLimits_v1 + + global __nvmlDeviceGetMemoryLimits_v1 + data["__nvmlDeviceGetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryLimits_v1 + + global __nvmlDeviceGetGpuFabricInfo_v4 + data["__nvmlDeviceGetGpuFabricInfo_v4"] = <_cyb_intptr_t>__nvmlDeviceGetGpuFabricInfo_v4 + + global __nvmlDevicePerfMetricsGetSamples_v1 + data["__nvmlDevicePerfMetricsGetSamples_v1"] = <_cyb_intptr_t>__nvmlDevicePerfMetricsGetSamples_v1 + + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = <_cyb_intptr_t>__nvmlDeviceSetNvlinkBwModeAsync_v1 + + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkTelemetrySamples_v1 + + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = <_cyb_intptr_t>__nvmlEventSetRegisterGpuOperationalEvents_v1 + + global __nvmlEventSetWait_v3 + data["__nvmlEventSetWait_v3"] = <_cyb_intptr_t>__nvmlEventSetWait_v3 + + global __nvmlEventSetGetContextCount_v1 + data["__nvmlEventSetGetContextCount_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextCount_v1 + + global __nvmlEventSetGetContextInfo_v1 + data["__nvmlEventSetGetContextInfo_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextInfo_v1 + + global __nvmlEventSetGetContextData_v1 + data["__nvmlEventSetGetContextData_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextData_v1 + + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = <_cyb_intptr_t>__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + + global __nvmlDeviceGetBankRemapperStatus_v1 + data["__nvmlDeviceGetBankRemapperStatus_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBankRemapperStatus_v1 _cyb_func_ptrs = data return data @@ -7478,3 +7688,193 @@ cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpu raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState_v2 is not found") return (__nvmlGpuInstanceSetVgpuSchedulerState_v2)( gpuInstance, pSchedulerState) + + +cdef nvmlReturn_t _nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCPER_v1 + _check_or_init_nvml() + if __nvmlSystemGetCPER_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCPER_v1 is not found") + return (__nvmlSystemGetCPER_v1)( + cper) + + +cdef nvmlReturn_t _nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBBXTimeData_v1 + _check_or_init_nvml() + if __nvmlDeviceGetBBXTimeData_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBBXTimeData_v1 is not found") + return (__nvmlDeviceGetBBXTimeData_v1)( + device, timeData) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingStats_v2 + _check_or_init_nvml() + if __nvmlDeviceGetAccountingStats_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingStats_v2 is not found") + return (__nvmlDeviceGetAccountingStats_v2)( + device, stats) + + +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRemappedRows_v2 + _check_or_init_nvml() + if __nvmlDeviceGetRemappedRows_v2 == NULL: + with gil: + 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, nvmlEventData_v2_t* data, unsigned int timeoutms) 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, data, timeoutms) + + +cdef nvmlReturn_t _nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, unsigned int* count) 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, count) + + +cdef nvmlReturn_t _nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, unsigned int index, nvmlOperationalEventContextInfo_v1_t* info) 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, index, info) + + +cdef nvmlReturn_t _nvmlEventSetGetContextData_v1(nvmlEventSet_t set, unsigned int index, void* data, unsigned int* dataSize) 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, index, data, dataSize) + + +cdef nvmlReturn_t _nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, unsigned int index, nvmlGpuOperationalEventContextLegacyXid_v1_t* xid) 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, index, xid) + + +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 f7ae66ae98e..7b851e1aa4e 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvml_windows.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=831330186c4a7bb029b953be6dd3cda119a7f10c56fa9378ab621fbc4374f9d1 +# This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=10e6cb1d192514ece92e863cbebdde5c60b94cdc58d27a8c2e4cf9af1a27c968 # <<<< PREAMBLE CONTENT >>>> @@ -412,6 +413,25 @@ cdef void* __nvmlDeviceGetVgpuSchedulerLog_v2 = NULL cdef void* __nvmlGpuInstanceGetVgpuSchedulerLog_v2 = NULL cdef void* __nvmlDeviceSetVgpuSchedulerState_v2 = NULL cdef void* __nvmlGpuInstanceSetVgpuSchedulerState_v2 = NULL +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 @@ -1475,6 +1495,63 @@ cdef int _init_nvml() except -1 nogil: global __nvmlGpuInstanceSetVgpuSchedulerState_v2 __nvmlGpuInstanceSetVgpuSchedulerState_v2 = _cyb_GetProcAddress(handle, 'nvmlGpuInstanceSetVgpuSchedulerState_v2') + global __nvmlSystemGetCPER_v1 + __nvmlSystemGetCPER_v1 = _cyb_GetProcAddress(handle, 'nvmlSystemGetCPER_v1') + + global __nvmlDeviceGetBBXTimeData_v1 + __nvmlDeviceGetBBXTimeData_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBBXTimeData_v1') + + global __nvmlDeviceGetAccountingStats_v2 + __nvmlDeviceGetAccountingStats_v2 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetAccountingStats_v2') + + 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 @@ -2544,6 +2621,63 @@ cpdef dict _inspect_function_pointers(): global __nvmlGpuInstanceSetVgpuSchedulerState_v2 data["__nvmlGpuInstanceSetVgpuSchedulerState_v2"] = <_cyb_intptr_t>__nvmlGpuInstanceSetVgpuSchedulerState_v2 + + global __nvmlSystemGetCPER_v1 + data["__nvmlSystemGetCPER_v1"] = <_cyb_intptr_t>__nvmlSystemGetCPER_v1 + + global __nvmlDeviceGetBBXTimeData_v1 + data["__nvmlDeviceGetBBXTimeData_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBBXTimeData_v1 + + global __nvmlDeviceGetAccountingStats_v2 + data["__nvmlDeviceGetAccountingStats_v2"] = <_cyb_intptr_t>__nvmlDeviceGetAccountingStats_v2 + + global __nvmlDeviceGetRemappedRows_v2 + data["__nvmlDeviceGetRemappedRows_v2"] = <_cyb_intptr_t>__nvmlDeviceGetRemappedRows_v2 + + global __nvmlDeviceSetAdaptiveTgpMode_v1 + data["__nvmlDeviceSetAdaptiveTgpMode_v1"] = <_cyb_intptr_t>__nvmlDeviceSetAdaptiveTgpMode_v1 + + global __nvmlDeviceGetAdaptiveTgpModeInfo_v1 + data["__nvmlDeviceGetAdaptiveTgpModeInfo_v1"] = <_cyb_intptr_t>__nvmlDeviceGetAdaptiveTgpModeInfo_v1 + + global __nvmlDeviceSetMemoryLimits_v1 + data["__nvmlDeviceSetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceSetMemoryLimits_v1 + + global __nvmlDeviceGetMemoryLimits_v1 + data["__nvmlDeviceGetMemoryLimits_v1"] = <_cyb_intptr_t>__nvmlDeviceGetMemoryLimits_v1 + + global __nvmlDeviceGetGpuFabricInfo_v4 + data["__nvmlDeviceGetGpuFabricInfo_v4"] = <_cyb_intptr_t>__nvmlDeviceGetGpuFabricInfo_v4 + + global __nvmlDevicePerfMetricsGetSamples_v1 + data["__nvmlDevicePerfMetricsGetSamples_v1"] = <_cyb_intptr_t>__nvmlDevicePerfMetricsGetSamples_v1 + + global __nvmlDeviceSetNvlinkBwModeAsync_v1 + data["__nvmlDeviceSetNvlinkBwModeAsync_v1"] = <_cyb_intptr_t>__nvmlDeviceSetNvlinkBwModeAsync_v1 + + global __nvmlDeviceGetNvLinkTelemetrySamples_v1 + data["__nvmlDeviceGetNvLinkTelemetrySamples_v1"] = <_cyb_intptr_t>__nvmlDeviceGetNvLinkTelemetrySamples_v1 + + global __nvmlEventSetRegisterGpuOperationalEvents_v1 + data["__nvmlEventSetRegisterGpuOperationalEvents_v1"] = <_cyb_intptr_t>__nvmlEventSetRegisterGpuOperationalEvents_v1 + + global __nvmlEventSetWait_v3 + data["__nvmlEventSetWait_v3"] = <_cyb_intptr_t>__nvmlEventSetWait_v3 + + global __nvmlEventSetGetContextCount_v1 + data["__nvmlEventSetGetContextCount_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextCount_v1 + + global __nvmlEventSetGetContextInfo_v1 + data["__nvmlEventSetGetContextInfo_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextInfo_v1 + + global __nvmlEventSetGetContextData_v1 + data["__nvmlEventSetGetContextData_v1"] = <_cyb_intptr_t>__nvmlEventSetGetContextData_v1 + + global __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + data["__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1"] = <_cyb_intptr_t>__nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 + + global __nvmlDeviceGetBankRemapperStatus_v1 + data["__nvmlDeviceGetBankRemapperStatus_v1"] = <_cyb_intptr_t>__nvmlDeviceGetBankRemapperStatus_v1 _cyb_func_ptrs = data return data @@ -6073,3 +6207,193 @@ cdef nvmlReturn_t _nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpu raise FunctionNotFoundError("function nvmlGpuInstanceSetVgpuSchedulerState_v2 is not found") return (__nvmlGpuInstanceSetVgpuSchedulerState_v2)( gpuInstance, pSchedulerState) + + +cdef nvmlReturn_t _nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetCPER_v1 + _check_or_init_nvml() + if __nvmlSystemGetCPER_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetCPER_v1 is not found") + return (__nvmlSystemGetCPER_v1)( + cper) + + +cdef nvmlReturn_t _nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetBBXTimeData_v1 + _check_or_init_nvml() + if __nvmlDeviceGetBBXTimeData_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetBBXTimeData_v1 is not found") + return (__nvmlDeviceGetBBXTimeData_v1)( + device, timeData) + + +cdef nvmlReturn_t _nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetAccountingStats_v2 + _check_or_init_nvml() + if __nvmlDeviceGetAccountingStats_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetAccountingStats_v2 is not found") + return (__nvmlDeviceGetAccountingStats_v2)( + device, stats) + + +cdef nvmlReturn_t _nvmlDeviceGetRemappedRows_v2(nvmlDevice_t device, nvmlRemappedRowsInfo_v2_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetRemappedRows_v2 + _check_or_init_nvml() + if __nvmlDeviceGetRemappedRows_v2 == NULL: + with gil: + 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, nvmlEventData_v2_t* data, unsigned int timeoutms) 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, data, timeoutms) + + +cdef nvmlReturn_t _nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, unsigned int* count) 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, count) + + +cdef nvmlReturn_t _nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, unsigned int index, nvmlOperationalEventContextInfo_v1_t* info) 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, index, info) + + +cdef nvmlReturn_t _nvmlEventSetGetContextData_v1(nvmlEventSet_t set, unsigned int index, void* data, unsigned int* dataSize) 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, index, data, dataSize) + + +cdef nvmlReturn_t _nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, unsigned int index, nvmlGpuOperationalEventContextLegacyXid_v1_t* xid) 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, index, xid) + + +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/nvrtc.pxd b/cuda_bindings/cuda/bindings/_internal/nvrtc.pxd index 020f113c03b..68f4cc772fd 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvrtc.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ff79428bd0afac112d0a9f6131f9ed097b8d0ebc4574444a0e4a41e7f6e260d0 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8d4e35dd6b1a5b4d4138b57d889d92501da4c91fc6c3d38c050bb2359e033589 from ..cynvrtc cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx index e58f6920b4a..06a6277d829 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc_linux.pyx @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ff5d5beb8dc8a8fb1dac0241d4b72d29bf8c55cfd2cba627567cfab2d4d10767 +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3d6013b99cb59aaab8ae661d838401b123ed27efda53268eab153c7add7ca3a8 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx index 3c363d8f17b..752c659677f 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvrtc_windows.pyx @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=becc61b4d220395420a59980fa3a7dc2ea4c45e7c64881bf7819df3a57443343 +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=574a59b0c82321fb7c287f06c11dd873715e47bea253df57466f0cfc29d8f5de # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd index e4ac3cf1258..205bf7a658f 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/_internal/nvvm.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a27b041eb470b98bf5b1a0a92ace9467c5f3921d47ee10557a4f00ff1e4ac411 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1bb383561fd7ffa5411d336ed9df7dbd5d59ed0a9215e82c9938dd54266f9106 from ..cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx index d8b4271eb40..08f74faa61b 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_linux.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e0b66c45b6f66a7ab7bae49939a26007efef95651084f1ef09fd32848260f2c8 +# This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b8fe65feec44ce979fc981ea49fefa1b8bdd487092159d597ba5b18b427cc74d # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx index 31e23b6f792..2a6754f0450 100644 --- a/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/nvvm_windows.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=19fa5b34915a71deea0e75c2a16830e9571463f9cc32aa8b233853c303d6d742 +# This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1a8d9ee78bc417c85345caf1dd580ac660ab437cd874a89d6924786f4ad7aade # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/_internal/runtime.pxd b/cuda_bindings/cuda/bindings/_internal/runtime.pxd index 04a943808a3..6714704a175 100644 --- a/cuda_bindings/cuda/bindings/_internal/runtime.pxd +++ b/cuda_bindings/cuda/bindings/_internal/runtime.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=afc5b9003f3efc6f826b46b17b5294f581a00a97f82beaad39634b5037b7669a +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cd46e65c8b1ec45ff0541a157eeb974a3258f0540645a5616759d23b17e1bc10 from ..cyruntime cimport * # EGL/GL/VDPAU helper declarations (implementations included in runtime_linux/windows.pyx) @@ -337,3 +338,4 @@ cdef cudaError_t _cudaMemcpyWithAttributesAsync(void* dst, const void* src, size cdef cudaError_t _cudaMemcpy3DWithAttributesAsync(cudaMemcpy3DBatchOp* op, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil cdef cudaError_t _cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_internal/runtime_linux.pyx b/cuda_bindings/cuda/bindings/_internal/runtime_linux.pyx index 2d1409ce2be..86a17c1f8ff 100644 --- a/cuda_bindings/cuda/bindings/_internal/runtime_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/runtime_linux.pyx @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c45a1e41ddef35af045f2ff91e9703cb77870bf90603b3c5c7369e76f7a539f0 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1b990290e2d956f48a0006dfe6341c78d6198aecf0a1a20d2e71c7044869d220 import os from libc.stdint cimport uintptr_t @@ -1043,6 +1044,9 @@ cdef extern from 'cuda_runtime_api.h' nogil: cdef extern from 'cuda_runtime_api.h' nogil: cudaError_t _static_cudaStreamBeginRecaptureToGraph "cudaStreamBeginRecaptureToGraph" (cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) noexcept +cdef extern from 'cuda_runtime_api.h' nogil: + cudaError_t _static_cudaMemGetLocationInfo "cudaMemGetLocationInfo" (void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) noexcept + ############################################################################### # Wrapper functions @@ -3286,3 +3290,10 @@ cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStrea if usePTDS: return ptds._cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) return _static_cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) + + +cdef cudaError_t _cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemGetLocationInfo(devPtr, size, summaryGranularity, samplingGranularity, location_out) + return _static_cudaMemGetLocationInfo(devPtr, size, summaryGranularity, samplingGranularity, location_out) diff --git a/cuda_bindings/cuda/bindings/_internal/runtime_ptds.pxd b/cuda_bindings/cuda/bindings/_internal/runtime_ptds.pxd index e1685cd3680..cd7d433a2c1 100644 --- a/cuda_bindings/cuda/bindings/_internal/runtime_ptds.pxd +++ b/cuda_bindings/cuda/bindings/_internal/runtime_ptds.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fa210f57cc23e0c4cdcad28a1ab8292bc74cc6b557bb3ca1700d1be8c25aa6af +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7bcf08853dcfdf191a306446ddac7774147d679de81aad4209c5fd6c74e82ccc from ..cyruntime cimport * @@ -332,3 +333,4 @@ cdef cudaError_t _cudaMemcpyWithAttributesAsync(void* dst, const void* src, size cdef cudaError_t _cudaMemcpy3DWithAttributesAsync(cudaMemcpy3DBatchOp* op, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil cdef cudaError_t _cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t _cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil diff --git a/cuda_bindings/cuda/bindings/_internal/runtime_ptds_linux.pyx b/cuda_bindings/cuda/bindings/_internal/runtime_ptds_linux.pyx index 0f940954d0d..af100599378 100644 --- a/cuda_bindings/cuda/bindings/_internal/runtime_ptds_linux.pyx +++ b/cuda_bindings/cuda/bindings/_internal/runtime_ptds_linux.pyx @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=33b0c77f7174d41189a91abfe73613b5ba48bd31b5da37d509da61c00b11a004 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=35dccf403acb6cffa9cbefc4f90d1e05f20f86060d1eadd0342aff3de3bfdaca cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -977,6 +978,9 @@ cdef extern from 'cuda_runtime_api.h' nogil: cdef extern from 'cuda_runtime_api.h' nogil: cudaError_t _static_cudaStreamBeginRecaptureToGraph "cudaStreamBeginRecaptureToGraph" (cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) noexcept +cdef extern from 'cuda_runtime_api.h' nogil: + cudaError_t _static_cudaMemGetLocationInfo "cudaMemGetLocationInfo" (void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) noexcept + ############################################################################### # Wrapper functions @@ -2260,3 +2264,7 @@ cdef cudaError_t _cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodePara cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil: return _static_cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) + + +cdef cudaError_t _cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return _static_cudaMemGetLocationInfo(devPtr, size, summaryGranularity, samplingGranularity, location_out) diff --git a/cuda_bindings/cuda/bindings/_internal/runtime_ptds_windows.pyx b/cuda_bindings/cuda/bindings/_internal/runtime_ptds_windows.pyx index 0f940954d0d..af100599378 100644 --- a/cuda_bindings/cuda/bindings/_internal/runtime_ptds_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/runtime_ptds_windows.pyx @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=33b0c77f7174d41189a91abfe73613b5ba48bd31b5da37d509da61c00b11a004 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=35dccf403acb6cffa9cbefc4f90d1e05f20f86060d1eadd0342aff3de3bfdaca cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM @@ -977,6 +978,9 @@ cdef extern from 'cuda_runtime_api.h' nogil: cdef extern from 'cuda_runtime_api.h' nogil: cudaError_t _static_cudaStreamBeginRecaptureToGraph "cudaStreamBeginRecaptureToGraph" (cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) noexcept +cdef extern from 'cuda_runtime_api.h' nogil: + cudaError_t _static_cudaMemGetLocationInfo "cudaMemGetLocationInfo" (void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) noexcept + ############################################################################### # Wrapper functions @@ -2260,3 +2264,7 @@ cdef cudaError_t _cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodePara cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil: return _static_cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) + + +cdef cudaError_t _cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return _static_cudaMemGetLocationInfo(devPtr, size, summaryGranularity, samplingGranularity, location_out) diff --git a/cuda_bindings/cuda/bindings/_internal/runtime_windows.pyx b/cuda_bindings/cuda/bindings/_internal/runtime_windows.pyx index f848344f483..45161adb0c1 100644 --- a/cuda_bindings/cuda/bindings/_internal/runtime_windows.pyx +++ b/cuda_bindings/cuda/bindings/_internal/runtime_windows.pyx @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5f0e930fd8c13f49036a66fc40729a3270cc44d8b16234b1387b93e51f0e0a0f +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bbe09320a5e5a688b4b633aa016d3326deb51e3e02ed380b34b94556bc22b421 import os from libc.stdint cimport uintptr_t @@ -1031,6 +1032,9 @@ cdef extern from 'cuda_runtime_api.h' nogil: cdef extern from 'cuda_runtime_api.h' nogil: cudaError_t _static_cudaStreamBeginRecaptureToGraph "cudaStreamBeginRecaptureToGraph" (cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) noexcept +cdef extern from 'cuda_runtime_api.h' nogil: + cudaError_t _static_cudaMemGetLocationInfo "cudaMemGetLocationInfo" (void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) noexcept + ############################################################################### # Wrapper functions @@ -3274,3 +3278,10 @@ cdef cudaError_t _cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStrea if usePTDS: return ptds._cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) return _static_cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) + + +cdef cudaError_t _cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil: + cdef bint usePTDS = cudaPythonInit() + if usePTDS: + return ptds._cudaMemGetLocationInfo(devPtr, size, summaryGranularity, samplingGranularity, location_out) + return _static_cudaMemGetLocationInfo(devPtr, size, summaryGranularity, samplingGranularity, location_out) diff --git a/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py b/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py index 3ab48be6e02..7f35f006c36 100644 --- a/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py +++ b/cuda_bindings/cuda/bindings/_test_helpers/arch_check.py @@ -54,10 +54,11 @@ def unsupported_before(device: int, expected_device_arch: nvml.DeviceArch | str # The API call raised NotSupportedError, NVML status FunctionNotFoundError, # or NvmlSymbolNotFoundError (symbol absent from the loaded NVML DLL), so we # skip the test but don't fail it - pytest.skip( - f"Unsupported call for device architecture {nvml.DeviceArch(device_arch).name} " - f"on device '{nvml.device_get_name(device)}'" - ) + try: + name = nvml.DeviceArch(device_arch).name + except ValueError: + name = f"UNKNOWN({device_arch})" + pytest.skip(f"Unsupported call for device architecture {name} on device '{nvml.device_get_name(device)}'") # If the API call worked, just continue elif int(device_arch) < expected_device_arch_int: # In this case, we /know/ if will fail, and we want to assert that it does. diff --git a/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd b/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd index 1a0d1c811de..3e8aa8a3675 100644 --- a/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd +++ b/cuda_bindings/cuda/bindings/_v2/nvrtc.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=223716a3d6961dfe7231f2c88e76a9ab4c0a8d888cc4bf3e889bfbcbf8580346 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=632bbedaee3acec49d09764a74b02343ada9ddc14f52c6fe00843d62e147006b from libc.stdint cimport intptr_t from ..cynvrtc cimport * diff --git a/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx b/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx index 379350ffa6f..4e267b1bd47 100644 --- a/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx +++ b/cuda_bindings/cuda/bindings/_v2/nvrtc.pyx @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e5360fc057cdd7b8e28b4d502821443d190e589b200dce1a234494ad6e9abf93 +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b919b9cb09a71e4b2f6ad7dd1f76c7e3bf92b5cb1dd51c0d83087d2ce0cab581 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings/cuda/bindings/cudla.pxd b/cuda_bindings/cuda/bindings/cudla.pxd index cb58d685a24..97ecfb1bf25 100644 --- a/cuda_bindings/cuda/bindings/cudla.pxd +++ b/cuda_bindings/cuda/bindings/cudla.pxd @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e64a78a1b3e010d167373d7c9635ff4637dfd1a6a38ffafb671dcde4e12aaaad +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=436984a783ea5e6bef13945d0b6d60b4143aa08131c82cdea619337233b15737 from libc.stdint cimport intptr_t from .cycudla cimport * diff --git a/cuda_bindings/cuda/bindings/cudla.pyx b/cuda_bindings/cuda/bindings/cudla.pyx index 175a6ba0d22..4532ebaeb97 100644 --- a/cuda_bindings/cuda/bindings/cudla.pyx +++ b/cuda_bindings/cuda/bindings/cudla.pyx @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3ee237ed16e651bae93e2bc6d4d63dcf99b309ad7a74cb3e2bd5b9e540e714f4 +# This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=37c4218155319e18c12093c50fd40d05d05035b9625c2aaf8c111b0ab26d3c8c # <<<< PREAMBLE CONTENT >>>> @@ -768,13 +769,19 @@ cdef class Fence: return obj -dev_attribute_dtype = _numpy.dtype(( - _numpy.dtype((_numpy.void, sizeof(cudlaDevAttribute))), - { - "unified_addressing_supported": (_numpy.uint8, 0), - "device_version": (_numpy.uint32, 0), - } - )) +cdef _get_dev_attribute_dtype_offsets(): + cdef cudlaDevAttribute pod + return _numpy.dtype({ + 'names': ['unified_addressing_supported', 'device_version'], + 'formats': [_numpy.uint8, _numpy.uint32], + 'offsets': [ + (&(pod.unifiedAddressingSupported)) - (&pod), + (&(pod.deviceVersion)) - (&pod), + ], + 'itemsize': sizeof(cudlaDevAttribute), + }) + +dev_attribute_dtype = _get_dev_attribute_dtype_offsets() cdef class DevAttribute: """Empty-initialize an instance of `cudlaDevAttribute`. @@ -905,15 +912,21 @@ cdef class DevAttribute: return obj -module_attribute_dtype = _numpy.dtype(( - _numpy.dtype((_numpy.void, sizeof(cudlaModuleAttribute))), - { - "num_input_tensors": (_numpy.uint32, 0), - "num_output_tensors": (_numpy.uint32, 0), - "input_tensor_desc": (_numpy.intp, 0), - "output_tensor_desc": (_numpy.intp, 0), - } - )) +cdef _get_module_attribute_dtype_offsets(): + cdef cudlaModuleAttribute pod + return _numpy.dtype({ + 'names': ['num_input_tensors', 'num_output_tensors', 'input_tensor_desc', 'output_tensor_desc'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.numInputTensors)) - (&pod), + (&(pod.numOutputTensors)) - (&pod), + (&(pod.inputTensorDesc)) - (&pod), + (&(pod.outputTensorDesc)) - (&pod), + ], + 'itemsize': sizeof(cudlaModuleAttribute), + }) + +module_attribute_dtype = _get_module_attribute_dtype_offsets() cdef class ModuleAttribute: """Empty-initialize an instance of `cudlaModuleAttribute`. @@ -1153,7 +1166,12 @@ cdef class WaitEvents: """int: """ if self._ptr[0].preFences == NULL or self._ptr[0].numEvents == 0: return [] - return Fence.from_ptr((self._ptr[0].preFences), self._ptr[0].numEvents) + return Fence.from_ptr( + (self._ptr[0].preFences), + self._ptr[0].numEvents, + owner=self, + readonly=self._readonly + ) @pre_fences.setter def pre_fences(self, val): @@ -1319,7 +1337,12 @@ cdef class SignalEvents: """int: """ if self._ptr[0].eofFences == NULL or self._ptr[0].numEvents == 0: return [] - return Fence.from_ptr((self._ptr[0].eofFences), self._ptr[0].numEvents) + return Fence.from_ptr( + (self._ptr[0].eofFences), + self._ptr[0].numEvents, + owner=self, + readonly=self._readonly + ) @eof_fences.setter def eof_fences(self, val): diff --git a/cuda_bindings/cuda/bindings/cufile.pxd b/cuda_bindings/cuda/bindings/cufile.pxd index 2bd8c7489ca..35b6271e529 100644 --- a/cuda_bindings/cuda/bindings/cufile.pxd +++ b/cuda_bindings/cuda/bindings/cufile.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=232df43b5a8960f10286c172abc71222a3822087a1f6134e12d9341f3b53886c +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1d85ffab055c92f1ea96fc186f7ede91090e0d65388d2a03591d374f74937209 from libc.stdint cimport intptr_t from .cycufile cimport * diff --git a/cuda_bindings/cuda/bindings/cufile.pyx b/cuda_bindings/cuda/bindings/cufile.pyx index fbc9c20dc47..15eedf9708f 100644 --- a/cuda_bindings/cuda/bindings/cufile.pyx +++ b/cuda_bindings/cuda/bindings/cufile.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4567ca64d02631fc8d6ed11af8164d72c86b4686c105fd733d186e6c92512749 +# This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9bb12d58d34130a4d23007783ff3b16344fd90af5d0977196234ced1b9e6574d # <<<< PREAMBLE CONTENT >>>> @@ -80,13 +81,19 @@ from cuda.bindings.driver import CUresult as pyCUresult # POD ############################################################################### -_py_anon_pod1_dtype = _numpy.dtype(( - _numpy.dtype((_numpy.void, sizeof((NULL).handle))), - { - "fd": (_numpy.int32, 0), - "handle": (_numpy.intp, 0), - } - )) +cdef _get__py_anon_pod1_dtype_offsets(): + cdef cuda_bindings_cufile__anon_pod1 pod + return _numpy.dtype({ + 'names': ['fd', 'handle'], + 'formats': [_numpy.int32, _numpy.intp], + 'offsets': [ + (&(pod.fd)) - (&pod), + (&(pod.handle)) - (&pod), + ], + 'itemsize': sizeof((NULL).handle), + }) + +_py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() cdef class _py_anon_pod1: """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod1`. @@ -411,6 +418,7 @@ cdef class IOEvents: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=io_events_dtype) @@ -529,13 +537,15 @@ cdef class IOEvents: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an IOEvents 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)") @@ -545,6 +555,7 @@ cdef class IOEvents: ptr, sizeof(CUfileIOEvents_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=io_events_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -746,6 +757,7 @@ cdef class PerGpuStats: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=per_gpu_stats_dtype) @@ -1159,13 +1171,15 @@ cdef class PerGpuStats: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an PerGpuStats 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)") @@ -1175,6 +1189,164 @@ cdef class PerGpuStats: ptr, sizeof(CUfilePerGpuStats_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=per_gpu_stats_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner + + return obj + + +cdef _get_io_vec_dtype_offsets(): + cdef CUfileIOVec_t pod + return _numpy.dtype({ + 'names': ['base_', 'len'], + 'formats': [_numpy.intp, _numpy.uint64], + 'offsets': [ + (&(pod.base)) - (&pod), + (&(pod.len)) - (&pod), + ], + 'itemsize': sizeof(CUfileIOVec_t), + }) + +io_vec_dtype = _get_io_vec_dtype_offsets() + +cdef class IOVec: + """Empty-initialize an array of `CUfileIOVec_t`. + The resulting object is of length `size` and of dtype `io_vec_dtype`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `CUfileIOVec_t` + """ + cdef: + readonly object _data + object _owner + + def __init__(self, size=1): + arr = _numpy.empty(size, dtype=io_vec_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(CUfileIOVec_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(CUfileIOVec_t) }" + + def __repr__(self): + if self._data.size > 1: + return f"<{__name__}.IOVec_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.IOVec 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, IOVec)) 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 base_(self): + """Union[~_numpy.intp, int]: """ + if self._data.size == 1: + return int(self._data.base_[0]) + return self._data.base_ + + @base_.setter + def base_(self, val): + self._data.base_ = val + + @property + def len(self): + """Union[~_numpy.uint64, int]: """ + if self._data.size == 1: + return int(self._data.len[0]) + return self._data.len + + @len.setter + def len(self, val): + self._data.len = 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 IOVec.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == io_vec_dtype: + return IOVec.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """Create an IOVec instance with the memory from the given buffer.""" + return IOVec.from_data(_numpy.frombuffer(buffer, dtype=io_vec_dtype)) + + @staticmethod + def from_data(data): + """Create an IOVec instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `io_vec_dtype` holding the data. + """ + cdef IOVec obj = IOVec.__new__(IOVec) + 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 != io_vec_dtype: + raise ValueError("data array must be of dtype io_vec_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 IOVec 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 IOVec obj = IOVec.__new__(IOVec) + 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(CUfileIOVec_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=io_vec_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -1206,6 +1378,7 @@ cdef class Descr: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=descr_dtype) @@ -1322,13 +1495,15 @@ cdef class Descr: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an Descr 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)") @@ -1338,16 +1513,23 @@ cdef class Descr: ptr, sizeof(CUfileDescr_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=descr_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj -_py_anon_pod2_dtype = _numpy.dtype(( - _numpy.dtype((_numpy.void, sizeof((NULL).u))), - { - "batch": (_py_anon_pod3_dtype, 0), - } - )) +cdef _get__py_anon_pod2_dtype_offsets(): + cdef cuda_bindings_cufile__anon_pod2 pod + return _numpy.dtype({ + 'names': ['batch'], + 'formats': [_py_anon_pod3_dtype], + 'offsets': [ + (&(pod.batch)) - (&pod), + ], + 'itemsize': sizeof((NULL).u), + }) + +_py_anon_pod2_dtype = _get__py_anon_pod2_dtype_offsets() cdef class _py_anon_pod2: """Empty-initialize an instance of `cuda_bindings_cufile__anon_pod2`. @@ -1418,7 +1600,11 @@ cdef class _py_anon_pod2: @property def batch(self): """_py_anon_pod3: """ - return _py_anon_pod3.from_ptr(&(self._ptr[0].batch), self._readonly, self) + return _py_anon_pod3.from_ptr( + &(self._ptr[0].batch), + readonly=self._readonly, + owner=self, + ) @batch.setter def batch(self, val): @@ -1471,8 +1657,8 @@ cdef class _py_anon_pod2: cdef _get_stats_level1_dtype_offsets(): cdef CUfileStatsLevel1_t pod return _numpy.dtype({ - 'names': ['read_ops', 'write_ops', 'hdl_register_ops', 'hdl_deregister_ops', 'buf_register_ops', 'buf_deregister_ops', 'read_bytes', 'write_bytes', 'read_bw_bytes_per_sec', 'write_bw_bytes_per_sec', 'read_lat_avg_us', 'write_lat_avg_us', 'read_ops_per_sec', 'write_ops_per_sec', 'read_lat_sum_us', 'write_lat_sum_us', 'batch_submit_ops', 'batch_complete_ops', 'batch_setup_ops', 'batch_cancel_ops', 'batch_destroy_ops', 'batch_enqueued_ops', 'batch_posix_enqueued_ops', 'batch_processed_ops', 'batch_posix_processed_ops', 'batch_nvfs_submit_ops', 'batch_p2p_submit_ops', 'batch_aio_submit_ops', 'batch_iouring_submit_ops', 'batch_mixed_io_submit_ops', 'batch_total_submit_ops', 'batch_read_bytes', 'batch_write_bytes', 'batch_read_bw_bytes', 'batch_write_bw_bytes', 'batch_submit_lat_avg_us', 'batch_completion_lat_avg_us', 'batch_submit_ops_per_sec', 'batch_complete_ops_per_sec', 'batch_submit_lat_sum_us', 'batch_completion_lat_sum_us', 'last_batch_read_bytes', 'last_batch_write_bytes'], - 'formats': [op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], + 'names': ['read_ops', 'write_ops', 'hdl_register_ops', 'hdl_deregister_ops', 'buf_register_ops', 'buf_deregister_ops', 'read_bytes', 'write_bytes', 'read_bw_bytes_per_sec', 'write_bw_bytes_per_sec', 'read_lat_avg_us', 'write_lat_avg_us', 'read_ops_per_sec', 'write_ops_per_sec', 'read_lat_sum_us', 'write_lat_sum_us', 'batch_submit_ops', 'batch_complete_ops', 'batch_setup_ops', 'batch_cancel_ops', 'batch_destroy_ops', 'batch_enqueued_ops', 'batch_posix_enqueued_ops', 'batch_processed_ops', 'batch_posix_processed_ops', 'batch_nvfs_submit_ops', 'batch_p2p_submit_ops', 'batch_aio_submit_ops', 'batch_iouring_submit_ops', 'batch_mixed_io_submit_ops', 'batch_total_submit_ops', 'batch_read_bytes', 'batch_write_bytes', 'batch_read_bw_bytes', 'batch_write_bw_bytes', 'batch_submit_lat_avg_us', 'batch_completion_lat_avg_us', 'batch_submit_ops_per_sec', 'batch_complete_ops_per_sec', 'batch_submit_lat_sum_us', 'batch_completion_lat_sum_us', 'last_batch_read_bytes', 'last_batch_write_bytes', 'readv_ops', 'writev_ops', 'readv_bytes', 'writev_bytes', 'readv_bw_bytes_per_sec', 'writev_bw_bytes_per_sec', 'readv_lat_avg_us', 'writev_lat_avg_us', 'readv_ops_per_sec', 'writev_ops_per_sec', 'readv_lat_sum_us', 'writev_lat_sum_us'], + 'formats': [op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, op_counter_dtype, op_counter_dtype, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], 'offsets': [ (&(pod.read_ops)) - (&pod), (&(pod.write_ops)) - (&pod), @@ -1517,6 +1703,18 @@ cdef _get_stats_level1_dtype_offsets(): (&(pod.batch_completion_lat_sum_us)) - (&pod), (&(pod.last_batch_read_bytes)) - (&pod), (&(pod.last_batch_write_bytes)) - (&pod), + (&(pod.readv_ops)) - (&pod), + (&(pod.writev_ops)) - (&pod), + (&(pod.readv_bytes)) - (&pod), + (&(pod.writev_bytes)) - (&pod), + (&(pod.readv_bw_bytes_per_sec)) - (&pod), + (&(pod.writev_bw_bytes_per_sec)) - (&pod), + (&(pod.readv_lat_avg_us)) - (&pod), + (&(pod.writev_lat_avg_us)) - (&pod), + (&(pod.readv_ops_per_sec)) - (&pod), + (&(pod.writev_ops_per_sec)) - (&pod), + (&(pod.readv_lat_sum_us)) - (&pod), + (&(pod.writev_lat_sum_us)) - (&pod), ], 'itemsize': sizeof(CUfileStatsLevel1_t), }) @@ -1592,7 +1790,11 @@ cdef class StatsLevel1: @property def read_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].read_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].read_ops), + readonly=self._readonly, + owner=self, + ) @read_ops.setter def read_ops(self, val): @@ -1604,7 +1806,11 @@ cdef class StatsLevel1: @property def write_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].write_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].write_ops), + readonly=self._readonly, + owner=self, + ) @write_ops.setter def write_ops(self, val): @@ -1616,7 +1822,11 @@ cdef class StatsLevel1: @property def hdl_register_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].hdl_register_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].hdl_register_ops), + readonly=self._readonly, + owner=self, + ) @hdl_register_ops.setter def hdl_register_ops(self, val): @@ -1628,7 +1838,11 @@ cdef class StatsLevel1: @property def hdl_deregister_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].hdl_deregister_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].hdl_deregister_ops), + readonly=self._readonly, + owner=self, + ) @hdl_deregister_ops.setter def hdl_deregister_ops(self, val): @@ -1640,7 +1854,11 @@ cdef class StatsLevel1: @property def buf_register_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].buf_register_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].buf_register_ops), + readonly=self._readonly, + owner=self, + ) @buf_register_ops.setter def buf_register_ops(self, val): @@ -1652,7 +1870,11 @@ cdef class StatsLevel1: @property def buf_deregister_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].buf_deregister_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].buf_deregister_ops), + readonly=self._readonly, + owner=self, + ) @buf_deregister_ops.setter def buf_deregister_ops(self, val): @@ -1664,7 +1886,11 @@ cdef class StatsLevel1: @property def batch_submit_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_submit_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_submit_ops), + readonly=self._readonly, + owner=self, + ) @batch_submit_ops.setter def batch_submit_ops(self, val): @@ -1676,7 +1902,11 @@ cdef class StatsLevel1: @property def batch_complete_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_complete_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_complete_ops), + readonly=self._readonly, + owner=self, + ) @batch_complete_ops.setter def batch_complete_ops(self, val): @@ -1688,7 +1918,11 @@ cdef class StatsLevel1: @property def batch_setup_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_setup_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_setup_ops), + readonly=self._readonly, + owner=self, + ) @batch_setup_ops.setter def batch_setup_ops(self, val): @@ -1700,7 +1934,11 @@ cdef class StatsLevel1: @property def batch_cancel_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_cancel_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_cancel_ops), + readonly=self._readonly, + owner=self, + ) @batch_cancel_ops.setter def batch_cancel_ops(self, val): @@ -1712,7 +1950,11 @@ cdef class StatsLevel1: @property def batch_destroy_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_destroy_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_destroy_ops), + readonly=self._readonly, + owner=self, + ) @batch_destroy_ops.setter def batch_destroy_ops(self, val): @@ -1724,7 +1966,11 @@ cdef class StatsLevel1: @property def batch_enqueued_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_enqueued_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_enqueued_ops), + readonly=self._readonly, + owner=self, + ) @batch_enqueued_ops.setter def batch_enqueued_ops(self, val): @@ -1736,7 +1982,11 @@ cdef class StatsLevel1: @property def batch_posix_enqueued_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_posix_enqueued_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_posix_enqueued_ops), + readonly=self._readonly, + owner=self, + ) @batch_posix_enqueued_ops.setter def batch_posix_enqueued_ops(self, val): @@ -1748,7 +1998,11 @@ cdef class StatsLevel1: @property def batch_processed_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_processed_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_processed_ops), + readonly=self._readonly, + owner=self, + ) @batch_processed_ops.setter def batch_processed_ops(self, val): @@ -1760,7 +2014,11 @@ cdef class StatsLevel1: @property def batch_posix_processed_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_posix_processed_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_posix_processed_ops), + readonly=self._readonly, + owner=self, + ) @batch_posix_processed_ops.setter def batch_posix_processed_ops(self, val): @@ -1772,7 +2030,11 @@ cdef class StatsLevel1: @property def batch_nvfs_submit_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_nvfs_submit_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_nvfs_submit_ops), + readonly=self._readonly, + owner=self, + ) @batch_nvfs_submit_ops.setter def batch_nvfs_submit_ops(self, val): @@ -1784,7 +2046,11 @@ cdef class StatsLevel1: @property def batch_p2p_submit_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_p2p_submit_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_p2p_submit_ops), + readonly=self._readonly, + owner=self, + ) @batch_p2p_submit_ops.setter def batch_p2p_submit_ops(self, val): @@ -1796,7 +2062,11 @@ cdef class StatsLevel1: @property def batch_aio_submit_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_aio_submit_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_aio_submit_ops), + readonly=self._readonly, + owner=self, + ) @batch_aio_submit_ops.setter def batch_aio_submit_ops(self, val): @@ -1808,7 +2078,11 @@ cdef class StatsLevel1: @property def batch_iouring_submit_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_iouring_submit_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_iouring_submit_ops), + readonly=self._readonly, + owner=self, + ) @batch_iouring_submit_ops.setter def batch_iouring_submit_ops(self, val): @@ -1820,7 +2094,11 @@ cdef class StatsLevel1: @property def batch_mixed_io_submit_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_mixed_io_submit_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_mixed_io_submit_ops), + readonly=self._readonly, + owner=self, + ) @batch_mixed_io_submit_ops.setter def batch_mixed_io_submit_ops(self, val): @@ -1832,7 +2110,11 @@ cdef class StatsLevel1: @property def batch_total_submit_ops(self): """OpCounter: """ - return OpCounter.from_ptr(&(self._ptr[0].batch_total_submit_ops), self._readonly, self) + return OpCounter.from_ptr( + &(self._ptr[0].batch_total_submit_ops), + readonly=self._readonly, + owner=self, + ) @batch_total_submit_ops.setter def batch_total_submit_ops(self, val): @@ -1841,6 +2123,38 @@ cdef class StatsLevel1: cdef OpCounter val_ = val _cyb_memcpy(&(self._ptr[0].batch_total_submit_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + @property + def readv_ops(self): + """OpCounter: """ + return OpCounter.from_ptr( + &(self._ptr[0].readv_ops), + readonly=self._readonly, + owner=self, + ) + + @readv_ops.setter + def readv_ops(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + cdef OpCounter val_ = val + _cyb_memcpy(&(self._ptr[0].readv_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + + @property + def writev_ops(self): + """OpCounter: """ + return OpCounter.from_ptr( + &(self._ptr[0].writev_ops), + readonly=self._readonly, + owner=self, + ) + + @writev_ops.setter + def writev_ops(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + cdef OpCounter val_ = val + _cyb_memcpy(&(self._ptr[0].writev_ops), (val_._get_ptr()), sizeof(CUfileOpCounter_t) * 1) + @property def read_bytes(self): """int: """ @@ -2083,6 +2397,116 @@ cdef class StatsLevel1: raise ValueError("This StatsLevel1 instance is read-only") self._ptr[0].last_batch_write_bytes = val + @property + def readv_bytes(self): + """int: """ + return self._ptr[0].readv_bytes + + @readv_bytes.setter + def readv_bytes(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].readv_bytes = val + + @property + def writev_bytes(self): + """int: """ + return self._ptr[0].writev_bytes + + @writev_bytes.setter + def writev_bytes(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].writev_bytes = val + + @property + def readv_bw_bytes_per_sec(self): + """int: """ + return self._ptr[0].readv_bw_bytes_per_sec + + @readv_bw_bytes_per_sec.setter + def readv_bw_bytes_per_sec(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].readv_bw_bytes_per_sec = val + + @property + def writev_bw_bytes_per_sec(self): + """int: """ + return self._ptr[0].writev_bw_bytes_per_sec + + @writev_bw_bytes_per_sec.setter + def writev_bw_bytes_per_sec(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].writev_bw_bytes_per_sec = val + + @property + def readv_lat_avg_us(self): + """int: """ + return self._ptr[0].readv_lat_avg_us + + @readv_lat_avg_us.setter + def readv_lat_avg_us(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].readv_lat_avg_us = val + + @property + def writev_lat_avg_us(self): + """int: """ + return self._ptr[0].writev_lat_avg_us + + @writev_lat_avg_us.setter + def writev_lat_avg_us(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].writev_lat_avg_us = val + + @property + def readv_ops_per_sec(self): + """int: """ + return self._ptr[0].readv_ops_per_sec + + @readv_ops_per_sec.setter + def readv_ops_per_sec(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].readv_ops_per_sec = val + + @property + def writev_ops_per_sec(self): + """int: """ + return self._ptr[0].writev_ops_per_sec + + @writev_ops_per_sec.setter + def writev_ops_per_sec(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].writev_ops_per_sec = val + + @property + def readv_lat_sum_us(self): + """int: """ + return self._ptr[0].readv_lat_sum_us + + @readv_lat_sum_us.setter + def readv_lat_sum_us(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].readv_lat_sum_us = val + + @property + def writev_lat_sum_us(self): + """int: """ + return self._ptr[0].writev_lat_sum_us + + @writev_lat_sum_us.setter + def writev_lat_sum_us(self, val): + if self._readonly: + raise ValueError("This StatsLevel1 instance is read-only") + self._ptr[0].writev_lat_sum_us = val + @staticmethod def from_buffer(buffer): """Create an StatsLevel1 instance with the memory from the given buffer.""" @@ -2153,6 +2577,7 @@ cdef class IOParams: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=io_params_dtype) @@ -2291,13 +2716,15 @@ cdef class IOParams: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an IOParams 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)") @@ -2307,6 +2734,7 @@ cdef class IOParams: ptr, sizeof(CUfileIOParams_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=io_params_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -2395,7 +2823,11 @@ cdef class StatsLevel2: @property def basic(self): """StatsLevel1: """ - return StatsLevel1.from_ptr(&(self._ptr[0].basic), self._readonly, self) + return StatsLevel1.from_ptr( + &(self._ptr[0].basic), + readonly=self._readonly, + owner=self, + ) @basic.setter def basic(self, val): @@ -2563,7 +2995,11 @@ cdef class StatsLevel3: @property def detailed(self): """StatsLevel2: """ - return StatsLevel2.from_ptr(&(self._ptr[0].detailed), self._readonly, self) + return StatsLevel2.from_ptr( + &(self._ptr[0].detailed), + readonly=self._readonly, + owner=self, + ) @detailed.setter def detailed(self, val): @@ -2575,7 +3011,12 @@ cdef class StatsLevel3: @property def per_gpu_stats(self): """PerGpuStats: """ - return PerGpuStats.from_ptr(&(self._ptr[0].per_gpu_stats), 16, self._readonly) + return PerGpuStats.from_ptr( + &(self._ptr[0].per_gpu_stats), + 16, + readonly=self._readonly, + owner=self, + ) @per_gpu_stats.setter def per_gpu_stats(self, val): @@ -2721,7 +3162,8 @@ class DriverControlFlags(_cyb_FastEnum): """ USE_POLL_MODE = (CU_FILE_USE_POLL_MODE, 'use POLL mode. properties.use_poll_mode') ALLOW_COMPAT_MODE = (CU_FILE_ALLOW_COMPAT_MODE, 'allow COMPATIBILITY mode. properties.allow_compat_mode') - POSIX_IO_MODE = (CU_FILE_POSIX_IO_MODE, 'Vanilla posix io mode. properties.posix_io_mode') + VANILLA_POSIX_IO_MODE = (CU_FILE_VANILLA_POSIX_IO_MODE, 'Vanilla posix io mode. properties.vanilla_posix_io_mode') + POSIX_IO_MODE = (CU_FILE_POSIX_IO_MODE, 'alias for backward compatibility') FALLBACK_IO_MODE = (CU_FILE_FALLBACK_IO_MODE, 'Fallback io mode. properties.gds_fallback_io') class FeatureFlags(_cyb_FastEnum): @@ -2800,6 +3242,8 @@ class BoolConfigParameter(_cyb_FastEnum): FORCE_ODIRECT_MODE = CUFILE_PARAM_FORCE_ODIRECT_MODE SKIP_TOPOLOGY_DETECTION = CUFILE_PARAM_SKIP_TOPOLOGY_DETECTION STREAM_MEMOPS_BYPASS = CUFILE_PARAM_STREAM_MEMOPS_BYPASS + PROPERTIES_POSIX_IO_MODE = CUFILE_PARAM_PROPERTIES_POSIX_IO_MODE + GDS_FALLBACK_IO = CUFILE_PARAM_GDS_FALLBACK_IO class StringConfigParameter(_cyb_FastEnum): """ @@ -2808,6 +3252,7 @@ class StringConfigParameter(_cyb_FastEnum): LOGGING_LEVEL = CUFILE_PARAM_LOGGING_LEVEL ENV_LOGFILE_PATH = CUFILE_PARAM_ENV_LOGFILE_PATH LOG_DIR = CUFILE_PARAM_LOG_DIR + RDMA_TRANSPORT = CUFILE_PARAM_RDMA_TRANSPORT class ArrayConfigParameter(_cyb_FastEnum): """ @@ -2876,10 +3321,12 @@ cpdef intptr_t handle_register(intptr_t descr) except? 0: """cuFileHandleRegister is required, and performs extra checking that is memoized to provide increased performance on later cuFile operations. Args: - descr (intptr_t): ``CUfileDescr_t`` file descriptor (OS agnostic). + descr (intptr_t): ``CUfileDescr_t`` file descriptor (OS + agnostic). Returns: - intptr_t: ``CUfileHandle_t`` opaque file handle for IO operations. + intptr_t: ``CUfileHandle_t`` opaque file handle for IO + operations. .. seealso:: `cuFileHandleRegister` """ @@ -2907,7 +3354,8 @@ cpdef buf_register(intptr_t buf_ptr_base, size_t length, int flags): Args: buf_ptr_base (intptr_t): buffer pointer allocated. - length (size_t): size of memory region from the above specified bufPtr. + length (size_t): size of memory region from the above + specified bufPtr. flags (int): CU_FILE_RDMA_REGISTER. .. seealso:: `cuFileBufRegister` @@ -2967,8 +3415,10 @@ cpdef driver_set_poll_mode(bint poll, size_t poll_threshold_size): """Sets whether the Read/Write APIs use polling to do IO operations This takes place before the driver is opened. No-op if driver is already open. Args: - poll (bint): boolean to indicate whether to use poll mode or not. - poll_threshold_size (size_t): max IO size to use for POLLING mode in KB. + poll (bint): boolean to indicate whether to use poll mode or + not. + poll_threshold_size (size_t): max IO size to use for POLLING + mode in KB. .. seealso:: `cuFileDriverSetPollMode` """ @@ -2981,7 +3431,8 @@ cpdef driver_set_max_direct_io_size(size_t max_direct_io_size): """Control parameter to set max IO size(KB) used by the library to talk to nvidia-fs driver This takes place before the driver is opened. No-op if driver is already open. Args: - max_direct_io_size (size_t): maximum allowed direct io size in KB. + max_direct_io_size (size_t): maximum allowed direct io size in + KB. .. seealso:: `cuFileDriverSetMaxDirectIOSize` """ @@ -2994,7 +3445,8 @@ cpdef driver_set_max_cache_size(size_t max_cache_size): """Control parameter to set maximum GPU memory reserved per device by the library for internal buffering This takes place before the driver is opened. No-op if driver is already open. Args: - max_cache_size (size_t): The maximum GPU buffer space per device used for internal use in KB. + max_cache_size (size_t): The maximum GPU buffer space per + device used for internal use in KB. .. seealso:: `cuFileDriverSetMaxCacheSize` """ @@ -3007,7 +3459,8 @@ cpdef driver_set_max_pinned_mem_size(size_t max_pinned_size): """Sets maximum buffer space that is pinned in KB for use by ``cuFileBufRegister`` This takes place before the driver is opened. No-op if driver is already open. Args: - max_pinned_size (size_t): maximum buffer space that is pinned in KB. + max_pinned_size (size_t): maximum buffer space that is pinned + in KB. .. seealso:: `cuFileDriverSetMaxPinnedMemSize` """ @@ -3133,7 +3586,8 @@ cpdef tuple get_parameter_min_max_value(int param): """Get both the minimum and maximum settable values for a given size_t parameter in a single call. Args: - param (SizeTConfigParameter): CUfile SizeT configuration parameter. + param (SizeTConfigParameter): CUfile SizeT configuration + parameter. Returns: A 2-tuple containing: @@ -3155,7 +3609,8 @@ cpdef set_stats_level(int level): """Set the level of statistics collection for cuFile operations. This will override the cufile.json settings for stats. Args: - level (int): Statistics level (0 = disabled, 1 = basic, 2 = detailed, 3 = verbose). + level (int): Statistics level (0 = disabled, 1 = basic, 2 = + detailed, 3 = verbose). .. seealso:: `cuFileSetStatsLevel` """ @@ -3213,7 +3668,8 @@ cpdef get_stats_l1(intptr_t stats): """Get Level 1 cuFile statistics. Args: - stats (intptr_t): Pointer to ``CUfileStatsLevel1_t`` structure to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel1_t`` structure + to be filled. .. seealso:: `cuFileGetStatsL1` """ @@ -3226,7 +3682,8 @@ cpdef get_stats_l2(intptr_t stats): """Get Level 2 cuFile statistics. Args: - stats (intptr_t): Pointer to ``CUfileStatsLevel2_t`` structure to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel2_t`` structure + to be filled. .. seealso:: `cuFileGetStatsL2` """ @@ -3239,7 +3696,8 @@ cpdef get_stats_l3(intptr_t stats): """Get Level 3 cuFile statistics. Args: - stats (intptr_t): Pointer to ``CUfileStatsLevel3_t`` structure to be filled. + stats (intptr_t): Pointer to ``CUfileStatsLevel3_t`` structure + to be filled. .. seealso:: `cuFileGetStatsL3` """ @@ -3277,7 +3735,8 @@ cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_v Args: size_values (intptr_t): Buffer to receive slab sizes in KB. count_values (intptr_t): Buffer to receive slab counts. - len (int): Buffer size (must match the actual parameter length). + len (int): Buffer size (must match the actual parameter + length). .. seealso:: `cuFileGetParameterPosixPoolSlabArray` """ @@ -3286,6 +3745,8 @@ cpdef get_parameter_posix_pool_slab_array(intptr_t size_values, intptr_t count_v check_status(__status__) + + cpdef str op_status_error(int status): """cufileop status string. @@ -3346,4 +3807,50 @@ cpdef write(intptr_t fh, intptr_t buf_ptr_base, size_t size, off_t file_offset, status = cuFileWrite(fh, buf_ptr_base, size, file_offset, buf_ptr_offset) check_status(status) return status + + +cpdef readv(intptr_t fh, IOVec iov, off_t file_offset, unsigned int flags=0): + """Read data from a registered file handle into a scatter list of device or host buffers. + + Args: + fh (intptr_t): ``CUfileHandle_t`` opaque file handle. + iov (IOVec): scatter/gather descriptor array; each element specifies a + base pointer (device or host) and a byte length. + file_offset (off_t): file offset from the beginning of the file. + flags (unsigned int): reserved; must be 0. + + Returns: + ssize_t: number of bytes read on success. + + .. seealso:: `cuFileReadv` + """ + cdef intptr_t iov_ptr = (iov)._get_ptr() + cdef size_t iovcnt = len(iov) + with nogil: + status = cuFileReadv(fh, iov_ptr, iovcnt, file_offset, flags) + check_status(status) + return status + + +cpdef writev(intptr_t fh, IOVec iov, off_t file_offset, unsigned int flags=0): + """Write data to a registered file handle from a gather list of device or host buffers. + + Args: + fh (intptr_t): ``CUfileHandle_t`` opaque file handle. + iov (IOVec): scatter/gather descriptor array; each element specifies a + base pointer (device or host) and a byte length. + file_offset (off_t): file offset from the beginning of the file. + flags (unsigned int): reserved; must be 0. + + Returns: + ssize_t: number of bytes written on success. + + .. seealso:: `cuFileWritev` + """ + cdef intptr_t iov_ptr = (iov)._get_ptr() + cdef size_t iovcnt = len(iov) + with nogil: + status = cuFileWritev(fh, iov_ptr, iovcnt, file_offset, flags) + check_status(status) + return status del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/cycudla.pxd b/cuda_bindings/cuda/bindings/cycudla.pxd index 6eee248e7d5..5f42abe0de5 100644 --- a/cuda_bindings/cuda/bindings/cycudla.pxd +++ b/cuda_bindings/cuda/bindings/cycudla.pxd @@ -1,10 +1,11 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. # This layer exposes the C header to Cython as-is. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c4dacd5de0bc9a6ac0cc92dabed1728cc6133d0448924ea6db4f9c740ff089b6 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f24f3dc6fe7d137fe1753e5eb4ebb613d631f984996f6dbb859befed8211c73b from libc.stdint cimport int8_t, int16_t, int32_t, int64_t from libc.stdint cimport uint8_t, uint16_t, uint32_t, uint64_t from libc.stdint cimport intptr_t, uintptr_t diff --git a/cuda_bindings/cuda/bindings/cycudla.pyx b/cuda_bindings/cuda/bindings/cycudla.pyx index 42a7bd651c6..df23650e881 100644 --- a/cuda_bindings/cuda/bindings/cycudla.pyx +++ b/cuda_bindings/cuda/bindings/cycudla.pyx @@ -1,9 +1,10 @@ # SPDX-FileCopyrightText: Copyright (c) 2024-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated across versions from 1.5.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 1.5.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b134ed8cb83eb5a5c6ff30be817e64d09d421d7257761e58fbc06b131690a392 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=71bfc67b64e7e78ba54303e68d8df46f44f73c601c5d303926a46e261b3fd042 from ._internal cimport cudla as _cudla diff --git a/cuda_bindings/cuda/bindings/cycufile.pxd b/cuda_bindings/cuda/bindings/cycufile.pxd index b5a0c9cb884..47aa51465fe 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pxd +++ b/cuda_bindings/cuda/bindings/cycufile.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f840820f160e36eebe6e052b5a5d3a35b55704060301ee2ab7d5cd7a7d580418 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7961eb9a31b8ad5274ddd2a6357f2f75c1004c44ee4a5edeadf22674f1833d3e from libc.stdint cimport uint32_t, uint64_t from libc.time cimport time_t from libcpp cimport bool as cpp_bool @@ -107,6 +108,7 @@ cdef extern from 'cufile.h': ctypedef enum CUfileDriverControlFlags_t: CU_FILE_USE_POLL_MODE CU_FILE_ALLOW_COMPAT_MODE + CU_FILE_VANILLA_POSIX_IO_MODE CU_FILE_POSIX_IO_MODE CU_FILE_FALLBACK_IO_MODE @@ -172,12 +174,15 @@ cdef extern from 'cufile.h': CUFILE_PARAM_FORCE_ODIRECT_MODE CUFILE_PARAM_SKIP_TOPOLOGY_DETECTION CUFILE_PARAM_STREAM_MEMOPS_BYPASS + CUFILE_PARAM_PROPERTIES_POSIX_IO_MODE + CUFILE_PARAM_GDS_FALLBACK_IO cdef extern from 'cufile.h': ctypedef enum CUFileStringConfigParameter_t: CUFILE_PARAM_LOGGING_LEVEL CUFILE_PARAM_ENV_LOGFILE_PATH CUFILE_PARAM_LOG_DIR + CUFILE_PARAM_RDMA_TRANSPORT cdef extern from 'cufile.h': ctypedef enum CUFileArrayConfigParameter_t: @@ -285,6 +290,11 @@ cdef extern from 'cufile.h': uint64_t n_mmap_free uint64_t reg_bytes +cdef extern from 'cufile.h': + ctypedef struct CUfileIOVec_t 'CUfileIOVec_t': + void* base + size_t len + cdef extern from 'cufile.h': ctypedef struct CUfileDrvProps_t 'CUfileDrvProps_t': cuda_bindings_cufile__anon_pod0 nvfs @@ -349,6 +359,18 @@ cdef extern from 'cufile.h': uint64_t batch_completion_lat_sum_us uint64_t last_batch_read_bytes uint64_t last_batch_write_bytes + CUfileOpCounter_t readv_ops + CUfileOpCounter_t writev_ops + uint64_t readv_bytes + uint64_t writev_bytes + uint64_t readv_bw_bytes_per_sec + uint64_t writev_bw_bytes_per_sec + uint64_t readv_lat_avg_us + uint64_t writev_lat_avg_us + uint64_t readv_ops_per_sec + uint64_t writev_ops_per_sec + uint64_t readv_lat_sum_us + uint64_t writev_lat_sum_us cdef extern from 'cufile.h': ctypedef struct CUfileIOParams_t 'CUfileIOParams_t': @@ -432,3 +454,5 @@ cdef CUfileError_t cuFileGetStatsL3(CUfileStatsLevel3_t* stats) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileSetParameterPosixPoolSlabArray(const size_t* size_values, const size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil cdef CUfileError_t cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil +cdef ssize_t cuFileReadv(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil +cdef ssize_t cuFileWritev(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil diff --git a/cuda_bindings/cuda/bindings/cycufile.pyx b/cuda_bindings/cuda/bindings/cycufile.pyx index c8d240560b0..5c6ac42c8cd 100644 --- a/cuda_bindings/cuda/bindings/cycufile.pyx +++ b/cuda_bindings/cuda/bindings/cycufile.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a68ff13250f4b5131f4b4adf8a37a4283b27749e8429b5f6e57bfc68bf656b00 +# This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f665ca316ab6166959a5f3338c901e698617b31146000a9d99422dcf9849d3fc # <<<< PREAMBLE CONTENT >>>> @@ -193,3 +194,11 @@ cdef CUfileError_t cuFileSetParameterPosixPoolSlabArray(const size_t* size_value cdef CUfileError_t cuFileGetParameterPosixPoolSlabArray(size_t* size_values, size_t* count_values, int len) except?CUFILE_LOADING_ERROR nogil: return _cufile._cuFileGetParameterPosixPoolSlabArray(size_values, count_values, len) + + +cdef ssize_t cuFileReadv(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil: + return _cufile._cuFileReadv(fh, iov, iovcnt, file_offset, flags) + + +cdef ssize_t cuFileWritev(CUfileHandle_t fh, const CUfileIOVec_t* iov, size_t iovcnt, off_t file_offset, unsigned flags) except* nogil: + return _cufile._cuFileWritev(fh, iov, iovcnt, file_offset, flags) diff --git a/cuda_bindings/cuda/bindings/cydriver.pxd b/cuda_bindings/cuda/bindings/cydriver.pxd index 43f9d031e24..da6754e7af2 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pxd +++ b/cuda_bindings/cuda/bindings/cydriver.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cccb0572002cd20232f2b9f5c7acf559c92813d33dfc364136d57c8f453e50c6 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9e145065ec8a0e7780c0d8e38d0cec7a9b4bf2512e8a745f32593531bbb64676 from libc.stdint cimport uint32_t, uint64_t @@ -395,12 +396,17 @@ cdef extern from 'cuda.h': CU_DEVICE_ATTRIBUTE_HOST_ALLOC_DMA_BUF_SUPPORTED CU_DEVICE_ATTRIBUTE_ONLY_PARTIAL_HOST_NATIVE_ATOMIC_SUPPORTED CU_DEVICE_ATTRIBUTE_ATOMIC_REDUCTION_SUPPORTED + CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT + CU_DEVICE_ATTRIBUTE_MAX_OVERSIZED_SHARED_MEMORY_PER_BLOCK CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED CU_DEVICE_ATTRIBUTE_DMA_BUF_MMAP_SUPPORTED CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_SUPPORTED CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_MULTICAST_SUPPORTED CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_COUNTED_OPS_SUPPORTED CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED + CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_SUPPORTED_HANDLE_TYPES + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED CU_DEVICE_ATTRIBUTE_MAX ctypedef CUdevice_attribute_enum CUdevice_attribute @@ -427,6 +433,7 @@ cdef extern from 'cuda.h': CU_POINTER_ATTRIBUTE_MAPPING_BASE_ADDR CU_POINTER_ATTRIBUTE_MEMORY_BLOCK_ID CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE + CU_POINTER_ATTRIBUTE_LOCALITY_DOMAIN_ORDINAL ctypedef CUpointer_attribute_enum CUpointer_attribute cdef extern from 'cuda.h': @@ -448,6 +455,7 @@ cdef extern from 'cuda.h': CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED + CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE CU_FUNC_ATTRIBUTE_MAX ctypedef CUfunction_attribute_enum CUfunction_attribute @@ -574,17 +582,20 @@ cdef extern from 'cuda.h': CU_TARGET_COMPUTE_100 CU_TARGET_COMPUTE_110 CU_TARGET_COMPUTE_103 + CU_TARGET_COMPUTE_107 CU_TARGET_COMPUTE_120 CU_TARGET_COMPUTE_121 CU_TARGET_COMPUTE_90A CU_TARGET_COMPUTE_100A CU_TARGET_COMPUTE_110A CU_TARGET_COMPUTE_103A + CU_TARGET_COMPUTE_107A CU_TARGET_COMPUTE_120A CU_TARGET_COMPUTE_121A CU_TARGET_COMPUTE_100F CU_TARGET_COMPUTE_110F CU_TARGET_COMPUTE_103F + CU_TARGET_COMPUTE_107F CU_TARGET_COMPUTE_120F CU_TARGET_COMPUTE_121F CU_TARGET_COMPUTE_101 @@ -654,6 +665,7 @@ cdef extern from 'cuda.h': CU_LIMIT_SHMEM_SIZE CU_LIMIT_CIG_ENABLED CU_LIMIT_CIG_SHMEM_FALLBACK_ENABLED + CU_LIMIT_PER_BLOCK_MEMORY_SIZE CU_LIMIT_MAX ctypedef CUlimit_enum CUlimit @@ -727,6 +739,7 @@ cdef extern from 'cuda.h': CU_CLUSTER_SCHEDULING_POLICY_DEFAULT CU_CLUSTER_SCHEDULING_POLICY_SPREAD CU_CLUSTER_SCHEDULING_POLICY_LOAD_BALANCING + CU_CLUSTER_SCHEDULING_POLICY_RUBIN_DSMEM_LOCALITY ctypedef CUclusterSchedulingPolicy_enum CUclusterSchedulingPolicy cdef extern from 'cuda.h': @@ -818,6 +831,7 @@ cdef extern from 'cuda.h': CUDA_ERROR_STUB_LIBRARY CUDA_ERROR_CALL_REQUIRES_NEWER_DRIVER CUDA_ERROR_DEVICE_UNAVAILABLE + CUDA_ERROR_MULTICAST_RESOURCE_FULL CUDA_ERROR_NO_DEVICE CUDA_ERROR_INVALID_DEVICE CUDA_ERROR_DEVICE_NOT_LICENSED @@ -846,6 +860,7 @@ cdef extern from 'cuda.h': CUDA_ERROR_UNSUPPORTED_EXEC_AFFINITY CUDA_ERROR_UNSUPPORTED_DEVSIDE_SYNC CUDA_ERROR_CONTAINED + CUDA_ERROR_INSUFFICIENT_LOADER_VERSION CUDA_ERROR_INVALID_SOURCE CUDA_ERROR_FILE_NOT_FOUND CUDA_ERROR_SHARED_OBJECT_SYMBOL_NOT_FOUND @@ -908,6 +923,7 @@ cdef extern from 'cuda.h': CUDA_ERROR_KEY_ROTATION CUDA_ERROR_STREAM_DETACHED CUDA_ERROR_GRAPH_RECAPTURE_FAILURE + CUDA_ERROR_FABRIC_NOT_READY CUDA_ERROR_UNKNOWN ctypedef cudaError_enum CUresult @@ -1079,6 +1095,7 @@ cdef extern from 'cuda.h': CU_MEM_LOCATION_TYPE_HOST_NUMA CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT CU_MEM_LOCATION_TYPE_INVISIBLE + CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN CU_MEM_LOCATION_TYPE_MAX ctypedef CUmemLocationType_enum CUmemLocationType @@ -1165,6 +1182,7 @@ cdef extern from 'cuda.h': CU_MEMPOOL_ATTR_LOCATION_TYPE CU_MEMPOOL_ATTR_MAX_POOL_SIZE CU_MEMPOOL_ATTR_HW_DECOMPRESS_ENABLED + CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID ctypedef CUmemPool_attribute_enum CUmemPool_attribute cdef extern from 'cuda.h': @@ -1278,6 +1296,8 @@ cdef extern from 'cuda.h': CU_PROCESS_STATE_LOCKED CU_PROCESS_STATE_CHECKPOINTED CU_PROCESS_STATE_FAILED + CU_PROCESS_STATE_CHECKPOINTING + CU_PROCESS_STATE_RESTORING ctypedef CUprocessState_enum CUprocessState cdef extern from 'cuda.h': @@ -1534,6 +1554,7 @@ cdef extern from 'cuda.h': ctypedef enum CUdevSmResourceGroup_flags "CUdevSmResourceGroup_flags": CU_DEV_SM_RESOURCE_GROUP_DEFAULT CU_DEV_SM_RESOURCE_GROUP_BACKFILL + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID cdef extern from 'cuda.h': ctypedef enum CUdevSmResourceSplitByCount_flags "CUdevSmResourceSplitByCount_flags": @@ -1563,6 +1584,8 @@ cdef extern from 'cuda.h': CU_SHARED_MEMORY_MODE_DEFAULT CU_SHARED_MEMORY_MODE_REQUIRE_PORTABLE CU_SHARED_MEMORY_MODE_ALLOW_NON_PORTABLE + CU_SHARED_MEMORY_MODE_ALLOW_OVERSIZED_SHARED_MEMORY + CU_SHARED_MEMORY_MODE_PREFER_OVERSIZED_SHARED_MEMORY ctypedef CUsharedMemoryMode_enum CUsharedMemoryMode cdef extern from 'cuda.h': @@ -1595,8 +1618,16 @@ cdef extern from 'cuda.h': CU_GRAPH_RECAPTURE_INELIGIBLE_FOR_UPDATE CU_GRAPH_RECAPTURE_ERROR ctypedef CUgraphRecaptureStatus_enum CUgraphRecaptureStatus + +cdef extern from 'cuda.h': + ctypedef enum CUcliqueType_enum: + CU_CLIQUE_TYPE_UNICAST_POINTER + CU_CLIQUE_TYPE_MULTICAST_POINTER + CU_CLIQUE_TYPE_UNICAST_LOGICAL_ENDPOINT + CU_CLIQUE_TYPE_MULTICAST_LOGICAL_ENDPOINT + ctypedef CUcliqueType_enum CUcliqueType cdef enum: _CURESULT_INTERNAL_LOADING_ERROR = CUresult.CUDA_ERROR_NOT_FOUND -cdef enum: CUDA_VERSION = 13030 +cdef enum: CUDA_VERSION = 13040 # TYPES @@ -1932,6 +1963,12 @@ cdef extern from 'cuda.h': ctypedef CUcoredumpCallbackEntry_st* CUcoredumpCallbackHandle 'CUcoredumpCallbackHandle' +cdef extern from 'cuda.h': + ctypedef struct CUIcheckpointOperation_st: + pass + ctypedef CUIcheckpointOperation_st* CUcheckpointOperationHandle 'CUcheckpointOperationHandle' + + cdef extern from 'cuda.h': cdef struct CUuuid_st: char bytes[16] @@ -1970,12 +2007,12 @@ cdef extern from 'cuda.h': unsigned char remote ctypedef CUlaunchMemSyncDomainMap_st CUlaunchMemSyncDomainMap -cdef struct cuda_bindings_driver__anon_pod4: +cdef struct cuda_bindings_driver__anon_pod5: unsigned int x unsigned int y unsigned int z -cdef struct cuda_bindings_driver__anon_pod7: +cdef struct cuda_bindings_driver__anon_pod8: unsigned int x unsigned int y unsigned int z @@ -1994,44 +2031,44 @@ cdef extern from 'cuda.h': size_t dataWindowSize ctypedef CUlibraryHostUniversalFunctionAndDataTable_st CUlibraryHostUniversalFunctionAndDataTable -cdef struct cuda_bindings_driver__anon_pod10: +cdef struct cuda_bindings_driver__anon_pod11: unsigned int width unsigned int height unsigned int depth -cdef struct cuda_bindings_driver__anon_pod16: +cdef struct cuda_bindings_driver__anon_pod17: int reserved[32] -cdef struct cuda_bindings_driver__anon_pod18: +cdef struct cuda_bindings_driver__anon_pod19: void* handle void* name -cdef struct cuda_bindings_driver__anon_pod20: +cdef struct cuda_bindings_driver__anon_pod21: void* handle void* name -cdef struct cuda_bindings_driver__anon_pod22: +cdef struct cuda_bindings_driver__anon_pod23: unsigned long long value -cdef union cuda_bindings_driver__anon_pod23: +cdef union cuda_bindings_driver__anon_pod24: void* fence unsigned long long reserved -cdef struct cuda_bindings_driver__anon_pod24: +cdef struct cuda_bindings_driver__anon_pod25: unsigned long long key -cdef struct cuda_bindings_driver__anon_pod26: +cdef struct cuda_bindings_driver__anon_pod27: unsigned long long value -cdef union cuda_bindings_driver__anon_pod27: +cdef union cuda_bindings_driver__anon_pod28: void* fence unsigned long long reserved -cdef struct cuda_bindings_driver__anon_pod28: +cdef struct cuda_bindings_driver__anon_pod29: unsigned long long key unsigned int timeoutMs -cdef struct cuda_bindings_driver__anon_pod31: +cdef struct cuda_bindings_driver__anon_pod34: unsigned int level unsigned int layer unsigned int offsetX @@ -2041,12 +2078,16 @@ cdef struct cuda_bindings_driver__anon_pod31: unsigned int extentHeight unsigned int extentDepth -cdef struct cuda_bindings_driver__anon_pod32: +cdef struct cuda_bindings_driver__anon_pod35: unsigned int layer unsigned long long offset unsigned long long size -cdef struct cuda_bindings_driver__anon_pod35: +cdef struct cuda_bindings_driver__anon_pod38: + unsigned char deviceId + unsigned char localityDomainId + +cdef struct cuda_bindings_driver__anon_pod39: unsigned char compressionType unsigned char gpuDirectRDMACapable unsigned short usage @@ -2058,6 +2099,7 @@ cdef extern from 'cuda.h': unsigned int minSmPartitionSize unsigned int smCoscheduledAlignment unsigned int flags + unsigned int localityDomainId ctypedef CUdevSmResource_st CUdevSmResource cdef extern from 'cuda.h': @@ -2071,7 +2113,8 @@ cdef extern from 'cuda.h': unsigned int coscheduledSmCount unsigned int preferredCoscheduledSmCount unsigned int flags - unsigned int reserved[12] + unsigned int localityDomainId + unsigned int reserved[11] ctypedef CU_DEV_SM_RESOURCE_GROUP_PARAMS_st CU_DEV_SM_RESOURCE_GROUP_PARAMS cdef extern from 'cuda.h': @@ -2085,9 +2128,15 @@ cdef extern from 'cuda.h': unsigned char data[64] ctypedef CUlogicalEndpointFabricHandle_st CUlogicalEndpointFabricHandle -cdef struct cuda_bindings_driver__anon_pod43: +cdef struct cuda_bindings_driver__anon_pod48: unsigned int numDevices +cdef extern from 'cuda.h': + cdef struct CUcliqueInfo_st: + CUcliqueType type + unsigned int id + ctypedef CUcliqueInfo_st CUcliqueInfo + cdef extern from 'cuda.h': ctypedef size_t (*CUoccupancyB2DSize 'CUoccupancyB2DSize')( int blockSize @@ -2134,11 +2183,6 @@ cdef extern from 'cuda.h': cuuint64_t reserved1[7] ctypedef CUcheckpointLockArgs_st CUcheckpointLockArgs -cdef extern from 'cuda.h': - cdef struct CUcheckpointCheckpointArgs_st: - cuuint64_t reserved[8] - ctypedef CUcheckpointCheckpointArgs_st CUcheckpointCheckpointArgs - cdef extern from 'cuda.h': cdef struct CUcheckpointUnlockArgs_st: cuuint64_t reserved[8] @@ -2278,30 +2322,25 @@ cdef extern from 'cuda.h': CUcontext ctx ctypedef CUDA_KERNEL_NODE_PARAMS_v3_st CUDA_KERNEL_NODE_PARAMS_v3 -cdef struct cuda_bindings_driver__anon_pod12: +cdef struct cuda_bindings_driver__anon_pod13: CUarray hArray -cdef struct cuda_bindings_driver__anon_pod13: +cdef struct cuda_bindings_driver__anon_pod14: CUmipmappedArray hMipmappedArray -cdef union cuda_bindings_driver__anon_pod29: +cdef union cuda_bindings_driver__anon_pod32: CUmipmappedArray mipmap CUarray array -cdef struct cuda_bindings_driver__anon_pod5: +cdef struct cuda_bindings_driver__anon_pod6: CUevent event int flags int triggerAtBlockStart -cdef struct cuda_bindings_driver__anon_pod6: +cdef struct cuda_bindings_driver__anon_pod7: CUevent event int flags -cdef extern from 'cuda.h': - cdef struct CUDA_EVENT_RECORD_NODE_PARAMS_st: - CUevent event - ctypedef CUDA_EVENT_RECORD_NODE_PARAMS_st CUDA_EVENT_RECORD_NODE_PARAMS - cdef extern from 'cuda.h': cdef struct CUDA_EVENT_WAIT_NODE_PARAMS_st: CUevent event @@ -2350,7 +2389,7 @@ cdef extern from 'cuda.h': CUgraphNode errorFromNode ctypedef CUgraphExecUpdateResultInfo_st CUgraphExecUpdateResultInfo_v1 -cdef struct cuda_bindings_driver__anon_pod8: +cdef struct cuda_bindings_driver__anon_pod9: int deviceUpdatable CUgraphDeviceNode devNode @@ -2369,53 +2408,40 @@ cdef extern from 'cuda.h': void* userData ctypedef CUDA_HOST_NODE_PARAMS_st CUDA_HOST_NODE_PARAMS_v1 -cdef extern from 'cuda.h': - cdef struct CUDA_HOST_NODE_PARAMS_v2_st: - CUhostFn fn - void* userData - unsigned int syncMode - ctypedef CUDA_HOST_NODE_PARAMS_v2_st CUDA_HOST_NODE_PARAMS_v2 - cdef extern from 'cuda.h': cdef struct CUDA_ARRAY_SPARSE_PROPERTIES_st: - cuda_bindings_driver__anon_pod10 tileExtent + cuda_bindings_driver__anon_pod11 tileExtent unsigned int miptailFirstLevel unsigned long long miptailSize unsigned int flags unsigned int reserved[4] ctypedef CUDA_ARRAY_SPARSE_PROPERTIES_st CUDA_ARRAY_SPARSE_PROPERTIES_v1 -cdef union cuda_bindings_driver__anon_pod17: +cdef union cuda_bindings_driver__anon_pod18: int fd - cuda_bindings_driver__anon_pod18 win32 + cuda_bindings_driver__anon_pod19 win32 void* nvSciBufObject -cdef union cuda_bindings_driver__anon_pod19: +cdef union cuda_bindings_driver__anon_pod20: int fd - cuda_bindings_driver__anon_pod20 win32 + cuda_bindings_driver__anon_pod21 win32 void* nvSciSyncObj -cdef struct cuda_bindings_driver__anon_pod21: - cuda_bindings_driver__anon_pod22 fence - cuda_bindings_driver__anon_pod23 nvSciSync - cuda_bindings_driver__anon_pod24 keyedMutex +cdef struct cuda_bindings_driver__anon_pod22: + cuda_bindings_driver__anon_pod23 fence + cuda_bindings_driver__anon_pod24 nvSciSync + cuda_bindings_driver__anon_pod25 keyedMutex unsigned int reserved[12] -cdef struct cuda_bindings_driver__anon_pod25: - cuda_bindings_driver__anon_pod26 fence - cuda_bindings_driver__anon_pod27 nvSciSync - cuda_bindings_driver__anon_pod28 keyedMutex +cdef struct cuda_bindings_driver__anon_pod26: + cuda_bindings_driver__anon_pod27 fence + cuda_bindings_driver__anon_pod28 nvSciSync + cuda_bindings_driver__anon_pod29 keyedMutex unsigned int reserved[10] -cdef union cuda_bindings_driver__anon_pod30: - cuda_bindings_driver__anon_pod31 sparseLevel - cuda_bindings_driver__anon_pod32 miptail - -cdef extern from 'cuda.h': - cdef struct CUmemLocation_st: - CUmemLocationType type - int id - ctypedef CUmemLocation_st CUmemLocation_v1 +cdef union cuda_bindings_driver__anon_pod33: + cuda_bindings_driver__anon_pod34 sparseLevel + cuda_bindings_driver__anon_pod35 miptail cdef extern from 'cuda.h': cdef struct CUstreamCigCaptureParams_st: @@ -2557,13 +2583,13 @@ cdef extern from 'cuda.h': size_t Depth ctypedef CUDA_MEMCPY3D_PEER_st CUDA_MEMCPY3D_PEER_v1 -cdef struct cuda_bindings_driver__anon_pod14: +cdef struct cuda_bindings_driver__anon_pod15: CUdeviceptr devPtr CUarray_format format unsigned int numChannels size_t sizeInBytes -cdef struct cuda_bindings_driver__anon_pod15: +cdef struct cuda_bindings_driver__anon_pod16: CUdeviceptr devPtr CUarray_format format unsigned int numChannels @@ -2576,6 +2602,13 @@ cdef extern from 'cuda.h': CUdeviceptr dptr ctypedef CUDA_MEM_FREE_NODE_PARAMS_st CUDA_MEM_FREE_NODE_PARAMS +cdef extern from 'cuda.h': + cdef struct CUcheckpointCustomStoragePerDeviceData_st: + CUdeviceptr devPtr + size_t size + CUstream stream + ctypedef CUcheckpointCustomStoragePerDeviceData_st CUcheckpointCustomStoragePerDeviceData + cdef extern from 'cuda.h': cdef struct CUdevWorkqueueConfigResource_st: CUdevice device @@ -2583,7 +2616,7 @@ cdef extern from 'cuda.h': CUdevWorkqueueConfigScope sharingScope ctypedef CUdevWorkqueueConfigResource_st CUdevWorkqueueConfigResource -cdef struct cuda_bindings_driver__anon_pod42: +cdef struct cuda_bindings_driver__anon_pod47: CUdevice device cdef extern from 'cuda.h': @@ -2594,7 +2627,7 @@ cdef extern from 'cuda.h': ) -cdef union cuda_bindings_driver__anon_pod9: +cdef union cuda_bindings_driver__anon_pod10: CUexecAffinitySmCount smCount cdef extern from 'cuda.h': @@ -2605,10 +2638,10 @@ cdef extern from 'cuda.h': unsigned int reserved[16] ctypedef CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1 -cdef union cuda_bindings_driver__anon_pod33: +cdef union cuda_bindings_driver__anon_pod36: CUmemGenericAllocationHandle memHandle -cdef struct cuda_bindings_driver__anon_pod38: +cdef struct cuda_bindings_driver__anon_pod42: CUarray array CUoffset3D offset @@ -2630,16 +2663,16 @@ cdef extern from 'cuda.h': CUaccessPolicyWindow accessPolicyWindow int cooperative CUsynchronizationPolicy syncPolicy - cuda_bindings_driver__anon_pod4 clusterDim + cuda_bindings_driver__anon_pod5 clusterDim CUclusterSchedulingPolicy clusterSchedulingPolicyPreference int programmaticStreamSerializationAllowed - cuda_bindings_driver__anon_pod5 programmaticEvent - cuda_bindings_driver__anon_pod6 launchCompletionEvent + cuda_bindings_driver__anon_pod6 programmaticEvent + cuda_bindings_driver__anon_pod7 launchCompletionEvent int priority CUlaunchMemSyncDomainMap memSyncDomainMap CUlaunchMemSyncDomain memSyncDomain - cuda_bindings_driver__anon_pod7 preferredClusterDim - cuda_bindings_driver__anon_pod8 deviceUpdatableKernelNode + cuda_bindings_driver__anon_pod8 preferredClusterDim + cuda_bindings_driver__anon_pod9 deviceUpdatableKernelNode unsigned int sharedMemCarveout unsigned int nvlinkUtilCentricScheduling CUlaunchAttributePortableClusterMode portableClusterSizeMode @@ -2647,11 +2680,20 @@ cdef extern from 'cuda.h': ctypedef CUlaunchAttributeValue_union CUlaunchAttributeValue cdef extern from 'cuda.h': - cdef struct CUcheckpointRestoreArgs_st: - CUcheckpointGpuPair* gpuPairs - unsigned int gpuPairsCount - char reserved[((64 - 8) - 4)] - ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs + cdef struct CUDA_HOST_NODE_PARAMS_v2_st: + CUhostFn fn + void* userData + unsigned int syncMode + CUcontext ctx + CUgreenCtx gCtx + ctypedef CUDA_HOST_NODE_PARAMS_v2_st CUDA_HOST_NODE_PARAMS_v2 + +cdef extern from 'cuda.h': + cdef struct CUDA_EVENT_RECORD_NODE_PARAMS_st: + CUevent event + CUcontext ctx + CUgreenCtx gCtx + ctypedef CUDA_EVENT_RECORD_NODE_PARAMS_st CUDA_EVENT_RECORD_NODE_PARAMS cdef extern from 'cuda.h': cdef struct CUasyncNotificationInfo_st: @@ -2670,7 +2712,7 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': cdef struct CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: CUexternalMemoryHandleType type - cuda_bindings_driver__anon_pod17 handle + cuda_bindings_driver__anon_pod18 handle unsigned long long size unsigned int flags unsigned int reserved[16] @@ -2679,28 +2721,31 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': cdef struct CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: CUexternalSemaphoreHandleType type - cuda_bindings_driver__anon_pod19 handle + cuda_bindings_driver__anon_pod20 handle unsigned int flags unsigned int reserved[16] ctypedef CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1 cdef extern from 'cuda.h': cdef struct CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: - cuda_bindings_driver__anon_pod21 params + cuda_bindings_driver__anon_pod22 params unsigned int flags unsigned int reserved[16] ctypedef CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1 cdef extern from 'cuda.h': cdef struct CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: - cuda_bindings_driver__anon_pod25 params + cuda_bindings_driver__anon_pod26 params unsigned int flags unsigned int reserved[16] ctypedef CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1 cdef extern from 'cuda.h': - ctypedef CUmemLocation_v1 CUmemLocation 'CUmemLocation' - + cdef struct CUmemLocation_st: + CUmemLocationType type + int id + cuda_bindings_driver__anon_pod38 localized + ctypedef CUmemLocation_st CUmemLocation_v1 cdef extern from 'cuda.h': cdef union CUstreamBatchMemOpParams_union: @@ -2729,17 +2774,24 @@ cdef extern from 'cuda.h': ctypedef CUDA_MEMCPY3D_PEER_v1 CUDA_MEMCPY3D_PEER 'CUDA_MEMCPY3D_PEER' -cdef union cuda_bindings_driver__anon_pod11: - cuda_bindings_driver__anon_pod12 array - cuda_bindings_driver__anon_pod13 mipmap - cuda_bindings_driver__anon_pod14 linear - cuda_bindings_driver__anon_pod15 pitch2D - cuda_bindings_driver__anon_pod16 reserved +cdef union cuda_bindings_driver__anon_pod12: + cuda_bindings_driver__anon_pod13 array + cuda_bindings_driver__anon_pod14 mipmap + cuda_bindings_driver__anon_pod15 linear + cuda_bindings_driver__anon_pod16 pitch2D + cuda_bindings_driver__anon_pod17 reserved + +cdef extern from 'cuda.h': + cdef struct CUcheckpointCustomStorageInfo_st: + CUcheckpointOperationHandle handle + CUcheckpointCustomStoragePerDeviceData* perDeviceData + unsigned int deviceCount + ctypedef CUcheckpointCustomStorageInfo_st CUcheckpointCustomStorageInfo cdef extern from 'cuda.h': cdef struct CUexecAffinityParam_st: CUexecAffinityType type - cuda_bindings_driver__anon_pod9 param + cuda_bindings_driver__anon_pod10 param ctypedef CUexecAffinityParam_st CUexecAffinityParam_v1 cdef extern from 'cuda.h': @@ -2749,12 +2801,12 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': cdef struct CUarrayMapInfo_st: CUresourcetype resourceType - cuda_bindings_driver__anon_pod29 resource + cuda_bindings_driver__anon_pod32 resource CUarraySparseSubresourceType subresourceType - cuda_bindings_driver__anon_pod30 subresource + cuda_bindings_driver__anon_pod33 subresource CUmemOperationType memOperationType CUmemHandleType memHandleType - cuda_bindings_driver__anon_pod33 memHandle + cuda_bindings_driver__anon_pod36 memHandle unsigned long long offset unsigned int deviceBitMask unsigned int flags @@ -2800,44 +2852,8 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': - cdef struct CUmemAllocationProp_st: - CUmemAllocationType type - CUmemAllocationHandleType requestedHandleTypes - CUmemLocation location - void* win32HandleMetaData - cuda_bindings_driver__anon_pod35 allocFlags - ctypedef CUmemAllocationProp_st CUmemAllocationProp_v1 - -cdef extern from 'cuda.h': - cdef struct CUmemAccessDesc_st: - CUmemLocation location - CUmemAccess_flags flags - ctypedef CUmemAccessDesc_st CUmemAccessDesc_v1 - -cdef extern from 'cuda.h': - cdef struct CUmemPoolProps_st: - CUmemAllocationType allocType - CUmemAllocationHandleType handleTypes - CUmemLocation location - void* win32SecurityAttributes - size_t maxSize - unsigned short usage - unsigned char reserved[54] - ctypedef CUmemPoolProps_st CUmemPoolProps_v1 - -cdef extern from 'cuda.h': - cdef struct CUmemcpyAttributes_st: - CUmemcpySrcAccessOrder srcAccessOrder - CUmemLocation srcLocHint - CUmemLocation dstLocHint - unsigned int flags - ctypedef CUmemcpyAttributes_st CUmemcpyAttributes_v1 + ctypedef CUmemLocation_v1 CUmemLocation 'CUmemLocation' -cdef struct cuda_bindings_driver__anon_pod37: - CUdeviceptr ptr - size_t rowLength - size_t layerHeight - CUmemLocation locHint cdef extern from 'cuda.h': ctypedef CUstreamBatchMemOpParams_v1 CUstreamBatchMemOpParams 'CUstreamBatchMemOpParams' @@ -2854,10 +2870,25 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': cdef struct CUDA_RESOURCE_DESC_st: CUresourcetype resType - cuda_bindings_driver__anon_pod11 res + cuda_bindings_driver__anon_pod12 res unsigned int flags ctypedef CUDA_RESOURCE_DESC_st CUDA_RESOURCE_DESC_v1 +cdef extern from 'cuda.h': + cdef struct CUcheckpointCheckpointArgs_st: + CUcheckpointCustomStorageInfo** customStorageInfo_out + char reserved[56] + ctypedef CUcheckpointCheckpointArgs_st CUcheckpointCheckpointArgs + +cdef extern from 'cuda.h': + cdef struct CUcheckpointRestoreArgs_st: + CUcheckpointGpuPair* gpuPairs + unsigned int gpuPairsCount + unsigned int padding0 + CUcheckpointCustomStorageInfo** customStorageInfo_out + char reserved[40] + ctypedef CUcheckpointRestoreArgs_st CUcheckpointRestoreArgs + cdef extern from 'cuda.h': cdef struct CUdevResource_st: CUdevResourceType type @@ -2872,8 +2903,8 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': cdef struct CUlogicalEndpointProp_struct: CUlogicalEndpointType type - cuda_bindings_driver__anon_pod42 unicast - cuda_bindings_driver__anon_pod43 multicast + cuda_bindings_driver__anon_pod47 unicast + cuda_bindings_driver__anon_pod48 multicast unsigned long long size unsigned int ipcHandleTypes unsigned int flags @@ -2921,6 +2952,8 @@ cdef extern from 'cuda.h': CUexternalSemaphore* extSemArray CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* paramsArray unsigned int numExtSems + CUcontext ctx + CUgreenCtx gCtx ctypedef CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 cdef extern from 'cuda.h': @@ -2935,27 +2968,50 @@ cdef extern from 'cuda.h': CUexternalSemaphore* extSemArray CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* paramsArray unsigned int numExtSems + CUcontext ctx + CUgreenCtx gCtx ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2 cdef extern from 'cuda.h': - ctypedef CUmemAllocationProp_v1 CUmemAllocationProp 'CUmemAllocationProp' - + cdef struct CUmemAllocationProp_st: + CUmemAllocationType type + CUmemAllocationHandleType requestedHandleTypes + CUmemLocation location + void* win32HandleMetaData + cuda_bindings_driver__anon_pod39 allocFlags + ctypedef CUmemAllocationProp_st CUmemAllocationProp_v1 cdef extern from 'cuda.h': - ctypedef CUmemAccessDesc_v1 CUmemAccessDesc 'CUmemAccessDesc' - + cdef struct CUmemAccessDesc_st: + CUmemLocation location + CUmemAccess_flags flags + ctypedef CUmemAccessDesc_st CUmemAccessDesc_v1 cdef extern from 'cuda.h': - ctypedef CUmemPoolProps_v1 CUmemPoolProps 'CUmemPoolProps' - + cdef struct CUmemPoolProps_st: + CUmemAllocationType allocType + CUmemAllocationHandleType handleTypes + CUmemLocation location + void* win32SecurityAttributes + size_t maxSize + unsigned short usage + unsigned char gpuDirectRDMACapable + unsigned char reserved[53] + ctypedef CUmemPoolProps_st CUmemPoolProps_v1 cdef extern from 'cuda.h': - ctypedef CUmemcpyAttributes_v1 CUmemcpyAttributes 'CUmemcpyAttributes' - + cdef struct CUmemcpyAttributes_st: + CUmemcpySrcAccessOrder srcAccessOrder + CUmemLocation srcLocHint + CUmemLocation dstLocHint + unsigned int flags + ctypedef CUmemcpyAttributes_st CUmemcpyAttributes_v1 -cdef union cuda_bindings_driver__anon_pod36: - cuda_bindings_driver__anon_pod37 ptr - cuda_bindings_driver__anon_pod38 array +cdef struct cuda_bindings_driver__anon_pod41: + CUdeviceptr ptr + size_t rowLength + size_t layerHeight + CUmemLocation locHint cdef extern from 'cuda.h': cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: @@ -2996,6 +3052,30 @@ cdef extern from 'cuda.h': ctypedef CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1 CUDA_EXT_SEM_WAIT_NODE_PARAMS 'CUDA_EXT_SEM_WAIT_NODE_PARAMS' +cdef extern from 'cuda.h': + ctypedef CUmemAllocationProp_v1 CUmemAllocationProp 'CUmemAllocationProp' + + +cdef extern from 'cuda.h': + ctypedef CUmemAccessDesc_v1 CUmemAccessDesc 'CUmemAccessDesc' + + +cdef extern from 'cuda.h': + ctypedef CUmemPoolProps_v1 CUmemPoolProps 'CUmemPoolProps' + + +cdef extern from 'cuda.h': + ctypedef CUmemcpyAttributes_v1 CUmemcpyAttributes 'CUmemcpyAttributes' + + +cdef union cuda_bindings_driver__anon_pod40: + cuda_bindings_driver__anon_pod41 ptr + cuda_bindings_driver__anon_pod42 array + +cdef extern from 'cuda.h': + ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 CUDA_BATCH_MEM_OP_NODE_PARAMS 'CUDA_BATCH_MEM_OP_NODE_PARAMS' + + cdef extern from 'cuda.h': cdef struct CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: CUmemPoolProps poolProps @@ -3017,13 +3097,9 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': cdef struct CUmemcpy3DOperand_st: CUmemcpy3DOperandType type - cuda_bindings_driver__anon_pod36 op + cuda_bindings_driver__anon_pod40 op ctypedef CUmemcpy3DOperand_st CUmemcpy3DOperand_v1 -cdef extern from 'cuda.h': - ctypedef CUDA_BATCH_MEM_OP_NODE_PARAMS_v1 CUDA_BATCH_MEM_OP_NODE_PARAMS 'CUDA_BATCH_MEM_OP_NODE_PARAMS' - - cdef extern from 'cuda.h': ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1 CUDA_MEM_ALLOC_NODE_PARAMS 'CUDA_MEM_ALLOC_NODE_PARAMS' @@ -3632,6 +3708,13 @@ cdef CUresult cuLogicalEndpointImport(CUlogicalEndpointId leId, const void* hand cdef CUresult cuLogicalEndpointGetLimits(cuuint64_t* bindAlignment, cuuint64_t* maxSize, const CUlogicalEndpointProp* prop) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, int* queryStatus) except ?CUDA_ERROR_NOT_FOUND nogil cdef CUresult cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetFabricClusterUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetCliqueCount(size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuDeviceGetCliqueInfo(CUcliqueInfo* cliqueInfo, size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuMemGetLocationInfo(CUdeviceptr ptr, size_t size, size_t summaryGranularity, size_t samplingGranularity, CUmemLocation* location_out) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphAddNode_v3(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuGraphNodeSetParams_v2(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil # TODO: Extract these defines somehow? @@ -3716,6 +3799,8 @@ cdef enum: CU_MEM_CREATE_USAGE_TILE_POOL = 1 cdef enum: CU_MEM_CREATE_USAGE_HW_DECOMPRESS = 2 +cdef enum: CU_MEM_CREATE_USAGE_GPU_DIRECT_RDMA_OVER_PCIE = 4 + cdef enum: CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS = 2 cdef enum: CUDA_COOPERATIVE_LAUNCH_MULTI_DEVICE_NO_PRE_LAUNCH_SYNC = 1 diff --git a/cuda_bindings/cuda/bindings/cydriver.pyx b/cuda_bindings/cuda/bindings/cydriver.pyx index 2ca1d97644e..af647d36913 100644 --- a/cuda_bindings/cuda/bindings/cydriver.pyx +++ b/cuda_bindings/cuda/bindings/cydriver.pyx @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5b828e2ee0de9b245c71a6ba9361656ab10f7564caa7e3d9c162b2c6a07fb3df +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=66aba9b58abd5c5ae210ca5ca8ac01676cb64b9f4059c17623b68146e30381ac from ._internal cimport driver as _driver cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -2073,3 +2074,31 @@ cdef CUresult cuLogicalEndpointQuery(CUlogicalEndpointId leId, cuuint32_t count, cdef CUresult cuStreamBeginRecaptureToGraph(CUstream hStream, CUstreamCaptureMode mode, CUgraph hGraph, CUgraphRecaptureCallback callbackFunc, void* userData) except ?CUDA_ERROR_NOT_FOUND nogil: return _driver._cuStreamBeginRecaptureToGraph(hStream, mode, hGraph, callbackFunc, userData) + + +cdef CUresult cuDeviceGetFabricClusterUuid(CUuuid* uuid, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetFabricClusterUuid(uuid, dev) + + +cdef CUresult cuDeviceGetCliqueCount(size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetCliqueCount(count, dev) + + +cdef CUresult cuDeviceGetCliqueInfo(CUcliqueInfo* cliqueInfo, size_t* count, CUdevice dev) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuDeviceGetCliqueInfo(cliqueInfo, count, dev) + + +cdef CUresult cuMemGetLocationInfo(CUdeviceptr ptr, size_t size, size_t summaryGranularity, size_t samplingGranularity, CUmemLocation* location_out) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuMemGetLocationInfo(ptr, size, summaryGranularity, samplingGranularity, location_out) + + +cdef CUresult cuGraphAddNode_v3(CUgraphNode* phGraphNode, CUgraph hGraph, const CUgraphNode* dependencies, const CUgraphEdgeData* dependencyData, size_t numDependencies, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphAddNode_v3(phGraphNode, hGraph, dependencies, dependencyData, numDependencies, nodeParams) + + +cdef CUresult cuGraphNodeSetParams_v2(CUgraphNode hNode, CUgraphNodeParams* nodeParams) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuGraphNodeSetParams_v2(hNode, nodeParams) + + +cdef CUresult cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuCheckpointOperationComplete(handle) diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pxd b/cuda_bindings/cuda/bindings/cynvfatbin.pxd index ef8951fbcc3..c9d844c6da9 100644 --- a/cuda_bindings/cuda/bindings/cynvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/cynvfatbin.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fede358631d711050e04c9b0f7582773ba7012844987bc47358f1378d484a136 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=350ce092394c88b497887fcb76999a31e960cb7c395fbc50aadd7d5ce174ffc7 from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/cynvfatbin.pyx b/cuda_bindings/cuda/bindings/cynvfatbin.pyx index 86bdd89f0f3..45c539c5ac8 100644 --- a/cuda_bindings/cuda/bindings/cynvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/cynvfatbin.pyx @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bae30bbdaff2009b86c05de2a46bbaecad9e63327c93a10b6f2e8a2d95fd6a60 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a68125034d3e119ba0ef4b2b9d490cee4a84ffc773465379588b86d515dfa022 from ._internal cimport nvfatbin as _nvfatbin diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pxd b/cuda_bindings/cuda/bindings/cynvjitlink.pxd index ff80a17c5ab..b6bc62c1d7b 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=58778b073e81f54fcf5c42775b45944d22b6e944fe6965b42d83898239f1e1b6 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=19b54696d673ac6a15251d0a9fb4d23d19a3ed87a31a38a1727cf89a4a1a8383 from libc.stdint cimport intptr_t, uint32_t diff --git a/cuda_bindings/cuda/bindings/cynvjitlink.pyx b/cuda_bindings/cuda/bindings/cynvjitlink.pyx index cf4ee0332a0..fd20bfee10f 100644 --- a/cuda_bindings/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/cynvjitlink.pyx @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e507515291c3bc20b88d0b58ab5b01a1cc38c5d21bca87a4f379cc846b869ed4 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f91e9f01600d3933b3489ae1d9963b33f8095779168d3b27949645eb41926ec3 from ._internal cimport nvjitlink as _nvjitlink diff --git a/cuda_bindings/cuda/bindings/cynvml.pxd b/cuda_bindings/cuda/bindings/cynvml.pxd index 61ac3fa0da7..be3ab2da3ae 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pxd +++ b/cuda_bindings/cuda/bindings/cynvml.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5e55307c8ff89e076c29fc7c2a36bf0af7ecf3162693a4c94d7fca65454d6a9e +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6cd5217ee9e8afc03e6cce40801c8b2ad5f105d1fb2a1528910955e91e3cc570 from libc.stdint cimport int64_t @@ -198,7 +199,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 @@ -213,6 +217,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": @@ -382,6 +387,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 @@ -418,6 +424,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 @@ -770,7 +778,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 @@ -788,7 +940,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 @@ -802,6 +964,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 @@ -828,6 +998,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': @@ -1508,6 +1706,102 @@ 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 nvmlOperationalEventContextInfo_v1_t 'nvmlOperationalEventContextInfo_v1_t': + unsigned int nvmlGpuOperationalEventContextType + unsigned int sourceEventContextType + unsigned int dataSize + unsigned short dataFormatVersion + +ctypedef struct nvmlGpuOperationalEventContextLegacyXid_v1_t 'nvmlGpuOperationalEventContextLegacyXid_v1_t': + 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 nvmlEventData_v2_t 'nvmlEventData_v2_t': + 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 dataType + 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' @@ -1865,6 +2159,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' @@ -1963,7 +2287,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' @@ -1978,6 +2302,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' @@ -1999,8 +2333,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 @@ -2357,3 +2722,22 @@ cdef nvmlReturn_t nvmlDeviceGetVgpuSchedulerLog_v2(nvmlDevice_t device, nvmlVgpu cdef nvmlReturn_t nvmlGpuInstanceGetVgpuSchedulerLog_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerLogInfo_v2_t* pSchedulerLogInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +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, nvmlEventData_v2_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, unsigned int index, nvmlOperationalEventContextInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetContextData_v1(nvmlEventSet_t set, unsigned int index, void* data, unsigned int* dataSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, unsigned int index, nvmlGpuOperationalEventContextLegacyXid_v1_t* xid) 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 612368c7736..6c62117b741 100644 --- a/cuda_bindings/cuda/bindings/cynvml.pyx +++ b/cuda_bindings/cuda/bindings/cynvml.pyx @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ec221879a459b2de9b3dfe54cba58613e9c08b279a95f782a450c98fd7cea532 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=099ee5a0fb0a12b6d7e67b841b75a59bad0b98a1cfc171914aa985729c034980 from ._internal cimport nvml as _nvml @@ -1414,3 +1415,79 @@ cdef nvmlReturn_t nvmlDeviceSetVgpuSchedulerState_v2(nvmlDevice_t device, nvmlVg cdef nvmlReturn_t nvmlGpuInstanceSetVgpuSchedulerState_v2(nvmlGpuInstance_t gpuInstance, nvmlVgpuSchedulerState_v2_t* pSchedulerState) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: return _nvml._nvmlGpuInstanceSetVgpuSchedulerState_v2(gpuInstance, pSchedulerState) + + +cdef nvmlReturn_t nvmlSystemGetCPER_v1(nvmlGetCPER_v1_t* cper) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetCPER_v1(cper) + + +cdef nvmlReturn_t nvmlDeviceGetBBXTimeData_v1(nvmlDevice_t device, nvmlBBXTimeData_v1_t* timeData) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetBBXTimeData_v1(device, timeData) + + +cdef nvmlReturn_t nvmlDeviceGetAccountingStats_v2(nvmlDevice_t device, nvmlAccountingStats_v2_t* stats) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetAccountingStats_v2(device, stats) + + +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, nvmlEventData_v2_t* data, unsigned int timeoutms) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetWait_v3(set, data, timeoutms) + + +cdef nvmlReturn_t nvmlEventSetGetContextCount_v1(nvmlEventSet_t set, unsigned int* count) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetContextCount_v1(set, count) + + +cdef nvmlReturn_t nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, unsigned int index, nvmlOperationalEventContextInfo_v1_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetContextInfo_v1(set, index, info) + + +cdef nvmlReturn_t nvmlEventSetGetContextData_v1(nvmlEventSet_t set, unsigned int index, void* data, unsigned int* dataSize) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetContextData_v1(set, index, data, dataSize) + + +cdef nvmlReturn_t nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, unsigned int index, nvmlGpuOperationalEventContextLegacyXid_v1_t* xid) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(set, index, xid) + + +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/cynvrtc.pxd b/cuda_bindings/cuda/bindings/cynvrtc.pxd index e377fd316e2..37e76005971 100644 --- a/cuda_bindings/cuda/bindings/cynvrtc.pxd +++ b/cuda_bindings/cuda/bindings/cynvrtc.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=dbbc8028df717e2c963cb78a4e59700459ad88e1ac111c61e5992d7d007ecc5e +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a5984ec05eaf04c2ac41c7771b8f7b364aeab3379ee9785f1b24be8d3cf54996 from libc.stdint cimport uint32_t, uint64_t diff --git a/cuda_bindings/cuda/bindings/cynvrtc.pyx b/cuda_bindings/cuda/bindings/cynvrtc.pyx index 6289a40092a..fba8bc6a646 100644 --- a/cuda_bindings/cuda/bindings/cynvrtc.pyx +++ b/cuda_bindings/cuda/bindings/cynvrtc.pyx @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9725757222bfc514253ab6a6113b4e6b1c33fab841fe2fff8ebb1012ecf7715b +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1d9a881bfe3a610482ffafe142e4f1ce9b0fbaa994c5b5ffc3479aaffa3321ee from ._internal cimport nvrtc as _nvrtc cdef const char* nvrtcGetErrorString(nvrtcResult result) except?NULL nogil: diff --git a/cuda_bindings/cuda/bindings/cynvvm.pxd b/cuda_bindings/cuda/bindings/cynvvm.pxd index f25e7e84b3b..265ba1e67ac 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.0. Do not modify it directly. ############################################################################### @@ -10,7 +10,8 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=79be0fd21f7c6b6112743eb60ce9e69287a66999ecaaa063d87a52ab64982bce +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a12951d46579f8e61f9db52baac664267a20686d4817cd73fca72880384938c8 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..acfac1325ff 100644 --- a/cuda_bindings/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings/cuda/bindings/cynvvm.pyx @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7ea5803be62646c287bad43350e27d3254f35d25ab50b9c54f7ac5695b4c3114 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7b192f7eeaa6f6cf5d27ad50ab58bd7120734a43628621ee954ab223b0e772c5 from ._internal cimport nvvm as _nvvm diff --git a/cuda_bindings/cuda/bindings/cyruntime.pxd b/cuda_bindings/cuda/bindings/cyruntime.pxd index 58e0a14ca60..387c3f09d7f 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pxd +++ b/cuda_bindings/cuda/bindings/cyruntime.pxd @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2b62a3b56226f5cf6953f578057af792369a100b7775328c5aa66d81d780d2ac +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=833f9a47fd72d2c4d0b0b88e49283e323464e1cfb40f424ab9915beb9d24502a from libc.stdint cimport uint32_t, uint64_t @@ -243,6 +244,7 @@ cdef extern from 'driver_types.h': cudaErrorUnsupportedExecAffinity cudaErrorUnsupportedDevSideSync cudaErrorContained + cudaErrorInsufficientLoaderVersion cudaErrorInvalidSource cudaErrorFileNotFound cudaErrorSharedObjectSymbolNotFound @@ -304,6 +306,7 @@ cdef extern from 'driver_types.h': cudaErrorInvalidResourceConfiguration cudaErrorStreamDetached cudaErrorGraphRecaptureFailure + cudaErrorFabricNotReady cudaErrorUnknown cudaErrorApiFailureBase @@ -401,6 +404,7 @@ cdef extern from 'driver_types.h': cudaClusterSchedulingPolicyDefault cudaClusterSchedulingPolicySpread cudaClusterSchedulingPolicyLoadBalancing + cudaClusterSchedulingPolicyRubinDsmemLocality cdef extern from 'driver_types.h': cdef enum cudaStreamUpdateCaptureDependenciesFlags: @@ -493,6 +497,7 @@ cdef extern from 'driver_types.h': cudaFuncAttributeRequiredClusterDepth cudaFuncAttributeNonPortableClusterSizeAllowed cudaFuncAttributeClusterSchedulingPolicyPreference + cudaFuncAttributeSharedMemoryMode cudaFuncAttributeMax cdef extern from 'driver_types.h': @@ -530,6 +535,7 @@ cdef extern from 'driver_types.h': cudaLimitDevRuntimePendingLaunchCount cudaLimitMaxL2FetchGranularity cudaLimitPersistingL2CacheSize + cudaLimitPerBlockMemorySize cdef extern from 'driver_types.h': cdef enum cudaMemoryAdvise: @@ -711,7 +717,10 @@ cdef extern from 'driver_types.h': cudaDevAttrReserved145 cudaDevAttrOnlyPartialHostNativeAtomicSupported cudaDevAttrAtomicReductionSupported + cudaDevAttrLocalityDomainCount + cudaDevAttrOversizedSharedMemoryPerBlock cudaDevAttrCigStreamsSupported + cudaDevAttrLocalityDomainMultiprocessorCount cudaDevAttrMax cudaDevAttrCooperativeMultiDeviceLaunch cudaDevAttrMaxTimelineSemaphoreInteropSupported @@ -732,6 +741,7 @@ cdef extern from 'driver_types.h': cudaMemPoolAttrLocationType cudaMemPoolAttrMaxPoolSize cudaMemPoolAttrHwDecompressEnabled + cudaMemPoolAttrLocalityDomainId cdef extern from 'driver_types.h': cdef enum cudaMemLocationType: @@ -742,6 +752,7 @@ cdef extern from 'driver_types.h': cudaMemLocationTypeHostNuma cudaMemLocationTypeHostNumaCurrent cudaMemLocationTypeInvisible + cudaMemLocationTypeDeviceLocalityDomain cdef extern from 'driver_types.h': cdef enum cudaMemAccessFlags: @@ -1077,6 +1088,7 @@ cdef extern from 'library_types.h': CUDA_R_6F_E2M3 CUDA_R_6F_E3M2 CUDA_R_4F_E2M1 + CUDA_R_8F_UE5M3 ctypedef cudaDataType_t cudaDataType cdef enum cudaEglFrameType_enum: @@ -1254,10 +1266,25 @@ cdef extern from 'library_types.h': CUDA_EMULATION_STRATEGY_EAGER ctypedef cudaEmulationStrategy_t cudaEmulationStrategy +cdef extern from 'library_types.h': + cdef enum cudaEmulationMantissaControl_t: + CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC + CUDA_EMULATION_MANTISSA_CONTROL_FIXED + ctypedef cudaEmulationMantissaControl_t cudaEmulationMantissaControl + +cdef extern from 'library_types.h': + cdef enum cudaEmulationSpecialValuesSupport_t: + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY + CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN + ctypedef cudaEmulationSpecialValuesSupport_t cudaEmulationSpecialValuesSupport + cdef extern from 'driver_types.h': cdef enum cudaDevSmResourceGroup_flags: cudaDevSmResourceGroupDefault cudaDevSmResourceGroupBackfill + cudaDevSmResourceGroupLocalityDomainId cdef extern from 'driver_types.h': cdef enum cudaDevSmResourceSplitByCount_flags: @@ -1276,20 +1303,6 @@ cdef extern from 'driver_types.h': cudaDevWorkqueueConfigScopeDeviceCtx cudaDevWorkqueueConfigScopeGreenCtxBalanced -cdef extern from 'library_types.h': - cdef enum cudaEmulationMantissaControl_t: - CUDA_EMULATION_MANTISSA_CONTROL_DYNAMIC - CUDA_EMULATION_MANTISSA_CONTROL_FIXED - ctypedef cudaEmulationMantissaControl_t cudaEmulationMantissaControl - -cdef extern from 'library_types.h': - cdef enum cudaEmulationSpecialValuesSupport_t: - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_DEFAULT - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NONE - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_INFINITY - CUDA_EMULATION_SPECIAL_VALUES_SUPPORT_NAN - ctypedef cudaEmulationSpecialValuesSupport_t cudaEmulationSpecialValuesSupport - cdef extern from 'driver_types.h': cdef enum cudaHostTaskSyncMode: cudaHostTaskBlocking @@ -1313,6 +1326,8 @@ cdef extern from 'driver_types.h': cudaSharedMemoryModeDefault cudaSharedMemoryModeRequirePortable cudaSharedMemoryModeAllowNonPortable + cudaSharedMemoryModeAllowOversizedSharedMemory + cudaSharedMemoryModePreferOversizedSharedMemory cdef extern from 'driver_types.h': cdef enum cudaGraphRecaptureStatus: @@ -1456,14 +1471,6 @@ cdef extern from 'driver_types.h': unsigned int lastLayer unsigned int reserved[16] -cdef extern from 'driver_types.h': - cdef struct cudaPointerAttributes: - cudaMemoryType type - int device - void* devicePointer - void* hostPointer - long reserved[8] - cdef extern from 'driver_types.h': cdef struct cudaFuncAttributes: size_t sharedSizeBytes @@ -1483,9 +1490,13 @@ cdef extern from 'driver_types.h': int clusterSchedulingPolicyPreference int nonPortableClusterSizeAllowed int deviceNodeUpdateStatus - int reserved1 + cudaSharedMemoryMode sharedMemoryMode int reserved[14] +cdef struct cuda_bindings_runtime__anon_pod9: + unsigned char deviceId + unsigned char localityDomainId + cdef extern from 'driver_types.h': cdef struct cudaMemPoolPtrExportData: unsigned char reserved[64] @@ -1611,7 +1622,7 @@ cdef extern from 'driver_types.h': char reserved[64] ctypedef cudaMemFabricHandle_st cudaMemFabricHandle_t -cdef struct cuda_bindings_runtime__anon_pod12: +cdef struct cuda_bindings_runtime__anon_pod14: void* handle void* name @@ -1622,28 +1633,28 @@ cdef extern from 'driver_types.h': unsigned int flags unsigned int reserved[16] -cdef struct cuda_bindings_runtime__anon_pod14: +cdef struct cuda_bindings_runtime__anon_pod16: void* handle void* name -cdef struct cuda_bindings_runtime__anon_pod16: +cdef struct cuda_bindings_runtime__anon_pod18: unsigned long long value -cdef union cuda_bindings_runtime__anon_pod17: +cdef union cuda_bindings_runtime__anon_pod19: void* fence unsigned long long reserved -cdef struct cuda_bindings_runtime__anon_pod18: +cdef struct cuda_bindings_runtime__anon_pod20: unsigned long long key -cdef struct cuda_bindings_runtime__anon_pod20: +cdef struct cuda_bindings_runtime__anon_pod22: unsigned long long value -cdef union cuda_bindings_runtime__anon_pod21: +cdef union cuda_bindings_runtime__anon_pod23: void* fence unsigned long long reserved -cdef struct cuda_bindings_runtime__anon_pod22: +cdef struct cuda_bindings_runtime__anon_pod24: unsigned long long key unsigned int timeoutMs @@ -1664,7 +1675,7 @@ cdef extern from 'driver_types.h': unsigned char reserved[5] ctypedef cudaGraphEdgeData_st cudaGraphEdgeData -cdef struct cuda_bindings_runtime__anon_pod26: +cdef struct cuda_bindings_runtime__anon_pod28: void* pValue size_t offset size_t size @@ -1675,17 +1686,17 @@ cdef extern from 'driver_types.h': unsigned char remote ctypedef cudaLaunchMemSyncDomainMap_st cudaLaunchMemSyncDomainMap -cdef struct cuda_bindings_runtime__anon_pod27: +cdef struct cuda_bindings_runtime__anon_pod29: unsigned int x unsigned int y unsigned int z -cdef struct cuda_bindings_runtime__anon_pod29: +cdef struct cuda_bindings_runtime__anon_pod31: unsigned int x unsigned int y unsigned int z -cdef struct cuda_bindings_runtime__anon_pod33: +cdef struct cuda_bindings_runtime__anon_pod35: unsigned long long bytesOverBudget cdef extern from '': @@ -1710,6 +1721,7 @@ cdef extern from 'driver_types.h': unsigned int minSmPartitionSize unsigned int smCoscheduledAlignment unsigned int flags + unsigned int localityDomainId cdef extern from 'driver_types.h': cdef struct cudaDevWorkqueueConfigResource: @@ -1727,7 +1739,8 @@ cdef extern from 'driver_types.h': unsigned int coscheduledSmCount unsigned int preferredCoscheduledSmCount unsigned int flags - unsigned int reserved[12] + unsigned int localityDomainId + unsigned int reserved[11] ctypedef cudaDevSmResourceGroupParams_st cudaDevSmResourceGroupParams cdef extern from 'cuda_runtime_api.h': @@ -1753,20 +1766,16 @@ cdef extern from 'cuda_runtime_api.h': ) -cdef extern from 'driver_types.h': - cdef struct cudaEventRecordNodeParams: - cudaEvent_t event - cdef extern from 'driver_types.h': cdef struct cudaEventWaitNodeParams: cudaEvent_t event -cdef struct cuda_bindings_runtime__anon_pod28: +cdef struct cuda_bindings_runtime__anon_pod30: cudaEvent_t event int flags int triggerAtBlockStart -cdef struct cuda_bindings_runtime__anon_pod30: +cdef struct cuda_bindings_runtime__anon_pod32: cudaEvent_t event int flags @@ -1790,7 +1799,7 @@ cdef extern from 'driver_types.h': cudaGraphNode_t errorFromNode ctypedef cudaGraphExecUpdateResultInfo_st cudaGraphExecUpdateResultInfo -cdef struct cuda_bindings_runtime__anon_pod31: +cdef struct cuda_bindings_runtime__anon_pod33: int deviceUpdatable cudaGraphDeviceNode_t devNode @@ -1812,6 +1821,11 @@ cdef extern from 'driver_types.h': cudaGraph_t* phGraph_out cudaExecutionContext_t ctx +cdef extern from 'driver_types.h': + cdef struct cudaEventRecordNodeParams: + cudaEvent_t event + cudaExecutionContext_t ctx + cdef struct cuda_bindings_runtime__anon_pod4: void* devPtr cudaChannelFormatDesc desc @@ -1842,7 +1856,7 @@ cdef extern from 'driver_types.h': unsigned int flags unsigned int reserved[4] -cdef union cuda_bindings_runtime__anon_pod34: +cdef union cuda_bindings_runtime__anon_pod36: cudaArray_t pArray[3] cudaPitchedPtr pPitch[3] @@ -1888,45 +1902,51 @@ cdef extern from 'driver_types.h': cudaHostFn_t fn void* userData unsigned int syncMode + cudaExecutionContext_t ctx cdef extern from 'driver_types.h': - cdef struct cudaMemLocation: - cudaMemLocationType type - int id + cdef struct cudaPointerAttributes: + cudaMemoryType type + int device + void* devicePointer + void* hostPointer + int localityDomainOrdinal + long unused + long reserved[7] -cdef struct cuda_bindings_runtime__anon_pod10: +cdef struct cuda_bindings_runtime__anon_pod12: cudaArray_t array cudaOffset3D offset -cdef union cuda_bindings_runtime__anon_pod11: +cdef union cuda_bindings_runtime__anon_pod13: int fd - cuda_bindings_runtime__anon_pod12 win32 + cuda_bindings_runtime__anon_pod14 win32 void* nvSciBufObject -cdef union cuda_bindings_runtime__anon_pod13: +cdef union cuda_bindings_runtime__anon_pod15: int fd - cuda_bindings_runtime__anon_pod14 win32 + cuda_bindings_runtime__anon_pod16 win32 void* nvSciSyncObj -cdef struct cuda_bindings_runtime__anon_pod15: - cuda_bindings_runtime__anon_pod16 fence - cuda_bindings_runtime__anon_pod17 nvSciSync - cuda_bindings_runtime__anon_pod18 keyedMutex +cdef struct cuda_bindings_runtime__anon_pod17: + cuda_bindings_runtime__anon_pod18 fence + cuda_bindings_runtime__anon_pod19 nvSciSync + cuda_bindings_runtime__anon_pod20 keyedMutex unsigned int reserved[12] -cdef struct cuda_bindings_runtime__anon_pod19: - cuda_bindings_runtime__anon_pod20 fence - cuda_bindings_runtime__anon_pod21 nvSciSync - cuda_bindings_runtime__anon_pod22 keyedMutex +cdef struct cuda_bindings_runtime__anon_pod21: + cuda_bindings_runtime__anon_pod22 fence + cuda_bindings_runtime__anon_pod23 nvSciSync + cuda_bindings_runtime__anon_pod24 keyedMutex unsigned int reserved[10] -cdef union cuda_bindings_runtime__anon_pod25: +cdef union cuda_bindings_runtime__anon_pod27: dim3 gridDim - cuda_bindings_runtime__anon_pod26 param + cuda_bindings_runtime__anon_pod28 param unsigned int isEnabled -cdef union cuda_bindings_runtime__anon_pod32: - cuda_bindings_runtime__anon_pod33 overBudget +cdef union cuda_bindings_runtime__anon_pod34: + cuda_bindings_runtime__anon_pod35 overBudget cdef extern from 'driver_types.h': cdef struct cudaKernelNodeParamsV2: @@ -1947,16 +1967,16 @@ cdef extern from 'driver_types.h': cudaAccessPolicyWindow accessPolicyWindow int cooperative cudaSynchronizationPolicy syncPolicy - cuda_bindings_runtime__anon_pod27 clusterDim + cuda_bindings_runtime__anon_pod29 clusterDim cudaClusterSchedulingPolicy clusterSchedulingPolicyPreference int programmaticStreamSerializationAllowed - cuda_bindings_runtime__anon_pod28 programmaticEvent + cuda_bindings_runtime__anon_pod30 programmaticEvent int priority cudaLaunchMemSyncDomainMap memSyncDomainMap cudaLaunchMemSyncDomain memSyncDomain - cuda_bindings_runtime__anon_pod29 preferredClusterDim - cuda_bindings_runtime__anon_pod30 launchCompletionEvent - cuda_bindings_runtime__anon_pod31 deviceUpdatableKernelNode + cuda_bindings_runtime__anon_pod31 preferredClusterDim + cuda_bindings_runtime__anon_pod32 launchCompletionEvent + cuda_bindings_runtime__anon_pod33 deviceUpdatableKernelNode unsigned int sharedMemCarveout unsigned int nvlinkUtilCentricScheduling cudaLaunchAttributePortableClusterMode portableClusterSizeMode @@ -1970,7 +1990,7 @@ cdef union cuda_bindings_runtime__anon_pod1: cuda_bindings_runtime__anon_pod6 reserved cdef struct cudaEglFrame_st: - cuda_bindings_runtime__anon_pod34 frame + cuda_bindings_runtime__anon_pod36 frame cudaEglPlaneDesc planeDesc[3] unsigned int planeCount cudaEglFrameType frameType @@ -1985,37 +2005,15 @@ cdef extern from 'driver_types.h': cudaMemcpy3DParms copyParams cdef extern from 'driver_types.h': - cdef struct cudaMemAccessDesc: - cudaMemLocation location - cudaMemAccessFlags flags - -cdef extern from 'driver_types.h': - cdef struct cudaMemPoolProps: - cudaMemAllocationType allocType - cudaMemAllocationHandleType handleTypes - cudaMemLocation location - void* win32SecurityAttributes - size_t maxSize - unsigned short usage - unsigned char reserved[54] - -cdef extern from 'driver_types.h': - cdef struct cudaMemcpyAttributes: - cudaMemcpySrcAccessOrder srcAccessOrder - cudaMemLocation srcLocHint - cudaMemLocation dstLocHint - unsigned int flags - -cdef struct cuda_bindings_runtime__anon_pod9: - void* ptr - size_t rowLength - size_t layerHeight - cudaMemLocation locHint + cdef struct cudaMemLocation: + cudaMemLocationType type + int id + cuda_bindings_runtime__anon_pod9 localized cdef extern from 'driver_types.h': cdef struct cudaExternalMemoryHandleDesc: cudaExternalMemoryHandleType type - cuda_bindings_runtime__anon_pod11 handle + cuda_bindings_runtime__anon_pod13 handle unsigned long long size unsigned int flags unsigned int reserved[16] @@ -2023,19 +2021,19 @@ cdef extern from 'driver_types.h': cdef extern from 'driver_types.h': cdef struct cudaExternalSemaphoreHandleDesc: cudaExternalSemaphoreHandleType type - cuda_bindings_runtime__anon_pod13 handle + cuda_bindings_runtime__anon_pod15 handle unsigned int flags unsigned int reserved[16] cdef extern from 'driver_types.h': cdef struct cudaExternalSemaphoreSignalParams: - cuda_bindings_runtime__anon_pod15 params + cuda_bindings_runtime__anon_pod17 params unsigned int flags unsigned int reserved[16] cdef extern from 'driver_types.h': cdef struct cudaExternalSemaphoreWaitParams: - cuda_bindings_runtime__anon_pod19 params + cuda_bindings_runtime__anon_pod21 params unsigned int flags unsigned int reserved[16] @@ -2043,12 +2041,12 @@ cdef extern from 'driver_types.h': cdef struct cudaGraphKernelNodeUpdate: cudaGraphDeviceNode_t node cudaGraphKernelNodeField field - cuda_bindings_runtime__anon_pod25 updateData + cuda_bindings_runtime__anon_pod27 updateData cdef extern from 'driver_types.h': cdef struct cudaAsyncNotificationInfo: cudaAsyncNotificationType type - cuda_bindings_runtime__anon_pod32 info + cuda_bindings_runtime__anon_pod34 info ctypedef cudaAsyncNotificationInfo cudaAsyncNotificationInfo_t cdef extern from 'driver_types.h': @@ -2069,24 +2067,32 @@ cdef extern from 'driver_types.h': unsigned int flags cdef extern from 'driver_types.h': - cdef struct cudaMemAllocNodeParams: - cudaMemPoolProps poolProps - cudaMemAccessDesc* accessDescs - size_t accessDescCount - size_t bytesize - void* dptr + cdef struct cudaMemAccessDesc: + cudaMemLocation location + cudaMemAccessFlags flags cdef extern from 'driver_types.h': - cdef struct cudaMemAllocNodeParamsV2: - cudaMemPoolProps poolProps - cudaMemAccessDesc* accessDescs - size_t accessDescCount - size_t bytesize - void* dptr + cdef struct cudaMemPoolProps: + cudaMemAllocationType allocType + cudaMemAllocationHandleType handleTypes + cudaMemLocation location + void* win32SecurityAttributes + size_t maxSize + unsigned short usage + unsigned char reserved[54] -cdef union cuda_bindings_runtime__anon_pod8: - cuda_bindings_runtime__anon_pod9 ptr - cuda_bindings_runtime__anon_pod10 array +cdef extern from 'driver_types.h': + cdef struct cudaMemcpyAttributes: + cudaMemcpySrcAccessOrder srcAccessOrder + cudaMemLocation srcLocHint + cudaMemLocation dstLocHint + unsigned int flags + +cdef struct cuda_bindings_runtime__anon_pod11: + void* ptr + size_t rowLength + size_t layerHeight + cudaMemLocation locHint cdef extern from 'driver_types.h': cdef struct cudaExternalSemaphoreSignalNodeParams: @@ -2099,6 +2105,7 @@ cdef extern from 'driver_types.h': cudaExternalSemaphore_t* extSemArray cudaExternalSemaphoreSignalParams* paramsArray unsigned int numExtSems + cudaExecutionContext_t ctx cdef extern from 'driver_types.h': cdef struct cudaExternalSemaphoreWaitNodeParams: @@ -2111,19 +2118,32 @@ cdef extern from 'driver_types.h': cudaExternalSemaphore_t* extSemArray cudaExternalSemaphoreWaitParams* paramsArray unsigned int numExtSems + cudaExecutionContext_t ctx cdef extern from 'driver_types.h': - cdef struct cudaMemcpy3DOperand: - cudaMemcpy3DOperandType type - cuda_bindings_runtime__anon_pod8 op + cdef struct cudaMemAllocNodeParams: + cudaMemPoolProps poolProps + cudaMemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + void* dptr cdef extern from 'driver_types.h': - cdef struct cudaMemcpy3DBatchOp: - cudaMemcpy3DOperand src - cudaMemcpy3DOperand dst - cudaExtent extent - cudaMemcpySrcAccessOrder srcAccessOrder - unsigned int flags + cdef struct cudaMemAllocNodeParamsV2: + cudaMemPoolProps poolProps + cudaMemAccessDesc* accessDescs + size_t accessDescCount + size_t bytesize + void* dptr + +cdef union cuda_bindings_runtime__anon_pod10: + cuda_bindings_runtime__anon_pod11 ptr + cuda_bindings_runtime__anon_pod12 array + +cdef extern from 'driver_types.h': + cdef struct cudaMemcpy3DOperand: + cudaMemcpy3DOperandType type + cuda_bindings_runtime__anon_pod10 op cdef extern from 'driver_types.h': cdef struct cudaGraphNodeParams: @@ -2144,6 +2164,14 @@ cdef extern from 'driver_types.h': cudaConditionalNodeParams conditional long long reserved2 +cdef extern from 'driver_types.h': + cdef struct cudaMemcpy3DBatchOp: + cudaMemcpy3DOperand src + cudaMemcpy3DOperand dst + cudaExtent extent + cudaMemcpySrcAccessOrder srcAccessOrder + unsigned int flags + cdef extern from 'cuda_runtime_api.h': ctypedef cudaError_t (*cudaGraphRecaptureCallback_t 'cudaGraphRecaptureCallback_t')( void* data, @@ -2529,6 +2557,7 @@ cdef cudaError_t cudaMemcpyWithAttributesAsync(void* dst, const void* src, size_ cdef cudaError_t cudaMemcpy3DWithAttributesAsync(cudaMemcpy3DBatchOp* op, unsigned long long flags, cudaStream_t stream) except ?cudaErrorCallRequiresNewerDriver nogil cdef cudaError_t cudaGraphNodeGetParams(cudaGraphNode_t node, cudaGraphNodeParams* nodeParams) except ?cudaErrorCallRequiresNewerDriver nogil cdef cudaError_t cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStreamCaptureMode mode, cudaGraph_t graph, cudaGraphRecaptureCallbackData* callbackData) except ?cudaErrorCallRequiresNewerDriver nogil +cdef cudaError_t cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil # C #define integer constants from driver_types.h required for ABI compat with lowpp layer cdef extern from 'driver_types.h': diff --git a/cuda_bindings/cuda/bindings/cyruntime.pyx b/cuda_bindings/cuda/bindings/cyruntime.pyx index bc3f12896c8..73324b51498 100644 --- a/cuda_bindings/cuda/bindings/cyruntime.pyx +++ b/cuda_bindings/cuda/bindings/cyruntime.pyx @@ -2,9 +2,10 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.3.0. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.4.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=034f6c5c936d547d3106aa249f8f85b67389eac8b90ab569aa74815f08d699af +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=688a31f40f86e60ac9bab47ed3c6c11f0762c60016d8167d3a57f3b3dc61c7cf from ._internal cimport runtime as _runtime cdef cudaError_t cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil: @@ -1363,6 +1364,10 @@ cdef cudaError_t cudaStreamBeginRecaptureToGraph(cudaStream_t stream, cudaStream return _runtime._cudaStreamBeginRecaptureToGraph(stream, mode, graph, callbackData) +cdef cudaError_t cudaMemGetLocationInfo(void* devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, cudaMemLocation* location_out) except ?cudaErrorCallRequiresNewerDriver nogil: + return _runtime._cudaMemGetLocationInfo(devPtr, size, summaryGranularity, samplingGranularity, location_out) + + ############################################################################### # Static inline helpers from driver_functions.h ############################################################################### diff --git a/cuda_bindings/cuda/bindings/driver.pxd b/cuda_bindings/cuda/bindings/driver.pxd index 9f4d912a3c4..44d474ca68e 100644 --- a/cuda_bindings/cuda/bindings/driver.pxd +++ b/cuda_bindings/cuda/bindings/driver.pxd @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f4b08b7f4b26966f9f462562819700500a100748c5b34ab47de79836e6bec3f2 +# This code was automatically generated with version 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3493d4c4789723331ed15bd7d54668deeccd7d41b0eafe2361c3b3313e2b8032 cimport cuda.bindings.cydriver as cydriver include "_lib/utils.pxd" @@ -328,6 +329,20 @@ cdef class CUlinkState: cdef cydriver.CUlinkState* _pvt_ptr cdef list _keepalive +cdef class CUcheckpointOperationHandle: + """ + + Handle for a CUDA custom storage checkpoint or restore operation awaiting completion + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + cdef cydriver.CUcheckpointOperationHandle _pvt_val + cdef cydriver.CUcheckpointOperationHandle* _pvt_ptr + cdef class CUcoredumpCallbackHandle: """ Opaque handle representing a registered coredump status callback. @@ -545,13 +560,6 @@ cdef class CUipcEventHandle_st: """ CUDA IPC event handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -564,13 +572,6 @@ cdef class CUipcMemHandle_st: """ CUDA IPC mem handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -1423,12 +1424,20 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: The sync mode to use for the host task + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() Get memory address of class instance """ - cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st* _val_ptr cdef cydriver.CUDA_HOST_NODE_PARAMS_v2_st* _pvt_ptr cdef CUhostFn _fn @@ -1437,6 +1446,12 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: cdef _HelperInputVoidPtr _cyuserData + cdef CUcontext _ctx + + + cdef CUgreenCtx _gCtx + + cdef class CUDA_CONDITIONAL_NODE_PARAMS: """ Conditional node parameters @@ -1467,7 +1482,7 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: empty nodes, child graphs, memsets, memcopies, and conditionals. This applies recursively to child graphs and conditional bodies. - All kernels, including kernels in nested conditionals or child - graphs at any level, must belong to the same CUDA context. + graphs at any level, must belong to the same device context. These graphs may be populated using graph node creation APIs or cuStreamBeginCaptureToGraph. CU_GRAPH_COND_TYPE_IF: phGraph_out[0] is executed when the condition is non-zero. If `size` == 2, @@ -1538,11 +1553,6 @@ cdef class CUgraphEdgeData_st: See CUgraphDependencyType. - reserved : bytes - These bytes are unused and must be zeroed. This ensures - compatibility if additional fields are added in the future. - - Methods ------- getPtr() @@ -1999,7 +2009,7 @@ cdef class CUexecAffinitySmCount_st: cdef cydriver.CUexecAffinitySmCount_st _pvt_val cdef cydriver.CUexecAffinitySmCount_st* _pvt_ptr -cdef class anon_union3: +cdef class anon_union4: """ Attributes ---------- @@ -2029,7 +2039,7 @@ cdef class CUexecAffinityParam_st: Type of execution affinity. - param : anon_union3 + param : anon_union4 @@ -2041,7 +2051,7 @@ cdef class CUexecAffinityParam_st: cdef cydriver.CUexecAffinityParam_st* _val_ptr cdef cydriver.CUexecAffinityParam_st* _pvt_ptr - cdef anon_union3 _param + cdef anon_union4 _param cdef class CUctxCigParam_st: @@ -2336,10 +2346,6 @@ cdef class CUDA_MEMCPY3D_st: Source array reference - reserved0 : Any - Must be NULL - - srcPitch : size_t Source pitch (ignored when src is array) @@ -2380,10 +2386,6 @@ cdef class CUDA_MEMCPY3D_st: Destination array reference - reserved1 : Any - Must be NULL - - dstPitch : size_t Destination pitch (ignored when dst is array) @@ -2422,9 +2424,6 @@ cdef class CUDA_MEMCPY3D_st: cdef CUarray _srcArray - cdef _HelperInputVoidPtr _cyreserved0 - - cdef _HelperInputVoidPtr _cydstHost @@ -2434,9 +2433,6 @@ cdef class CUDA_MEMCPY3D_st: cdef CUarray _dstArray - cdef _HelperInputVoidPtr _cyreserved1 - - cdef class CUDA_MEMCPY3D_PEER_st: """ 3D memory cross-context copy parameters @@ -2589,10 +2585,6 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: Must be zero - reserved : int - Must be zero - - copyCtx : CUcontext Context on which to run the node @@ -2733,10 +2725,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -2763,10 +2751,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: alignment requirement - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -2885,13 +2869,6 @@ cdef class anon_struct10: cdef class anon_struct11: """ - Attributes - ---------- - - reserved : list[int] - - - Methods ------- getPtr() @@ -2899,7 +2876,7 @@ cdef class anon_struct11: """ cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr -cdef class anon_union4: +cdef class anon_union5: """ Attributes ---------- @@ -2920,10 +2897,6 @@ cdef class anon_union4: - reserved : anon_struct11 - - - Methods ------- getPtr() @@ -2943,9 +2916,6 @@ cdef class anon_union4: cdef anon_struct10 _pitch2D - cdef anon_struct11 _reserved - - cdef class CUDA_RESOURCE_DESC_st: """ CUDA Resource descriptor @@ -2957,7 +2927,7 @@ cdef class CUDA_RESOURCE_DESC_st: Resource type - res : anon_union4 + res : anon_union5 @@ -2973,7 +2943,7 @@ cdef class CUDA_RESOURCE_DESC_st: cdef cydriver.CUDA_RESOURCE_DESC_st* _val_ptr cdef cydriver.CUDA_RESOURCE_DESC_st* _pvt_ptr - cdef anon_union4 _res + cdef anon_union5 _res cdef class CUDA_TEXTURE_DESC_st: @@ -3019,10 +2989,6 @@ cdef class CUDA_TEXTURE_DESC_st: Border Color - reserved : list[int] - - - Methods ------- getPtr() @@ -3070,10 +3036,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Last layer index - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3215,7 +3177,7 @@ cdef class anon_struct12: cdef _HelperInputVoidPtr _cyname -cdef class anon_union5: +cdef class anon_union6: """ Attributes ---------- @@ -3256,7 +3218,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Type of the handle - handle : anon_union5 + handle : anon_union6 @@ -3268,10 +3230,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3280,7 +3238,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _val_ptr cdef cydriver.CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st* _pvt_ptr - cdef anon_union5 _handle + cdef anon_union6 _handle cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: @@ -3302,10 +3260,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Flags reserved for future use. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3334,10 +3288,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Total number of levels in the mipmap chain - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3375,7 +3325,7 @@ cdef class anon_struct13: cdef _HelperInputVoidPtr _cyname -cdef class anon_union6: +cdef class anon_union7: """ Attributes ---------- @@ -3416,7 +3366,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Type of the handle - handle : anon_union6 + handle : anon_union7 @@ -3424,10 +3374,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Flags reserved for the future. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3436,7 +3382,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _val_ptr cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st* _pvt_ptr - cdef anon_union6 _handle + cdef anon_union7 _handle cdef class anon_struct14: @@ -3455,7 +3401,7 @@ cdef class anon_struct14: """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st* _pvt_ptr -cdef class anon_union7: +cdef class anon_union8: """ Attributes ---------- @@ -3464,10 +3410,6 @@ cdef class anon_union7: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -3503,7 +3445,7 @@ cdef class anon_struct16: - nvSciSync : anon_union7 + nvSciSync : anon_union8 @@ -3511,10 +3453,6 @@ cdef class anon_struct16: - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3525,7 +3463,7 @@ cdef class anon_struct16: cdef anon_struct14 _fence - cdef anon_union7 _nvSciSync + cdef anon_union8 _nvSciSync cdef anon_struct15 _keyedMutex @@ -3553,10 +3491,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3584,7 +3518,7 @@ cdef class anon_struct17: """ cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st* _pvt_ptr -cdef class anon_union8: +cdef class anon_union9: """ Attributes ---------- @@ -3593,10 +3527,6 @@ cdef class anon_union8: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -3636,7 +3566,7 @@ cdef class anon_struct19: - nvSciSync : anon_union8 + nvSciSync : anon_union9 @@ -3644,10 +3574,6 @@ cdef class anon_struct19: - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3658,7 +3584,7 @@ cdef class anon_struct19: cdef anon_struct17 _fence - cdef anon_union8 _nvSciSync + cdef anon_union9 _nvSciSync cdef anon_struct18 _keyedMutex @@ -3686,10 +3612,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -3757,12 +3679,20 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: paramsArray. + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() Get memory address of class instance """ - cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st* _val_ptr cdef cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st* _pvt_ptr cdef size_t _extSemArray_length @@ -3773,6 +3703,12 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray + cdef CUcontext _ctx + + + cdef CUgreenCtx _gCtx + + cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: """ Semaphore wait node parameters @@ -3829,12 +3765,20 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: paramsArray. + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() Get memory address of class instance """ - cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st _pvt_val + cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st* _val_ptr cdef cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st* _pvt_ptr cdef size_t _extSemArray_length @@ -3845,7 +3789,13 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray -cdef class anon_union9: + cdef CUcontext _ctx + + + cdef CUgreenCtx _gCtx + + +cdef class anon_union12: """ Attributes ---------- @@ -3939,7 +3889,7 @@ cdef class anon_struct21: """ cdef cydriver.CUarrayMapInfo_st* _pvt_ptr -cdef class anon_union10: +cdef class anon_union13: """ Attributes ---------- @@ -3965,7 +3915,7 @@ cdef class anon_union10: cdef anon_struct21 _miptail -cdef class anon_union11: +cdef class anon_union14: """ Attributes ---------- @@ -3996,7 +3946,7 @@ cdef class CUarrayMapInfo_st: Resource type - resource : anon_union9 + resource : anon_union12 @@ -4004,7 +3954,7 @@ cdef class CUarrayMapInfo_st: Sparse subresource type - subresource : anon_union10 + subresource : anon_union13 @@ -4016,7 +3966,7 @@ cdef class CUarrayMapInfo_st: Memory handle type - memHandle : anon_union11 + memHandle : anon_union14 @@ -4032,10 +3982,6 @@ cdef class CUarrayMapInfo_st: flags for future use, must be zero now. - reserved : list[unsigned int] - Reserved for future use, must be zero now. - - Methods ------- getPtr() @@ -4044,14 +3990,34 @@ cdef class CUarrayMapInfo_st: cdef cydriver.CUarrayMapInfo_st* _val_ptr cdef cydriver.CUarrayMapInfo_st* _pvt_ptr - cdef anon_union9 _resource + cdef anon_union12 _resource + + + cdef anon_union13 _subresource + + + cdef anon_union14 _memHandle + +cdef class anon_struct22: + """ + Attributes + ---------- - cdef anon_union10 _subresource + deviceId : bytes - cdef anon_union11 _memHandle + localityDomainId : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUmemLocation_st* _pvt_ptr cdef class CUmemLocation_st: """ @@ -4070,6 +4036,11 @@ cdef class CUmemLocation_st: CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. + localized : anon_struct22 + Identifier for + CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN. + + Methods ------- getPtr() @@ -4078,7 +4049,10 @@ cdef class CUmemLocation_st: cdef cydriver.CUmemLocation_st* _val_ptr cdef cydriver.CUmemLocation_st* _pvt_ptr -cdef class anon_struct22: + cdef anon_struct22 _localized + + +cdef class anon_struct23: """ Attributes ---------- @@ -4095,10 +4069,6 @@ cdef class anon_struct22: - reserved : bytes - - - Methods ------- getPtr() @@ -4133,7 +4103,7 @@ cdef class CUmemAllocationProp_st: In all other cases, this field is required to be zero. - allocFlags : anon_struct22 + allocFlags : anon_struct23 @@ -4151,7 +4121,7 @@ cdef class CUmemAllocationProp_st: cdef _HelperInputVoidPtr _cywin32HandleMetaData - cdef anon_struct22 _allocFlags + cdef anon_struct23 _allocFlags cdef class CUmulticastObjectProp_st: @@ -4287,8 +4257,22 @@ cdef class CUmemPoolProps_st: Bitmask indicating intended usage for the pool. - reserved : bytes - reserved for future use, must be 0 + gpuDirectRDMACapable : bytes + Allocation hint for requesting GPUDirect RDMA capable memory. On + devices that support GPUDirect RDMA, this flag indicates that the + memory will be used for GPUDirect RDMA. On platforms where the + default RDMA path does not support localized allocations, this flag + has the following effects: - For MPS clients using MLOPart/locality + domains, this flag has the effect of disabling localization for the + pool. This allows the pool to be used for GPUDirect RDMA with the + default RDMA path. - For pools that are localized using CUDA + locality domain APIs, using this flag will have no effect, but + attempting to export the localized memory without forcing PCIe will + return an error. To use GPUDirect RDMA with localized pools on + platforms where the default RDMA path does not support localized + allocations, handles must be acquired with the flag + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE. Note that CUDA memory + pools are only compatible with dma_buf mappings. Methods @@ -4309,13 +4293,6 @@ cdef class CUmemPoolPtrExportData_st: """ Opaque data for exporting a pool allocation - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -4419,7 +4396,7 @@ cdef class CUextent3D_st: cdef cydriver.CUextent3D_st _pvt_val cdef cydriver.CUextent3D_st* _pvt_ptr -cdef class anon_struct23: +cdef class anon_struct24: """ Attributes ---------- @@ -4453,7 +4430,7 @@ cdef class anon_struct23: cdef CUmemLocation _locHint -cdef class anon_struct24: +cdef class anon_struct25: """ Attributes ---------- @@ -4479,16 +4456,16 @@ cdef class anon_struct24: cdef CUoffset3D _offset -cdef class anon_union13: +cdef class anon_union16: """ Attributes ---------- - ptr : anon_struct23 + ptr : anon_struct24 - array : anon_struct24 + array : anon_struct25 @@ -4499,10 +4476,10 @@ cdef class anon_union13: """ cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr - cdef anon_struct23 _ptr + cdef anon_struct24 _ptr - cdef anon_struct24 _array + cdef anon_struct25 _array cdef class CUmemcpy3DOperand_st: @@ -4516,7 +4493,7 @@ cdef class CUmemcpy3DOperand_st: - op : anon_union13 + op : anon_union16 @@ -4528,7 +4505,7 @@ cdef class CUmemcpy3DOperand_st: cdef cydriver.CUmemcpy3DOperand_st* _val_ptr cdef cydriver.CUmemcpy3DOperand_st* _pvt_ptr - cdef anon_union13 _op + cdef anon_union16 _op cdef class CUDA_MEMCPY3D_BATCH_OP_st: @@ -4735,17 +4712,31 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: The event to record when the node executes + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() Get memory address of class instance """ - cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st _pvt_val + cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st* _val_ptr cdef cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st* _pvt_ptr cdef CUevent _event + cdef CUcontext _ctx + + + cdef CUgreenCtx _gCtx + + cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: """ Event wait node parameters @@ -4779,14 +4770,6 @@ cdef class CUgraphNodeParams_st: Type of the node - reserved0 : list[int] - Reserved. Must be zero. - - - reserved1 : list[long long] - Padding. Unused bytes must be zero. - - kernel : CUDA_KERNEL_NODE_PARAMS_v3 Kernel node parameters. @@ -4843,10 +4826,6 @@ cdef class CUgraphNodeParams_st: Padding as bytes - reserved2 : long long - Reserved bytes. Must be zero. - - Methods ------- getPtr() @@ -4894,6 +4873,77 @@ cdef class CUgraphNodeParams_st: cdef CUDA_CONDITIONAL_NODE_PARAMS _conditional +cdef class CUcheckpointCustomStoragePerDeviceData_st: + """ + Per-GPU data for zero-copy mapped device memory used with CUDA + checkpoint/restore on custom storage + + Attributes + ---------- + + devPtr : CUdeviceptr + Zero-copy mapped device memory pointer for the user to copy to/from + + + size : size_t + Size of mapped memory + + + stream : CUstream + Stream the user may use for the copy; the CUDA driver synchronizes + on this stream before completing checkpoint or restore + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointCustomStoragePerDeviceData_st _pvt_val + cdef cydriver.CUcheckpointCustomStoragePerDeviceData_st* _pvt_ptr + + cdef CUdeviceptr _devPtr + + + cdef CUstream _stream + + +cdef class CUcheckpointCustomStorageInfo_st: + """ + Output from CUDA custom storage checkpoint/restore: per-GPU device + pointers and a handle to complete the operation + + Attributes + ---------- + + handle : CUcheckpointOperationHandle + Handle returned that is needed to complete checkpoint or restore + + + perDeviceData : CUcheckpointCustomStoragePerDeviceData + Returned pointer to array of per-device data, one per device. User + should set to NULL + + + deviceCount : unsigned int + Number of devices (and elements in `perDeviceData` array) + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcheckpointCustomStorageInfo_st _pvt_val + cdef cydriver.CUcheckpointCustomStorageInfo_st* _pvt_ptr + + cdef CUcheckpointOperationHandle _handle + + + cdef size_t _perDeviceData_length + cdef cydriver.CUcheckpointCustomStoragePerDeviceData* _perDeviceData + + cdef class CUcheckpointLockArgs_st: """ CUDA checkpoint optional lock arguments @@ -4906,14 +4956,6 @@ cdef class CUcheckpointLockArgs_st: no timeout - reserved0 : unsigned int - Reserved for future use, must be zero - - - reserved1 : list[cuuint64_t] - Reserved for future use, must be zeroed - - Methods ------- getPtr() @@ -4929,8 +4971,9 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed + customStorageInfo_out : CUcheckpointCustomStorageInfo + Optional custom storage; if NULL, GPU memory is checkpointed to + host Methods @@ -4986,12 +5029,8 @@ cdef class CUcheckpointRestoreArgs_st: Number of gpu pairs to remap - reserved : bytes - Reserved for future use, must be zeroed - - - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed + customStorageInfo_out : CUcheckpointCustomStorageInfo + Optional custom storage; if NULL, GPU memory is restored from host Methods @@ -5010,13 +5049,6 @@ cdef class CUcheckpointUnlockArgs_st: """ CUDA checkpoint optional unlock arguments - Attributes - ---------- - - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed - - Methods ------- getPtr() @@ -5066,10 +5098,6 @@ cdef class CUmemDecompressParams_st: The decompression algorithm to use. - padding : bytes - - - Methods ------- getPtr() @@ -5084,6 +5112,29 @@ cdef class CUmemDecompressParams_st: cdef _HelperInputVoidPtr _cydst +cdef class CUcliqueInfo_st: + """ + Fabric clique information + + Attributes + ---------- + + type : CUcliqueType + Type of the fabric clique + + + id : unsigned int + ID of the fabric clique + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cydriver.CUcliqueInfo_st _pvt_val + cdef cydriver.CUcliqueInfo_st* _pvt_ptr + cdef class CUlogicalEndpointFabricHandle_st: """ Fabric handle for a logical endpoint @@ -5103,7 +5154,7 @@ cdef class CUlogicalEndpointFabricHandle_st: cdef cydriver.CUlogicalEndpointFabricHandle_st _pvt_val cdef cydriver.CUlogicalEndpointFabricHandle_st* _pvt_ptr -cdef class anon_struct25: +cdef class anon_struct26: """ Attributes ---------- @@ -5122,7 +5173,7 @@ cdef class anon_struct25: cdef CUdevice _device -cdef class anon_struct26: +cdef class anon_struct27: """ Attributes ---------- @@ -5149,11 +5200,11 @@ cdef class CUlogicalEndpointProp_struct: Type of the logical endpoint defined in CUlogicalEndpointType - unicast : anon_struct25 + unicast : anon_struct26 - multicast : anon_struct26 + multicast : anon_struct27 @@ -5178,10 +5229,10 @@ cdef class CUlogicalEndpointProp_struct: cdef cydriver.CUlogicalEndpointProp_struct* _val_ptr cdef cydriver.CUlogicalEndpointProp_struct* _pvt_ptr - cdef anon_struct25 _unicast + cdef anon_struct26 _unicast - cdef anon_struct26 _multicast + cdef anon_struct27 _multicast cdef class CUdevSmResource_st: @@ -5210,6 +5261,13 @@ cdef class CUdevSmResource_st: CUdevSmResourceGroup_flags. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID is set in flags. If the + backfill flag is set, SMs may be assigned from other locality + domains. + + Methods ------- getPtr() @@ -5248,13 +5306,6 @@ cdef class CUdevWorkqueueConfigResource_st: cdef class CUdevWorkqueueResource_st: """ - Attributes - ---------- - - reserved : bytes - Reserved for future use - - Methods ------- getPtr() @@ -5287,8 +5338,9 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: CUdevSmResourceGroup_flags. - reserved : list[unsigned int] - + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID is set in flags Methods @@ -5355,7 +5407,7 @@ cdef class CUdevResource_st: cdef cydriver.CUdevResource_st* _nextResource -cdef class anon_union17: +cdef class anon_union21: """ Attributes ---------- @@ -5384,7 +5436,7 @@ cdef class CUeglFrame_st: Attributes ---------- - frame : anon_union17 + frame : anon_union21 @@ -5432,7 +5484,7 @@ cdef class CUeglFrame_st: cdef cydriver.CUeglFrame_st* _val_ptr cdef cydriver.CUeglFrame_st* _pvt_ptr - cdef anon_union17 _frame + cdef anon_union21 _frame cdef class CUdeviceptr: @@ -5565,13 +5617,6 @@ cdef class CUipcEventHandle_v1(CUipcEventHandle_st): """ CUDA IPC event handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -5583,13 +5628,6 @@ cdef class CUipcEventHandle(CUipcEventHandle_v1): """ CUDA IPC event handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -5601,13 +5639,6 @@ cdef class CUipcMemHandle_v1(CUipcMemHandle_st): """ CUDA IPC mem handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -5619,13 +5650,6 @@ cdef class CUipcMemHandle(CUipcMemHandle_v1): """ CUDA IPC mem handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -6465,6 +6489,14 @@ cdef class CUDA_HOST_NODE_PARAMS_v2(CUDA_HOST_NODE_PARAMS_v2_st): The sync mode to use for the host task + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -6509,11 +6541,6 @@ cdef class CUgraphEdgeData(CUgraphEdgeData_st): See CUgraphDependencyType. - reserved : bytes - These bytes are unused and must be zeroed. This ensures - compatibility if additional fields are added in the future. - - Methods ------- getPtr() @@ -7347,7 +7374,7 @@ cdef class CUexecAffinityParam_v1(CUexecAffinityParam_st): Type of execution affinity. - param : anon_union3 + param : anon_union4 @@ -7369,7 +7396,7 @@ cdef class CUexecAffinityParam(CUexecAffinityParam_v1): Type of execution affinity. - param : anon_union3 + param : anon_union4 @@ -7702,10 +7729,6 @@ cdef class CUDA_MEMCPY3D_v2(CUDA_MEMCPY3D_st): Source array reference - reserved0 : Any - Must be NULL - - srcPitch : size_t Source pitch (ignored when src is array) @@ -7746,10 +7769,6 @@ cdef class CUDA_MEMCPY3D_v2(CUDA_MEMCPY3D_st): Destination array reference - reserved1 : Any - Must be NULL - - dstPitch : size_t Destination pitch (ignored when dst is array) @@ -7817,10 +7836,6 @@ cdef class CUDA_MEMCPY3D(CUDA_MEMCPY3D_v2): Source array reference - reserved0 : Any - Must be NULL - - srcPitch : size_t Source pitch (ignored when src is array) @@ -7861,10 +7876,6 @@ cdef class CUDA_MEMCPY3D(CUDA_MEMCPY3D_v2): Destination array reference - reserved1 : Any - Must be NULL - - dstPitch : size_t Destination pitch (ignored when dst is array) @@ -8136,10 +8147,6 @@ cdef class CUDA_MEMCPY_NODE_PARAMS(CUDA_MEMCPY_NODE_PARAMS_st): Must be zero - reserved : int - Must be zero - - copyCtx : CUcontext Context on which to run the node @@ -8315,10 +8322,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_v1(CUDA_ARRAY_SPARSE_PROPERTIES_st): CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8350,10 +8353,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES(CUDA_ARRAY_SPARSE_PROPERTIES_v1): CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8376,10 +8375,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_v1(CUDA_ARRAY_MEMORY_REQUIREMENTS_st): alignment requirement - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8402,10 +8397,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS(CUDA_ARRAY_MEMORY_REQUIREMENTS_v1): alignment requirement - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8424,7 +8415,7 @@ cdef class CUDA_RESOURCE_DESC_v1(CUDA_RESOURCE_DESC_st): Resource type - res : anon_union4 + res : anon_union5 @@ -8450,7 +8441,7 @@ cdef class CUDA_RESOURCE_DESC(CUDA_RESOURCE_DESC_v1): Resource type - res : anon_union4 + res : anon_union5 @@ -8508,10 +8499,6 @@ cdef class CUDA_TEXTURE_DESC_v1(CUDA_TEXTURE_DESC_st): Border Color - reserved : list[int] - - - Methods ------- getPtr() @@ -8562,10 +8549,6 @@ cdef class CUDA_TEXTURE_DESC(CUDA_TEXTURE_DESC_v1): Border Color - reserved : list[int] - - - Methods ------- getPtr() @@ -8612,10 +8595,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC_v1(CUDA_RESOURCE_VIEW_DESC_st): Last layer index - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8662,10 +8641,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC(CUDA_RESOURCE_VIEW_DESC_v1): Last layer index - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8855,7 +8830,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_ Type of the handle - handle : anon_union5 + handle : anon_union6 @@ -8867,10 +8842,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_ Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8889,7 +8860,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1) Type of the handle - handle : anon_union5 + handle : anon_union6 @@ -8901,10 +8872,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC(CUDA_EXTERNAL_MEMORY_HANDLE_DESC_v1) Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8931,10 +8898,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_ Flags reserved for future use. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8961,10 +8924,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC(CUDA_EXTERNAL_MEMORY_BUFFER_DESC_v1) Flags reserved for future use. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8992,10 +8951,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_v1(CUDA_EXTERNAL_MEMORY_MIP Total number of levels in the mipmap chain - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9023,10 +8978,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC(CUDA_EXTERNAL_MEMORY_MIPMAP Total number of levels in the mipmap chain - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9045,7 +8996,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE Type of the handle - handle : anon_union6 + handle : anon_union7 @@ -9053,10 +9004,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_v1(CUDA_EXTERNAL_SEMAPHORE_HANDLE Flags reserved for the future. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9075,7 +9022,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DE Type of the handle - handle : anon_union6 + handle : anon_union7 @@ -9083,10 +9030,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC(CUDA_EXTERNAL_SEMAPHORE_HANDLE_DE Flags reserved for the future. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9116,10 +9059,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_SIGN For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9149,10 +9088,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(CUDA_EXTERNAL_SEMAPHORE_SIGNAL_ For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9182,10 +9117,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_v1(CUDA_EXTERNAL_SEMAPHORE_WAIT_P For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9215,10 +9146,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(CUDA_EXTERNAL_SEMAPHORE_WAIT_PARA For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -9300,6 +9227,14 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2(CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2 paramsArray. + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -9381,6 +9316,14 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2(CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st) paramsArray. + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -9412,7 +9355,7 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): Resource type - resource : anon_union9 + resource : anon_union12 @@ -9420,7 +9363,7 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): Sparse subresource type - subresource : anon_union10 + subresource : anon_union13 @@ -9432,7 +9375,7 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): Memory handle type - memHandle : anon_union11 + memHandle : anon_union14 @@ -9448,10 +9391,6 @@ cdef class CUarrayMapInfo_v1(CUarrayMapInfo_st): flags for future use, must be zero now. - reserved : list[unsigned int] - Reserved for future use, must be zero now. - - Methods ------- getPtr() @@ -9471,7 +9410,7 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): Resource type - resource : anon_union9 + resource : anon_union12 @@ -9479,7 +9418,7 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): Sparse subresource type - subresource : anon_union10 + subresource : anon_union13 @@ -9491,7 +9430,7 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): Memory handle type - memHandle : anon_union11 + memHandle : anon_union14 @@ -9507,10 +9446,6 @@ cdef class CUarrayMapInfo(CUarrayMapInfo_v1): flags for future use, must be zero now. - reserved : list[unsigned int] - Reserved for future use, must be zero now. - - Methods ------- getPtr() @@ -9535,6 +9470,11 @@ cdef class CUmemLocation_v1(CUmemLocation_st): CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. + localized : anon_struct22 + Identifier for + CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN. + + Methods ------- getPtr() @@ -9559,6 +9499,11 @@ cdef class CUmemLocation(CUmemLocation_v1): CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. + localized : anon_struct22 + Identifier for + CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN. + + Methods ------- getPtr() @@ -9593,7 +9538,7 @@ cdef class CUmemAllocationProp_v1(CUmemAllocationProp_st): In all other cases, this field is required to be zero. - allocFlags : anon_struct22 + allocFlags : anon_struct23 @@ -9631,7 +9576,7 @@ cdef class CUmemAllocationProp(CUmemAllocationProp_v1): In all other cases, this field is required to be zero. - allocFlags : anon_struct22 + allocFlags : anon_struct23 @@ -9847,8 +9792,22 @@ cdef class CUmemPoolProps_v1(CUmemPoolProps_st): Bitmask indicating intended usage for the pool. - reserved : bytes - reserved for future use, must be 0 + gpuDirectRDMACapable : bytes + Allocation hint for requesting GPUDirect RDMA capable memory. On + devices that support GPUDirect RDMA, this flag indicates that the + memory will be used for GPUDirect RDMA. On platforms where the + default RDMA path does not support localized allocations, this flag + has the following effects: - For MPS clients using MLOPart/locality + domains, this flag has the effect of disabling localization for the + pool. This allows the pool to be used for GPUDirect RDMA with the + default RDMA path. - For pools that are localized using CUDA + locality domain APIs, using this flag will have no effect, but + attempting to export the localized memory without forcing PCIe will + return an error. To use GPUDirect RDMA with localized pools on + platforms where the default RDMA path does not support localized + allocations, handles must be acquired with the flag + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE. Note that CUDA memory + pools are only compatible with dma_buf mappings. Methods @@ -9895,8 +9854,22 @@ cdef class CUmemPoolProps(CUmemPoolProps_v1): Bitmask indicating intended usage for the pool. - reserved : bytes - reserved for future use, must be 0 + gpuDirectRDMACapable : bytes + Allocation hint for requesting GPUDirect RDMA capable memory. On + devices that support GPUDirect RDMA, this flag indicates that the + memory will be used for GPUDirect RDMA. On platforms where the + default RDMA path does not support localized allocations, this flag + has the following effects: - For MPS clients using MLOPart/locality + domains, this flag has the effect of disabling localization for the + pool. This allows the pool to be used for GPUDirect RDMA with the + default RDMA path. - For pools that are localized using CUDA + locality domain APIs, using this flag will have no effect, but + attempting to export the localized memory without forcing PCIe will + return an error. To use GPUDirect RDMA with localized pools on + platforms where the default RDMA path does not support localized + allocations, handles must be acquired with the flag + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE. Note that CUDA memory + pools are only compatible with dma_buf mappings. Methods @@ -9910,13 +9883,6 @@ cdef class CUmemPoolPtrExportData_v1(CUmemPoolPtrExportData_st): """ Opaque data for exporting a pool allocation - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -9928,13 +9894,6 @@ cdef class CUmemPoolPtrExportData(CUmemPoolPtrExportData_v1): """ Opaque data for exporting a pool allocation - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -10125,7 +10084,7 @@ cdef class CUmemcpy3DOperand_v1(CUmemcpy3DOperand_st): - op : anon_union13 + op : anon_union16 @@ -10147,7 +10106,7 @@ cdef class CUmemcpy3DOperand(CUmemcpy3DOperand_v1): - op : anon_union13 + op : anon_union16 @@ -10393,6 +10352,14 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS(CUDA_EVENT_RECORD_NODE_PARAMS_st): The event to record when the node executes + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -10429,14 +10396,6 @@ cdef class CUgraphNodeParams(CUgraphNodeParams_st): Type of the node - reserved0 : list[int] - Reserved. Must be zero. - - - reserved1 : list[long long] - Padding. Unused bytes must be zero. - - kernel : CUDA_KERNEL_NODE_PARAMS_v3 Kernel node parameters. @@ -10493,8 +10452,60 @@ cdef class CUgraphNodeParams(CUgraphNodeParams_st): Padding as bytes - reserved2 : long long - Reserved bytes. Must be zero. + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointCustomStoragePerDeviceData(CUcheckpointCustomStoragePerDeviceData_st): + """ + Per-GPU data for zero-copy mapped device memory used with CUDA + checkpoint/restore on custom storage + + Attributes + ---------- + + devPtr : CUdeviceptr + Zero-copy mapped device memory pointer for the user to copy to/from + + + size : size_t + Size of mapped memory + + + stream : CUstream + Stream the user may use for the copy; the CUDA driver synchronizes + on this stream before completing checkpoint or restore + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcheckpointCustomStorageInfo(CUcheckpointCustomStorageInfo_st): + """ + Output from CUDA custom storage checkpoint/restore: per-GPU device + pointers and a handle to complete the operation + + Attributes + ---------- + + handle : CUcheckpointOperationHandle + Handle returned that is needed to complete checkpoint or restore + + + perDeviceData : CUcheckpointCustomStoragePerDeviceData + Returned pointer to array of per-device data, one per device. User + should set to NULL + + + deviceCount : unsigned int + Number of devices (and elements in `perDeviceData` array) Methods @@ -10516,14 +10527,6 @@ cdef class CUcheckpointLockArgs(CUcheckpointLockArgs_st): no timeout - reserved0 : unsigned int - Reserved for future use, must be zero - - - reserved1 : list[cuuint64_t] - Reserved for future use, must be zeroed - - Methods ------- getPtr() @@ -10538,8 +10541,9 @@ cdef class CUcheckpointCheckpointArgs(CUcheckpointCheckpointArgs_st): Attributes ---------- - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed + customStorageInfo_out : CUcheckpointCustomStorageInfo + Optional custom storage; if NULL, GPU memory is checkpointed to + host Methods @@ -10587,12 +10591,8 @@ cdef class CUcheckpointRestoreArgs(CUcheckpointRestoreArgs_st): Number of gpu pairs to remap - reserved : bytes - Reserved for future use, must be zeroed - - - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed + customStorageInfo_out : CUcheckpointCustomStorageInfo + Optional custom storage; if NULL, GPU memory is restored from host Methods @@ -10606,13 +10606,6 @@ cdef class CUcheckpointUnlockArgs(CUcheckpointUnlockArgs_st): """ CUDA checkpoint optional unlock arguments - Attributes - ---------- - - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed - - Methods ------- getPtr() @@ -10661,8 +10654,26 @@ cdef class CUmemDecompressParams(CUmemDecompressParams_st): The decompression algorithm to use. - padding : bytes + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUcliqueInfo(CUcliqueInfo_st): + """ + Fabric clique information + + Attributes + ---------- + + type : CUcliqueType + Type of the fabric clique + + id : unsigned int + ID of the fabric clique Methods @@ -10713,11 +10724,11 @@ cdef class CUlogicalEndpointProp(CUlogicalEndpointProp_struct): Type of the logical endpoint defined in CUlogicalEndpointType - unicast : anon_struct25 + unicast : anon_struct26 - multicast : anon_struct26 + multicast : anon_struct27 @@ -10767,6 +10778,13 @@ cdef class CUdevSmResource(CUdevSmResource_st): CUdevSmResourceGroup_flags. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID is set in flags. If the + backfill flag is set, SMs may be assigned from other locality + domains. + + Methods ------- getPtr() @@ -10800,13 +10818,6 @@ cdef class CUdevWorkqueueConfigResource(CUdevWorkqueueConfigResource_st): cdef class CUdevWorkqueueResource(CUdevWorkqueueResource_st): """ - Attributes - ---------- - - reserved : bytes - Reserved for future use - - Methods ------- getPtr() @@ -10838,8 +10849,9 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS(CU_DEV_SM_RESOURCE_GROUP_PARAMS_st): CUdevSmResourceGroup_flags. - reserved : list[unsigned int] - + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID is set in flags Methods @@ -10942,7 +10954,7 @@ cdef class CUeglFrame_v1(CUeglFrame_st): Attributes ---------- - frame : anon_union17 + frame : anon_union21 @@ -10998,7 +11010,7 @@ cdef class CUeglFrame(CUeglFrame_v1): Attributes ---------- - frame : anon_union17 + frame : anon_union21 diff --git a/cuda_bindings/cuda/bindings/driver.pyx b/cuda_bindings/cuda/bindings/driver.pyx index 44b7c4c567c..92237525d80 100644 --- a/cuda_bindings/cuda/bindings/driver.pyx +++ b/cuda_bindings/cuda/bindings/driver.pyx @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4a70be46627269cff03a2b89504463158d6e50d738cfde91e8c3ed1bf88fd9e0 +# This code was automatically generated with version 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a1404cb4432dcb406b0793e27235118beca37669afc1986a9d5d91c354bbcc1a from typing import Any, Optional import cython import ctypes @@ -212,6 +213,20 @@ CU_MEM_CREATE_USAGE_TILE_POOL = cydriver.CU_MEM_CREATE_USAGE_TILE_POOL #: for hardware accelerated decompression. CU_MEM_CREATE_USAGE_HW_DECOMPRESS = cydriver.CU_MEM_CREATE_USAGE_HW_DECOMPRESS +#: Setting this flag forces GPUDirect RDMA on a locality-domain-localized +#: allocation to use the PCIe (BAR1) path, allowing the allocation to +#: remain locality-domain localized on platforms where the platform- +#: coherent RDMA path does not support localized allocations. Because on +#: some platforms the PCIe bandwidth is limited, using this flag may result +#: in lower RDMA bandwidth than the default RDMA mapping link. Note that +#: this flag does not itself force PCIe to be used, and that this must be +#: done when creating the RDMA export. +#: :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED` +#: indicates whether this flag is needed to create GPUDirect RDMA capable +#: localized memory allocations. This flag is only valid if +#: gpuDirectRDMACapable is set. +CU_MEM_CREATE_USAGE_GPU_DIRECT_RDMA_OVER_PCIE = cydriver.CU_MEM_CREATE_USAGE_GPU_DIRECT_RDMA_OVER_PCIE + #: This flag, if set, indicates that the memory will be used as a buffer #: for hardware accelerated decompression. CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS = cydriver.CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS @@ -2330,6 +2345,18 @@ class CUdevice_attribute(_FastEnum): ) + CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT, + 'Number of locality domains\n' + ) + + + CU_DEVICE_ATTRIBUTE_MAX_OVERSIZED_SHARED_MEMORY_PER_BLOCK = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX_OVERSIZED_SHARED_MEMORY_PER_BLOCK, + 'Maximum oversized shared memory per block\n' + ) + + CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED = ( cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED, 'Device supports CIG streams with D3D12\n' @@ -2366,6 +2393,25 @@ class CUdevice_attribute(_FastEnum): 'Device supports unicast logical endpoint access on the owner device\n' ) + + CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT, + 'Number of multiprocessors on each locality domain\n' + ) + + + CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_SUPPORTED_HANDLE_TYPES = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_SUPPORTED_HANDLE_TYPES, + 'Handle types supported with logical endpoint IPC\n' + ) + + + CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED, + 'Device supports GPUDirect RDMA with localized memory using the default RDMA\n' + 'mapping link\n' + ) + CU_DEVICE_ATTRIBUTE_MAX = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX class CUpointer_attribute(_FastEnum): @@ -2507,6 +2553,14 @@ class CUpointer_attribute(_FastEnum): 'memory that is capable to be used for hardware accelerated decompression.\n' ) + + CU_POINTER_ATTRIBUTE_LOCALITY_DOMAIN_ORDINAL = ( + cydriver.CUpointer_attribute_enum.CU_POINTER_ATTRIBUTE_LOCALITY_DOMAIN_ORDINAL, + 'Returns in `*data` an integer representing the locality domain ordinal of\n' + 'the memory allocation, or -1 if the allocation is not localized to a\n' + 'locality domain.\n' + ) + class CUfunction_attribute(_FastEnum): """ Function properties @@ -2578,15 +2632,23 @@ class CUfunction_attribute(_FastEnum): cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES, 'The maximum size in bytes of dynamically-allocated shared memory that can\n' 'be used by this function. If the user-specified dynamic shared memory size\n' - 'is larger than this value, the launch will fail. The default value of this\n' - 'attribute is :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK` -\n' + 'is larger than this value, the launch will fail.\n' + 'The default value of this attribute is\n' + ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK` -\n' ':py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`, except when\n' ':py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES` is greater than\n' ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`, then the\n' 'default value of this attribute is 0. The value can be increased to\n' ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` -\n' - ':py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`. See\n' - ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' + ':py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`.\n' + 'This attribute is ignored if\n' + ':py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE` or\n' + ':py:obj:`~.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE` is set.\n' + 'This attribute cannot be used to access oversized shared memory. Oversized\n' + 'shared memory can only be accessed by setting\n' + ':py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE` or\n' + ':py:obj:`~.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE`.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) @@ -2597,16 +2659,16 @@ class CUfunction_attribute(_FastEnum): 'the total shared memory. Refer to\n' ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`. This\n' 'is only a hint, and the driver can choose a different ratio if required to\n' - 'execute the function. See :py:obj:`~.cuFuncSetAttribute`,\n' - ':py:obj:`~.cuKernelSetAttribute`\n' + 'execute the function.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET, 'If this attribute is set, the kernel must launch with a valid cluster size\n' - 'specified. See :py:obj:`~.cuFuncSetAttribute`,\n' - ':py:obj:`~.cuKernelSetAttribute`\n' + 'specified.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) @@ -2616,8 +2678,8 @@ class CUfunction_attribute(_FastEnum): 'all be positive. The validity of the cluster dimensions is otherwise\n' 'checked at launch time.\n' 'If the value is set during compile time, it cannot be set at runtime.\n' - 'Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. See\n' - ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' + 'Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) @@ -2627,8 +2689,8 @@ class CUfunction_attribute(_FastEnum): 'all be positive. The validity of the cluster dimensions is otherwise\n' 'checked at launch time.\n' 'If the value is set during compile time, it cannot be set at runtime.\n' - 'Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See\n' - ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' + 'Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) @@ -2638,8 +2700,8 @@ class CUfunction_attribute(_FastEnum): 'all be positive. The validity of the cluster dimensions is otherwise\n' 'checked at launch time.\n' 'If the value is set during compile time, it cannot be set at runtime.\n' - 'Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See\n' - ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' + 'Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) @@ -2657,23 +2719,32 @@ class CUfunction_attribute(_FastEnum): 'cluster size for sm_90 is 8 blocks per cluster. This value may increase for\n' 'future compute capabilities.\n' 'The specific hardware unit may support higher cluster sizes that’s not\n' - 'guaranteed to be portable. See :py:obj:`~.cuFuncSetAttribute`,\n' - ':py:obj:`~.cuKernelSetAttribute`\n' + 'guaranteed to be portable.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE, 'The block scheduling policy of a function. The value type is\n' - ':py:obj:`~.CUclusterSchedulingPolicy` / cudaClusterSchedulingPolicy. See\n' - ':py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' + ':py:obj:`~.CUclusterSchedulingPolicy` / cudaClusterSchedulingPolicy.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED = ( cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED, 'Whether the function can be updated on device. 1 means device node update\n' - 'is supported, 0 is unsupported. See :py:obj:`~.cuFuncGetAttribute`.\n' + 'is supported, 0 is unsupported.\n' + 'See :py:obj:`~.cuFuncGetAttribute`.\n' + ) + + + CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE = ( + cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE, + 'The shared memory mode of a function. The value type is\n' + ':py:obj:`~.CUsharedMemoryMode` / cudaSharedMemoryMode.\n' + 'See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute`\n' ) CU_FUNC_ATTRIBUTE_MAX = cydriver.CUfunction_attribute_enum.CU_FUNC_ATTRIBUTE_MAX @@ -3368,6 +3439,12 @@ class CUjit_target(_FastEnum): ) + CU_TARGET_COMPUTE_107 = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_107, + 'Compute device class 10.7.\n' + ) + + CU_TARGET_COMPUTE_110 = ( cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_110, 'Compute device class 11.0.\n' @@ -3398,9 +3475,11 @@ class CUjit_target(_FastEnum): 'Compute device class 11.0 with accelerated features.\n' ) + CU_TARGET_COMPUTE_103A = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103A + - CU_TARGET_COMPUTE_103A = ( - cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103A, + CU_TARGET_COMPUTE_107A = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_107A, 'Compute device class 12.0. with accelerated features.\n' ) @@ -3428,9 +3507,11 @@ class CUjit_target(_FastEnum): 'Compute device class 11.0 with family features.\n' ) + CU_TARGET_COMPUTE_103F = cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103F - CU_TARGET_COMPUTE_103F = ( - cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_103F, + + CU_TARGET_COMPUTE_107F = ( + cydriver.CUjit_target_enum.CU_TARGET_COMPUTE_107F, 'Compute device class 12.0. with family features.\n' ) @@ -3677,6 +3758,12 @@ class CUlimit(_FastEnum): 'than available\n' ) + + CU_LIMIT_PER_BLOCK_MEMORY_SIZE = ( + cydriver.CUlimit_enum.CU_LIMIT_PER_BLOCK_MEMORY_SIZE, + 'Per-block memory size\n' + ) + CU_LIMIT_MAX = cydriver.CUlimit_enum.CU_LIMIT_MAX class CUresourcetype(_FastEnum): @@ -3893,8 +3980,8 @@ class CUgraphDependencyType(_FastEnum): CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC = ( cydriver.CUgraphDependencyType_enum.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC, 'This dependency type allows the downstream node to use\n' - '`cudaGridDependencySynchronize()`. It may only be used between kernel\n' - 'nodes, and must be used with either the\n' + 'cudaGridDependencySynchronize(). It may only be used between kernel nodes,\n' + 'and must be used with either the\n' ':py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC` or\n' ':py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER` outgoing port.\n' ) @@ -3980,6 +4067,8 @@ class CUclusterSchedulingPolicy(_FastEnum): 'allow the hardware to load-balance the blocks in a cluster to the SMs\n' ) + CU_CLUSTER_SCHEDULING_POLICY_RUBIN_DSMEM_LOCALITY = cydriver.CUclusterSchedulingPolicy_enum.CU_CLUSTER_SCHEDULING_POLICY_RUBIN_DSMEM_LOCALITY + class CUlaunchMemSyncDomain(_FastEnum): """ Memory Synchronization Domain A kernel can be launched in a @@ -4069,6 +4158,21 @@ class CUsharedMemoryMode(_FastEnum): ':py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN`\n' ) + + CU_SHARED_MEMORY_MODE_ALLOW_OVERSIZED_SHARED_MEMORY = ( + cydriver.CUsharedMemoryMode_enum.CU_SHARED_MEMORY_MODE_ALLOW_OVERSIZED_SHARED_MEMORY, + 'Specifies that oversized shared memory configurations may be used (with the\n' + 'limitation of only 8kB L1 cache)\n' + ) + + + CU_SHARED_MEMORY_MODE_PREFER_OVERSIZED_SHARED_MEMORY = ( + cydriver.CUsharedMemoryMode_enum.CU_SHARED_MEMORY_MODE_PREFER_OVERSIZED_SHARED_MEMORY, + 'Specifies that oversized shared memory configurations may be used (with the\n' + 'limitation of only 8kB L1 cache), and prefer an oversized shared memory\n' + 'configuration\n' + ) + class CUlaunchAttributeID(_FastEnum): """ Launch attributes enum; used as id field of @@ -4310,8 +4414,8 @@ class CUlaunchAttributeID(_FastEnum): CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE, - 'Valid for graph nodes, launches. This indicates if the kernel is allowed to\n' - 'use a non-portable dynamic shared memory mode.\n' + "Valid for graph nodes, launches. This controls a kernel's use of non-\n" + 'portable or oversized shared memory configurations.\n' ) class CUstreamCaptureStatus(_FastEnum): @@ -4557,6 +4661,13 @@ class CUresult(_FastEnum): ) + CUDA_ERROR_MULTICAST_RESOURCE_FULL = ( + cydriver.cudaError_enum.CUDA_ERROR_MULTICAST_RESOURCE_FULL, + 'The API call failed because of a hardware resource required to bind memory\n' + 'to a multicast object is unavailable.\n' + ) + + CUDA_ERROR_NO_DEVICE = ( cydriver.cudaError_enum.CUDA_ERROR_NO_DEVICE, 'This indicates that no CUDA-capable devices were detected by the installed\n' @@ -4757,6 +4868,12 @@ class CUresult(_FastEnum): ) + CUDA_ERROR_INSUFFICIENT_LOADER_VERSION = ( + cydriver.cudaError_enum.CUDA_ERROR_INSUFFICIENT_LOADER_VERSION, + 'This indicates that the Loader version is insufficient for fatbin\n' + ) + + CUDA_ERROR_INVALID_SOURCE = ( cydriver.cudaError_enum.CUDA_ERROR_INVALID_SOURCE, 'This indicates that the device kernel source is invalid. This includes\n' @@ -5259,6 +5376,16 @@ class CUresult(_FastEnum): ) + CUDA_ERROR_FABRIC_NOT_READY = ( + cydriver.cudaError_enum.CUDA_ERROR_FABRIC_NOT_READY, + 'The GPU fabric is not ready within the bounded wait while the fabric\n' + 'manager probe is still in progress (or not converging in time).\n' + 'Applications may retry after a delay; for the initialization wait budget,\n' + 'see environment variables such as CUDA_FABRIC_INIT_TIMEOUT_MS. The CUDA\n' + 'Runtime uses the same value as :py:obj:`~.cudaErrorFabricNotReady`.\n' + ) + + CUDA_ERROR_UNKNOWN = ( cydriver.cudaError_enum.CUDA_ERROR_UNKNOWN, 'This indicates that an unknown internal error has occurred.\n' @@ -5877,6 +6004,13 @@ class CUmemLocationType(_FastEnum): 'CU_DEVICE_INVALID\n' ) + + CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN = ( + cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN, + 'Location is a portion of device memory, specified by the locality domain\n' + 'ID.\n' + ) + CU_MEM_LOCATION_TYPE_MAX = cydriver.CUmemLocationType_enum.CU_MEM_LOCATION_TYPE_MAX class CUmemAllocationType(_FastEnum): @@ -6181,6 +6315,19 @@ class CUmemPool_attribute(_FastEnum): 'enabled\n' ) + + CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID = ( + cydriver.CUmemPool_attribute_enum.CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID, + '(value type = int) The locality domain ID for the mempool, if the mempool\n' + 'is localized to a locality domain. A value of -1 indicates that the mempool\n' + 'is not localized.\n' + 'Note: On devices with a single locality domain, mempools created with\n' + ':py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN` and\n' + 'localityDomainId 0 are equivalent to full-device mempools created with\n' + ':py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`. The value of this attribute will\n' + 'be -1 for such mempools.\n' + ) + class CUmemcpyFlags(_FastEnum): """ Flags to specify for copies within a batch. For more details see @@ -6609,6 +6756,18 @@ class CUprocessState(_FastEnum): 'process\n' ) + + CU_PROCESS_STATE_CHECKPOINTING = ( + cydriver.CUprocessState_enum.CU_PROCESS_STATE_CHECKPOINTING, + 'Application memory contents are being checkpointed\n' + ) + + + CU_PROCESS_STATE_RESTORING = ( + cydriver.CUprocessState_enum.CU_PROCESS_STATE_RESTORING, + 'Application memory contents are being restored\n' + ) + class CUmoduleLoadingMode(_FastEnum): """ CUDA Lazy Loading status @@ -6655,6 +6814,35 @@ class CUmemDecompressAlgorithm(_FastEnum): 'LZ4 is supported.\n' ) +class CUcliqueType(_FastEnum): + """ + Fabric clique types + """ + + + CU_CLIQUE_TYPE_UNICAST_POINTER = ( + cydriver.CUcliqueType_enum.CU_CLIQUE_TYPE_UNICAST_POINTER, + 'Unicast pointer clique\n' + ) + + + CU_CLIQUE_TYPE_MULTICAST_POINTER = ( + cydriver.CUcliqueType_enum.CU_CLIQUE_TYPE_MULTICAST_POINTER, + 'Multicast pointer clique\n' + ) + + + CU_CLIQUE_TYPE_UNICAST_LOGICAL_ENDPOINT = ( + cydriver.CUcliqueType_enum.CU_CLIQUE_TYPE_UNICAST_LOGICAL_ENDPOINT, + 'Unicast logical endpoint clique\n' + ) + + + CU_CLIQUE_TYPE_MULTICAST_LOGICAL_ENDPOINT = ( + cydriver.CUcliqueType_enum.CU_CLIQUE_TYPE_MULTICAST_LOGICAL_ENDPOINT, + 'Multicast logical endpoint clique\n' + ) + class CUlogicalEndpointIpcHandleType(_FastEnum): """ IPC handle types that can be requested/queried for a given logical @@ -6801,6 +6989,13 @@ class CUdevSmResourceGroup_flags(_FastEnum): CU_DEV_SM_RESOURCE_GROUP_BACKFILL = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_BACKFILL + + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID = ( + cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID, + 'The SMs must be located on a specific locality domain, specified by\n' + 'localityDomainId\n' + ) + class CUdevSmResourceSplitByCount_flags(_FastEnum): """ @@ -8130,8 +8325,8 @@ class CUkernelNodeAttrID(_FastEnum): CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE, - 'Valid for graph nodes, launches. This indicates if the kernel is allowed to\n' - 'use a non-portable dynamic shared memory mode.\n' + "Valid for graph nodes, launches. This controls a kernel's use of non-\n" + 'portable or oversized shared memory configurations.\n' ) class CUstreamAttrID(_FastEnum): @@ -8375,8 +8570,8 @@ class CUstreamAttrID(_FastEnum): CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE = ( cydriver.CUlaunchAttributeID_enum.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE, - 'Valid for graph nodes, launches. This indicates if the kernel is allowed to\n' - 'use a non-portable dynamic shared memory mode.\n' + "Valid for graph nodes, launches. This controls a kernel's use of non-\n" + 'portable or oversized shared memory configurations.\n' ) cdef class CUmemGenericAllocationHandle: @@ -9211,6 +9406,40 @@ cdef class CUlinkState: def getPtr(self): return self._pvt_ptr +cdef class CUcheckpointOperationHandle: + """ + + Handle for a CUDA custom storage checkpoint or restore operation awaiting completion + + Methods + ------- + getPtr() + Get memory address of class instance + + """ + def __cinit__(self, void_ptr init_value = 0, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + self._pvt_ptr[0] = init_value + else: + self._pvt_ptr = _ptr + def __init__(self, *args, **kwargs): + pass + def __repr__(self): + return '' + def __index__(self): + return self.__int__() + def __eq__(self, other): + if not isinstance(other, CUcheckpointOperationHandle): + return False + return self._pvt_ptr[0] == (other)._pvt_ptr[0] + def __hash__(self): + return hash((self._pvt_ptr[0])) + def __int__(self): + return self._pvt_ptr[0] + def getPtr(self): + return self._pvt_ptr + cdef class CUcoredumpCallbackHandle: """ Opaque handle representing a registered coredump status callback. @@ -9724,13 +9953,6 @@ cdef class CUipcEventHandle_st: """ CUDA IPC event handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -9751,45 +9973,14 @@ cdef class CUipcEventHandle_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 64: - raise ValueError("reserved length must be 64, is " + str(len(reserved))) - if CHAR_MIN == 0: - for i, b in enumerate(reserved): - if b < 0 and b > -129: - b = b + 256 - self._pvt_ptr[0].reserved[i] = b - else: - for i, b in enumerate(reserved): - if b > 127 and b < 256: - b = b - 256 - self._pvt_ptr[0].reserved[i] = b - - cdef class CUipcMemHandle_st: """ CUDA IPC mem handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -9810,34 +10001,10 @@ cdef class CUipcMemHandle_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 64: - raise ValueError("reserved length must be 64, is " + str(len(reserved))) - if CHAR_MIN == 0: - for i, b in enumerate(reserved): - if b < 0 and b > -129: - b = b + 256 - self._pvt_ptr[0].reserved[i] = b - else: - for i, b in enumerate(reserved): - if b > 127 and b < 256: - b = b - 256 - self._pvt_ptr[0].reserved[i] = b - - cdef class CUstreamMemOpWaitValueParams_st: """ Attributes @@ -10810,6 +10977,7 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: return [CUstreamBatchMemOpParams(_ptr=arr) for arr in arrs] @paramArray.setter def paramArray(self, val): + cdef cydriver.CUstreamBatchMemOpParams* _paramArray_new if len(val) == 0: free(self._paramArray) self._paramArray = NULL @@ -10817,14 +10985,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: self._pvt_ptr[0].paramArray = NULL else: if self._paramArray_length != len(val): - free(self._paramArray) - self._paramArray = calloc(len(val), sizeof(cydriver.CUstreamBatchMemOpParams)) - if self._paramArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramArray_new = calloc(len(val), sizeof(cydriver.CUstreamBatchMemOpParams)) + if _paramArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUstreamBatchMemOpParams))) + for idx in range(len(val)): + string.memcpy(&_paramArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + free(self._paramArray) + self._paramArray = _paramArray_new self._paramArray_length = len(val) - self._pvt_ptr[0].paramArray = self._paramArray - for idx in range(len(val)): - string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + self._pvt_ptr[0].paramArray = _paramArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) @@ -10945,6 +11121,7 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: return [CUstreamBatchMemOpParams(_ptr=arr) for arr in arrs] @paramArray.setter def paramArray(self, val): + cdef cydriver.CUstreamBatchMemOpParams* _paramArray_new if len(val) == 0: free(self._paramArray) self._paramArray = NULL @@ -10952,14 +11129,22 @@ cdef class CUDA_BATCH_MEM_OP_NODE_PARAMS_v2_st: self._pvt_ptr[0].paramArray = NULL else: if self._paramArray_length != len(val): - free(self._paramArray) - self._paramArray = calloc(len(val), sizeof(cydriver.CUstreamBatchMemOpParams)) - if self._paramArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramArray_new = calloc(len(val), sizeof(cydriver.CUstreamBatchMemOpParams)) + if _paramArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUstreamBatchMemOpParams))) + for idx in range(len(val)): + string.memcpy(&_paramArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + free(self._paramArray) + self._paramArray = _paramArray_new self._paramArray_length = len(val) - self._pvt_ptr[0].paramArray = self._paramArray - for idx in range(len(val)): - string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) + self._pvt_ptr[0].paramArray = _paramArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamBatchMemOpParams)) @@ -12700,6 +12885,14 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: The sync mode to use for the host task + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -12707,7 +12900,8 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: """ def __cinit__(self, void_ptr _ptr = 0): if _ptr == 0: - self._pvt_ptr = &self._pvt_val + self._val_ptr = calloc(1, sizeof(cydriver.CUDA_HOST_NODE_PARAMS_v2_st)) + self._pvt_ptr = self._val_ptr else: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): @@ -12715,8 +12909,15 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: self._fn = CUhostFn(_ptr=&self._pvt_ptr[0].fn) + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + + self._gCtx = CUgreenCtx(_ptr=&self._pvt_ptr[0].gCtx) + def __dealloc__(self): - pass + if self._val_ptr is not NULL: + free(self._val_ptr) def getPtr(self): return self._pvt_ptr def __repr__(self): @@ -12740,6 +12941,18 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: except ValueError: str_list += ['syncMode : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + + try: + str_list += ['gCtx : ' + str(self.gCtx)] + except ValueError: + str_list += ['gCtx : '] + return '\n'.join(str_list) else: return '' @@ -12778,6 +12991,40 @@ cdef class CUDA_HOST_NODE_PARAMS_v2_st: self._pvt_ptr[0].syncMode = syncMode + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + + @property + def gCtx(self): + return self._gCtx + @gCtx.setter + def gCtx(self, gCtx): + cdef cydriver.CUgreenCtx cygCtx + if gCtx is None: + cygCtx = 0 + elif isinstance(gCtx, (CUgreenCtx,)): + pgCtx = int(gCtx) + cygCtx = pgCtx + else: + pgCtx = int(CUgreenCtx(gCtx)) + cygCtx = pgCtx + self._gCtx._pvt_ptr[0] = cygCtx + + cdef class CUDA_CONDITIONAL_NODE_PARAMS: """ Conditional node parameters @@ -12808,7 +13055,7 @@ cdef class CUDA_CONDITIONAL_NODE_PARAMS: empty nodes, child graphs, memsets, memcopies, and conditionals. This applies recursively to child graphs and conditional bodies. - All kernels, including kernels in nested conditionals or child - graphs at any level, must belong to the same CUDA context. + graphs at any level, must belong to the same device context. These graphs may be populated using graph node creation APIs or cuStreamBeginCaptureToGraph. CU_GRAPH_COND_TYPE_IF: phGraph_out[0] is executed when the condition is non-zero. If `size` == 2, @@ -12977,11 +13224,6 @@ cdef class CUgraphEdgeData_st: See CUgraphDependencyType. - reserved : bytes - These bytes are unused and must be zeroed. This ensures - compatibility if additional fields are added in the future. - - Methods ------- getPtr() @@ -13019,12 +13261,6 @@ cdef class CUgraphEdgeData_st: except ValueError: str_list += ['type : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -13053,17 +13289,6 @@ cdef class CUgraphEdgeData_st: self._pvt_ptr[0].type = type - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 5) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 5: - raise ValueError("reserved length must be 5, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b - - cdef class CUDA_GRAPH_INSTANTIATE_PARAMS_st: """ Graph instantiation parameters @@ -14390,6 +14615,7 @@ cdef class CUlaunchConfig_st: return [CUlaunchAttribute(_ptr=arr) for arr in arrs] @attrs.setter def attrs(self, val): + cdef cydriver.CUlaunchAttribute* _attrs_new if len(val) == 0: free(self._attrs) self._attrs = NULL @@ -14397,14 +14623,22 @@ cdef class CUlaunchConfig_st: self._pvt_ptr[0].attrs = NULL else: if self._attrs_length != len(val): - free(self._attrs) - self._attrs = calloc(len(val), sizeof(cydriver.CUlaunchAttribute)) - if self._attrs is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _attrs_new = calloc(len(val), sizeof(cydriver.CUlaunchAttribute)) + if _attrs_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUlaunchAttribute))) + for idx in range(len(val)): + string.memcpy(&_attrs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUlaunchAttribute)) + free(self._attrs) + self._attrs = _attrs_new self._attrs_length = len(val) - self._pvt_ptr[0].attrs = self._attrs - for idx in range(len(val)): - string.memcpy(&self._attrs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUlaunchAttribute)) + self._pvt_ptr[0].attrs = _attrs_new + else: + for idx in range(len(val)): + string.memcpy(&self._attrs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUlaunchAttribute)) @@ -14464,7 +14698,7 @@ cdef class CUexecAffinitySmCount_st: self._pvt_ptr[0].val = val -cdef class anon_union3: +cdef class anon_union4: """ Attributes ---------- @@ -14522,7 +14756,7 @@ cdef class CUexecAffinityParam_st: Type of execution affinity. - param : anon_union3 + param : anon_union4 @@ -14540,7 +14774,7 @@ cdef class CUexecAffinityParam_st: def __init__(self, void_ptr _ptr = 0): pass - self._param = anon_union3(_ptr=self._pvt_ptr) + self._param = anon_union4(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -14578,7 +14812,7 @@ cdef class CUexecAffinityParam_st: def param(self): return self._param @param.setter - def param(self, param not None : anon_union3): + def param(self, param not None : anon_union4): string.memcpy(&self._pvt_ptr[0].param, param.getPtr(), sizeof(self._pvt_ptr[0].param)) @@ -14733,6 +14967,7 @@ cdef class CUctxCreateParams_st: return [CUexecAffinityParam(_ptr=arr) for arr in arrs] @execAffinityParams.setter def execAffinityParams(self, val): + cdef cydriver.CUexecAffinityParam* _execAffinityParams_new if len(val) == 0: free(self._execAffinityParams) self._execAffinityParams = NULL @@ -14740,14 +14975,22 @@ cdef class CUctxCreateParams_st: self._pvt_ptr[0].execAffinityParams = NULL else: if self._execAffinityParams_length != len(val): - free(self._execAffinityParams) - self._execAffinityParams = calloc(len(val), sizeof(cydriver.CUexecAffinityParam)) - if self._execAffinityParams is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _execAffinityParams_new = calloc(len(val), sizeof(cydriver.CUexecAffinityParam)) + if _execAffinityParams_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUexecAffinityParam))) + for idx in range(len(val)): + string.memcpy(&_execAffinityParams_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) + free(self._execAffinityParams) + self._execAffinityParams = _execAffinityParams_new self._execAffinityParams_length = len(val) - self._pvt_ptr[0].execAffinityParams = self._execAffinityParams - for idx in range(len(val)): - string.memcpy(&self._execAffinityParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) + self._pvt_ptr[0].execAffinityParams = _execAffinityParams_new + else: + for idx in range(len(val)): + string.memcpy(&self._execAffinityParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUexecAffinityParam)) @@ -14765,6 +15008,7 @@ cdef class CUctxCreateParams_st: return [CUctxCigParam(_ptr=arr) for arr in arrs] @cigParams.setter def cigParams(self, val): + cdef cydriver.CUctxCigParam* _cigParams_new if len(val) == 0: free(self._cigParams) self._cigParams = NULL @@ -14772,14 +15016,22 @@ cdef class CUctxCreateParams_st: self._pvt_ptr[0].cigParams = NULL else: if self._cigParams_length != len(val): - free(self._cigParams) - self._cigParams = calloc(len(val), sizeof(cydriver.CUctxCigParam)) - if self._cigParams is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _cigParams_new = calloc(len(val), sizeof(cydriver.CUctxCigParam)) + if _cigParams_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUctxCigParam))) + for idx in range(len(val)): + string.memcpy(&_cigParams_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUctxCigParam)) + free(self._cigParams) + self._cigParams = _cigParams_new self._cigParams_length = len(val) - self._pvt_ptr[0].cigParams = self._cigParams - for idx in range(len(val)): - string.memcpy(&self._cigParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUctxCigParam)) + self._pvt_ptr[0].cigParams = _cigParams_new + else: + for idx in range(len(val)): + string.memcpy(&self._cigParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUctxCigParam)) @@ -14904,6 +15156,7 @@ cdef class CUstreamCigCaptureParams_st: return [CUstreamCigParam(_ptr=arr) for arr in arrs] @streamCigParams.setter def streamCigParams(self, val): + cdef cydriver.CUstreamCigParam* _streamCigParams_new if len(val) == 0: free(self._streamCigParams) self._streamCigParams = NULL @@ -14911,14 +15164,22 @@ cdef class CUstreamCigCaptureParams_st: self._pvt_ptr[0].streamCigParams = NULL else: if self._streamCigParams_length != len(val): - free(self._streamCigParams) - self._streamCigParams = calloc(len(val), sizeof(cydriver.CUstreamCigParam)) - if self._streamCigParams is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _streamCigParams_new = calloc(len(val), sizeof(cydriver.CUstreamCigParam)) + if _streamCigParams_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUstreamCigParam))) + for idx in range(len(val)): + string.memcpy(&_streamCigParams_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamCigParam)) + free(self._streamCigParams) + self._streamCigParams = _streamCigParams_new self._streamCigParams_length = len(val) - self._pvt_ptr[0].streamCigParams = self._streamCigParams - for idx in range(len(val)): - string.memcpy(&self._streamCigParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamCigParam)) + self._pvt_ptr[0].streamCigParams = _streamCigParams_new + else: + for idx in range(len(val)): + string.memcpy(&self._streamCigParams[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUstreamCigParam)) @@ -15433,10 +15694,6 @@ cdef class CUDA_MEMCPY3D_st: Source array reference - reserved0 : Any - Must be NULL - - srcPitch : size_t Source pitch (ignored when src is array) @@ -15477,10 +15734,6 @@ cdef class CUDA_MEMCPY3D_st: Destination array reference - reserved1 : Any - Must be NULL - - dstPitch : size_t Destination pitch (ignored when dst is array) @@ -15582,12 +15835,6 @@ cdef class CUDA_MEMCPY3D_st: str_list += ['srcArray : '] - try: - str_list += ['reserved0 : ' + hex(self.reserved0)] - except ValueError: - str_list += ['reserved0 : '] - - try: str_list += ['srcPitch : ' + str(self.srcPitch)] except ValueError: @@ -15648,12 +15895,6 @@ cdef class CUDA_MEMCPY3D_st: str_list += ['dstArray : '] - try: - str_list += ['reserved1 : ' + hex(self.reserved1)] - except ValueError: - str_list += ['reserved1 : '] - - try: str_list += ['dstPitch : ' + str(self.dstPitch)] except ValueError: @@ -15771,15 +16012,6 @@ cdef class CUDA_MEMCPY3D_st: self._srcArray._pvt_ptr[0] = cysrcArray - @property - def reserved0(self): - return self._pvt_ptr[0].reserved0 - @reserved0.setter - def reserved0(self, reserved0): - self._cyreserved0 = _HelperInputVoidPtr(reserved0) - self._pvt_ptr[0].reserved0 = self._cyreserved0.cptr - - @property def srcPitch(self): return self._pvt_ptr[0].srcPitch @@ -15880,15 +16112,6 @@ cdef class CUDA_MEMCPY3D_st: self._dstArray._pvt_ptr[0] = cydstArray - @property - def reserved1(self): - return self._pvt_ptr[0].reserved1 - @reserved1.setter - def reserved1(self, reserved1): - self._cyreserved1 = _HelperInputVoidPtr(reserved1) - self._pvt_ptr[0].reserved1 = self._cyreserved1.cptr - - @property def dstPitch(self): return self._pvt_ptr[0].dstPitch @@ -16498,10 +16721,6 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: Must be zero - reserved : int - Must be zero - - copyCtx : CUcontext Context on which to run the node @@ -16542,12 +16761,6 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: str_list += ['flags : '] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - - try: str_list += ['copyCtx : ' + str(self.copyCtx)] except ValueError: @@ -16571,14 +16784,6 @@ cdef class CUDA_MEMCPY_NODE_PARAMS_st: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, int reserved): - self._pvt_ptr[0].reserved = reserved - - @property def copyCtx(self): return self._copyCtx @@ -16948,10 +17153,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: CU_ARRAY_SPARSE_PROPERTIES_SINGLE_MIPTAIL - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -16998,12 +17199,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -17040,14 +17235,6 @@ cdef class CUDA_ARRAY_SPARSE_PROPERTIES_st: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: """ CUDA array memory requirements @@ -17063,10 +17250,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: alignment requirement - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -17098,12 +17281,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: except ValueError: str_list += ['alignment : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -17124,14 +17301,6 @@ cdef class CUDA_ARRAY_MEMORY_REQUIREMENTS_st: self._pvt_ptr[0].alignment = alignment - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class anon_struct7: """ Attributes @@ -17504,13 +17673,6 @@ cdef class anon_struct10: cdef class anon_struct11: """ - Attributes - ---------- - - reserved : list[int] - - - Methods ------- getPtr() @@ -17529,24 +17691,11 @@ cdef class anon_struct11: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return self._pvt_ptr[0].res.reserved.reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].res.reserved.reserved = reserved - - -cdef class anon_union4: +cdef class anon_union5: """ Attributes ---------- @@ -17567,10 +17716,6 @@ cdef class anon_union4: - reserved : anon_struct11 - - - Methods ------- getPtr() @@ -17593,9 +17738,6 @@ cdef class anon_union4: self._pitch2D = anon_struct10(_ptr=self._pvt_ptr) - - self._reserved = anon_struct11(_ptr=self._pvt_ptr) - def __dealloc__(self): pass def getPtr(self): @@ -17627,12 +17769,6 @@ cdef class anon_union4: except ValueError: str_list += ['pitch2D : '] - - try: - str_list += ['reserved :\n' + '\n'.join([' ' + line for line in str(self.reserved).splitlines()])] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -17669,14 +17805,6 @@ cdef class anon_union4: string.memcpy(&self._pvt_ptr[0].res.pitch2D, pitch2D.getPtr(), sizeof(self._pvt_ptr[0].res.pitch2D)) - @property - def reserved(self): - return self._reserved - @reserved.setter - def reserved(self, reserved not None : anon_struct11): - string.memcpy(&self._pvt_ptr[0].res.reserved, reserved.getPtr(), sizeof(self._pvt_ptr[0].res.reserved)) - - cdef class CUDA_RESOURCE_DESC_st: """ CUDA Resource descriptor @@ -17688,7 +17816,7 @@ cdef class CUDA_RESOURCE_DESC_st: Resource type - res : anon_union4 + res : anon_union5 @@ -17710,7 +17838,7 @@ cdef class CUDA_RESOURCE_DESC_st: def __init__(self, void_ptr _ptr = 0): pass - self._res = anon_union4(_ptr=self._pvt_ptr) + self._res = anon_union5(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -17754,7 +17882,7 @@ cdef class CUDA_RESOURCE_DESC_st: def res(self): return self._res @res.setter - def res(self, res not None : anon_union4): + def res(self, res not None : anon_union5): string.memcpy(&self._pvt_ptr[0].res, res.getPtr(), sizeof(self._pvt_ptr[0].res)) @@ -17809,10 +17937,6 @@ cdef class CUDA_TEXTURE_DESC_st: Border Color - reserved : list[int] - - - Methods ------- getPtr() @@ -17886,12 +18010,6 @@ cdef class CUDA_TEXTURE_DESC_st: except ValueError: str_list += ['borderColor : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -17968,14 +18086,6 @@ cdef class CUDA_TEXTURE_DESC_st: self._pvt_ptr[0].borderColor = borderColor - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class CUDA_RESOURCE_VIEW_DESC_st: """ Resource view descriptor @@ -18015,10 +18125,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: Last layer index - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -18086,12 +18192,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: except ValueError: str_list += ['lastLayer : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -18160,14 +18260,6 @@ cdef class CUDA_RESOURCE_VIEW_DESC_st: self._pvt_ptr[0].lastLayer = lastLayer - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class CUtensorMap_st: """ Tensor map descriptor. Requires compiler support for aligning to @@ -18583,7 +18675,7 @@ cdef class anon_struct12: self._pvt_ptr[0].handle.win32.name = self._cyname.cptr -cdef class anon_union5: +cdef class anon_union6: """ Attributes ---------- @@ -18678,7 +18770,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Type of the handle - handle : anon_union5 + handle : anon_union6 @@ -18690,10 +18782,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: Flags must either be zero or CUDA_EXTERNAL_MEMORY_DEDICATED - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -18708,7 +18796,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: def __init__(self, void_ptr _ptr = 0): pass - self._handle = anon_union5(_ptr=self._pvt_ptr) + self._handle = anon_union6(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -18742,12 +18830,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -18764,7 +18846,7 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: def handle(self): return self._handle @handle.setter - def handle(self, handle not None : anon_union5): + def handle(self, handle not None : anon_union6): string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) @@ -18784,14 +18866,6 @@ cdef class CUDA_EXTERNAL_MEMORY_HANDLE_DESC_st: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: """ External memory buffer descriptor @@ -18811,10 +18885,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: Flags reserved for future use. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -18852,12 +18922,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -18886,14 +18950,6 @@ cdef class CUDA_EXTERNAL_MEMORY_BUFFER_DESC_st: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: """ External memory mipmap descriptor @@ -18914,10 +18970,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: Total number of levels in the mipmap chain - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -18958,12 +19010,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: except ValueError: str_list += ['numLevels : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -18992,14 +19038,6 @@ cdef class CUDA_EXTERNAL_MEMORY_MIPMAPPED_ARRAY_DESC_st: self._pvt_ptr[0].numLevels = numLevels - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class anon_struct13: """ Attributes @@ -19064,7 +19102,7 @@ cdef class anon_struct13: self._pvt_ptr[0].handle.win32.name = self._cyname.cptr -cdef class anon_union6: +cdef class anon_union7: """ Attributes ---------- @@ -19159,7 +19197,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Type of the handle - handle : anon_union6 + handle : anon_union7 @@ -19167,10 +19205,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: Flags reserved for the future. Must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -19185,7 +19219,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: def __init__(self, void_ptr _ptr = 0): pass - self._handle = anon_union6(_ptr=self._pvt_ptr) + self._handle = anon_union7(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -19213,12 +19247,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -19235,7 +19263,7 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: def handle(self): return self._handle @handle.setter - def handle(self, handle not None : anon_union6): + def handle(self, handle not None : anon_union7): string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) @@ -19247,14 +19275,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_HANDLE_DESC_st: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class anon_struct14: """ Attributes @@ -19299,7 +19319,7 @@ cdef class anon_struct14: self._pvt_ptr[0].params.fence.value = value -cdef class anon_union7: +cdef class anon_union8: """ Attributes ---------- @@ -19308,10 +19328,6 @@ cdef class anon_union7: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -19335,12 +19351,6 @@ cdef class anon_union7: except ValueError: str_list += ['fence : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -19354,14 +19364,6 @@ cdef class anon_union7: self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr - @property - def reserved(self): - return self._pvt_ptr[0].params.nvSciSync.reserved - @reserved.setter - def reserved(self, unsigned long long reserved): - self._pvt_ptr[0].params.nvSciSync.reserved = reserved - - cdef class anon_struct15: """ Attributes @@ -19415,7 +19417,7 @@ cdef class anon_struct16: - nvSciSync : anon_union7 + nvSciSync : anon_union8 @@ -19423,10 +19425,6 @@ cdef class anon_struct16: - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -19441,7 +19439,7 @@ cdef class anon_struct16: self._fence = anon_struct14(_ptr=self._pvt_ptr) - self._nvSciSync = anon_union7(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union8(_ptr=self._pvt_ptr) self._keyedMutex = anon_struct15(_ptr=self._pvt_ptr) @@ -19471,12 +19469,6 @@ cdef class anon_struct16: except ValueError: str_list += ['keyedMutex : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -19493,7 +19485,7 @@ cdef class anon_struct16: def nvSciSync(self): return self._nvSciSync @nvSciSync.setter - def nvSciSync(self, nvSciSync not None : anon_union7): + def nvSciSync(self, nvSciSync not None : anon_union8): string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) @@ -19505,14 +19497,6 @@ cdef class anon_struct16: string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) - @property - def reserved(self): - return self._pvt_ptr[0].params.reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].params.reserved = reserved - - cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: """ External semaphore signal parameters @@ -19535,10 +19519,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -19573,12 +19553,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -19599,14 +19573,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS_st: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class anon_struct17: """ Attributes @@ -19651,7 +19617,7 @@ cdef class anon_struct17: self._pvt_ptr[0].params.fence.value = value -cdef class anon_union8: +cdef class anon_union9: """ Attributes ---------- @@ -19660,10 +19626,6 @@ cdef class anon_union8: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -19687,12 +19649,6 @@ cdef class anon_union8: except ValueError: str_list += ['fence : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -19706,14 +19662,6 @@ cdef class anon_union8: self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr - @property - def reserved(self): - return self._pvt_ptr[0].params.nvSciSync.reserved - @reserved.setter - def reserved(self, unsigned long long reserved): - self._pvt_ptr[0].params.nvSciSync.reserved = reserved - - cdef class anon_struct18: """ Attributes @@ -19785,7 +19733,7 @@ cdef class anon_struct19: - nvSciSync : anon_union8 + nvSciSync : anon_union9 @@ -19793,10 +19741,6 @@ cdef class anon_struct19: - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -19811,7 +19755,7 @@ cdef class anon_struct19: self._fence = anon_struct17(_ptr=self._pvt_ptr) - self._nvSciSync = anon_union8(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union9(_ptr=self._pvt_ptr) self._keyedMutex = anon_struct18(_ptr=self._pvt_ptr) @@ -19841,12 +19785,6 @@ cdef class anon_struct19: except ValueError: str_list += ['keyedMutex : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -19863,7 +19801,7 @@ cdef class anon_struct19: def nvSciSync(self): return self._nvSciSync @nvSciSync.setter - def nvSciSync(self, nvSciSync not None : anon_union8): + def nvSciSync(self, nvSciSync not None : anon_union9): string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) @@ -19875,14 +19813,6 @@ cdef class anon_struct19: string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) - @property - def reserved(self): - return self._pvt_ptr[0].params.reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].params.reserved = reserved - - cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: """ External semaphore wait parameters @@ -19905,10 +19835,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: For all other types of CUexternalSemaphore, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -19943,12 +19869,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -19969,14 +19889,6 @@ cdef class CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS_st: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: """ Semaphore signal node parameters @@ -20078,6 +19990,7 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: return [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -20085,14 +19998,22 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_st: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) @@ -20124,6 +20045,14 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: paramsArray. + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -20131,13 +20060,21 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: """ def __cinit__(self, void_ptr _ptr = 0): if _ptr == 0: - self._pvt_ptr = &self._pvt_val + self._val_ptr = calloc(1, sizeof(cydriver.CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st)) + self._pvt_ptr = self._val_ptr else: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + + self._gCtx = CUgreenCtx(_ptr=&self._pvt_ptr[0].gCtx) + def __dealloc__(self): - pass + if self._val_ptr is not NULL: + free(self._val_ptr) if self._extSemArray is not NULL: free(self._extSemArray) @@ -20171,6 +20108,18 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: except ValueError: str_list += ['numExtSems : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + + try: + str_list += ['gCtx : ' + str(self.gCtx)] + except ValueError: + str_list += ['gCtx : '] + return '\n'.join(str_list) else: return '' @@ -20205,6 +20154,7 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: return [CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -20212,14 +20162,22 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_SIGNAL_PARAMS)) @@ -20231,6 +20189,40 @@ cdef class CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v2_st: self._pvt_ptr[0].numExtSems = numExtSems + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + + @property + def gCtx(self): + return self._gCtx + @gCtx.setter + def gCtx(self, gCtx): + cdef cydriver.CUgreenCtx cygCtx + if gCtx is None: + cygCtx = 0 + elif isinstance(gCtx, (CUgreenCtx,)): + pgCtx = int(gCtx) + cygCtx = pgCtx + else: + pgCtx = int(CUgreenCtx(gCtx)) + cygCtx = pgCtx + self._gCtx._pvt_ptr[0] = cygCtx + + cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: """ Semaphore wait node parameters @@ -20332,6 +20324,7 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: return [CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -20339,14 +20332,22 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_st: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) @@ -20378,6 +20379,14 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: paramsArray. + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -20385,13 +20394,21 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: """ def __cinit__(self, void_ptr _ptr = 0): if _ptr == 0: - self._pvt_ptr = &self._pvt_val + self._val_ptr = calloc(1, sizeof(cydriver.CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st)) + self._pvt_ptr = self._val_ptr else: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + + self._gCtx = CUgreenCtx(_ptr=&self._pvt_ptr[0].gCtx) + def __dealloc__(self): - pass + if self._val_ptr is not NULL: + free(self._val_ptr) if self._extSemArray is not NULL: free(self._extSemArray) @@ -20425,6 +20442,18 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: except ValueError: str_list += ['numExtSems : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + + try: + str_list += ['gCtx : ' + str(self.gCtx)] + except ValueError: + str_list += ['gCtx : '] + return '\n'.join(str_list) else: return '' @@ -20459,6 +20488,7 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: return [CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -20466,14 +20496,22 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_EXTERNAL_SEMAPHORE_WAIT_PARAMS)) @@ -20485,7 +20523,41 @@ cdef class CUDA_EXT_SEM_WAIT_NODE_PARAMS_v2_st: self._pvt_ptr[0].numExtSems = numExtSems -cdef class anon_union9: + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + + @property + def gCtx(self): + return self._gCtx + @gCtx.setter + def gCtx(self, gCtx): + cdef cydriver.CUgreenCtx cygCtx + if gCtx is None: + cygCtx = 0 + elif isinstance(gCtx, (CUgreenCtx,)): + pgCtx = int(gCtx) + cygCtx = pgCtx + else: + pgCtx = int(CUgreenCtx(gCtx)) + cygCtx = pgCtx + self._gCtx._pvt_ptr[0] = cygCtx + + +cdef class anon_union12: """ Attributes ---------- @@ -20821,7 +20893,7 @@ cdef class anon_struct21: self._pvt_ptr[0].subresource.miptail.size = size -cdef class anon_union10: +cdef class anon_union13: """ Attributes ---------- @@ -20889,7 +20961,7 @@ cdef class anon_union10: string.memcpy(&self._pvt_ptr[0].subresource.miptail, miptail.getPtr(), sizeof(self._pvt_ptr[0].subresource.miptail)) -cdef class anon_union11: +cdef class anon_union14: """ Attributes ---------- @@ -20958,7 +21030,7 @@ cdef class CUarrayMapInfo_st: Resource type - resource : anon_union9 + resource : anon_union12 @@ -20966,7 +21038,7 @@ cdef class CUarrayMapInfo_st: Sparse subresource type - subresource : anon_union10 + subresource : anon_union13 @@ -20978,7 +21050,7 @@ cdef class CUarrayMapInfo_st: Memory handle type - memHandle : anon_union11 + memHandle : anon_union14 @@ -20994,10 +21066,6 @@ cdef class CUarrayMapInfo_st: flags for future use, must be zero now. - reserved : list[unsigned int] - Reserved for future use, must be zero now. - - Methods ------- getPtr() @@ -21012,13 +21080,13 @@ cdef class CUarrayMapInfo_st: def __init__(self, void_ptr _ptr = 0): pass - self._resource = anon_union9(_ptr=self._pvt_ptr) + self._resource = anon_union12(_ptr=self._pvt_ptr) - self._subresource = anon_union10(_ptr=self._pvt_ptr) + self._subresource = anon_union13(_ptr=self._pvt_ptr) - self._memHandle = anon_union11(_ptr=self._pvt_ptr) + self._memHandle = anon_union14(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -21088,12 +21156,6 @@ cdef class CUarrayMapInfo_st: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -21110,7 +21172,7 @@ cdef class CUarrayMapInfo_st: def resource(self): return self._resource @resource.setter - def resource(self, resource not None : anon_union9): + def resource(self, resource not None : anon_union12): string.memcpy(&self._pvt_ptr[0].resource, resource.getPtr(), sizeof(self._pvt_ptr[0].resource)) @@ -21126,7 +21188,7 @@ cdef class CUarrayMapInfo_st: def subresource(self): return self._subresource @subresource.setter - def subresource(self, subresource not None : anon_union10): + def subresource(self, subresource not None : anon_union13): string.memcpy(&self._pvt_ptr[0].subresource, subresource.getPtr(), sizeof(self._pvt_ptr[0].subresource)) @@ -21150,7 +21212,7 @@ cdef class CUarrayMapInfo_st: def memHandle(self): return self._memHandle @memHandle.setter - def memHandle(self, memHandle not None : anon_union11): + def memHandle(self, memHandle not None : anon_union14): string.memcpy(&self._pvt_ptr[0].memHandle, memHandle.getPtr(), sizeof(self._pvt_ptr[0].memHandle)) @@ -21178,12 +21240,66 @@ cdef class CUarrayMapInfo_st: self._pvt_ptr[0].flags = flags +cdef class anon_struct22: + """ + Attributes + ---------- + + deviceId : bytes + + + + localityDomainId : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].localized + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['deviceId : ' + str(self.deviceId)] + except ValueError: + str_list += ['deviceId : '] + + + try: + str_list += ['localityDomainId : ' + str(self.localityDomainId)] + except ValueError: + str_list += ['localityDomainId : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def deviceId(self): + return self._pvt_ptr[0].localized.deviceId + @deviceId.setter + def deviceId(self, unsigned char deviceId): + self._pvt_ptr[0].localized.deviceId = deviceId + + @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved + def localityDomainId(self): + return self._pvt_ptr[0].localized.localityDomainId + @localityDomainId.setter + def localityDomainId(self, unsigned char localityDomainId): + self._pvt_ptr[0].localized.localityDomainId = localityDomainId cdef class CUmemLocation_st: @@ -21203,6 +21319,11 @@ cdef class CUmemLocation_st: CUmemLocationType::CU_MEM_LOCATION_TYPE_HOST_NUMA. + localized : anon_struct22 + Identifier for + CUmemLocationType::CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN. + + Methods ------- getPtr() @@ -21216,6 +21337,9 @@ cdef class CUmemLocation_st: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + + self._localized = anon_struct22(_ptr=self._pvt_ptr) + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -21236,6 +21360,12 @@ cdef class CUmemLocation_st: except ValueError: str_list += ['id : '] + + try: + str_list += ['localized :\n' + '\n'.join([' ' + line for line in str(self.localized).splitlines()])] + except ValueError: + str_list += ['localized : '] + return '\n'.join(str_list) else: return '' @@ -21256,7 +21386,15 @@ cdef class CUmemLocation_st: self._pvt_ptr[0].id = id -cdef class anon_struct22: + @property + def localized(self): + return self._localized + @localized.setter + def localized(self, localized not None : anon_struct22): + string.memcpy(&self._pvt_ptr[0].localized, localized.getPtr(), sizeof(self._pvt_ptr[0].localized)) + + +cdef class anon_struct23: """ Attributes ---------- @@ -21273,10 +21411,6 @@ cdef class anon_struct22: - reserved : bytes - - - Methods ------- getPtr() @@ -21312,12 +21446,6 @@ cdef class anon_struct22: except ValueError: str_list += ['usage : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -21346,17 +21474,6 @@ cdef class anon_struct22: self._pvt_ptr[0].allocFlags.usage = usage - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].allocFlags.reserved, 4) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 4: - raise ValueError("reserved length must be 4, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].allocFlags.reserved[i] = b - - cdef class CUmemAllocationProp_st: """ Specifies the allocation properties for a allocation. @@ -21384,7 +21501,7 @@ cdef class CUmemAllocationProp_st: In all other cases, this field is required to be zero. - allocFlags : anon_struct22 + allocFlags : anon_struct23 @@ -21404,7 +21521,7 @@ cdef class CUmemAllocationProp_st: self._location = CUmemLocation(_ptr=&self._pvt_ptr[0].location) - self._allocFlags = anon_struct22(_ptr=self._pvt_ptr) + self._allocFlags = anon_struct23(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -21484,7 +21601,7 @@ cdef class CUmemAllocationProp_st: def allocFlags(self): return self._allocFlags @allocFlags.setter - def allocFlags(self, allocFlags not None : anon_struct22): + def allocFlags(self, allocFlags not None : anon_struct23): string.memcpy(&self._pvt_ptr[0].allocFlags, allocFlags.getPtr(), sizeof(self._pvt_ptr[0].allocFlags)) @@ -21810,8 +21927,22 @@ cdef class CUmemPoolProps_st: Bitmask indicating intended usage for the pool. - reserved : bytes - reserved for future use, must be 0 + gpuDirectRDMACapable : bytes + Allocation hint for requesting GPUDirect RDMA capable memory. On + devices that support GPUDirect RDMA, this flag indicates that the + memory will be used for GPUDirect RDMA. On platforms where the + default RDMA path does not support localized allocations, this flag + has the following effects: - For MPS clients using MLOPart/locality + domains, this flag has the effect of disabling localization for the + pool. This allows the pool to be used for GPUDirect RDMA with the + default RDMA path. - For pools that are localized using CUDA + locality domain APIs, using this flag will have no effect, but + attempting to export the localized memory without forcing PCIe will + return an error. To use GPUDirect RDMA with localized pools on + platforms where the default RDMA path does not support localized + allocations, handles must be acquired with the flag + CU_MEM_RANGE_FLAG_DMA_BUF_MAPPING_TYPE_PCIE. Note that CUDA memory + pools are only compatible with dma_buf mappings. Methods @@ -21874,9 +22005,9 @@ cdef class CUmemPoolProps_st: try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['gpuDirectRDMACapable : ' + str(self.gpuDirectRDMACapable)] except ValueError: - str_list += ['reserved : '] + str_list += ['gpuDirectRDMACapable : '] return '\n'.join(str_list) else: @@ -21932,27 +22063,17 @@ cdef class CUmemPoolProps_st: @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 54) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 54: - raise ValueError("reserved length must be 54, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b + def gpuDirectRDMACapable(self): + return self._pvt_ptr[0].gpuDirectRDMACapable + @gpuDirectRDMACapable.setter + def gpuDirectRDMACapable(self, unsigned char gpuDirectRDMACapable): + self._pvt_ptr[0].gpuDirectRDMACapable = gpuDirectRDMACapable cdef class CUmemPoolPtrExportData_st: """ Opaque data for exporting a pool allocation - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -21973,26 +22094,10 @@ cdef class CUmemPoolPtrExportData_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 64: - raise ValueError("reserved length must be 64, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b - - cdef class CUmemcpyAttributes_st: """ Attributes specific to copies within a batch. For more details on @@ -22273,7 +22378,7 @@ cdef class CUextent3D_st: self._pvt_ptr[0].depth = depth -cdef class anon_struct23: +cdef class anon_struct24: """ Attributes ---------- @@ -22387,7 +22492,7 @@ cdef class anon_struct23: string.memcpy(&self._pvt_ptr[0].op.ptr.locHint, locHint.getPtr(), sizeof(self._pvt_ptr[0].op.ptr.locHint)) -cdef class anon_struct24: +cdef class anon_struct25: """ Attributes ---------- @@ -22464,16 +22569,16 @@ cdef class anon_struct24: string.memcpy(&self._pvt_ptr[0].op.array.offset, offset.getPtr(), sizeof(self._pvt_ptr[0].op.array.offset)) -cdef class anon_union13: +cdef class anon_union16: """ Attributes ---------- - ptr : anon_struct23 + ptr : anon_struct24 - array : anon_struct24 + array : anon_struct25 @@ -22488,10 +22593,10 @@ cdef class anon_union13: def __init__(self, void_ptr _ptr): pass - self._ptr = anon_struct23(_ptr=self._pvt_ptr) + self._ptr = anon_struct24(_ptr=self._pvt_ptr) - self._array = anon_struct24(_ptr=self._pvt_ptr) + self._array = anon_struct25(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -22520,7 +22625,7 @@ cdef class anon_union13: def ptr(self): return self._ptr @ptr.setter - def ptr(self, ptr not None : anon_struct23): + def ptr(self, ptr not None : anon_struct24): string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) @@ -22528,7 +22633,7 @@ cdef class anon_union13: def array(self): return self._array @array.setter - def array(self, array not None : anon_struct24): + def array(self, array not None : anon_struct25): string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) @@ -22543,7 +22648,7 @@ cdef class CUmemcpy3DOperand_st: - op : anon_union13 + op : anon_union16 @@ -22561,7 +22666,7 @@ cdef class CUmemcpy3DOperand_st: def __init__(self, void_ptr _ptr = 0): pass - self._op = anon_union13(_ptr=self._pvt_ptr) + self._op = anon_union16(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -22599,7 +22704,7 @@ cdef class CUmemcpy3DOperand_st: def op(self): return self._op @op.setter - def op(self, op not None : anon_union13): + def op(self, op not None : anon_union16): string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) @@ -22840,6 +22945,7 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: return [CUmemAccessDesc(_ptr=arr) for arr in arrs] @accessDescs.setter def accessDescs(self, val): + cdef cydriver.CUmemAccessDesc* _accessDescs_new if len(val) == 0: free(self._accessDescs) self._accessDescs = NULL @@ -22847,175 +22953,192 @@ cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v1_st: self._pvt_ptr[0].accessDescs = NULL else: if self._accessDescs_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _accessDescs_new = calloc(len(val), sizeof(cydriver.CUmemAccessDesc)) + if _accessDescs_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUmemAccessDesc))) + for idx in range(len(val)): + string.memcpy(&_accessDescs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) free(self._accessDescs) - self._accessDescs = calloc(len(val), sizeof(cydriver.CUmemAccessDesc)) - if self._accessDescs is NULL: + self._accessDescs = _accessDescs_new + self._accessDescs_length = len(val) + self._pvt_ptr[0].accessDescs = _accessDescs_new + else: + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + + + + @property + def accessDescCount(self): + return self._pvt_ptr[0].accessDescCount + @accessDescCount.setter + def accessDescCount(self, size_t accessDescCount): + self._pvt_ptr[0].accessDescCount = accessDescCount + + + @property + def bytesize(self): + return self._pvt_ptr[0].bytesize + @bytesize.setter + def bytesize(self, size_t bytesize): + self._pvt_ptr[0].bytesize = bytesize + + + @property + def dptr(self): + return self._dptr + @dptr.setter + def dptr(self, dptr): + cdef cydriver.CUdeviceptr cydptr + if dptr is None: + cydptr = 0 + elif isinstance(dptr, (CUdeviceptr)): + pdptr = int(dptr) + cydptr = pdptr + else: + pdptr = int(CUdeviceptr(dptr)) + cydptr = pdptr + self._dptr._pvt_ptr[0] = cydptr + + + +cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: + """ + Memory allocation node parameters + + Attributes + ---------- + + poolProps : CUmemPoolProps + in: location where the allocation should reside (specified in + ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is + not supported. + + + accessDescs : CUmemAccessDesc + in: array of memory access descriptors. Used to describe peer GPU + access + + + accessDescCount : size_t + in: number of memory access descriptors. Must not exceed the number + of GPUs. + + + bytesize : size_t + in: size in bytes of the requested allocation + + + dptr : CUdeviceptr + out: address of the allocation returned by CUDA + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._poolProps = CUmemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) + + + self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) + + def __dealloc__(self): + pass + + if self._accessDescs is not NULL: + free(self._accessDescs) + self._pvt_ptr[0].accessDescs = NULL + + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['poolProps :\n' + '\n'.join([' ' + line for line in str(self.poolProps).splitlines()])] + except ValueError: + str_list += ['poolProps : '] + + + try: + str_list += ['accessDescs : ' + str(self.accessDescs)] + except ValueError: + str_list += ['accessDescs : '] + + + try: + str_list += ['accessDescCount : ' + str(self.accessDescCount)] + except ValueError: + str_list += ['accessDescCount : '] + + + try: + str_list += ['bytesize : ' + str(self.bytesize)] + except ValueError: + str_list += ['bytesize : '] + + + try: + str_list += ['dptr : ' + str(self.dptr)] + except ValueError: + str_list += ['dptr : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def poolProps(self): + return self._poolProps + @poolProps.setter + def poolProps(self, poolProps not None : CUmemPoolProps): + string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) + + + @property + def accessDescs(self): + arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cydriver.CUmemAccessDesc) for x in range(self._accessDescs_length)] + return [CUmemAccessDesc(_ptr=arr) for arr in arrs] + @accessDescs.setter + def accessDescs(self, val): + cdef cydriver.CUmemAccessDesc* _accessDescs_new + if len(val) == 0: + free(self._accessDescs) + self._accessDescs = NULL + self._accessDescs_length = 0 + self._pvt_ptr[0].accessDescs = NULL + else: + if self._accessDescs_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _accessDescs_new = calloc(len(val), sizeof(cydriver.CUmemAccessDesc)) + if _accessDescs_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUmemAccessDesc))) + for idx in range(len(val)): + string.memcpy(&_accessDescs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + free(self._accessDescs) + self._accessDescs = _accessDescs_new self._accessDescs_length = len(val) - self._pvt_ptr[0].accessDescs = self._accessDescs - for idx in range(len(val)): - string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) - - - - @property - def accessDescCount(self): - return self._pvt_ptr[0].accessDescCount - @accessDescCount.setter - def accessDescCount(self, size_t accessDescCount): - self._pvt_ptr[0].accessDescCount = accessDescCount - - - @property - def bytesize(self): - return self._pvt_ptr[0].bytesize - @bytesize.setter - def bytesize(self, size_t bytesize): - self._pvt_ptr[0].bytesize = bytesize - - - @property - def dptr(self): - return self._dptr - @dptr.setter - def dptr(self, dptr): - cdef cydriver.CUdeviceptr cydptr - if dptr is None: - cydptr = 0 - elif isinstance(dptr, (CUdeviceptr)): - pdptr = int(dptr) - cydptr = pdptr - else: - pdptr = int(CUdeviceptr(dptr)) - cydptr = pdptr - self._dptr._pvt_ptr[0] = cydptr - - - -cdef class CUDA_MEM_ALLOC_NODE_PARAMS_v2_st: - """ - Memory allocation node parameters - - Attributes - ---------- - - poolProps : CUmemPoolProps - in: location where the allocation should reside (specified in - ::location). ::handleTypes must be CU_MEM_HANDLE_TYPE_NONE. IPC is - not supported. - - - accessDescs : CUmemAccessDesc - in: array of memory access descriptors. Used to describe peer GPU - access - - - accessDescCount : size_t - in: number of memory access descriptors. Must not exceed the number - of GPUs. - - - bytesize : size_t - in: size in bytes of the requested allocation - - - dptr : CUdeviceptr - out: address of the allocation returned by CUDA - - - Methods - ------- - getPtr() - Get memory address of class instance - """ - def __cinit__(self, void_ptr _ptr = 0): - if _ptr == 0: - self._pvt_ptr = &self._pvt_val - else: - self._pvt_ptr = _ptr - def __init__(self, void_ptr _ptr = 0): - pass - - self._poolProps = CUmemPoolProps(_ptr=&self._pvt_ptr[0].poolProps) - - - self._dptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].dptr) - - def __dealloc__(self): - pass - - if self._accessDescs is not NULL: - free(self._accessDescs) - self._pvt_ptr[0].accessDescs = NULL - - def getPtr(self): - return self._pvt_ptr - def __repr__(self): - if self._pvt_ptr is not NULL: - str_list = [] - - try: - str_list += ['poolProps :\n' + '\n'.join([' ' + line for line in str(self.poolProps).splitlines()])] - except ValueError: - str_list += ['poolProps : '] - - - try: - str_list += ['accessDescs : ' + str(self.accessDescs)] - except ValueError: - str_list += ['accessDescs : '] - - - try: - str_list += ['accessDescCount : ' + str(self.accessDescCount)] - except ValueError: - str_list += ['accessDescCount : '] - - - try: - str_list += ['bytesize : ' + str(self.bytesize)] - except ValueError: - str_list += ['bytesize : '] - - - try: - str_list += ['dptr : ' + str(self.dptr)] - except ValueError: - str_list += ['dptr : '] - - return '\n'.join(str_list) - else: - return '' - - @property - def poolProps(self): - return self._poolProps - @poolProps.setter - def poolProps(self, poolProps not None : CUmemPoolProps): - string.memcpy(&self._pvt_ptr[0].poolProps, poolProps.getPtr(), sizeof(self._pvt_ptr[0].poolProps)) - - - @property - def accessDescs(self): - arrs = [self._pvt_ptr[0].accessDescs + x*sizeof(cydriver.CUmemAccessDesc) for x in range(self._accessDescs_length)] - return [CUmemAccessDesc(_ptr=arr) for arr in arrs] - @accessDescs.setter - def accessDescs(self, val): - if len(val) == 0: - free(self._accessDescs) - self._accessDescs = NULL - self._accessDescs_length = 0 - self._pvt_ptr[0].accessDescs = NULL - else: - if self._accessDescs_length != len(val): - free(self._accessDescs) - self._accessDescs = calloc(len(val), sizeof(cydriver.CUmemAccessDesc)) - if self._accessDescs is NULL: - raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUmemAccessDesc))) - self._accessDescs_length = len(val) - self._pvt_ptr[0].accessDescs = self._accessDescs - for idx in range(len(val)): - string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) + self._pvt_ptr[0].accessDescs = _accessDescs_new + else: + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemAccessDesc)) @@ -23207,6 +23330,14 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: The event to record when the node executes + ctx : CUcontext + + + + gCtx : CUgreenCtx + + + Methods ------- getPtr() @@ -23214,7 +23345,8 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: """ def __cinit__(self, void_ptr _ptr = 0): if _ptr == 0: - self._pvt_ptr = &self._pvt_val + self._val_ptr = calloc(1, sizeof(cydriver.CUDA_EVENT_RECORD_NODE_PARAMS_st)) + self._pvt_ptr = self._val_ptr else: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): @@ -23222,8 +23354,15 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: self._event = CUevent(_ptr=&self._pvt_ptr[0].event) + + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + + + self._gCtx = CUgreenCtx(_ptr=&self._pvt_ptr[0].gCtx) + def __dealloc__(self): - pass + if self._val_ptr is not NULL: + free(self._val_ptr) def getPtr(self): return self._pvt_ptr def __repr__(self): @@ -23235,6 +23374,18 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: except ValueError: str_list += ['event : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + + try: + str_list += ['gCtx : ' + str(self.gCtx)] + except ValueError: + str_list += ['gCtx : '] + return '\n'.join(str_list) else: return '' @@ -23256,6 +23407,40 @@ cdef class CUDA_EVENT_RECORD_NODE_PARAMS_st: self._event._pvt_ptr[0] = cyevent + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cydriver.CUcontext cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (CUcontext,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(CUcontext(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + + @property + def gCtx(self): + return self._gCtx + @gCtx.setter + def gCtx(self, gCtx): + cdef cydriver.CUgreenCtx cygCtx + if gCtx is None: + cygCtx = 0 + elif isinstance(gCtx, (CUgreenCtx,)): + pgCtx = int(gCtx) + cygCtx = pgCtx + else: + pgCtx = int(CUgreenCtx(gCtx)) + cygCtx = pgCtx + self._gCtx._pvt_ptr[0] = cygCtx + + cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: """ Event wait node parameters @@ -23327,14 +23512,6 @@ cdef class CUgraphNodeParams_st: Type of the node - reserved0 : list[int] - Reserved. Must be zero. - - - reserved1 : list[long long] - Padding. Unused bytes must be zero. - - kernel : CUDA_KERNEL_NODE_PARAMS_v3 Kernel node parameters. @@ -23391,10 +23568,6 @@ cdef class CUgraphNodeParams_st: Padding as bytes - reserved2 : long long - Reserved bytes. Must be zero. - - Methods ------- getPtr() @@ -23462,18 +23635,6 @@ cdef class CUgraphNodeParams_st: str_list += ['type : '] - try: - str_list += ['reserved0 : ' + str(self.reserved0)] - except ValueError: - str_list += ['reserved0 : '] - - - try: - str_list += ['reserved1 : ' + str(self.reserved1)] - except ValueError: - str_list += ['reserved1 : '] - - try: str_list += ['kernel :\n' + '\n'.join([' ' + line for line in str(self.kernel).splitlines()])] except ValueError: @@ -23557,12 +23718,6 @@ cdef class CUgraphNodeParams_st: except ValueError: str_list += ['asBytes : '] - - try: - str_list += ['reserved2 : ' + str(self.reserved2)] - except ValueError: - str_list += ['reserved2 : '] - return '\n'.join(str_list) else: return '' @@ -23575,22 +23730,6 @@ cdef class CUgraphNodeParams_st: self._pvt_ptr[0].type = int(type) - @property - def reserved0(self): - return self._pvt_ptr[0].reserved0 - @reserved0.setter - def reserved0(self, reserved0): - self._pvt_ptr[0].reserved0 = reserved0 - - - @property - def reserved1(self): - return self._pvt_ptr[0].reserved1 - @reserved1.setter - def reserved1(self, reserved1): - self._pvt_ptr[0].reserved1 = reserved1 - - @property def kernel(self): return self._kernel @@ -23714,32 +23853,136 @@ cdef class CUgraphNodeParams_st: self._pvt_ptr[0].asBytes[i] = b +cdef class CUcheckpointCustomStoragePerDeviceData_st: + """ + Per-GPU data for zero-copy mapped device memory used with CUDA + checkpoint/restore on custom storage + + Attributes + ---------- + + devPtr : CUdeviceptr + Zero-copy mapped device memory pointer for the user to copy to/from + + + size : size_t + Size of mapped memory + + + stream : CUstream + Stream the user may use for the copy; the CUDA driver synchronizes + on this stream before completing checkpoint or restore + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + + self._devPtr = CUdeviceptr(_ptr=&self._pvt_ptr[0].devPtr) + + + self._stream = CUstream(_ptr=&self._pvt_ptr[0].stream) + + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['devPtr : ' + str(self.devPtr)] + except ValueError: + str_list += ['devPtr : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['stream : ' + str(self.stream)] + except ValueError: + str_list += ['stream : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def devPtr(self): + return self._devPtr + @devPtr.setter + def devPtr(self, devPtr): + cdef cydriver.CUdeviceptr cydevPtr + if devPtr is None: + cydevPtr = 0 + elif isinstance(devPtr, (CUdeviceptr)): + pdevPtr = int(devPtr) + cydevPtr = pdevPtr + else: + pdevPtr = int(CUdeviceptr(devPtr)) + cydevPtr = pdevPtr + self._devPtr._pvt_ptr[0] = cydevPtr + + + @property - def reserved2(self): - return self._pvt_ptr[0].reserved2 - @reserved2.setter - def reserved2(self, long long reserved2): - self._pvt_ptr[0].reserved2 = reserved2 + def size(self): + return self._pvt_ptr[0].size + @size.setter + def size(self, size_t size): + self._pvt_ptr[0].size = size -cdef class CUcheckpointLockArgs_st: + @property + def stream(self): + return self._stream + @stream.setter + def stream(self, stream): + cdef cydriver.CUstream cystream + if stream is None: + cystream = 0 + elif isinstance(stream, (CUstream,)): + pstream = int(stream) + cystream = pstream + else: + pstream = int(CUstream(stream)) + cystream = pstream + self._stream._pvt_ptr[0] = cystream + + +cdef class CUcheckpointCustomStorageInfo_st: """ - CUDA checkpoint optional lock arguments + Output from CUDA custom storage checkpoint/restore: per-GPU device + pointers and a handle to complete the operation Attributes ---------- - timeoutMs : unsigned int - Timeout in milliseconds to attempt to lock the process, 0 indicates - no timeout + handle : CUcheckpointOperationHandle + Handle returned that is needed to complete checkpoint or restore - reserved0 : unsigned int - Reserved for future use, must be zero + perDeviceData : CUcheckpointCustomStoragePerDeviceData + Returned pointer to array of per-device data, one per device. User + should set to NULL - reserved1 : list[cuuint64_t] - Reserved for future use, must be zeroed + deviceCount : unsigned int + Number of devices (and elements in `perDeviceData` array) Methods @@ -23751,11 +23994,19 @@ cdef class CUcheckpointLockArgs_st: if _ptr == 0: self._pvt_ptr = &self._pvt_val else: - self._pvt_ptr = _ptr + self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + + self._handle = CUcheckpointOperationHandle(_ptr=&self._pvt_ptr[0].handle) + def __dealloc__(self): pass + + if self._perDeviceData is not NULL: + free(self._perDeviceData) + self._pvt_ptr[0].perDeviceData = NULL + def getPtr(self): return self._pvt_ptr def __repr__(self): @@ -23763,49 +24014,131 @@ cdef class CUcheckpointLockArgs_st: str_list = [] try: - str_list += ['timeoutMs : ' + str(self.timeoutMs)] + str_list += ['handle : ' + str(self.handle)] except ValueError: - str_list += ['timeoutMs : '] + str_list += ['handle : '] try: - str_list += ['reserved0 : ' + str(self.reserved0)] + str_list += ['perDeviceData : ' + str(self.perDeviceData)] except ValueError: - str_list += ['reserved0 : '] + str_list += ['perDeviceData : '] try: - str_list += ['reserved1 : ' + str(self.reserved1)] + str_list += ['deviceCount : ' + str(self.deviceCount)] except ValueError: - str_list += ['reserved1 : '] + str_list += ['deviceCount : '] return '\n'.join(str_list) else: return '' @property - def timeoutMs(self): - return self._pvt_ptr[0].timeoutMs - @timeoutMs.setter - def timeoutMs(self, unsigned int timeoutMs): - self._pvt_ptr[0].timeoutMs = timeoutMs + def handle(self): + return self._handle + @handle.setter + def handle(self, handle): + cdef cydriver.CUcheckpointOperationHandle cyhandle + if handle is None: + cyhandle = 0 + elif isinstance(handle, (CUcheckpointOperationHandle,)): + phandle = int(handle) + cyhandle = phandle + else: + phandle = int(CUcheckpointOperationHandle(handle)) + cyhandle = phandle + self._handle._pvt_ptr[0] = cyhandle @property - def reserved0(self): - return self._pvt_ptr[0].reserved0 - @reserved0.setter - def reserved0(self, unsigned int reserved0): - self._pvt_ptr[0].reserved0 = reserved0 + def perDeviceData(self): + arrs = [self._pvt_ptr[0].perDeviceData + x*sizeof(cydriver.CUcheckpointCustomStoragePerDeviceData) for x in range(self._perDeviceData_length)] + return [CUcheckpointCustomStoragePerDeviceData(_ptr=arr) for arr in arrs] + @perDeviceData.setter + def perDeviceData(self, val): + cdef cydriver.CUcheckpointCustomStoragePerDeviceData* _perDeviceData_new + if len(val) == 0: + free(self._perDeviceData) + self._perDeviceData = NULL + self._perDeviceData_length = 0 + self._pvt_ptr[0].perDeviceData = NULL + else: + if self._perDeviceData_length != len(val): + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _perDeviceData_new = calloc(len(val), sizeof(cydriver.CUcheckpointCustomStoragePerDeviceData)) + if _perDeviceData_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUcheckpointCustomStoragePerDeviceData))) + for idx in range(len(val)): + string.memcpy(&_perDeviceData_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUcheckpointCustomStoragePerDeviceData)) + free(self._perDeviceData) + self._perDeviceData = _perDeviceData_new + self._perDeviceData_length = len(val) + self._pvt_ptr[0].perDeviceData = _perDeviceData_new + else: + for idx in range(len(val)): + string.memcpy(&self._perDeviceData[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUcheckpointCustomStoragePerDeviceData)) + + + + @property + def deviceCount(self): + return self._pvt_ptr[0].deviceCount + @deviceCount.setter + def deviceCount(self, unsigned int deviceCount): + self._pvt_ptr[0].deviceCount = deviceCount - @property - def reserved1(self): - return [cuuint64_t(init_value=_reserved1) for _reserved1 in self._pvt_ptr[0].reserved1] - @reserved1.setter - def reserved1(self, reserved1): - self._pvt_ptr[0].reserved1 = reserved1 +cdef class CUcheckpointLockArgs_st: + """ + CUDA checkpoint optional lock arguments + Attributes + ---------- + + timeoutMs : unsigned int + Timeout in milliseconds to attempt to lock the process, 0 indicates + no timeout + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['timeoutMs : ' + str(self.timeoutMs)] + except ValueError: + str_list += ['timeoutMs : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def timeoutMs(self): + return self._pvt_ptr[0].timeoutMs + @timeoutMs.setter + def timeoutMs(self, unsigned int timeoutMs): + self._pvt_ptr[0].timeoutMs = timeoutMs cdef class CUcheckpointCheckpointArgs_st: @@ -23815,8 +24148,9 @@ cdef class CUcheckpointCheckpointArgs_st: Attributes ---------- - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed + customStorageInfo_out : CUcheckpointCustomStorageInfo + Optional custom storage; if NULL, GPU memory is checkpointed to + host Methods @@ -23840,21 +24174,20 @@ cdef class CUcheckpointCheckpointArgs_st: str_list = [] try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['customStorageInfo_out : ' + str(self.customStorageInfo_out)] except ValueError: - str_list += ['reserved : '] + str_list += ['customStorageInfo_out : '] return '\n'.join(str_list) else: return '' @property - def reserved(self): - return [cuuint64_t(init_value=_reserved) for _reserved in self._pvt_ptr[0].reserved] - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - + def customStorageInfo_out(self): + return self._pvt_ptr[0].customStorageInfo_out + @customStorageInfo_out.setter + def customStorageInfo_out(self, void_ptr customStorageInfo_out): + self._pvt_ptr[0].customStorageInfo_out = customStorageInfo_out cdef class CUcheckpointGpuPair_st: @@ -23945,12 +24278,8 @@ cdef class CUcheckpointRestoreArgs_st: Number of gpu pairs to remap - reserved : bytes - Reserved for future use, must be zeroed - - - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed + customStorageInfo_out : CUcheckpointCustomStorageInfo + Optional custom storage; if NULL, GPU memory is restored from host Methods @@ -23991,9 +24320,9 @@ cdef class CUcheckpointRestoreArgs_st: try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['customStorageInfo_out : ' + str(self.customStorageInfo_out)] except ValueError: - str_list += ['reserved : '] + str_list += ['customStorageInfo_out : '] return '\n'.join(str_list) else: @@ -24005,6 +24334,7 @@ cdef class CUcheckpointRestoreArgs_st: return [CUcheckpointGpuPair(_ptr=arr) for arr in arrs] @gpuPairs.setter def gpuPairs(self, val): + cdef cydriver.CUcheckpointGpuPair* _gpuPairs_new if len(val) == 0: free(self._gpuPairs) self._gpuPairs = NULL @@ -24012,14 +24342,22 @@ cdef class CUcheckpointRestoreArgs_st: self._pvt_ptr[0].gpuPairs = NULL else: if self._gpuPairs_length != len(val): - free(self._gpuPairs) - self._gpuPairs = calloc(len(val), sizeof(cydriver.CUcheckpointGpuPair)) - if self._gpuPairs is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _gpuPairs_new = calloc(len(val), sizeof(cydriver.CUcheckpointGpuPair)) + if _gpuPairs_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUcheckpointGpuPair))) + for idx in range(len(val)): + string.memcpy(&_gpuPairs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUcheckpointGpuPair)) + free(self._gpuPairs) + self._gpuPairs = _gpuPairs_new self._gpuPairs_length = len(val) - self._pvt_ptr[0].gpuPairs = self._gpuPairs - for idx in range(len(val)): - string.memcpy(&self._gpuPairs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUcheckpointGpuPair)) + self._pvt_ptr[0].gpuPairs = _gpuPairs_new + else: + for idx in range(len(val)): + string.memcpy(&self._gpuPairs[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUcheckpointGpuPair)) @@ -24032,44 +24370,17 @@ cdef class CUcheckpointRestoreArgs_st: @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, {{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != {{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}: - raise ValueError("reserved length must be {{struct_field_array_lengths['CUcheckpointRestoreArgs_st.reserved']}}, is " + str(len(reserved))) - if CHAR_MIN == 0: - for i, b in enumerate(reserved): - if b < 0 and b > -129: - b = b + 256 - self._pvt_ptr[0].reserved[i] = b - else: - for i, b in enumerate(reserved): - if b > 127 and b < 256: - b = b - 256 - self._pvt_ptr[0].reserved[i] = b - - - @property - def reserved(self): - return [cuuint64_t(init_value=_reserved) for _reserved in self._pvt_ptr[0].reserved] - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - + def customStorageInfo_out(self): + return self._pvt_ptr[0].customStorageInfo_out + @customStorageInfo_out.setter + def customStorageInfo_out(self, void_ptr customStorageInfo_out): + self._pvt_ptr[0].customStorageInfo_out = customStorageInfo_out cdef class CUcheckpointUnlockArgs_st: """ CUDA checkpoint optional unlock arguments - Attributes - ---------- - - reserved : list[cuuint64_t] - Reserved for future use, must be zeroed - - Methods ------- getPtr() @@ -24090,24 +24401,10 @@ cdef class CUcheckpointUnlockArgs_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return [cuuint64_t(init_value=_reserved) for _reserved in self._pvt_ptr[0].reserved] - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - - cdef class CUmemDecompressParams_st: """ Structure describing the parameters that compose a single @@ -24149,10 +24446,6 @@ cdef class CUmemDecompressParams_st: The decompression algorithm to use. - padding : bytes - - - Methods ------- getPtr() @@ -24208,12 +24501,6 @@ cdef class CUmemDecompressParams_st: except ValueError: str_list += ['algo : '] - - try: - str_list += ['padding : ' + str(self.padding)] - except ValueError: - str_list += ['padding : '] - return '\n'.join(str_list) else: return '' @@ -24265,15 +24552,70 @@ cdef class CUmemDecompressParams_st: self._pvt_ptr[0].algo = int(algo) +cdef class CUcliqueInfo_st: + """ + Fabric clique information + + Attributes + ---------- + + type : CUcliqueType + Type of the fabric clique + + + id : unsigned int + ID of the fabric clique + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._pvt_ptr = &self._pvt_val + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + pass + def __dealloc__(self): + pass + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['type : ' + str(self.type)] + except ValueError: + str_list += ['type : '] + + + try: + str_list += ['id : ' + str(self.id)] + except ValueError: + str_list += ['id : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def type(self): + return CUcliqueType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : CUcliqueType): + self._pvt_ptr[0].type = int(type) + + @property - def padding(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].padding, 20) - @padding.setter - def padding(self, padding): - if len(padding) != 20: - raise ValueError("padding length must be 20, is " + str(len(padding))) - for i, b in enumerate(padding): - self._pvt_ptr[0].padding[i] = b + def id(self): + return self._pvt_ptr[0].id + @id.setter + def id(self, unsigned int id): + self._pvt_ptr[0].id = id cdef class CUlogicalEndpointFabricHandle_st: @@ -24327,7 +24669,7 @@ cdef class CUlogicalEndpointFabricHandle_st: self._pvt_ptr[0].data[i] = b -cdef class anon_struct25: +cdef class anon_struct26: """ Attributes ---------- @@ -24384,7 +24726,7 @@ cdef class anon_struct25: -cdef class anon_struct26: +cdef class anon_struct27: """ Attributes ---------- @@ -24439,11 +24781,11 @@ cdef class CUlogicalEndpointProp_struct: Type of the logical endpoint defined in CUlogicalEndpointType - unicast : anon_struct25 + unicast : anon_struct26 - multicast : anon_struct26 + multicast : anon_struct27 @@ -24474,10 +24816,10 @@ cdef class CUlogicalEndpointProp_struct: def __init__(self, void_ptr _ptr = 0): pass - self._unicast = anon_struct25(_ptr=self._pvt_ptr) + self._unicast = anon_struct26(_ptr=self._pvt_ptr) - self._multicast = anon_struct26(_ptr=self._pvt_ptr) + self._multicast = anon_struct27(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -24539,7 +24881,7 @@ cdef class CUlogicalEndpointProp_struct: def unicast(self): return self._unicast @unicast.setter - def unicast(self, unicast not None : anon_struct25): + def unicast(self, unicast not None : anon_struct26): string.memcpy(&self._pvt_ptr[0].unicast, unicast.getPtr(), sizeof(self._pvt_ptr[0].unicast)) @@ -24547,7 +24889,7 @@ cdef class CUlogicalEndpointProp_struct: def multicast(self): return self._multicast @multicast.setter - def multicast(self, multicast not None : anon_struct26): + def multicast(self, multicast not None : anon_struct27): string.memcpy(&self._pvt_ptr[0].multicast, multicast.getPtr(), sizeof(self._pvt_ptr[0].multicast)) @@ -24601,6 +24943,13 @@ cdef class CUdevSmResource_st: CUdevSmResourceGroup_flags. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID is set in flags. If the + backfill flag is set, SMs may be assigned from other locality + domains. + + Methods ------- getPtr() @@ -24644,6 +24993,12 @@ cdef class CUdevSmResource_st: except ValueError: str_list += ['flags : '] + + try: + str_list += ['localityDomainId : ' + str(self.localityDomainId)] + except ValueError: + str_list += ['localityDomainId : '] + return '\n'.join(str_list) else: return '' @@ -24680,6 +25035,14 @@ cdef class CUdevSmResource_st: self._pvt_ptr[0].flags = flags + @property + def localityDomainId(self): + return self._pvt_ptr[0].localityDomainId + @localityDomainId.setter + def localityDomainId(self, unsigned int localityDomainId): + self._pvt_ptr[0].localityDomainId = localityDomainId + + cdef class CUdevWorkqueueConfigResource_st: """ Attributes @@ -24777,13 +25140,6 @@ cdef class CUdevWorkqueueConfigResource_st: cdef class CUdevWorkqueueResource_st: """ - Attributes - ---------- - - reserved : bytes - Reserved for future use - - Methods ------- getPtr() @@ -24804,26 +25160,10 @@ cdef class CUdevWorkqueueResource_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 40) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 40: - raise ValueError("reserved length must be 40, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b - - cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: """ Attributes @@ -24848,8 +25188,9 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: CUdevSmResourceGroup_flags. - reserved : list[unsigned int] - + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID is set in flags Methods @@ -24897,9 +25238,9 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['localityDomainId : ' + str(self.localityDomainId)] except ValueError: - str_list += ['reserved : '] + str_list += ['localityDomainId : '] return '\n'.join(str_list) else: @@ -24938,11 +25279,11 @@ cdef class CU_DEV_SM_RESOURCE_GROUP_PARAMS_st: @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved + def localityDomainId(self): + return self._pvt_ptr[0].localityDomainId + @localityDomainId.setter + def localityDomainId(self, unsigned int localityDomainId): + self._pvt_ptr[0].localityDomainId = localityDomainId cdef class CUdevResource_st: @@ -25121,6 +25462,7 @@ cdef class CUdevResource_st: return [CUdevResource_st(_ptr=arr) for arr in arrs] @nextResource.setter def nextResource(self, val): + cdef cydriver.CUdevResource_st* _nextResource_new if len(val) == 0: free(self._nextResource) self._nextResource = NULL @@ -25128,18 +25470,26 @@ cdef class CUdevResource_st: self._pvt_ptr[0].nextResource = NULL else: if self._nextResource_length != len(val): - free(self._nextResource) - self._nextResource = calloc(len(val), sizeof(cydriver.CUdevResource_st)) - if self._nextResource is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _nextResource_new = calloc(len(val), sizeof(cydriver.CUdevResource_st)) + if _nextResource_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUdevResource_st))) + for idx in range(len(val)): + string.memcpy(&_nextResource_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUdevResource_st)) + free(self._nextResource) + self._nextResource = _nextResource_new self._nextResource_length = len(val) - self._pvt_ptr[0].nextResource = self._nextResource - for idx in range(len(val)): - string.memcpy(&self._nextResource[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUdevResource_st)) + self._pvt_ptr[0].nextResource = _nextResource_new + else: + for idx in range(len(val)): + string.memcpy(&self._nextResource[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUdevResource_st)) -cdef class anon_union17: +cdef class anon_union21: """ Attributes ---------- @@ -25219,7 +25569,7 @@ cdef class CUeglFrame_st: Attributes ---------- - frame : anon_union17 + frame : anon_union21 @@ -25273,7 +25623,7 @@ cdef class CUeglFrame_st: def __init__(self, void_ptr _ptr = 0): pass - self._frame = anon_union17(_ptr=self._pvt_ptr) + self._frame = anon_union21(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -25351,7 +25701,7 @@ cdef class CUeglFrame_st: def frame(self): return self._frame @frame.setter - def frame(self, frame not None : anon_union17): + def frame(self, frame not None : anon_union21): string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) @@ -27715,6 +28065,9 @@ def cuCtxSetLimit(limit not None : CUlimit, size_t value): available for persisting L2 cache. This is purely a performance hint and it can be ignored or clamped depending on the platform. + - :py:obj:`~.CU_LIMIT_PER_BLOCK_MEMORY_SIZE` constrols size in bytes of + per-block memory. + Parameters ---------- limit : :py:obj:`~.CUlimit` @@ -27768,17 +28121,24 @@ def cuCtxGetLimit(limit not None : CUlimit): - :py:obj:`~.CU_LIMIT_PERSISTING_L2_CACHE_SIZE`: Persisting L2 cache size in bytes + - :py:obj:`~.CU_LIMIT_PER_BLOCK_MEMORY_SIZE`: Per-block memory in + bytes. + Parameters ---------- limit : :py:obj:`~.CUlimit` - None + Limit to query Returns ------- CUresult - + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_UNSUPPORTED_LIMIT` pvalue : int - None + Returned size of limit + + See Also + -------- + :py:obj:`~.cuCtxCreate`, :py:obj:`~.cuCtxDestroy`, :py:obj:`~.cuCtxGetApiVersion`, :py:obj:`~.cuCtxGetCacheConfig`, :py:obj:`~.cuCtxGetDevice`, :py:obj:`~.cuCtxGetFlags`, :py:obj:`~.cuCtxPopCurrent`, :py:obj:`~.cuCtxPushCurrent`, :py:obj:`~.cuCtxSetCacheConfig`, :py:obj:`~.cuCtxSetLimit`, :py:obj:`~.cuCtxSynchronize`, :py:obj:`~.cudaDeviceGetLimit` """ cdef size_t pvalue = 0 cdef cydriver.CUlimit cylimit = int(limit) @@ -29771,6 +30131,10 @@ def cuKernelGetAttribute(attrib not None : CUfunction_attribute, kernel, dev): The block scheduling policy of a function. The value type is :py:obj:`~.CUclusterSchedulingPolicy`. + - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`: The shared memory + mode of a function. The value type is :py:obj:`~.CUsharedMemoryMode` + / cudaSharedMemoryMode. + Parameters ---------- attrib : :py:obj:`~.CUfunction_attribute` @@ -29886,6 +30250,10 @@ def cuKernelSetAttribute(attrib not None : CUfunction_attribute, int val, kernel The block scheduling policy of a function. The value type is :py:obj:`~.CUclusterSchedulingPolicy`. + - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`: The shared memory + mode of a function. The value type is :py:obj:`~.CUsharedMemoryMode` + / cudaSharedMemoryMode. + Parameters ---------- attrib : :py:obj:`~.CUfunction_attribute` @@ -35029,7 +35397,17 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long :py:obj:`~.CUmemAllocationProp.CUmemLocation.id` must be set to 0. Specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` as the :py:obj:`~.CUmemLocation.type` will result in - :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. Specifying + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN` as the + :py:obj:`~.CUmemLocation.type` will localize the allocation to the + specified locality domain. + :py:obj:`~.CUmemAllocationProp.CUmemLocation.localized`.deviceId must + specify the device ID. + :py:obj:`~.CUmemAllocationProp.CUmemLocation.localized`.localityDomainId + must specify the locality domain ID. The locality domain ID must be a + valid locality domain ID for the specified device. See also + :py:obj:`~.cuDeviceGetAttribute` with the attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT`. Applications that intend to use :py:obj:`~.CU_MEM_HANDLE_TYPE_FABRIC` based memory sharing must ensure: (1) `nvidia-caps-imex-channels` @@ -35077,6 +35455,10 @@ def cuMemCreate(size_t size, prop : Optional[CUmemAllocationProp], unsigned long See Also -------- :py:obj:`~.cuMemRelease`, :py:obj:`~.cuMemExportToShareableHandle`, :py:obj:`~.cuMemImportFromShareableHandle` + + Notes + ----- + On devices with a single locality domain, :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN` and localityDomainId 0 is equivalent to a full-device allocation created with :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`. The resulting allocation will be of type :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`. """ cdef CUmemGenericAllocationHandle handle = CUmemGenericAllocationHandle() cdef cydriver.CUmemAllocationProp* cyprop_ptr = prop._pvt_ptr if prop is not None else NULL @@ -35147,6 +35529,10 @@ def cuMemMap(ptr, size_t size, size_t offset, handle, unsigned long long flags): :py:obj:`~.cuMulticastGetGranularity` with the flag :py:obj:`~.CU_MULTICAST_RECOMMENDED_GRANULARITY`. + When `handle` represents a multicast object, this call may fail if the + devices added via :py:obj:`~.cuMulticastAddDevice` do not belong to the + same clique. + When `handle` represents a multicast object, this call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the @@ -35463,7 +35849,7 @@ def cuMemSetAccess(ptr, size_t size, desc : Optional[tuple[CUmemAccessDesc] | li See Also -------- - :py:obj:`~.cuMemSetAccess`, :py:obj:`~.cuMemCreate`, :py:obj:`~.py`:obj:`~.cuMemMap` + :py:obj:`~.cuMemSetAccess`, :py:obj:`~.cuMemCreate`, :py:obj:`~.cuMemMap` """ desc = [] if desc is None else desc if not all(isinstance(_x, (CUmemAccessDesc,)) for _x in desc): @@ -36028,6 +36414,11 @@ def cuMemPoolGetAttribute(pool, attr not None : CUmemPool_attribute): importing process or pools imported via fabric handles across nodes this will be CU_MEM_LOCATION_TYPE_INVISIBLE. + - :py:obj:`~.CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID`: (value type = int) + The locality domain id for the mempool, if the mempool is localized + to a locality domain. A value of -1 indicates that the mempool is not + localized to a locality domain. + - :py:obj:`~.CU_MEMPOOL_ATTR_MAX_POOL_SIZE`: (value type = :py:obj:`~.cuuint64_t`) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate due @@ -36086,7 +36477,7 @@ def cuMemPoolSetAccess(pool, map : Optional[tuple[CUmemAccessDesc] | list[CUmemA Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` See Also -------- @@ -36183,7 +36574,17 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): the host memory node. Specifying :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT` as the :py:obj:`~.CUmemPoolProps.CUmemLocation.type` will result in - :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. To create a memory pool targeting + a specific device locality domain, applications must set + :py:obj:`~.CUmemPoolProps.CUmemLocation.type` to + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`, + :py:obj:`~.CUmemPoolProps.CUmemLocation.localized`.deviceId must + specify the device ID, and + :py:obj:`~.CUmemPoolProps.CUmemLocation.localized`.localityDomainId + must specify the locality domain ID. The locality domain ID must be a + valid locality domain ID for the specified device. See also + :py:obj:`~.cuDeviceGetAttribute` with the attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT`. By default, the pool's memory will be accessible from the device it is allocated on. In the case of pools created with @@ -36247,6 +36648,8 @@ def cuMemPoolCreate(poolProps : Optional[CUmemPoolProps]): Notes ----- + On devices with a single locality domain, a memory pool created with :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN` and localityDomainId 0 is equivalent to a full-device memory pool created with :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`. The pool will report :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE` for :py:obj:`~.CU_MEMPOOL_ATTR_LOCATION_TYPE` and -1 for :py:obj:`~.CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID`. + Specifying CU_MEM_HANDLE_TYPE_NONE creates a memory pool that will not support IPC. """ cdef CUmemoryPool pool = CUmemoryPool() @@ -36306,13 +36709,16 @@ def cuMemGetDefaultMemPool(location : Optional[CUmemLocation], typename not None The memory location can be of one of :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`, or - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`. The allocation type can be - one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST`, + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, or + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`. The allocation + type can be one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`. When the allocation type is :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`, the location type can also be :py:obj:`~.CU_MEM_LOCATION_TYPE_NONE` to indicate no preferred location for the managed memory pool. + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED` can not be used with + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`. Parameters ---------- @@ -36348,14 +36754,17 @@ def cuMemGetMemPool(location : Optional[CUmemLocation], typename not None : CUme The memory location can be of one of :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, or - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`. The allocation type can be - one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`. The allocation + type can be one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`. When the allocation type is :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`, the location type can also be :py:obj:`~.CU_MEM_LOCATION_TYPE_NONE` to indicate no preferred - location for the managed memory pool. In all other cases, the call - returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + location for the managed memory pool. + :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED` can not be used with + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`. In all other + cases, the call returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE` Returns the last pool provided to :py:obj:`~.cuMemSetMemPool` or :py:obj:`~.cuDeviceSetMemPool` for this location and allocation type or @@ -36375,7 +36784,7 @@ def cuMemGetMemPool(location : Optional[CUmemLocation], typename not None : CUme Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` pool : :py:obj:`~.CUmemoryPool` None @@ -36398,16 +36807,15 @@ def cuMemSetMemPool(location : Optional[CUmemLocation], typename not None : CUme The memory location can be of one of :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` or or - :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`. The allocation type can be - one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` or + :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA`, + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN`. The allocation + type can be one of :py:obj:`~.CU_MEM_ALLOCATION_TYPE_PINNED` or :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`. When the allocation type is :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED`, the location type can also be :py:obj:`~.CU_MEM_LOCATION_TYPE_NONE` to indicate no preferred - location for the managed memory pool. - :py:obj:`~.CU_MEM_ALLOCATION_TYPE_MANAGED` can not be used with - :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_MEMORY_NODE`. In all other - cases, the call returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + location for the managed memory pool. In all other cases, the call + returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool. The location @@ -36433,7 +36841,7 @@ def cuMemSetMemPool(location : Optional[CUmemLocation], typename not None : CUme Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` See Also -------- @@ -36488,6 +36896,10 @@ def cuMemAllocFromPoolAsync(size_t bytesize, pool, hStream): Notes ----- + The specified memory pool may be from a device different than that of the specified `hStream`. + + Basic stream ordering allows future work submitted into the same stream to use the allocation. Stream query, stream synchronize, and CUDA events can be used to guarantee that the allocation operation completes before work submitted in a separate stream runs. + During stream capture, this function results in the creation of an allocation node. In this case, the allocation is owned by the graph instead of the memory pool. The memory pool's properties are used to set the node's creation parameters. """ cdef cydriver.CUstream cyhStream @@ -36718,11 +37130,11 @@ def cuMulticastCreate(prop : Optional[CUmulticastObjectProp]): :py:obj:`~.cuMulticastBindAddr`, or :py:obj:`~.cuMulticastBindAddr_v2`. and can be unbound via :py:obj:`~.cuMulticastUnbind`. The total amount of memory that can be bound per device is specified by - :py:obj:`~.py`:obj:`~.CUmulticastObjectProp.size`. This size must be a - multiple of the value returned by :py:obj:`~.cuMulticastGetGranularity` - with the flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. For best - performance however, the size should be aligned to the value returned - by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CUmulticastObjectProp.size`. This size must be a multiple of + the value returned by :py:obj:`~.cuMulticastGetGranularity` with the + flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. For best performance + however, the size should be aligned to the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. After all participating devices have been added, multicast objects can @@ -36782,6 +37194,10 @@ def cuMulticastAddDevice(mcHandle, dev): be mapped to the multicast object. A call to :py:obj:`~.cuMemMap` will block until all devices have been added. + This call may fail with :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` if the + device specified by `dev` does not belong to the same clique as the + other devices previously added to this multicast object. + Parameters ---------- mcHandle : :py:obj:`~.CUmemGenericAllocationHandle` @@ -36839,6 +37255,27 @@ def cuMulticastBindMem(mcHandle, size_t mcOffset, memHandle, size_t memOffset, s allocated memory. Similarly the `size` + `mcOffset` cannot be larger than the size of the multicast object. + On systems with Rubin+ (SM_107+) GPUs, `memOffset` may be aligned to + 256 instead of the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. In such a case the + `size` + `memOffset` cannot be larger than the size of the allocated + memory. Similarly the `size` + `mcOffset` + the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` cannot be larger than the + size of the than the size of the multicast object. The next available + mcOffset for the next bind will be mcOffset + size + the value returned + by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. + + Also note that the ability to accept a `memOffset` that is not aligned + to the value returned by :py:obj:`~.cuMulticastGetGranularity` with the + flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED` is limited by HW + resources and may result in error + :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` + The memory allocation must have beeen created on one of the devices that was added to the multicast team via :py:obj:`~.cuMulticastAddDevice`. Externally shareable as well as @@ -36848,6 +37285,9 @@ def cuMulticastBindMem(mcHandle, size_t mcOffset, memHandle, size_t memOffset, s call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary system software is not initialized or running. + This call may fail if the devices added via + :py:obj:`~.cuMulticastAddDevice` do not belong to the same clique. + This call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and @@ -36871,7 +37311,7 @@ def cuMulticastBindMem(mcHandle, size_t mcOffset, memHandle, size_t memOffset, s Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` See Also -------- @@ -36921,6 +37361,27 @@ def cuMulticastBindMem_v2(mcHandle, dev, size_t mcOffset, memHandle, size_t memO allocated memory. Similarly the `size` + `mcOffset` cannot be larger than the size of the multicast object. + On systems with Rubin+ (SM_107+) GPUs, `memOffset` may be aligned to + 256 instead of the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. In such a case the + `size` + `memOffset` cannot be larger than the size of the allocated + memory. Similarly the `size` + `mcOffset` + the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` cannot be larger than the + size of the than the size of the multicast object. The next available + mcOffset for the next bind will be mcOffset + size + the value returned + by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM`. + + Also note that the ability to accept a `memOffset` that is not aligned + to the value returned by :py:obj:`~.cuMulticastGetGranularity` with the + flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED` is limited by HW + resources and may result in error + :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` + The memory allocation must have beeen created on one of the devices that was added to the multicast team via :py:obj:`~.cuMulticastAddDevice`. For device memory, i.e., type @@ -36939,6 +37400,9 @@ def cuMulticastBindMem_v2(mcHandle, dev, size_t mcOffset, memHandle, size_t memO call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary system software is not initialized or running. + This call may fail if the devices added via + :py:obj:`~.cuMulticastAddDevice` do not belong to the same clique. + This call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and @@ -36965,7 +37429,7 @@ def cuMulticastBindMem_v2(mcHandle, dev, size_t mcOffset, memHandle, size_t memO Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` See Also -------- @@ -37018,6 +37482,26 @@ def cuMulticastBindAddr(mcHandle, size_t mcOffset, memptr, size_t size, unsigned Similarly the `size` + `mcOffset` cannot be larger than the total size of the multicast object. + On systems with Rubin+ (SM_107+) GPUs, `memptr` may be aligned to 256 + instead of the value returned by :py:obj:`~.cuMulticastGetGranularity` + with the flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. In such a case the + `size` + `memptr` cannot be larger than the size of the allocated + memory. Similarly the `size` + `mcOffset` + the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` cannot be larger than the + size of the than the size of the multicast object. The next available + mcOffset for the next bind will be mcOffset + size + the value returned + by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` + + Also note that the ability to accept a `memptr` that is not aligned to + the value returned by :py:obj:`~.cuMulticastGetGranularity` with the + flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED` is limited by HW + resources and may result in error + :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` + The memory allocation must have beeen created on one of the devices that was added to the multicast team via :py:obj:`~.cuMulticastAddDevice`. Externally shareable as well as @@ -37027,6 +37511,9 @@ def cuMulticastBindAddr(mcHandle, size_t mcOffset, memptr, size_t size, unsigned call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary system software is not initialized or running. + This call may fail if the devices added via + :py:obj:`~.cuMulticastAddDevice` do not belong to the same clique. + This call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and @@ -37048,7 +37535,7 @@ def cuMulticastBindAddr(mcHandle, size_t mcOffset, memptr, size_t size, unsigned Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` See Also -------- @@ -37096,6 +37583,26 @@ def cuMulticastBindAddr_v2(mcHandle, dev, size_t mcOffset, memptr, size_t size, Similarly the `size` + `mcOffset` cannot be larger than the total size of the multicast object. + On systems with Rubin+ (SM_107+) GPUs, `memptr` may be aligned to 256 + instead of the value returned by :py:obj:`~.cuMulticastGetGranularity` + with the flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED`. In such a case the + `size` + `memptr` cannot be larger than the size of the allocated + memory. Similarly the `size` + `mcOffset` + the value returned by + :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` cannot be larger than the + size of the than the size of the multicast object. The next available + mcOffset for the next bind will be mcOffset + size + the value returned + by :py:obj:`~.cuMulticastGetGranularity` with the flag + :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` + + Also note that the ability to accept a `memptr` that is not aligned to + the value returned by :py:obj:`~.cuMulticastGetGranularity` with the + flag :py:obj:`~.CU_MULTICAST_GRANULARITY_MINIMUM` or + :py:obj:`~.CU_MULTICAST_GRANULARITY_RECOMMENDED` is limited by HW + resources and may result in error + :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` + For device memory, i.e., type :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, the memory allocation must have been created on the device specified by `dev`. For host NUMA memory, i.e., type @@ -37112,6 +37619,9 @@ def cuMulticastBindAddr_v2(mcHandle, dev, size_t mcOffset, memptr, size_t size, call may also return CUDA_ERROR_SYSTEM_NOT_READY if the necessary system software is not initialized or running. + This call may fail if the devices added via + :py:obj:`~.cuMulticastAddDevice` do not belong to the same clique. + This call may return CUDA_ERROR_ILLEGAL_STATE if the system configuration is in an illegal state. In such cases, to continue using multicast, verify that the system configuration is in a valid state and @@ -37136,7 +37646,7 @@ def cuMulticastBindAddr_v2(mcHandle, dev, size_t mcOffset, memptr, size_t size, Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY`, :py:obj:`~.CUDA_ERROR_SYSTEM_NOT_READY`, :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE`, :py:obj:`~.CUDA_ERROR_MULTICAST_RESOURCE_FULL` See Also -------- @@ -37266,6 +37776,126 @@ def cuMulticastGetGranularity(prop : Optional[CUmulticastObjectProp], option not return (_CUresult(err), None) return (_CUresult_SUCCESS, granularity) +@cython.embedsignature(True) +def cuDeviceGetFabricClusterUuid(dev): + """ Retrieves the fabric cluster UUID. + + Retrieves the fabric cluster UUID for the given device. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device for which the fabric cluster UUID is requested. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + uuid : :py:obj:`~.CUuuid` + Fabric cluster UUID. + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef CUuuid uuid = CUuuid() + with nogil: + err = cydriver.cuDeviceGetFabricClusterUuid(uuid._pvt_ptr, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, uuid) + +@cython.embedsignature(True) +def cuDeviceGetCliqueCount(dev): + """ Retrieves the number of fabric cliques. + + Retrieves the number of fabric cliques that the device is part of. + + Parameters + ---------- + dev : :py:obj:`~.CUdevice` + Device for which the number of fabric cliques is requested. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + count : int + Number of fabric cliques that the device is part of. + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef size_t count = 0 + with nogil: + err = cydriver.cuDeviceGetCliqueCount(&count, cydev) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, count) + +@cython.embedsignature(True) +def cuDeviceGetCliqueInfo(size_t count, dev): + """ Retrieves fabric clique information. + + Returns the fabric clique information for the cliques that the device + is a part of. User must specify the size of the `cliqueInfo` array in + `count`. The same parameter `count` will return the actual number of + entries updated in the `cliqueInfo` array. + + Parameters + ---------- + count : int + Input: Size of the `cliqueInfo` array. Output: Number of entries + updated in the `cliqueInfo` array. + dev : :py:obj:`~.CUdevice` + Device for which the clique information is requested. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + cliqueInfo : list[:py:obj:`~.CUcliqueInfo`] + Array to store the fabric clique information. + count : int + Input: Size of the `cliqueInfo` array. Output: Number of entries + updated in the `cliqueInfo` array. + """ + cdef cydriver.CUdevice cydev + if dev is None: + pdev = 0 + elif isinstance(dev, (CUdevice,)): + pdev = int(dev) + else: + pdev = int(CUdevice(dev)) + cydev = pdev + cdef size_t _clique_count = count + cdef cydriver.CUcliqueInfo* cycliqueInfo = NULL + pycliqueInfo = [] + if _clique_count != 0: + cycliqueInfo = calloc(_clique_count, sizeof(cydriver.CUcliqueInfo)) + if cycliqueInfo is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(_clique_count) + 'x' + str(sizeof(cydriver.CUcliqueInfo))) + with nogil: + err = cydriver.cuDeviceGetCliqueInfo(cycliqueInfo, &count, cydev) + if CUresult(err) == CUresult(0): + pycliqueInfo = [CUcliqueInfo() for _ in range(count)] + for idx in range(count): + string.memcpy((pycliqueInfo[idx])._pvt_ptr, &cycliqueInfo[idx], sizeof(cydriver.CUcliqueInfo)) + if cycliqueInfo is not NULL: + free(cycliqueInfo) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None, None) + return (_CUresult_SUCCESS, pycliqueInfo, count) + @cython.embedsignature(True) def cuLogicalEndpointIdReserve(count): """ Reserves a range of logical endpoint ids. @@ -37436,6 +38066,10 @@ def cuLogicalEndpointAddDevice(leId, dev): devices have been added. User can query whether the logical endpoint is ready for use via :py:obj:`~.cuLogicalEndpointQuery`. + This call may fail with :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` if the + device specified by `dev` does not belong to the same clique as the + other devices previously added to this multicast logical endpoint. + Parameters ---------- leId : :py:obj:`~.CUlogicalEndpointId` @@ -37966,6 +38600,13 @@ def cuLogicalEndpointQuery(leId, count): of 0 if any logical endpoint ID in the given range is not fully constructed, and a non-zero value otherwise. + Construction of a multicast logical endpoint may fail here if the + devices added via :py:obj:`~.cuLogicalEndpointAddDevice` do not belong + to the same clique. + + This API may return :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` if no devices + are found on which this logical endpoint can be accessed. + Parameters ---------- leId : :py:obj:`~.CUlogicalEndpointId` @@ -38081,13 +38722,12 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): :py:obj:`~.CUDA_POINTER_ATTRIBUTE_P2P_TOKENS`. - `ptr` must be a pointer to memory obtained from - :py:obj:`~.py`:obj:`~.cuMemAlloc()`. Note that p2pToken and - vaSpaceToken are only valid for the lifetime of the source - allocation. A subsequent allocation at the same address may return - completely different tokens. Querying this attribute has a side - effect of setting the attribute - :py:obj:`~.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS` for the region of memory - that `ptr` points to. + :py:obj:`~.cuMemAlloc()`. Note that p2pToken and vaSpaceToken are + only valid for the lifetime of the source allocation. A subsequent + allocation at the same address may return completely different + tokens. Querying this attribute has a side effect of setting the + attribute :py:obj:`~.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS` for the region + of memory that `ptr` points to. - :py:obj:`~.CU_POINTER_ATTRIBUTE_SYNC_MEMOPS`: @@ -38151,6 +38791,11 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): - Returns a bitmask of the allowed handle types for an allocation that may be passed to :py:obj:`~.cuMemExportToShareableHandle`. + - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE`: + + - Returns in `*data` a boolean that indicates if the memory this + pointer is referencing can be used with the GPUDirect RDMA API. + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE`: - Returns in `*data` the handle to the mempool that the allocation was @@ -38162,6 +38807,12 @@ def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): points to memory that is capable to be used for hardware accelerated decompression. + - :py:obj:`~.CU_POINTER_ATTRIBUTE_LOCALITY_DOMAIN_ORDINAL`: + + - Returns in `*data` an integer representing the locality domain + ordinal of the allocation, or -1 if the allocation is not localized + to a locality domain. + Note that for most allocations in the unified virtual address space the host and device pointer for accessing the allocation will be the same. The exceptions to this are @@ -38251,7 +38902,9 @@ def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, :py:obj:`~.CUmemLocation.type` is etiher :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST` OR :py:obj:`~.CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT`, - :py:obj:`~.CUmemLocation.id` will be ignored. + :py:obj:`~.CUmemLocation.id` will be ignored. Prefetching to + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN` locations is + not supported. The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU page size before @@ -38313,7 +38966,7 @@ def cuMemPrefetchAsync(devPtr, size_t count, location not None : CUmemLocation, Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`, See Also -------- @@ -38415,23 +39068,25 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`, then :py:obj:`~.CUmemLocation.id` must be a valid device ordinal and the device must have a non-zero value for the device attribute - :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. Setting - the preferred location does not cause data to migrate to that - location immediately. Instead, it guides the migration policy when a - fault occurs on that memory region. If the data is already in its - preferred location and the faulting processor can establish a mapping - without requiring the data to be migrated, then data migration will - be avoided. On the other hand, if the data is not in its preferred - location or if a direct mapping cannot be established, then it will - be migrated to the processor accessing it. It is important to note - that setting the preferred location does not prevent data prefetching - done using :py:obj:`~.cuMemPrefetchAsync`. Having a preferred - location can override the page thrash detection and resolution logic - in the Unified Memory driver. Normally, if a page is detected to be - constantly thrashing between for example host and device memory, the - page may eventually be pinned to host memory by the Unified Memory - driver. But if the preferred location is set as device memory, then - the page will continue to thrash indefinitely. If + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. A + :py:obj:`~.CUmemLocation.type` of + :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN` is + unsupported. Setting the preferred location does not cause data to + migrate to that location immediately. Instead, it guides the + migration policy when a fault occurs on that memory region. If the + data is already in its preferred location and the faulting processor + can establish a mapping without requiring the data to be migrated, + then data migration will be avoided. On the other hand, if the data + is not in its preferred location or if a direct mapping cannot be + established, then it will be migrated to the processor accessing it. + It is important to note that setting the preferred location does not + prevent data prefetching done using :py:obj:`~.cuMemPrefetchAsync`. + Having a preferred location can override the page thrash detection + and resolution logic in the Unified Memory driver. Normally, if a + page is detected to be constantly thrashing between for example host + and device memory, the page may eventually be pinned to host memory + by the Unified Memory driver. But if the preferred location is set as + device memory, then the page will continue to thrash indefinitely. If :py:obj:`~.CU_MEM_ADVISE_SET_READ_MOSTLY` is also set on this memory region or any subset of it, then the policies associated with that advice will override the policies of this advice, unless read @@ -38522,7 +39177,7 @@ def cuMemAdvise(devPtr, size_t count, advice not None : CUmem_advise, location n Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_DEVICE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` See Also -------- @@ -38865,6 +39520,88 @@ def cuMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[CUdeviceptr] | list free(cyprefetchLocs) return (_CUresult(err),) +@cython.embedsignature(True) +def cuMemGetLocationInfo(ptr, size_t size, size_t summaryGranularity, size_t samplingGranularity, location_out : Optional[CUmemLocation]): + """ Gets residency information for a memory address range. + + Retrieves memory location information for the specified address range + starting at `ptr` with size `size`. The API summarizes the location + information with a granularity specified by `summaryGranularity`. For + each summary region, the API determines the most common location by + sampling memory at intervals defined by `samplingGranularity` within + that region. + + The location information is returned in the `location_out` array, with + one entry per summary region. The total number of locations returned + will be ceil(size/summaryGranularity). The user is expected to allocate + the `location_out` array with sufficient memory. + + For example, with an address range of 1GB, a `summaryGranularity` of + 128MB, and a `samplingGranularity` of 2MB, the function will: + + - Divide the 1GB range into 8 summary regions of 128MB each + + - Within each 128MB region, sample every 2MB to determine the most + common location. If there is a tie a random winner is chosen. + + - Populate the `location_out` array with 8 entries, one for each 128MB + region `summaryGranularity` should be less than or equal to `size` + and greater than 0. `samplingGranularity` should be less than or + equal to `summaryGranularity`. If the `samplingGranularity` is set to + 0, a system dependent value is used as the granularity. In all other + cases, the call returns :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + When the memory is not resident on any processor, the call returns + :py:obj:`~.CUDA_SUCCESS` and the returned location type for that + interval is :py:obj:`~.CU_MEM_LOCATION_TYPE_NONE`. + + The memory range must refer to one of the following: + + - Managed memory allocated via :py:obj:`~.cuMemAllocManaged`, via + :py:obj:`~.cuMemAllocFromPool` from a managed memory pool or declared + via managed variables. + + - System-allocated pageable memory that is not registered via + :py:obj:`~.cuMemHostRegister`. If the memory range does not refer to + one of the above, the call returns + :py:obj:`~.CUDA_ERROR_INVALID_VALUE`. + + All devices on the system must have non-zero value of device attribute + :py:obj:`~.CU_DEVICE_ATTRIBUTE_CONCURRENT_MANAGED_ACCESS`. If not, this + call returns :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED`. + + Parameters + ---------- + ptr : :py:obj:`~.CUdeviceptr` + Starting address of the memory range to query + size : size_t + Size in bytes of the memory range to query + summaryGranularity : size_t + Granularity in bytes at which to summarize location information + samplingGranularity : size_t + Granularity in bytes at which to sample memory within each summary + region + location_out : :py:obj:`~.CUmemLocation` + Array to store location information, one entry per summary region + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + """ + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + pptr = 0 + elif isinstance(ptr, (CUdeviceptr,)): + pptr = int(ptr) + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + cdef cydriver.CUmemLocation* cylocation_out_ptr = location_out._pvt_ptr if location_out is not None else NULL + with nogil: + err = cydriver.cuMemGetLocationInfo(cyptr, size, summaryGranularity, samplingGranularity, cylocation_out_ptr) + return (_CUresult(err),) + @cython.embedsignature(True) def cuMemRangeGetAttribute(size_t dataSize, attribute not None : CUmem_range_attribute, devPtr, size_t count): """ Query an attribute of a given memory range. @@ -39191,6 +39928,8 @@ def cuPointerGetAttributes(unsigned int numAttributes, attributes : Optional[tup - :py:obj:`~.CU_POINTER_ATTRIBUTE_ALLOWED_HANDLE_TYPES` + - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_GPU_DIRECT_RDMA_CAPABLE` + - :py:obj:`~.CU_POINTER_ATTRIBUTE_MEMPOOL_HANDLE` - :py:obj:`~.CU_POINTER_ATTRIBUTE_IS_HW_DECOMPRESS_CAPABLE` @@ -41378,10 +42117,10 @@ def cuImportExternalMemory(memHandleDesc : Optional[CUDA_EXTERNAL_MEMORY_HANDLE_ :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.fd` must be a valid file descriptor referencing a dma_buf object and :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.flags` must be zero. - Importing a dma_buf object is supported only on Tegra Jetson platform - starting with Thor series. Mapping an imported dma_buf object as CUDA - mipmapped array using - :py:obj:`~.cuExternalMemoryGetMappedMipmappedArray` is not supported. + Importing a dma_buf object is supported only on Tegra platform starting + with Thor series. Mapping an imported dma_buf object as CUDA mipmapped + array using :py:obj:`~.cuExternalMemoryGetMappedMipmappedArray` is not + supported. The size of the memory object must be specified in :py:obj:`~.CUDA_EXTERNAL_MEMORY_HANDLE_DESC.size`. @@ -42468,6 +43207,10 @@ def cuFuncGetAttribute(attrib not None : CUfunction_attribute, hfunc): The block scheduling policy of a function. The value type is :py:obj:`~.CUclusterSchedulingPolicy`. + - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`: The shared memory + mode of a function. The value type is :py:obj:`~.CUsharedMemoryMode` + / cudaSharedMemoryMode. + With a few execeptions, function attributes may also be queried on unloaded function handles returned from :py:obj:`~.cuModuleEnumerateFunctions`. @@ -42578,6 +43321,10 @@ def cuFuncSetAttribute(hfunc, attrib not None : CUfunction_attribute, int value) The block scheduling policy of a function. The value type is :py:obj:`~.CUclusterSchedulingPolicy`. + - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE`: The shared memory + mode of a function. The value type is :py:obj:`~.CUsharedMemoryMode` + / cudaSharedMemoryMode. + Parameters ---------- hfunc : :py:obj:`~.CUfunction` @@ -45281,6 +46028,10 @@ def cuGraphEventRecordNodeSetEvent(hNode, event): See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphEventRecordNodeGetEvent`, :py:obj:`~.cuGraphEventWaitNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + + Notes + ----- + This function will reset the node's context to the event's device context. """ cdef cydriver.CUevent cyevent if event is None: @@ -49125,6 +49876,104 @@ def cuGraphAddNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUg return (_CUresult(err), None) return (_CUresult_SUCCESS, phGraphNode) +@cython.embedsignature(True) +def cuGraphAddNode_v3(hGraph, dependencies : Optional[tuple[CUgraphNode] | list[CUgraphNode]], dependencyData : Optional[tuple[CUgraphEdgeData] | list[CUgraphEdgeData]], size_t numDependencies, nodeParams : Optional[CUgraphNodeParams]): + """ Adds a node of arbitrary type to a graph. + + Creates a new node in `hGraph` described by `nodeParams` with + `numDependencies` dependencies specified via `dependencies`. + `numDependencies` may be 0. `dependencies` may be null if + `numDependencies` is 0. `dependencies` may not have any duplicate + entries. + + `nodeParams` is a tagged union. The node type should be specified in + the `typename` field, and type-specific parameters in the corresponding + union member. All unused bytes - that is, `reserved0` and all bytes + past the utilized union member - must be set to zero. It is recommended + to use brace initialization or memset to ensure all bytes are + initialized. + + Note that for some node types, `nodeParams` may contain "out + parameters" which are modified during the call, such as + `nodeParams->alloc.dptr`. + + For kernel nodes, if both the kernel node's :py:obj:`~.CUfunction` and + ctx are non-NULL, the underlying device context of ctx must match the + device context that the :py:obj:`~.CUfunction` was loaded into; + otherwise the call returns :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. + + A handle to the new node will be returned in `phGraphNode`. + + Parameters + ---------- + hGraph : :py:obj:`~.CUgraph` or :py:obj:`~.cudaGraph_t` + Graph to which to add the node + dependencies : list[:py:obj:`~.CUgraphNode`] + Dependencies of the node + dependencyData : list[:py:obj:`~.CUgraphEdgeData`] + Optional edge data for the dependencies. If NULL, the data is + assumed to be default (zeroed) for all dependencies. + numDependencies : size_t + Number of dependencies + nodeParams : :py:obj:`~.CUgraphNodeParams` + Specification of the node + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + phGraphNode : :py:obj:`~.CUgraphNode` + Returns newly created node + + See Also + -------- + :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphNodeSetParams_v2`, :py:obj:`~.cuGraphExecNodeSetParams` + """ + dependencyData = [] if dependencyData is None else dependencyData + if not all(isinstance(_x, (CUgraphEdgeData,)) for _x in dependencyData): + raise TypeError("Argument 'dependencyData' is not instance of type (expected tuple[cydriver.CUgraphEdgeData,] or list[cydriver.CUgraphEdgeData,]") + dependencies = [] if dependencies is None else dependencies + if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): + raise TypeError("Argument 'dependencies' is not instance of type (expected tuple[cydriver.CUgraphNode,] or list[cydriver.CUgraphNode,]") + cdef cydriver.CUgraph cyhGraph + if hGraph is None: + phGraph = 0 + elif isinstance(hGraph, (CUgraph,)): + phGraph = int(hGraph) + else: + phGraph = int(CUgraph(hGraph)) + cyhGraph = phGraph + cdef CUgraphNode phGraphNode = CUgraphNode() + cdef cydriver.CUgraphNode* cydependencies = NULL + if len(dependencies) > 1: + cydependencies = calloc(len(dependencies), sizeof(cydriver.CUgraphNode)) + if cydependencies is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencies)) + 'x' + str(sizeof(cydriver.CUgraphNode))) + else: + for idx in range(len(dependencies)): + cydependencies[idx] = (dependencies[idx])._pvt_ptr[0] + elif len(dependencies) == 1: + cydependencies = (dependencies[0])._pvt_ptr + cdef cydriver.CUgraphEdgeData* cydependencyData = NULL + if len(dependencyData) > 1: + cydependencyData = calloc(len(dependencyData), sizeof(cydriver.CUgraphEdgeData)) + if cydependencyData is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(dependencyData)) + 'x' + str(sizeof(cydriver.CUgraphEdgeData))) + for idx in range(len(dependencyData)): + string.memcpy(&cydependencyData[idx], (dependencyData[idx])._pvt_ptr, sizeof(cydriver.CUgraphEdgeData)) + elif len(dependencyData) == 1: + cydependencyData = (dependencyData[0])._pvt_ptr + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + with nogil: + err = cydriver.cuGraphAddNode_v3(phGraphNode._pvt_ptr, cyhGraph, cydependencies, cydependencyData, numDependencies, cynodeParams_ptr) + if len(dependencies) > 1 and cydependencies is not NULL: + free(cydependencies) + if len(dependencyData) > 1 and cydependencyData is not NULL: + free(cydependencyData) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, phGraphNode) + @cython.embedsignature(True) def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): """ Update a graph node's parameters. @@ -49166,6 +50015,52 @@ def cuGraphNodeSetParams(hNode, nodeParams : Optional[CUgraphNodeParams]): err = cydriver.cuGraphNodeSetParams(cyhNode, cynodeParams_ptr) return (_CUresult(err),) +@cython.embedsignature(True) +def cuGraphNodeSetParams_v2(hNode, nodeParams : Optional[CUgraphNodeParams]): + """ Update a graph node's parameters. + + Sets the parameters of graph node `hNode` to `nodeParams`. The node + type specified by `nodeParams->type` must match the type of `hNode`. + `nodeParams` must be fully initialized and all unused bytes (reserved, + padding) zeroed. + + Modifying parameters is not supported for node types + CU_GRAPH_NODE_TYPE_MEM_ALLOC and CU_GRAPH_NODE_TYPE_MEM_FREE. + + For kernel nodes, if both the kernel node's :py:obj:`~.CUfunction` and + ctx are non-NULL, the underlying device context of ctx must match the + device context that the :py:obj:`~.CUfunction` was loaded into; + otherwise the call returns :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. + + Parameters + ---------- + hNode : :py:obj:`~.CUgraphNode` or :py:obj:`~.cudaGraphNode_t` + Node to set the parameters for + nodeParams : :py:obj:`~.CUgraphNodeParams` + Parameters to copy + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuGraphAddNode_v3`, :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuGraphExecNodeSetParams` + """ + cdef cydriver.CUgraphNode cyhNode + if hNode is None: + phNode = 0 + elif isinstance(hNode, (CUgraphNode,)): + phNode = int(hNode) + else: + phNode = int(CUgraphNode(hNode)) + cyhNode = phNode + cdef cydriver.CUgraphNodeParams* cynodeParams_ptr = nodeParams._pvt_ptr if nodeParams is not None else NULL + with nogil: + err = cydriver.cuGraphNodeSetParams_v2(cyhNode, cynodeParams_ptr) + return (_CUresult(err),) + @cython.embedsignature(True) def cuGraphNodeGetParams(hNode): """ Return a graph node's parameters. @@ -54611,18 +55506,20 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] - `smCount:` must be either 0 or in the range of [2,inputSmCount] where inputSmCount is the amount of SMs the `input` resource has. `smCount` must be a multiple of 2, as well as a multiple of - `coscheduledSmCount`. When assigning SMs to a group (and if results - are expected by having the `result` parameter set), `smCount` - cannot end up with 0 or a value less than `coscheduledSmCount` - otherwise CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION will be - returned. + `coscheduledSmCount` if it is nonzero. When assigning SMs to a + group (and if results are expected by having the `result` parameter + set), `smCount` cannot end up with 0 or a value less than + `coscheduledSmCount` otherwise + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION will be returned. - `coscheduledSmCount:` allows grouping SMs together in order to be able to launch clusters on Compute Architecture 9.0+. The default value may be queried from the device’s :py:obj:`~.CU_DEV_RESOURCE_TYPE_SM` resource (8 on Compute Architecture 9.0+ and 2 otherwise). The maximum is 32 on Compute - Architecture 9.0+ and 2 otherwise. + Architecture 9.0+ and 2 otherwise. A `coscheduledSmCount` of 0 uses + the default value internally while preserving 0 in `groupParams`. + Cluster occupancy will be derived from the resulting SM topology. - `preferredCoscheduledSmCount:` Attempts to merge `coscheduledSmCount` groups into larger groups, in order to make @@ -54631,10 +55528,24 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] - `flags:` - - `CU_DEV_SM_RESOURCE_GROUP_BACKFILL:` lets `smCount` be a non-multiple - of `coscheduledSmCount`, filling the difference between SM count and - already assigned co-scheduled groupings with other SMs. This lets any - resulting group behave similar to the `remainder` group for example. + - `CU_DEV_SM_RESOURCE_GROUP_BACKFILL:` Treats constraints as a hint, + ignoring them if necessary to reach the requested `smCount`. Lets + `smCount` be a non-multiple of `coscheduledSmCount`, filling the + difference between SM count and already assigned co-scheduled groupings + with other SMs. This lets any resulting group behave similar to the + `remainder` group for example. When used with + `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`, backfill fills up to the + requested `smCount` using the target locality domain first, then SMs + not attributed to any locality domain, then SMs from other locality + domains. If no SMs can be found in the requested locality domain, + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. + + - `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID:` Specifies that the SM + partition should be localized to the specified `localityDomainId`. + + - `localityDomainId:` Specifies the locality domain that the + partitioned SMs must be located on. Only valid when + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID is set in flags. Example params and their effect: @@ -54747,8 +55658,11 @@ def cuDevResourceGenerateDesc(resources : Optional[tuple[CUdevResource] | list[C resources are provided in `resources` and they are of type :py:obj:`~.CU_DEV_RESOURCE_TYPE_SM`, they must be outputs (whether `result` or `remaining`) from the same split API instance and have - the same smCoscheduledAlignment values, otherwise - CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. + the same smCoscheduledAlignment and localityDomainId values, + otherwise CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. + + The output descriptor `phDesc` will remain valid for the lifetime of + the process. Note: The API is not supported on 32-bit platforms. @@ -55406,12 +56320,61 @@ def cuCheckpointProcessLock(int pid, args : Optional[CUcheckpointLockArgs]): def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpointArgs]): """ Checkpoint a CUDA process's GPU memory contents. - Checkpoints a CUDA process specified by `pid` that is in the LOCKED - state. The GPU memory contents will be brought into host memory and all - underlying references will be released. Process must be in the LOCKED - state to checkpoint. - - Upon successful return the process will be in the CHECKPOINTED state. + Checkpoints a CUDA process specified by `pid`. The GPU memory contents + will be brought into host memory or mapped onto the calling process's + GPUs for user-defined behavior. Underlying GPU references are released + when checkpointing completes. The process must be in the + :py:obj:`~.CU_PROCESS_STATE_LOCKED` state to checkpoint. + + When :py:obj:`~.CUcheckpointCheckpointArgs.customStorageInfo_out` is + not NULL, all the GPU memory allocated by the process with `pid` will + be mapped onto the calling process's GPUs so the application can copy + the memory to custom storage. Upon return of this call, the pointer + referenced by + :py:obj:`~.CUcheckpointCheckpointArgs.customStorageInfo_out` will point + to a :py:obj:`~.CUcheckpointCustomStorageInfo` struct allocated and + populated by the driver. For each GPU which contains data from the + checkpointed process, there is a corresponding entry in the + :py:obj:`~.CUcheckpointCustomStoragePerDeviceData` array. + + - The device pointers and sizes for the contiguously mapped memory on a + particular GPU are set in the + :py:obj:`~.CUcheckpointCustomStoragePerDeviceData.devPtr` and + :py:obj:`~.CUcheckpointCustomStoragePerDeviceData.size` fields + respectively. + + - A stream belonging to the primary context of a particular GPU is set + in :py:obj:`~.CUcheckpointCustomStoragePerDeviceData.stream`. The + application can use the stream to find out which GPU the memory is + mapped on and to enqueue the copies to custom storage. + + The application is responsible for copying the mapped data from the GPU + at the specified device address to custom storage. When checkpointing + to custom storage, the application is expected to call + :py:obj:`~.cuCheckpointOperationComplete`. The + :py:obj:`~.CUcheckpointCustomStorageInfo.handle` set by this call + should be passed to :py:obj:`~.cuCheckpointOperationComplete` in + `handle`. The driver synchronizes all the streams in + :py:obj:`~.cuCheckpointOperationComplete`, at which point the copy to + custom storage is considered complete. + + When checkpointing to custom storage, the application is expected to + retain primary contexts of all the devices used by the process to be + checkpointed. Otherwise :py:obj:`~.cuCheckpointProcessCheckpoint` will + return :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. Unlike other checkpoint + operations, checkpointing to custom storage requires :py:obj:`~.cuInit` + to have been called before execution. Checkpointing the calling + process's GPU memory to custom storage is not supported. Upon + successful return, the target process will be in the + :py:obj:`~.CU_PROCESS_STATE_CHECKPOINTING` state. + + When :py:obj:`~.CUcheckpointCheckpointArgs.customStorageInfo_out` is + NULL, the GPU memory contents will be brought into host memory by + :py:obj:`~.cuCheckpointProcessCheckpoint`. The application is not + expected to copy the GPU memory contents. The application is also not + expected to call :py:obj:`~.cuCheckpointOperationComplete`. Upon + successful return, the target process will be in the + :py:obj:`~.CU_PROCESS_STATE_CHECKPOINTED` state. Parameters ---------- @@ -55423,7 +56386,7 @@ def cuCheckpointProcessCheckpoint(int pid, args : Optional[CUcheckpointCheckpoin Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` """ cdef cydriver.CUcheckpointCheckpointArgs* cyargs_ptr = args._pvt_ptr if args is not None else NULL with nogil: @@ -55435,18 +56398,67 @@ def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs] """ Restore a CUDA process's GPU memory contents from its last checkpoint. Restores a CUDA process specified by `pid` from its last checkpoint. - Process must be in the CHECKPOINTED state to restore. + Process must be in the :py:obj:`~.CU_PROCESS_STATE_CHECKPOINTED` state + to restore. GPU UUID pairs can be specified in `args` to remap the process old GPUs onto new GPUs. The GPU to restore onto needs to have enough memory and be of the same chip type as the old GPU. If an array of GPU UUID pairs is specified, it must contain every checkpointed GPU. - Upon successful return the process will be in the LOCKED state. - CUDA process restore requires persistence mode to be enabled or :py:obj:`~.cuInit` to have been called before execution. + When :py:obj:`~.CUcheckpointRestoreArgs.customStorageInfo_out` is not + NULL, all the GPU memory to be restored for the process with `pid` will + be mapped onto the calling process's GPUs so the application can copy + the memory back to the GPU. + + Upon return of this call, the pointer referenced by + :py:obj:`~.CUcheckpointRestoreArgs.customStorageInfo_out` will point to + a :py:obj:`~.CUcheckpointCustomStorageInfo` struct allocated and + populated by the driver. For each GPU which contains data from the + restored process, there is a corresponding entry in the + :py:obj:`~.CUcheckpointCustomStoragePerDeviceData` array. + + - The device pointers and sizes for the contiguously mapped memory on a + particular GPU are set in the + :py:obj:`~.CUcheckpointCustomStoragePerDeviceData.devPtr` and + :py:obj:`~.CUcheckpointCustomStoragePerDeviceData.size` fields + respectively. + + - A stream belonging to the primary context of the GPU is set in + :py:obj:`~.CUcheckpointCustomStoragePerDeviceData.stream`. The + application can use the stream to find out which GPU the memory is + mapped on and to enqueue the copies from custom storage back to the + GPU. + + The application is responsible for copying the data from custom storage + to the GPU at the specified device address. When restoring from custom + storage, the application is expected to call + :py:obj:`~.cuCheckpointOperationComplete`. The + :py:obj:`~.CUcheckpointCustomStorageInfo.handle` set by this call + should be passed to :py:obj:`~.cuCheckpointOperationComplete` in + `handle`. The driver synchronizes all the streams in + :py:obj:`~.cuCheckpointOperationComplete`, at which point the copy from + custom storage is considered complete. + + When restoring from custom storage, the application is expected to + retain primary contexts of all the devices used by the process to be + restored. Otherwise :py:obj:`~.cuCheckpointProcessRestore` will return + :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`. Restoring the calling process's + GPU memory from custom storage is not supported. Upon successful + return, the target process will be in the + :py:obj:`~.CU_PROCESS_STATE_RESTORING` state. + + When :py:obj:`~.CUcheckpointRestoreArgs.customStorageInfo_out` is NULL, + the GPU memory contents will be restored from host memory by + :py:obj:`~.cuCheckpointProcessRestore`. The application is not expected + to copy back the GPU memory contents. The application is also not + expected to call :py:obj:`~.cuCheckpointOperationComplete`. Upon + successful return, the target process will be in the + :py:obj:`~.CU_PROCESS_STATE_LOCKED` state. + Parameters ---------- pid : int @@ -55457,7 +56469,7 @@ def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs] Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT` See Also -------- @@ -55468,6 +56480,64 @@ def cuCheckpointProcessRestore(int pid, args : Optional[CUcheckpointRestoreArgs] err = cydriver.cuCheckpointProcessRestore(pid, cyargs_ptr) return (_CUresult(err),) +@cython.embedsignature(True) +def cuCheckpointOperationComplete(handle): + """ Complete a custom-storage checkpoint or restore operation. + + After :py:obj:`~.cuCheckpointProcessCheckpoint` or + :py:obj:`~.cuCheckpointProcessRestore` with custom storage, + :py:obj:`~.cuCheckpointOperationComplete` should be called when the + application has finished or enqueued (on a stream) the required copies + (for checkpoint, GPU mappings to custom storage and for restore, custom + storage into GPU mappings) so the driver can finish the operation. + + :py:obj:`~.cuCheckpointOperationComplete` will first synchronize on the + streams returned by :py:obj:`~.cuCheckpointProcessCheckpoint` or + :py:obj:`~.cuCheckpointProcessRestore`. The driver assumes that the + application has completed copying the memory to or from custom storage + once synchronization is done. None of the streams returned by + :py:obj:`~.cuCheckpointProcessCheckpoint` or + :py:obj:`~.cuCheckpointProcessRestore` should be in stream capture + mode; any attempt to do so would result in + :py:obj:`~.CUDA_ERROR_STREAM_CAPTURE_UNSUPPORTED`. Once the + synchronization is done, :py:obj:`~.cuCheckpointOperationComplete` will + unmap the GPU memory that was mapped on each GPU in a particular + :py:obj:`~.cuCheckpointProcessCheckpoint` or + :py:obj:`~.cuCheckpointProcessRestore` operation. + :py:obj:`~.cuCheckpointOperationComplete` identifies the operation to + be completed using `handle`. This handle is set by + :py:obj:`~.cuCheckpointProcessCheckpoint` or + :py:obj:`~.cuCheckpointProcessRestore`. + + When the call returns successfully, the target process will be in the + :py:obj:`~.CU_PROCESS_STATE_CHECKPOINTED` state when completing a + checkpoint operation or the :py:obj:`~.CU_PROCESS_STATE_LOCKED` state + when completing a restore operation. + + Parameters + ---------- + handle : :py:obj:`~.CUcheckpointOperationHandle` + :py:obj:`~.CUcheckpointCustomStorageInfo.handle` set by a prior + :py:obj:`~.cuCheckpointProcessCheckpoint` or + :py:obj:`~.cuCheckpointProcessRestore` call + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS` :py:obj:`~.CUDA_ERROR_INVALID_VALUE` :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED` :py:obj:`~.CUDA_ERROR_ILLEGAL_STATE` :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + """ + cdef cydriver.CUcheckpointOperationHandle cyhandle + if handle is None: + phandle = 0 + elif isinstance(handle, (CUcheckpointOperationHandle,)): + phandle = int(handle) + else: + phandle = int(CUcheckpointOperationHandle(handle)) + cyhandle = phandle + with nogil: + err = cydriver.cuCheckpointOperationComplete(cyhandle) + return (_CUresult(err),) + @cython.embedsignature(True) def cuCheckpointProcessUnlock(int pid, args : Optional[CUcheckpointUnlockArgs]): """ Unlock a CUDA process to allow CUDA API calls. @@ -57379,6 +58449,21 @@ def sizeof(objType): if objType == CUgraphNodeParams: return sizeof(cydriver.CUgraphNodeParams) + if objType == CUcheckpointCustomStoragePerDeviceData_st: + return sizeof(cydriver.CUcheckpointCustomStoragePerDeviceData_st) + + if objType == CUcheckpointCustomStoragePerDeviceData: + return sizeof(cydriver.CUcheckpointCustomStoragePerDeviceData) + + if objType == CUcheckpointOperationHandle: + return sizeof(cydriver.CUcheckpointOperationHandle) + + if objType == CUcheckpointCustomStorageInfo_st: + return sizeof(cydriver.CUcheckpointCustomStorageInfo_st) + + if objType == CUcheckpointCustomStorageInfo: + return sizeof(cydriver.CUcheckpointCustomStorageInfo) + if objType == CUcheckpointLockArgs_st: return sizeof(cydriver.CUcheckpointLockArgs_st) @@ -57415,6 +58500,12 @@ def sizeof(objType): if objType == CUmemDecompressParams: return sizeof(cydriver.CUmemDecompressParams) + if objType == CUcliqueInfo_st: + return sizeof(cydriver.CUcliqueInfo_st) + + if objType == CUcliqueInfo: + return sizeof(cydriver.CUcliqueInfo) + if objType == CUlogicalEndpointId: return sizeof(cydriver.CUlogicalEndpointId) @@ -57622,6 +58713,10 @@ cdef int _add_native_handle_getters() except?-1: _add_cuda_native_handle_getter(CUlinkState, CUlinkState_getter) + def CUcheckpointOperationHandle_getter(CUcheckpointOperationHandle x): return (x._pvt_ptr[0]) + _add_cuda_native_handle_getter(CUcheckpointOperationHandle, CUcheckpointOperationHandle_getter) + + def CUcoredumpCallbackHandle_getter(CUcoredumpCallbackHandle x): return (x._pvt_ptr[0]) _add_cuda_native_handle_getter(CUcoredumpCallbackHandle, CUcoredumpCallbackHandle_getter) diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pxd b/cuda_bindings/cuda/bindings/nvfatbin.pxd index facc2dfeeb4..aca95c85185 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pxd +++ b/cuda_bindings/cuda/bindings/nvfatbin.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c9d5a4b06ca92f766674f286b75dfc83dff952b5987eb88cdb2773bb28f1ea6a +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f9455d8c181ccdf20d59511bf1236f302dbe9ef903b61035cc1dd971e278caa1 from libc.stdint cimport intptr_t, uint32_t from .cynvfatbin cimport * diff --git a/cuda_bindings/cuda/bindings/nvfatbin.pyx b/cuda_bindings/cuda/bindings/nvfatbin.pyx index 309d2d751df..8e640a970d3 100644 --- a/cuda_bindings/cuda/bindings/nvfatbin.pyx +++ b/cuda_bindings/cuda/bindings/nvfatbin.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=22dd0937e8e243f48b06a24f0c1819e09360d102541b621dfe1cdeaa55c2154c +# This code was automatically generated across versions from 12.4.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a9f06b8372f6c9da9bd1056df4fe0095a6e4a2b85496da6cca9a5496b641a909 # <<<< PREAMBLE CONTENT >>>> @@ -117,7 +118,8 @@ cpdef intptr_t create(options, size_t options_count) except -1: """nvFatbinCreate creates a new handle. Args: - options (object): An array of strings, each containing a single option. It can be: + options (object): An array of strings, each containing a + single option. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address @@ -147,8 +149,10 @@ cpdef add_ptx(intptr_t handle, code, size_t size, arch, identifier, options_cmd_ handle (intptr_t): nvFatbin handle. code (bytes): The PTX code. size (size_t): The size of the PTX code. - arch (str): The numerical architecture that this PTX is for (the XX of any sm_XX, lto_XX, or compute_XX). - identifier (str): Name of the PTX, useful when extracting the fatbin with tools like cuobjdump. + arch (str): The numerical architecture that this PTX is for + (the XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the PTX, useful when extracting the + fatbin with tools like cuobjdump. options_cmd_line (str): Options used during JIT compilation. .. seealso:: `nvFatbinAddPTX` @@ -178,8 +182,10 @@ cpdef add_cubin(intptr_t handle, code, size_t size, arch, identifier): handle (intptr_t): nvFatbin handle. code (bytes): The cubin. size (size_t): The size of the cubin. - arch (str): The numerical architecture that this cubin is for (the XX of any sm_XX, lto_XX, or compute_XX). - identifier (str): Name of the cubin, useful when extracting the fatbin with tools like cuobjdump. + arch (str): The numerical architecture that this cubin is for + (the XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the cubin, useful when extracting + the fatbin with tools like cuobjdump. .. seealso:: `nvFatbinAddCubin` """ @@ -204,8 +210,10 @@ cpdef add_ltoir(intptr_t handle, code, size_t size, arch, identifier, options_cm handle (intptr_t): nvFatbin handle. code (bytes): The LTOIR code. size (size_t): The size of the LTOIR code. - arch (str): The numerical architecture that this LTOIR is for (the XX of any sm_XX, lto_XX, or compute_XX). - identifier (str): Name of the LTOIR, useful when extracting the fatbin with tools like cuobjdump. + arch (str): The numerical architecture that this LTOIR is for + (the XX of any sm_XX, lto_XX, or compute_XX). + identifier (str): Name of the LTOIR, useful when extracting + the fatbin with tools like cuobjdump. options_cmd_line (str): Options used during JIT compilation. .. seealso:: `nvFatbinAddLTOIR` @@ -314,7 +322,8 @@ cpdef add_tile_ir(intptr_t handle, code, size_t size, identifier, options_cmd_li handle (intptr_t): nvFatbin handle. code (bytes): The Tile IR. size (size_t): The size of the Tile IR. - identifier (str): Name of the Tile IR, useful when extracting the fatbin with tools like cuobjdump. + identifier (str): Name of the Tile IR, useful when extracting + the fatbin with tools like cuobjdump. options_cmd_line (str): Options used during JIT compilation. .. seealso:: `nvFatbinAddTileIR` diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pxd b/cuda_bindings/cuda/bindings/nvjitlink.pxd index ac697049088..7c55364f171 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings/cuda/bindings/nvjitlink.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b847666247321f33f1f6b4c5fa92d6ee5d1022389e32eceb03c7458c45ff44ed +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=71dbc31e82ef2e456eb1a686757dc7a9f951a37f7c4d813d8b4ed92956a0f225 from libc.stdint cimport intptr_t, uint32_t from .cynvjitlink cimport * diff --git a/cuda_bindings/cuda/bindings/nvjitlink.pyx b/cuda_bindings/cuda/bindings/nvjitlink.pyx index eee6cc33923..adeb4c40de9 100644 --- a/cuda_bindings/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings/cuda/bindings/nvjitlink.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=85275f1596953f034c156776f8fe4f6e518dbb89ffedda994d8e78bfd9284246 +# This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f722861e068fe62c47806f8fc7757afc24a313435cc14026e1b4f59d1b7f2be7 # <<<< PREAMBLE CONTENT >>>> @@ -117,7 +118,8 @@ cpdef intptr_t create(uint32_t num_options, options) except -1: Args: num_options (uint32_t): Number of options passed. - options (object): Array of size ``num_options`` of option strings. It can be: + options (object): Array of size ``num_options`` of option + strings. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address diff --git a/cuda_bindings/cuda/bindings/nvml.pxd b/cuda_bindings/cuda/bindings/nvml.pxd index acc9900f069..40546231530 100644 --- a/cuda_bindings/cuda/bindings/nvml.pxd +++ b/cuda_bindings/cuda/bindings/nvml.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=eb901f46ca6b6930935726541c32b3ea04f7f46b6090c4c2ad9cb62386c2028b +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f699a98280e825837b6ddf7fb083deca9f51318e2406acefd67481a68b43a165 from libc.stdint cimport intptr_t from .cynvml cimport * @@ -53,14 +54,10 @@ ctypedef nvmlMask255_t Mask255 ctypedef nvmlHostname_v1_t Hostname_v1 ctypedef nvmlUnrepairableMemoryStatus_v1_t UnrepairableMemoryStatus_v1 ctypedef nvmlRusdSettings_v1_t RusdSettings_v1 -ctypedef nvmlBBXTimeData_v1_t BBXTimeData_v1 -ctypedef nvmlRemappedRowsInfo_v2_t RemappedRowsInfo_v2 -ctypedef nvmlAccountingStats_v2_t AccountingStats_v2 ctypedef nvmlPowerValue_v2_t PowerValue_v2 ctypedef nvmlVgpuTypeMaxInstance_v1_t VgpuTypeMaxInstance_v1 ctypedef nvmlVgpuProcessUtilizationSample_t VgpuProcessUtilizationSample ctypedef nvmlGpuFabricInfo_t GpuFabricInfo -ctypedef nvmlCPERCursor_v1_t CPERCursor_v1 ctypedef nvmlSystemEventSetCreateRequest_v1_t SystemEventSetCreateRequest_v1 ctypedef nvmlSystemEventSetFreeRequest_v1_t SystemEventSetFreeRequest_v1 ctypedef nvmlSystemRegisterEventRequest_v1_t SystemRegisterEventRequest_v1 @@ -72,7 +69,6 @@ ctypedef nvmlWorkloadPowerProfileCurrentProfiles_v1_t WorkloadPowerProfileCurren ctypedef nvmlWorkloadPowerProfileRequestedProfiles_v1_t WorkloadPowerProfileRequestedProfiles_v1 ctypedef nvmlWorkloadPowerProfileUpdateProfiles_v1_t WorkloadPowerProfileUpdateProfiles_v1 ctypedef nvmlPRMTLV_v1_t PRMTLV_v1 -ctypedef nvmlGetCPER_v1_t GetCPER_v1 ctypedef nvmlVgpuSchedulerSetState_t VgpuSchedulerSetState ctypedef nvmlGpmMetricsGet_t GpmMetricsGet ctypedef nvmlPRMCounterList_v1_t PRMCounterList_v1 @@ -145,6 +141,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 ############################################################################### @@ -432,3 +433,21 @@ cpdef object device_get_vgpu_scheduler_log_v2(intptr_t device) cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance) cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_state) cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p_scheduler_state) +cpdef 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_wait_v3(intptr_t set, unsigned int timeoutms) +cpdef unsigned int event_set_get_context_count_v1(intptr_t set) except? 0 +cpdef object event_set_get_context_info_v1(intptr_t set, unsigned int index) +cpdef object event_set_get_gpu_operational_event_context_legacy_xid_v1(intptr_t set, unsigned int index) +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 a51d4264363..7b9596cba61 100644 --- a/cuda_bindings/cuda/bindings/nvml.pyx +++ b/cuda_bindings/cuda/bindings/nvml.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e47a16bd9956de14a991ded5d1aef667cdd26a141e27db5b2015b91be6918d3c +# This code was automatically generated across versions from 12.9.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=31a6d5cce1fd1ed7edcffdecc800121cd731148850cb8dfed1134d02f3b4a002 # <<<< PREAMBLE CONTENT >>>> @@ -373,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): @@ -381,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): @@ -398,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): @@ -676,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): """ @@ -732,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): """ @@ -902,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.") @@ -1059,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.') @@ -1133,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): @@ -1154,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): @@ -1172,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): """ @@ -1220,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 `nvmlEventData_v2_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 `nvmlEventData_v2_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 + `nvmlOperationalEventContextInfo_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") @@ -1607,7 +1847,12 @@ 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") - MAX = 289 + 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 @@ -1642,6 +1887,9 @@ class DeviceArch(_FastEnum): ADA = 8 HOPPER = 9 BLACKWELL = 10 + DLA = 11 + DLA2 = 12 + NPU3 = 15 UNKNOWN = 0xFFFFFFFF @@ -1803,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 @@ -1919,6 +2169,7 @@ class NvlinkState(_FastEnum): INACTIVE = 0x0 ACTIVE = 0x1 SLEEP = 0x2 + ACTIVE_TRAFFIC_DISABLED = 0x3 class NvlinkFirmwareUcodeType(_FastEnum): @@ -3263,6 +3514,7 @@ cdef class ProcessInfo: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_info_dtype) @@ -3392,13 +3644,15 @@ cdef class ProcessInfo: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an ProcessInfo 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)") @@ -3408,6 +3662,7 @@ cdef class ProcessInfo: ptr, sizeof(nvmlProcessInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_info_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -3441,6 +3696,7 @@ cdef class ProcessDetail_v1: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_detail_v1_dtype) @@ -3581,13 +3837,15 @@ cdef class ProcessDetail_v1: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an ProcessDetail_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)") @@ -3597,6 +3855,7 @@ cdef class ProcessDetail_v1: ptr, sizeof(nvmlProcessDetail_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_detail_v1_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -4164,6 +4423,7 @@ cdef class BridgeChipInfo: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=bridge_chip_info_dtype) @@ -4271,13 +4531,15 @@ cdef class BridgeChipInfo: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an BridgeChipInfo 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)") @@ -4287,22 +4549,29 @@ cdef class BridgeChipInfo: ptr, sizeof(nvmlBridgeChipInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=bridge_chip_info_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj -value_dtype = _numpy.dtype(( - _numpy.dtype((_numpy.void, sizeof(nvmlValue_t))), - { - "d_val": (_numpy.float64, 0), - "si_val": (_numpy.int32, 0), - "ui_val": (_numpy.uint32, 0), - "ul_val": (_numpy.uint32, 0), - "ull_val": (_numpy.uint64, 0), - "sll_val": (_numpy.int64, 0), - "us_val": (_numpy.uint16, 0), - } - )) +cdef _get_value_dtype_offsets(): + cdef nvmlValue_t pod + return _numpy.dtype({ + 'names': ['d_val', 'si_val', 'ui_val', 'ul_val', 'ull_val', 'sll_val', 'us_val'], + 'formats': [_numpy.float64, _numpy.int32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.int64, _numpy.uint16], + 'offsets': [ + (&(pod.dVal)) - (&pod), + (&(pod.siVal)) - (&pod), + (&(pod.uiVal)) - (&pod), + (&(pod.ulVal)) - (&pod), + (&(pod.ullVal)) - (&pod), + (&(pod.sllVal)) - (&pod), + (&(pod.usVal)) - (&pod), + ], + 'itemsize': sizeof(nvmlValue_t), + }) + +value_dtype = _get_value_dtype_offsets() cdef class Value: """Empty-initialize an instance of `nvmlValue_t`. @@ -4506,164 +4775,178 @@ cdef _get__py_anon_pod0_dtype_offsets(): _py_anon_pod0_dtype = _get__py_anon_pod0_dtype_offsets() cdef class _py_anon_pod0: - """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod0`. + """Empty-initialize an array of `cuda_bindings_nvml__anon_pod0`. + The resulting object is of length `size` and of dtype `_py_anon_pod0_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. .. seealso:: `cuda_bindings_nvml__anon_pod0` """ cdef: - cuda_bindings_nvml__anon_pod0 *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod0)) - if self._ptr == NULL: - raise MemoryError("Error allocating _py_anon_pod0") - self._owner = None - self._owned = True - self._readonly = False - def __dealloc__(self): - cdef cuda_bindings_nvml__anon_pod0 *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=_py_anon_pod0_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(cuda_bindings_nvml__anon_pod0), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(cuda_bindings_nvml__anon_pod0) }" def __repr__(self): - return f"<{__name__}._py_anon_pod0 object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}._py_anon_pod0_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}._py_anon_pod0 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 _py_anon_pod0 other_ - if not isinstance(other, _py_anon_pod0): + cdef object self_data = self._data + if (not isinstance(other, _py_anon_pod0)) 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(cuda_bindings_nvml__anon_pod0)) == 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(cuda_bindings_nvml__anon_pod0), 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(cuda_bindings_nvml__anon_pod0)) - if self._ptr == NULL: - raise MemoryError("Error allocating _py_anon_pod0") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod0)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + _cyb_cpython.PyBuffer_Release(buffer) @property def controller(self): - """int: """ - return (self._ptr[0].controller) + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.controller[0]) + return self._data.controller @controller.setter def controller(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod0 instance is read-only") - self._ptr[0].controller = val + self._data.controller = val @property def default_min_temp(self): - """int: """ - return self._ptr[0].defaultMinTemp + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.default_min_temp[0]) + return self._data.default_min_temp @default_min_temp.setter def default_min_temp(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod0 instance is read-only") - self._ptr[0].defaultMinTemp = val + self._data.default_min_temp = val @property def default_max_temp(self): - """int: """ - return self._ptr[0].defaultMaxTemp + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.default_max_temp[0]) + return self._data.default_max_temp @default_max_temp.setter def default_max_temp(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod0 instance is read-only") - self._ptr[0].defaultMaxTemp = val + self._data.default_max_temp = val @property def current_temp(self): - """int: """ - return self._ptr[0].currentTemp + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.current_temp[0]) + return self._data.current_temp @current_temp.setter def current_temp(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod0 instance is read-only") - self._ptr[0].currentTemp = val + self._data.current_temp = val @property def target(self): - """int: """ - return (self._ptr[0].target) + """Union[~_numpy.int32, int]: """ + if self._data.size == 1: + return int(self._data.target[0]) + return self._data.target @target.setter def target(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod0 instance is read-only") - self._ptr[0].target = val + self._data.target = 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 _py_anon_pod0.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == _py_anon_pod0_dtype: + return _py_anon_pod0.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): """Create an _py_anon_pod0 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod0), _py_anon_pod0) + return _py_anon_pod0.from_data(_numpy.frombuffer(buffer, dtype=_py_anon_pod0_dtype)) @staticmethod def from_data(data): """Create an _py_anon_pod0 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod0_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `_py_anon_pod0_dtype` holding the data. """ - return _cyb_from_data(data, "_py_anon_pod0_dtype", _py_anon_pod0_dtype, _py_anon_pod0) + cdef _py_anon_pod0 obj = _py_anon_pod0.__new__(_py_anon_pod0) + 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 != _py_anon_pod0_dtype: + raise ValueError("data array must be of dtype _py_anon_pod0_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an _py_anon_pod0 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 _py_anon_pod0 obj = _py_anon_pod0.__new__(_py_anon_pod0) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod0)) - if obj._ptr == NULL: - raise MemoryError("Error allocating _py_anon_pod0") - _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod0)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + 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(cuda_bindings_nvml__anon_pod0) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=_py_anon_pod0_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj @@ -4860,6 +5143,7 @@ cdef class ClkMonFaultInfo: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=clk_mon_fault_info_dtype) @@ -4967,13 +5251,15 @@ cdef class ClkMonFaultInfo: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an ClkMonFaultInfo 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)") @@ -4983,6 +5269,7 @@ cdef class ClkMonFaultInfo: ptr, sizeof(nvmlClkMonFaultInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=clk_mon_fault_info_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -5208,6 +5495,7 @@ cdef class ProcessUtilizationSample: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_utilization_sample_dtype) @@ -5359,13 +5647,15 @@ cdef class ProcessUtilizationSample: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an ProcessUtilizationSample 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)") @@ -5375,6 +5665,7 @@ cdef class ProcessUtilizationSample: ptr, sizeof(nvmlProcessUtilizationSample_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_utilization_sample_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -5411,6 +5702,7 @@ cdef class ProcessUtilizationInfo_v1: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=process_utilization_info_v1_dtype) @@ -5584,13 +5876,15 @@ cdef class ProcessUtilizationInfo_v1: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an ProcessUtilizationInfo_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)") @@ -5600,6 +5894,7 @@ cdef class ProcessUtilizationInfo_v1: ptr, sizeof(nvmlProcessUtilizationInfo_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=process_utilization_info_v1_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -6350,153 +6645,167 @@ cdef _get__py_anon_pod1_dtype_offsets(): _py_anon_pod1_dtype = _get__py_anon_pod1_dtype_offsets() cdef class _py_anon_pod1: - """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod1`. + """Empty-initialize an array of `cuda_bindings_nvml__anon_pod1`. + The resulting object is of length `size` and of dtype `_py_anon_pod1_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. .. seealso:: `cuda_bindings_nvml__anon_pod1` """ cdef: - cuda_bindings_nvml__anon_pod1 *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod1)) - if self._ptr == NULL: - raise MemoryError("Error allocating _py_anon_pod1") - self._owner = None - self._owned = True - self._readonly = False - def __dealloc__(self): - cdef cuda_bindings_nvml__anon_pod1 *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=_py_anon_pod1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(cuda_bindings_nvml__anon_pod1), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(cuda_bindings_nvml__anon_pod1) }" def __repr__(self): - return f"<{__name__}._py_anon_pod1 object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}._py_anon_pod1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}._py_anon_pod1 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 _py_anon_pod1 other_ - if not isinstance(other, _py_anon_pod1): + cdef object self_data = self._data + if (not isinstance(other, _py_anon_pod1)) 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(cuda_bindings_nvml__anon_pod1)) == 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(cuda_bindings_nvml__anon_pod1), 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(cuda_bindings_nvml__anon_pod1)) - if self._ptr == NULL: - raise MemoryError("Error allocating _py_anon_pod1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(cuda_bindings_nvml__anon_pod1)) - self._owner = None - self._owned = True - self._readonly = not val.flags.writeable - else: - setattr(self, key, val) + _cyb_cpython.PyBuffer_Release(buffer) @property def b_is_present(self): - """int: """ - return self._ptr[0].bIsPresent + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.b_is_present[0]) + return self._data.b_is_present @b_is_present.setter def b_is_present(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod1 instance is read-only") - self._ptr[0].bIsPresent = val + self._data.b_is_present = val @property def percentage(self): - """int: """ - return self._ptr[0].percentage + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.percentage[0]) + return self._data.percentage @percentage.setter def percentage(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod1 instance is read-only") - self._ptr[0].percentage = val + self._data.percentage = val @property def inc_threshold(self): - """int: """ - return self._ptr[0].incThreshold + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.inc_threshold[0]) + return self._data.inc_threshold @inc_threshold.setter def inc_threshold(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod1 instance is read-only") - self._ptr[0].incThreshold = val + self._data.inc_threshold = val @property def dec_threshold(self): - """int: """ - return self._ptr[0].decThreshold + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.dec_threshold[0]) + return self._data.dec_threshold @dec_threshold.setter def dec_threshold(self, val): - if self._readonly: - raise ValueError("This _py_anon_pod1 instance is read-only") - self._ptr[0].decThreshold = val + self._data.dec_threshold = 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 _py_anon_pod1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == _py_anon_pod1_dtype: + return _py_anon_pod1.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): """Create an _py_anon_pod1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(cuda_bindings_nvml__anon_pod1), _py_anon_pod1) + return _py_anon_pod1.from_data(_numpy.frombuffer(buffer, dtype=_py_anon_pod1_dtype)) @staticmethod def from_data(data): """Create an _py_anon_pod1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `_py_anon_pod1_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `_py_anon_pod1_dtype` holding the data. """ - return _cyb_from_data(data, "_py_anon_pod1_dtype", _py_anon_pod1_dtype, _py_anon_pod1) + cdef _py_anon_pod1 obj = _py_anon_pod1.__new__(_py_anon_pod1) + 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 != _py_anon_pod1_dtype: + raise ValueError("data array must be of dtype _py_anon_pod1_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an _py_anon_pod1 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 _py_anon_pod1 obj = _py_anon_pod1.__new__(_py_anon_pod1) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod1)) - if obj._ptr == NULL: - raise MemoryError("Error allocating _py_anon_pod1") - _cyb_memcpy((obj._ptr), ptr, sizeof(cuda_bindings_nvml__anon_pod1)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + 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(cuda_bindings_nvml__anon_pod1) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=_py_anon_pod1_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj @@ -6856,6 +7165,7 @@ cdef class VgpuProcessUtilizationInfo_v1: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=vgpu_process_utilization_info_v1_dtype) @@ -7049,13 +7359,15 @@ cdef class VgpuProcessUtilizationInfo_v1: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an VgpuProcessUtilizationInfo_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)") @@ -7065,6 +7377,7 @@ cdef class VgpuProcessUtilizationInfo_v1: ptr, sizeof(nvmlVgpuProcessUtilizationInfo_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_process_utilization_info_v1_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -7373,6 +7686,7 @@ cdef class VgpuSchedulerLogEntry: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=vgpu_scheduler_log_entry_dtype) @@ -7524,13 +7838,15 @@ cdef class VgpuSchedulerLogEntry: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an VgpuSchedulerLogEntry 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)") @@ -7540,6 +7856,7 @@ cdef class VgpuSchedulerLogEntry: ptr, sizeof(nvmlVgpuSchedulerLogEntry_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_scheduler_log_entry_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -8960,6 +9277,7 @@ cdef class HwbcEntry: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=hwbc_entry_dtype) @@ -9065,13 +9383,15 @@ cdef class HwbcEntry: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an HwbcEntry 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)") @@ -9081,6 +9401,7 @@ cdef class HwbcEntry: ptr, sizeof(nvmlHwbcEntry_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=hwbc_entry_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -9612,6 +9933,7 @@ cdef class UnitFanInfo: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=unit_fan_info_dtype) @@ -9719,13 +10041,15 @@ cdef class UnitFanInfo: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an UnitFanInfo 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)") @@ -9735,6 +10059,7 @@ cdef class UnitFanInfo: ptr, sizeof(nvmlUnitFanInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=unit_fan_info_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -9944,6 +10269,7 @@ cdef class SystemEventData_v1: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=system_event_data_v1_dtype) @@ -10051,13 +10377,15 @@ cdef class SystemEventData_v1: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an SystemEventData_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)") @@ -10067,6 +10395,7 @@ cdef class SystemEventData_v1: ptr, sizeof(nvmlSystemEventData_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=system_event_data_v1_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -10295,6 +10624,7 @@ cdef class EncoderSessionInfo: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=encoder_session_info_dtype) @@ -10468,13 +10798,15 @@ cdef class EncoderSessionInfo: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an EncoderSessionInfo 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)") @@ -10484,6 +10816,7 @@ cdef class EncoderSessionInfo: ptr, sizeof(nvmlEncoderSessionInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=encoder_session_info_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -10679,6 +11012,7 @@ cdef class FBCSessionInfo: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=fbc_session_info_dtype) @@ -10896,13 +11230,15 @@ cdef class FBCSessionInfo: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an FBCSessionInfo 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)") @@ -10912,6 +11248,7 @@ cdef class FBCSessionInfo: ptr, sizeof(nvmlFBCSessionInfo_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=fbc_session_info_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -13114,6 +13451,7 @@ cdef class GpuInstancePlacement: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=gpu_instance_placement_dtype) @@ -13221,13 +13559,15 @@ cdef class GpuInstancePlacement: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an GpuInstancePlacement 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)") @@ -13237,6 +13577,7 @@ cdef class GpuInstancePlacement: ptr, sizeof(nvmlGpuInstancePlacement_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=gpu_instance_placement_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -13546,6 +13887,7 @@ cdef class ComputeInstancePlacement: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=compute_instance_placement_dtype) @@ -13653,13 +13995,15 @@ cdef class ComputeInstancePlacement: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an ComputeInstancePlacement 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)") @@ -13669,6 +14013,7 @@ cdef class ComputeInstancePlacement: ptr, sizeof(nvmlComputeInstancePlacement_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=compute_instance_placement_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -14679,6 +15024,7 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=ecc_sram_unique_uncorrected_error_entry_v1_dtype) @@ -14841,13 +15187,15 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an EccSramUniqueUncorrectedErrorEntry_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)") @@ -14857,6 +15205,7 @@ cdef class EccSramUniqueUncorrectedErrorEntry_v1: ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorEntry_v1_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=ecc_sram_unique_uncorrected_error_entry_v1_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -14948,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 @@ -15230,153 +15579,167 @@ cdef _get_nvlink_firmware_version_dtype_offsets(): nvlink_firmware_version_dtype = _get_nvlink_firmware_version_dtype_offsets() cdef class NvlinkFirmwareVersion: - """Empty-initialize an instance of `nvmlNvlinkFirmwareVersion_t`. + """Empty-initialize an array of `nvmlNvlinkFirmwareVersion_t`. + The resulting object is of length `size` and of dtype `nvlink_firmware_version_dtype`. + If default-constructed, the instance represents a single struct. + Args: + size (int): number of structs, default=1. .. seealso:: `nvmlNvlinkFirmwareVersion_t` """ cdef: - nvmlNvlinkFirmwareVersion_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareVersion_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareVersion") - self._owner = None - self._owned = True - self._readonly = False - - def __dealloc__(self): - cdef nvmlNvlinkFirmwareVersion_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=nvlink_firmware_version_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlNvlinkFirmwareVersion_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlNvlinkFirmwareVersion_t) }" def __repr__(self): - return f"<{__name__}.NvlinkFirmwareVersion object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.NvlinkFirmwareVersion_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.NvlinkFirmwareVersion 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 NvlinkFirmwareVersion other_ - if not isinstance(other, NvlinkFirmwareVersion): + cdef object self_data = self._data + if (not isinstance(other, NvlinkFirmwareVersion)) 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(nvmlNvlinkFirmwareVersion_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(nvmlNvlinkFirmwareVersion_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(nvmlNvlinkFirmwareVersion_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareVersion") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareVersion_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 ucode_type(self): - """int: """ - return self._ptr[0].ucodeType + """Union[~_numpy.uint8, int]: """ + if self._data.size == 1: + return int(self._data.ucode_type[0]) + return self._data.ucode_type @ucode_type.setter def ucode_type(self, val): - if self._readonly: - raise ValueError("This NvlinkFirmwareVersion instance is read-only") - self._ptr[0].ucodeType = val + self._data.ucode_type = val @property def major(self): - """int: """ - return self._ptr[0].major + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.major[0]) + return self._data.major @major.setter def major(self, val): - if self._readonly: - raise ValueError("This NvlinkFirmwareVersion instance is read-only") - self._ptr[0].major = val + self._data.major = val @property def minor(self): - """int: """ - return self._ptr[0].minor + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.minor[0]) + return self._data.minor @minor.setter def minor(self, val): - if self._readonly: - raise ValueError("This NvlinkFirmwareVersion instance is read-only") - self._ptr[0].minor = val + self._data.minor = val @property def sub_minor(self): - """int: """ - return self._ptr[0].subMinor + """Union[~_numpy.uint32, int]: """ + if self._data.size == 1: + return int(self._data.sub_minor[0]) + return self._data.sub_minor @sub_minor.setter def sub_minor(self, val): - if self._readonly: - raise ValueError("This NvlinkFirmwareVersion instance is read-only") - self._ptr[0].subMinor = val + self._data.sub_minor = 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 NvlinkFirmwareVersion.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == nvlink_firmware_version_dtype: + return NvlinkFirmwareVersion.from_data(out) + return out + + def __setitem__(self, key, val): + self._data[key] = val @staticmethod def from_buffer(buffer): """Create an NvlinkFirmwareVersion instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkFirmwareVersion_t), NvlinkFirmwareVersion) + return NvlinkFirmwareVersion.from_data(_numpy.frombuffer(buffer, dtype=nvlink_firmware_version_dtype)) @staticmethod def from_data(data): """Create an NvlinkFirmwareVersion instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `nvlink_firmware_version_dtype` holding the data. + data (_numpy.ndarray): a 1D array of dtype `nvlink_firmware_version_dtype` holding the data. """ - return _cyb_from_data(data, "nvlink_firmware_version_dtype", nvlink_firmware_version_dtype, NvlinkFirmwareVersion) + cdef NvlinkFirmwareVersion obj = NvlinkFirmwareVersion.__new__(NvlinkFirmwareVersion) + 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 != nvlink_firmware_version_dtype: + raise ValueError("data array must be of dtype nvlink_firmware_version_dtype") + obj._data = data.view(_numpy.recarray) + + return obj @staticmethod - def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an NvlinkFirmwareVersion 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 NvlinkFirmwareVersion obj = NvlinkFirmwareVersion.__new__(NvlinkFirmwareVersion) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareVersion_t)) - if obj._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareVersion") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareVersion_t)) - obj._owner = None - obj._owned = True - else: - obj._ptr = ptr - obj._owner = owner - obj._owned = False - obj._readonly = readonly + 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(nvmlNvlinkFirmwareVersion_t) * size, flag) + data = _numpy.ndarray(size, buffer=buf, dtype=nvlink_firmware_version_dtype) + obj._data = data.view(_numpy.recarray) + obj._owner = owner + return obj @@ -15709,6 +16072,7 @@ cdef class VgpuSchedulerLogEntry_v2: """ cdef: readonly object _data + object _owner def __init__(self, size=1): arr = _numpy.empty(size, dtype=vgpu_scheduler_log_entry_v2_dtype) @@ -15871,13 +16235,15 @@ cdef class VgpuSchedulerLogEntry_v2: return obj @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): """Create an VgpuSchedulerLogEntry_v2 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. size (int): number of structs, default=1. readonly (bool): whether the data is read-only (to the user). default is `False`. + 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)") @@ -15887,6 +16253,7 @@ cdef class VgpuSchedulerLogEntry_v2: ptr, sizeof(nvmlVgpuSchedulerLogEntry_v2_t) * size, flag) data = _numpy.ndarray(size, buffer=buf, dtype=vgpu_scheduler_log_entry_v2_dtype) obj._data = data.view(_numpy.recarray) + obj._owner = owner return obj @@ -16058,49 +16425,48 @@ cdef class VgpuSchedulerState_v2: return obj -cdef _get_excluded_device_info_dtype_offsets(): - cdef nvmlExcludedDeviceInfo_t pod +cdef _get_bbx_time_data_v1_dtype_offsets(): + cdef nvmlBBXTimeData_v1_t pod return _numpy.dtype({ - 'names': ['pci_info', 'uuid'], - 'formats': [pci_info_dtype, (_numpy.int8, 80)], + 'names': ['time_run'], + 'formats': [_numpy.uint32], 'offsets': [ - (&(pod.pciInfo)) - (&pod), - (&(pod.uuid)) - (&pod), + (&(pod.timeRun)) - (&pod), ], - 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), + 'itemsize': sizeof(nvmlBBXTimeData_v1_t), }) -excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() +bbx_time_data_v1_dtype = _get_bbx_time_data_v1_dtype_offsets() -cdef class ExcludedDeviceInfo: - """Empty-initialize an instance of `nvmlExcludedDeviceInfo_t`. +cdef class BBXTimeData_v1: + """Empty-initialize an instance of `nvmlBBXTimeData_v1_t`. - .. seealso:: `nvmlExcludedDeviceInfo_t` + .. seealso:: `nvmlBBXTimeData_v1_t` """ cdef: - nvmlExcludedDeviceInfo_t *_ptr + nvmlBBXTimeData_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlExcludedDeviceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlBBXTimeData_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ExcludedDeviceInfo") + raise MemoryError("Error allocating BBXTimeData_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlExcludedDeviceInfo_t *ptr + cdef nvmlBBXTimeData_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__}.BBXTimeData_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -16114,24 +16480,24 @@ cdef class ExcludedDeviceInfo: return (self._ptr) def __eq__(self, other): - cdef ExcludedDeviceInfo other_ - if not isinstance(other, ExcludedDeviceInfo): + cdef BBXTimeData_v1 other_ + if not isinstance(other, BBXTimeData_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlExcludedDeviceInfo_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBBXTimeData_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(nvmlBBXTimeData_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(nvmlBBXTimeData_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 BBXTimeData_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBBXTimeData_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -16139,49 +16505,33 @@ cdef class ExcludedDeviceInfo: setattr(self, key, val) @property - def pci_info(self): - """PciInfo: """ - return PciInfo.from_ptr(&(self._ptr[0].pciInfo), self._readonly, self) - - @pci_info.setter - def pci_info(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) - - @property - def uuid(self): - """~_numpy.int8: (array of length 80).""" - return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) + def time_run(self): + """int: [out] Cumulative number of seconds the GPU has had the driver loaded""" + return self._ptr[0].timeRun - @uuid.setter - def uuid(self, val): + @time_run.setter + def time_run(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 BBXTimeData_v1 instance is read-only") + self._ptr[0].timeRun = 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 BBXTimeData_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlBBXTimeData_v1_t), BBXTimeData_v1) @staticmethod def from_data(data): - """Create an ExcludedDeviceInfo instance wrapping the given NumPy array. + """Create an BBXTimeData_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 `bbx_time_data_v1_dtype` holding the data. """ - return _cyb_from_data(data, "excluded_device_info_dtype", excluded_device_info_dtype, ExcludedDeviceInfo) + return _cyb_from_data(data, "bbx_time_data_v1_dtype", bbx_time_data_v1_dtype, BBXTimeData_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an ExcludedDeviceInfo instance wrapping the given pointer. + """Create an BBXTimeData_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -16190,69 +16540,69 @@ cdef class ExcludedDeviceInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef ExcludedDeviceInfo obj = ExcludedDeviceInfo.__new__(ExcludedDeviceInfo) + cdef BBXTimeData_v1 obj = BBXTimeData_v1.__new__(BBXTimeData_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlBBXTimeData_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ExcludedDeviceInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlExcludedDeviceInfo_t)) + raise MemoryError("Error allocating BBXTimeData_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBBXTimeData_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_process_detail_list_v1_dtype_offsets(): - cdef nvmlProcessDetailList_v1_t pod +cdef _get_remapped_rows_info_v2_dtype_offsets(): + cdef nvmlRemappedRowsInfo_v2_t pod return _numpy.dtype({ - 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], + 'names': ['corr_active_remaps', 'corr_inactive_remaps', 'unc_active_remaps', 'unc_inactive_remaps', 'b_pending', 'b_failure_occurred'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.mode)) - (&pod), - (&(pod.numProcArrayEntries)) - (&pod), - (&(pod.procArray)) - (&pod), + (&(pod.corrActiveRemaps)) - (&pod), + (&(pod.corrInactiveRemaps)) - (&pod), + (&(pod.uncActiveRemaps)) - (&pod), + (&(pod.uncInactiveRemaps)) - (&pod), + (&(pod.bPending)) - (&pod), + (&(pod.bFailureOccurred)) - (&pod), ], - 'itemsize': sizeof(nvmlProcessDetailList_v1_t), + 'itemsize': sizeof(nvmlRemappedRowsInfo_v2_t), }) -process_detail_list_v1_dtype = _get_process_detail_list_v1_dtype_offsets() +remapped_rows_info_v2_dtype = _get_remapped_rows_info_v2_dtype_offsets() -cdef class ProcessDetailList_v1: - """Empty-initialize an instance of `nvmlProcessDetailList_v1_t`. +cdef class RemappedRowsInfo_v2: + """Empty-initialize an instance of `nvmlRemappedRowsInfo_v2_t`. - .. seealso:: `nvmlProcessDetailList_v1_t` + .. seealso:: `nvmlRemappedRowsInfo_v2_t` """ cdef: - nvmlProcessDetailList_v1_t *_ptr + nvmlRemappedRowsInfo_v2_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(nvmlRemappedRowsInfo_v2_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ProcessDetailList_v1") + raise MemoryError("Error allocating RemappedRowsInfo_v2") self._owner = None self._owned = True self._readonly = False - self._refs = {} def __dealloc__(self): - cdef nvmlProcessDetailList_v1_t *ptr + cdef nvmlRemappedRowsInfo_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__}.ProcessDetailList_v1 object at {hex(id(self))}>" + return f"<{__name__}.RemappedRowsInfo_v2 object at {hex(id(self))}>" @property def ptr(self): @@ -16266,24 +16616,24 @@ cdef class ProcessDetailList_v1: return (self._ptr) def __eq__(self, other): - cdef ProcessDetailList_v1 other_ - if not isinstance(other, ProcessDetailList_v1): + cdef RemappedRowsInfo_v2 other_ + if not isinstance(other, RemappedRowsInfo_v2): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlProcessDetailList_v1_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlRemappedRowsInfo_v2_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(nvmlRemappedRowsInfo_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(nvmlProcessDetailList_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlRemappedRowsInfo_v2_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 RemappedRowsInfo_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlRemappedRowsInfo_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -16291,60 +16641,88 @@ 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 corr_active_remaps(self): + """int: Number of active row remappings due to correctable errors.""" + return self._ptr[0].corrActiveRemaps - @version.setter - def version(self, val): + @corr_active_remaps.setter + def corr_active_remaps(self, val): if self._readonly: - raise ValueError("This ProcessDetailList_v1 instance is read-only") - self._ptr[0].version = val + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].corrActiveRemaps = val @property - def mode(self): - """int: Process mode, One of `nvmlProcessMode_t`.""" - return self._ptr[0].mode + def corr_inactive_remaps(self): + """int: Number of inactive row remappings due to correctable errors.""" + return self._ptr[0].corrInactiveRemaps - @mode.setter - def mode(self, val): + @corr_inactive_remaps.setter + def corr_inactive_remaps(self, val): if self._readonly: - raise ValueError("This ProcessDetailList_v1 instance is read-only") - self._ptr[0].mode = val + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].corrInactiveRemaps = 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) + def unc_active_remaps(self): + """int: Number of active row remappings due to uncorrectable errors.""" + return self._ptr[0].uncActiveRemaps - @proc_array.setter - def proc_array(self, val): + @unc_active_remaps.setter + def unc_active_remaps(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 RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].uncActiveRemaps = val + + @property + def unc_inactive_remaps(self): + """int: Number of inactive row remappings due to uncorrectable errors.""" + return self._ptr[0].uncInactiveRemaps + + @unc_inactive_remaps.setter + def unc_inactive_remaps(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].uncInactiveRemaps = val + + @property + def b_pending(self): + """int: Whether or not there is any pending row remapping; 0 indicates not pending, 1 indicates pending.""" + return self._ptr[0].bPending + + @b_pending.setter + def b_pending(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].bPending = val + + @property + def b_failure_occurred(self): + """int: Whether or not there's any row remapping failure in the past; 0 indicates no failure, 1 indicates failure occurred.""" + return self._ptr[0].bFailureOccurred + + @b_failure_occurred.setter + def b_failure_occurred(self, val): + if self._readonly: + raise ValueError("This RemappedRowsInfo_v2 instance is read-only") + self._ptr[0].bFailureOccurred = 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 RemappedRowsInfo_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlRemappedRowsInfo_v2_t), RemappedRowsInfo_v2) @staticmethod def from_data(data): - """Create an ProcessDetailList_v1 instance wrapping the given NumPy array. + """Create an RemappedRowsInfo_v2 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 `remapped_rows_info_v2_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, "remapped_rows_info_v2_dtype", remapped_rows_info_v2_dtype, RemappedRowsInfo_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an ProcessDetailList_v1 instance wrapping the given pointer. + """Create an RemappedRowsInfo_v2 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -16353,66 +16731,73 @@ 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 RemappedRowsInfo_v2 obj = RemappedRowsInfo_v2.__new__(RemappedRowsInfo_v2) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlRemappedRowsInfo_v2_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ProcessDetailList_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlProcessDetailList_v1_t)) + raise MemoryError("Error allocating RemappedRowsInfo_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlRemappedRowsInfo_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_bridge_chip_hierarchy_dtype_offsets(): - cdef nvmlBridgeChipHierarchy_t pod +cdef _get_accounting_stats_v2_dtype_offsets(): + cdef nvmlAccountingStats_v2_t pod return _numpy.dtype({ - 'names': ['bridge_count', 'bridge_chip_info'], - 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], + 'names': ['pid', 'is_running', 'gpu_utilization', 'memory_utilization', 'max_memory_usage', 'sample_count', 'sum_gpu_util', 'sum_fb_util', 'time', 'start_time'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint64, _numpy.uint32, _numpy.uint64, _numpy.uint64, _numpy.uint64, _numpy.uint64], 'offsets': [ - (&(pod.bridgeCount)) - (&pod), - (&(pod.bridgeChipInfo)) - (&pod), - ], - 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), - }) - -bridge_chip_hierarchy_dtype = _get_bridge_chip_hierarchy_dtype_offsets() - -cdef class BridgeChipHierarchy: - """Empty-initialize an instance of `nvmlBridgeChipHierarchy_t`. + (&(pod.pid)) - (&pod), + (&(pod.isRunning)) - (&pod), + (&(pod.gpuUtilization)) - (&pod), + (&(pod.memoryUtilization)) - (&pod), + (&(pod.maxMemoryUsage)) - (&pod), + (&(pod.sampleCount)) - (&pod), + (&(pod.sumGpuUtil)) - (&pod), + (&(pod.sumFbUtil)) - (&pod), + (&(pod.time)) - (&pod), + (&(pod.startTime)) - (&pod), + ], + 'itemsize': sizeof(nvmlAccountingStats_v2_t), + }) +accounting_stats_v2_dtype = _get_accounting_stats_v2_dtype_offsets() - .. seealso:: `nvmlBridgeChipHierarchy_t` +cdef class AccountingStats_v2: + """Empty-initialize an instance of `nvmlAccountingStats_v2_t`. + + + .. seealso:: `nvmlAccountingStats_v2_t` """ cdef: - nvmlBridgeChipHierarchy_t *_ptr + nvmlAccountingStats_v2_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlAccountingStats_v2_t)) if self._ptr == NULL: - raise MemoryError("Error allocating BridgeChipHierarchy") + raise MemoryError("Error allocating AccountingStats_v2") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlBridgeChipHierarchy_t *ptr + cdef nvmlAccountingStats_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__}.BridgeChipHierarchy object at {hex(id(self))}>" + return f"<{__name__}.AccountingStats_v2 object at {hex(id(self))}>" @property def ptr(self): @@ -16426,24 +16811,24 @@ cdef class BridgeChipHierarchy: return (self._ptr) def __eq__(self, other): - cdef BridgeChipHierarchy other_ - if not isinstance(other, BridgeChipHierarchy): + cdef AccountingStats_v2 other_ + if not isinstance(other, AccountingStats_v2): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlBridgeChipHierarchy_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlAccountingStats_v2_t)) == 0) def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): - _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlBridgeChipHierarchy_t), self._readonly) + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlAccountingStats_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(nvmlBridgeChipHierarchy_t)) + self._ptr = _cyb_malloc(sizeof(nvmlAccountingStats_v2_t)) if self._ptr == NULL: - raise MemoryError("Error allocating BridgeChipHierarchy") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlBridgeChipHierarchy_t)) + raise MemoryError("Error allocating AccountingStats_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlAccountingStats_v2_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -16451,39 +16836,132 @@ cdef class BridgeChipHierarchy: setattr(self, key, val) @property - def bridge_chip_info(self): - """BridgeChipInfo: """ - return BridgeChipInfo.from_ptr(&(self._ptr[0].bridgeChipInfo), self._ptr[0].bridgeCount, self._readonly) + def pid(self): + """int: Process Id of the target process to query stats for.""" + return self._ptr[0].pid - @bridge_chip_info.setter - def bridge_chip_info(self, val): + @pid.setter + def pid(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) + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].pid = val + + @property + def is_running(self): + """int: Flag to represent if the process is running (1 for running, 0 for terminated).""" + return self._ptr[0].isRunning + + @is_running.setter + def is_running(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].isRunning = val + + @property + def gpu_utilization(self): + """int: Percent of time over the process's lifetime during which one or more kernels was executing on the GPU. Utilization stats just like returned by nvmlDeviceGetUtilizationRates but for the life time of a process (not just the last sample period). Set to NVML_VALUE_NOT_AVAILABLE if nvmlDeviceGetUtilizationRates is not supported""" + return self._ptr[0].gpuUtilization + + @gpu_utilization.setter + def gpu_utilization(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].gpuUtilization = val + + @property + def memory_utilization(self): + """int: Percent of time over the process's lifetime during which global (device) memory was being read or written. Set to NVML_VALUE_NOT_AVAILABLE if nvmlDeviceGetUtilizationRates is not supported""" + return self._ptr[0].memoryUtilization + + @memory_utilization.setter + def memory_utilization(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].memoryUtilization = val + + @property + def max_memory_usage(self): + """int: Maximum total memory in bytes that was ever allocated by the process. Set to NVML_VALUE_NOT_AVAILABLE if nvmlProcessInfo_t->usedGpuMemory is not supported""" + return self._ptr[0].maxMemoryUsage + + @max_memory_usage.setter + def max_memory_usage(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].maxMemoryUsage = val + + @property + def sample_count(self): + """int: The sample counts since the process starts.""" + return self._ptr[0].sampleCount + + @sample_count.setter + def sample_count(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].sampleCount = val + + @property + def sum_gpu_util(self): + """int: The sum of process's GR engine utilization in unit of pct * 100.""" + return self._ptr[0].sumGpuUtil + + @sum_gpu_util.setter + def sum_gpu_util(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].sumGpuUtil = val + + @property + def sum_fb_util(self): + """int: The sum of process's FB bandwidth utilization in unit of pct * 100.""" + return self._ptr[0].sumFbUtil + + @sum_fb_util.setter + def sum_fb_util(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].sumFbUtil = val + + @property + def time(self): + """int: Amount of time in ms during which the compute context was active. The time is reported as 0 if the process is not terminated""" + return self._ptr[0].time + + @time.setter + def time(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].time = val + + @property + def start_time(self): + """int: CPU Timestamp in usec representing start time for the process.""" + return self._ptr[0].startTime + + @start_time.setter + def start_time(self, val): + if self._readonly: + raise ValueError("This AccountingStats_v2 instance is read-only") + self._ptr[0].startTime = 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 AccountingStats_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlAccountingStats_v2_t), AccountingStats_v2) @staticmethod def from_data(data): - """Create an BridgeChipHierarchy instance wrapping the given NumPy array. + """Create an AccountingStats_v2 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 single-element array of dtype `accounting_stats_v2_dtype` holding the data. """ - return _cyb_from_data(data, "bridge_chip_hierarchy_dtype", bridge_chip_hierarchy_dtype, BridgeChipHierarchy) + return _cyb_from_data(data, "accounting_stats_v2_dtype", accounting_stats_v2_dtype, AccountingStats_v2) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an BridgeChipHierarchy instance wrapping the given pointer. + """Create an AccountingStats_v2 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -16492,622 +16970,559 @@ cdef class BridgeChipHierarchy: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef BridgeChipHierarchy obj = BridgeChipHierarchy.__new__(BridgeChipHierarchy) + cdef AccountingStats_v2 obj = AccountingStats_v2.__new__(AccountingStats_v2) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlAccountingStats_v2_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating BridgeChipHierarchy") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlBridgeChipHierarchy_t)) + raise MemoryError("Error allocating AccountingStats_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlAccountingStats_v2_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_sample_dtype_offsets(): - cdef nvmlSample_t pod +cdef _get_cper_cursor_v1_dtype_offsets(): + cdef nvmlCPERCursor_v1_t pod return _numpy.dtype({ - 'names': ['time_stamp', 'sample_value'], - 'formats': [_numpy.uint64, value_dtype], + 'names': ['cper_type_mask', 'uuid', 'handle'], + 'formats': [_numpy.uint32, (_numpy.int8, 80), _numpy.uint64], 'offsets': [ - (&(pod.timeStamp)) - (&pod), - (&(pod.sampleValue)) - (&pod), + (&(pod.cperTypeMask)) - (&pod), + (&(pod.uuid)) - (&pod), + (&(pod.handle)) - (&pod), ], - 'itemsize': sizeof(nvmlSample_t), + 'itemsize': sizeof(nvmlCPERCursor_v1_t), }) -sample_dtype = _get_sample_dtype_offsets() +cper_cursor_v1_dtype = _get_cper_cursor_v1_dtype_offsets() -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. +cdef class CPERCursor_v1: + """Empty-initialize an instance of `nvmlCPERCursor_v1_t`. - Args: - size (int): number of structs, default=1. - .. seealso:: `nvmlSample_t` + .. seealso:: `nvmlCPERCursor_v1_t` """ cdef: - readonly object _data + nvmlCPERCursor_v1_t *_ptr + object _owner + bint _owned + bint _readonly - 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 __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlCPERCursor_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating CPERCursor_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlCPERCursor_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) def __repr__(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))}>" + return f"<{__name__}.CPERCursor_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 + return (self._ptr) cdef intptr_t _get_ptr(self): - return self._data.ctypes.data + return (self._ptr) 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 + return (self._ptr) 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: + cdef CPERCursor_v1 other_ + if not isinstance(other, CPERCursor_v1): return False - return bool((self_data == other._data).all()) + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlCPERCursor_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlCPERCursor_v1_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): - _cyb_cpython.PyBuffer_Release(buffer) + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlCPERCursor_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating CPERCursor_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlCPERCursor_v1_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, 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 + def cper_type_mask(self): + """int: [IN] Types of records to access. Bitmask of `nvmlCPERType_t` values. To change, reset `handle` to `NVML_CPER_CURSOR_HANDLE_INIT`.""" + return self._ptr[0].cperTypeMask - @time_stamp.setter - def time_stamp(self, val): - self._data.time_stamp = val + @cper_type_mask.setter + def cper_type_mask(self, val): + if self._readonly: + raise ValueError("This CPERCursor_v1 instance is read-only") + self._ptr[0].cperTypeMask = val @property - def sample_value(self): - """value_dtype: """ - return self._data.sample_value + def uuid(self): + """~_numpy.int8: (array of length 80).[IN] UUID of target to filter records for. Required for `NVML_CPER_ACCESS_TYPE_GPU`. To change, reset `handle` to `NVML_CPER_CURSOR_HANDLE_INIT`.""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) - @sample_value.setter - def sample_value(self, val): - self._data.sample_value = val + @uuid.setter + def uuid(self, val): + if self._readonly: + raise ValueError("This CPERCursor_v1 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) - 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 + @property + def handle(self): + """int: [IN/OUT] Opaque handle tracking read position. Initialize to `NVML_CPER_CURSOR_HANDLE_INIT` on first call; pass the same ``nvmlCPERCursor_v1_t`` on the next call to continue. Caller must not interpret or modify.""" + return (self._ptr[0].handle) - def __setitem__(self, key, val): - self._data[key] = val + @handle.setter + def handle(self, val): + if self._readonly: + raise ValueError("This CPERCursor_v1 instance is read-only") + self._ptr[0].handle = val @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 CPERCursor_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlCPERCursor_v1_t), CPERCursor_v1) @staticmethod def from_data(data): - """Create an Sample instance wrapping the given NumPy array. + """Create an CPERCursor_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a 1D array of dtype `sample_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `cper_cursor_v1_dtype` holding the data. """ - 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 + return _cyb_from_data(data, "cper_cursor_v1_dtype", cper_cursor_v1_dtype, CPERCursor_v1) @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): - """Create an Sample instance wrapping the given pointer. + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an CPERCursor_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. + 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 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) - + cdef CPERCursor_v1 obj = CPERCursor_v1.__new__(CPERCursor_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlCPERCursor_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating CPERCursor_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlCPERCursor_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_instance_utilization_sample_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationSample_t pod +cdef _get_set_memory_limits_v1_dtype_offsets(): + cdef nvmlSetMemoryLimits_v1_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': ['name_space', 'soft_limit', 'hard_limit'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64], 'offsets': [ - (&(pod.vgpuInstance)) - (&pod), - (&(pod.timeStamp)) - (&pod), - (&(pod.smUtil)) - (&pod), - (&(pod.memUtil)) - (&pod), - (&(pod.encUtil)) - (&pod), - (&(pod.decUtil)) - (&pod), + (&(pod.nameSpace)) - (&pod), + (&(pod.softLimit)) - (&pod), + (&(pod.hardLimit)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), + 'itemsize': sizeof(nvmlSetMemoryLimits_v1_t), }) -vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_dtype_offsets() +set_memory_limits_v1_dtype = _get_set_memory_limits_v1_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`. - If default-constructed, the instance represents a single struct. +cdef class SetMemoryLimits_v1: + """Empty-initialize an instance of `nvmlSetMemoryLimits_v1_t`. - Args: - size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuInstanceUtilizationSample_t` + .. seealso:: `nvmlSetMemoryLimits_v1_t` """ cdef: - readonly object _data + nvmlSetMemoryLimits_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs - 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 __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlSetMemoryLimits_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating SetMemoryLimits_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlSetMemoryLimits_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) 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))}>" + return f"<{__name__}.SetMemoryLimits_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 + return (self._ptr) cdef intptr_t _get_ptr(self): - return self._data.ctypes.data + return (self._ptr) 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 + return (self._ptr) 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: + cdef SetMemoryLimits_v1 other_ + if not isinstance(other, SetMemoryLimits_v1): return False - return bool((self_data == other._data).all()) + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlSetMemoryLimits_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlSetMemoryLimits_v1_t), self._readonly) 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 + pass - @sm_util.setter - def sm_util(self, val): - self._data.sm_util = val + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlSetMemoryLimits_v1_t)) + if self._ptr == NULL: + 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 + else: + setattr(self, key, val) @property - def mem_util(self): - """value_dtype: """ - return self._data.mem_util + 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 "" - @mem_util.setter - def mem_util(self, val): - self._data.mem_util = val + @name_space.setter + def name_space(self, val): + if self._readonly: + 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 enc_util(self): - """value_dtype: """ - return self._data.enc_util + def soft_limit(self): + """int: [in] Soft memory limit in Bytes.""" + return self._ptr[0].softLimit - @enc_util.setter - def enc_util(self, val): - self._data.enc_util = val + @soft_limit.setter + def soft_limit(self, val): + if self._readonly: + raise ValueError("This SetMemoryLimits_v1 instance is read-only") + self._ptr[0].softLimit = 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 hard_limit(self): + """int: [in] Hard memory limit in Bytes.""" + return self._ptr[0].hardLimit - def __setitem__(self, key, val): - self._data[key] = val + @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 VgpuInstanceUtilizationSample instance with the memory from the given buffer.""" - return VgpuInstanceUtilizationSample.from_data(_numpy.frombuffer(buffer, dtype=vgpu_instance_utilization_sample_dtype)) + """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 VgpuInstanceUtilizationSample instance wrapping the given NumPy array. + """Create an SetMemoryLimits_v1 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 single-element array of dtype `set_memory_limits_v1_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 + return _cyb_from_data(data, "set_memory_limits_v1_dtype", set_memory_limits_v1_dtype, SetMemoryLimits_v1) @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): - """Create an VgpuInstanceUtilizationSample instance wrapping the given pointer. + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an SetMemoryLimits_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. + 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 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) - + cdef SetMemoryLimits_v1 obj = SetMemoryLimits_v1.__new__(SetMemoryLimits_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlSetMemoryLimits_v1_t)) + if obj._ptr == NULL: + 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._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} return obj -cdef _get_vgpu_instance_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstanceUtilizationInfo_v1_t pod +cdef _get_get_memory_limits_v1_dtype_offsets(): + cdef nvmlGetMemoryLimits_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], + 'names': ['name_space', 'soft_limit', 'hard_limit', 'current_used'], + 'formats': [_numpy.intp, _numpy.uint64, _numpy.uint64, _numpy.uint64], '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.nameSpace)) - (&pod), + (&(pod.softLimit)) - (&pod), + (&(pod.hardLimit)) - (&pod), + (&(pod.currentUsed)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuInstanceUtilizationInfo_v1_t), + 'itemsize': sizeof(nvmlGetMemoryLimits_v1_t), }) -vgpu_instance_utilization_info_v1_dtype = _get_vgpu_instance_utilization_info_v1_dtype_offsets() +get_memory_limits_v1_dtype = _get_get_memory_limits_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. +cdef class GetMemoryLimits_v1: + """Empty-initialize an instance of `nvmlGetMemoryLimits_v1_t`. - Args: - size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuInstanceUtilizationInfo_v1_t` + .. seealso:: `nvmlGetMemoryLimits_v1_t` """ cdef: - readonly object _data + nvmlGetMemoryLimits_v1_t *_ptr + object _owner + bint _owned + bint _readonly + dict _refs - 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 __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlGetMemoryLimits_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating GetMemoryLimits_v1") + self._owner = None + self._owned = True + self._readonly = False + self._refs = {} + + def __dealloc__(self): + cdef nvmlGetMemoryLimits_v1_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) 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))}>" + return f"<{__name__}.GetMemoryLimits_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 + return (self._ptr) cdef intptr_t _get_ptr(self): - return self._data.ctypes.data + return (self._ptr) 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 + return (self._ptr) 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: + cdef GetMemoryLimits_v1 other_ + if not isinstance(other, GetMemoryLimits_v1): return False - return bool((self_data == other._data).all()) + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGetMemoryLimits_v1_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGetMemoryLimits_v1_t), self._readonly) 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 + pass - @mem_util.setter - def mem_util(self, val): - self._data.mem_util = val + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlGetMemoryLimits_v1_t)) + if self._ptr == NULL: + 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 + else: + setattr(self, key, val) @property - def enc_util(self): - """value_dtype: Encoder Util Value.""" - return self._data.enc_util + 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 "" - @enc_util.setter - def enc_util(self, val): - self._data.enc_util = val + @name_space.setter + def name_space(self, val): + if self._readonly: + 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 dec_util(self): - """value_dtype: Decoder Util Value.""" - return self._data.dec_util + def soft_limit(self): + """int: [out] Currently set soft memory limit in Bytes.""" + return self._ptr[0].softLimit - @dec_util.setter - def dec_util(self, val): - self._data.dec_util = val + @soft_limit.setter + def soft_limit(self, val): + if self._readonly: + raise ValueError("This GetMemoryLimits_v1 instance is read-only") + self._ptr[0].softLimit = val @property - def jpg_util(self): - """value_dtype: Jpeg Util Value.""" - return self._data.jpg_util + def hard_limit(self): + """int: [out] Currently set hard memory limit in Bytes.""" + return self._ptr[0].hardLimit - @jpg_util.setter - def jpg_util(self, val): - self._data.jpg_util = val + @hard_limit.setter + def hard_limit(self, val): + if self._readonly: + raise ValueError("This GetMemoryLimits_v1 instance is read-only") + self._ptr[0].hardLimit = 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 current_used(self): + """int: [out] Currently used memory in Bytes.""" + return self._ptr[0].currentUsed - def __setitem__(self, key, val): - self._data[key] = val + @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 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 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 VgpuInstanceUtilizationInfo_v1 instance wrapping the given NumPy array. + """Create an GetMemoryLimits_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. + data (_numpy.ndarray): a single-element array of dtype `get_memory_limits_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 + return _cyb_from_data(data, "get_memory_limits_v1_dtype", get_memory_limits_v1_dtype, GetMemoryLimits_v1) @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): - """Create an VgpuInstanceUtilizationInfo_v1 instance wrapping the given pointer. + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GetMemoryLimits_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. + 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 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) - + cdef GetMemoryLimits_v1 obj = GetMemoryLimits_v1.__new__(GetMemoryLimits_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlGetMemoryLimits_v1_t)) + if obj._ptr == NULL: + 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._owner = owner + obj._owned = False + obj._readonly = readonly + obj._refs = {} return obj -cdef _get_field_value_dtype_offsets(): - cdef nvmlFieldValue_t pod +cdef _get_pmgr_pwr_tuple_dtype_offsets(): + cdef nvmlPmgrPwrTuple_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': ['pwrm_w'], + 'formats': [_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.pwrmW)) - (&pod), ], - 'itemsize': sizeof(nvmlFieldValue_t), + 'itemsize': sizeof(nvmlPmgrPwrTuple_t), }) -field_value_dtype = _get_field_value_dtype_offsets() +pmgr_pwr_tuple_dtype = _get_pmgr_pwr_tuple_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 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:: `nvmlFieldValue_t` + .. seealso:: `nvmlPmgrPwrTuple_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=pmgr_pwr_tuple_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(nvmlPmgrPwrTuple_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPmgrPwrTuple_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__}.PmgrPwrTuple_Array_{self._data.size} object at {hex(id(self))}>" else: - return f"<{__name__}.FieldValue object at {hex(id(self))}>" + return f"<{__name__}.PmgrPwrTuple object at {hex(id(self))}>" @property def ptr(self): @@ -17128,7 +17543,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, PmgrPwrTuple)) or self_data.size != other._data.size or self_data.dtype != other._data.dtype: return False return bool((self_data == other._data).all()) @@ -17139,79 +17554,15 @@ 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]: """ - 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]: """ + def pwrm_w(self): + """Union[~_numpy.uint32, int]: Power consumption 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_ @@ -17223,10 +17574,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 PmgrPwrTuple.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 == pmgr_pwr_tuple_dtype: + return PmgrPwrTuple.from_data(out) return out def __setitem__(self, key, val): @@ -17234,707 +17585,711 @@ 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 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 FieldValue instance wrapping the given NumPy array. + """Create an PmgrPwrTuple 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 `pmgr_pwr_tuple_dtype` holding the data. """ - cdef FieldValue obj = FieldValue.__new__(FieldValue) + 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 != field_value_dtype: - raise ValueError("data array must be of dtype field_value_dtype") + 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, size_t size=1, bint readonly=False): - """Create an FieldValue 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. 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 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(nvmlFieldValue_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=field_value_dtype) + 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_prm_counter_value_v1_dtype_offsets(): - cdef nvmlPRMCounterValue_v1_t pod +cdef _get_rail_metrics_dtype_offsets(): + cdef nvmlRailMetrics_t pod return _numpy.dtype({ - 'names': ['status', 'output_type', 'output_value'], - 'formats': [_numpy.int32, _numpy.int32, value_dtype], + 'names': ['freqk_hz', 'util_pct'], + 'formats': [_numpy.uint32, _numpy.uint64], 'offsets': [ - (&(pod.status)) - (&pod), - (&(pod.outputType)) - (&pod), - (&(pod.outputValue)) - (&pod), + (&(pod.freqkHz)) - (&pod), + (&(pod.utilPct)) - (&pod), ], - 'itemsize': sizeof(nvmlPRMCounterValue_v1_t), + 'itemsize': sizeof(nvmlRailMetrics_t), }) -prm_counter_value_v1_dtype = _get_prm_counter_value_v1_dtype_offsets() +rail_metrics_dtype = _get_rail_metrics_dtype_offsets() -cdef class PRMCounterValue_v1: - """Empty-initialize an instance of `nvmlPRMCounterValue_v1_t`. +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:: `nvmlPRMCounterValue_v1_t` + .. seealso:: `nvmlRailMetrics_t` """ cdef: - nvmlPRMCounterValue_v1_t *_ptr + readonly object _data 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 __init__(self, size=1): + arr = _numpy.empty(size, dtype=rail_metrics_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlRailMetrics_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlRailMetrics_t) }" def __repr__(self): - return f"<{__name__}.PRMCounterValue_v1 object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.RailMetrics_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.RailMetrics 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 PRMCounterValue_v1 other_ - if not isinstance(other, PRMCounterValue_v1): + cdef object self_data = self._data + if (not isinstance(other, RailMetrics)) 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(nvmlPRMCounterValue_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(nvmlPRMCounterValue_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(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) + _cyb_cpython.PyBuffer_Release(buffer) @property - def output_value(self): - """Value: Output value.""" - return Value.from_ptr(&(self._ptr[0].outputValue), self._readonly, self) + def freqk_hz(self): + """Union[~_numpy.uint32, int]: Frequency in kilohertz.""" + if self._data.size == 1: + return int(self._data.freqk_hz[0]) + return self._data.freqk_hz - @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) + @freqk_hz.setter + def freqk_hz(self, val): + self._data.freqk_hz = val @property - def status(self): - """int: Status of the PRM counter read.""" - return (self._ptr[0].status) + 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 - @status.setter - def status(self, val): - if self._readonly: - raise ValueError("This PRMCounterValue_v1 instance is read-only") - self._ptr[0].status = val + @util_pct.setter + def util_pct(self, val): + self._data.util_pct = val - @property - def output_type(self): - """int: Output value type.""" - return (self._ptr[0].outputType) + 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 RailMetrics.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == rail_metrics_dtype: + return RailMetrics.from_data(out) + return out - @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 + def __setitem__(self, key, val): + self._data[key] = 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 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 PRMCounterValue_v1 instance wrapping the given NumPy array. + """Create an RailMetrics 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 1D array of dtype `rail_metrics_dtype` holding the data. """ - return _cyb_from_data(data, "prm_counter_value_v1_dtype", prm_counter_value_v1_dtype, PRMCounterValue_v1) + 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 != 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, bint readonly=False, object owner=None): - """Create an PRMCounterValue_v1 instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an RailMetrics 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 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 + 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(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_gpu_thermal_settings_dtype_offsets(): - cdef nvmlGpuThermalSettings_t pod +cdef _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets(): + cdef nvmlPwrModelMetricsDlppm1xPerf_t pod return _numpy.dtype({ - 'names': ['count', 'sensor'], - 'formats': [_numpy.uint32, (_py_anon_pod0_dtype, 3)], + 'names': ['perfms'], + 'formats': [_numpy.uint32], 'offsets': [ - (&(pod.count)) - (&pod), - (&(pod.sensor)) - (&pod), + (&(pod.perfms)) - (&pod), ], - 'itemsize': sizeof(nvmlGpuThermalSettings_t), + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), }) -gpu_thermal_settings_dtype = _get_gpu_thermal_settings_dtype_offsets() +pwr_model_metrics_dlppm1x_perf_dtype = _get_pwr_model_metrics_dlppm1x_perf_dtype_offsets() -cdef class GpuThermalSettings: - """Empty-initialize an instance of `nvmlGpuThermalSettings_t`. +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:: `nvmlGpuThermalSettings_t` + .. seealso:: `nvmlPwrModelMetricsDlppm1xPerf_t` """ cdef: - nvmlGpuThermalSettings_t *_ptr + readonly object _data 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 __init__(self, size=1): + arr = _numpy.empty(size, dtype=pwr_model_metrics_dlppm1x_perf_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPwrModelMetricsDlppm1xPerf_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelMetricsDlppm1xPerf_t) }" def __repr__(self): - return f"<{__name__}.GpuThermalSettings object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PwrModelMetricsDlppm1xPerf_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PwrModelMetricsDlppm1xPerf 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 GpuThermalSettings other_ - if not isinstance(other, GpuThermalSettings): + cdef object self_data = self._data + if (not isinstance(other, PwrModelMetricsDlppm1xPerf)) 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(nvmlGpuThermalSettings_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(nvmlGpuThermalSettings_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(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) + _cyb_cpython.PyBuffer_Release(buffer) @property - def sensor(self): - """_py_anon_pod0: """ - return _py_anon_pod0.from_ptr(&(self._ptr[0].sensor), 3, self._readonly) + def perfms(self): + """Union[~_numpy.uint32, int]: Performance metric in milliseconds.""" + if self._data.size == 1: + return int(self._data.perfms[0]) + return self._data.perfms - @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) + @perfms.setter + def perfms(self, val): + self._data.perfms = val - @property - def count(self): - """int: """ - return self._ptr[0].count + 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 PwrModelMetricsDlppm1xPerf.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_metrics_dlppm1x_perf_dtype: + return PwrModelMetricsDlppm1xPerf.from_data(out) + return out - @count.setter - def count(self, val): - if self._readonly: - raise ValueError("This GpuThermalSettings instance is read-only") - self._ptr[0].count = val + def __setitem__(self, key, val): + self._data[key] = 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 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 GpuThermalSettings instance wrapping the given NumPy array. + """Create an PwrModelMetricsDlppm1xPerf 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 1D array of dtype `pwr_model_metrics_dlppm1x_perf_dtype` holding the data. """ - return _cyb_from_data(data, "gpu_thermal_settings_dtype", gpu_thermal_settings_dtype, GpuThermalSettings) + 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 != 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, bint readonly=False, object owner=None): - """Create an GpuThermalSettings instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PwrModelMetricsDlppm1xPerf 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 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 + 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(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_clk_mon_status_dtype_offsets(): - cdef nvmlClkMonStatus_t pod +cdef _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets(): + cdef nvmlPwrModelMetricsSamplePfpp1x_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': ['freqk_hz', 'est_tgp_pwrm_w'], + 'formats': [(_numpy.uint32, 16), _numpy.uint32], 'offsets': [ - (&(pod.bGlobalStatus)) - (&pod), - (&(pod.clkMonListSize)) - (&pod), - (&(pod.clkMonList)) - (&pod), + (&(pod.freqkHz)) - (&pod), + (&(pod.estTgpPwrmW)) - (&pod), ], - 'itemsize': sizeof(nvmlClkMonStatus_t), + 'itemsize': sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), }) -clk_mon_status_dtype = _get_clk_mon_status_dtype_offsets() +pwr_model_metrics_sample_pfpp1x_dtype = _get_pwr_model_metrics_sample_pfpp1x_dtype_offsets() -cdef class ClkMonStatus: - """Empty-initialize an instance of `nvmlClkMonStatus_t`. +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:: `nvmlClkMonStatus_t` + .. seealso:: `nvmlPwrModelMetricsSamplePfpp1x_t` """ cdef: - nvmlClkMonStatus_t *_ptr + readonly object _data 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 __init__(self, size=1): + arr = _numpy.empty(size, dtype=pwr_model_metrics_sample_pfpp1x_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPwrModelMetricsSamplePfpp1x_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelMetricsSamplePfpp1x_t) }" def __repr__(self): - return f"<{__name__}.ClkMonStatus object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PwrModelMetricsSamplePfpp1x_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PwrModelMetricsSamplePfpp1x 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 ClkMonStatus other_ - if not isinstance(other, ClkMonStatus): + cdef object self_data = self._data + if (not isinstance(other, PwrModelMetricsSamplePfpp1x)) 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(nvmlClkMonStatus_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(nvmlClkMonStatus_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(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) + _cyb_cpython.PyBuffer_Release(buffer) @property - def clk_mon_list(self): - """ClkMonFaultInfo: """ - return ClkMonFaultInfo.from_ptr(&(self._ptr[0].clkMonList), self._ptr[0].clkMonListSize, self._readonly) + def freqk_hz(self): + """~_numpy.uint32: (array of length 16).Array of input frequencies in kilohertz for each domain.""" + return self._data.freqk_hz - @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) + @freqk_hz.setter + def freqk_hz(self, val): + self._data.freqk_hz = val @property - def b_global_status(self): - """int: """ - return self._ptr[0].bGlobalStatus + 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.est_tgp_pwrm_w[0]) + return self._data.est_tgp_pwrm_w - @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 + @est_tgp_pwrm_w.setter + def est_tgp_pwrm_w(self, val): + self._data.est_tgp_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 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 + + def __setitem__(self, key, val): + self._data[key] = 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 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 ClkMonStatus instance wrapping the given NumPy array. + """Create an PwrModelMetricsSamplePfpp1x 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 1D array of dtype `pwr_model_metrics_sample_pfpp1x_dtype` holding the data. """ - return _cyb_from_data(data, "clk_mon_status_dtype", clk_mon_status_dtype, ClkMonStatus) + 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 != 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, bint readonly=False, object owner=None): - """Create an ClkMonStatus instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PwrModelMetricsSamplePfpp1x 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 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 + 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(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_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlProcessesUtilizationInfo_v1_t pod +cdef _get_pwr_model_operating_point_pfpp1x_dtype_offsets(): + cdef nvmlPwrModelOperatingPointPfpp1x_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': ['freqk_hz', 'pwrm_w'], + 'formats': [_numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.processSamplesCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.procUtilArray)) - (&pod), + (&(pod.freqkHz)) - (&pod), + (&(pod.pwrmW)) - (&pod), ], - 'itemsize': sizeof(nvmlProcessesUtilizationInfo_v1_t), + 'itemsize': sizeof(nvmlPwrModelOperatingPointPfpp1x_t), }) -processes_utilization_info_v1_dtype = _get_processes_utilization_info_v1_dtype_offsets() +pwr_model_operating_point_pfpp1x_dtype = _get_pwr_model_operating_point_pfpp1x_dtype_offsets() -cdef class ProcessesUtilizationInfo_v1: - """Empty-initialize an instance of `nvmlProcessesUtilizationInfo_v1_t`. +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:: `nvmlProcessesUtilizationInfo_v1_t` + .. seealso:: `nvmlPwrModelOperatingPointPfpp1x_t` """ cdef: - nvmlProcessesUtilizationInfo_v1_t *_ptr + readonly object _data 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 __init__(self, size=1): + arr = _numpy.empty(size, dtype=pwr_model_operating_point_pfpp1x_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlPwrModelOperatingPointPfpp1x_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlPwrModelOperatingPointPfpp1x_t) }" def __repr__(self): - return f"<{__name__}.ProcessesUtilizationInfo_v1 object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PwrModelOperatingPointPfpp1x_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PwrModelOperatingPointPfpp1x 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 ProcessesUtilizationInfo_v1 other_ - if not isinstance(other, ProcessesUtilizationInfo_v1): + cdef object self_data = self._data + if (not isinstance(other, PwrModelOperatingPointPfpp1x)) 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(nvmlProcessesUtilizationInfo_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(nvmlProcessesUtilizationInfo_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(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) + _cyb_cpython.PyBuffer_Release(buffer) @property - def version(self): - """int: The version number of this struct.""" - return self._ptr[0].version + def freqk_hz(self): + """Union[~_numpy.uint32, int]: Operating frequency in kilohertz.""" + if self._data.size == 1: + return int(self._data.freqk_hz[0]) + return self._data.freqk_hz - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This ProcessesUtilizationInfo_v1 instance is read-only") - self._ptr[0].version = val + @freqk_hz.setter + def freqk_hz(self, val): + self._data.freqk_hz = val @property - def last_seen_time_stamp(self): - """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" - return self._ptr[0].lastSeenTimeStamp + def pwrm_w(self): + """Union[~_numpy.uint32, int]: Power consumption at this frequency in milliwatts.""" + if self._data.size == 1: + return int(self._data.pwrm_w[0]) + return self._data.pwrm_w - @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 + @pwrm_w.setter + def pwrm_w(self, val): + self._data.pwrm_w = 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) + 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 PwrModelOperatingPointPfpp1x.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == pwr_model_operating_point_pfpp1x_dtype: + return PwrModelOperatingPointPfpp1x.from_data(out) + return out - @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 + def __setitem__(self, key, val): + self._data[key] = 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 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 ProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + """Create an PwrModelOperatingPointPfpp1x 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 1D array of dtype `pwr_model_operating_point_pfpp1x_dtype` holding the data. """ - return _cyb_from_data(data, "processes_utilization_info_v1_dtype", processes_utilization_info_v1_dtype, ProcessesUtilizationInfo_v1) + 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 != 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, bint readonly=False, object owner=None): - """Create an ProcessesUtilizationInfo_v1 instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an PwrModelOperatingPointPfpp1x 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 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 = {} + 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(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_gpu_dynamic_pstates_info_dtype_offsets(): - cdef nvmlGpuDynamicPstatesInfo_t pod +cdef _get_adaptive_tgp_mode_info_v1_dtype_offsets(): + cdef nvmlAdaptiveTgpModeInfo_v1_t pod return _numpy.dtype({ - 'names': ['flags_', 'utilization'], - 'formats': [_numpy.uint32, (_py_anon_pod1_dtype, 8)], + '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.flags)) - (&pod), - (&(pod.utilization)) - (&pod), + (&(pod.inBandEnableRequest)) - (&pod), + (&(pod.featureAllowedByAdmin)) - (&pod), + (&(pod.adminOverrideEnabled)) - (&pod), + (&(pod.enablementStatus)) - (&pod), + (&(pod.adjustedLimitMw)) - (&pod), ], - 'itemsize': sizeof(nvmlGpuDynamicPstatesInfo_t), + 'itemsize': sizeof(nvmlAdaptiveTgpModeInfo_v1_t), }) -gpu_dynamic_pstates_info_dtype = _get_gpu_dynamic_pstates_info_dtype_offsets() +adaptive_tgp_mode_info_v1_dtype = _get_adaptive_tgp_mode_info_v1_dtype_offsets() -cdef class GpuDynamicPstatesInfo: - """Empty-initialize an instance of `nvmlGpuDynamicPstatesInfo_t`. +cdef class AdaptiveTgpModeInfo_v1: + """Empty-initialize an instance of `nvmlAdaptiveTgpModeInfo_v1_t`. - .. seealso:: `nvmlGpuDynamicPstatesInfo_t` + .. seealso:: `nvmlAdaptiveTgpModeInfo_v1_t` """ cdef: - nvmlGpuDynamicPstatesInfo_t *_ptr + nvmlAdaptiveTgpModeInfo_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(nvmlAdaptiveTgpModeInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuDynamicPstatesInfo") + raise MemoryError("Error allocating AdaptiveTgpModeInfo_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlGpuDynamicPstatesInfo_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__}.GpuDynamicPstatesInfo object at {hex(id(self))}>" + return f"<{__name__}.AdaptiveTgpModeInfo_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -17948,24 +18303,24 @@ cdef class GpuDynamicPstatesInfo: return (self._ptr) def __eq__(self, other): - cdef GpuDynamicPstatesInfo other_ - if not isinstance(other, GpuDynamicPstatesInfo): + cdef AdaptiveTgpModeInfo_v1 other_ + if not isinstance(other, AdaptiveTgpModeInfo_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuDynamicPstatesInfo_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(nvmlGpuDynamicPstatesInfo_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(nvmlGpuDynamicPstatesInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlAdaptiveTgpModeInfo_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 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 @@ -17973,47 +18328,77 @@ 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, self._readonly) + 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) - @utilization.setter - def utilization(self, val): + @in_band_enable_request.setter + def in_band_enable_request(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 AdaptiveTgpModeInfo_v1 instance is read-only") + self._ptr[0].inBandEnableRequest = val @property - def flags_(self): - """int: """ - return self._ptr[0].flags + 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) - @flags_.setter - def flags_(self, val): + @feature_allowed_by_admin.setter + def feature_allowed_by_admin(self, val): if self._readonly: - raise ValueError("This GpuDynamicPstatesInfo instance is read-only") - self._ptr[0].flags = val + raise ValueError("This AdaptiveTgpModeInfo_v1 instance is read-only") + self._ptr[0].featureAllowedByAdmin = val + + @property + 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) + + @admin_override_enabled.setter + def admin_override_enabled(self, val): + if self._readonly: + 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 GpuDynamicPstatesInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlGpuDynamicPstatesInfo_t), GpuDynamicPstatesInfo) + """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 GpuDynamicPstatesInfo 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 `gpu_dynamic_pstates_info_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, "gpu_dynamic_pstates_info_dtype", gpu_dynamic_pstates_info_dtype, GpuDynamicPstatesInfo) + 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 GpuDynamicPstatesInfo 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. @@ -18022,69 +18407,67 @@ cdef class GpuDynamicPstatesInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GpuDynamicPstatesInfo obj = GpuDynamicPstatesInfo.__new__(GpuDynamicPstatesInfo) + cdef AdaptiveTgpModeInfo_v1 obj = AdaptiveTgpModeInfo_v1.__new__(AdaptiveTgpModeInfo_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlGpuDynamicPstatesInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlAdaptiveTgpModeInfo_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating GpuDynamicPstatesInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuDynamicPstatesInfo_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_vgpu_processes_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuProcessesUtilizationInfo_v1_t pod +cdef _get_operational_event_context_info_v1_dtype_offsets(): + cdef nvmlOperationalEventContextInfo_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': ['nvml_gpu_operational_event_context_type', 'source_event_context_type', 'data_size', 'data_format_version'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint16], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.vgpuProcessCount)) - (&pod), - (&(pod.lastSeenTimeStamp)) - (&pod), - (&(pod.vgpuProcUtilArray)) - (&pod), + (&(pod.nvmlGpuOperationalEventContextType)) - (&pod), + (&(pod.sourceEventContextType)) - (&pod), + (&(pod.dataSize)) - (&pod), + (&(pod.dataFormatVersion)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t), + 'itemsize': sizeof(nvmlOperationalEventContextInfo_v1_t), }) -vgpu_processes_utilization_info_v1_dtype = _get_vgpu_processes_utilization_info_v1_dtype_offsets() +operational_event_context_info_v1_dtype = _get_operational_event_context_info_v1_dtype_offsets() -cdef class VgpuProcessesUtilizationInfo_v1: - """Empty-initialize an instance of `nvmlVgpuProcessesUtilizationInfo_v1_t`. +cdef class OperationalEventContextInfo_v1: + """Empty-initialize an instance of `nvmlOperationalEventContextInfo_v1_t`. - .. seealso:: `nvmlVgpuProcessesUtilizationInfo_v1_t` + .. seealso:: `nvmlOperationalEventContextInfo_v1_t` """ cdef: - nvmlVgpuProcessesUtilizationInfo_v1_t *_ptr + nvmlOperationalEventContextInfo_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(nvmlOperationalEventContextInfo_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuProcessesUtilizationInfo_v1") + raise MemoryError("Error allocating OperationalEventContextInfo_v1") self._owner = None self._owned = True self._readonly = False - self._refs = {} def __dealloc__(self): - cdef nvmlVgpuProcessesUtilizationInfo_v1_t *ptr + cdef nvmlOperationalEventContextInfo_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__}.OperationalEventContextInfo_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18098,24 +18481,24 @@ cdef class VgpuProcessesUtilizationInfo_v1: return (self._ptr) def __eq__(self, other): - cdef VgpuProcessesUtilizationInfo_v1 other_ - if not isinstance(other, VgpuProcessesUtilizationInfo_v1): + cdef OperationalEventContextInfo_v1 other_ + if not isinstance(other, OperationalEventContextInfo_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(nvmlOperationalEventContextInfo_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(nvmlOperationalEventContextInfo_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(nvmlOperationalEventContextInfo_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 OperationalEventContextInfo_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlOperationalEventContextInfo_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18123,60 +18506,66 @@ 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 nvml_gpu_operational_event_context_type(self): + """int: """ + return self._ptr[0].nvmlGpuOperationalEventContextType - @version.setter - def version(self, val): + @nvml_gpu_operational_event_context_type.setter + def nvml_gpu_operational_event_context_type(self, val): if self._readonly: - raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") - self._ptr[0].version = val + raise ValueError("This OperationalEventContextInfo_v1 instance is read-only") + self._ptr[0].nvmlGpuOperationalEventContextType = val @property - def last_seen_time_stamp(self): - """int: Return only samples with timestamp greater than lastSeenTimeStamp.""" - return self._ptr[0].lastSeenTimeStamp + def source_event_context_type(self): + """int: """ + return self._ptr[0].sourceEventContextType - @last_seen_time_stamp.setter - def last_seen_time_stamp(self, val): + @source_event_context_type.setter + def source_event_context_type(self, val): if self._readonly: - raise ValueError("This VgpuProcessesUtilizationInfo_v1 instance is read-only") - self._ptr[0].lastSeenTimeStamp = val + raise ValueError("This OperationalEventContextInfo_v1 instance is read-only") + self._ptr[0].sourceEventContextType = 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) + def data_size(self): + """int: """ + return self._ptr[0].dataSize - @vgpu_proc_util_array.setter - def vgpu_proc_util_array(self, val): + @data_size.setter + def data_size(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 OperationalEventContextInfo_v1 instance is read-only") + self._ptr[0].dataSize = val + + @property + def data_format_version(self): + """int: """ + return self._ptr[0].dataFormatVersion + + @data_format_version.setter + def data_format_version(self, val): + if self._readonly: + raise ValueError("This OperationalEventContextInfo_v1 instance is read-only") + self._ptr[0].dataFormatVersion = 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 OperationalEventContextInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlOperationalEventContextInfo_v1_t), OperationalEventContextInfo_v1) @staticmethod def from_data(data): - """Create an VgpuProcessesUtilizationInfo_v1 instance wrapping the given NumPy array. + """Create an OperationalEventContextInfo_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 `operational_event_context_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) + return _cyb_from_data(data, "operational_event_context_info_v1_dtype", operational_event_context_info_v1_dtype, OperationalEventContextInfo_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 OperationalEventContextInfo_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18185,60 +18574,64 @@ 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 OperationalEventContextInfo_v1 obj = OperationalEventContextInfo_v1.__new__(OperationalEventContextInfo_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuProcessesUtilizationInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlOperationalEventContextInfo_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 OperationalEventContextInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlOperationalEventContextInfo_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 -vgpu_scheduler_params_dtype = _numpy.dtype(( - _numpy.dtype((_numpy.void, sizeof(nvmlVgpuSchedulerParams_t))), - { - "vgpu_sched_data_with_arr": (_py_anon_pod2_dtype, 0), - "vgpu_sched_data": (_py_anon_pod3_dtype, 0), - } - )) +cdef _get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets(): + cdef nvmlGpuOperationalEventContextLegacyXid_v1_t pod + return _numpy.dtype({ + 'names': ['xid_code'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.xidCode)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuOperationalEventContextLegacyXid_v1_t), + }) -cdef class VgpuSchedulerParams: - """Empty-initialize an instance of `nvmlVgpuSchedulerParams_t`. +gpu_operational_event_context_legacy_xid_v1_dtype = _get_gpu_operational_event_context_legacy_xid_v1_dtype_offsets() +cdef class GpuOperationalEventContextLegacyXid_v1: + """Empty-initialize an instance of `nvmlGpuOperationalEventContextLegacyXid_v1_t`. - .. seealso:: `nvmlVgpuSchedulerParams_t` + + .. seealso:: `nvmlGpuOperationalEventContextLegacyXid_v1_t` """ cdef: - nvmlVgpuSchedulerParams_t *_ptr + nvmlGpuOperationalEventContextLegacyXid_v1_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(nvmlGpuOperationalEventContextLegacyXid_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerParams") + raise MemoryError("Error allocating GpuOperationalEventContextLegacyXid_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuSchedulerParams_t *ptr + cdef nvmlGpuOperationalEventContextLegacyXid_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__}.VgpuSchedulerParams object at {hex(id(self))}>" + return f"<{__name__}.GpuOperationalEventContextLegacyXid_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18252,24 +18645,24 @@ cdef class VgpuSchedulerParams: return (self._ptr) def __eq__(self, other): - cdef VgpuSchedulerParams other_ - if not isinstance(other, VgpuSchedulerParams): + cdef GpuOperationalEventContextLegacyXid_v1 other_ + if not isinstance(other, GpuOperationalEventContextLegacyXid_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerParams_t)) == 0) + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuOperationalEventContextLegacyXid_v1_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(nvmlGpuOperationalEventContextLegacyXid_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(nvmlVgpuSchedulerParams_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuOperationalEventContextLegacyXid_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerParams") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerParams_t)) + raise MemoryError("Error allocating GpuOperationalEventContextLegacyXid_v1") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlGpuOperationalEventContextLegacyXid_v1_t)) self._owner = None self._owned = True self._readonly = not val.flags.writeable @@ -18277,46 +18670,33 @@ 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), self._readonly, 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), self._readonly, self) + def xid_code(self): + """int: """ + return self._ptr[0].xidCode - @vgpu_sched_data.setter - def vgpu_sched_data(self, val): + @xid_code.setter + def xid_code(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 GpuOperationalEventContextLegacyXid_v1 instance is read-only") + self._ptr[0].xidCode = 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) + """Create an GpuOperationalEventContextLegacyXid_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuOperationalEventContextLegacyXid_v1_t), GpuOperationalEventContextLegacyXid_v1) @staticmethod def from_data(data): - """Create an VgpuSchedulerParams instance wrapping the given NumPy array. + """Create an GpuOperationalEventContextLegacyXid_v1 instance wrapping the given NumPy array. Args: - data (_numpy.ndarray): a single-element array of dtype `vgpu_scheduler_params_dtype` holding the data. + data (_numpy.ndarray): a single-element array of dtype `gpu_operational_event_context_legacy_xid_v1_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_params_dtype", vgpu_scheduler_params_dtype, VgpuSchedulerParams) + return _cyb_from_data(data, "gpu_operational_event_context_legacy_xid_v1_dtype", gpu_operational_event_context_legacy_xid_v1_dtype, GpuOperationalEventContextLegacyXid_v1) @staticmethod def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): - """Create an VgpuSchedulerParams instance wrapping the given pointer. + """Create an GpuOperationalEventContextLegacyXid_v1 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. @@ -18325,59 +18705,65 @@ cdef class VgpuSchedulerParams: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerParams obj = VgpuSchedulerParams.__new__(VgpuSchedulerParams) + cdef GpuOperationalEventContextLegacyXid_v1 obj = GpuOperationalEventContextLegacyXid_v1.__new__(GpuOperationalEventContextLegacyXid_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerParams_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuOperationalEventContextLegacyXid_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerParams") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerParams_t)) + raise MemoryError("Error allocating GpuOperationalEventContextLegacyXid_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuOperationalEventContextLegacyXid_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 -vgpu_scheduler_set_params_dtype = _numpy.dtype(( - _numpy.dtype((_numpy.void, sizeof(nvmlVgpuSchedulerSetParams_t))), - { - "vgpu_sched_data_with_arr": (_py_anon_pod4_dtype, 0), - "vgpu_sched_data": (_py_anon_pod5_dtype, 0), - } - )) - -cdef class VgpuSchedulerSetParams: - """Empty-initialize an instance of `nvmlVgpuSchedulerSetParams_t`. - +cdef _get_gpu_fabric_clique_v1_dtype_offsets(): + cdef nvmlGpuFabricClique_v1_t pod + return _numpy.dtype({ + 'names': ['type', 'id'], + 'formats': [_numpy.uint8, _numpy.uint32], + 'offsets': [ + (&(pod.type)) - (&pod), + (&(pod.id)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuFabricClique_v1_t), + }) - .. seealso:: `nvmlVgpuSchedulerSetParams_t` +gpu_fabric_clique_v1_dtype = _get_gpu_fabric_clique_v1_dtype_offsets() + +cdef class GpuFabricClique_v1: + """Empty-initialize an instance of `nvmlGpuFabricClique_v1_t`. + + + .. seealso:: `nvmlGpuFabricClique_v1_t` """ cdef: - nvmlVgpuSchedulerSetParams_t *_ptr + nvmlGpuFabricClique_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerSetParams_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlGpuFabricClique_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerSetParams") + raise MemoryError("Error allocating GpuFabricClique_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuSchedulerSetParams_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__}.VgpuSchedulerSetParams object at {hex(id(self))}>" + return f"<{__name__}.GpuFabricClique_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18391,24 +18777,24 @@ cdef class VgpuSchedulerSetParams: return (self._ptr) def __eq__(self, other): - cdef VgpuSchedulerSetParams other_ - if not isinstance(other, VgpuSchedulerSetParams): + cdef GpuFabricClique_v1 other_ + if not isinstance(other, GpuFabricClique_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuSchedulerSetParams_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(nvmlVgpuSchedulerSetParams_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(nvmlVgpuSchedulerSetParams_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuFabricClique_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerSetParams") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerSetParams_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 @@ -18416,46 +18802,44 @@ cdef class VgpuSchedulerSetParams: 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), self._readonly, self) + def type(self): + """int: Clique type. See NVML_GPU_FABRIC_CLIQUE_TYPE_*.""" + return self._ptr[0].type - @vgpu_sched_data_with_arr.setter - def vgpu_sched_data_with_arr(self, val): + @type.setter + def type(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 GpuFabricClique_v1 instance is read-only") + self._ptr[0].type = val @property - def vgpu_sched_data(self): - """_py_anon_pod5: """ - return _py_anon_pod5.from_ptr(&(self._ptr[0].vgpuSchedData), self._readonly, self) + def id(self): + """int: Clique ID assigned by the Fabric Manager.""" + return self._ptr[0].id - @vgpu_sched_data.setter - def vgpu_sched_data(self, val): + @id.setter + def id(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 GpuFabricClique_v1 instance is read-only") + self._ptr[0].id = 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 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 VgpuSchedulerSetParams 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 `vgpu_scheduler_set_params_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, "vgpu_scheduler_set_params_dtype", vgpu_scheduler_set_params_dtype, VgpuSchedulerSetParams) + 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 VgpuSchedulerSetParams 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. @@ -18464,66 +18848,66 @@ cdef class VgpuSchedulerSetParams: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerSetParams obj = VgpuSchedulerSetParams.__new__(VgpuSchedulerSetParams) + cdef GpuFabricClique_v1 obj = GpuFabricClique_v1.__new__(GpuFabricClique_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerSetParams_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuFabricClique_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerSetParams") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerSetParams_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_license_info_dtype_offsets(): - cdef nvmlVgpuLicenseInfo_t pod +cdef _get_gpu_operational_event_config_v1_dtype_offsets(): + cdef nvmlGpuOperationalEventConfig_v1_t pod return _numpy.dtype({ - 'names': ['is_licensed', 'license_expiry', 'current_state'], - 'formats': [_numpy.uint8, vgpu_license_expiry_dtype, _numpy.uint32], + 'names': ['uuid', 'min_log_level', 'min_severity'], + 'formats': [(_numpy.int8, 96), _numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.isLicensed)) - (&pod), - (&(pod.licenseExpiry)) - (&pod), - (&(pod.currentState)) - (&pod), + (&(pod.uuid)) - (&pod), + (&(pod.minLogLevel)) - (&pod), + (&(pod.minSeverity)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuLicenseInfo_t), + 'itemsize': sizeof(nvmlGpuOperationalEventConfig_v1_t), }) -vgpu_license_info_dtype = _get_vgpu_license_info_dtype_offsets() +gpu_operational_event_config_v1_dtype = _get_gpu_operational_event_config_v1_dtype_offsets() -cdef class VgpuLicenseInfo: - """Empty-initialize an instance of `nvmlVgpuLicenseInfo_t`. +cdef class GpuOperationalEventConfig_v1: + """Empty-initialize an instance of `nvmlGpuOperationalEventConfig_v1_t`. - .. seealso:: `nvmlVgpuLicenseInfo_t` + .. seealso:: `nvmlGpuOperationalEventConfig_v1_t` """ cdef: - nvmlVgpuLicenseInfo_t *_ptr + nvmlGpuOperationalEventConfig_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(nvmlGpuOperationalEventConfig_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuLicenseInfo") + raise MemoryError("Error allocating GpuOperationalEventConfig_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuLicenseInfo_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__}.VgpuLicenseInfo object at {hex(id(self))}>" + return f"<{__name__}.GpuOperationalEventConfig_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18537,24 +18921,24 @@ cdef class VgpuLicenseInfo: return (self._ptr) def __eq__(self, other): - cdef VgpuLicenseInfo other_ - if not isinstance(other, VgpuLicenseInfo): + cdef GpuOperationalEventConfig_v1 other_ + if not isinstance(other, GpuOperationalEventConfig_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlVgpuLicenseInfo_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(nvmlVgpuLicenseInfo_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(nvmlVgpuLicenseInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlGpuOperationalEventConfig_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 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 @@ -18562,56 +18946,59 @@ cdef class VgpuLicenseInfo: setattr(self, key, val) @property - def license_expiry(self): - """VgpuLicenseExpiry: """ - return VgpuLicenseExpiry.from_ptr(&(self._ptr[0].licenseExpiry), self._readonly, self) + def uuid(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) - @license_expiry.setter - def license_expiry(self, val): + @uuid.setter + def uuid(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 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 is_licensed(self): + def min_log_level(self): """int: """ - return self._ptr[0].isLicensed + return self._ptr[0].minLogLevel - @is_licensed.setter - def is_licensed(self, val): + @min_log_level.setter + def min_log_level(self, val): if self._readonly: - raise ValueError("This VgpuLicenseInfo instance is read-only") - self._ptr[0].isLicensed = val + raise ValueError("This GpuOperationalEventConfig_v1 instance is read-only") + self._ptr[0].minLogLevel = val @property - def current_state(self): + def min_severity(self): """int: """ - return self._ptr[0].currentState + return self._ptr[0].minSeverity - @current_state.setter - def current_state(self, val): + @min_severity.setter + def min_severity(self, val): if self._readonly: - raise ValueError("This VgpuLicenseInfo instance is read-only") - self._ptr[0].currentState = val + raise ValueError("This GpuOperationalEventConfig_v1 instance is read-only") + self._ptr[0].minSeverity = 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 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 VgpuLicenseInfo 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_license_info_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_license_info_dtype", vgpu_license_info_dtype, VgpuLicenseInfo) + 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 VgpuLicenseInfo 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. @@ -18620,260 +19007,481 @@ cdef class VgpuLicenseInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuLicenseInfo obj = VgpuLicenseInfo.__new__(VgpuLicenseInfo) + cdef GpuOperationalEventConfig_v1 obj = GpuOperationalEventConfig_v1.__new__(GpuOperationalEventConfig_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuLicenseInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlGpuOperationalEventConfig_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuLicenseInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuLicenseInfo_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 return obj -cdef _get_grid_licensable_feature_dtype_offsets(): - cdef nvmlGridLicensableFeature_t pod +cdef _get_event_data_v2_dtype_offsets(): + cdef nvmlEventData_v2_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': ['uuid', 'source_module', 'event_type', 'event_data', 'group_cursor', 'instance_id', 'timestamp_usec', 'trace_id', 'data_type', '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.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.uint32, _numpy.uint8, _numpy.uint8], 'offsets': [ - (&(pod.featureCode)) - (&pod), - (&(pod.featureState)) - (&pod), - (&(pod.licenseInfo)) - (&pod), - (&(pod.productName)) - (&pod), - (&(pod.featureEnabled)) - (&pod), - (&(pod.licenseExpiry)) - (&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.dataType)) - (&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(nvmlGridLicensableFeature_t), + 'itemsize': sizeof(nvmlEventData_v2_t), }) -grid_licensable_feature_dtype = _get_grid_licensable_feature_dtype_offsets() +event_data_v2_dtype = _get_event_data_v2_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. +cdef class EventData_v2: + """Empty-initialize an instance of `nvmlEventData_v2_t`. - Args: - size (int): number of structs, default=1. - .. seealso:: `nvmlGridLicensableFeature_t` + .. seealso:: `nvmlEventData_v2_t` """ cdef: - readonly object _data + nvmlEventData_v2_t *_ptr + object _owner + bint _owned + bint _readonly - 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 __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlEventData_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EventData_v2") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + cdef nvmlEventData_v2_t *ptr + if self._owned and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) 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))}>" + return f"<{__name__}.EventData_v2 object at {hex(id(self))}>" @property def ptr(self): """Get the pointer address to the data as Python :class:`int`.""" - return self._data.ctypes.data + return (self._ptr) cdef intptr_t _get_ptr(self): - return self._data.ctypes.data + return (self._ptr) 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 + return (self._ptr) 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: + cdef EventData_v2 other_ + if not isinstance(other, EventData_v2): return False - return bool((self_data == other._data).all()) + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEventData_v2_t)) == 0) - def __getbuffer__(self, Py_buffer *buffer, int flags): - _cyb_cpython.PyObject_GetBuffer(self._data, buffer, flags) + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlEventData_v2_t), self._readonly) def __releasebuffer__(self, Py_buffer *buffer): - _cyb_cpython.PyBuffer_Release(buffer) + pass + + def __setitem__(self, key, val): + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlEventData_v2_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating EventData_v2") + _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEventData_v2_t)) + self._owner = None + self._owned = True + self._readonly = not val.flags.writeable + else: + setattr(self, key, val) @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 + def uuid(self): + """~_numpy.int8: (array of length 96).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) - @feature_code.setter - def feature_code(self, val): - self._data.feature_code = val + @uuid.setter + def uuid(self, val): + if self._readonly: + raise ValueError("This EventData_v2 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 feature_state(self): - """Union[~_numpy.uint32, int]: """ - if self._data.size == 1: - return int(self._data.feature_state[0]) - return self._data.feature_state + def source_module(self): + """~_numpy.int8: (array of length 16).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].sourceModule) - @feature_state.setter - def feature_state(self, val): - self._data.feature_state = val + @source_module.setter + def source_module(self, val): + if self._readonly: + raise ValueError("This EventData_v2 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) @property - def license_info(self): - """~_numpy.int8: (array of length 128).""" - return self._data.license_info + def event_type(self): + """int: """ + return self._ptr[0].eventType - @license_info.setter - def license_info(self, val): - self._data.license_info = val + @event_type.setter + def event_type(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].eventType = val @property - def product_name(self): - """~_numpy.int8: (array of length 128).""" - return self._data.product_name + def event_data(self): + """int: """ + return self._ptr[0].eventData - @product_name.setter - def product_name(self, val): - self._data.product_name = val + @event_data.setter + def event_data(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].eventData = 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 + def group_cursor(self): + """int: """ + return self._ptr[0].groupCursor - @feature_enabled.setter - def feature_enabled(self, val): - self._data.feature_enabled = val + @group_cursor.setter + def group_cursor(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].groupCursor = val @property - def license_expiry(self): - """grid_license_expiry_dtype: """ - return self._data.license_expiry + def instance_id(self): + """int: """ + return self._ptr[0].instanceId - @license_expiry.setter - def license_expiry(self, val): - self._data.license_expiry = val + @instance_id.setter + def instance_id(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].instanceId = 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 + @property + def timestamp_usec(self): + """int: """ + return self._ptr[0].timestampUsec - def __setitem__(self, key, val): - self._data[key] = val + @timestamp_usec.setter + def timestamp_usec(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].timestampUsec = val + + @property + def trace_id(self): + """int: """ + return self._ptr[0].traceId + + @trace_id.setter + def trace_id(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].traceId = val + + @property + def data_type(self): + """int: """ + return self._ptr[0].dataType + + @data_type.setter + def data_type(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].dataType = val + + @property + def gpu_instance_id(self): + """int: """ + return self._ptr[0].gpuInstanceId + + @gpu_instance_id.setter + def gpu_instance_id(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].gpuInstanceId = val + + @property + def compute_instance_id(self): + """int: """ + return self._ptr[0].computeInstanceId + + @compute_instance_id.setter + def compute_instance_id(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].computeInstanceId = val + + @property + def severity(self): + """int: """ + return self._ptr[0].severity + + @severity.setter + def severity(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].severity = val + + @property + def category_id(self): + """int: """ + return self._ptr[0].categoryId + + @category_id.setter + def category_id(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].categoryId = val + + @property + def module_event_code(self): + """int: """ + return self._ptr[0].moduleEventCode + + @module_event_code.setter + def module_event_code(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].moduleEventCode = val + + @property + def scope(self): + """int: """ + return self._ptr[0].scope + + @scope.setter + def scope(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].scope = val + + @property + def originator(self): + """int: """ + return self._ptr[0].originator + + @originator.setter + def originator(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].originator = val + + @property + def module_instance(self): + """int: """ + return self._ptr[0].moduleInstance + + @module_instance.setter + def module_instance(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].moduleInstance = val + + @property + def chiplet_id(self): + """int: """ + return self._ptr[0].chipletId + + @chiplet_id.setter + def chiplet_id(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].chipletId = val + + @property + def log_level(self): + """int: """ + return self._ptr[0].logLevel + + @log_level.setter + def log_level(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].logLevel = val + + @property + def attributes(self): + """int: """ + return self._ptr[0].attributes + + @attributes.setter + def attributes(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].attributes = val + + @property + def group_cper_size(self): + """int: """ + return self._ptr[0].groupCperSize + + @group_cper_size.setter + def group_cper_size(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].groupCperSize = val + + @property + def group_attributes(self): + """int: """ + return self._ptr[0].groupAttributes + + @group_attributes.setter + def group_attributes(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].groupAttributes = val + + @property + def group_size(self): + """int: """ + return self._ptr[0].groupSize + + @group_size.setter + def group_size(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].groupSize = val + + @property + def group_index(self): + """int: """ + return self._ptr[0].groupIndex + + @group_index.setter + def group_index(self, val): + if self._readonly: + raise ValueError("This EventData_v2 instance is read-only") + self._ptr[0].groupIndex = 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)) + """Create an EventData_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlEventData_v2_t), EventData_v2) @staticmethod def from_data(data): - """Create an GridLicensableFeature instance wrapping the given NumPy array. + """Create an EventData_v2 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 single-element array of dtype `event_data_v2_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 + return _cyb_from_data(data, "event_data_v2_dtype", event_data_v2_dtype, EventData_v2) @staticmethod - def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False): - """Create an GridLicensableFeature instance wrapping the given pointer. + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an EventData_v2 instance wrapping the given pointer. Args: ptr (intptr_t): pointer address as Python :class:`int` to the data. - size (int): number of structs, default=1. + 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 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) - + cdef EventData_v2 obj = EventData_v2.__new__(EventData_v2) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlEventData_v2_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating EventData_v2") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEventData_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_unit_fan_speeds_dtype_offsets(): - cdef nvmlUnitFanSpeeds_t pod +cdef _get_nvlink_set_bw_mode_async_v1_dtype_offsets(): + cdef nvmlNvlinkSetBwModeAsync_v1_t pod return _numpy.dtype({ - 'names': ['fans', 'count'], - 'formats': [(unit_fan_info_dtype, 24), _numpy.uint32], + 'names': ['b_set_best', 'bw_mode', 'async_poll_timeout_ms'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.fans)) - (&pod), - (&(pod.count)) - (&pod), + (&(pod.bSetBest)) - (&pod), + (&(pod.bwMode)) - (&pod), + (&(pod.asyncPollTimeoutMs)) - (&pod), ], - 'itemsize': sizeof(nvmlUnitFanSpeeds_t), + 'itemsize': sizeof(nvmlNvlinkSetBwModeAsync_v1_t), }) -unit_fan_speeds_dtype = _get_unit_fan_speeds_dtype_offsets() +nvlink_set_bw_mode_async_v1_dtype = _get_nvlink_set_bw_mode_async_v1_dtype_offsets() -cdef class UnitFanSpeeds: - """Empty-initialize an instance of `nvmlUnitFanSpeeds_t`. +cdef class NvlinkSetBwModeAsync_v1: + """Empty-initialize an instance of `nvmlNvlinkSetBwModeAsync_v1_t`. - .. seealso:: `nvmlUnitFanSpeeds_t` + .. seealso:: `nvmlNvlinkSetBwModeAsync_v1_t` """ cdef: - nvmlUnitFanSpeeds_t *_ptr + nvmlNvlinkSetBwModeAsync_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(nvmlNvlinkSetBwModeAsync_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating UnitFanSpeeds") + raise MemoryError("Error allocating NvlinkSetBwModeAsync_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlUnitFanSpeeds_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__}.UnitFanSpeeds object at {hex(id(self))}>" + return f"<{__name__}.NvlinkSetBwModeAsync_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -18887,24 +19495,24 @@ cdef class UnitFanSpeeds: return (self._ptr) def __eq__(self, other): - cdef UnitFanSpeeds other_ - if not isinstance(other, UnitFanSpeeds): + cdef NvlinkSetBwModeAsync_v1 other_ + if not isinstance(other, NvlinkSetBwModeAsync_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlUnitFanSpeeds_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(nvmlUnitFanSpeeds_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(nvmlUnitFanSpeeds_t)) + self._ptr = _cyb_malloc(sizeof(nvmlNvlinkSetBwModeAsync_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 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 @@ -18912,47 +19520,55 @@ cdef class UnitFanSpeeds: setattr(self, key, val) @property - def fans(self): - """UnitFanInfo: """ - return UnitFanInfo.from_ptr(&(self._ptr[0].fans), 24, self._readonly) + def b_set_best(self): + """int: [in] - Set to the best available Bandwidth mode""" + return self._ptr[0].bSetBest - @fans.setter - def fans(self, val): + @b_set_best.setter + def b_set_best(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 NvlinkSetBwModeAsync_v1 instance is read-only") + self._ptr[0].bSetBest = val @property - def count(self): - """int: """ - return self._ptr[0].count + def bw_mode(self): + """int: [in] - Requested Bandwidth mode to set. Values can be found from `nvmlDeviceGetNvlinkSupportedBwModes()`""" + return self._ptr[0].bwMode - @count.setter - def count(self, val): + @bw_mode.setter + def bw_mode(self, val): if self._readonly: - raise ValueError("This UnitFanSpeeds instance is read-only") - self._ptr[0].count = val + raise ValueError("This NvlinkSetBwModeAsync_v1 instance is read-only") + self._ptr[0].bwMode = val + + @property + def async_poll_timeout_ms(self): + """int: [out] - Time in ms to poll to validate bandwidth setting.""" + return self._ptr[0].asyncPollTimeoutMs + + @async_poll_timeout_ms.setter + def async_poll_timeout_ms(self, val): + if self._readonly: + raise ValueError("This NvlinkSetBwModeAsync_v1 instance is read-only") + self._ptr[0].asyncPollTimeoutMs = 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 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 UnitFanSpeeds 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 `unit_fan_speeds_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, "unit_fan_speeds_dtype", unit_fan_speeds_dtype, UnitFanSpeeds) + 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 UnitFanSpeeds 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. @@ -18961,280 +19577,258 @@ cdef class UnitFanSpeeds: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef UnitFanSpeeds obj = UnitFanSpeeds.__new__(UnitFanSpeeds) + cdef NvlinkSetBwModeAsync_v1 obj = NvlinkSetBwModeAsync_v1.__new__(NvlinkSetBwModeAsync_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlUnitFanSpeeds_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkSetBwModeAsync_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating UnitFanSpeeds") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlUnitFanSpeeds_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_vgpu_pgpu_metadata_dtype_offsets(): - cdef nvmlVgpuPgpuMetadata_t pod +cdef _get_nvlink_telemetry_sample_v1_dtype_offsets(): + cdef nvmlNvlinkTelemetrySample_v1_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': ['link_id', 'sample_type', 'sample_count', 'samples', 'nvml_return'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp, _numpy.int32], '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.linkId)) - (&pod), + (&(pod.sampleType)) - (&pod), + (&(pod.sampleCount)) - (&pod), + (&(pod.samples)) - (&pod), + (&(pod.nvmlReturn)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuPgpuMetadata_t), + 'itemsize': sizeof(nvmlNvlinkTelemetrySample_v1_t), }) -vgpu_pgpu_metadata_dtype = _get_vgpu_pgpu_metadata_dtype_offsets() +nvlink_telemetry_sample_v1_dtype = _get_nvlink_telemetry_sample_v1_dtype_offsets() -cdef class VgpuPgpuMetadata: - """Empty-initialize an instance of `nvmlVgpuPgpuMetadata_t`. +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:: `nvmlVgpuPgpuMetadata_t` + .. seealso:: `nvmlNvlinkTelemetrySample_v1_t` """ cdef: - nvmlVgpuPgpuMetadata_t *_ptr + readonly object _data 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 __init__(self, size=1): + arr = _numpy.empty(size, dtype=nvlink_telemetry_sample_v1_dtype) + self._data = arr.view(_numpy.recarray) + assert self._data.itemsize == sizeof(nvmlNvlinkTelemetrySample_v1_t), \ + f"itemsize {self._data.itemsize} mismatches struct size { sizeof(nvmlNvlinkTelemetrySample_v1_t) }" def __repr__(self): - return f"<{__name__}.VgpuPgpuMetadata object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.NvlinkTelemetrySample_v1_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.NvlinkTelemetrySample_v1 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 VgpuPgpuMetadata other_ - if not isinstance(other, VgpuPgpuMetadata): + cdef object self_data = self._data + if (not isinstance(other, NvlinkTelemetrySample_v1)) 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(nvmlVgpuPgpuMetadata_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(nvmlVgpuPgpuMetadata_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(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), self._readonly, 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) + _cyb_cpython.PyBuffer_Release(buffer) @property - def version(self): - """int: """ - return self._ptr[0].version + def link_id(self): + """Union[~_numpy.uint32, int]: [in] LinkId""" + if self._data.size == 1: + return int(self._data.link_id[0]) + return self._data.link_id - @version.setter - def version(self, val): - if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - self._ptr[0].version = val + @link_id.setter + def link_id(self, val): + self._data.link_id = val @property - def revision(self): - """int: """ - return self._ptr[0].revision + 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.sample_type[0]) + return self._data.sample_type - @revision.setter - def revision(self, val): - if self._readonly: - raise ValueError("This VgpuPgpuMetadata instance is read-only") - self._ptr[0].revision = val + @sample_type.setter + def sample_type(self, val): + self._data.sample_type = val @property - def host_driver_version(self): - """~_numpy.int8: (array of length 80).""" - return _cyb_cpython.PyUnicode_FromString(self._ptr[0].hostDriverVersion) + 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 - @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) + @sample_count.setter + def sample_count(self, val): + self._data.sample_count = val @property - def pgpu_virtualization_caps(self): - """int: """ - return self._ptr[0].pgpuVirtualizationCaps + 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 - @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 + @samples.setter + def samples(self, val): + self._data.samples = val @property - def opaque_data_size(self): - """int: """ - return self._ptr[0].opaqueDataSize + 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.nvml_return[0]) + return self._data.nvml_return - @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 + @nvml_return.setter + def nvml_return(self, val): + self._data.nvml_return = val - @property - def opaque_data(self): - """~_numpy.int8: (array of length 4).""" - return _cyb_cpython.PyUnicode_FromString(self._ptr[0].opaqueData) + 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 NvlinkTelemetrySample_v1.from_data(self._data[key_:key_+1]) + out = self._data[key] + if isinstance(out, _numpy.recarray) and out.dtype == nvlink_telemetry_sample_v1_dtype: + return NvlinkTelemetrySample_v1.from_data(out) + return out - @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) + def __setitem__(self, key, val): + self._data[key] = val @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 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 VgpuPgpuMetadata instance wrapping the given NumPy array. + """Create an NvlinkTelemetrySample_v1 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 1D array of dtype `nvlink_telemetry_sample_v1_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_pgpu_metadata_dtype", vgpu_pgpu_metadata_dtype, VgpuPgpuMetadata) + 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 != 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, bint readonly=False, object owner=None): - """Create an VgpuPgpuMetadata instance wrapping the given pointer. + def from_ptr(intptr_t ptr, size_t size=1, bint readonly=False, object owner=None): + """Create an NvlinkTelemetrySample_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. + 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 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 + 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(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_gpu_instance_info_dtype_offsets(): - cdef nvmlGpuInstanceInfo_t pod +cdef _get_ecc_bank_remapper_histogram_v1_dtype_offsets(): + cdef nvmlEccBankRemapperHistogram_v1_t pod return _numpy.dtype({ - 'names': ['device_', 'id', 'profile_id', 'placement'], - 'formats': [_numpy.intp, _numpy.uint32, _numpy.uint32, gpu_instance_placement_dtype], + 'names': ['max_spare_group_count', 'no_spare_group_count'], + 'formats': [_numpy.uint32, _numpy.uint32], 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), + (&(pod.maxSpareGroupCount)) - (&pod), + (&(pod.noSpareGroupCount)) - (&pod), ], - 'itemsize': sizeof(nvmlGpuInstanceInfo_t), + 'itemsize': sizeof(nvmlEccBankRemapperHistogram_v1_t), }) -gpu_instance_info_dtype = _get_gpu_instance_info_dtype_offsets() +ecc_bank_remapper_histogram_v1_dtype = _get_ecc_bank_remapper_histogram_v1_dtype_offsets() -cdef class GpuInstanceInfo: - """Empty-initialize an instance of `nvmlGpuInstanceInfo_t`. +cdef class EccBankRemapperHistogram_v1: + """Empty-initialize an instance of `nvmlEccBankRemapperHistogram_v1_t`. - .. seealso:: `nvmlGpuInstanceInfo_t` + .. seealso:: `nvmlEccBankRemapperHistogram_v1_t` """ cdef: - nvmlGpuInstanceInfo_t *_ptr + nvmlEccBankRemapperHistogram_v1_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlGpuInstanceInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlEccBankRemapperHistogram_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating GpuInstanceInfo") + raise MemoryError("Error allocating EccBankRemapperHistogram_v1") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlGpuInstanceInfo_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__}.GpuInstanceInfo object at {hex(id(self))}>" + return f"<{__name__}.EccBankRemapperHistogram_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -19248,24 +19842,24 @@ cdef class GpuInstanceInfo: return (self._ptr) def __eq__(self, other): - cdef GpuInstanceInfo other_ - if not isinstance(other, GpuInstanceInfo): + cdef EccBankRemapperHistogram_v1 other_ + if not isinstance(other, EccBankRemapperHistogram_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuInstanceInfo_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(nvmlGpuInstanceInfo_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(nvmlGpuInstanceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlEccBankRemapperHistogram_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 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 @@ -19273,67 +19867,44 @@ cdef class GpuInstanceInfo: setattr(self, key, val) @property - def placement(self): - """GpuInstancePlacement: """ - return GpuInstancePlacement.from_ptr(&(self._ptr[0].placement), self._readonly, 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 + def max_spare_group_count(self): + """int: Number of groups that have maximum spare.""" + return self._ptr[0].maxSpareGroupCount - @id.setter - def id(self, val): + @max_spare_group_count.setter + def max_spare_group_count(self, val): if self._readonly: - raise ValueError("This GpuInstanceInfo instance is read-only") - self._ptr[0].id = val + raise ValueError("This EccBankRemapperHistogram_v1 instance is read-only") + self._ptr[0].maxSpareGroupCount = val @property - def profile_id(self): - """int: """ - return self._ptr[0].profileId + def no_spare_group_count(self): + """int: Number of groups that have not spare.""" + return self._ptr[0].noSpareGroupCount - @profile_id.setter - def profile_id(self, val): + @no_spare_group_count.setter + def no_spare_group_count(self, val): if self._readonly: - raise ValueError("This GpuInstanceInfo instance is read-only") - self._ptr[0].profileId = val + raise ValueError("This EccBankRemapperHistogram_v1 instance is read-only") + self._ptr[0].noSpareGroupCount = 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) + """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 GpuInstanceInfo 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 `gpu_instance_info_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, "gpu_instance_info_dtype", gpu_instance_info_dtype, GpuInstanceInfo) + 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 GpuInstanceInfo 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. @@ -19342,68 +19913,65 @@ cdef class GpuInstanceInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef GpuInstanceInfo obj = GpuInstanceInfo.__new__(GpuInstanceInfo) + cdef EccBankRemapperHistogram_v1 obj = EccBankRemapperHistogram_v1.__new__(EccBankRemapperHistogram_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlGpuInstanceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlEccBankRemapperHistogram_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating GpuInstanceInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlGpuInstanceInfo_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_compute_instance_info_dtype_offsets(): - cdef nvmlComputeInstanceInfo_t pod +cdef _get_excluded_device_info_dtype_offsets(): + cdef nvmlExcludedDeviceInfo_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': ['pci_info', 'uuid'], + 'formats': [pci_info_dtype, (_numpy.int8, 80)], 'offsets': [ - (&(pod.device)) - (&pod), - (&(pod.gpuInstance)) - (&pod), - (&(pod.id)) - (&pod), - (&(pod.profileId)) - (&pod), - (&(pod.placement)) - (&pod), + (&(pod.pciInfo)) - (&pod), + (&(pod.uuid)) - (&pod), ], - 'itemsize': sizeof(nvmlComputeInstanceInfo_t), + 'itemsize': sizeof(nvmlExcludedDeviceInfo_t), }) -compute_instance_info_dtype = _get_compute_instance_info_dtype_offsets() +excluded_device_info_dtype = _get_excluded_device_info_dtype_offsets() -cdef class ComputeInstanceInfo: - """Empty-initialize an instance of `nvmlComputeInstanceInfo_t`. +cdef class ExcludedDeviceInfo: + """Empty-initialize an instance of `nvmlExcludedDeviceInfo_t`. - .. seealso:: `nvmlComputeInstanceInfo_t` + .. seealso:: `nvmlExcludedDeviceInfo_t` """ cdef: - nvmlComputeInstanceInfo_t *_ptr + nvmlExcludedDeviceInfo_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(nvmlExcludedDeviceInfo_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ComputeInstanceInfo") + raise MemoryError("Error allocating ExcludedDeviceInfo") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlComputeInstanceInfo_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__}.ComputeInstanceInfo object at {hex(id(self))}>" + return f"<{__name__}.ExcludedDeviceInfo object at {hex(id(self))}>" @property def ptr(self): @@ -19417,24 +19985,24 @@ cdef class ComputeInstanceInfo: return (self._ptr) def __eq__(self, other): - cdef ComputeInstanceInfo other_ - if not isinstance(other, ComputeInstanceInfo): + cdef ExcludedDeviceInfo other_ + if not isinstance(other, ExcludedDeviceInfo): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlComputeInstanceInfo_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(nvmlComputeInstanceInfo_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(nvmlComputeInstanceInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) if self._ptr == NULL: - raise MemoryError("Error allocating ComputeInstanceInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlComputeInstanceInfo_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 @@ -19442,78 +20010,53 @@ cdef class ComputeInstanceInfo: setattr(self, key, val) @property - def placement(self): - """ComputeInstancePlacement: """ - return ComputeInstancePlacement.from_ptr(&(self._ptr[0].placement), self._readonly, 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 + def pci_info(self): + """PciInfo: """ + return PciInfo.from_ptr( + &(self._ptr[0].pciInfo), + readonly=self._readonly, + owner=self, + ) - @id.setter - def id(self, val): + @pci_info.setter + def pci_info(self, val): if self._readonly: - raise ValueError("This ComputeInstanceInfo instance is read-only") - self._ptr[0].id = 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 profile_id(self): - """int: """ - return self._ptr[0].profileId + def uuid(self): + """~_numpy.int8: (array of length 80).""" + return _cyb_cpython.PyUnicode_FromString(self._ptr[0].uuid) - @profile_id.setter - def profile_id(self, val): + @uuid.setter + def uuid(self, val): if self._readonly: - raise ValueError("This ComputeInstanceInfo instance is read-only") - self._ptr[0].profileId = val + 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) @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 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 ComputeInstanceInfo 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 `compute_instance_info_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, "compute_instance_info_dtype", compute_instance_info_dtype, ComputeInstanceInfo) + 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 ComputeInstanceInfo 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. @@ -19522,68 +20065,69 @@ cdef class ComputeInstanceInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef ComputeInstanceInfo obj = ComputeInstanceInfo.__new__(ComputeInstanceInfo) + cdef ExcludedDeviceInfo obj = ExcludedDeviceInfo.__new__(ExcludedDeviceInfo) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlComputeInstanceInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlExcludedDeviceInfo_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating ComputeInstanceInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlComputeInstanceInfo_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_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets(): - cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_t pod +cdef _get_process_detail_list_v1_dtype_offsets(): + cdef nvmlProcessDetailList_v1_t pod return _numpy.dtype({ - 'names': ['version', 'entry_count', 'entries'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.intp], + 'names': ['version', 'mode', 'num_proc_array_entries', 'proc_array'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.intp], 'offsets': [ (&(pod.version)) - (&pod), - (&(pod.entryCount)) - (&pod), - (&(pod.entries)) - (&pod), + (&(pod.mode)) - (&pod), + (&(pod.numProcArrayEntries)) - (&pod), + (&(pod.procArray)) - (&pod), ], - 'itemsize': sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), + 'itemsize': sizeof(nvmlProcessDetailList_v1_t), }) -ecc_sram_unique_uncorrected_error_counts_v1_dtype = _get_ecc_sram_unique_uncorrected_error_counts_v1_dtype_offsets() +process_detail_list_v1_dtype = _get_process_detail_list_v1_dtype_offsets() -cdef class EccSramUniqueUncorrectedErrorCounts_v1: - """Empty-initialize an instance of `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t`. +cdef class ProcessDetailList_v1: + """Empty-initialize an instance of `nvmlProcessDetailList_v1_t`. - .. seealso:: `nvmlEccSramUniqueUncorrectedErrorCounts_v1_t` + .. seealso:: `nvmlProcessDetailList_v1_t` """ cdef: - nvmlEccSramUniqueUncorrectedErrorCounts_v1_t *_ptr + nvmlProcessDetailList_v1_t *_ptr object _owner bint _owned bint _readonly dict _refs def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlProcessDetailList_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") + raise MemoryError("Error allocating ProcessDetailList_v1") self._owner = None self._owned = True self._readonly = False self._refs = {} def __dealloc__(self): - cdef nvmlEccSramUniqueUncorrectedErrorCounts_v1_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__}.EccSramUniqueUncorrectedErrorCounts_v1 object at {hex(id(self))}>" + return f"<{__name__}.ProcessDetailList_v1 object at {hex(id(self))}>" @property def ptr(self): @@ -19597,24 +20141,24 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: return (self._ptr) def __eq__(self, other): - cdef EccSramUniqueUncorrectedErrorCounts_v1 other_ - if not isinstance(other, EccSramUniqueUncorrectedErrorCounts_v1): + cdef ProcessDetailList_v1 other_ + if not isinstance(other, ProcessDetailList_v1): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_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(nvmlEccSramUniqueUncorrectedErrorCounts_v1_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(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + self._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) if self._ptr == NULL: - raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_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 @@ -19623,48 +20167,64 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: @property def version(self): - """int: the API version number""" + """int: Struct version, MUST be nvmlProcessDetailList_v1.""" return self._ptr[0].version @version.setter def version(self, val): if self._readonly: - raise ValueError("This EccSramUniqueUncorrectedErrorCounts_v1 instance is read-only") + raise ValueError("This ProcessDetailList_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: + def mode(self): + """int: Process mode, One of `nvmlProcessMode_t`.""" + return self._ptr[0].mode + + @mode.setter + def mode(self, val): + if self._readonly: + raise ValueError("This ProcessDetailList_v1 instance is read-only") + self._ptr[0].mode = val + + @property + def proc_array(self): + """int: Process array.""" + if self._ptr[0].procArray == NULL or self._ptr[0].numProcArrayEntries == 0: return [] - return EccSramUniqueUncorrectedErrorEntry_v1.from_ptr((self._ptr[0].entries), self._ptr[0].entryCount) + return ProcessDetail_v1.from_ptr( + (self._ptr[0].procArray), + self._ptr[0].numProcArrayEntries, + owner=self, + readonly=self._readonly + ) - @entries.setter - def entries(self, val): + @proc_array.setter + def proc_array(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 + 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 EccSramUniqueUncorrectedErrorCounts_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t), EccSramUniqueUncorrectedErrorCounts_v1) + """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 EccSramUniqueUncorrectedErrorCounts_v1 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 `ecc_sram_unique_uncorrected_error_counts_v1_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, "ecc_sram_unique_uncorrected_error_counts_v1_dtype", ecc_sram_unique_uncorrected_error_counts_v1_dtype, EccSramUniqueUncorrectedErrorCounts_v1) + 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 EccSramUniqueUncorrectedErrorCounts_v1 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. @@ -19673,16 +20233,16 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef EccSramUniqueUncorrectedErrorCounts_v1 obj = EccSramUniqueUncorrectedErrorCounts_v1.__new__(EccSramUniqueUncorrectedErrorCounts_v1) + cdef ProcessDetailList_v1 obj = ProcessDetailList_v1.__new__(ProcessDetailList_v1) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlProcessDetailList_v1_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating EccSramUniqueUncorrectedErrorCounts_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlEccSramUniqueUncorrectedErrorCounts_v1_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 @@ -19690,49 +20250,49 @@ cdef class EccSramUniqueUncorrectedErrorCounts_v1: return obj -cdef _get_nvlink_firmware_info_dtype_offsets(): - cdef nvmlNvlinkFirmwareInfo_t pod +cdef _get_bridge_chip_hierarchy_dtype_offsets(): + cdef nvmlBridgeChipHierarchy_t pod return _numpy.dtype({ - 'names': ['firmware_version', 'num_valid_entries'], - 'formats': [(nvlink_firmware_version_dtype, 100), _numpy.uint32], + 'names': ['bridge_count', 'bridge_chip_info'], + 'formats': [_numpy.uint8, (bridge_chip_info_dtype, 128)], 'offsets': [ - (&(pod.firmwareVersion)) - (&pod), - (&(pod.numValidEntries)) - (&pod), + (&(pod.bridgeCount)) - (&pod), + (&(pod.bridgeChipInfo)) - (&pod), ], - 'itemsize': sizeof(nvmlNvlinkFirmwareInfo_t), + 'itemsize': sizeof(nvmlBridgeChipHierarchy_t), }) -nvlink_firmware_info_dtype = _get_nvlink_firmware_info_dtype_offsets() +bridge_chip_hierarchy_dtype = _get_bridge_chip_hierarchy_dtype_offsets() -cdef class NvlinkFirmwareInfo: - """Empty-initialize an instance of `nvmlNvlinkFirmwareInfo_t`. +cdef class BridgeChipHierarchy: + """Empty-initialize an instance of `nvmlBridgeChipHierarchy_t`. - .. seealso:: `nvmlNvlinkFirmwareInfo_t` + .. seealso:: `nvmlBridgeChipHierarchy_t` """ cdef: - nvmlNvlinkFirmwareInfo_t *_ptr + nvmlBridgeChipHierarchy_t *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkFirmwareInfo_t)) + self._ptr = _cyb_calloc(1, sizeof(nvmlBridgeChipHierarchy_t)) if self._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") + raise MemoryError("Error allocating BridgeChipHierarchy") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlNvlinkFirmwareInfo_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__}.NvlinkFirmwareInfo object at {hex(id(self))}>" + return f"<{__name__}.BridgeChipHierarchy object at {hex(id(self))}>" @property def ptr(self): @@ -19746,24 +20306,24 @@ cdef class NvlinkFirmwareInfo: return (self._ptr) def __eq__(self, other): - cdef NvlinkFirmwareInfo other_ - if not isinstance(other, NvlinkFirmwareInfo): + cdef BridgeChipHierarchy other_ + if not isinstance(other, BridgeChipHierarchy): return False other_ = other - return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkFirmwareInfo_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(nvmlNvlinkFirmwareInfo_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(nvmlNvlinkFirmwareInfo_t)) + self._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) if self._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlNvlinkFirmwareInfo_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 @@ -19771,47 +20331,44 @@ 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, self._readonly) - - @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 + def bridge_chip_info(self): + """BridgeChipInfo: """ + return BridgeChipInfo.from_ptr( + &(self._ptr[0].bridgeChipInfo), + self._ptr[0].bridgeCount, + readonly=self._readonly, + owner=self, + ) - @num_valid_entries.setter - def num_valid_entries(self, val): + @bridge_chip_info.setter + def bridge_chip_info(self, val): if self._readonly: - raise ValueError("This NvlinkFirmwareInfo instance is read-only") - self._ptr[0].numValidEntries = 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 NvlinkFirmwareInfo instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkFirmwareInfo_t), NvlinkFirmwareInfo) + """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 NvlinkFirmwareInfo 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 `nvlink_firmware_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, "nvlink_firmware_info_dtype", nvlink_firmware_info_dtype, NvlinkFirmwareInfo) + 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 NvlinkFirmwareInfo 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. @@ -19820,192 +20377,5966 @@ cdef class NvlinkFirmwareInfo: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef NvlinkFirmwareInfo obj = NvlinkFirmwareInfo.__new__(NvlinkFirmwareInfo) + cdef BridgeChipHierarchy obj = BridgeChipHierarchy.__new__(BridgeChipHierarchy) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkFirmwareInfo_t)) + obj._ptr = _cyb_malloc(sizeof(nvmlBridgeChipHierarchy_t)) if obj._ptr == NULL: - raise MemoryError("Error allocating NvlinkFirmwareInfo") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkFirmwareInfo_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_vgpu_scheduler_log_info_v2_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_v2_t pod +cdef _get_sample_dtype_offsets(): + cdef nvmlSample_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': ['time_stamp', 'sample_value'], + 'formats': [_numpy.uint64, value_dtype], 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.avgFactor)) - (&pod), - (&(pod.timeslice)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), + (&(pod.timeStamp)) - (&pod), + (&(pod.sampleValue)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v2_t), + 'itemsize': sizeof(nvmlSample_t), }) -vgpu_scheduler_log_info_v2_dtype = _get_vgpu_scheduler_log_info_v2_dtype_offsets() +sample_dtype = _get_sample_dtype_offsets() -cdef class VgpuSchedulerLogInfo_v2: - """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v2_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:: `nvmlVgpuSchedulerLogInfo_v2_t` + .. seealso:: `nvmlSample_t` """ cdef: - nvmlVgpuSchedulerLogInfo_v2_t *_ptr + readonly object _data 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 __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__}.VgpuSchedulerLogInfo_v2 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 VgpuSchedulerLogInfo_v2 other_ - if not isinstance(other, VgpuSchedulerLogInfo_v2): + 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(nvmlVgpuSchedulerLogInfo_v2_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_v2_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_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) + _cyb_cpython.PyBuffer_Release(buffer) @property - def log_entries(self): - """VgpuSchedulerLogEntry_v2: OUT: Structure to store the state and logs of a software runlist.""" - return VgpuSchedulerLogEntry_v2.from_ptr(&(self._ptr[0].logEntries), 200, self._readonly) + 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 - @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) + @time_stamp.setter + def time_stamp(self, val): + self._data.time_stamp = 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 + def sample_value(self): + """value_dtype: """ + return self._data.sample_value - @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 + @sample_value.setter + def sample_value(self, val): + self._data.sample_value = val - @property - def scheduler_policy(self): - """int: OUT: Scheduler policy.""" - return self._ptr[0].schedulerPolicy + 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 - @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 + def __setitem__(self, key, val): + self._data[key] = 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 + @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)) - @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 + @staticmethod + def from_data(data): + """Create an Sample instance wrapping the given NumPy array. - @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 + Args: + data (_numpy.ndarray): a 1D array of dtype `sample_dtype` holding the data. + """ + 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, 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. + 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 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_vgpu_instance_utilization_sample_dtype_offsets(): + cdef nvmlVgpuInstanceUtilizationSample_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], + 'offsets': [ + (&(pod.vgpuInstance)) - (&pod), + (&(pod.timeStamp)) - (&pod), + (&(pod.smUtil)) - (&pod), + (&(pod.memUtil)) - (&pod), + (&(pod.encUtil)) - (&pod), + (&(pod.decUtil)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuInstanceUtilizationSample_t), + }) + +vgpu_instance_utilization_sample_dtype = _get_vgpu_instance_utilization_sample_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`. + If default-constructed, the instance represents a single struct. + + Args: + size (int): number of structs, default=1. + + .. seealso:: `nvmlVgpuInstanceUtilizationSample_t` + """ + cdef: + readonly object _data + object _owner + + 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=self._readonly) + 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=self._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 VgpuSchedulerLogInfo_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + 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__}.VgpuSchedulerLogInfo_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 VgpuSchedulerLogInfo_v1 other_ + if not isinstance(other, VgpuSchedulerLogInfo_v1): + return False + other_ = other + 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(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(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 + + @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 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 VgpuSchedulerLogInfo_v1 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. + """ + 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 VgpuSchedulerLogInfo_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 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 + return obj + + +cdef _get_vgpu_scheduler_state_v1_dtype_offsets(): + cdef nvmlVgpuSchedulerState_v1_t 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], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.engineId)) - (&pod), + (&(pod.schedulerPolicy)) - (&pod), + (&(pod.enableARRMode)) - (&pod), + (&(pod.schedulerParams)) - (&pod), + ], + 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), + }) + +vgpu_scheduler_state_v1_dtype = _get_vgpu_scheduler_state_v1_dtype_offsets() + +cdef class VgpuSchedulerState_v1: + """Empty-initialize an instance of `nvmlVgpuSchedulerState_v1_t`. + + + .. seealso:: `nvmlVgpuSchedulerState_v1_t` + """ + cdef: + nvmlVgpuSchedulerState_v1_t *_ptr + object _owner + bint _owned + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating VgpuSchedulerState_v1") + self._owner = None + self._owned = True + self._readonly = False + + def __dealloc__(self): + 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__}.VgpuSchedulerState_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 VgpuSchedulerState_v1 other_ + if not isinstance(other, VgpuSchedulerState_v1): + return False + other_ = other + 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(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(nvmlVgpuSchedulerState_v1_t)) + if self._ptr == NULL: + 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 + else: + setattr(self, key, val) - @timeslice.setter - def timeslice(self, val): + @property + def scheduler_params(self): + """VgpuSchedulerSetParams: IN: vGPU Scheduler Parameters.""" + return VgpuSchedulerSetParams.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_v2 instance is read-only") - self._ptr[0].timeslice = val + 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 entries_count(self): - """int: OUT: Count of log entries fetched.""" - return self._ptr[0].entriesCount + def version(self): + """int: IN: The version number of this struct.""" + return self._ptr[0].version - @entries_count.setter - def entries_count(self, val): + @version.setter + def version(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].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 + + @scheduler_policy.setter + def scheduler_policy(self, val): + if self._readonly: + raise ValueError("This VgpuSchedulerState_v1 instance is read-only") + self._ptr[0].schedulerPolicy = val + + @property + def enable_arr_mode(self): + """int: IN: Adaptive Round Robin scheduler.""" + return self._ptr[0].enableARRMode + + @enable_arr_mode.setter + def enable_arr_mode(self, val): + if self._readonly: + 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. @@ -20014,70 +26345,221 @@ 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_vgpu_instances_utilization_info_v1_dtype_offsets(): - cdef nvmlVgpuInstancesUtilizationInfo_v1_t pod +cdef _get_grid_licensable_features_dtype_offsets(): + cdef nvmlGridLicensableFeatures_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': ['is_grid_license_supported', 'licensable_features_count', 'grid_licensable_features'], + 'formats': [_numpy.int32, _numpy.uint32, (grid_licensable_feature_dtype, 3)], + 'offsets': [ + (&(pod.isGridLicenseSupported)) - (&pod), + (&(pod.licensableFeaturesCount)) - (&pod), + (&(pod.gridLicensableFeatures)) - (&pod), + ], + 'itemsize': sizeof(nvmlGridLicensableFeatures_t), + }) + +grid_licensable_features_dtype = _get_grid_licensable_features_dtype_offsets() + +cdef class GridLicensableFeatures: + """Empty-initialize an instance of `nvmlGridLicensableFeatures_t`. + + + .. seealso:: `nvmlGridLicensableFeatures_t` + """ + cdef: + nvmlGridLicensableFeatures_t *_ptr + 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 __repr__(self): + return f"<{__name__}.GridLicensableFeatures 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 GridLicensableFeatures other_ + if not isinstance(other, GridLicensableFeatures): + return False + other_ = other + 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(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(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 + else: + setattr(self, key, val) + + @property + def grid_licensable_features(self): + """GridLicensableFeature: """ + return GridLicensableFeature.from_ptr( + &(self._ptr[0].gridLicensableFeatures), + self._ptr[0].licensableFeaturesCount, + readonly=self._readonly, + owner=self, + ) + + @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) + + @property + def is_grid_license_supported(self): + """int: """ + return self._ptr[0].isGridLicenseSupported + + @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 + + @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) + + @staticmethod + def from_data(data): + """Create an GridLicensableFeatures instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `grid_licensable_features_dtype` holding the data. + """ + 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 GridLicensableFeatures 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 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 + return obj + + +cdef _get_nv_link_info_v2_dtype_offsets(): + cdef nvmlNvLinkInfo_v2_t pod + return _numpy.dtype({ + '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): @@ -20091,96 +26573,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) + 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. @@ -20189,62 +26660,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): @@ -20265,7 +26738,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()) @@ -20276,33 +26749,194 @@ 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 + + @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_ + 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 PwrModelMetricsDlppm1x.from_data(self._data[key_:key_+1]) + out = self._data[key] + 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): + self._data[key] = val + + @staticmethod + def from_buffer(buffer): + """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 PwrModelMetricsDlppm1x instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `pwr_model_metrics_dlppm1x_dtype` holding the data. + """ + 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 != 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 PwrModelMetricsDlppm1x 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 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(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_perf_metrics_pfpp1x_sample_dtype_offsets(): + cdef nvmlPerfMetricsPfpp1xSample_t pod + return _numpy.dtype({ + 'names': ['estimated_metrics'], + 'formats': [pwr_model_metrics_pfpp1x_dtype], + 'offsets': [ + (&(pod.estimatedMetrics)) - (&pod), + ], + 'itemsize': sizeof(nvmlPerfMetricsPfpp1xSample_t), + }) + +perf_metrics_pfpp1x_sample_dtype = _get_perf_metrics_pfpp1x_sample_dtype_offsets() + +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:: `nvmlPerfMetricsPfpp1xSample_t` + """ + cdef: + readonly object _data + object _owner + + 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) }" + + 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 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, PerfMetricsPfpp1xSample)) 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): + """pwr_model_metrics_pfpp1x_dtype: Estimated metrics from the PFPP 1x controller.""" + return self._data.estimated_metrics - @counter_value.setter - def counter_value(self, val): - self._data.counter_value = val + @estimated_metrics.setter + def estimated_metrics(self, val): + self._data.estimated_metrics = val def __getitem__(self, key): cdef ssize_t key_ @@ -20314,10 +26948,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 PerfMetricsPfpp1xSample.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 == perf_metrics_pfpp1x_sample_dtype: + return PerfMetricsPfpp1xSample.from_data(out) return out def __setitem__(self, key, val): @@ -20325,627 +26959,589 @@ 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 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 PRMCounter_v1 instance wrapping the given NumPy array. + """Create an PerfMetricsPfpp1xSample 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 `perf_metrics_pfpp1x_sample_dtype` holding the data. """ - cdef PRMCounter_v1 obj = PRMCounter_v1.__new__(PRMCounter_v1) + 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 != prm_counter_v1_dtype: - raise ValueError("data array must be of dtype prm_counter_v1_dtype") + 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, size_t size=1, bint readonly=False): - """Create an PRMCounter_v1 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. 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 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(nvmlPRMCounter_v1_t) * size, flag) - data = _numpy.ndarray(size, buffer=buf, dtype=prm_counter_v1_dtype) + 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_log_dtype_offsets(): - cdef nvmlVgpuSchedulerLog_t pod +cdef _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets(): + cdef nvmlPwrModelMetricsDlppm1xDramclkEstimates_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', 'num_estimated_metrics'], + 'formats': [(pwr_model_metrics_dlppm1x_dtype, 8), _numpy.uint8], 'offsets': [ - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), + (&(pod.estimatedMetrics)) - (&pod), + (&(pod.numEstimatedMetrics)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerLog_t), + 'itemsize': sizeof(nvmlPwrModelMetricsDlppm1xDramclkEstimates_t), }) -vgpu_scheduler_log_dtype = _get_vgpu_scheduler_log_dtype_offsets() +pwr_model_metrics_dlppm1x_dramclk_estimates_dtype = _get_pwr_model_metrics_dlppm1x_dramclk_estimates_dtype_offsets() -cdef class VgpuSchedulerLog: - """Empty-initialize an instance of `nvmlVgpuSchedulerLog_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:: `nvmlVgpuSchedulerLog_t` + .. seealso:: `nvmlPwrModelMetricsDlppm1xDramclkEstimates_t` """ cdef: - nvmlVgpuSchedulerLog_t *_ptr + readonly object _data 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 + readonly tuple _estimated_metrics - def __dealloc__(self): - cdef nvmlVgpuSchedulerLog_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__}.VgpuSchedulerLog 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 VgpuSchedulerLog other_ - if not isinstance(other, VgpuSchedulerLog): + 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(nvmlVgpuSchedulerLog_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(nvmlVgpuSchedulerLog_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(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), self._readonly, 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, self._readonly) - - @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 + _cyb_cpython.PyBuffer_Release(buffer) @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 + 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 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 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 - @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 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 VgpuSchedulerLog 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_log_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_log_dtype", vgpu_scheduler_log_dtype, VgpuSchedulerLog) + 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=self._readonly) + 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 VgpuSchedulerLog 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 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 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=self._readonly) + estimatedMetrics_list.append(estimatedMetrics_obj) + obj._estimatedMetrics = tuple(estimatedMetrics_list) return obj -cdef _get_vgpu_scheduler_get_state_dtype_offsets(): - cdef nvmlVgpuSchedulerGetState_t pod +cdef _get_observed_metrics_dtype_offsets(): + cdef nvmlObservedMetrics_t pod return _numpy.dtype({ - 'names': ['scheduler_policy', 'arr_mode', 'scheduler_params'], - 'formats': [_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.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(nvmlVgpuSchedulerGetState_t), + 'itemsize': sizeof(nvmlObservedMetrics_t), }) -vgpu_scheduler_get_state_dtype = _get_vgpu_scheduler_get_state_dtype_offsets() +observed_metrics_dtype = _get_observed_metrics_dtype_offsets() -cdef class VgpuSchedulerGetState: - """Empty-initialize an instance of `nvmlVgpuSchedulerGetState_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:: `nvmlVgpuSchedulerGetState_t` + .. seealso:: `nvmlObservedMetrics_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 - 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=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__}.VgpuSchedulerGetState 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 VgpuSchedulerGetState other_ - if not isinstance(other, VgpuSchedulerGetState): + 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(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 + _cyb_cpython.PyBuffer_Release(buffer) - 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 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: """ - return VgpuSchedulerParams.from_ptr(&(self._ptr[0].schedulerParams), self._readonly, 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 VgpuSchedulerGetState 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 scheduler_policy(self): - """int: """ - return self._ptr[0].schedulerPolicy + def core_rail(self): + """core_rail_metrics_dtype: Observed core rail metrics.""" + return self._data.core_rail - @scheduler_policy.setter - def scheduler_policy(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerGetState instance is read-only") - self._ptr[0].schedulerPolicy = val + @core_rail.setter + def core_rail(self, val): + self._data.core_rail = val @property - def arr_mode(self): - """int: """ - return self._ptr[0].arrMode + def fb_rail(self): + """rail_metrics_dtype: Observed fb rail metrics.""" + return self._data.fb_rail - @arr_mode.setter - def arr_mode(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerGetState instance is read-only") - self._ptr[0].arrMode = val + @fb_rail.setter + def fb_rail(self, val): + self._data.fb_rail = val + + @property + def tgp_pwr_tuple(self): + """pmgr_pwr_tuple_dtype: Observed 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: Observed 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_ + 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 VgpuSchedulerGetState instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerGetState_t), VgpuSchedulerGetState) + """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 VgpuSchedulerGetState 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_get_state_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_get_state_dtype", vgpu_scheduler_get_state_dtype, VgpuSchedulerGetState) + 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 VgpuSchedulerGetState 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 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 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_state_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerStateInfo_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'], - 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, vgpu_scheduler_params_dtype], + 'names': ['observed_metrics'], + 'formats': [observed_metrics_dtype], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), + (&(pod.observedMetrics)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerStateInfo_v1_t), + 'itemsize': sizeof(nvmlPerfMetricsDlppc2xSample_t), }) -vgpu_scheduler_state_info_v1_dtype = _get_vgpu_scheduler_state_info_v1_dtype_offsets() +perf_metrics_dlppc2x_sample_dtype = _get_perf_metrics_dlppc2x_sample_dtype_offsets() -cdef class VgpuSchedulerStateInfo_v1: - """Empty-initialize an instance of `nvmlVgpuSchedulerStateInfo_v1_t`. +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. + Args: + size (int): number of structs, default=1. - .. seealso:: `nvmlVgpuSchedulerStateInfo_v1_t` + .. seealso:: `nvmlPerfMetricsDlppc2xSample_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=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__}.VgpuSchedulerStateInfo_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 VgpuSchedulerStateInfo_v1 other_ - if not isinstance(other, VgpuSchedulerStateInfo_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(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 - - 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), self._readonly, 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 + _cyb_cpython.PyBuffer_Release(buffer) @property - def scheduler_policy(self): - """int: OUT: Scheduler policy.""" - return self._ptr[0].schedulerPolicy + def observed_metrics(self): + """observed_metrics_dtype: Observed metrics from the DLPPC 2x controller.""" + return self._data.observed_metrics - @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 + @observed_metrics.setter + def observed_metrics(self, val): + self._data.observed_metrics = 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 __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 - @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 + 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 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 VgpuSchedulerStateInfo_v1 instance wrapping the given NumPy array. + """Create an PerfMetricsDlppc2xSample instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a 1D array of dtype `perf_metrics_dlppc2x_sample_dtype` holding the data. + """ + 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) - 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) + 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 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 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 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_log_info_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerLogInfo_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', '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': ['dlppc2x', 'pfpp1x'], + 'formats': [perf_metrics_dlppc2x_sample_dtype, perf_metrics_pfpp1x_sample_dtype], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.arrMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), - (&(pod.entriesCount)) - (&pod), - (&(pod.logEntries)) - (&pod), + (&(pod.dlppc2x)) - (&pod), + (&(pod.pfpp1x)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerLogInfo_v1_t), + 'itemsize': sizeof(cuda_bindings_nvml__anon_pod8), }) -vgpu_scheduler_log_info_v1_dtype = _get_vgpu_scheduler_log_info_v1_dtype_offsets() +_py_anon_pod8_dtype = _get__py_anon_pod8_dtype_offsets() -cdef class VgpuSchedulerLogInfo_v1: - """Empty-initialize an instance of `nvmlVgpuSchedulerLogInfo_v1_t`. +cdef class _py_anon_pod8: + """Empty-initialize an instance of `cuda_bindings_nvml__anon_pod8`. - .. seealso:: `nvmlVgpuSchedulerLogInfo_v1_t` + .. seealso:: `cuda_bindings_nvml__anon_pod8` """ cdef: - nvmlVgpuSchedulerLogInfo_v1_t *_ptr + cuda_bindings_nvml__anon_pod8 *_ptr object _owner bint _owned bint _readonly def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + self._ptr = _cyb_calloc(1, sizeof(cuda_bindings_nvml__anon_pod8)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") + raise MemoryError("Error allocating _py_anon_pod8") self._owner = None self._owned = True self._readonly = False def __dealloc__(self): - cdef nvmlVgpuSchedulerLogInfo_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__}.VgpuSchedulerLogInfo_v1 object at {hex(id(self))}>" + return f"<{__name__}._py_anon_pod8 object at {hex(id(self))}>" @property def ptr(self): @@ -20959,24 +27555,24 @@ cdef class VgpuSchedulerLogInfo_v1: return (self._ptr) def __eq__(self, other): - cdef VgpuSchedulerLogInfo_v1 other_ - if not isinstance(other, VgpuSchedulerLogInfo_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(nvmlVgpuSchedulerLogInfo_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(nvmlVgpuSchedulerLogInfo_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(nvmlVgpuSchedulerLogInfo_v1_t)) + self._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod8)) if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") - _cyb_memcpy(self._ptr, val.ctypes.data, sizeof(nvmlVgpuSchedulerLogInfo_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 @@ -20984,103 +27580,56 @@ cdef class VgpuSchedulerLogInfo_v1: setattr(self, key, val) @property - def scheduler_params(self): - """VgpuSchedulerParams: OUT: vGPU Scheduler Parameters.""" - return VgpuSchedulerParams.from_ptr(&(self._ptr[0].schedulerParams), self._readonly, 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, self._readonly) - - @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 - - @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 dlppc2x(self): + """PerfMetricsDlppc2xSample: """ + return PerfMetricsDlppc2xSample.from_ptr( + &(self._ptr[0].dlppc2x), + 1, + readonly=self._readonly, + owner=self, + ) - @arr_mode.setter - def arr_mode(self, val): + @dlppc2x.setter + def dlppc2x(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") - self._ptr[0].arrMode = 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 entries_count(self): - """int: OUT: Count of log entries fetched.""" - return self._ptr[0].entriesCount + def pfpp1x(self): + """PerfMetricsPfpp1xSample: """ + return PerfMetricsPfpp1xSample.from_ptr( + &(self._ptr[0].pfpp1x), + 1, + readonly=self._readonly, + owner=self, + ) - @entries_count.setter - def entries_count(self, val): + @pfpp1x.setter + def pfpp1x(self, val): if self._readonly: - raise ValueError("This VgpuSchedulerLogInfo_v1 instance is read-only") - self._ptr[0].entriesCount = 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 VgpuSchedulerLogInfo_v1 instance with the memory from the given buffer.""" - return _cyb_from_buffer(buffer, sizeof(nvmlVgpuSchedulerLogInfo_v1_t), VgpuSchedulerLogInfo_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 VgpuSchedulerLogInfo_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_log_info_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_log_info_v1_dtype", vgpu_scheduler_log_info_v1_dtype, VgpuSchedulerLogInfo_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 VgpuSchedulerLogInfo_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. @@ -21089,396 +27638,377 @@ cdef class VgpuSchedulerLogInfo_v1: """ if ptr == 0: raise ValueError("ptr must not be null (0)") - cdef VgpuSchedulerLogInfo_v1 obj = VgpuSchedulerLogInfo_v1.__new__(VgpuSchedulerLogInfo_v1) + cdef _py_anon_pod8 obj = _py_anon_pod8.__new__(_py_anon_pod8) if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerLogInfo_v1_t)) + obj._ptr = _cyb_malloc(sizeof(cuda_bindings_nvml__anon_pod8)) if obj._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerLogInfo_v1") - _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlVgpuSchedulerLogInfo_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_vgpu_scheduler_state_v1_dtype_offsets(): - cdef nvmlVgpuSchedulerState_v1_t pod +cdef _get_perf_metric_controller_sample_dtype_offsets(): + cdef nvmlPerfMetricControllerSample_t 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': ['controller_type', 'data_'], + 'formats': [_numpy.uint32, _py_anon_pod8_dtype], 'offsets': [ - (&(pod.version)) - (&pod), - (&(pod.engineId)) - (&pod), - (&(pod.schedulerPolicy)) - (&pod), - (&(pod.enableARRMode)) - (&pod), - (&(pod.schedulerParams)) - (&pod), + (&(pod.controllerType)) - (&pod), + (&(pod.data)) - (&pod), ], - 'itemsize': sizeof(nvmlVgpuSchedulerState_v1_t), + 'itemsize': sizeof(nvmlPerfMetricControllerSample_t), }) -vgpu_scheduler_state_v1_dtype = _get_vgpu_scheduler_state_v1_dtype_offsets() +perf_metric_controller_sample_dtype = _get_perf_metric_controller_sample_dtype_offsets() -cdef class VgpuSchedulerState_v1: - """Empty-initialize an instance of `nvmlVgpuSchedulerState_v1_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:: `nvmlVgpuSchedulerState_v1_t` + .. seealso:: `nvmlPerfMetricControllerSample_t` """ cdef: - nvmlVgpuSchedulerState_v1_t *_ptr + readonly object _data object _owner - bint _owned - bint _readonly - - def __init__(self): - self._ptr = _cyb_calloc(1, sizeof(nvmlVgpuSchedulerState_v1_t)) - if self._ptr == NULL: - raise MemoryError("Error allocating VgpuSchedulerState_v1") - self._owner = None - self._owned = True - self._readonly = False - def __dealloc__(self): - cdef nvmlVgpuSchedulerState_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=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__}.VgpuSchedulerState_v1 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 VgpuSchedulerState_v1 other_ - if not isinstance(other, VgpuSchedulerState_v1): + 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(nvmlVgpuSchedulerState_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(nvmlVgpuSchedulerState_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(nvmlVgpuSchedulerState_v1_t)) - if self._ptr == NULL: - 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 - else: - setattr(self, key, val) - - @property - def scheduler_params(self): - """VgpuSchedulerSetParams: IN: vGPU Scheduler Parameters.""" - return VgpuSchedulerSetParams.from_ptr(&(self._ptr[0].schedulerParams), self._readonly, 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 + _cyb_cpython.PyBuffer_Release(buffer) @property - def scheduler_policy(self): - """int: IN: Scheduler policy.""" - return self._ptr[0].schedulerPolicy - - @scheduler_policy.setter - def scheduler_policy(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerState_v1 instance is read-only") - self._ptr[0].schedulerPolicy = val + 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 enable_arr_mode(self): - """int: IN: Adaptive Round Robin scheduler.""" - return self._ptr[0].enableARRMode + def data_(self): + """_py_anon_pod8_dtype: Union containing controller-specific data.""" + return self._data.data_ - @enable_arr_mode.setter - def enable_arr_mode(self, val): - if self._readonly: - raise ValueError("This VgpuSchedulerState_v1 instance is read-only") - self._ptr[0].enableARRMode = val + @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): + self._data[key] = val @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 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 VgpuSchedulerState_v1 instance wrapping the given NumPy array. + """Create an PerfMetricControllerSample 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 1D array of dtype `perf_metric_controller_sample_dtype` holding the data. """ - return _cyb_from_data(data, "vgpu_scheduler_state_v1_dtype", vgpu_scheduler_state_v1_dtype, VgpuSchedulerState_v1) + 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, bint readonly=False, object owner=None): - """Create an VgpuSchedulerState_v1 instance wrapping the given pointer. + 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. - 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 VgpuSchedulerState_v1 obj = VgpuSchedulerState_v1.__new__(VgpuSchedulerState_v1) - if owner is None: - obj._ptr = _cyb_malloc(sizeof(nvmlVgpuSchedulerState_v1_t)) - if obj._ptr == NULL: - 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._owner = owner - obj._owned = False - obj._readonly = readonly + 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_grid_licensable_features_dtype_offsets(): - cdef nvmlGridLicensableFeatures_t pod +cdef _get_perf_metrics_sample_dtype_offsets(): + cdef nvmlPerfMetricsSample_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': ['num_controller_data', 'controller_data'], + 'formats': [_numpy.uint8, (perf_metric_controller_sample_dtype, 4)], 'offsets': [ - (&(pod.isGridLicenseSupported)) - (&pod), - (&(pod.licensableFeaturesCount)) - (&pod), - (&(pod.gridLicensableFeatures)) - (&pod), + (&(pod.numControllerData)) - (&pod), + (&(pod.controllerData)) - (&pod), ], - 'itemsize': sizeof(nvmlGridLicensableFeatures_t), + 'itemsize': sizeof(nvmlPerfMetricsSample_t), }) -grid_licensable_features_dtype = _get_grid_licensable_features_dtype_offsets() +perf_metrics_sample_dtype = _get_perf_metrics_sample_dtype_offsets() -cdef class GridLicensableFeatures: - """Empty-initialize an instance of `nvmlGridLicensableFeatures_t`. +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:: `nvmlGridLicensableFeatures_t` + .. seealso:: `nvmlPerfMetricsSample_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 + readonly tuple _controller_data - 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_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): - return f"<{__name__}.GridLicensableFeatures object at {hex(id(self))}>" + if self._data.size > 1: + return f"<{__name__}.PerfMetricsSample_Array_{self._data.size} object at {hex(id(self))}>" + else: + return f"<{__name__}.PerfMetricsSample 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, PerfMetricsSample)) 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 - - 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 - else: - setattr(self, key, val) + _cyb_cpython.PyBuffer_Release(buffer) @property - def grid_licensable_features(self): - """GridLicensableFeature: """ - return GridLicensableFeature.from_ptr(&(self._ptr[0].gridLicensableFeatures), self._ptr[0].licensableFeaturesCount, self._readonly) - - @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) + def controller_data(self): + """PerfMetricControllerSample: Array of controller samples.""" + if self._data.size == 1: + return self._controller_data[0] + return self._controller_data - @property - def is_grid_license_supported(self): - """int: """ - return self._ptr[0].isGridLicenseSupported + 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 - @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 __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=self._readonly) + 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=self._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): @@ -21492,81 +28022,69 @@ 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)) - if self._ptr == NULL: - 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), self._readonly, 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 + if key == 0 and isinstance(val, _numpy.ndarray): + self._ptr = _cyb_malloc(sizeof(nvmlPerfMetricsSamples_v1_t)) + if self._ptr == NULL: + 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 + else: + setattr(self, key, val) @property - def is_nvle_enabled(self): - """int: OUT - NVLINK encryption enablement.""" - return self._ptr[0].isNvleEnabled + 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, + ) - @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. @@ -21575,16 +28093,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 @@ -21592,7 +28110,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` """ @@ -21602,10 +28120,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` """ @@ -21615,7 +28134,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` """ @@ -21747,7 +28266,8 @@ cpdef unsigned int unit_get_count() except? 0: """Retrieves the number of units in the system. Returns: - unsigned int: Reference in which to return the number of units. + unsigned int: Reference in which to return the number of + units. .. seealso:: `nvmlUnitGetCount` """ @@ -21762,7 +28282,8 @@ cpdef intptr_t unit_get_handle_by_index(unsigned int index) except? 0: """Acquire the handle for a particular unit, based on its index. Args: - index (unsigned int): The index of the target unit, >= 0 and < ``unitCount``. + index (unsigned int): The index of the target unit, >= 0 and < + ``unitCount``. Returns: intptr_t: Reference in which to return the unit handle. @@ -21783,7 +28304,8 @@ cpdef object unit_get_unit_info(intptr_t unit): unit (intptr_t): The identifier of the target unit. Returns: - nvmlUnitInfo_t: Reference in which to return the unit information. + nvmlUnitInfo_t: Reference in which to return the unit + information. .. seealso:: `nvmlUnitGetUnitInfo` """ @@ -21802,7 +28324,8 @@ cpdef object unit_get_led_state(intptr_t unit): unit (intptr_t): The identifier of the target unit. Returns: - nvmlLedState_t: Reference in which to return the current LED state. + nvmlLedState_t: Reference in which to return the current LED + state. .. seealso:: `nvmlUnitGetLedState` """ @@ -21821,7 +28344,8 @@ cpdef object unit_get_psu_info(intptr_t unit): unit (intptr_t): The identifier of the target unit. Returns: - nvmlPSUInfo_t: Reference in which to return the PSU information. + nvmlPSUInfo_t: Reference in which to return the PSU + information. .. seealso:: `nvmlUnitGetPsuInfo` """ @@ -21841,7 +28365,8 @@ cpdef unsigned int unit_get_temperature(intptr_t unit, unsigned int type) except type (unsigned int): The type of reading to take. Returns: - unsigned int: Reference in which to return the intake temperature. + unsigned int: Reference in which to return the intake + temperature. .. seealso:: `nvmlUnitGetTemperature` """ @@ -21859,7 +28384,8 @@ cpdef object unit_get_fan_speed_info(intptr_t unit): unit (intptr_t): The identifier of the target unit. Returns: - nvmlUnitFanSpeeds_t: Reference in which to return the fan speed information. + nvmlUnitFanSpeeds_t: Reference in which to return the fan + speed information. .. seealso:: `nvmlUnitGetFanSpeedInfo` """ @@ -21875,7 +28401,8 @@ cpdef unsigned int device_get_count_v2() except? 0: """Retrieves the number of compute devices in the system. A compute device is a single GPU. Returns: - unsigned int: Reference in which to return the number of accessible devices. + unsigned int: Reference in which to return the number of + accessible devices. .. seealso:: `nvmlDeviceGetCount_v2` """ @@ -21909,7 +28436,8 @@ cpdef intptr_t device_get_handle_by_index_v2(unsigned int index) except? 0: """Acquire the handle for a particular device, based on its index. Args: - index (unsigned int): The index of the target GPU, >= 0 and < ``accessibleDevices``. + index (unsigned int): The index of the target GPU, >= 0 and < + ``accessibleDevices``. Returns: intptr_t: Reference in which to return the device handle. @@ -21952,7 +28480,8 @@ cpdef intptr_t device_get_handle_by_uuid(uuid) except? 0: uuid (str): The UUID of the target GPU or MIG instance. Returns: - intptr_t: Reference in which to return the device handle or MIG device handle. + intptr_t: Reference in which to return the device handle or + MIG device handle. .. seealso:: `nvmlDeviceGetHandleByUUID` """ @@ -21971,7 +28500,11 @@ cpdef intptr_t device_get_handle_by_pci_bus_id_v2(pci_bus_id) except? 0: """Acquire the handle for a particular device, based on its PCI bus id. Args: - pci_bus_id (str): The PCI bus id of the target GPU Accept the following formats (all numbers in hexadecimal): domain:bus:device.function in format x:x:x.x domain:bus:device in format x:x:x bus:device.function in format x:x.x. + pci_bus_id (str): The PCI bus id of the target GPU Accept the + following formats (all numbers in hexadecimal): + domain:bus:device.function in format x:x:x.x + domain:bus:device in format x:x:x bus:device.function in + format x:x.x. Returns: intptr_t: Reference in which to return the device handle. @@ -22033,7 +28566,8 @@ cpdef unsigned int device_get_index(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the NVML index of the device. + unsigned int: Reference in which to return the NVML index of + the device. .. seealso:: `nvmlDeviceGetIndex` """ @@ -22051,7 +28585,8 @@ cpdef str device_get_serial(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - char: Reference in which to return the board/module serial number. + char: Reference in which to return the board/module serial + number. .. seealso:: `nvmlDeviceGetSerial` """ @@ -22088,7 +28623,8 @@ cpdef object device_get_c2c_mode_info_v(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlC2cModeInfo_v1_t: Output struct containing the device's C2C Mode info. + nvmlC2cModeInfo_v1_t: Output struct containing the device's + C2C Mode info. .. seealso:: `nvmlDeviceGetC2cModeInfoV` """ @@ -22105,11 +28641,14 @@ cpdef object device_get_memory_affinity(intptr_t device, unsigned int node_set_s Args: device (intptr_t): The identifier of the target device. - node_set_size (unsigned int): The size of the node_set array that is safe to access. + node_set_size (unsigned int): The size of the node_set array + that is safe to access. scope (unsigned int): Scope that change the default behavior. Returns: - unsigned long: Array reference in which to return a bitmask of NODEs, 64 NODEs per unsigned long on 64-bit machines, 32 on 32-bit machines. + unsigned long: Array reference in which to return a bitmask of + NODEs, 64 NODEs per unsigned long on 64-bit machines, 32 + on 32-bit machines. .. seealso:: `nvmlDeviceGetMemoryAffinity` """ @@ -22128,11 +28667,14 @@ cpdef object device_get_cpu_affinity_within_scope(intptr_t device, unsigned int Args: device (intptr_t): The identifier of the target device. - cpu_set_size (unsigned int): The size of the cpu_set array that is safe to access. + cpu_set_size (unsigned int): The size of the cpu_set array + that is safe to access. scope (unsigned int): Scope that change the default behavior. Returns: - unsigned long: Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines. + unsigned long: Array reference in which to return a bitmask of + CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on + 32-bit machines. .. seealso:: `nvmlDeviceGetCpuAffinityWithinScope` """ @@ -22151,10 +28693,13 @@ cpdef object device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size) Args: device (intptr_t): The identifier of the target device. - cpu_set_size (unsigned int): The size of the cpu_set array that is safe to access. + cpu_set_size (unsigned int): The size of the cpu_set array + that is safe to access. Returns: - unsigned long: Array reference in which to return a bitmask of CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines. + unsigned long: Array reference in which to return a bitmask of + CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on + 32-bit machines. .. seealso:: `nvmlDeviceGetCpuAffinity` """ @@ -22237,10 +28782,12 @@ cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_inde Args: device1 (intptr_t): The first device. device2 (intptr_t): The second device. - p2p_index (GpuP2PCapsIndex): p2p Capability Index being looked for between ``device1`` and ``device2``. + p2p_index (GpuP2PCapsIndex): p2p Capability Index being looked + for between ``device1`` and ``device2``. Returns: - int: Reference in which to return the status of the ``p2p_index`` between ``device1`` and ``device2``. + int: Reference in which to return the status of the + ``p2p_index`` between ``device1`` and ``device2``. .. seealso:: `nvmlDeviceGetP2PStatus` """ @@ -22277,7 +28824,8 @@ cpdef unsigned int device_get_minor_number(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the minor number for the device. + unsigned int: Reference in which to return the minor number + for the device. .. seealso:: `nvmlDeviceGetMinorNumber` """ @@ -22353,7 +28901,8 @@ cpdef unsigned int device_get_inforom_configuration_checksum(intptr_t device) ex device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the infoROM configuration checksum. + unsigned int: Reference in which to return the infoROM + configuration checksum. .. seealso:: `nvmlDeviceGetInforomConfigurationChecksum` """ @@ -22442,7 +28991,8 @@ cpdef int device_get_persistence_mode(intptr_t device) except? -1: device (intptr_t): The identifier of the target device. Returns: - int: Reference in which to return the current driver persistence mode. + int: Reference in which to return the current driver + persistence mode. .. seealso:: `nvmlDeviceGetPersistenceMode` """ @@ -22460,7 +29010,8 @@ cpdef object device_get_pci_info_ext(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlPciInfoExt_v1_t: Reference in which to return the PCI info. + nvmlPciInfoExt_v1_t: Reference in which to return the PCI + info. .. seealso:: `nvmlDeviceGetPciInfoExt` """ @@ -22499,7 +29050,8 @@ cpdef unsigned int device_get_max_pcie_link_generation(intptr_t device) except? device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the max PCIe link generation. + unsigned int: Reference in which to return the max PCIe link + generation. .. seealso:: `nvmlDeviceGetMaxPcieLinkGeneration` """ @@ -22517,7 +29069,8 @@ cpdef unsigned int device_get_gpu_max_pcie_link_generation(intptr_t device) exce device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the max PCIe link generation. + unsigned int: Reference in which to return the max PCIe link + generation. .. seealso:: `nvmlDeviceGetGpuMaxPcieLinkGeneration` """ @@ -22535,7 +29088,8 @@ cpdef unsigned int device_get_max_pcie_link_width(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the max PCIe link generation. + unsigned int: Reference in which to return the max PCIe link + generation. .. seealso:: `nvmlDeviceGetMaxPcieLinkWidth` """ @@ -22553,7 +29107,8 @@ cpdef unsigned int device_get_curr_pcie_link_generation(intptr_t device) except? device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the current PCIe link generation. + unsigned int: Reference in which to return the current PCIe + link generation. .. seealso:: `nvmlDeviceGetCurrPcieLinkGeneration` """ @@ -22571,7 +29126,8 @@ cpdef unsigned int device_get_curr_pcie_link_width(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the current PCIe link generation. + unsigned int: Reference in which to return the current PCIe + link generation. .. seealso:: `nvmlDeviceGetCurrPcieLinkWidth` """ @@ -22587,7 +29143,8 @@ cpdef unsigned int device_get_pcie_throughput(intptr_t device, int counter) exce Args: device (intptr_t): The identifier of the target device. - counter (PcieUtilCounter): The specific counter that should be queried ``nvmlPcieUtilCounter_t``. + counter (PcieUtilCounter): The specific counter that should be + queried ``nvmlPcieUtilCounter_t``. Returns: unsigned int: Reference in which to return throughput in KB/s. @@ -22608,7 +29165,8 @@ cpdef unsigned int device_get_pcie_replay_counter(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the counter's value. + unsigned int: Reference in which to return the counter's + value. .. seealso:: `nvmlDeviceGetPcieReplayCounter` """ @@ -22627,7 +29185,8 @@ cpdef unsigned int device_get_clock_info(intptr_t device, int type) except? 0: type (ClockType): Identify which clock domain to query. Returns: - unsigned int: Reference in which to return the clock speed in MHz. + unsigned int: Reference in which to return the clock speed in + MHz. .. seealso:: `nvmlDeviceGetClockInfo` """ @@ -22646,7 +29205,8 @@ cpdef unsigned int device_get_max_clock_info(intptr_t device, int type) except? type (ClockType): Identify which clock domain to query. Returns: - unsigned int: Reference in which to return the clock speed in MHz. + unsigned int: Reference in which to return the clock speed in + MHz. .. seealso:: `nvmlDeviceGetMaxClockInfo` """ @@ -22681,7 +29241,8 @@ cpdef unsigned int device_get_clock(intptr_t device, int clock_type, int clock_i Args: device (intptr_t): The identifier of the target device. clock_type (ClockType): Identify which clock domain to query. - clock_id (ClockId): Identify which clock in the domain to query. + clock_id (ClockId): Identify which clock in the domain to + query. Returns: unsigned int: Reference in which to return the clock in MHz. @@ -22744,7 +29305,8 @@ cpdef object device_get_supported_graphics_clocks(intptr_t device, unsigned int Args: device (intptr_t): The identifier of the target device. - memory_clock_m_hz (unsigned int): Memory clock for which to return possible graphics clocks. + memory_clock_m_hz (unsigned int): Memory clock for which to + return possible graphics clocks. Returns: unsigned int: Reference in which to return the clocks in MHz. @@ -22774,8 +29336,11 @@ cpdef tuple device_get_auto_boosted_clocks_enabled(intptr_t device): Returns: A 2-tuple containing: - - int: Where to store the current state of Auto Boosted clocks of the target device. - - int: Where to store the default Auto Boosted clocks behavior of the target device that the device will revert to when no applications are using the GPU. + - int: Where to store the current state of Auto Boosted clocks + of the target device. + - int: Where to store the default Auto Boosted clocks behavior + of the target device that the device will revert to when + no applications are using the GPU. .. seealso:: `nvmlDeviceGetAutoBoostedClocksEnabled` """ @@ -22794,7 +29359,8 @@ cpdef unsigned int device_get_fan_speed(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the fan speed percentage. + unsigned int: Reference in which to return the fan speed + percentage. .. seealso:: `nvmlDeviceGetFanSpeed` """ @@ -22813,7 +29379,8 @@ cpdef unsigned int device_get_fan_speed_v2(intptr_t device, unsigned int fan) ex fan (unsigned int): The index of the target fan, zero indexed. Returns: - unsigned int: Reference in which to return the fan speed percentage. + unsigned int: Reference in which to return the fan speed + percentage. .. seealso:: `nvmlDeviceGetFanSpeed_v2` """ @@ -22832,7 +29399,8 @@ cpdef unsigned int device_get_target_fan_speed(intptr_t device, unsigned int fan fan (unsigned int): The index of the target fan, zero indexed. Returns: - unsigned int: Reference in which to return the fan speed percentage. + unsigned int: Reference in which to return the fan speed + percentage. .. seealso:: `nvmlDeviceGetTargetFanSpeed` """ @@ -22873,7 +29441,8 @@ cpdef unsigned int device_get_fan_control_policy_v2(intptr_t device, unsigned in fan (unsigned int): The index of the target fan, zero indexed. Returns: - unsigned int: Reference in which to return the fan control ``policy``. + unsigned int: Reference in which to return the fan control + ``policy``. .. seealso:: `nvmlDeviceGetFanControlPolicy_v2` """ @@ -22909,7 +29478,9 @@ cpdef object device_get_cooler_info(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlCoolerInfo_v1_t: Structure specifying the cooler's control signal characteristics (out) and the target that cooler cools (out). + nvmlCoolerInfo_v1_t: Structure specifying the cooler's control + signal characteristics (out) and the target that cooler + cools (out). .. seealso:: `nvmlDeviceGetCoolerInfo` """ @@ -22927,10 +29498,12 @@ cpdef unsigned int device_get_temperature_threshold(intptr_t device, int thresho Args: device (intptr_t): The identifier of the target device. - threshold_type (TemperatureThresholds): The type of threshold value queried. + threshold_type (TemperatureThresholds): The type of threshold + value queried. Returns: - unsigned int: Reference in which to return the temperature reading. + unsigned int: Reference in which to return the temperature + reading. .. seealso:: `nvmlDeviceGetTemperatureThreshold` """ @@ -22949,7 +29522,8 @@ cpdef object device_get_thermal_settings(intptr_t device, unsigned int sensor_in sensor_index (unsigned int): The index of the thermal sensor. Returns: - nvmlGpuThermalSettings_t: Reference in which to return the thermal sensor information. + nvmlGpuThermalSettings_t: Reference in which to return the + thermal sensor information. .. seealso:: `nvmlDeviceGetThermalSettings` """ @@ -22968,7 +29542,8 @@ cpdef int device_get_performance_state(intptr_t device) except? -1: device (intptr_t): The identifier of the target device. Returns: - int: Reference in which to return the performance state reading. + int: Reference in which to return the performance state + reading. .. seealso:: `nvmlDeviceGetPerformanceState` """ @@ -22986,7 +29561,8 @@ cpdef unsigned long long device_get_current_clocks_event_reasons(intptr_t device device (intptr_t): The identifier of the target device. Returns: - unsigned long long: Reference in which to return bitmask of active clocks event reasons. + unsigned long long: Reference in which to return bitmask of + active clocks event reasons. .. seealso:: `nvmlDeviceGetCurrentClocksEventReasons` """ @@ -23004,7 +29580,8 @@ cpdef unsigned long long device_get_supported_clocks_event_reasons(intptr_t devi device (intptr_t): The identifier of the target device. Returns: - unsigned long long: Reference in which to return bitmask of supported clocks event reasons. + unsigned long long: Reference in which to return bitmask of + supported clocks event reasons. .. seealso:: `nvmlDeviceGetSupportedClocksEventReasons` """ @@ -23022,7 +29599,8 @@ cpdef int device_get_power_state(intptr_t device) except? -1: device (intptr_t): The identifier of the target device. Returns: - int: Reference in which to return the performance state reading. + int: Reference in which to return the performance state + reading. .. seealso:: `nvmlDeviceGetPowerState` """ @@ -23081,8 +29659,10 @@ cpdef tuple device_get_min_max_clock_of_p_state(intptr_t device, int type, int p Returns: A 2-tuple containing: - - unsigned int: Reference in which to return min clock frequency. - - unsigned int: Reference in which to return max clock frequency. + - unsigned int: Reference in which to return min clock + frequency. + - unsigned int: Reference in which to return max clock + frequency. .. seealso:: `nvmlDeviceGetMinMaxClockOfPState` """ @@ -23143,7 +29723,8 @@ cpdef device_set_clock_offsets(intptr_t device, intptr_t info): Args: device (intptr_t): The identifier of the target device. - info (intptr_t): Structure specifying the clock type (input), the pstate (input) and clock offset value (input). + info (intptr_t): Structure specifying the clock type (input), + the pstate (input) and clock offset value (input). .. seealso:: `nvmlDeviceSetClockOffsets` """ @@ -23159,7 +29740,8 @@ cpdef unsigned int device_get_power_management_limit(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the power management limit in milliwatts. + unsigned int: Reference in which to return the power + management limit in milliwatts. .. seealso:: `nvmlDeviceGetPowerManagementLimit` """ @@ -23179,8 +29761,10 @@ cpdef tuple device_get_power_management_limit_constraints(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference in which to return the minimum power management limit in milliwatts. - - unsigned int: Reference in which to return the maximum power management limit in milliwatts. + - unsigned int: Reference in which to return the minimum power + management limit in milliwatts. + - unsigned int: Reference in which to return the maximum power + management limit in milliwatts. .. seealso:: `nvmlDeviceGetPowerManagementLimitConstraints` """ @@ -23199,7 +29783,8 @@ cpdef unsigned int device_get_power_management_default_limit(intptr_t device) ex device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the default power management limit in milliwatts. + unsigned int: Reference in which to return the default power + management limit in milliwatts. .. seealso:: `nvmlDeviceGetPowerManagementDefaultLimit` """ @@ -23217,7 +29802,8 @@ cpdef unsigned int device_get_power_usage(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the power usage information. + unsigned int: Reference in which to return the power usage + information. .. seealso:: `nvmlDeviceGetPowerUsage` """ @@ -23235,7 +29821,8 @@ cpdef unsigned long long device_get_total_energy_consumption(intptr_t device) ex device (intptr_t): The identifier of the target device. Returns: - unsigned long long: Reference in which to return the energy consumption information. + unsigned long long: Reference in which to return the energy + consumption information. .. seealso:: `nvmlDeviceGetTotalEnergyConsumption` """ @@ -23253,7 +29840,8 @@ cpdef unsigned int device_get_enforced_power_limit(intptr_t device) except? 0: device (intptr_t): The device to communicate with. Returns: - unsigned int: Reference in which to return the power management limit in milliwatts. + unsigned int: Reference in which to return the power + management limit in milliwatts. .. seealso:: `nvmlDeviceGetEnforcedPowerLimit` """ @@ -23293,7 +29881,8 @@ cpdef object device_get_memory_info_v2(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlMemory_v2_t: Reference in which to return the memory information. + nvmlMemory_v2_t: Reference in which to return the memory + information. .. seealso:: `nvmlDeviceGetMemoryInfo_v2` """ @@ -23310,7 +29899,8 @@ cpdef int device_get_compute_mode(intptr_t device) except? -1: """Retrieves the current compute mode for the device or MIG device. Args: - device (intptr_t): The identifier of the target device handle or MIG device handle. + device (intptr_t): The identifier of the target device handle + or MIG device handle. Returns: int: Reference in which to return the current compute mode. @@ -23333,8 +29923,10 @@ cpdef tuple device_get_cuda_compute_capability(intptr_t device): Returns: A 2-tuple containing: - - int: Reference in which to return the major CUDA compute capability. - - int: Reference in which to return the minor CUDA compute capability. + - int: Reference in which to return the major CUDA compute + capability. + - int: Reference in which to return the minor CUDA compute + capability. .. seealso:: `nvmlDeviceGetCudaComputeCapability` """ @@ -23393,7 +29985,8 @@ cpdef unsigned int device_get_board_id(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return the device's board ID. + unsigned int: Reference in which to return the device's board + ID. .. seealso:: `nvmlDeviceGetBoardId` """ @@ -23411,7 +30004,9 @@ cpdef unsigned int device_get_multi_gpu_board(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return a zero or non-zero value to indicate whether the device is on a multi GPU board. + unsigned int: Reference in which to return a zero or non-zero + value to indicate whether the device is on a multi GPU + board. .. seealso:: `nvmlDeviceGetMultiGpuBoard` """ @@ -23427,11 +30022,14 @@ cpdef unsigned long long device_get_total_ecc_errors(intptr_t device, int error_ Args: device (intptr_t): The identifier of the target device. - error_type (MemoryErrorType): Flag that specifies the type of the errors. - counter_type (EccCounterType): Flag that specifies the counter-type of the errors. + error_type (MemoryErrorType): Flag that specifies the type of + the errors. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. Returns: - unsigned long long: Reference in which to return the specified ECC errors. + unsigned long long: Reference in which to return the specified + ECC errors. .. seealso:: `nvmlDeviceGetTotalEccErrors` """ @@ -23447,12 +30045,16 @@ cpdef unsigned long long device_get_memory_error_counter(intptr_t device, int er Args: device (intptr_t): The identifier of the target device. - error_type (MemoryErrorType): Flag that specifies the type of error. - counter_type (EccCounterType): Flag that specifies the counter-type of the errors. - location_type (MemoryLocation): Specifies the location of the counter. + error_type (MemoryErrorType): Flag that specifies the type of + error. + counter_type (EccCounterType): Flag that specifies the + counter-type of the errors. + location_type (MemoryLocation): Specifies the location of the + counter. Returns: - unsigned long long: Reference in which to return the ECC counter. + unsigned long long: Reference in which to return the ECC + counter. .. seealso:: `nvmlDeviceGetMemoryErrorCounter` """ @@ -23470,7 +30072,8 @@ cpdef object device_get_utilization_rates(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlUtilization_t: Reference in which to return the utilization information. + nvmlUtilization_t: Reference in which to return the + utilization information. .. seealso:: `nvmlDeviceGetUtilizationRates` """ @@ -23491,8 +30094,10 @@ cpdef tuple device_get_encoder_utilization(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference to an unsigned int for encoder utilization info. - - unsigned int: Reference to an unsigned int for the sampling period in US. + - unsigned int: Reference to an unsigned int for encoder + utilization info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. .. seealso:: `nvmlDeviceGetEncoderUtilization` """ @@ -23512,7 +30117,8 @@ cpdef unsigned int device_get_encoder_capacity(intptr_t device, int encoder_quer encoder_query_type (EncoderType): Type of encoder to query. Returns: - unsigned int: Reference to an unsigned int for the encoder capacity. + unsigned int: Reference to an unsigned int for the encoder + capacity. .. seealso:: `nvmlDeviceGetEncoderCapacity` """ @@ -23532,9 +30138,12 @@ cpdef tuple device_get_encoder_stats(intptr_t device): Returns: A 3-tuple containing: - - unsigned int: Reference to an unsigned int for count of active encoder sessions. - - unsigned int: Reference to an unsigned int for trailing average FPS of all active sessions. - - unsigned int: Reference to an unsigned int for encode latency in microseconds. + - unsigned int: Reference to an unsigned int for count of active + encoder sessions. + - unsigned int: Reference to an unsigned int for trailing + average FPS of all active sessions. + - unsigned int: Reference to an unsigned int for encode latency + in microseconds. .. seealso:: `nvmlDeviceGetEncoderStats` """ @@ -23554,7 +30163,8 @@ cpdef object device_get_encoder_sessions(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlEncoderSessionInfo_t: Reference in which to return the session information. + nvmlEncoderSessionInfo_t: Reference in which to return the + session information. .. seealso:: `nvmlDeviceGetEncoderSessions` """ @@ -23581,8 +30191,10 @@ cpdef tuple device_get_decoder_utilization(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference to an unsigned int for decoder utilization info. - - unsigned int: Reference to an unsigned int for the sampling period in US. + - unsigned int: Reference to an unsigned int for decoder + utilization info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. .. seealso:: `nvmlDeviceGetDecoderUtilization` """ @@ -23603,8 +30215,10 @@ cpdef tuple device_get_jpg_utilization(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference to an unsigned int for jpg utilization info. - - unsigned int: Reference to an unsigned int for the sampling period in US. + - unsigned int: Reference to an unsigned int for jpg utilization + info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. .. seealso:: `nvmlDeviceGetJpgUtilization` """ @@ -23625,8 +30239,10 @@ cpdef tuple device_get_ofa_utilization(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Reference to an unsigned int for ofa utilization info. - - unsigned int: Reference to an unsigned int for the sampling period in US. + - unsigned int: Reference to an unsigned int for ofa utilization + info. + - unsigned int: Reference to an unsigned int for the sampling + period in US. .. seealso:: `nvmlDeviceGetOfaUtilization` """ @@ -23645,7 +30261,8 @@ cpdef object device_get_fbc_stats(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure containing NvFBC stats. + nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure + containing NvFBC stats. .. seealso:: `nvmlDeviceGetFBCStats` """ @@ -23664,7 +30281,8 @@ cpdef object device_get_fbc_sessions(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlFBCSessionInfo_t: Reference in which to return the session information. + nvmlFBCSessionInfo_t: Reference in which to return the session + information. .. seealso:: `nvmlDeviceGetFBCSessions` """ @@ -23730,7 +30348,8 @@ cpdef object device_get_bridge_chip_info(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlBridgeChipHierarchy_t: Reference to the returned bridge chip Hierarchy. + nvmlBridgeChipHierarchy_t: Reference to the returned bridge + chip Hierarchy. .. seealso:: `nvmlDeviceGetBridgeChipInfo` """ @@ -23749,7 +30368,8 @@ cpdef object device_get_compute_running_processes_v3(intptr_t device): device (intptr_t): The device handle or MIG device handle. Returns: - nvmlProcessInfo_t: Reference in which to return the process information. + nvmlProcessInfo_t: Reference in which to return the process + information. .. seealso:: `nvmlDeviceGetComputeRunningProcesses_v3` """ @@ -23774,7 +30394,8 @@ cpdef object device_get_graphics_running_processes_v3(intptr_t device): device (intptr_t): The device handle or MIG device handle. Returns: - nvmlProcessInfo_t: Reference in which to return the process information. + nvmlProcessInfo_t: Reference in which to return the process + information. .. seealso:: `nvmlDeviceGetGraphicsRunningProcesses_v3` """ @@ -23799,7 +30420,8 @@ cpdef object device_get_mps_compute_running_processes_v3(intptr_t device): device (intptr_t): The device handle or MIG device handle. Returns: - nvmlProcessInfo_t: Reference in which to return the process information. + nvmlProcessInfo_t: Reference in which to return the process + information. .. seealso:: `nvmlDeviceGetMPSComputeRunningProcesses_v3` """ @@ -23825,7 +30447,8 @@ cpdef int device_on_same_board(intptr_t device1, intptr_t device2) except? 0: device2 (intptr_t): The second GPU device. Returns: - int: Reference in which to return the status. Non-zero indicates that the GPUs are on the same board. + int: Reference in which to return the status. Non-zero + indicates that the GPUs are on the same board. .. seealso:: `nvmlDeviceOnSameBoard` """ @@ -23844,7 +30467,10 @@ cpdef int device_get_api_restriction(intptr_t device, int api_type) except? -1: api_type (RestrictedAPI): Target API type for this operation. Returns: - int: Reference in which to return the current restriction NVML_FEATURE_ENABLED indicates that the API is root-only NVML_FEATURE_DISABLED indicates that the API is accessible to all users. + int: Reference in which to return the current restriction + NVML_FEATURE_ENABLED indicates that the API is root-only + NVML_FEATURE_DISABLED indicates that the API is accessible + to all users. .. seealso:: `nvmlDeviceGetAPIRestriction` """ @@ -23862,7 +30488,8 @@ cpdef object device_get_bar1_memory_info(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlBAR1Memory_t: Reference in which BAR1 memory information is returned. + nvmlBAR1Memory_t: Reference in which BAR1 memory information + is returned. .. seealso:: `nvmlDeviceGetBAR1MemoryInfo` """ @@ -23881,7 +30508,8 @@ cpdef unsigned int device_get_irq_num(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: The interrupt number associated with the specified device. + unsigned int: The interrupt number associated with the + specified device. .. seealso:: `nvmlDeviceGetIrqNum` """ @@ -23989,7 +30617,9 @@ cpdef unsigned int device_get_adaptive_clock_info_status(intptr_t device) except device (intptr_t): The identifier of the target device. Returns: - unsigned int: The current adaptive clocking status, either NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED or NVML_ADAPTIVE_CLOCKING_INFO_STATUS_ENABLED. + unsigned int: The current adaptive clocking status, either + NVML_ADAPTIVE_CLOCKING_INFO_STATUS_DISABLED or + NVML_ADAPTIVE_CLOCKING_INFO_STATUS_ENABLED. .. seealso:: `nvmlDeviceGetAdaptiveClockInfoStatus` """ @@ -24057,7 +30687,8 @@ cpdef object device_get_conf_compute_mem_size_info(intptr_t device): device (intptr_t): Device handle. Returns: - nvmlConfComputeMemSizeInfo_t: Protected/Unprotected Memory sizes. + nvmlConfComputeMemSizeInfo_t: Protected/Unprotected Memory + sizes. .. seealso:: `nvmlDeviceGetConfComputeMemSizeInfo` """ @@ -24073,7 +30704,9 @@ cpdef unsigned int system_get_conf_compute_gpus_ready_state() except? 0: """Get Conf Computing GPUs ready state. Returns: - unsigned int: Returns GPU current work accepting state, NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE. + unsigned int: Returns GPU current work accepting state, + NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or + NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE. .. seealso:: `nvmlSystemGetConfComputeGpusReadyState` """ @@ -24091,7 +30724,8 @@ cpdef object device_get_conf_compute_protected_memory_usage(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlMemory_t: Reference in which to return the memory information. + nvmlMemory_t: Reference in which to return the memory + information. .. seealso:: `nvmlDeviceGetConfComputeProtectedMemoryUsage` """ @@ -24110,7 +30744,8 @@ cpdef object device_get_conf_compute_gpu_certificate(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlConfComputeGpuCertificate_t: Reference in which to return the gpu certificate information. + nvmlConfComputeGpuCertificate_t: Reference in which to return + the gpu certificate information. .. seealso:: `nvmlDeviceGetConfComputeGpuCertificate` """ @@ -24127,7 +30762,8 @@ cpdef device_set_conf_compute_unprotected_mem_size(intptr_t device, unsigned lon Args: device (intptr_t): Device Handle. - size_ki_b (unsigned long long): Unprotected Memory size to be set in KiB. + size_ki_b (unsigned long long): Unprotected Memory size to be + set in KiB. .. seealso:: `nvmlDeviceSetConfComputeUnprotectedMemSize` """ @@ -24140,7 +30776,9 @@ cpdef system_set_conf_compute_gpus_ready_state(unsigned int is_accepting_work): """Set Conf Computing GPUs ready state. Args: - is_accepting_work (unsigned int): GPU accepting new work, NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE. + is_accepting_work (unsigned int): GPU accepting new work, + NVML_CC_ACCEPTING_CLIENT_REQUESTS_TRUE or + NVML_CC_ACCEPTING_CLIENT_REQUESTS_FALSE. .. seealso:: `nvmlSystemSetConfComputeGpusReadyState` """ @@ -24194,7 +30832,8 @@ cpdef tuple device_get_gsp_firmware_mode(intptr_t device): A 2-tuple containing: - unsigned int: Pointer to specify if GSP firmware is enabled. - - unsigned int: Pointer to specify if GSP firmware is supported by default on ``device``. + - unsigned int: Pointer to specify if GSP firmware is supported + by default on ``device``. .. seealso:: `nvmlDeviceGetGspFirmwareMode` """ @@ -24249,10 +30888,12 @@ cpdef object device_get_accounting_stats(intptr_t device, unsigned int pid): Args: device (intptr_t): The identifier of the target device. - pid (unsigned int): Process Id of the target process to query stats for. + pid (unsigned int): Process Id of the target process to query + stats for. Returns: - nvmlAccountingStats_t: Reference in which to return the process's accounting stats. + nvmlAccountingStats_t: Reference in which to return the + process's accounting stats. .. seealso:: `nvmlDeviceGetAccountingStats` """ @@ -24271,7 +30912,8 @@ cpdef object device_get_accounting_pids(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to return list of process ids. + unsigned int: Reference in which to return list of process + ids. .. seealso:: `nvmlDeviceGetAccountingPids` """ @@ -24296,7 +30938,9 @@ cpdef unsigned int device_get_accounting_buffer_size(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference in which to provide the size (in number of elements) of the circular buffer for accounting stats. + unsigned int: Reference in which to provide the size (in + number of elements) of the circular buffer for accounting + stats. .. seealso:: `nvmlDeviceGetAccountingBufferSize` """ @@ -24312,7 +30956,8 @@ cpdef object device_get_retired_pages(intptr_t device, int cause): Args: device (intptr_t): The identifier of the target device. - cause (PageRetirementCause): Filter page addresses by cause of retirement. + cause (PageRetirementCause): Filter page addresses by cause of + retirement. Returns: unsigned long long: Buffer to write the page addresses into. @@ -24360,10 +31005,14 @@ cpdef tuple device_get_remapped_rows(intptr_t device): Returns: A 4-tuple containing: - - unsigned int: Reference for number of rows remapped due to correctable errors. - - unsigned int: Reference for number of rows remapped due to uncorrectable errors. - - unsigned int: Reference for whether or not remappings are pending. - - unsigned int: Reference that is set when a remapping has failed in the past. + - unsigned int: Reference for number of rows remapped due to + correctable errors. + - unsigned int: Reference for number of rows remapped due to + uncorrectable errors. + - unsigned int: Reference for whether or not remappings are + pending. + - unsigned int: Reference that is set when a remapping has + failed in the past. .. seealso:: `nvmlDeviceGetRemappedRows` """ @@ -24403,7 +31052,8 @@ cpdef unsigned int device_get_architecture(intptr_t device) except? 0: device (intptr_t): The identifier of the target device. Returns: - unsigned int: Reference where architecture is returned, if call successful. Set to NVML_DEVICE_ARCH_* upon success. + unsigned int: Reference where architecture is returned, if + call successful. Set to NVML_DEVICE_ARCH_* upon success. .. seealso:: `nvmlDeviceGetArchitecture` """ @@ -24421,7 +31071,8 @@ cpdef object device_get_clk_mon_status(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlClkMonStatus_t: Reference in which to return the clkmon fault status. + nvmlClkMonStatus_t: Reference in which to return the clkmon + fault status. .. seealso:: `nvmlDeviceGetClkMonStatus` """ @@ -24438,10 +31089,13 @@ cpdef object device_get_process_utilization(intptr_t device, unsigned long long Args: device (intptr_t): The identifier of the target device. - last_seen_time_stamp (unsigned long long): Return only samples with timestamp greater than last_seen_time_stamp. + last_seen_time_stamp (unsigned long long): Return only samples + with timestamp greater than last_seen_time_stamp. Returns: - nvmlProcessUtilizationSample_t: Pointer to caller-supplied buffer in which guest process utilization samples are returned. + nvmlProcessUtilizationSample_t: Pointer to caller-supplied + buffer in which guest process utilization samples are + returned. .. seealso:: `nvmlDeviceGetProcessUtilization` """ @@ -24491,7 +31145,8 @@ cpdef device_set_compute_mode(intptr_t device, int mode): """Set the compute mode for the device or MIG device. Args: - device (intptr_t): The identifier of the target device handle or MIG device handle. + device (intptr_t): The identifier of the target device handle + or MIG device handle. mode (ComputeMode): The target compute mode. .. seealso:: `nvmlDeviceSetComputeMode` @@ -24520,7 +31175,8 @@ cpdef device_clear_ecc_error_counts(intptr_t device, int counter_type): Args: device (intptr_t): The identifier of the target device. - counter_type (EccCounterType): Flag that indicates which type of errors should be cleared. + counter_type (EccCounterType): Flag that indicates which type + of errors should be cleared. .. seealso:: `nvmlDeviceClearEccErrorCounts` """ @@ -24549,8 +31205,10 @@ cpdef device_set_gpu_locked_clocks(intptr_t device, unsigned int min_gpu_clock_m Args: device (intptr_t): The identifier of the target device. - min_gpu_clock_m_hz (unsigned int): Requested minimum gpu clock in MHz. - max_gpu_clock_m_hz (unsigned int): Requested maximum gpu clock in MHz. + min_gpu_clock_m_hz (unsigned int): Requested minimum gpu clock + in MHz. + max_gpu_clock_m_hz (unsigned int): Requested maximum gpu clock + in MHz. .. seealso:: `nvmlDeviceSetGpuLockedClocks` """ @@ -24577,8 +31235,10 @@ cpdef device_set_memory_locked_clocks(intptr_t device, unsigned int min_mem_cloc Args: device (intptr_t): The identifier of the target device. - min_mem_clock_m_hz (unsigned int): Requested minimum memory clock in MHz. - max_mem_clock_m_hz (unsigned int): Requested maximum memory clock in MHz. + min_mem_clock_m_hz (unsigned int): Requested minimum memory + clock in MHz. + max_mem_clock_m_hz (unsigned int): Requested maximum memory + clock in MHz. .. seealso:: `nvmlDeviceSetMemoryLockedClocks` """ @@ -24605,7 +31265,8 @@ cpdef device_set_auto_boosted_clocks_enabled(intptr_t device, int enabled): Args: device (intptr_t): The identifier of the target device. - enabled (EnableState): What state to try to set Auto Boosted clocks of the target device to. + enabled (EnableState): What state to try to set Auto Boosted + clocks of the target device to. .. seealso:: `nvmlDeviceSetAutoBoostedClocksEnabled` """ @@ -24619,8 +31280,10 @@ cpdef device_set_default_auto_boosted_clocks_enabled(intptr_t device, int enable Args: device (intptr_t): The identifier of the target device. - enabled (EnableState): What state to try to set default Auto Boosted clocks of the target device to. - flags (unsigned int): Flags that change the default behavior. Currently Unused. + enabled (EnableState): What state to try to set default Auto + Boosted clocks of the target device to. + flags (unsigned int): Flags that change the default behavior. + Currently Unused. .. seealso:: `nvmlDeviceSetDefaultAutoBoostedClocksEnabled` """ @@ -24693,7 +31356,8 @@ cpdef device_set_fan_speed_v2(intptr_t device, unsigned int fan, unsigned int sp Args: device (intptr_t): The identifier of the target device. fan (unsigned int): The index of the fan, starting at zero. - speed (unsigned int): The target speed of the fan [0-100] in % of max speed. + speed (unsigned int): The target speed of the fan [0-100] in % + of max speed. .. seealso:: `nvmlDeviceSetFanSpeed_v2` """ @@ -24737,7 +31401,9 @@ cpdef int device_get_nvlink_state(intptr_t device, unsigned int link) except? -1 link (unsigned int): Specifies the NvLink link to be queried. Returns: - int: ``nvmlEnableState_t`` where NVML_FEATURE_ENABLED indicates that the link is active and NVML_FEATURE_DISABLED indicates it is inactive. + int: ``nvmlEnableState_t`` where NVML_FEATURE_ENABLED + indicates that the link is active and + NVML_FEATURE_DISABLED indicates it is inactive. .. seealso:: `nvmlDeviceGetNvLinkState` """ @@ -24756,7 +31422,8 @@ cpdef unsigned int device_get_nvlink_version(intptr_t device, unsigned int link) link (unsigned int): Specifies the NvLink link to be queried. Returns: - unsigned int: Requested NvLink version from ``nvmlNvlinkVersion_t``. + unsigned int: Requested NvLink version from + ``nvmlNvlinkVersion_t``. .. seealso:: `nvmlDeviceGetNvLinkVersion` """ @@ -24773,10 +31440,12 @@ cpdef unsigned int device_get_nvlink_capability(intptr_t device, unsigned int li Args: device (intptr_t): The identifier of the target device. link (unsigned int): Specifies the NvLink link to be queried. - capability (NvLinkCapability): Specifies the ``nvmlNvLinkCapability_t`` to be queried. + capability (NvLinkCapability): Specifies the + ``nvmlNvLinkCapability_t`` to be queried. Returns: - unsigned int: A boolean for the queried capability indicating that feature is available. + unsigned int: A boolean for the queried capability indicating + that feature is available. .. seealso:: `nvmlDeviceGetNvLinkCapability` """ @@ -24795,7 +31464,8 @@ cpdef object device_get_nvlink_remote_pci_info_v2(intptr_t device, unsigned int link (unsigned int): Specifies the NvLink link to be queried. Returns: - nvmlPciInfo_t: ``nvmlPciInfo_t`` of the remote node for the specified link. + nvmlPciInfo_t: ``nvmlPciInfo_t`` of the remote node for the + specified link. .. seealso:: `nvmlDeviceGetNvLinkRemotePciInfo_v2` """ @@ -24813,7 +31483,8 @@ cpdef unsigned long long device_get_nvlink_error_counter(intptr_t device, unsign Args: device (intptr_t): The identifier of the target device. link (unsigned int): Specifies the NvLink link to be queried. - counter (NvLinkErrorCounter): Specifies the NvLink counter to be queried. + counter (NvLinkErrorCounter): Specifies the NvLink counter to + be queried. Returns: unsigned long long: Returned counter value. @@ -24849,7 +31520,8 @@ cpdef int device_get_nvlink_remote_device_type(intptr_t device, unsigned int lin link (unsigned int): The NVLink link index on the target GPU. Returns: - int: Pointer in which the output remote device type is returned. + int: Pointer in which the output remote device type is + returned. .. seealso:: `nvmlDeviceGetNvLinkRemoteDeviceType` """ @@ -24895,7 +31567,8 @@ cpdef object device_get_nvlink_supported_bw_modes(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlNvlinkSupportedBwModes_v1_t: Reference to ``nvmlNvlinkSupportedBwModes_t``. + nvmlNvlinkSupportedBwModes_v1_t: Reference to + ``nvmlNvlinkSupportedBwModes_t``. .. seealso:: `nvmlDeviceGetNvlinkSupportedBwModes` """ @@ -24915,7 +31588,8 @@ cpdef object device_get_nvlink_bw_mode(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlNvlinkGetBwMode_v1_t: Reference to ``nvmlNvlinkGetBwMode_t``. + nvmlNvlinkGetBwMode_v1_t: Reference to + ``nvmlNvlinkGetBwMode_t``. .. seealso:: `nvmlDeviceGetNvlinkBwMode` """ @@ -24933,7 +31607,8 @@ cpdef device_set_nvlink_bw_mode(intptr_t device, intptr_t set_bw_mode): Args: device (intptr_t): The identifier of the target device. - set_bw_mode (intptr_t): Reference to ``nvmlNvlinkSetBwMode_t``. + set_bw_mode (intptr_t): Reference to + ``nvmlNvlinkSetBwMode_t``. .. seealso:: `nvmlDeviceSetNvlinkBwMode` """ @@ -24963,7 +31638,8 @@ cpdef device_register_events(intptr_t device, unsigned long long event_types, in Args: device (intptr_t): The identifier of the target device. - event_types (unsigned long long): Bitmask of ``Event Types`` to record. + event_types (unsigned long long): Bitmask of ``Event Types`` + to record. set (intptr_t): Set to which add new event types. .. seealso:: `nvmlDeviceRegisterEvents` @@ -24980,7 +31656,8 @@ cpdef unsigned long long device_get_supported_event_types(intptr_t device) excep device (intptr_t): The identifier of the target device. Returns: - unsigned long long: Reference in which to return bitmask of supported events. + unsigned long long: Reference in which to return bitmask of + supported events. .. seealso:: `nvmlDeviceGetSupportedEventTypes` """ @@ -24996,7 +31673,8 @@ cpdef object event_set_wait_v2(intptr_t set, unsigned int timeoutms): Args: set (intptr_t): Reference to set of events to wait on. - timeoutms (unsigned int): Maximum amount of wait time in milliseconds for registered event. + timeoutms (unsigned int): Maximum amount of wait time in + milliseconds for registered event. Returns: nvmlEventData_t: Reference in which to return event data. @@ -25028,8 +31706,10 @@ cpdef device_modify_drain_state(intptr_t pci_info, int new_state): """Modify the drain state of a GPU. This method forces a GPU to no longer accept new incoming requests. Any new NVML process will no longer see this GPU. Persistence mode for this GPU must be turned off before this call is made. Must be called as administrator. For Linux only. Args: - pci_info (intptr_t): The PCI address of the GPU drain state to be modified. - new_state (EnableState): The drain state that should be entered, see ``nvmlEnableState_t``. + pci_info (intptr_t): The PCI address of the GPU drain state to + be modified. + new_state (EnableState): The drain state that should be + entered, see ``nvmlEnableState_t``. .. seealso:: `nvmlDeviceModifyDrainState` """ @@ -25042,10 +31722,12 @@ cpdef int device_query_drain_state(intptr_t pci_info) except? -1: """Query the drain state of a GPU. This method is used to check if a GPU is in a currently draining state. For Linux only. Args: - pci_info (intptr_t): The PCI address of the GPU drain state to be queried. + pci_info (intptr_t): The PCI address of the GPU drain state to + be queried. Returns: - int: The current drain state for this GPU, see ``nvmlEnableState_t``. + int: The current drain state for this GPU, see + ``nvmlEnableState_t``. .. seealso:: `nvmlDeviceQueryDrainState` """ @@ -25061,8 +31743,10 @@ cpdef device_remove_gpu_v2(intptr_t pci_info, int gpu_state, int link_state): Args: pci_info (intptr_t): The PCI address of the GPU to be removed. - gpu_state (DetachGpuState): Whether the GPU is to be removed, from the OS see ``nvmlDetachGpuState_t``. - link_state (PcieLinkState): Requested upstream PCIe link state, see ``nvmlPcieLinkState_t``. + gpu_state (DetachGpuState): Whether the GPU is to be removed, + from the OS see ``nvmlDetachGpuState_t``. + link_state (PcieLinkState): Requested upstream PCIe link + state, see ``nvmlPcieLinkState_t``. .. seealso:: `nvmlDeviceRemoveGpu_v2` """ @@ -25075,7 +31759,8 @@ cpdef device_discover_gpus(intptr_t pci_info): """Request the OS and the NVIDIA kernel driver to rediscover a portion of the PCI subsystem looking for GPUs that were previously removed. The portion of the PCI tree can be narrowed by specifying a domain, bus, and device. If all are zeroes then the entire PCI tree will be searched. Please note that for long-running NVML processes the enumeration will change based on how many GPUs are discovered and where they are inserted in bus order. Args: - pci_info (intptr_t): The PCI tree to be searched. Only the domain, bus, and device fields are used in this call. + pci_info (intptr_t): The PCI tree to be searched. Only the + domain, bus, and device fields are used in this call. .. seealso:: `nvmlDeviceDiscoverGpus` """ @@ -25091,7 +31776,8 @@ cpdef int device_get_virtualization_mode(intptr_t device) except? -1: device (intptr_t): Identifier of the target device. Returns: - int: Reference to virtualization mode. One of NVML_GPU_VIRTUALIZATION_?. + int: Reference to virtualization mode. One of + NVML_GPU_VIRTUALIZATION_?. .. seealso:: `nvmlDeviceGetVirtualizationMode` """ @@ -25125,7 +31811,8 @@ cpdef device_set_virtualization_mode(intptr_t device, int virtual_mode): Args: device (intptr_t): Identifier of the target device. - virtual_mode (GpuVirtualizationMode): virtualization mode. One of NVML_GPU_VIRTUALIZATION_?. + virtual_mode (GpuVirtualizationMode): virtualization mode. One + of NVML_GPU_VIRTUALIZATION_?. .. seealso:: `nvmlDeviceSetVirtualizationMode` """ @@ -25141,7 +31828,8 @@ cpdef unsigned long long vgpu_type_get_gsp_heap_size(unsigned int vgpu_type_id) vgpu_type_id (unsigned int): Handle to vGPU type. Returns: - unsigned long long: Reference to return the GSP heap size value. + unsigned long long: Reference to return the GSP heap size + value. .. seealso:: `nvmlVgpuTypeGetGspHeapSize` """ @@ -25159,7 +31847,8 @@ cpdef unsigned long long vgpu_type_get_fb_reservation(unsigned int vgpu_type_id) vgpu_type_id (unsigned int): Handle to vGPU type. Returns: - unsigned long long: Reference to return the framebuffer reservation. + unsigned long long: Reference to return the framebuffer + reservation. .. seealso:: `nvmlVgpuTypeGetFbReservation` """ @@ -25175,7 +31864,8 @@ cpdef device_set_vgpu_capabilities(intptr_t device, int capability, int state): Args: device (intptr_t): The identifier of the target device. - capability (DeviceVgpuCapability): Specifies the ``nvmlDeviceVgpuCapability_t`` to be set. + capability (DeviceVgpuCapability): Specifies the + ``nvmlDeviceVgpuCapability_t`` to be set. state (EnableState): The target capability mode. .. seealso:: `nvmlDeviceSetVgpuCapabilities` @@ -25192,7 +31882,8 @@ cpdef object device_get_grid_licensable_features_v4(intptr_t device): device (intptr_t): Identifier of the target device. Returns: - nvmlGridLicensableFeatures_t: Pointer to structure in which vGPU software licensable features are returned. + nvmlGridLicensableFeatures_t: Pointer to structure in which + vGPU software licensable features are returned. .. seealso:: `nvmlDeviceGetGridLicensableFeatures_v4` """ @@ -25208,10 +31899,12 @@ cpdef unsigned int get_vgpu_driver_capabilities(int capability) except? 0: """Retrieve the requested vGPU driver capability. Args: - capability (VgpuDriverCapability): Specifies the ``nvmlVgpuDriverCapability_t`` to be queried. + capability (VgpuDriverCapability): Specifies the + ``nvmlVgpuDriverCapability_t`` to be queried. Returns: - unsigned int: A boolean for the queried capability indicating that feature is supported. + unsigned int: A boolean for the queried capability indicating + that feature is supported. .. seealso:: `nvmlGetVgpuDriverCapabilities` """ @@ -25227,10 +31920,12 @@ cpdef unsigned int device_get_vgpu_capabilities(intptr_t device, int capability) Args: device (intptr_t): The identifier of the target device. - capability (DeviceVgpuCapability): Specifies the ``nvmlDeviceVgpuCapability_t`` to be queried. + capability (DeviceVgpuCapability): Specifies the + ``nvmlDeviceVgpuCapability_t`` to be queried. Returns: - unsigned int: Specifies that the queried capability is supported, and also returns capability's data. + unsigned int: Specifies that the queried capability is + supported, and also returns capability's data. .. seealso:: `nvmlDeviceGetVgpuCapabilities` """ @@ -25293,8 +31988,10 @@ cpdef tuple vgpu_type_get_device_id(unsigned int vgpu_type_id): Returns: A 2-tuple containing: - - unsigned long long: Device ID and vendor ID of the device contained in single 32 bit value. - - unsigned long long: Subsystem ID and subsystem vendor ID of the device contained in single 32 bit value. + - unsigned long long: Device ID and vendor ID of the device + contained in single 32 bit value. + - unsigned long long: Subsystem ID and subsystem vendor ID of + the device contained in single 32 bit value. .. seealso:: `nvmlVgpuTypeGetDeviceID` """ @@ -25347,13 +32044,16 @@ cpdef tuple vgpu_type_get_resolution(unsigned int vgpu_type_id, unsigned int dis Args: vgpu_type_id (unsigned int): Handle to vGPU type. - display_index (unsigned int): Zero-based index of display head. + display_index (unsigned int): Zero-based index of display + head. Returns: A 2-tuple containing: - - unsigned int: Pointer to maximum number of pixels in X dimension. - - unsigned int: Pointer to maximum number of pixels in Y dimension. + - unsigned int: Pointer to maximum number of pixels in X + dimension. + - unsigned int: Pointer to maximum number of pixels in Y + dimension. .. seealso:: `nvmlVgpuTypeGetResolution` """ @@ -25410,7 +32110,8 @@ cpdef unsigned int vgpu_type_get_max_instances(intptr_t device, unsigned int vgp vgpu_type_id (unsigned int): Handle to vGPU type. Returns: - unsigned int: Pointer to get the max number of vGPU instances that can be created on a deicve for given vgpu_type_id. + unsigned int: Pointer to get the max number of vGPU instances + that can be created on a deicve for given vgpu_type_id. .. seealso:: `nvmlVgpuTypeGetMaxInstances` """ @@ -25428,7 +32129,8 @@ cpdef unsigned int vgpu_type_get_max_instances_per_vm(unsigned int vgpu_type_id) vgpu_type_id (unsigned int): Handle to vGPU type. Returns: - unsigned int: Pointer to get the max number of vGPU instances supported per VM for given ``vgpu_type_id``. + unsigned int: Pointer to get the max number of vGPU instances + supported per VM for given ``vgpu_type_id``. .. seealso:: `nvmlVgpuTypeGetMaxInstancesPerVm` """ @@ -25446,7 +32148,8 @@ cpdef object vgpu_type_get_bar1_info(unsigned int vgpu_type_id): vgpu_type_id (unsigned int): Handle to vGPU type. Returns: - nvmlVgpuTypeBar1Info_v1_t: Pointer to the vGPU type BAR1 information structure ``nvmlVgpuTypeBar1Info_t``. + nvmlVgpuTypeBar1Info_v1_t: Pointer to the vGPU type BAR1 + information structure ``nvmlVgpuTypeBar1Info_t``. .. seealso:: `nvmlVgpuTypeGetBAR1Info` """ @@ -25463,7 +32166,8 @@ cpdef str vgpu_instance_get_uuid(unsigned int vgpu_instance): """Retrieve the UUID of a vGPU instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: char: Pointer to caller-supplied buffer to hold vGPU UUID. @@ -25482,7 +32186,8 @@ cpdef str vgpu_instance_get_vm_driver_version(unsigned int vgpu_instance): """Retrieve the NVIDIA driver version installed in the VM associated with a vGPU. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: char: Caller-supplied buffer to return driver version string. @@ -25501,7 +32206,8 @@ cpdef unsigned long long vgpu_instance_get_fb_usage(unsigned int vgpu_instance) """Retrieve the framebuffer usage in bytes. Args: - vgpu_instance (unsigned int): The identifier of the target instance. + vgpu_instance (unsigned int): The identifier of the target + instance. Returns: unsigned long long: Pointer to framebuffer usage in bytes. @@ -25519,7 +32225,8 @@ cpdef unsigned int vgpu_instance_get_license_status(unsigned int vgpu_instance) """[Deprecated]. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: unsigned int: Reference to return the licensing status. @@ -25537,7 +32244,8 @@ cpdef unsigned int vgpu_instance_get_type(unsigned int vgpu_instance) except? 0: """Retrieve the vGPU type of a vGPU instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: unsigned int: Reference to return the vgpu_type_id. @@ -25555,7 +32263,8 @@ cpdef unsigned int vgpu_instance_get_frame_rate_limit(unsigned int vgpu_instance """Retrieve the frame rate limit set for the vGPU instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: unsigned int: Reference to return the frame rate limit. @@ -25573,7 +32282,8 @@ cpdef int vgpu_instance_get_ecc_mode(unsigned int vgpu_instance) except? -1: """Retrieve the current ECC mode of vGPU instance. Args: - vgpu_instance (unsigned int): The identifier of the target vGPU instance. + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. Returns: int: Reference in which to return the current ECC mode. @@ -25591,10 +32301,12 @@ cpdef unsigned int vgpu_instance_get_encoder_capacity(unsigned int vgpu_instance """Retrieve the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: - unsigned int: Reference to an unsigned int for the encoder capacity. + unsigned int: Reference to an unsigned int for the encoder + capacity. .. seealso:: `nvmlVgpuInstanceGetEncoderCapacity` """ @@ -25609,8 +32321,10 @@ cpdef vgpu_instance_set_encoder_capacity(unsigned int vgpu_instance, unsigned in """Set the encoder capacity of a vGPU instance, as a percentage of maximum encoder capacity with valid values in the range 0-100. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. - encoder_capacity (unsigned int): Unsigned int for the encoder capacity value. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. + encoder_capacity (unsigned int): Unsigned int for the encoder + capacity value. .. seealso:: `nvmlVgpuInstanceSetEncoderCapacity` """ @@ -25623,14 +32337,18 @@ cpdef tuple vgpu_instance_get_encoder_stats(unsigned int vgpu_instance): """Retrieves the current encoder statistics of a vGPU Instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: A 3-tuple containing: - - unsigned int: Reference to an unsigned int for count of active encoder sessions. - - unsigned int: Reference to an unsigned int for trailing average FPS of all active sessions. - - unsigned int: Reference to an unsigned int for encode latency in microseconds. + - unsigned int: Reference to an unsigned int for count of active + encoder sessions. + - unsigned int: Reference to an unsigned int for trailing + average FPS of all active sessions. + - unsigned int: Reference to an unsigned int for encode latency + in microseconds. .. seealso:: `nvmlVgpuInstanceGetEncoderStats` """ @@ -25647,10 +32365,12 @@ cpdef object vgpu_instance_get_encoder_sessions(unsigned int vgpu_instance): """Retrieves information about all active encoder sessions on a vGPU Instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: - nvmlEncoderSessionInfo_t: Reference to caller supplied array in which the list of session information us returned. + nvmlEncoderSessionInfo_t: Reference to caller supplied array + in which the list of session information us returned. .. seealso:: `nvmlVgpuInstanceGetEncoderSessions` """ @@ -25672,10 +32392,12 @@ cpdef object vgpu_instance_get_fbc_stats(unsigned int vgpu_instance): """Retrieves the active frame buffer capture sessions statistics of a vGPU Instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: - nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure containing NvFBC stats. + nvmlFBCStats_t: Reference to ``nvmlFBCStats_t`` structure + containing NvFBC stats. .. seealso:: `nvmlVgpuInstanceGetFBCStats` """ @@ -25691,10 +32413,12 @@ cpdef object vgpu_instance_get_fbc_sessions(unsigned int vgpu_instance): """Retrieves information about active frame buffer capture sessions on a vGPU Instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: - nvmlFBCSessionInfo_t: Reference in which to return the session information. + nvmlFBCSessionInfo_t: Reference in which to return the session + information. .. seealso:: `nvmlVgpuInstanceGetFBCSessions` """ @@ -25716,7 +32440,8 @@ cpdef unsigned int vgpu_instance_get_gpu_instance_id(unsigned int vgpu_instance) """Retrieve the GPU Instance ID for the given vGPU Instance. The API will return a valid GPU Instance ID for MIG backed vGPU Instance, else INVALID_GPU_INSTANCE_ID is returned. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: unsigned int: GPU Instance ID. @@ -25734,7 +32459,8 @@ cpdef str vgpu_instance_get_gpu_pci_id(unsigned int vgpu_instance): """Retrieves the PCI Id of the given vGPU Instance i.e. the PCI Id of the GPU as seen inside the VM. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: char: Caller-supplied buffer to return vGPU PCI Id string. @@ -25760,10 +32486,12 @@ cpdef unsigned int vgpu_type_get_capabilities(unsigned int vgpu_type_id, int cap Args: vgpu_type_id (unsigned int): Handle to vGPU type. - capability (VgpuCapability): Specifies the ``nvmlVgpuCapability_t`` to be queried. + capability (VgpuCapability): Specifies the + ``nvmlVgpuCapability_t`` to be queried. Returns: - unsigned int: A boolean for the queried capability indicating that feature is supported. + unsigned int: A boolean for the queried capability indicating + that feature is supported. .. seealso:: `nvmlVgpuTypeGetCapabilities` """ @@ -25778,7 +32506,8 @@ cpdef str vgpu_instance_get_mdev_uuid(unsigned int vgpu_instance): """Retrieve the MDEV UUID of a vGPU instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: char: Pointer to caller-supplied buffer to hold MDEV UUID. @@ -25798,7 +32527,8 @@ cpdef gpu_instance_set_vgpu_scheduler_state(intptr_t gpu_instance, intptr_t p_sc Args: gpu_instance (intptr_t): The GPU instance handle. - p_scheduler (intptr_t): Pointer to the caller-provided structure of ``nvmlVgpuSchedulerState_t``. + p_scheduler (intptr_t): Pointer to the caller-provided + structure of ``nvmlVgpuSchedulerState_t``. .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState` """ @@ -25815,7 +32545,8 @@ cpdef object gpu_instance_get_vgpu_scheduler_state(intptr_t gpu_instance): gpu_instance (intptr_t): The GPU instance handle. Returns: - nvmlVgpuSchedulerStateInfo_v1_t: Reference in which ``p_scheduler_state_info`` is returned. + nvmlVgpuSchedulerStateInfo_v1_t: Reference in which + ``p_scheduler_state_info`` is returned. .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerState` """ @@ -25835,7 +32566,8 @@ cpdef object gpu_instance_get_vgpu_scheduler_log(intptr_t gpu_instance): gpu_instance (intptr_t): The GPU instance handle. Returns: - nvmlVgpuSchedulerLogInfo_v1_t: Reference in which ``p_scheduler_log_info`` is written. + nvmlVgpuSchedulerLogInfo_v1_t: Reference in which + ``p_scheduler_log_info`` is written. .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerLog` """ @@ -25855,7 +32587,8 @@ cpdef str device_get_pgpu_metadata_string(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - char: Pointer to caller-supplied buffer into which ``pgpu_metadata`` is written. + char: Pointer to caller-supplied buffer into which + ``pgpu_metadata`` is written. .. seealso:: `nvmlDeviceGetPgpuMetadataString` """ @@ -25880,7 +32613,8 @@ cpdef object device_get_vgpu_scheduler_log(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerLog_t: Reference in which ``p_scheduler_log`` is written. + nvmlVgpuSchedulerLog_t: Reference in which ``p_scheduler_log`` + is written. .. seealso:: `nvmlDeviceGetVgpuSchedulerLog` """ @@ -25899,7 +32633,8 @@ cpdef object device_get_vgpu_scheduler_state(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerGetState_t: Reference in which ``p_scheduler_state`` is returned. + nvmlVgpuSchedulerGetState_t: Reference in which + ``p_scheduler_state`` is returned. .. seealso:: `nvmlDeviceGetVgpuSchedulerState` """ @@ -25918,7 +32653,8 @@ cpdef object device_get_vgpu_scheduler_capabilities(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerCapabilities_t: Reference in which ``p_capabilities`` is written. + nvmlVgpuSchedulerCapabilities_t: Reference in which + ``p_capabilities`` is written. .. seealso:: `nvmlDeviceGetVgpuSchedulerCapabilities` """ @@ -25935,7 +32671,8 @@ cpdef device_set_vgpu_scheduler_state(intptr_t device, intptr_t p_scheduler_stat Args: device (intptr_t): The identifier of the target ``device``. - p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to set. + p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to + set. .. seealso:: `nvmlDeviceSetVgpuSchedulerState` """ @@ -25948,7 +32685,8 @@ cpdef set_vgpu_version(intptr_t vgpu_version): """Override the preset range of vGPU versions supported by the NVIDIA vGPU Manager with a range set by an administrator. Args: - vgpu_version (intptr_t): Pointer to a caller-supplied range of supported vGPU versions. + vgpu_version (intptr_t): Pointer to a caller-supplied range of + supported vGPU versions. .. seealso:: `nvmlSetVgpuVersion` """ @@ -25962,13 +32700,17 @@ cpdef tuple device_get_vgpu_process_utilization(intptr_t device, unsigned long l Args: device (intptr_t): The identifier for the target device. - last_seen_time_stamp (unsigned long long): Return only samples with timestamp greater than last_seen_time_stamp. + last_seen_time_stamp (unsigned long long): Return only samples + with timestamp greater than last_seen_time_stamp. Returns: A 2-tuple containing: - - unsigned int: Pointer to caller-supplied array size, and returns number of processes running on vGPU instances. - - nvmlVgpuProcessUtilizationSample_t: Pointer to caller-supplied buffer in which vGPU sub process utilization samples are returned. + - unsigned int: Pointer to caller-supplied array size, and + returns number of processes running on vGPU instances. + - nvmlVgpuProcessUtilizationSample_t: Pointer to caller-supplied + buffer in which vGPU sub process utilization samples are + returned. .. seealso:: `nvmlDeviceGetVgpuProcessUtilization` """ @@ -25984,7 +32726,8 @@ cpdef int vgpu_instance_get_accounting_mode(unsigned int vgpu_instance) except? """Queries the state of per process accounting mode on vGPU. Args: - vgpu_instance (unsigned int): The identifier of the target vGPU instance. + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. Returns: int: Reference in which to return the current accounting mode. @@ -26002,10 +32745,12 @@ cpdef object vgpu_instance_get_accounting_pids(unsigned int vgpu_instance): """Queries list of processes running on vGPU that can be queried for accounting stats. The list of processes returned can be in running or terminated state. Args: - vgpu_instance (unsigned int): The identifier of the target vGPU instance. + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. Returns: - unsigned int: Reference in which to return list of process ids. + unsigned int: Reference in which to return list of process + ids. .. seealso:: `nvmlVgpuInstanceGetAccountingPids` """ @@ -26027,11 +32772,14 @@ cpdef object vgpu_instance_get_accounting_stats(unsigned int vgpu_instance, unsi """Queries process's accounting stats. Args: - vgpu_instance (unsigned int): The identifier of the target vGPU instance. - pid (unsigned int): Process Id of the target process to query stats for. + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. + pid (unsigned int): Process Id of the target process to query + stats for. Returns: - nvmlAccountingStats_t: Reference in which to return the process's accounting stats. + nvmlAccountingStats_t: Reference in which to return the + process's accounting stats. .. seealso:: `nvmlVgpuInstanceGetAccountingStats` """ @@ -26047,7 +32795,8 @@ cpdef vgpu_instance_clear_accounting_pids(unsigned int vgpu_instance): """Clears accounting information of the vGPU instance that have already terminated. Args: - vgpu_instance (unsigned int): The identifier of the target vGPU instance. + vgpu_instance (unsigned int): The identifier of the target + vGPU instance. .. seealso:: `nvmlVgpuInstanceClearAccountingPids` """ @@ -26060,10 +32809,12 @@ cpdef object vgpu_instance_get_license_info_v2(unsigned int vgpu_instance): """Query the license information of the vGPU instance. Args: - vgpu_instance (unsigned int): Identifier of the target vGPU instance. + vgpu_instance (unsigned int): Identifier of the target vGPU + instance. Returns: - nvmlVgpuLicenseInfo_t: Pointer to vGPU license information structure. + nvmlVgpuLicenseInfo_t: Pointer to vGPU license information + structure. .. seealso:: `nvmlVgpuInstanceGetLicenseInfo_v2` """ @@ -26079,7 +32830,8 @@ cpdef unsigned int get_excluded_device_count() except? 0: """Retrieves the number of excluded GPU devices in the system. Returns: - unsigned int: Reference in which to return the number of excluded devices. + unsigned int: Reference in which to return the number of + excluded devices. .. seealso:: `nvmlGetExcludedDeviceCount` """ @@ -26094,10 +32846,12 @@ cpdef object get_excluded_device_info_by_index(unsigned int index): """Acquire the device information for an excluded GPU device, based on its index. Args: - index (unsigned int): The index of the target GPU, >= 0 and < ``deviceCount``. + index (unsigned int): The index of the target GPU, >= 0 and < + ``deviceCount``. Returns: - nvmlExcludedDeviceInfo_t: Reference in which to return the device information. + nvmlExcludedDeviceInfo_t: Reference in which to return the + device information. .. seealso:: `nvmlGetExcludedDeviceInfoByIndex` """ @@ -26114,7 +32868,8 @@ cpdef int device_set_mig_mode(intptr_t device, unsigned int mode) except? -1: Args: device (intptr_t): The identifier of the target device. - mode (unsigned int): The mode to be set, ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + mode (unsigned int): The mode to be set, + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. Returns: int: The activation_status status. @@ -26137,8 +32892,10 @@ cpdef tuple device_get_mig_mode(intptr_t device): Returns: A 2-tuple containing: - - unsigned int: Returns the current mode, ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. - - unsigned int: Returns the pending mode, ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + - unsigned int: Returns the current mode, + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. + - unsigned int: Returns the pending mode, + ``NVML_DEVICE_MIG_DISABLE`` or ``NVML_DEVICE_MIG_ENABLE``. .. seealso:: `nvmlDeviceGetMigMode` """ @@ -26155,10 +32912,15 @@ cpdef object device_get_gpu_instance_possible_placements_v2(intptr_t device, uns Args: device (intptr_t): The identifier of the target device. - profile_id (unsigned int): The GPU instance profile ID. See ``nvmlDeviceGetGpuInstanceProfileInfo``. + profile_id (unsigned int): The GPU instance profile ID. See + ``nvmlDeviceGetGpuInstanceProfileInfo``. Returns: - nvmlGpuInstancePlacement_t: Returns placements allowed for the profile. Can be NULL to discover number of allowed placements for this profile. If non-NULL must be large enough to accommodate the placements supported by the profile. + nvmlGpuInstancePlacement_t: Returns placements allowed for the + profile. Can be NULL to discover number of allowed + placements for this profile. If non-NULL must be large + enough to accommodate the placements supported by the + profile. .. seealso:: `nvmlDeviceGetGpuInstancePossiblePlacements_v2` """ @@ -26181,10 +32943,12 @@ cpdef unsigned int device_get_gpu_instance_remaining_capacity(intptr_t device, u Args: device (intptr_t): The identifier of the target device. - profile_id (unsigned int): The GPU instance profile ID. See ``nvmlDeviceGetGpuInstanceProfileInfo``. + profile_id (unsigned int): The GPU instance profile ID. See + ``nvmlDeviceGetGpuInstanceProfileInfo``. Returns: - unsigned int: Returns remaining instance count for the profile ID. + unsigned int: Returns remaining instance count for the profile + ID. .. seealso:: `nvmlDeviceGetGpuInstanceRemainingCapacity` """ @@ -26200,7 +32964,8 @@ cpdef intptr_t device_create_gpu_instance(intptr_t device, unsigned int profile_ Args: device (intptr_t): The identifier of the target device. - profile_id (unsigned int): The GPU instance profile ID. See ``nvmlDeviceGetGpuInstanceProfileInfo``. + profile_id (unsigned int): The GPU instance profile ID. See + ``nvmlDeviceGetGpuInstanceProfileInfo``. Returns: intptr_t: Returns the GPU instance handle. @@ -26219,8 +32984,10 @@ cpdef intptr_t device_create_gpu_instance_with_placement(intptr_t device, unsign Args: device (intptr_t): The identifier of the target device. - profile_id (unsigned int): The GPU instance profile ID. See ``nvmlDeviceGetGpuInstanceProfileInfo``. - placement (intptr_t): The requested placement. See ``nvmlDeviceGetGpuInstancePossiblePlacements_v2``. + profile_id (unsigned int): The GPU instance profile ID. See + ``nvmlDeviceGetGpuInstanceProfileInfo``. + placement (intptr_t): The requested placement. See + ``nvmlDeviceGetGpuInstancePossiblePlacements_v2``. Returns: intptr_t: Returns the GPU instance handle. @@ -26289,12 +33056,16 @@ cpdef object gpu_instance_get_compute_instance_profile_info_v(intptr_t gpu_insta """Versioned wrapper around ``nvmlGpuInstanceGetComputeInstanceProfileInfo`` that accepts a versioned ``nvmlComputeInstanceProfileInfo_v2_t`` or later output structure. Args: - gpu_instance (intptr_t): The identifier of the target GPU instance. - profile (unsigned int): One of the NVML_COMPUTE_INSTANCE_PROFILE_*. - eng_profile (unsigned int): One of the NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_*. + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile (unsigned int): One of the + NVML_COMPUTE_INSTANCE_PROFILE_*. + eng_profile (unsigned int): One of the + NVML_COMPUTE_INSTANCE_ENGINE_PROFILE_*. Returns: - nvmlComputeInstanceProfileInfo_v2_t: Returns detailed profile information. + nvmlComputeInstanceProfileInfo_v2_t: Returns detailed profile + information. .. seealso:: `nvmlGpuInstanceGetComputeInstanceProfileInfoV` """ @@ -26311,11 +33082,14 @@ cpdef unsigned int gpu_instance_get_compute_instance_remaining_capacity(intptr_t """Get compute instance profile capacity. Args: - gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile_id (unsigned int): The compute instance profile ID. + See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. Returns: - unsigned int: Returns remaining instance count for the profile ID. + unsigned int: Returns remaining instance count for the profile + ID. .. seealso:: `nvmlGpuInstanceGetComputeInstanceRemainingCapacity` """ @@ -26330,11 +33104,17 @@ cpdef object gpu_instance_get_compute_instance_possible_placements(intptr_t gpu_ """Get compute instance placements. Args: - gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile_id (unsigned int): The compute instance profile ID. + See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. Returns: - nvmlComputeInstancePlacement_t: Returns placements allowed for the profile. Can be NULL to discover number of allowed placements for this profile. If non-NULL must be large enough to accommodate the placements supported by the profile. + nvmlComputeInstancePlacement_t: Returns placements allowed for + the profile. Can be NULL to discover number of allowed + placements for this profile. If non-NULL must be large + enough to accommodate the placements supported by the + profile. .. seealso:: `nvmlGpuInstanceGetComputeInstancePossiblePlacements` """ @@ -26356,8 +33136,10 @@ cpdef intptr_t gpu_instance_create_compute_instance(intptr_t gpu_instance, unsig """Create compute instance. Args: - gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile_id (unsigned int): The compute instance profile ID. + See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. Returns: intptr_t: Returns the compute instance handle. @@ -26375,9 +33157,12 @@ cpdef intptr_t gpu_instance_create_compute_instance_with_placement(intptr_t gpu_ """Create compute instance with the specified placement. Args: - gpu_instance (intptr_t): The identifier of the target GPU instance. - profile_id (unsigned int): The compute instance profile ID. See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. - placement (intptr_t): The requested placement. See ``nvmlGpuInstanceGetComputeInstancePossiblePlacements``. + gpu_instance (intptr_t): The identifier of the target GPU + instance. + profile_id (unsigned int): The compute instance profile ID. + See ``nvmlGpuInstanceGetComputeInstanceProfileInfo``. + placement (intptr_t): The requested placement. See + ``nvmlGpuInstanceGetComputeInstancePossiblePlacements``. Returns: intptr_t: Returns the compute instance handle. @@ -26408,7 +33193,8 @@ cpdef intptr_t gpu_instance_get_compute_instance_by_id(intptr_t gpu_instance, un """Get compute instance for given instance ID. Args: - gpu_instance (intptr_t): The identifier of the target GPU instance. + gpu_instance (intptr_t): The identifier of the target GPU + instance. id (unsigned int): The compute instance ID. Returns: @@ -26430,7 +33216,8 @@ cpdef object compute_instance_get_info_v2(intptr_t compute_instance): compute_instance (intptr_t): The compute instance handle. Returns: - nvmlComputeInstanceInfo_t: Return compute instance information. + nvmlComputeInstanceInfo_t: Return compute instance + information. .. seealso:: `nvmlComputeInstanceGetInfo_v2` """ @@ -26556,7 +33343,10 @@ cpdef device_power_smoothing_activate_preset_profile(intptr_t device, intptr_t p Args: device (intptr_t): The identifier of the target device. - profile (intptr_t): Reference to ``nvmlPowerSmoothingProfile_v1_t``. Note that only ``profile->profileId`` is used and the rest of the structure is ignored. + profile (intptr_t): Reference to + ``nvmlPowerSmoothingProfile_v1_t``. Note that only + ``profile->profileId`` is used and the rest of the + structure is ignored. .. seealso:: `nvmlDevicePowerSmoothingActivatePresetProfile` """ @@ -26570,7 +33360,8 @@ cpdef device_power_smoothing_update_preset_profile_param(intptr_t device, intptr Args: device (intptr_t): The identifier of the target device. - profile (intptr_t): Reference to ``nvmlPowerSmoothingProfile_v1_t`` struct. + profile (intptr_t): Reference to + ``nvmlPowerSmoothingProfile_v1_t`` struct. .. seealso:: `nvmlDevicePowerSmoothingUpdatePresetProfileParam` """ @@ -26584,7 +33375,8 @@ cpdef device_power_smoothing_set_state(intptr_t device, intptr_t state): Args: device (intptr_t): The identifier of the target device. - state (intptr_t): Reference to ``nvmlPowerSmoothingState_v1_t``. + state (intptr_t): Reference to + ``nvmlPowerSmoothingState_v1_t``. .. seealso:: `nvmlDevicePowerSmoothingSetState` """ @@ -26600,7 +33392,8 @@ cpdef object device_get_addressing_mode(intptr_t device): device (intptr_t): The device handle. Returns: - nvmlDeviceAddressingMode_v1_t: Pointer to addressing mode of the device. + nvmlDeviceAddressingMode_v1_t: Pointer to addressing mode of + the device. .. seealso:: `nvmlDeviceGetAddressingMode` """ @@ -26640,7 +33433,8 @@ cpdef object device_get_power_mizer_mode_v1(intptr_t device): device (intptr_t): The identifier of the target device. Returns: - nvmlDevicePowerMizerModes_v1_t: Reference in which to return the power mizer mode. + nvmlDevicePowerMizerModes_v1_t: Reference in which to return + the power mizer mode. .. seealso:: `nvmlDeviceGetPowerMizerMode_v1` """ @@ -26657,7 +33451,8 @@ cpdef device_set_power_mizer_mode_v1(intptr_t device, intptr_t power_mizer_mode) Args: device (intptr_t): The identifier of the target device. - power_mizer_mode (intptr_t): Reference in which to set the power mizer mode. + power_mizer_mode (intptr_t): Reference in which to set the + power mizer mode. .. seealso:: `nvmlDeviceSetPowerMizerMode_v1` """ @@ -26686,7 +33481,8 @@ cpdef object device_get_vgpu_scheduler_state_v2(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerStateInfo_v2_t: Reference in which ``p_scheduler_state_info`` is returned. + nvmlVgpuSchedulerStateInfo_v2_t: Reference in which + ``p_scheduler_state_info`` is returned. .. seealso:: `nvmlDeviceGetVgpuSchedulerState_v2` """ @@ -26705,7 +33501,8 @@ cpdef object gpu_instance_get_vgpu_scheduler_state_v2(intptr_t gpu_instance): gpu_instance (intptr_t): The GPU instance handle. Returns: - nvmlVgpuSchedulerStateInfo_v2_t: Reference in which ``p_scheduler_state_info`` is returned. + nvmlVgpuSchedulerStateInfo_v2_t: Reference in which + ``p_scheduler_state_info`` is returned. .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerState_v2` """ @@ -26724,7 +33521,8 @@ cpdef object device_get_vgpu_scheduler_log_v2(intptr_t device): device (intptr_t): The identifier of the target ``device``. Returns: - nvmlVgpuSchedulerLogInfo_v2_t: Reference in which ``p_scheduler_log_info`` is written. + nvmlVgpuSchedulerLogInfo_v2_t: Reference in which + ``p_scheduler_log_info`` is written. .. seealso:: `nvmlDeviceGetVgpuSchedulerLog_v2` """ @@ -26743,7 +33541,8 @@ cpdef object gpu_instance_get_vgpu_scheduler_log_v2(intptr_t gpu_instance): gpu_instance (intptr_t): The GPU instance handle. Returns: - nvmlVgpuSchedulerLogInfo_v2_t: Reference in which ``p_scheduler_log_info`` is written. + nvmlVgpuSchedulerLogInfo_v2_t: Reference in which + ``p_scheduler_log_info`` is written. .. seealso:: `nvmlGpuInstanceGetVgpuSchedulerLog_v2` """ @@ -26760,7 +33559,8 @@ cpdef device_set_vgpu_scheduler_state_v2(intptr_t device, intptr_t p_scheduler_s Args: device (intptr_t): The identifier of the target ``device``. - p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to set. + p_scheduler_state (intptr_t): vGPU ``p_scheduler_state`` to + set. .. seealso:: `nvmlDeviceSetVgpuSchedulerState_v2` """ @@ -26774,7 +33574,8 @@ cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p Args: gpu_instance (intptr_t): The GPU instance handle. - p_scheduler_state (intptr_t): Pointer to the caller-provided structure of ``nvmlVgpuSchedulerState_v2_t``. + p_scheduler_state (intptr_t): Pointer to the caller-provided + structure of ``nvmlVgpuSchedulerState_v2_t``. .. seealso:: `nvmlGpuInstanceSetVgpuSchedulerState_v2` """ @@ -26783,6 +33584,361 @@ cpdef gpu_instance_set_vgpu_scheduler_state_v2(intptr_t gpu_instance, intptr_t p check_status(__status__) +cpdef object system_get_cper_v1(): + """Retrieves Common Platform Error Record (CPER) data. + + Returns: + nvmlGetCPER_v1_t: Pointer to an ``nvmlGetCPER_v1_t``. On entry + set ``cursor.cperTypeMask``, ``cursor.uuid`` (empty string + for all), ``cursor.handle`` (to + ``NVML_CPER_CURSOR_HANDLE_INIT`` for first call), + ``buffer`` (or NULL), ``bufferSize``. On return + ``cursor.handle`` and ``bufferSize`` are updated. + + .. seealso:: `nvmlSystemGetCPER_v1` + """ + cdef GetCPER_v1 cper_py = GetCPER_v1() + cdef nvmlGetCPER_v1_t *cper = (cper_py._get_ptr()) + with nogil: + __status__ = nvmlSystemGetCPER_v1(cper) + check_status(__status__) + return cper_py + + +cpdef object device_get_bbx_time_data_v1(intptr_t device): + """Retrieves the cumulative number of seconds the GPU has had the driver loaded. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlBBXTimeData_v1_t: Reference in which to return the + cumulative number of seconds the GPU has had the driver + loaded. + + .. seealso:: `nvmlDeviceGetBBXTimeData_v1` + """ + cdef BBXTimeData_v1 time_data_py = BBXTimeData_v1() + cdef nvmlBBXTimeData_v1_t *time_data = (time_data_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetBBXTimeData_v1(device, time_data) + check_status(__status__) + return time_data_py + + +cpdef object device_get_accounting_stats_v2(intptr_t device): + """Queries process's accounting stats (v2). + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlAccountingStats_v2_t: Reference in which to return the + process's accounting stats (v2). + + .. seealso:: `nvmlDeviceGetAccountingStats_v2` + """ + cdef AccountingStats_v2 stats_py = AccountingStats_v2() + cdef nvmlAccountingStats_v2_t *stats = (stats_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetAccountingStats_v2(device, stats) + check_status(__status__) + return stats_py + + +cpdef object device_get_remapped_rows_v2(intptr_t device): + """Get the status of row remapper. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlRemappedRowsInfo_v2_t: Reference for + ``nvmlRemappedRowsInfo_v2_t``. + + .. seealso:: `nvmlDeviceGetRemappedRows_v2` + """ + cdef RemappedRowsInfo_v2 info_py = RemappedRowsInfo_v2() + cdef nvmlRemappedRowsInfo_v2_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetRemappedRows_v2(device, info) + check_status(__status__) + 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_wait_v3(intptr_t set, unsigned int timeoutms): + """Waits on an event set and returns the next event in the extended event format. + + Args: + set (intptr_t): Reference to set of events to wait on. + timeoutms (unsigned int): Maximum amount of wait time in + milliseconds for registered event. + + Returns: + nvmlEventData_v2_t: Reference in which to return extended + event data. + + .. seealso:: `nvmlEventSetWait_v3` + """ + cdef EventData_v2 data_py = EventData_v2() + cdef nvmlEventData_v2_t *data = (data_py._get_ptr()) + with nogil: + __status__ = nvmlEventSetWait_v3(set, data, timeoutms) + check_status(__status__) + return data_py + + +cpdef unsigned int event_set_get_context_count_v1(intptr_t set) except? 0: + """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: + unsigned int: Reference in which to return the number of + context records. + + .. seealso:: `nvmlEventSetGetContextCount_v1` + """ + cdef unsigned int count + with nogil: + __status__ = nvmlEventSetGetContextCount_v1(set, &count) + check_status(__status__) + return count + + +cpdef object event_set_get_context_info_v1(intptr_t set, unsigned int index): + """Gets metadata for a context record from the most recent event returned by ``nvmlEventSetWait_v3``. + + Args: + set (intptr_t): Event set previously used with + ``nvmlEventSetWait_v3``. + index (unsigned int): Zero-based context index. + + Returns: + nvmlOperationalEventContextInfo_v1_t: Reference in which to + return context metadata. + + .. seealso:: `nvmlEventSetGetContextInfo_v1` + """ + cdef OperationalEventContextInfo_v1 info_py = OperationalEventContextInfo_v1() + cdef nvmlOperationalEventContextInfo_v1_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlEventSetGetContextInfo_v1(set, index, info) + check_status(__status__) + return info_py + + +cpdef object event_set_get_gpu_operational_event_context_legacy_xid_v1(intptr_t set, unsigned int index): + """Gets decoded GPU legacy-Xid context data for a context record from the most recent event returned by ``nvmlEventSetWait_v3``. + + Args: + set (intptr_t): Event set previously used with + ``nvmlEventSetWait_v3``. + index (unsigned int): Zero-based context index. + + Returns: + nvmlGpuOperationalEventContextLegacyXid_v1_t: Reference in + which to return legacy-Xid context data. + + .. seealso:: `nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1` + """ + cdef GpuOperationalEventContextLegacyXid_v1 xid_py = GpuOperationalEventContextLegacyXid_v1() + cdef nvmlGpuOperationalEventContextLegacyXid_v1_t *xid = (xid_py._get_ptr()) + with nogil: + __status__ = nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(set, index, xid) + check_status(__status__) + return xid_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 @@ -28466,8 +35622,31 @@ cpdef str vgpu_type_get_name(unsigned int vgpu_type_id): return cpython.PyUnicode_FromStringAndSize(vgpu_type_name, size[0]) -# Cleanup some docstrings that don't parse as rst. -device_get_virtualization_mode.__doc__ = device_get_virtualization_mode.__doc__.replace("NVML_GPU_VIRTUALIZATION_?", "``NVML_GPU_VIRTUALIZATION_?``") -device_set_virtualization_mode.__doc__ = device_set_virtualization_mode.__doc__.replace("NVML_GPU_VIRTUALIZATION_?", "``NVML_GPU_VIRTUALIZATION_?``") -GpmMetricId.GPM_METRIC_DRAM_BW_UTIL.__doc__ = "Percentage of DRAM bw used vs theoretical maximum. ``0.0 - 100.0 *\u200d/``." +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 unsigned int data_size + with nogil: + __status__ = nvmlEventSetGetContextData_v1(set, index, NULL, &data_size) + check_status_size(__status__) + cdef bytes data = bytes(data_size) + cdef void *_data_ = data + with nogil: + __status__ = nvmlEventSetGetContextData_v1(set, index, _data_, &data_size) + check_status(__status__) + return data del _cyb_FastEnum diff --git a/cuda_bindings/cuda/bindings/nvrtc.pxd b/cuda_bindings/cuda/bindings/nvrtc.pxd index a17faea0763..6e72b78f0d3 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pxd +++ b/cuda_bindings/cuda/bindings/nvrtc.pxd @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=06a058e3c626563f034714cce129fd58b33dd80c0e4a954723e92d0ae61c7c58 +# This code was automatically generated with version 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=315bc7e377beef4b6e7e6dbb58c18dd44c06655387f58ccdfacd96a4fa464c60 cimport cuda.bindings.cynvrtc as cynvrtc include "_lib/utils.pxd" diff --git a/cuda_bindings/cuda/bindings/nvrtc.pyx b/cuda_bindings/cuda/bindings/nvrtc.pyx index d963b48f791..b4b4d713579 100644 --- a/cuda_bindings/cuda/bindings/nvrtc.pyx +++ b/cuda_bindings/cuda/bindings/nvrtc.pyx @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ac1af34ecd1468ac91074ce7f18423af19fbc7727653cdfc1cd9b6f33f6cec72 +# This code was automatically generated with version 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9dcd9e24a5962a3fa156378497290ef95c84fb433d2c31c6e2a5da5528391fe8 from typing import Any, Optional import cython import ctypes diff --git a/cuda_bindings/cuda/bindings/nvvm.pxd b/cuda_bindings/cuda/bindings/nvvm.pxd index cb97bd48714..6e96ef7c920 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pxd +++ b/cuda_bindings/cuda/bindings/nvvm.pxd @@ -2,9 +2,10 @@ # # 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.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b4e10f31d2308a47fccfc9401d4f179bf61d389c1eb1491e8f9b00bf37a14ea9 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=64399bc158dff1d573ee582b859de69945c0aa7daca57980ad1372b441bd0fbd from libc.stdint cimport intptr_t from .cynvvm cimport * diff --git a/cuda_bindings/cuda/bindings/nvvm.pyx b/cuda_bindings/cuda/bindings/nvvm.pyx index 6d18a50f24c..fecc9c36856 100644 --- a/cuda_bindings/cuda/bindings/nvvm.pyx +++ b/cuda_bindings/cuda/bindings/nvvm.pyx @@ -2,8 +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. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=82dc56ccc695031faa515d1971c9841131d5aadc60c6d6e6cc223580fc544d16 +# This code was automatically generated across versions from 12.0.1 to 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c4c368f2adb8e24c25c067370ec9263cbd656df971795916276cdd859d339743 # <<<< PREAMBLE CONTENT >>>> @@ -162,9 +163,11 @@ cpdef add_module_to_program(intptr_t prog, buffer, size_t size, name): Args: prog (intptr_t): NVVM program. - buffer (bytes): NVVM IR module in the bitcode or text representation. + buffer (bytes): NVVM IR module in the bitcode or text + representation. size (size_t): Size of the NVVM IR module. - name (str): Name of the NVVM IR module. If NULL, "" is used as the name. + name (str): Name of the NVVM IR module. If NULL, "" + is used as the name. .. seealso:: `nvvmAddModuleToProgram` """ @@ -185,7 +188,8 @@ cpdef lazy_add_module_to_program(intptr_t prog, buffer, size_t size, name): prog (intptr_t): NVVM program. buffer (bytes): NVVM IR module in the bitcode representation. size (size_t): Size of the NVVM IR module. - name (str): Name of the NVVM IR module. If NULL, "" is used as the name. + name (str): Name of the NVVM IR module. If NULL, "" + is used as the name. .. seealso:: `nvvmLazyAddModuleToProgram` """ @@ -205,7 +209,8 @@ cpdef compile_program(intptr_t prog, int num_options, options): Args: prog (intptr_t): NVVM program. num_options (int): Number of compiler ``options`` passed. - options (object): Compiler options in the form of C string array. It can be: + options (object): Compiler options in the form of C string + array. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address @@ -228,7 +233,8 @@ cpdef verify_program(intptr_t prog, int num_options, options): Args: prog (intptr_t): NVVM program. num_options (int): Number of compiler ``options`` passed. - options (object): Compiler options in the form of C string array. It can be: + options (object): Compiler options in the form of C string + array. It can be: - an :class:`int` as the pointer address to the nested sequence, or - a Python sequence of :class:`int`\s, each of which is a pointer address @@ -252,7 +258,8 @@ cpdef size_t get_compiled_result_size(intptr_t prog) except? 0: prog (intptr_t): NVVM program. Returns: - size_t: Size of the compiled result (including the trailing NULL). + size_t: Size of the compiled result (including the trailing + NULL). .. seealso:: `nvvmGetCompiledResultSize` """ @@ -285,7 +292,8 @@ cpdef size_t get_program_log_size(intptr_t prog) except? 0: prog (intptr_t): NVVM program. Returns: - size_t: Size of the compilation/verification log (including the trailing NULL). + size_t: Size of the compilation/verification log (including + the trailing NULL). .. seealso:: `nvvmGetProgramLogSize` """ diff --git a/cuda_bindings/cuda/bindings/runtime.pxd b/cuda_bindings/cuda/bindings/runtime.pxd index 7cb680d1743..ec25a1ee7c6 100644 --- a/cuda_bindings/cuda/bindings/runtime.pxd +++ b/cuda_bindings/cuda/bindings/runtime.pxd @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0f2431380680008795336b7acb5ccd83dba7a6e05d0c81c2b5f825bc95576ccd +# This code was automatically generated with version 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5aa83c59fe0efd6b7e04554fe5342e91b15f6bd7d06bc3c3a1b9edd772ae8765 cimport cuda.bindings.cyruntime as cyruntime include "_lib/utils.pxd" @@ -405,10 +406,6 @@ cdef class cudaArraySparseProperties: Flags will either be zero or cudaArraySparsePropertiesSingleMipTail - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -435,10 +432,6 @@ cdef class cudaArrayMemoryRequirements: Alignment necessary for mapping the array. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -615,10 +608,6 @@ cdef class cudaMemcpyNodeParams: Must be zero - reserved : int - Must be zero - - ctx : cudaExecutionContext_t Context in which to run the memcpy. If NULL will try to use the current context. @@ -903,6 +892,10 @@ cdef class cudaHostNodeParamsV2: The synchronization mode to use for the host task + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -917,6 +910,9 @@ cdef class cudaHostNodeParamsV2: cdef _HelperInputVoidPtr _cyuserData + cdef cudaExecutionContext_t _ctx + + cdef class anon_struct1: """ Attributes @@ -1025,13 +1021,6 @@ cdef class anon_struct4: cdef class anon_struct5: """ - Attributes - ---------- - - reserved : list[int] - - - Methods ------- getPtr() @@ -1060,10 +1049,6 @@ cdef class anon_union0: - reserved : anon_struct5 - - - Methods ------- getPtr() @@ -1083,9 +1068,6 @@ cdef class anon_union0: cdef anon_struct4 _pitch2D - cdef anon_struct5 _reserved - - cdef class cudaResourceDesc: """ CUDA resource descriptor @@ -1155,10 +1137,6 @@ cdef class cudaResourceViewDesc: Last layer index - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -1201,8 +1179,8 @@ cdef class cudaPointerAttributes: pointer if an invalid pointer has been passed to CUDA. - reserved : list[long] - Must be zero + localityDomainOrdinal : int + Methods @@ -1210,7 +1188,7 @@ cdef class cudaPointerAttributes: getPtr() Get memory address of class instance """ - cdef cyruntime.cudaPointerAttributes _pvt_val + cdef cyruntime.cudaPointerAttributes* _val_ptr cdef cyruntime.cudaPointerAttributes* _pvt_ptr cdef _HelperInputVoidPtr _cydevicePointer @@ -1273,7 +1251,11 @@ cdef class cudaFuncAttributes: maxDynamicSharedSizeBytes : int The maximum size in bytes of dynamic shared memory per block for this function. Any launch must have a dynamic shared memory size - smaller than this value. + smaller than this value. This attribute is ignored if the + sharedMemoryMode function or launch attribute is set. This + attribute cannot be used to access oversized shared memory. + Oversized shared memory can only be accessed by setting the shared + memory mode. See cudaFuncSetAttribute preferredShmemCarveout : int @@ -1282,7 +1264,7 @@ cdef class cudaFuncAttributes: preference, in percent of the maximum shared memory. Refer to cudaDevAttrMaxSharedMemoryPerMultiprocessor. This is only a hint, and the driver can choose a different ratio if required to execute - the function. See cudaFuncSetAttribute + the function. See cudaFuncSetAttribute clusterDimMustBeSet : int @@ -1295,7 +1277,7 @@ cdef class cudaFuncAttributes: either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at - runtime should return cudaErrorNotPermitted. See + runtime should return cudaErrorNotPermitted. See cudaFuncSetAttribute @@ -1308,7 +1290,8 @@ cdef class cudaFuncAttributes: clusterSchedulingPolicyPreference : int - The block scheduling policy of a function. See cudaFuncSetAttribute + The block scheduling policy of a function. See + cudaFuncSetAttribute nonPortableClusterSizeAllowed : int @@ -1323,7 +1306,7 @@ cdef class cudaFuncAttributes: than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. The specific hardware unit may support - higher cluster sizes that’s not guaranteed to be portable. See + higher cluster sizes that’s not guaranteed to be portable. See cudaFuncSetAttribute @@ -1333,12 +1316,30 @@ cdef class cudaFuncAttributes: the value. - reserved1 : int + sharedMemoryMode : cudaSharedMemoryMode + This controls a kernel's use of non-portable or oversized shared + memory configurations. See cudaFuncSetAttribute + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef cyruntime.cudaFuncAttributes _pvt_val + cdef cyruntime.cudaFuncAttributes* _pvt_ptr + +cdef class anon_struct6: + """ + Attributes + ---------- + + deviceId : bytes + + + + localityDomainId : bytes - reserved : list[int] - Reserved for future use. Methods @@ -1346,8 +1347,7 @@ cdef class cudaFuncAttributes: getPtr() Get memory address of class instance """ - cdef cyruntime.cudaFuncAttributes _pvt_val - cdef cyruntime.cudaFuncAttributes* _pvt_ptr + cdef cyruntime.cudaMemLocation* _pvt_ptr cdef class cudaMemLocation: """ @@ -1369,6 +1369,11 @@ cdef class cudaMemLocation: cudaMemLocationType::cudaMemLocationTypeHostNuma. + localized : anon_struct6 + Identifier for + cudaMemLocationType::cudaMemLocationTypeDeviceLocalityDomain. + + Methods ------- getPtr() @@ -1377,6 +1382,9 @@ cdef class cudaMemLocation: cdef cyruntime.cudaMemLocation* _val_ptr cdef cyruntime.cudaMemLocation* _pvt_ptr + cdef anon_struct6 _localized + + cdef class cudaMemAccessDesc: """ Memory access descriptor @@ -1440,10 +1448,6 @@ cdef class cudaMemPoolProps: Bitmask indicating intended usage for the pool. - reserved : bytes - reserved for future use, must be 0 - - Methods ------- getPtr() @@ -1462,13 +1466,6 @@ cdef class cudaMemPoolPtrExportData: """ Opaque data for exporting a pool allocation - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -1666,7 +1663,7 @@ cdef class cudaOffset3D: cdef cyruntime.cudaOffset3D _pvt_val cdef cyruntime.cudaOffset3D* _pvt_ptr -cdef class anon_struct6: +cdef class anon_struct7: """ Attributes ---------- @@ -1700,7 +1697,7 @@ cdef class anon_struct6: cdef cudaMemLocation _locHint -cdef class anon_struct7: +cdef class anon_struct8: """ Attributes ---------- @@ -1726,16 +1723,16 @@ cdef class anon_struct7: cdef cudaOffset3D _offset -cdef class anon_union2: +cdef class anon_union3: """ Attributes ---------- - ptr : anon_struct6 + ptr : anon_struct7 - array : anon_struct7 + array : anon_struct8 @@ -1746,10 +1743,10 @@ cdef class anon_union2: """ cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr - cdef anon_struct6 _ptr + cdef anon_struct7 _ptr - cdef anon_struct7 _array + cdef anon_struct8 _array cdef class cudaMemcpy3DOperand: @@ -1763,7 +1760,7 @@ cdef class cudaMemcpy3DOperand: - op : anon_union2 + op : anon_union3 @@ -1775,7 +1772,7 @@ cdef class cudaMemcpy3DOperand: cdef cyruntime.cudaMemcpy3DOperand* _val_ptr cdef cyruntime.cudaMemcpy3DOperand* _pvt_ptr - cdef anon_union2 _op + cdef anon_union3 _op cdef class cudaMemcpy3DBatchOp: @@ -2236,10 +2233,6 @@ cdef class cudaDeviceProp: multi-node system. - reserved : list[int] - Reserved for future use - - Methods ------- getPtr() @@ -2255,13 +2248,6 @@ cdef class cudaIpcEventHandle_st: """ CUDA IPC event handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -2274,13 +2260,6 @@ cdef class cudaIpcMemHandle_st: """ CUDA IPC memory handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -2291,13 +2270,6 @@ cdef class cudaIpcMemHandle_st: cdef class cudaMemFabricHandle_st: """ - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -2306,7 +2278,7 @@ cdef class cudaMemFabricHandle_st: cdef cyruntime.cudaMemFabricHandle_st _pvt_val cdef cyruntime.cudaMemFabricHandle_st* _pvt_ptr -cdef class anon_struct8: +cdef class anon_struct9: """ Attributes ---------- @@ -2332,7 +2304,7 @@ cdef class anon_struct8: cdef _HelperInputVoidPtr _cyname -cdef class anon_union3: +cdef class anon_union4: """ Attributes ---------- @@ -2341,7 +2313,7 @@ cdef class anon_union3: - win32 : anon_struct8 + win32 : anon_struct9 @@ -2356,7 +2328,7 @@ cdef class anon_union3: """ cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr - cdef anon_struct8 _win32 + cdef anon_struct9 _win32 cdef _HelperInputVoidPtr _cynvSciBufObject @@ -2373,7 +2345,7 @@ cdef class cudaExternalMemoryHandleDesc: Type of the handle - handle : anon_union3 + handle : anon_union4 @@ -2385,10 +2357,6 @@ cdef class cudaExternalMemoryHandleDesc: Flags must either be zero or cudaExternalMemoryDedicated - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -2397,7 +2365,7 @@ cdef class cudaExternalMemoryHandleDesc: cdef cyruntime.cudaExternalMemoryHandleDesc* _val_ptr cdef cyruntime.cudaExternalMemoryHandleDesc* _pvt_ptr - cdef anon_union3 _handle + cdef anon_union4 _handle cdef class cudaExternalMemoryBufferDesc: @@ -2419,10 +2387,6 @@ cdef class cudaExternalMemoryBufferDesc: Flags reserved for future use. Must be zero. - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -2460,10 +2424,6 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: Total number of levels in the mipmap chain - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -2478,7 +2438,7 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: cdef cudaExtent _extent -cdef class anon_struct9: +cdef class anon_struct10: """ Attributes ---------- @@ -2504,7 +2464,7 @@ cdef class anon_struct9: cdef _HelperInputVoidPtr _cyname -cdef class anon_union4: +cdef class anon_union5: """ Attributes ---------- @@ -2513,7 +2473,7 @@ cdef class anon_union4: - win32 : anon_struct9 + win32 : anon_struct10 @@ -2528,7 +2488,7 @@ cdef class anon_union4: """ cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr - cdef anon_struct9 _win32 + cdef anon_struct10 _win32 cdef _HelperInputVoidPtr _cynvSciSyncObj @@ -2545,7 +2505,7 @@ cdef class cudaExternalSemaphoreHandleDesc: Type of the handle - handle : anon_union4 + handle : anon_union5 @@ -2553,10 +2513,6 @@ cdef class cudaExternalSemaphoreHandleDesc: Flags reserved for the future. Must be zero. - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -2565,10 +2521,10 @@ cdef class cudaExternalSemaphoreHandleDesc: cdef cyruntime.cudaExternalSemaphoreHandleDesc* _val_ptr cdef cyruntime.cudaExternalSemaphoreHandleDesc* _pvt_ptr - cdef anon_union4 _handle + cdef anon_union5 _handle -cdef class anon_struct10: +cdef class anon_struct11: """ Attributes ---------- @@ -2584,7 +2540,7 @@ cdef class anon_struct10: """ cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr -cdef class anon_union5: +cdef class anon_union6: """ Attributes ---------- @@ -2593,10 +2549,6 @@ cdef class anon_union5: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -2607,7 +2559,7 @@ cdef class anon_union5: cdef _HelperInputVoidPtr _cyfence -cdef class anon_struct11: +cdef class anon_struct12: """ Attributes ---------- @@ -2623,24 +2575,20 @@ cdef class anon_struct11: """ cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr -cdef class anon_struct12: +cdef class anon_struct13: """ Attributes ---------- - fence : anon_struct10 - - + fence : anon_struct11 - nvSciSync : anon_union5 - - keyedMutex : anon_struct11 + nvSciSync : anon_union6 - reserved : list[unsigned int] + keyedMutex : anon_struct12 @@ -2651,13 +2599,13 @@ cdef class anon_struct12: """ cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr - cdef anon_struct10 _fence + cdef anon_struct11 _fence - cdef anon_union5 _nvSciSync + cdef anon_union6 _nvSciSync - cdef anon_struct11 _keyedMutex + cdef anon_struct12 _keyedMutex cdef class cudaExternalSemaphoreSignalParams: @@ -2667,7 +2615,7 @@ cdef class cudaExternalSemaphoreSignalParams: Attributes ---------- - params : anon_struct12 + params : anon_struct13 @@ -2682,10 +2630,6 @@ cdef class cudaExternalSemaphoreSignalParams: all other types of cudaExternalSemaphore_t, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -2694,10 +2638,10 @@ cdef class cudaExternalSemaphoreSignalParams: cdef cyruntime.cudaExternalSemaphoreSignalParams _pvt_val cdef cyruntime.cudaExternalSemaphoreSignalParams* _pvt_ptr - cdef anon_struct12 _params + cdef anon_struct13 _params -cdef class anon_struct13: +cdef class anon_struct14: """ Attributes ---------- @@ -2713,7 +2657,7 @@ cdef class anon_struct13: """ cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr -cdef class anon_union6: +cdef class anon_union7: """ Attributes ---------- @@ -2722,10 +2666,6 @@ cdef class anon_union6: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -2736,7 +2676,7 @@ cdef class anon_union6: cdef _HelperInputVoidPtr _cyfence -cdef class anon_struct14: +cdef class anon_struct15: """ Attributes ---------- @@ -2756,24 +2696,20 @@ cdef class anon_struct14: """ cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr -cdef class anon_struct15: +cdef class anon_struct16: """ Attributes ---------- - fence : anon_struct13 - - - - nvSciSync : anon_union6 + fence : anon_struct14 - keyedMutex : anon_struct14 + nvSciSync : anon_union7 - reserved : list[unsigned int] + keyedMutex : anon_struct15 @@ -2784,13 +2720,13 @@ cdef class anon_struct15: """ cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr - cdef anon_struct13 _fence + cdef anon_struct14 _fence - cdef anon_union6 _nvSciSync + cdef anon_union7 _nvSciSync - cdef anon_struct14 _keyedMutex + cdef anon_struct15 _keyedMutex cdef class cudaExternalSemaphoreWaitParams: @@ -2800,7 +2736,7 @@ cdef class cudaExternalSemaphoreWaitParams: Attributes ---------- - params : anon_struct15 + params : anon_struct16 @@ -2815,10 +2751,6 @@ cdef class cudaExternalSemaphoreWaitParams: all other types of cudaExternalSemaphore_t, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -2827,7 +2759,7 @@ cdef class cudaExternalSemaphoreWaitParams: cdef cyruntime.cudaExternalSemaphoreWaitParams _pvt_val cdef cyruntime.cudaExternalSemaphoreWaitParams* _pvt_ptr - cdef anon_struct15 _params + cdef anon_struct16 _params cdef class cudaDevSmResource: @@ -2859,6 +2791,11 @@ cdef class cudaDevSmResource: cudaDevSmResourceGroup_flags. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + cudaDevSmResourceConstraintTypeLocalityDomainId is set in flags + + Methods ------- getPtr() @@ -2898,13 +2835,6 @@ cdef class cudaDevWorkqueueResource: """ Handle to a pre-existing workqueue related resource - Attributes - ---------- - - reserved : bytes - Reserved for future use - - Methods ------- getPtr() @@ -2939,8 +2869,9 @@ cdef class cudaDevSmResourceGroupParams_st: this this group is created. - reserved : list[unsigned int] - Reserved for future use - ensure this is zero initialized. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + cudaDevSmResourceGroupLocalityDomainId is set in flags Methods @@ -3241,6 +3172,10 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: paramsArray. + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -3257,6 +3192,9 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: cdef cyruntime.cudaExternalSemaphoreSignalParams* _paramsArray + cdef cudaExecutionContext_t _ctx + + cdef class cudaExternalSemaphoreWaitNodeParams: """ External semaphore wait node parameters @@ -3313,6 +3251,10 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: paramsArray. + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -3329,6 +3271,9 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: cdef cyruntime.cudaExternalSemaphoreWaitParams* _paramsArray + cdef cudaExecutionContext_t _ctx + + cdef class cudaConditionalNodeParams: """ CUDA conditional node parameters @@ -3359,7 +3304,7 @@ cdef class cudaConditionalNodeParams: empty nodes, child graphs, memsets, memcopies, and conditionals. This applies recursively to child graphs and conditional bodies. - All kernels, including kernels in nested conditionals or child - graphs at any level, must belong to the same CUDA context. + graphs at any level, must belong to the same device context. These graphs may be populated using graph node creation APIs or cudaStreamBeginCaptureToGraph. cudaGraphCondTypeIf: phGraph_out[0] is executed when the condition is non-zero. If `size` == 2, @@ -3433,6 +3378,10 @@ cdef class cudaEventRecordNodeParams: The event to record when the node executes + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -3444,6 +3393,9 @@ cdef class cudaEventRecordNodeParams: cdef cudaEvent_t _event + cdef cudaExecutionContext_t _ctx + + cdef class cudaEventWaitNodeParams: """ Event wait node parameters @@ -3477,14 +3429,6 @@ cdef class cudaGraphNodeParams: Type of the node - reserved0 : list[int] - Reserved. Must be zero. - - - reserved1 : list[long long] - Padding. Unused bytes must be zero. - - kernel : cudaKernelNodeParamsV2 Kernel node parameters. @@ -3533,10 +3477,6 @@ cdef class cudaGraphNodeParams: Conditional node parameters. - reserved2 : long long - Reserved bytes. Must be zero. - - Methods ------- getPtr() @@ -3618,11 +3558,6 @@ cdef class cudaGraphEdgeData_st: See cudaGraphDependencyType. - reserved : bytes - These bytes are unused and must be zeroed. This ensures - compatibility if additional fields are added in the future. - - Methods ------- getPtr() @@ -3704,7 +3639,7 @@ cdef class cudaGraphExecUpdateResultInfo_st: cdef cudaGraphNode_t _errorFromNode -cdef class anon_struct16: +cdef class anon_struct17: """ Attributes ---------- @@ -3731,7 +3666,7 @@ cdef class anon_struct16: cdef _HelperInputVoidPtr _cypValue -cdef class anon_union10: +cdef class anon_union11: """ Attributes ---------- @@ -3740,7 +3675,7 @@ cdef class anon_union10: - param : anon_struct16 + param : anon_struct17 @@ -3758,7 +3693,7 @@ cdef class anon_union10: cdef dim3 _gridDim - cdef anon_struct16 _param + cdef anon_struct17 _param cdef class cudaGraphKernelNodeUpdate: @@ -3778,7 +3713,7 @@ cdef class cudaGraphKernelNodeUpdate: interpreted - updateData : anon_union10 + updateData : anon_union11 Update data to apply. Which field is used depends on field's value @@ -3793,7 +3728,7 @@ cdef class cudaGraphKernelNodeUpdate: cdef cudaGraphDeviceNode_t _node - cdef anon_union10 _updateData + cdef anon_union11 _updateData cdef class cudaLaunchMemSyncDomainMap_st: @@ -3825,7 +3760,7 @@ cdef class cudaLaunchMemSyncDomainMap_st: cdef cyruntime.cudaLaunchMemSyncDomainMap_st _pvt_val cdef cyruntime.cudaLaunchMemSyncDomainMap_st* _pvt_ptr -cdef class anon_struct17: +cdef class anon_struct18: """ Attributes ---------- @@ -3849,7 +3784,7 @@ cdef class anon_struct17: """ cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr -cdef class anon_struct18: +cdef class anon_struct19: """ Attributes ---------- @@ -3876,7 +3811,7 @@ cdef class anon_struct18: cdef cudaEvent_t _event -cdef class anon_struct19: +cdef class anon_struct20: """ Attributes ---------- @@ -3900,7 +3835,7 @@ cdef class anon_struct19: """ cdef cyruntime.cudaLaunchAttributeValue* _pvt_ptr -cdef class anon_struct20: +cdef class anon_struct21: """ Attributes ---------- @@ -3923,7 +3858,7 @@ cdef class anon_struct20: cdef cudaEvent_t _event -cdef class anon_struct21: +cdef class anon_struct22: """ Attributes ---------- @@ -3971,7 +3906,7 @@ cdef class cudaLaunchAttributeValue: cudaSynchronizationPolicy for work queued up in this stream. - clusterDim : anon_struct17 + clusterDim : anon_struct18 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -3992,7 +3927,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchAttributeProgrammaticStreamSerialization. - programmaticEvent : anon_struct18 + programmaticEvent : anon_struct19 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -4016,22 +3951,22 @@ cdef class cudaLaunchAttributeValue: cudaLaunchMemSyncDomain. - preferredClusterDim : anon_struct19 + preferredClusterDim : anon_struct20 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension - of the preferred cluster, in blocks. Must be a divisor of the grid - Y dimension, and must be a multiple of the `y` field of - ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension - of the preferred cluster, in blocks. Must be equal to the `z` field - of ::cudaLaunchAttributeValue::clusterDim. + cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + cudaLaunchAttributeValue::clusterDim. - launchCompletionEvent : anon_struct20 + launchCompletionEvent : anon_struct21 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -4039,7 +3974,7 @@ cdef class cudaLaunchAttributeValue: cudaEventRecordExternal. - deviceUpdatableKernelNode : anon_struct21 + deviceUpdatableKernelNode : anon_struct22 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -4079,22 +4014,22 @@ cdef class cudaLaunchAttributeValue: cdef cudaAccessPolicyWindow _accessPolicyWindow - cdef anon_struct17 _clusterDim + cdef anon_struct18 _clusterDim - cdef anon_struct18 _programmaticEvent + cdef anon_struct19 _programmaticEvent cdef cudaLaunchMemSyncDomainMap _memSyncDomainMap - cdef anon_struct19 _preferredClusterDim + cdef anon_struct20 _preferredClusterDim - cdef anon_struct20 _launchCompletionEvent + cdef anon_struct21 _launchCompletionEvent - cdef anon_struct21 _deviceUpdatableKernelNode + cdef anon_struct22 _deviceUpdatableKernelNode cdef class cudaLaunchAttribute_st: @@ -4123,7 +4058,7 @@ cdef class cudaLaunchAttribute_st: cdef cudaLaunchAttributeValue _val -cdef class anon_struct22: +cdef class anon_struct23: """ Attributes ---------- @@ -4139,12 +4074,12 @@ cdef class anon_struct22: """ cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr -cdef class anon_union11: +cdef class anon_union12: """ Attributes ---------- - overBudget : anon_struct22 + overBudget : anon_struct23 @@ -4155,7 +4090,7 @@ cdef class anon_union11: """ cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr - cdef anon_struct22 _overBudget + cdef anon_struct23 _overBudget cdef class cudaAsyncNotificationInfo: @@ -4169,7 +4104,7 @@ cdef class cudaAsyncNotificationInfo: The type of notification being sent - info : anon_union11 + info : anon_union12 Information about the notification. `typename` must be checked in order to interpret this field. @@ -4182,7 +4117,7 @@ cdef class cudaAsyncNotificationInfo: cdef cyruntime.cudaAsyncNotificationInfo* _val_ptr cdef cyruntime.cudaAsyncNotificationInfo* _pvt_ptr - cdef anon_union11 _info + cdef anon_union12 _info cdef class cudaTextureDesc: @@ -4314,10 +4249,6 @@ cdef class cudaEglPlaneDesc_st: Channel Format Descriptor - reserved : list[unsigned int] - Reserved for future use - - Methods ------- getPtr() @@ -4329,7 +4260,7 @@ cdef class cudaEglPlaneDesc_st: cdef cudaChannelFormatDesc _channelDesc -cdef class anon_union12: +cdef class anon_union13: """ Attributes ---------- @@ -4363,7 +4294,7 @@ cdef class cudaEglFrame_st: Attributes ---------- - frame : anon_union12 + frame : anon_union13 @@ -4391,7 +4322,7 @@ cdef class cudaEglFrame_st: cdef cyruntime.cudaEglFrame_st* _val_ptr cdef cyruntime.cudaEglFrame_st* _pvt_ptr - cdef anon_union12 _frame + cdef anon_union13 _frame cdef class CUuuid(CUuuid_st): @@ -4430,13 +4361,6 @@ cdef class cudaIpcEventHandle_t(cudaIpcEventHandle_st): """ CUDA IPC event handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -4448,13 +4372,6 @@ cdef class cudaIpcMemHandle_t(cudaIpcMemHandle_st): """ CUDA IPC memory handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -4464,13 +4381,6 @@ cdef class cudaIpcMemHandle_t(cudaIpcMemHandle_st): cdef class cudaMemFabricHandle_t(cudaMemFabricHandle_st): """ - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -4504,8 +4414,9 @@ cdef class cudaDevSmResourceGroupParams(cudaDevSmResourceGroupParams_st): this this group is created. - reserved : list[unsigned int] - Reserved for future use - ensure this is zero initialized. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + cudaDevSmResourceGroupLocalityDomainId is set in flags Methods @@ -4609,11 +4520,6 @@ cdef class cudaGraphEdgeData(cudaGraphEdgeData_st): See cudaGraphDependencyType. - reserved : bytes - These bytes are unused and must be zeroed. This ensures - compatibility if additional fields are added in the future. - - Methods ------- getPtr() @@ -4741,7 +4647,7 @@ cdef class cudaAsyncNotificationInfo_t(cudaAsyncNotificationInfo): The type of notification being sent - info : anon_union11 + info : anon_union12 Information about the notification. `typename` must be checked in order to interpret this field. @@ -4778,7 +4684,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaSynchronizationPolicy for work queued up in this stream. - clusterDim : anon_struct17 + clusterDim : anon_struct18 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -4799,7 +4705,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaLaunchAttributeProgrammaticStreamSerialization. - programmaticEvent : anon_struct18 + programmaticEvent : anon_struct19 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -4823,22 +4729,22 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaLaunchMemSyncDomain. - preferredClusterDim : anon_struct19 + preferredClusterDim : anon_struct20 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension - of the preferred cluster, in blocks. Must be a divisor of the grid - Y dimension, and must be a multiple of the `y` field of - ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension - of the preferred cluster, in blocks. Must be equal to the `z` field - of ::cudaLaunchAttributeValue::clusterDim. + cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + cudaLaunchAttributeValue::clusterDim. - launchCompletionEvent : anon_struct20 + launchCompletionEvent : anon_struct21 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -4846,7 +4752,7 @@ cdef class cudaStreamAttrValue(cudaLaunchAttributeValue): cudaEventRecordExternal. - deviceUpdatableKernelNode : anon_struct21 + deviceUpdatableKernelNode : anon_struct22 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -4907,7 +4813,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaSynchronizationPolicy for work queued up in this stream. - clusterDim : anon_struct17 + clusterDim : anon_struct18 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -4928,7 +4834,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaLaunchAttributeProgrammaticStreamSerialization. - programmaticEvent : anon_struct18 + programmaticEvent : anon_struct19 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -4952,22 +4858,22 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaLaunchMemSyncDomain. - preferredClusterDim : anon_struct19 + preferredClusterDim : anon_struct20 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension - of the preferred cluster, in blocks. Must be a divisor of the grid - Y dimension, and must be a multiple of the `y` field of - ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension - of the preferred cluster, in blocks. Must be equal to the `z` field - of ::cudaLaunchAttributeValue::clusterDim. + cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + cudaLaunchAttributeValue::clusterDim. - launchCompletionEvent : anon_struct20 + launchCompletionEvent : anon_struct21 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -4975,7 +4881,7 @@ cdef class cudaKernelNodeAttrValue(cudaLaunchAttributeValue): cudaEventRecordExternal. - deviceUpdatableKernelNode : anon_struct21 + deviceUpdatableKernelNode : anon_struct22 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -5043,10 +4949,6 @@ cdef class cudaEglPlaneDesc(cudaEglPlaneDesc_st): Channel Format Descriptor - reserved : list[unsigned int] - Reserved for future use - - Methods ------- getPtr() @@ -5068,7 +4970,7 @@ cdef class cudaEglFrame(cudaEglFrame_st): Attributes ---------- - frame : anon_union12 + frame : anon_union13 diff --git a/cuda_bindings/cuda/bindings/runtime.pyx b/cuda_bindings/cuda/bindings/runtime.pyx index 6e11bdfc932..c84748ebbde 100644 --- a/cuda_bindings/cuda/bindings/runtime.pyx +++ b/cuda_bindings/cuda/bindings/runtime.pyx @@ -1,8 +1,9 @@ # SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -# This code was automatically generated with version 13.3.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=783d27cfa66fa4f5818edcf88141aeb96dcc0e27e73a77a36571f82f30f3bb47 +# This code was automatically generated with version 13.4.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=632a03657f085ae740d8137492ed61dac76e32eec0571a3bb73a2471da87bf08 from typing import Any, Optional import cython import ctypes @@ -925,6 +926,12 @@ class cudaError_t(_FastEnum): ) + cudaErrorInsufficientLoaderVersion = ( + cyruntime.cudaError.cudaErrorInsufficientLoaderVersion, + 'This indicates that loader version is insufficient for Fatbin\n' + ) + + cudaErrorInvalidSource = ( cyruntime.cudaError.cudaErrorInvalidSource, 'This indicates that the device kernel source is invalid.\n' @@ -1421,6 +1428,15 @@ class cudaError_t(_FastEnum): ) + cudaErrorFabricNotReady = ( + cyruntime.cudaError.cudaErrorFabricNotReady, + 'This error indicates GPU fabric is not ready within the bounded wait while\n' + 'the fabric manager probe is still in progress. Applications may retry after\n' + 'a delay; for the initialization wait budget, see environment variables such\n' + 'as CUDA_FABRIC_INIT_TIMEOUT_MS.\n' + ) + + cudaErrorUnknown = ( cyruntime.cudaError.cudaErrorUnknown, 'This indicates that an unknown internal error has occurred.\n' @@ -1456,6 +1472,21 @@ class cudaSharedMemoryMode(_FastEnum): 'up to :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin`\n' ) + + cudaSharedMemoryModeAllowOversizedSharedMemory = ( + cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModeAllowOversizedSharedMemory, + 'Specifies that oversized shared memory configurations may be used (with the\n' + 'limitation of only 8kB L1 cache)\n' + ) + + + cudaSharedMemoryModePreferOversizedSharedMemory = ( + cyruntime.cudaSharedMemoryMode.cudaSharedMemoryModePreferOversizedSharedMemory, + 'Specifies that oversized shared memory configurations may be used (with the\n' + 'limitation of only 8kB L1 cache), and prefer an oversized shared memory\n' + 'configuration\n' + ) + class cudaGraphDependencyType(_FastEnum): """ Type annotations that can be applied to graph edges as part of @@ -1748,8 +1779,8 @@ class cudaLaunchAttributeID(_FastEnum): cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode, 'Valid for graph nodes, launches. This attribute is graphs-only, and passing\n' 'it to a launch in a non-capturing stream will result in an error.\n' - ' :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can\n' - 'only be set to 0 or 1. Setting the field to 1 indicates that the\n' + ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable`\n' + 'can only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode`\n' @@ -1922,6 +1953,8 @@ class cudaDataType(_FastEnum): CUDA_R_4F_E2M1 = cyruntime.cudaDataType_t.CUDA_R_4F_E2M1 + CUDA_R_8F_UE5M3 = cyruntime.cudaDataType_t.CUDA_R_8F_UE5M3 + class cudaEmulationStrategy(_FastEnum): """ Enum for specifying how to leverage floating-point emulation @@ -3292,6 +3325,8 @@ class cudaClusterSchedulingPolicy(_FastEnum): 'allow the hardware to load-balance the blocks in a cluster to the SMs\n' ) + cudaClusterSchedulingPolicyRubinDsmemLocality = cyruntime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyRubinDsmemLocality + class cudaStreamUpdateCaptureDependenciesFlags(_FastEnum): """ Flags for :py:obj:`~.cudaStreamUpdateCaptureDependencies` @@ -3737,6 +3772,13 @@ class cudaFuncAttribute(_FastEnum): 'Required cluster scheduling policy preference\n' ) + + cudaFuncAttributeSharedMemoryMode = ( + cyruntime.cudaFuncAttribute.cudaFuncAttributeSharedMemoryMode, + "Setting that controls a kernel's use of non-portable or oversized shared\n" + 'memory configurations\n' + ) + cudaFuncAttributeMax = cyruntime.cudaFuncAttribute.cudaFuncAttributeMax class cudaFuncCache(_FastEnum): @@ -3884,6 +3926,12 @@ class cudaLimit(_FastEnum): 'A size in bytes for L2 persisting lines cache size\n' ) + + cudaLimitPerBlockMemorySize = ( + cyruntime.cudaLimit.cudaLimitPerBlockMemorySize, + 'Per-block memory size\n' + ) + class cudaMemoryAdvise(_FastEnum): """ CUDA Memory Advise values @@ -4860,11 +4908,30 @@ class cudaDeviceAttr(_FastEnum): ) + cudaDevAttrLocalityDomainCount = ( + cyruntime.cudaDeviceAttr.cudaDevAttrLocalityDomainCount, + 'Number of locality domains\n' + ) + + + cudaDevAttrOversizedSharedMemoryPerBlock = ( + cyruntime.cudaDeviceAttr.cudaDevAttrOversizedSharedMemoryPerBlock, + 'The maximum oversized shared memory per block. This value may vary by chip.\n' + 'See :py:obj:`~.cudaFuncSetAttribute`\n' + ) + + cudaDevAttrCigStreamsSupported = ( cyruntime.cudaDeviceAttr.cudaDevAttrCigStreamsSupported, 'Device supports CIG streams\n' ) + + cudaDevAttrLocalityDomainMultiprocessorCount = ( + cyruntime.cudaDeviceAttr.cudaDevAttrLocalityDomainMultiprocessorCount, + 'Number of multiprocessors on each locality domain\n' + ) + cudaDevAttrMax = cyruntime.cudaDeviceAttr.cudaDevAttrMax class cudaMemPoolAttr(_FastEnum): @@ -4986,6 +5053,14 @@ class cudaMemPoolAttr(_FastEnum): 'enabled\n' ) + + cudaMemPoolAttrLocalityDomainId = ( + cyruntime.cudaMemPoolAttr.cudaMemPoolAttrLocalityDomainId, + '(value type = int) The locality domain id for the mempool, if the mempool\n' + 'is localized to a locality domain. A value of -1 indicates that the mempool\n' + 'is not localized to a locality domain.\n' + ) + class cudaMemLocationType(_FastEnum): """ Specifies the type of location @@ -5032,6 +5107,12 @@ class cudaMemLocationType(_FastEnum): 'cudaInvalidDeviceId\n' ) + + cudaMemLocationTypeDeviceLocalityDomain = ( + cyruntime.cudaMemLocationType.cudaMemLocationTypeDeviceLocalityDomain, + 'Location is a portion of device memory, specified by the locality domain ID\n' + ) + class cudaMemAccessFlags(_FastEnum): """ Specifies the memory protection flags for mapping. @@ -5439,8 +5520,22 @@ class cudaDevSmResourceGroup_flags(_FastEnum): cudaDevSmResourceGroupBackfill = ( cyruntime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupBackfill, - 'Lets smCount be a non-multiple of minCoscheduledCount, filling the\n' - 'difference with other SMs.\n' + 'Treats constraints as a hint, ignoring them if necessary to reach the\n' + 'requested smCount. Lets smCount be a non-multiple of coscheduledSmCount,\n' + 'filling the difference between SM count and already assigned co-scheduled\n' + 'groupings with other SMs. When used with\n' + 'cudaDevSmResourceGroupLocalityDomainId, backfill fills up to the requested\n' + 'smCount using the target locality domain first, then SMs not attributed to\n' + 'any locality domain, then SMs from other locality domains. If no SMs can be\n' + 'found in the requested locality domain,\n' + 'cudaErrorInvalidResourceConfiguration is returned.\n' + ) + + + cudaDevSmResourceGroupLocalityDomainId = ( + cyruntime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupLocalityDomainId, + 'The SMs must be located on a specific locality domain, specified by\n' + 'localityDomainId\n' ) class cudaDevSmResourceSplitByCount_flags(_FastEnum): @@ -6590,8 +6685,8 @@ class cudaStreamAttrID(_FastEnum): cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode, 'Valid for graph nodes, launches. This attribute is graphs-only, and passing\n' 'it to a launch in a non-capturing stream will result in an error.\n' - ' :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can\n' - 'only be set to 0 or 1. Setting the field to 1 indicates that the\n' + ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable`\n' + 'can only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode`\n' @@ -6835,8 +6930,8 @@ class cudaKernelNodeAttrID(_FastEnum): cyruntime.cudaLaunchAttributeID.cudaLaunchAttributeDeviceUpdatableKernelNode, 'Valid for graph nodes, launches. This attribute is graphs-only, and passing\n' 'it to a launch in a non-capturing stream will result in an error.\n' - ' :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can\n' - 'only be set to 0 or 1. Setting the field to 1 indicates that the\n' + ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable`\n' + 'can only be set to 0 or 1. Setting the field to 1 indicates that the\n' 'corresponding kernel node should be device-updatable. On success, a handle\n' 'will be returned via\n' ':py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode`\n' @@ -7919,10 +8014,6 @@ cdef class cudaArraySparseProperties: Flags will either be zero or cudaArraySparsePropertiesSingleMipTail - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -7969,12 +8060,6 @@ cdef class cudaArraySparseProperties: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -8011,14 +8096,6 @@ cdef class cudaArraySparseProperties: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class cudaArrayMemoryRequirements: """ CUDA array and CUDA mipmapped array memory requirements @@ -8034,10 +8111,6 @@ cdef class cudaArrayMemoryRequirements: Alignment necessary for mapping the array. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -8069,12 +8142,6 @@ cdef class cudaArrayMemoryRequirements: except ValueError: str_list += ['alignment : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -8095,14 +8162,6 @@ cdef class cudaArrayMemoryRequirements: self._pvt_ptr[0].alignment = alignment - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class cudaPitchedPtr: """ CUDA Pitched memory pointer make_cudaPitchedPtr @@ -8599,10 +8658,6 @@ cdef class cudaMemcpyNodeParams: Must be zero - reserved : int - Must be zero - - ctx : cudaExecutionContext_t Context in which to run the memcpy. If NULL will try to use the current context. @@ -8644,12 +8699,6 @@ cdef class cudaMemcpyNodeParams: str_list += ['flags : '] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - - try: str_list += ['ctx : ' + str(self.ctx)] except ValueError: @@ -8673,14 +8722,6 @@ cdef class cudaMemcpyNodeParams: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, int reserved): - self._pvt_ptr[0].reserved = reserved - - @property def ctx(self): return self._ctx @@ -9476,6 +9517,10 @@ cdef class cudaHostNodeParamsV2: The synchronization mode to use for the host task + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -9491,6 +9536,9 @@ cdef class cudaHostNodeParamsV2: self._fn = cudaHostFn_t(_ptr=&self._pvt_ptr[0].fn) + + self._ctx = cudaExecutionContext_t(_ptr=&self._pvt_ptr[0].ctx) + def __dealloc__(self): pass def getPtr(self): @@ -9516,6 +9564,12 @@ cdef class cudaHostNodeParamsV2: except ValueError: str_list += ['syncMode : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + return '\n'.join(str_list) else: return '' @@ -9554,6 +9608,23 @@ cdef class cudaHostNodeParamsV2: self._pvt_ptr[0].syncMode = syncMode + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cyruntime.cudaExecutionContext_t cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (cudaExecutionContext_t,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(cudaExecutionContext_t(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + cdef class anon_struct1: """ Attributes @@ -9872,13 +9943,6 @@ cdef class anon_struct4: cdef class anon_struct5: """ - Attributes - ---------- - - reserved : list[int] - - - Methods ------- getPtr() @@ -9897,23 +9961,10 @@ cdef class anon_struct5: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return self._pvt_ptr[0].res.reserved.reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].res.reserved.reserved = reserved - - cdef class anon_union0: """ Attributes @@ -9935,10 +9986,6 @@ cdef class anon_union0: - reserved : anon_struct5 - - - Methods ------- getPtr() @@ -9961,9 +10008,6 @@ cdef class anon_union0: self._pitch2D = anon_struct4(_ptr=self._pvt_ptr) - - self._reserved = anon_struct5(_ptr=self._pvt_ptr) - def __dealloc__(self): pass def getPtr(self): @@ -9995,12 +10039,6 @@ cdef class anon_union0: except ValueError: str_list += ['pitch2D : '] - - try: - str_list += ['reserved :\n' + '\n'.join([' ' + line for line in str(self.reserved).splitlines()])] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -10037,14 +10075,6 @@ cdef class anon_union0: string.memcpy(&self._pvt_ptr[0].res.pitch2D, pitch2D.getPtr(), sizeof(self._pvt_ptr[0].res.pitch2D)) - @property - def reserved(self): - return self._reserved - @reserved.setter - def reserved(self, reserved not None : anon_struct5): - string.memcpy(&self._pvt_ptr[0].res.reserved, reserved.getPtr(), sizeof(self._pvt_ptr[0].res.reserved)) - - cdef class cudaResourceDesc: """ CUDA resource descriptor @@ -10173,10 +10203,6 @@ cdef class cudaResourceViewDesc: Last layer index - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -10244,12 +10270,6 @@ cdef class cudaResourceViewDesc: except ValueError: str_list += ['lastLayer : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -10318,14 +10338,6 @@ cdef class cudaResourceViewDesc: self._pvt_ptr[0].lastLayer = lastLayer - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class cudaPointerAttributes: """ CUDA pointer attributes @@ -10360,8 +10372,8 @@ cdef class cudaPointerAttributes: pointer if an invalid pointer has been passed to CUDA. - reserved : list[long] - Must be zero + localityDomainOrdinal : int + Methods @@ -10371,13 +10383,15 @@ cdef class cudaPointerAttributes: """ def __cinit__(self, void_ptr _ptr = 0): if _ptr == 0: - self._pvt_ptr = &self._pvt_val + self._val_ptr = calloc(1, sizeof(cyruntime.cudaPointerAttributes)) + self._pvt_ptr = self._val_ptr else: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass def __dealloc__(self): - pass + if self._val_ptr is not NULL: + free(self._val_ptr) def getPtr(self): return self._pvt_ptr def __repr__(self): @@ -10409,9 +10423,9 @@ cdef class cudaPointerAttributes: try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['localityDomainOrdinal : ' + str(self.localityDomainOrdinal)] except ValueError: - str_list += ['reserved : '] + str_list += ['localityDomainOrdinal : '] return '\n'.join(str_list) else: @@ -10452,11 +10466,11 @@ cdef class cudaPointerAttributes: @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved + def localityDomainOrdinal(self): + return self._pvt_ptr[0].localityDomainOrdinal + @localityDomainOrdinal.setter + def localityDomainOrdinal(self, int localityDomainOrdinal): + self._pvt_ptr[0].localityDomainOrdinal = localityDomainOrdinal cdef class cudaFuncAttributes: @@ -10513,7 +10527,11 @@ cdef class cudaFuncAttributes: maxDynamicSharedSizeBytes : int The maximum size in bytes of dynamic shared memory per block for this function. Any launch must have a dynamic shared memory size - smaller than this value. + smaller than this value. This attribute is ignored if the + sharedMemoryMode function or launch attribute is set. This + attribute cannot be used to access oversized shared memory. + Oversized shared memory can only be accessed by setting the shared + memory mode. See cudaFuncSetAttribute preferredShmemCarveout : int @@ -10522,7 +10540,7 @@ cdef class cudaFuncAttributes: preference, in percent of the maximum shared memory. Refer to cudaDevAttrMaxSharedMemoryPerMultiprocessor. This is only a hint, and the driver can choose a different ratio if required to execute - the function. See cudaFuncSetAttribute + the function. See cudaFuncSetAttribute clusterDimMustBeSet : int @@ -10535,7 +10553,7 @@ cdef class cudaFuncAttributes: either all be 0 or all be positive. The validity of the cluster dimensions is otherwise checked at launch time. If the value is set during compile time, it cannot be set at runtime. Setting it at - runtime should return cudaErrorNotPermitted. See + runtime should return cudaErrorNotPermitted. See cudaFuncSetAttribute @@ -10548,7 +10566,8 @@ cdef class cudaFuncAttributes: clusterSchedulingPolicyPreference : int - The block scheduling policy of a function. See cudaFuncSetAttribute + The block scheduling policy of a function. See + cudaFuncSetAttribute nonPortableClusterSizeAllowed : int @@ -10563,7 +10582,7 @@ cdef class cudaFuncAttributes: than the target compute capability. The portable cluster size for sm_90 is 8 blocks per cluster. This value may increase for future compute capabilities. The specific hardware unit may support - higher cluster sizes that’s not guaranteed to be portable. See + higher cluster sizes that’s not guaranteed to be portable. See cudaFuncSetAttribute @@ -10573,12 +10592,9 @@ cdef class cudaFuncAttributes: the value. - reserved1 : int - - - - reserved : list[int] - Reserved for future use. + sharedMemoryMode : cudaSharedMemoryMode + This controls a kernel's use of non-portable or oversized shared + memory configurations. See cudaFuncSetAttribute Methods @@ -10704,15 +10720,9 @@ cdef class cudaFuncAttributes: try: - str_list += ['reserved1 : ' + str(self.reserved1)] - except ValueError: - str_list += ['reserved1 : '] - - - try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['sharedMemoryMode : ' + str(self.sharedMemoryMode)] except ValueError: - str_list += ['reserved : '] + str_list += ['sharedMemoryMode : '] return '\n'.join(str_list) else: @@ -10855,19 +10865,73 @@ cdef class cudaFuncAttributes: @property - def reserved1(self): - return self._pvt_ptr[0].reserved1 - @reserved1.setter - def reserved1(self, int reserved1): - self._pvt_ptr[0].reserved1 = reserved1 + def sharedMemoryMode(self): + return cudaSharedMemoryMode(self._pvt_ptr[0].sharedMemoryMode) + @sharedMemoryMode.setter + def sharedMemoryMode(self, sharedMemoryMode not None : cudaSharedMemoryMode): + self._pvt_ptr[0].sharedMemoryMode = int(sharedMemoryMode) + + +cdef class anon_struct6: + """ + Attributes + ---------- + + deviceId : bytes + + + localityDomainId : bytes + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + pass + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].localized + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['deviceId : ' + str(self.deviceId)] + except ValueError: + str_list += ['deviceId : '] + + + try: + str_list += ['localityDomainId : ' + str(self.localityDomainId)] + except ValueError: + str_list += ['localityDomainId : '] + + return '\n'.join(str_list) + else: + return '' @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved + def deviceId(self): + return self._pvt_ptr[0].localized.deviceId + @deviceId.setter + def deviceId(self, unsigned char deviceId): + self._pvt_ptr[0].localized.deviceId = deviceId + + + @property + def localityDomainId(self): + return self._pvt_ptr[0].localized.localityDomainId + @localityDomainId.setter + def localityDomainId(self, unsigned char localityDomainId): + self._pvt_ptr[0].localized.localityDomainId = localityDomainId cdef class cudaMemLocation: @@ -10890,6 +10954,11 @@ cdef class cudaMemLocation: cudaMemLocationType::cudaMemLocationTypeHostNuma. + localized : anon_struct6 + Identifier for + cudaMemLocationType::cudaMemLocationTypeDeviceLocalityDomain. + + Methods ------- getPtr() @@ -10903,6 +10972,9 @@ cdef class cudaMemLocation: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + + self._localized = anon_struct6(_ptr=self._pvt_ptr) + def __dealloc__(self): if self._val_ptr is not NULL: free(self._val_ptr) @@ -10923,6 +10995,12 @@ cdef class cudaMemLocation: except ValueError: str_list += ['id : '] + + try: + str_list += ['localized :\n' + '\n'.join([' ' + line for line in str(self.localized).splitlines()])] + except ValueError: + str_list += ['localized : '] + return '\n'.join(str_list) else: return '' @@ -10943,6 +11021,14 @@ cdef class cudaMemLocation: self._pvt_ptr[0].id = id + @property + def localized(self): + return self._localized + @localized.setter + def localized(self, localized not None : anon_struct6): + string.memcpy(&self._pvt_ptr[0].localized, localized.getPtr(), sizeof(self._pvt_ptr[0].localized)) + + cdef class cudaMemAccessDesc: """ Memory access descriptor @@ -11049,10 +11135,6 @@ cdef class cudaMemPoolProps: Bitmask indicating intended usage for the pool. - reserved : bytes - reserved for future use, must be 0 - - Methods ------- getPtr() @@ -11111,12 +11193,6 @@ cdef class cudaMemPoolProps: except ValueError: str_list += ['usage : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -11170,28 +11246,10 @@ cdef class cudaMemPoolProps: self._pvt_ptr[0].usage = usage - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 54) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 54: - raise ValueError("reserved length must be 54, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b - - cdef class cudaMemPoolPtrExportData: """ Opaque data for exporting a pool allocation - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -11212,26 +11270,10 @@ cdef class cudaMemPoolPtrExportData: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 64: - raise ValueError("reserved length must be 64, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b - - cdef class cudaMemAllocNodeParams: """ Memory allocation node parameters @@ -11338,6 +11380,7 @@ cdef class cudaMemAllocNodeParams: return [cudaMemAccessDesc(_ptr=arr) for arr in arrs] @accessDescs.setter def accessDescs(self, val): + cdef cyruntime.cudaMemAccessDesc* _accessDescs_new if len(val) == 0: free(self._accessDescs) self._accessDescs = NULL @@ -11345,14 +11388,22 @@ cdef class cudaMemAllocNodeParams: self._pvt_ptr[0].accessDescs = NULL else: if self._accessDescs_length != len(val): - free(self._accessDescs) - self._accessDescs = calloc(len(val), sizeof(cyruntime.cudaMemAccessDesc)) - if self._accessDescs is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _accessDescs_new = calloc(len(val), sizeof(cyruntime.cudaMemAccessDesc)) + if _accessDescs_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaMemAccessDesc))) + for idx in range(len(val)): + string.memcpy(&_accessDescs_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) + free(self._accessDescs) + self._accessDescs = _accessDescs_new self._accessDescs_length = len(val) - self._pvt_ptr[0].accessDescs = self._accessDescs - for idx in range(len(val)): - string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) + self._pvt_ptr[0].accessDescs = _accessDescs_new + else: + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) @@ -11487,6 +11538,7 @@ cdef class cudaMemAllocNodeParamsV2: return [cudaMemAccessDesc(_ptr=arr) for arr in arrs] @accessDescs.setter def accessDescs(self, val): + cdef cyruntime.cudaMemAccessDesc* _accessDescs_new if len(val) == 0: free(self._accessDescs) self._accessDescs = NULL @@ -11494,14 +11546,22 @@ cdef class cudaMemAllocNodeParamsV2: self._pvt_ptr[0].accessDescs = NULL else: if self._accessDescs_length != len(val): - free(self._accessDescs) - self._accessDescs = calloc(len(val), sizeof(cyruntime.cudaMemAccessDesc)) - if self._accessDescs is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _accessDescs_new = calloc(len(val), sizeof(cyruntime.cudaMemAccessDesc)) + if _accessDescs_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaMemAccessDesc))) + for idx in range(len(val)): + string.memcpy(&_accessDescs_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) + free(self._accessDescs) + self._accessDescs = _accessDescs_new self._accessDescs_length = len(val) - self._pvt_ptr[0].accessDescs = self._accessDescs - for idx in range(len(val)): - string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) + self._pvt_ptr[0].accessDescs = _accessDescs_new + else: + for idx in range(len(val)): + string.memcpy(&self._accessDescs[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemAccessDesc)) @@ -11776,7 +11836,7 @@ cdef class cudaOffset3D: self._pvt_ptr[0].z = z -cdef class anon_struct6: +cdef class anon_struct7: """ Attributes ---------- @@ -11878,7 +11938,7 @@ cdef class anon_struct6: string.memcpy(&self._pvt_ptr[0].op.ptr.locHint, locHint.getPtr(), sizeof(self._pvt_ptr[0].op.ptr.locHint)) -cdef class anon_struct7: +cdef class anon_struct8: """ Attributes ---------- @@ -11955,16 +12015,16 @@ cdef class anon_struct7: string.memcpy(&self._pvt_ptr[0].op.array.offset, offset.getPtr(), sizeof(self._pvt_ptr[0].op.array.offset)) -cdef class anon_union2: +cdef class anon_union3: """ Attributes ---------- - ptr : anon_struct6 + ptr : anon_struct7 - array : anon_struct7 + array : anon_struct8 @@ -11979,10 +12039,10 @@ cdef class anon_union2: def __init__(self, void_ptr _ptr): pass - self._ptr = anon_struct6(_ptr=self._pvt_ptr) + self._ptr = anon_struct7(_ptr=self._pvt_ptr) - self._array = anon_struct7(_ptr=self._pvt_ptr) + self._array = anon_struct8(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -12011,7 +12071,7 @@ cdef class anon_union2: def ptr(self): return self._ptr @ptr.setter - def ptr(self, ptr not None : anon_struct6): + def ptr(self, ptr not None : anon_struct7): string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) @@ -12019,7 +12079,7 @@ cdef class anon_union2: def array(self): return self._array @array.setter - def array(self, array not None : anon_struct7): + def array(self, array not None : anon_struct8): string.memcpy(&self._pvt_ptr[0].op.array, array.getPtr(), sizeof(self._pvt_ptr[0].op.array)) @@ -12034,7 +12094,7 @@ cdef class cudaMemcpy3DOperand: - op : anon_union2 + op : anon_union3 @@ -12052,7 +12112,7 @@ cdef class cudaMemcpy3DOperand: def __init__(self, void_ptr _ptr = 0): pass - self._op = anon_union2(_ptr=self._pvt_ptr) + self._op = anon_union3(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -12090,7 +12150,7 @@ cdef class cudaMemcpy3DOperand: def op(self): return self._op @op.setter - def op(self, op not None : anon_union2): + def op(self, op not None : anon_union3): string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) @@ -12663,10 +12723,6 @@ cdef class cudaDeviceProp: multi-node system. - reserved : list[int] - Reserved for future use - - Methods ------- getPtr() @@ -13241,12 +13297,6 @@ cdef class cudaDeviceProp: except ValueError: str_list += ['hostNumaMultinodeIpcSupported : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -13999,25 +14049,10 @@ cdef class cudaDeviceProp: self._pvt_ptr[0].hostNumaMultinodeIpcSupported = hostNumaMultinodeIpcSupported - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class cudaIpcEventHandle_st: """ CUDA IPC event handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -14038,45 +14073,14 @@ cdef class cudaIpcEventHandle_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 64: - raise ValueError("reserved length must be 64, is " + str(len(reserved))) - if CHAR_MIN == 0: - for i, b in enumerate(reserved): - if b < 0 and b > -129: - b = b + 256 - self._pvt_ptr[0].reserved[i] = b - else: - for i, b in enumerate(reserved): - if b > 127 and b < 256: - b = b - 256 - self._pvt_ptr[0].reserved[i] = b - - cdef class cudaIpcMemHandle_st: """ CUDA IPC memory handle - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -14097,43 +14101,12 @@ cdef class cudaIpcMemHandle_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 64: - raise ValueError("reserved length must be 64, is " + str(len(reserved))) - if CHAR_MIN == 0: - for i, b in enumerate(reserved): - if b < 0 and b > -129: - b = b + 256 - self._pvt_ptr[0].reserved[i] = b - else: - for i, b in enumerate(reserved): - if b > 127 and b < 256: - b = b - 256 - self._pvt_ptr[0].reserved[i] = b - - cdef class cudaMemFabricHandle_st: """ - Attributes - ---------- - - reserved : bytes - - - Methods ------- getPtr() @@ -14154,35 +14127,11 @@ cdef class cudaMemFabricHandle_st: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 64) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 64: - raise ValueError("reserved length must be 64, is " + str(len(reserved))) - if CHAR_MIN == 0: - for i, b in enumerate(reserved): - if b < 0 and b > -129: - b = b + 256 - self._pvt_ptr[0].reserved[i] = b - else: - for i, b in enumerate(reserved): - if b > 127 and b < 256: - b = b - 256 - self._pvt_ptr[0].reserved[i] = b - - -cdef class anon_struct8: +cdef class anon_struct9: """ Attributes ---------- @@ -14246,7 +14195,7 @@ cdef class anon_struct8: self._pvt_ptr[0].handle.win32.name = self._cyname.cptr -cdef class anon_union3: +cdef class anon_union4: """ Attributes ---------- @@ -14255,7 +14204,7 @@ cdef class anon_union3: - win32 : anon_struct8 + win32 : anon_struct9 @@ -14274,7 +14223,7 @@ cdef class anon_union3: def __init__(self, void_ptr _ptr): pass - self._win32 = anon_struct8(_ptr=self._pvt_ptr) + self._win32 = anon_struct9(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -14317,7 +14266,7 @@ cdef class anon_union3: def win32(self): return self._win32 @win32.setter - def win32(self, win32 not None : anon_struct8): + def win32(self, win32 not None : anon_struct9): string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) @@ -14341,7 +14290,7 @@ cdef class cudaExternalMemoryHandleDesc: Type of the handle - handle : anon_union3 + handle : anon_union4 @@ -14353,10 +14302,6 @@ cdef class cudaExternalMemoryHandleDesc: Flags must either be zero or cudaExternalMemoryDedicated - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -14371,7 +14316,7 @@ cdef class cudaExternalMemoryHandleDesc: def __init__(self, void_ptr _ptr = 0): pass - self._handle = anon_union3(_ptr=self._pvt_ptr) + self._handle = anon_union4(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -14405,12 +14350,6 @@ cdef class cudaExternalMemoryHandleDesc: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -14427,7 +14366,7 @@ cdef class cudaExternalMemoryHandleDesc: def handle(self): return self._handle @handle.setter - def handle(self, handle not None : anon_union3): + def handle(self, handle not None : anon_union4): string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) @@ -14447,14 +14386,6 @@ cdef class cudaExternalMemoryHandleDesc: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class cudaExternalMemoryBufferDesc: """ External memory buffer descriptor @@ -14474,10 +14405,6 @@ cdef class cudaExternalMemoryBufferDesc: Flags reserved for future use. Must be zero. - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -14515,12 +14442,6 @@ cdef class cudaExternalMemoryBufferDesc: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -14549,14 +14470,6 @@ cdef class cudaExternalMemoryBufferDesc: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class cudaExternalMemoryMipmappedArrayDesc: """ External memory mipmap descriptor @@ -14586,10 +14499,6 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: Total number of levels in the mipmap chain - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -14645,12 +14554,6 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: except ValueError: str_list += ['numLevels : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -14695,15 +14598,7 @@ cdef class cudaExternalMemoryMipmappedArrayDesc: self._pvt_ptr[0].numLevels = numLevels - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - -cdef class anon_struct9: +cdef class anon_struct10: """ Attributes ---------- @@ -14767,7 +14662,7 @@ cdef class anon_struct9: self._pvt_ptr[0].handle.win32.name = self._cyname.cptr -cdef class anon_union4: +cdef class anon_union5: """ Attributes ---------- @@ -14776,7 +14671,7 @@ cdef class anon_union4: - win32 : anon_struct9 + win32 : anon_struct10 @@ -14795,7 +14690,7 @@ cdef class anon_union4: def __init__(self, void_ptr _ptr): pass - self._win32 = anon_struct9(_ptr=self._pvt_ptr) + self._win32 = anon_struct10(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -14838,7 +14733,7 @@ cdef class anon_union4: def win32(self): return self._win32 @win32.setter - def win32(self, win32 not None : anon_struct9): + def win32(self, win32 not None : anon_struct10): string.memcpy(&self._pvt_ptr[0].handle.win32, win32.getPtr(), sizeof(self._pvt_ptr[0].handle.win32)) @@ -14862,7 +14757,7 @@ cdef class cudaExternalSemaphoreHandleDesc: Type of the handle - handle : anon_union4 + handle : anon_union5 @@ -14870,10 +14765,6 @@ cdef class cudaExternalSemaphoreHandleDesc: Flags reserved for the future. Must be zero. - reserved : list[unsigned int] - Must be zero - - Methods ------- getPtr() @@ -14888,7 +14779,7 @@ cdef class cudaExternalSemaphoreHandleDesc: def __init__(self, void_ptr _ptr = 0): pass - self._handle = anon_union4(_ptr=self._pvt_ptr) + self._handle = anon_union5(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -14916,12 +14807,6 @@ cdef class cudaExternalSemaphoreHandleDesc: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -14938,7 +14823,7 @@ cdef class cudaExternalSemaphoreHandleDesc: def handle(self): return self._handle @handle.setter - def handle(self, handle not None : anon_union4): + def handle(self, handle not None : anon_union5): string.memcpy(&self._pvt_ptr[0].handle, handle.getPtr(), sizeof(self._pvt_ptr[0].handle)) @@ -14950,15 +14835,7 @@ cdef class cudaExternalSemaphoreHandleDesc: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - -cdef class anon_struct10: +cdef class anon_struct11: """ Attributes ---------- @@ -15002,7 +14879,7 @@ cdef class anon_struct10: self._pvt_ptr[0].params.fence.value = value -cdef class anon_union5: +cdef class anon_union6: """ Attributes ---------- @@ -15011,10 +14888,6 @@ cdef class anon_union5: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -15038,12 +14911,6 @@ cdef class anon_union5: except ValueError: str_list += ['fence : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -15057,15 +14924,7 @@ cdef class anon_union5: self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr - @property - def reserved(self): - return self._pvt_ptr[0].params.nvSciSync.reserved - @reserved.setter - def reserved(self, unsigned long long reserved): - self._pvt_ptr[0].params.nvSciSync.reserved = reserved - - -cdef class anon_struct11: +cdef class anon_struct12: """ Attributes ---------- @@ -15109,24 +14968,20 @@ cdef class anon_struct11: self._pvt_ptr[0].params.keyedMutex.key = key -cdef class anon_struct12: +cdef class anon_struct13: """ Attributes ---------- - fence : anon_struct10 - - + fence : anon_struct11 - nvSciSync : anon_union5 - - keyedMutex : anon_struct11 + nvSciSync : anon_union6 - reserved : list[unsigned int] + keyedMutex : anon_struct12 @@ -15141,13 +14996,13 @@ cdef class anon_struct12: def __init__(self, void_ptr _ptr): pass - self._fence = anon_struct10(_ptr=self._pvt_ptr) + self._fence = anon_struct11(_ptr=self._pvt_ptr) - self._nvSciSync = anon_union5(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union6(_ptr=self._pvt_ptr) - self._keyedMutex = anon_struct11(_ptr=self._pvt_ptr) + self._keyedMutex = anon_struct12(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -15174,12 +15029,6 @@ cdef class anon_struct12: except ValueError: str_list += ['keyedMutex : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -15188,7 +15037,7 @@ cdef class anon_struct12: def fence(self): return self._fence @fence.setter - def fence(self, fence not None : anon_struct10): + def fence(self, fence not None : anon_struct11): string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) @@ -15196,7 +15045,7 @@ cdef class anon_struct12: def nvSciSync(self): return self._nvSciSync @nvSciSync.setter - def nvSciSync(self, nvSciSync not None : anon_union5): + def nvSciSync(self, nvSciSync not None : anon_union6): string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) @@ -15204,18 +15053,10 @@ cdef class anon_struct12: def keyedMutex(self): return self._keyedMutex @keyedMutex.setter - def keyedMutex(self, keyedMutex not None : anon_struct11): + def keyedMutex(self, keyedMutex not None : anon_struct12): string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) - @property - def reserved(self): - return self._pvt_ptr[0].params.reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].params.reserved = reserved - - cdef class cudaExternalSemaphoreSignalParams: """ External semaphore signal parameters, compatible with driver type @@ -15223,7 +15064,7 @@ cdef class cudaExternalSemaphoreSignalParams: Attributes ---------- - params : anon_struct12 + params : anon_struct13 @@ -15238,10 +15079,6 @@ cdef class cudaExternalSemaphoreSignalParams: all other types of cudaExternalSemaphore_t, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -15255,7 +15092,7 @@ cdef class cudaExternalSemaphoreSignalParams: def __init__(self, void_ptr _ptr = 0): pass - self._params = anon_struct12(_ptr=self._pvt_ptr) + self._params = anon_struct13(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -15276,12 +15113,6 @@ cdef class cudaExternalSemaphoreSignalParams: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -15290,7 +15121,7 @@ cdef class cudaExternalSemaphoreSignalParams: def params(self): return self._params @params.setter - def params(self, params not None : anon_struct12): + def params(self, params not None : anon_struct13): string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) @@ -15302,15 +15133,7 @@ cdef class cudaExternalSemaphoreSignalParams: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - -cdef class anon_struct13: +cdef class anon_struct14: """ Attributes ---------- @@ -15354,7 +15177,7 @@ cdef class anon_struct13: self._pvt_ptr[0].params.fence.value = value -cdef class anon_union6: +cdef class anon_union7: """ Attributes ---------- @@ -15363,10 +15186,6 @@ cdef class anon_union6: - reserved : unsigned long long - - - Methods ------- getPtr() @@ -15390,12 +15209,6 @@ cdef class anon_union6: except ValueError: str_list += ['fence : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -15409,15 +15222,7 @@ cdef class anon_union6: self._pvt_ptr[0].params.nvSciSync.fence = self._cyfence.cptr - @property - def reserved(self): - return self._pvt_ptr[0].params.nvSciSync.reserved - @reserved.setter - def reserved(self, unsigned long long reserved): - self._pvt_ptr[0].params.nvSciSync.reserved = reserved - - -cdef class anon_struct14: +cdef class anon_struct15: """ Attributes ---------- @@ -15479,24 +15284,20 @@ cdef class anon_struct14: self._pvt_ptr[0].params.keyedMutex.timeoutMs = timeoutMs -cdef class anon_struct15: +cdef class anon_struct16: """ Attributes ---------- - fence : anon_struct13 + fence : anon_struct14 - nvSciSync : anon_union6 - - + nvSciSync : anon_union7 - keyedMutex : anon_struct14 - - reserved : list[unsigned int] + keyedMutex : anon_struct15 @@ -15511,13 +15312,13 @@ cdef class anon_struct15: def __init__(self, void_ptr _ptr): pass - self._fence = anon_struct13(_ptr=self._pvt_ptr) + self._fence = anon_struct14(_ptr=self._pvt_ptr) - self._nvSciSync = anon_union6(_ptr=self._pvt_ptr) + self._nvSciSync = anon_union7(_ptr=self._pvt_ptr) - self._keyedMutex = anon_struct14(_ptr=self._pvt_ptr) + self._keyedMutex = anon_struct15(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -15544,12 +15345,6 @@ cdef class anon_struct15: except ValueError: str_list += ['keyedMutex : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -15558,7 +15353,7 @@ cdef class anon_struct15: def fence(self): return self._fence @fence.setter - def fence(self, fence not None : anon_struct13): + def fence(self, fence not None : anon_struct14): string.memcpy(&self._pvt_ptr[0].params.fence, fence.getPtr(), sizeof(self._pvt_ptr[0].params.fence)) @@ -15566,7 +15361,7 @@ cdef class anon_struct15: def nvSciSync(self): return self._nvSciSync @nvSciSync.setter - def nvSciSync(self, nvSciSync not None : anon_union6): + def nvSciSync(self, nvSciSync not None : anon_union7): string.memcpy(&self._pvt_ptr[0].params.nvSciSync, nvSciSync.getPtr(), sizeof(self._pvt_ptr[0].params.nvSciSync)) @@ -15574,18 +15369,10 @@ cdef class anon_struct15: def keyedMutex(self): return self._keyedMutex @keyedMutex.setter - def keyedMutex(self, keyedMutex not None : anon_struct14): + def keyedMutex(self, keyedMutex not None : anon_struct15): string.memcpy(&self._pvt_ptr[0].params.keyedMutex, keyedMutex.getPtr(), sizeof(self._pvt_ptr[0].params.keyedMutex)) - @property - def reserved(self): - return self._pvt_ptr[0].params.reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].params.reserved = reserved - - cdef class cudaExternalSemaphoreWaitParams: """ External semaphore wait parameters, compatible with driver type @@ -15593,7 +15380,7 @@ cdef class cudaExternalSemaphoreWaitParams: Attributes ---------- - params : anon_struct15 + params : anon_struct16 @@ -15608,10 +15395,6 @@ cdef class cudaExternalSemaphoreWaitParams: all other types of cudaExternalSemaphore_t, flags must be zero. - reserved : list[unsigned int] - - - Methods ------- getPtr() @@ -15625,7 +15408,7 @@ cdef class cudaExternalSemaphoreWaitParams: def __init__(self, void_ptr _ptr = 0): pass - self._params = anon_struct15(_ptr=self._pvt_ptr) + self._params = anon_struct16(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -15646,12 +15429,6 @@ cdef class cudaExternalSemaphoreWaitParams: except ValueError: str_list += ['flags : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -15660,7 +15437,7 @@ cdef class cudaExternalSemaphoreWaitParams: def params(self): return self._params @params.setter - def params(self, params not None : anon_struct15): + def params(self, params not None : anon_struct16): string.memcpy(&self._pvt_ptr[0].params, params.getPtr(), sizeof(self._pvt_ptr[0].params)) @@ -15672,14 +15449,6 @@ cdef class cudaExternalSemaphoreWaitParams: self._pvt_ptr[0].flags = flags - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - cdef class cudaDevSmResource: """ Data for SM-related resources All parameters in this structure are @@ -15709,6 +15478,11 @@ cdef class cudaDevSmResource: cudaDevSmResourceGroup_flags. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + cudaDevSmResourceConstraintTypeLocalityDomainId is set in flags + + Methods ------- getPtr() @@ -15752,6 +15526,12 @@ cdef class cudaDevSmResource: except ValueError: str_list += ['flags : '] + + try: + str_list += ['localityDomainId : ' + str(self.localityDomainId)] + except ValueError: + str_list += ['localityDomainId : '] + return '\n'.join(str_list) else: return '' @@ -15788,6 +15568,14 @@ cdef class cudaDevSmResource: self._pvt_ptr[0].flags = flags + @property + def localityDomainId(self): + return self._pvt_ptr[0].localityDomainId + @localityDomainId.setter + def localityDomainId(self, unsigned int localityDomainId): + self._pvt_ptr[0].localityDomainId = localityDomainId + + cdef class cudaDevWorkqueueConfigResource: """ Data for workqueue configuration related resources @@ -15876,13 +15664,6 @@ cdef class cudaDevWorkqueueResource: """ Handle to a pre-existing workqueue related resource - Attributes - ---------- - - reserved : bytes - Reserved for future use - - Methods ------- getPtr() @@ -15903,26 +15684,10 @@ cdef class cudaDevWorkqueueResource: if self._pvt_ptr is not NULL: str_list = [] - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 40) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 40: - raise ValueError("reserved length must be 40, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b - - cdef class cudaDevSmResourceGroupParams_st: """ Input data for splitting SMs @@ -15949,8 +15714,9 @@ cdef class cudaDevSmResourceGroupParams_st: this this group is created. - reserved : list[unsigned int] - Reserved for future use - ensure this is zero initialized. + localityDomainId : unsigned int + Locality domain that the SM must be located on. Only valid if + cudaDevSmResourceGroupLocalityDomainId is set in flags Methods @@ -15998,9 +15764,9 @@ cdef class cudaDevSmResourceGroupParams_st: try: - str_list += ['reserved : ' + str(self.reserved)] + str_list += ['localityDomainId : ' + str(self.localityDomainId)] except ValueError: - str_list += ['reserved : '] + str_list += ['localityDomainId : '] return '\n'.join(str_list) else: @@ -16039,11 +15805,11 @@ cdef class cudaDevSmResourceGroupParams_st: @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved + def localityDomainId(self): + return self._pvt_ptr[0].localityDomainId + @localityDomainId.setter + def localityDomainId(self, unsigned int localityDomainId): + self._pvt_ptr[0].localityDomainId = localityDomainId cdef class cudaDevResource_st: @@ -16237,6 +16003,7 @@ cdef class cudaDevResource_st: return [cudaDevResource_st(_ptr=arr) for arr in arrs] @nextResource.setter def nextResource(self, val): + cdef cyruntime.cudaDevResource_st* _nextResource_new if len(val) == 0: free(self._nextResource) self._nextResource = NULL @@ -16244,14 +16011,22 @@ cdef class cudaDevResource_st: self._pvt_ptr[0].nextResource = NULL else: if self._nextResource_length != len(val): - free(self._nextResource) - self._nextResource = calloc(len(val), sizeof(cyruntime.cudaDevResource_st)) - if self._nextResource is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _nextResource_new = calloc(len(val), sizeof(cyruntime.cudaDevResource_st)) + if _nextResource_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaDevResource_st))) + for idx in range(len(val)): + string.memcpy(&_nextResource_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaDevResource_st)) + free(self._nextResource) + self._nextResource = _nextResource_new self._nextResource_length = len(val) - self._pvt_ptr[0].nextResource = self._nextResource - for idx in range(len(val)): - string.memcpy(&self._nextResource[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaDevResource_st)) + self._pvt_ptr[0].nextResource = _nextResource_new + else: + for idx in range(len(val)): + string.memcpy(&self._nextResource[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaDevResource_st)) @@ -16861,6 +16636,7 @@ cdef class cudaExternalSemaphoreSignalNodeParams: return [cudaExternalSemaphoreSignalParams(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cyruntime.cudaExternalSemaphoreSignalParams* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -16868,14 +16644,22 @@ cdef class cudaExternalSemaphoreSignalNodeParams: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreSignalParams))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) @@ -16907,6 +16691,10 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: paramsArray. + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -16919,6 +16707,9 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + + self._ctx = cudaExecutionContext_t(_ptr=&self._pvt_ptr[0].ctx) + def __dealloc__(self): pass @@ -16954,6 +16745,12 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: except ValueError: str_list += ['numExtSems : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + return '\n'.join(str_list) else: return '' @@ -16988,6 +16785,7 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: return [cudaExternalSemaphoreSignalParams(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cyruntime.cudaExternalSemaphoreSignalParams* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -16995,14 +16793,22 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreSignalParams))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreSignalParams)) @@ -17014,6 +16820,23 @@ cdef class cudaExternalSemaphoreSignalNodeParamsV2: self._pvt_ptr[0].numExtSems = numExtSems + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cyruntime.cudaExecutionContext_t cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (cudaExecutionContext_t,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(cudaExecutionContext_t(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + cdef class cudaExternalSemaphoreWaitNodeParams: """ External semaphore wait node parameters @@ -17115,6 +16938,7 @@ cdef class cudaExternalSemaphoreWaitNodeParams: return [cudaExternalSemaphoreWaitParams(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cyruntime.cudaExternalSemaphoreWaitParams* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -17122,14 +16946,22 @@ cdef class cudaExternalSemaphoreWaitNodeParams: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreWaitParams))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) @@ -17161,6 +16993,10 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: paramsArray. + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -17173,6 +17009,9 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): pass + + self._ctx = cudaExecutionContext_t(_ptr=&self._pvt_ptr[0].ctx) + def __dealloc__(self): pass @@ -17208,6 +17047,12 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: except ValueError: str_list += ['numExtSems : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + return '\n'.join(str_list) else: return '' @@ -17242,6 +17087,7 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: return [cudaExternalSemaphoreWaitParams(_ptr=arr) for arr in arrs] @paramsArray.setter def paramsArray(self, val): + cdef cyruntime.cudaExternalSemaphoreWaitParams* _paramsArray_new if len(val) == 0: free(self._paramsArray) self._paramsArray = NULL @@ -17249,14 +17095,22 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: self._pvt_ptr[0].paramsArray = NULL else: if self._paramsArray_length != len(val): - free(self._paramsArray) - self._paramsArray = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) - if self._paramsArray is NULL: + # Allocate and fill a new buffer before touching the + # live state so a failure leaves this object unchanged + # (strong exception guarantee); the old buffer is only + # freed once the resize is known to succeed. + _paramsArray_new = calloc(len(val), sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + if _paramsArray_new is NULL: raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaExternalSemaphoreWaitParams))) + for idx in range(len(val)): + string.memcpy(&_paramsArray_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + free(self._paramsArray) + self._paramsArray = _paramsArray_new self._paramsArray_length = len(val) - self._pvt_ptr[0].paramsArray = self._paramsArray - for idx in range(len(val)): - string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) + self._pvt_ptr[0].paramsArray = _paramsArray_new + else: + for idx in range(len(val)): + string.memcpy(&self._paramsArray[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaExternalSemaphoreWaitParams)) @@ -17268,6 +17122,23 @@ cdef class cudaExternalSemaphoreWaitNodeParamsV2: self._pvt_ptr[0].numExtSems = numExtSems + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cyruntime.cudaExecutionContext_t cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (cudaExecutionContext_t,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(cudaExecutionContext_t(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + cdef class cudaConditionalNodeParams: """ CUDA conditional node parameters @@ -17298,7 +17169,7 @@ cdef class cudaConditionalNodeParams: empty nodes, child graphs, memsets, memcopies, and conditionals. This applies recursively to child graphs and conditional bodies. - All kernels, including kernels in nested conditionals or child - graphs at any level, must belong to the same CUDA context. + graphs at any level, must belong to the same device context. These graphs may be populated using graph node creation APIs or cudaStreamBeginCaptureToGraph. cudaGraphCondTypeIf: phGraph_out[0] is executed when the condition is non-zero. If `size` == 2, @@ -17522,6 +17393,10 @@ cdef class cudaEventRecordNodeParams: The event to record when the node executes + ctx : cudaExecutionContext_t + CUDA Execution Context + + Methods ------- getPtr() @@ -17537,6 +17412,9 @@ cdef class cudaEventRecordNodeParams: self._event = cudaEvent_t(_ptr=&self._pvt_ptr[0].event) + + self._ctx = cudaExecutionContext_t(_ptr=&self._pvt_ptr[0].ctx) + def __dealloc__(self): pass def getPtr(self): @@ -17550,6 +17428,12 @@ cdef class cudaEventRecordNodeParams: except ValueError: str_list += ['event : '] + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + return '\n'.join(str_list) else: return '' @@ -17571,6 +17455,23 @@ cdef class cudaEventRecordNodeParams: self._event._pvt_ptr[0] = cyevent + @property + def ctx(self): + return self._ctx + @ctx.setter + def ctx(self, ctx): + cdef cyruntime.cudaExecutionContext_t cyctx + if ctx is None: + cyctx = 0 + elif isinstance(ctx, (cudaExecutionContext_t,)): + pctx = int(ctx) + cyctx = pctx + else: + pctx = int(cudaExecutionContext_t(ctx)) + cyctx = pctx + self._ctx._pvt_ptr[0] = cyctx + + cdef class cudaEventWaitNodeParams: """ Event wait node parameters @@ -17642,14 +17543,6 @@ cdef class cudaGraphNodeParams: Type of the node - reserved0 : list[int] - Reserved. Must be zero. - - - reserved1 : list[long long] - Padding. Unused bytes must be zero. - - kernel : cudaKernelNodeParamsV2 Kernel node parameters. @@ -17698,10 +17591,6 @@ cdef class cudaGraphNodeParams: Conditional node parameters. - reserved2 : long long - Reserved bytes. Must be zero. - - Methods ------- getPtr() @@ -17766,18 +17655,6 @@ cdef class cudaGraphNodeParams: str_list += ['type : '] - try: - str_list += ['reserved0 : ' + str(self.reserved0)] - except ValueError: - str_list += ['reserved0 : '] - - - try: - str_list += ['reserved1 : ' + str(self.reserved1)] - except ValueError: - str_list += ['reserved1 : '] - - try: str_list += ['kernel :\n' + '\n'.join([' ' + line for line in str(self.kernel).splitlines()])] except ValueError: @@ -17849,12 +17726,6 @@ cdef class cudaGraphNodeParams: except ValueError: str_list += ['conditional : '] - - try: - str_list += ['reserved2 : ' + str(self.reserved2)] - except ValueError: - str_list += ['reserved2 : '] - return '\n'.join(str_list) else: return '' @@ -17867,22 +17738,6 @@ cdef class cudaGraphNodeParams: self._pvt_ptr[0].type = int(type) - @property - def reserved0(self): - return self._pvt_ptr[0].reserved0 - @reserved0.setter - def reserved0(self, reserved0): - self._pvt_ptr[0].reserved0 = reserved0 - - - @property - def reserved1(self): - return self._pvt_ptr[0].reserved1 - @reserved1.setter - def reserved1(self, reserved1): - self._pvt_ptr[0].reserved1 = reserved1 - - @property def kernel(self): return self._kernel @@ -17979,14 +17834,6 @@ cdef class cudaGraphNodeParams: string.memcpy(&self._pvt_ptr[0].conditional, conditional.getPtr(), sizeof(self._pvt_ptr[0].conditional)) - @property - def reserved2(self): - return self._pvt_ptr[0].reserved2 - @reserved2.setter - def reserved2(self, long long reserved2): - self._pvt_ptr[0].reserved2 = reserved2 - - cdef class cudaGraphEdgeData_st: """ Optional annotation for edges in a CUDA graph. Note, all edges @@ -18024,11 +17871,6 @@ cdef class cudaGraphEdgeData_st: See cudaGraphDependencyType. - reserved : bytes - These bytes are unused and must be zeroed. This ensures - compatibility if additional fields are added in the future. - - Methods ------- getPtr() @@ -18066,12 +17908,6 @@ cdef class cudaGraphEdgeData_st: except ValueError: str_list += ['type : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -18100,17 +17936,6 @@ cdef class cudaGraphEdgeData_st: self._pvt_ptr[0].type = type - @property - def reserved(self): - return PyBytes_FromStringAndSize(self._pvt_ptr[0].reserved, 5) - @reserved.setter - def reserved(self, reserved): - if len(reserved) != 5: - raise ValueError("reserved length must be 5, is " + str(len(reserved))) - for i, b in enumerate(reserved): - self._pvt_ptr[0].reserved[i] = b - - cdef class cudaGraphInstantiateParams_st: """ Graph instantiation parameters @@ -18348,7 +18173,7 @@ cdef class cudaGraphExecUpdateResultInfo_st: self._errorFromNode._pvt_ptr[0] = cyerrorFromNode -cdef class anon_struct16: +cdef class anon_struct17: """ Attributes ---------- @@ -18429,7 +18254,7 @@ cdef class anon_struct16: self._pvt_ptr[0].updateData.param.size = size -cdef class anon_union10: +cdef class anon_union11: """ Attributes ---------- @@ -18438,7 +18263,7 @@ cdef class anon_union10: - param : anon_struct16 + param : anon_struct17 @@ -18460,7 +18285,7 @@ cdef class anon_union10: self._gridDim = dim3(_ptr=&self._pvt_ptr[0].updateData.gridDim) - self._param = anon_struct16(_ptr=self._pvt_ptr) + self._param = anon_struct17(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -18503,7 +18328,7 @@ cdef class anon_union10: def param(self): return self._param @param.setter - def param(self, param not None : anon_struct16): + def param(self, param not None : anon_struct17): string.memcpy(&self._pvt_ptr[0].updateData.param, param.getPtr(), sizeof(self._pvt_ptr[0].updateData.param)) @@ -18532,7 +18357,7 @@ cdef class cudaGraphKernelNodeUpdate: interpreted - updateData : anon_union10 + updateData : anon_union11 Update data to apply. Which field is used depends on field's value @@ -18553,7 +18378,7 @@ cdef class cudaGraphKernelNodeUpdate: self._node = cudaGraphDeviceNode_t(_ptr=&self._pvt_ptr[0].node) - self._updateData = anon_union10(_ptr=self._pvt_ptr) + self._updateData = anon_union11(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -18614,7 +18439,7 @@ cdef class cudaGraphKernelNodeUpdate: def updateData(self): return self._updateData @updateData.setter - def updateData(self, updateData not None : anon_union10): + def updateData(self, updateData not None : anon_union11): string.memcpy(&self._pvt_ptr[0].updateData, updateData.getPtr(), sizeof(self._pvt_ptr[0].updateData)) @@ -18690,7 +18515,7 @@ cdef class cudaLaunchMemSyncDomainMap_st: self._pvt_ptr[0].remote = remote -cdef class anon_struct17: +cdef class anon_struct18: """ Attributes ---------- @@ -18770,7 +18595,7 @@ cdef class anon_struct17: self._pvt_ptr[0].clusterDim.z = z -cdef class anon_struct18: +cdef class anon_struct19: """ Attributes ---------- @@ -18862,7 +18687,7 @@ cdef class anon_struct18: self._pvt_ptr[0].programmaticEvent.triggerAtBlockStart = triggerAtBlockStart -cdef class anon_struct19: +cdef class anon_struct20: """ Attributes ---------- @@ -18942,7 +18767,7 @@ cdef class anon_struct19: self._pvt_ptr[0].preferredClusterDim.z = z -cdef class anon_struct20: +cdef class anon_struct21: """ Attributes ---------- @@ -19016,7 +18841,7 @@ cdef class anon_struct20: self._pvt_ptr[0].launchCompletionEvent.flags = flags -cdef class anon_struct21: +cdef class anon_struct22: """ Attributes ---------- @@ -19115,7 +18940,7 @@ cdef class cudaLaunchAttributeValue: cudaSynchronizationPolicy for work queued up in this stream. - clusterDim : anon_struct17 + clusterDim : anon_struct18 Value of launch attribute cudaLaunchAttributeClusterDimension that represents the desired cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the @@ -19136,7 +18961,7 @@ cdef class cudaLaunchAttributeValue: cudaLaunchAttributeProgrammaticStreamSerialization. - programmaticEvent : anon_struct18 + programmaticEvent : anon_struct19 Value of launch attribute cudaLaunchAttributeProgrammaticEvent with the following fields: - `cudaEvent_t` event - Event to fire when all blocks trigger it. - `int` flags; - Event record flags, see @@ -19160,22 +18985,22 @@ cdef class cudaLaunchAttributeValue: cudaLaunchMemSyncDomain. - preferredClusterDim : anon_struct19 + preferredClusterDim : anon_struct20 Value of launch attribute cudaLaunchAttributePreferredClusterDimension that represents the desired preferred cluster dimensions for the kernel. Opaque type with the following fields: - `x` - The X dimension of the preferred cluster, in blocks. Must be a divisor of the grid X dimension, and must be a multiple of the `x` field of - ::cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension - of the preferred cluster, in blocks. Must be a divisor of the grid - Y dimension, and must be a multiple of the `y` field of - ::cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension - of the preferred cluster, in blocks. Must be equal to the `z` field - of ::cudaLaunchAttributeValue::clusterDim. + cudaLaunchAttributeValue::clusterDim. - `y` - The Y dimension of + the preferred cluster, in blocks. Must be a divisor of the grid Y + dimension, and must be a multiple of the `y` field of + cudaLaunchAttributeValue::clusterDim. - `z` - The Z dimension of + the preferred cluster, in blocks. Must be equal to the `z` field of + cudaLaunchAttributeValue::clusterDim. - launchCompletionEvent : anon_struct20 + launchCompletionEvent : anon_struct21 Value of launch attribute cudaLaunchAttributeLaunchCompletionEvent with the following fields: - `cudaEvent_t` event - Event to fire when the last block launches. - `int` flags - Event record @@ -19183,7 +19008,7 @@ cdef class cudaLaunchAttributeValue: cudaEventRecordExternal. - deviceUpdatableKernelNode : anon_struct21 + deviceUpdatableKernelNode : anon_struct22 Value of launch attribute cudaLaunchAttributeDeviceUpdatableKernelNode with the following fields: - `int` deviceUpdatable - Whether or not the resulting @@ -19228,22 +19053,22 @@ cdef class cudaLaunchAttributeValue: self._accessPolicyWindow = cudaAccessPolicyWindow(_ptr=&self._pvt_ptr[0].accessPolicyWindow) - self._clusterDim = anon_struct17(_ptr=self._pvt_ptr) + self._clusterDim = anon_struct18(_ptr=self._pvt_ptr) - self._programmaticEvent = anon_struct18(_ptr=self._pvt_ptr) + self._programmaticEvent = anon_struct19(_ptr=self._pvt_ptr) self._memSyncDomainMap = cudaLaunchMemSyncDomainMap(_ptr=&self._pvt_ptr[0].memSyncDomainMap) - self._preferredClusterDim = anon_struct19(_ptr=self._pvt_ptr) + self._preferredClusterDim = anon_struct20(_ptr=self._pvt_ptr) - self._launchCompletionEvent = anon_struct20(_ptr=self._pvt_ptr) + self._launchCompletionEvent = anon_struct21(_ptr=self._pvt_ptr) - self._deviceUpdatableKernelNode = anon_struct21(_ptr=self._pvt_ptr) + self._deviceUpdatableKernelNode = anon_struct22(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -19411,7 +19236,7 @@ cdef class cudaLaunchAttributeValue: def clusterDim(self): return self._clusterDim @clusterDim.setter - def clusterDim(self, clusterDim not None : anon_struct17): + def clusterDim(self, clusterDim not None : anon_struct18): string.memcpy(&self._pvt_ptr[0].clusterDim, clusterDim.getPtr(), sizeof(self._pvt_ptr[0].clusterDim)) @@ -19435,7 +19260,7 @@ cdef class cudaLaunchAttributeValue: def programmaticEvent(self): return self._programmaticEvent @programmaticEvent.setter - def programmaticEvent(self, programmaticEvent not None : anon_struct18): + def programmaticEvent(self, programmaticEvent not None : anon_struct19): string.memcpy(&self._pvt_ptr[0].programmaticEvent, programmaticEvent.getPtr(), sizeof(self._pvt_ptr[0].programmaticEvent)) @@ -19467,7 +19292,7 @@ cdef class cudaLaunchAttributeValue: def preferredClusterDim(self): return self._preferredClusterDim @preferredClusterDim.setter - def preferredClusterDim(self, preferredClusterDim not None : anon_struct19): + def preferredClusterDim(self, preferredClusterDim not None : anon_struct20): string.memcpy(&self._pvt_ptr[0].preferredClusterDim, preferredClusterDim.getPtr(), sizeof(self._pvt_ptr[0].preferredClusterDim)) @@ -19475,7 +19300,7 @@ cdef class cudaLaunchAttributeValue: def launchCompletionEvent(self): return self._launchCompletionEvent @launchCompletionEvent.setter - def launchCompletionEvent(self, launchCompletionEvent not None : anon_struct20): + def launchCompletionEvent(self, launchCompletionEvent not None : anon_struct21): string.memcpy(&self._pvt_ptr[0].launchCompletionEvent, launchCompletionEvent.getPtr(), sizeof(self._pvt_ptr[0].launchCompletionEvent)) @@ -19483,7 +19308,7 @@ cdef class cudaLaunchAttributeValue: def deviceUpdatableKernelNode(self): return self._deviceUpdatableKernelNode @deviceUpdatableKernelNode.setter - def deviceUpdatableKernelNode(self, deviceUpdatableKernelNode not None : anon_struct21): + def deviceUpdatableKernelNode(self, deviceUpdatableKernelNode not None : anon_struct22): string.memcpy(&self._pvt_ptr[0].deviceUpdatableKernelNode, deviceUpdatableKernelNode.getPtr(), sizeof(self._pvt_ptr[0].deviceUpdatableKernelNode)) @@ -19588,7 +19413,7 @@ cdef class cudaLaunchAttribute_st: string.memcpy(&self._pvt_ptr[0].val, val.getPtr(), sizeof(self._pvt_ptr[0].val)) -cdef class anon_struct22: +cdef class anon_struct23: """ Attributes ---------- @@ -19632,12 +19457,12 @@ cdef class anon_struct22: self._pvt_ptr[0].info.overBudget.bytesOverBudget = bytesOverBudget -cdef class anon_union11: +cdef class anon_union12: """ Attributes ---------- - overBudget : anon_struct22 + overBudget : anon_struct23 @@ -19652,7 +19477,7 @@ cdef class anon_union11: def __init__(self, void_ptr _ptr): pass - self._overBudget = anon_struct22(_ptr=self._pvt_ptr) + self._overBudget = anon_struct23(_ptr=self._pvt_ptr) def __dealloc__(self): pass @@ -19675,7 +19500,7 @@ cdef class anon_union11: def overBudget(self): return self._overBudget @overBudget.setter - def overBudget(self, overBudget not None : anon_struct22): + def overBudget(self, overBudget not None : anon_struct23): string.memcpy(&self._pvt_ptr[0].info.overBudget, overBudget.getPtr(), sizeof(self._pvt_ptr[0].info.overBudget)) @@ -19690,7 +19515,7 @@ cdef class cudaAsyncNotificationInfo: The type of notification being sent - info : anon_union11 + info : anon_union12 Information about the notification. `typename` must be checked in order to interpret this field. @@ -19709,7 +19534,7 @@ cdef class cudaAsyncNotificationInfo: def __init__(self, void_ptr _ptr = 0): pass - self._info = anon_union11(_ptr=self._pvt_ptr) + self._info = anon_union12(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -19747,7 +19572,7 @@ cdef class cudaAsyncNotificationInfo: def info(self): return self._info @info.setter - def info(self, info not None : anon_union11): + def info(self, info not None : anon_union12): string.memcpy(&self._pvt_ptr[0].info, info.getPtr(), sizeof(self._pvt_ptr[0].info)) @@ -20127,10 +19952,6 @@ cdef class cudaEglPlaneDesc_st: Channel Format Descriptor - reserved : list[unsigned int] - Reserved for future use - - Methods ------- getPtr() @@ -20189,12 +20010,6 @@ cdef class cudaEglPlaneDesc_st: except ValueError: str_list += ['channelDesc : '] - - try: - str_list += ['reserved : ' + str(self.reserved)] - except ValueError: - str_list += ['reserved : '] - return '\n'.join(str_list) else: return '' @@ -20247,15 +20062,7 @@ cdef class cudaEglPlaneDesc_st: string.memcpy(&self._pvt_ptr[0].channelDesc, channelDesc.getPtr(), sizeof(self._pvt_ptr[0].channelDesc)) - @property - def reserved(self): - return self._pvt_ptr[0].reserved - @reserved.setter - def reserved(self, reserved): - self._pvt_ptr[0].reserved = reserved - - -cdef class anon_union12: +cdef class anon_union13: """ Attributes ---------- @@ -20343,7 +20150,7 @@ cdef class cudaEglFrame_st: Attributes ---------- - frame : anon_union12 + frame : anon_union13 @@ -20377,7 +20184,7 @@ cdef class cudaEglFrame_st: def __init__(self, void_ptr _ptr = 0): pass - self._frame = anon_union12(_ptr=self._pvt_ptr) + self._frame = anon_union13(_ptr=self._pvt_ptr) def __dealloc__(self): if self._val_ptr is not NULL: @@ -20425,7 +20232,7 @@ cdef class cudaEglFrame_st: def frame(self): return self._frame @frame.setter - def frame(self, frame not None : anon_union12): + def frame(self, frame not None : anon_union13): string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) @@ -25452,7 +25259,7 @@ def cudaLaunchHostFunc(stream, fn, userData): Parameters ---------- - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` Stream to enqueue function call in fn : :py:obj:`~.cudaHostFn_t` The function to call once preceding stream operations are complete @@ -25548,7 +25355,7 @@ def cudaLaunchHostFunc_v2(stream, fn, userData, unsigned int syncMode): Parameters ---------- - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` Stream to enqueue function call in fn : :py:obj:`~.cudaHostFn_t` The function to call once preceding stream operations are complete @@ -28090,7 +27897,7 @@ def cudaMemcpyBatchAsync(dsts : Optional[tuple[Any] | list[Any]], srcs : Optiona attrsIdxs[numAttrs-1] through count - 1. numAttrs : size_t Size of `attrs` and `attrsIdxs` arrays. - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to enqueue the operations in. Must not be legacy NULL stream. @@ -28235,7 +28042,7 @@ def cudaMemcpy3DBatchAsync(size_t numOps, opList : Optional[tuple[cudaMemcpy3DBa Array of size `numOps` containing the actual memcpy operations. flags : unsigned long long Flags for future use, must be zero now. - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to enqueue the operations in. Must not be default NULL stream. @@ -28281,7 +28088,7 @@ def cudaMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[cudaMem Performs asynchronous memory copy operation where `dst` and `src` are the destination and source pointers respectively. `size` specifies the number of bytes to copy. `attr` specifies the attributes for the copy - and `hStream` specifies the stream to enqueue the operation in. + and `stream` specifies the stream to enqueue the operation in. For more information regarding the attributes, please refer to :py:obj:`~.cudaMemcpyAttributes` and it's usage desciption @@ -28297,7 +28104,7 @@ def cudaMemcpyWithAttributesAsync(dst, src, size_t size, attr : Optional[cudaMem Number of bytes to copy attr : :py:obj:`~.cudaMemcpyAttributes` Attributes for the copy - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` Stream to enqueue the operation in Returns @@ -28335,7 +28142,7 @@ def cudaMemcpy3DWithAttributesAsync(op : Optional[cudaMemcpy3DBatchOp], unsigned Performs 3D asynchronous memory copy with the specified attributes. Performs the copy operation specified in `op`. `flags` specifies the - flags for the copy and `hStream` specifies the stream to enqueue the + flags for the copy and `stream` specifies the stream to enqueue the operation in. For more information regarding the operation, please refer to @@ -28348,7 +28155,7 @@ def cudaMemcpy3DWithAttributesAsync(op : Optional[cudaMemcpy3DBatchOp], unsigned Operation to perform flags : unsigned long long Flags for the copy, must be zero now. - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` Stream to enqueue the operation in Returns @@ -28961,7 +28768,9 @@ def cudaMemPrefetchAsync(devPtr, size_t count, location not None : cudaMemLocati :py:obj:`~.cudaMemLocation.type` is etiher :py:obj:`~.cudaMemLocationTypeHost` OR :py:obj:`~.cudaMemLocationTypeHostNumaCurrent`, - :py:obj:`~.cudaMemLocation.id` will be ignored. + :py:obj:`~.cudaMemLocation.id` will be ignored. Prefetching to + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain` locations is not + supported. The start address and end address of the memory range will be rounded down and rounded up respectively to be aligned to CPU page size before @@ -29023,7 +28832,7 @@ def cudaMemPrefetchAsync(devPtr, size_t count, location not None : cudaMemLocati Returns ------- cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorNotSupported` See Also -------- @@ -29101,7 +28910,7 @@ def cudaMemPrefetchBatchAsync(dptrs : Optional[tuple[Any] | list[Any]], sizes : Size of `prefetchLocs` and `prefetchLocIdxs` arrays. flags : unsigned long long Flags reserved for future use. Must be zero. - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to enqueue the operations in. Must not be legacy NULL stream. @@ -29191,7 +29000,7 @@ def cudaMemDiscardBatchAsync(dptrs : Optional[tuple[Any] | list[Any]], sizes : t Size of `dptrs` and `sizes` arrays. flags : unsigned long long Flags reserved for future use. Must be zero. - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to enqueue the operations in. Must not be legacy NULL stream. @@ -29286,7 +29095,7 @@ def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[Any] | list[Any]] Size of `prefetchLocs` and `prefetchLocIdxs` arrays. flags : unsigned long long Flags reserved for future use. Must be zero. - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` The stream to enqueue the operations in. Must not be legacy NULL stream. @@ -29335,6 +29144,80 @@ def cudaMemDiscardAndPrefetchBatchAsync(dptrs : Optional[tuple[Any] | list[Any]] free(cyprefetchLocs) return (_cudaError_t(err),) +@cython.embedsignature(True) +def cudaMemGetLocationInfo(devPtr, size_t size, size_t summaryGranularity, size_t samplingGranularity, location_out : Optional[cudaMemLocation]): + """ Gets location information for a memory address range. + + Retrieves memory location information for the specified address range + starting at `ptr` with size `size`. The API determines the most common + location by sampling memory at intervals defined by + `samplingGranularity` within the whole interval. + + The location information is returned in the `location_out` array, with + one entry per summary region. The total number of locations returned + will be ceil(size/summaryGranularity). The user is expected to allocate + the `location_out` array with sufficient memory. + + For example, with an address range of 1GB, a `summaryGranularity` of + 128MB, and a `samplingGranularity` of 2MB, the function will: + + - Divide the 1GB range into 8 summary regions of 128MB each + + - Within each 128MB region, sample every 2MB to determine the most + common location. If there is a tie a random winner is chosen. + + - Populate the `location_out` array with 8 entries, one for each 128MB + region `summaryGranularity` should be less than or equal to `size` + and greater than 0. `samplingGranularity` should be less than or + equal to `summaryGranularity`. If the `samplingGranularity` is set to + 0 it is set to a system dependent default value. In all other cases, + the call returns :py:obj:`~.cudaErrorInvalidValue`. + + When the memory is not resident on any processor, the call returns + :py:obj:`~.cudaSuccess` and the returned location type for that + interval is :py:obj:`~.cudaMemLocationTypeNone`. + + The memory range must refer to one of the following: + + - Managed memory allocated via :py:obj:`~.cudaMallocManaged`, via + :py:obj:`~.cudaMallocFromPoolAsync` from a managed memory pool or + declared via managed variables. + + - System-allocated pageable memory that is not registered via + :py:obj:`~.cudaHostRegister`. If the memory range does not refer to + one of the above, the call returns :py:obj:`~.cudaErrorInvalidValue`. + + All devices on the system must have non-zero value for the device + attribute :py:obj:`~.cudaDevAttrConcurrentManagedAccess`. If not, this + call returns :py:obj:`~.cudaErrorNotSupported`. + + Parameters + ---------- + ptr : Any + Starting address of the memory range to query + size : size_t + Size in bytes of the memory range to query + summaryGranularity : size_t + Granularity in bytes at which to summarize location information + samplingGranularity : size_t + Granularity in bytes at which to sample memory within each summary + region + location_out : :py:obj:`~.cudaMemLocation` + Array to store location information, one entry per summary region + + Returns + ------- + cudaError_t + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` + """ + cdef _HelperInputVoidPtrStruct cydevPtrHelper + cdef void* cydevPtr = _helper_input_void_ptr(devPtr, &cydevPtrHelper) + cdef cyruntime.cudaMemLocation* cylocation_out_ptr = location_out._pvt_ptr if location_out is not None else NULL + with nogil: + err = cyruntime.cudaMemGetLocationInfo(cydevPtr, size, summaryGranularity, samplingGranularity, cylocation_out_ptr) + _helper_input_void_ptr_free(&cydevPtrHelper) + return (_cudaError_t(err),) + @cython.embedsignature(True) def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, location not None : cudaMemLocation): """ Advise about the usage of a given memory range. @@ -29516,7 +29399,7 @@ def cudaMemAdvise(devPtr, size_t count, advice not None : cudaMemoryAdvise, loca Returns ------- cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice` + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidDevice`, :py:obj:`~.cudaErrorNotSupported` See Also -------- @@ -30369,6 +30252,11 @@ def cudaMemPoolGetAttribute(memPool, attr not None : cudaMemPoolAttr): the importing process or pools imported via fabric handles across nodes this will be cudaMemlocataionTypeInvisible. + - :py:obj:`~.cudaMemPoolAttrLocalityDomainId`: (value type = int) The + locality domain id for the mempool, if the mempool is localized to a + locality domain. A value of -1 indicates that the mempool is not + localized to a locality domain. + - :py:obj:`~.cudaMemPoolAttrMaxPoolSize`: (value type = cuuint64_t) Maximum size of the pool in bytes, this value may be higher than what was initially passed to cuMemPoolCreate due to alignment @@ -30431,7 +30319,7 @@ def cudaMemPoolSetAccess(memPool, descList : Optional[tuple[cudaMemAccessDesc] | Returns ------- cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` See Also -------- @@ -30529,9 +30417,19 @@ def cudaMemPoolCreate(poolProps : Optional[cudaMemPoolProps]): ID of the host memory node. Specifying :py:obj:`~.cudaMemLocationTypeHostNumaCurrent` as the :py:obj:`~.cudaMemPoolProps.cudaMemLocation.type` will result in - :py:obj:`~.cudaErrorInvalidValue`. By default, the pool's memory will - be accessible from the device it is allocated on. In the case of pools - created with :py:obj:`~.cudaMemLocationTypeHostNuma` or + :py:obj:`~.cudaErrorInvalidValue`. To create a memory pool targeting a + specific device locality domain, applications must set + :py:obj:`~.cudaMemPoolProps.cudaMemLocation.type` to + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain`, + :py:obj:`~.cudaMemPoolProps.cudaMemLocation.localized`.deviceId must + specify the device ID, and + :py:obj:`~.cudaMemPoolProps.cudaMemLocation.localized`.localityDomainId + must specify the locality domain ID. The locality domain ID must be a + valid locality domain ID for the specified device. See also + :py:obj:`~.cudaDeviceGetAttribute` with the attribute + :py:obj:`~.cudaDevAttrLocalityDomainCount`. By default, the pool's + memory will be accessible from the device it is allocated on. In the + case of pools created with :py:obj:`~.cudaMemLocationTypeHostNuma` or :py:obj:`~.cudaMemLocationTypeHost`, their default accessibility will be from the host CPU. Applications can control the maximum size of the pool by specifying a non-zero value for @@ -30651,14 +30549,17 @@ def cudaMemGetDefaultMemPool(location : Optional[cudaMemLocation], typename not The memory location can be of one of :py:obj:`~.cudaMemLocationTypeDevice`, - :py:obj:`~.cudaMemLocationTypeHost`, or - :py:obj:`~.cudaMemLocationTypeHostNuma`. The allocation type can be one - of :py:obj:`~.cudaMemAllocationTypePinned` or + :py:obj:`~.cudaMemLocationTypeHost`, + :py:obj:`~.cudaMemLocationTypeHostNuma`, or + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain`. The allocation + type can be one of :py:obj:`~.cudaMemAllocationTypePinned` or :py:obj:`~.cudaMemAllocationTypeManaged`. When the allocation type is :py:obj:`~.cudaMemAllocationTypeManaged`, the location type can also be :py:obj:`~.cudaMemLocationTypeNone` to indicate no preferred location - for the managed memory pool. In all other cases, the call return - :py:obj:`~.cudaErrorInvalidValue` + for the managed memory pool. :py:obj:`~.cudaMemAllocationTypeManaged` + can not be used with + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain`. In all other + cases, the call return :py:obj:`~.cudaErrorInvalidValue` Parameters ---------- @@ -30693,14 +30594,17 @@ def cudaMemGetMemPool(location : Optional[cudaMemLocation], typename not None : The memory location can be of one of :py:obj:`~.cudaMemLocationTypeDevice`, - :py:obj:`~.cudaMemLocationTypeHost`, or - :py:obj:`~.cudaMemLocationTypeHostNuma`. The allocation type can be one - of :py:obj:`~.cudaMemAllocationTypePinned` or + :py:obj:`~.cudaMemLocationTypeHost`, + :py:obj:`~.cudaMemLocationTypeHostNuma`, or + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain`. The allocation + type can be one of :py:obj:`~.cudaMemAllocationTypePinned` or :py:obj:`~.cudaMemAllocationTypeManaged`. When the allocation type is :py:obj:`~.cudaMemAllocationTypeManaged`, the location type can also be :py:obj:`~.cudaMemLocationTypeNone` to indicate no preferred location - for the managed memory pool. In all other cases, the call return - :py:obj:`~.cudaErrorInvalidValue` + for the managed memory pool. :py:obj:`~.cudaMemAllocationTypeManaged` + can not be used with + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain`. In all other + cases, the call return :py:obj:`~.cudaErrorInvalidValue` Returns the last pool provided to :py:obj:`~.cudaMemSetMemPool` or :py:obj:`~.cudaDeviceSetMemPool` for this location and allocation type @@ -30721,7 +30625,7 @@ def cudaMemGetMemPool(location : Optional[cudaMemLocation], typename not None : Returns ------- cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` memPool : :py:obj:`~.cudaMemPool_t` None @@ -30744,14 +30648,17 @@ def cudaMemSetMemPool(location : Optional[cudaMemLocation], typename not None : The memory location can be of one of :py:obj:`~.cudaMemLocationTypeDevice`, - :py:obj:`~.cudaMemLocationTypeHost` or - :py:obj:`~.cudaMemLocationTypeHostNuma`. The allocation type can be one - of :py:obj:`~.cudaMemAllocationTypePinned` or + :py:obj:`~.cudaMemLocationTypeHost` + :py:obj:`~.cudaMemLocationTypeHostNuma`, or + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain`. The allocation + type can be one of :py:obj:`~.cudaMemAllocationTypePinned` or :py:obj:`~.cudaMemAllocationTypeManaged`. When the allocation type is :py:obj:`~.cudaMemAllocationTypeManaged`, the location type can also be :py:obj:`~.cudaMemLocationTypeNone` to indicate no preferred location - for the managed memory pool. In all other cases, the call return - :py:obj:`~.cudaErrorInvalidValue` + for the managed memory pool. :py:obj:`~.cudaMemAllocationTypeManaged` + can not be used with + :py:obj:`~.cudaMemLocationTypeDeviceLocalityDomain`. In all other + cases, the call return :py:obj:`~.cudaErrorInvalidValue` When a memory pool is set as the current memory pool, the location parameter should be the same as the location of the pool. If the @@ -30778,7 +30685,7 @@ def cudaMemSetMemPool(location : Optional[cudaMemLocation], typename not None : Returns ------- cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue` + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorNotSupported` See Also -------- @@ -30806,7 +30713,7 @@ def cudaMemSetMemPool(location : Optional[cudaMemLocation], typename not None : def cudaMallocFromPoolAsync(size_t size, memPool, stream): """ Allocates memory from a specified pool with stream ordered semantics. - Inserts an allocation operation into `hStream`. A pointer to the + Inserts an allocation operation into `stream`. A pointer to the allocated memory is returned immediately in *dptr. The allocation must not be accessed until the the allocation operation completes. The allocation comes from the specified memory pool. @@ -31079,6 +30986,10 @@ def cudaPointerGetAttributes(ptr): memory referred to by `ptr` cannot be accessed directly by the host then this is NULL. + - :py:obj:`~.localityDomainOrdinal` is the locality domain ordinal for + device allocations localized to a locality domain, or -1 when the + allocation is not localized to a locality domain. + Parameters ---------- ptr : Any @@ -32186,6 +32097,11 @@ def cudaRuntimeGetVersion(): of this API is solely to return a compile-time constant stating the CUDA Toolkit version in the above format. + As of CUDA 13.0, on Windows, the `runtimeVersion` may not be the same + as the CUDA Toolkit version the app was built with. Windows will use + the CUDA Runtime packaged with the display driver, and that version + will be reported. + This function automatically returns :py:obj:`~.cudaErrorInvalidValue` if the `runtimeVersion` argument is NULL. @@ -36729,17 +36645,17 @@ def cudaGraphExecUpdate(hGraphExec, hGraph): def cudaGraphUpload(graphExec, stream): """ Uploads an executable graph in a stream. - Uploads `hGraphExec` to the device in `hStream` without executing it. - Uploads of the same `hGraphExec` will be serialized. Each upload is - ordered behind both any previous work in `hStream` and any previous - launches of `hGraphExec`. Uses memory cached by `stream` to back the + Uploads `graphExec` to the device in `stream` without executing it. + Uploads of the same `graphExec` will be serialized. Each upload is + ordered behind both any previous work in `stream` and any previous + launches of `graphExec`. Uses memory cached by `stream` to back the allocations owned by `graphExec`. Parameters ---------- - hGraphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` + graphExec : :py:obj:`~.CUgraphExec` or :py:obj:`~.cudaGraphExec_t` Executable graph to upload - hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + stream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` Stream in which to upload the graph Returns @@ -38547,10 +38463,17 @@ def cudaDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[cudaDevResou - `flags:` - - `cudaDevSmResourceGroupBackfill:` lets `smCount` be a non-multiple of - `coscheduledSmCount`, filling the difference between SM count and - already assigned co-scheduled groupings with other SMs. This lets any - resulting group behave similar to the `remainder` group for example. + - `cudaDevSmResourceGroupBackfill:` Treats constraints as a hint, + ignoring them if necessary to reach the requested `smCount`. Lets + `smCount` be a non-multiple of `coscheduledSmCount`, filling the + difference between SM count and already assigned co-scheduled groupings + with other SMs. This lets any resulting group behave similar to the + `remainder` group for example. When used with + `cudaDevSmResourceGroupLocalityDomainId`, backfill fills up to the + requested `smCount` using the target locality domain first, then SMs + not attributed to any locality domain, then SMs from other locality + domains. If no SMs can be found in the requested locality domain, + :py:obj:`~.cudaErrorInvalidResourceConfiguration` is returned. Example params and their effect: diff --git a/cuda_bindings/docs/source/module/driver.rst b/cuda_bindings/docs/source/module/driver.rst index 8d9490f54a7..37fb0e9cecd 100644 --- a/cuda_bindings/docs/source/module/driver.rst +++ b/cuda_bindings/docs/source/module/driver.rst @@ -1,7 +1,8 @@ .. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. .. SPDX-License-Identifier: Apache-2.0 -.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=15f77ea651a2deffa7f7ae710189546cff9c23ba311b693207743eaf339a0a9c +.. !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=97724cda94bae86a54d6cf1205fbed172482bf03a3231089ab976da3c0b7299d ------ driver ------ @@ -86,6 +87,8 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUDA_EVENT_RECORD_NODE_PARAMS_st .. autoclass:: cuda.bindings.driver.CUDA_EVENT_WAIT_NODE_PARAMS_st .. autoclass:: cuda.bindings.driver.CUgraphNodeParams_st +.. autoclass:: cuda.bindings.driver.CUcheckpointCustomStoragePerDeviceData_st +.. autoclass:: cuda.bindings.driver.CUcheckpointCustomStorageInfo_st .. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs_st .. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs_st .. autoclass:: cuda.bindings.driver.CUcheckpointGpuPair_st @@ -1921,6 +1924,18 @@ Data types used by CUDA driver Device supports atomic reduction operations in stream batch memory operations + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_COUNT + + + Number of locality domains + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX_OVERSIZED_SHARED_MEMORY_PER_BLOCK + + + Maximum oversized shared memory per block + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED @@ -1957,6 +1972,24 @@ Data types used by CUDA driver Device supports unicast logical endpoint access on the owner device + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT + + + Number of multiprocessors on each locality domain + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_SUPPORTED_HANDLE_TYPES + + + Handle types supported with logical endpoint IPC + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED + + + Device supports GPUDirect RDMA with localized memory using the default RDMA mapping link + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_MAX .. autoclass:: cuda.bindings.driver.CUpointer_attribute @@ -2086,6 +2119,12 @@ Data types used by CUDA driver Returns in ``*data`` a boolean that indicates whether the pointer points to memory that is capable to be used for hardware accelerated decompression. + + .. autoattribute:: cuda.bindings.driver.CUpointer_attribute.CU_POINTER_ATTRIBUTE_LOCALITY_DOMAIN_ORDINAL + + + Returns in ``*data`` an integer representing the locality domain ordinal of the memory allocation, or -1 if the allocation is not localized to a locality domain. + .. autoclass:: cuda.bindings.driver.CUfunction_attribute .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX_THREADS_PER_BLOCK @@ -2139,19 +2178,43 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX_DYNAMIC_SHARED_SIZE_BYTES - The maximum size in bytes of dynamically-allocated shared memory that can be used by this function. If the user-specified dynamic shared memory size is larger than this value, the launch will fail. The default value of this attribute is :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK` - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`, except when :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES` is greater than :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`, then the default value of this attribute is 0. The value can be increased to :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + The maximum size in bytes of dynamically-allocated shared memory that can be used by this function. If the user-specified dynamic shared memory size is larger than this value, the launch will fail. + + + + The default value of this attribute is :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK` - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`, except when :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES` is greater than :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK`, then the default value of this attribute is 0. The value can be increased to :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` - :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_SIZE_BYTES`. + + + + This attribute is ignored if :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE` or :py:obj:`~.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE` is set. + + + + This attribute cannot be used to access oversized shared memory. Oversized shared memory can only be accessed by setting :py:obj:`~.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE` or :py:obj:`~.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE`. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_PREFERRED_SHARED_MEMORY_CARVEOUT - On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. Refer to :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`. This is only a hint, and the driver can choose a different ratio if required to execute the function. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + On devices where the L1 cache and shared memory use the same hardware resources, this sets the shared memory carveout preference, in percent of the total shared memory. Refer to :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_MULTIPROCESSOR`. This is only a hint, and the driver can choose a different ratio if required to execute the function. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CLUSTER_SIZE_MUST_BE_SET - If this attribute is set, the kernel must launch with a valid cluster size specified. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + If this attribute is set, the kernel must launch with a valid cluster size specified. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_WIDTH @@ -2161,7 +2224,11 @@ Data types used by CUDA driver - If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + If the value is set during compile time, it cannot be set at runtime. Setting it at runtime will return CUDA_ERROR_NOT_PERMITTED. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_HEIGHT @@ -2171,7 +2238,11 @@ Data types used by CUDA driver - If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_REQUIRED_CLUSTER_DEPTH @@ -2181,7 +2252,11 @@ Data types used by CUDA driver - If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + If the value is set during compile time, it cannot be set at runtime. Setting it at runtime should return CUDA_ERROR_NOT_PERMITTED. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_NON_PORTABLE_CLUSTER_SIZE_ALLOWED @@ -2203,19 +2278,41 @@ Data types used by CUDA driver - The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + The specific hardware unit may support higher cluster sizes that’s not guaranteed to be portable. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_CLUSTER_SCHEDULING_POLICY_PREFERENCE - The block scheduling policy of a function. The value type is :py:obj:`~.CUclusterSchedulingPolicy` / cudaClusterSchedulingPolicy. See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` + The block scheduling policy of a function. The value type is :py:obj:`~.CUclusterSchedulingPolicy` / cudaClusterSchedulingPolicy. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_DEVICE_NODE_UPDATE_SUPPORTED - Whether the function can be updated on device. 1 means device node update is supported, 0 is unsupported. See :py:obj:`~.cuFuncGetAttribute`. + Whether the function can be updated on device. 1 means device node update is supported, 0 is unsupported. + + + + See :py:obj:`~.cuFuncGetAttribute`. + + + .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_SHARED_MEMORY_MODE + + + The shared memory mode of a function. The value type is :py:obj:`~.CUsharedMemoryMode` / cudaSharedMemoryMode. + + + + See :py:obj:`~.cuFuncSetAttribute`, :py:obj:`~.cuKernelSetAttribute` .. autoattribute:: cuda.bindings.driver.CUfunction_attribute.CU_FUNC_ATTRIBUTE_MAX @@ -2907,6 +3004,12 @@ Data types used by CUDA driver Compute device class 10.3. + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_107 + + + Compute device class 10.7. + + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_120 @@ -2940,6 +3043,9 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_103A + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_107A + + Compute device class 12.0. with accelerated features. @@ -2970,6 +3076,9 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_103F + .. autoattribute:: cuda.bindings.driver.CUjit_target.CU_TARGET_COMPUTE_107F + + Compute device class 12.0. with family features. @@ -3192,6 +3301,12 @@ Data types used by CUDA driver When set to zero, CUDA will fail to launch a kernel on a CIG context, instead of using the fallback path, if the kernel uses more shared memory than available + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_PER_BLOCK_MEMORY_SIZE + + + Per-block memory size + + .. autoattribute:: cuda.bindings.driver.CUlimit.CU_LIMIT_MAX .. autoclass:: cuda.bindings.driver.CUresourcetype @@ -3387,7 +3502,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUgraphDependencyType.CU_GRAPH_DEPENDENCY_TYPE_PROGRAMMATIC - This dependency type allows the downstream node to use ``cudaGridDependencySynchronize()``. It may only be used between kernel nodes, and must be used with either the :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC` or :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER` outgoing port. + This dependency type allows the downstream node to use cudaGridDependencySynchronize(). It may only be used between kernel nodes, and must be used with either the :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_PROGRAMMATIC` or :py:obj:`~.CU_GRAPH_KERNEL_NODE_PORT_LAUNCH_ORDER` outgoing port. .. autoclass:: cuda.bindings.driver.CUgraphInstantiateResult @@ -3458,6 +3573,9 @@ Data types used by CUDA driver allow the hardware to load-balance the blocks in a cluster to the SMs + + .. autoattribute:: cuda.bindings.driver.CUclusterSchedulingPolicy.CU_CLUSTER_SCHEDULING_POLICY_RUBIN_DSMEM_LOCALITY + .. autoclass:: cuda.bindings.driver.CUlaunchMemSyncDomain .. autoattribute:: cuda.bindings.driver.CUlaunchMemSyncDomain.CU_LAUNCH_MEM_SYNC_DOMAIN_DEFAULT @@ -3509,6 +3627,18 @@ Data types used by CUDA driver Specifies that the dynamic shared size bytes requested may be a non-portable size but still within the bounds of :py:obj:`~.CU_DEVICE_ATTRIBUTE_MAX_SHARED_MEMORY_PER_BLOCK_OPTIN` + + .. autoattribute:: cuda.bindings.driver.CUsharedMemoryMode.CU_SHARED_MEMORY_MODE_ALLOW_OVERSIZED_SHARED_MEMORY + + + Specifies that oversized shared memory configurations may be used (with the limitation of only 8kB L1 cache) + + + .. autoattribute:: cuda.bindings.driver.CUsharedMemoryMode.CU_SHARED_MEMORY_MODE_PREFER_OVERSIZED_SHARED_MEMORY + + + Specifies that oversized shared memory configurations may be used (with the limitation of only 8kB L1 cache), and prefer an oversized shared memory configuration + .. autoclass:: cuda.bindings.driver.CUlaunchAttributeID .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_IGNORE @@ -3642,7 +3772,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUlaunchAttributeID.CU_LAUNCH_ATTRIBUTE_SHARED_MEMORY_MODE - Valid for graph nodes, launches. This indicates if the kernel is allowed to use a non-portable dynamic shared memory mode. + Valid for graph nodes, launches. This controls a kernel's use of non-portable or oversized shared memory configurations. .. autoclass:: cuda.bindings.driver.CUstreamCaptureStatus @@ -3828,6 +3958,12 @@ Data types used by CUDA driver This indicates that requested CUDA device is unavailable at the current time. Devices are often unavailable due to use of :py:obj:`~.CU_COMPUTEMODE_EXCLUSIVE_PROCESS` or :py:obj:`~.CU_COMPUTEMODE_PROHIBITED`. + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_MULTICAST_RESOURCE_FULL + + + The API call failed because of a hardware resource required to bind memory to a multicast object is unavailable. + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_NO_DEVICE @@ -3998,6 +4134,12 @@ Data types used by CUDA driver This indicates that an exception occurred on the device that is now contained by the GPU's error containment capability. Common causes are - a. Certain types of invalid accesses of peer GPU memory over nvlink b. Certain classes of hardware errors This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched. + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INSUFFICIENT_LOADER_VERSION + + + This indicates that the Loader version is insufficient for fatbin + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_INVALID_SOURCE @@ -4370,6 +4512,12 @@ Data types used by CUDA driver This error indicates that a graph recapture failed and had to be terminated. + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_FABRIC_NOT_READY + + + The GPU fabric is not ready within the bounded wait while the fabric manager probe is still in progress (or not converging in time). Applications may retry after a delay; for the initialization wait budget, see environment variables such as CUDA_FABRIC_INIT_TIMEOUT_MS. The CUDA Runtime uses the same value as :py:obj:`~.cudaErrorFabricNotReady`. + + .. autoattribute:: cuda.bindings.driver.CUresult.CUDA_ERROR_UNKNOWN @@ -4963,6 +5111,12 @@ Data types used by CUDA driver Location is not visible but device is accessible, id is always CU_DEVICE_INVALID + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN + + + Location is a portion of device memory, specified by the locality domain ID. + + .. autoattribute:: cuda.bindings.driver.CUmemLocationType.CU_MEM_LOCATION_TYPE_MAX .. autoclass:: cuda.bindings.driver.CUmemAllocationType @@ -5195,6 +5349,16 @@ Data types used by CUDA driver (value type = int) Indicates whether the pool has hardware compresssion enabled + + .. autoattribute:: cuda.bindings.driver.CUmemPool_attribute.CU_MEMPOOL_ATTR_LOCALITY_DOMAIN_ID + + + (value type = int) The locality domain ID for the mempool, if the mempool is localized to a locality domain. A value of -1 indicates that the mempool is not localized. + + + + Note: On devices with a single locality domain, mempools created with :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN` and localityDomainId 0 are equivalent to full-device mempools created with :py:obj:`~.CU_MEM_LOCATION_TYPE_DEVICE`. The value of this attribute will be -1 for such mempools. + .. autoclass:: cuda.bindings.driver.CUmemcpyFlags .. autoattribute:: cuda.bindings.driver.CUmemcpyFlags.CU_MEMCPY_FLAG_DEFAULT @@ -5523,6 +5687,18 @@ Data types used by CUDA driver Application entered an uncorrectable error during the checkpoint/restore process + + .. autoattribute:: cuda.bindings.driver.CUprocessState.CU_PROCESS_STATE_CHECKPOINTING + + + Application memory contents are being checkpointed + + + .. autoattribute:: cuda.bindings.driver.CUprocessState.CU_PROCESS_STATE_RESTORING + + + Application memory contents are being restored + .. autoclass:: cuda.bindings.driver.CUeglFrameType .. autoattribute:: cuda.bindings.driver.CUeglFrameType.CU_EGL_FRAME_TYPE_ARRAY @@ -6420,6 +6596,9 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUDA_EVENT_RECORD_NODE_PARAMS .. autoclass:: cuda.bindings.driver.CUDA_EVENT_WAIT_NODE_PARAMS .. autoclass:: cuda.bindings.driver.CUgraphNodeParams +.. autoclass:: cuda.bindings.driver.CUcheckpointCustomStoragePerDeviceData +.. autoclass:: cuda.bindings.driver.CUcheckpointOperationHandle +.. autoclass:: cuda.bindings.driver.CUcheckpointCustomStorageInfo .. autoclass:: cuda.bindings.driver.CUcheckpointLockArgs .. autoclass:: cuda.bindings.driver.CUcheckpointCheckpointArgs .. autoclass:: cuda.bindings.driver.CUcheckpointGpuPair @@ -6562,6 +6741,10 @@ Data types used by CUDA driver This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression. +.. autoattribute:: cuda.bindings.driver.CU_MEM_CREATE_USAGE_GPU_DIRECT_RDMA_OVER_PCIE + + Setting this flag forces GPUDirect RDMA on a locality-domain-localized allocation to use the PCIe (BAR1) path, allowing the allocation to remain locality-domain localized on platforms where the platform-coherent RDMA path does not support localized allocations. Because on some platforms the PCIe bandwidth is limited, using this flag may result in lower RDMA bandwidth than the default RDMA mapping link. Note that this flag does not itself force PCIe to be used, and that this must be done when creating the RDMA export. :py:obj:`~.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED` indicates whether this flag is needed to create GPUDirect RDMA capable localized memory allocations. This flag is only valid if gpuDirectRDMACapable is set. + .. autoattribute:: cuda.bindings.driver.CU_MEM_POOL_CREATE_USAGE_HW_DECOMPRESS This flag, if set, indicates that the memory will be used as a buffer for hardware accelerated decompression. @@ -7085,6 +7268,46 @@ Support for multicast on a specific device can be queried using the device attri .. autofunction:: cuda.bindings.driver.cuMulticastUnbind .. autofunction:: cuda.bindings.driver.cuMulticastGetGranularity +Fabric Clique Information +------------------------- + +MANBRIEF low-level CUDA driver application programming interface to retrieve fabric clique information. API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes functions and data structures to retrieve fabric clique information. + +.. autoclass:: cuda.bindings.driver.CUcliqueInfo_st +.. autoclass:: cuda.bindings.driver.CUcliqueType + + .. autoattribute:: cuda.bindings.driver.CUcliqueType.CU_CLIQUE_TYPE_UNICAST_POINTER + + + Unicast pointer clique + + + .. autoattribute:: cuda.bindings.driver.CUcliqueType.CU_CLIQUE_TYPE_MULTICAST_POINTER + + + Multicast pointer clique + + + .. autoattribute:: cuda.bindings.driver.CUcliqueType.CU_CLIQUE_TYPE_UNICAST_LOGICAL_ENDPOINT + + + Unicast logical endpoint clique + + + .. autoattribute:: cuda.bindings.driver.CUcliqueType.CU_CLIQUE_TYPE_MULTICAST_LOGICAL_ENDPOINT + + + Multicast logical endpoint clique + +.. autoclass:: cuda.bindings.driver.CUcliqueInfo +.. autofunction:: cuda.bindings.driver.cuDeviceGetFabricClusterUuid +.. autofunction:: cuda.bindings.driver.cuDeviceGetCliqueCount +.. autofunction:: cuda.bindings.driver.cuDeviceGetCliqueInfo + Logical Endpoint ---------------- @@ -7215,6 +7438,7 @@ This device address may be queried using cuMemHostGetDevicePointer() when a cont .. autofunction:: cuda.bindings.driver.cuMemPrefetchBatchAsync .. autofunction:: cuda.bindings.driver.cuMemDiscardBatchAsync .. autofunction:: cuda.bindings.driver.cuMemDiscardAndPrefetchBatchAsync +.. autofunction:: cuda.bindings.driver.cuMemGetLocationInfo .. autofunction:: cuda.bindings.driver.cuMemRangeGetAttribute .. autofunction:: cuda.bindings.driver.cuMemRangeGetAttributes .. autofunction:: cuda.bindings.driver.cuPointerSetAttribute @@ -7478,7 +7702,9 @@ This section describes the graph management functions of the low-level CUDA driv .. autofunction:: cuda.bindings.driver.cuGraphRetainUserObject .. autofunction:: cuda.bindings.driver.cuGraphReleaseUserObject .. autofunction:: cuda.bindings.driver.cuGraphAddNode +.. autofunction:: cuda.bindings.driver.cuGraphAddNode_v3 .. autofunction:: cuda.bindings.driver.cuGraphNodeSetParams +.. autofunction:: cuda.bindings.driver.cuGraphNodeSetParams_v2 .. autofunction:: cuda.bindings.driver.cuGraphNodeGetParams .. autofunction:: cuda.bindings.driver.cuGraphExecNodeSetParams .. autofunction:: cuda.bindings.driver.cuGraphConditionalHandleCreate @@ -7734,6 +7960,22 @@ SMs There are two possible partition operations - with cuDevSmResourceSplitByCount the partitions created have to follow default SM count granularity requirements, so it will often be rounded up and aligned to a default value. On the other hand, cuDevSmResourceSplit is explicit and allows for creation of non-equal groups. It will not round up automatically - instead it is the developer’s responsibility to query and set the correct values. These requirements can be queried with cuDeviceGetDevResource to determine the alignment granularity (sm.smCoscheduledAlignment). A general guideline on the default values for each compute architecture: +- On all architectures, + + + + + + - Portable code should set smCount to a multiple of the device's alignment granularity (sm.smCoscheduledAlignment). + + + + + + + + + - On Compute Architecture 7.X, 8.X, and all Tegra SoC: @@ -7764,15 +8006,17 @@ There are two possible partition operations - with cuDevSmResourceSplitByCount t - - The smCount must be a multiple of 8, or coscheduledSmCount if provided. + - The smCount must be a multiple of coscheduledSmCount if provided. + + + - The alignment is 8. - - The alignment (and default value of coscheduledSmCount) is 8. While the maximum value for coscheduled SM count is 32 on all Compute Architecture 9.0+, it's recommended to follow cluster size requirements. The portable cluster size and the max cluster size should be used in order to benefit from this co-scheduling. @@ -7784,6 +8028,8 @@ There are two possible partition operations - with cuDevSmResourceSplitByCount t +While the maximum value for coscheduled SM count is 32 on all Compute Architecture 9.0+, it's recommended to follow cluster size requirements. The portable cluster size and the max cluster size should be used in order to benefit from this co-scheduling. + @@ -7848,6 +8094,26 @@ Additionally, there are two known scenarios, where its possible for the workload - On Compute Architecture 9.x: When a module with dynamic parallelism (CDP) is loaded, all future kernels running under green contexts may use and share an additional set of 2 SMs. + + + + + + + + + + + + +Memory Copy Operations + + + + + +Green context restrictions apply to memory copy operations only when the copy is performed using a green context. For cross-device copies, green context restrictions may not be applied. + .. autoclass:: cuda.bindings.driver.CUdevSmResource_st .. autoclass:: cuda.bindings.driver.CUdevWorkqueueConfigResource_st .. autoclass:: cuda.bindings.driver.CUdevWorkqueueResource_st @@ -7875,6 +8141,12 @@ Additionally, there are two known scenarios, where its possible for the workload .. autoattribute:: cuda.bindings.driver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_BACKFILL + + .. autoattribute:: cuda.bindings.driver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID + + + The SMs must be located on a specific locality domain, specified by localityDomainId + .. autoclass:: cuda.bindings.driver.CUdevSmResourceSplitByCount_flags .. autoattribute:: cuda.bindings.driver.CUdevSmResourceSplitByCount_flags.CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING @@ -7994,6 +8266,7 @@ Checkpoint and restore capabilities are currently restricted to Linux. .. autofunction:: cuda.bindings.driver.cuCheckpointProcessLock .. autofunction:: cuda.bindings.driver.cuCheckpointProcessCheckpoint .. autofunction:: cuda.bindings.driver.cuCheckpointProcessRestore +.. autofunction:: cuda.bindings.driver.cuCheckpointOperationComplete .. autofunction:: cuda.bindings.driver.cuCheckpointProcessUnlock Profiler Control diff --git a/cuda_bindings/docs/source/module/nvrtc.rst b/cuda_bindings/docs/source/module/nvrtc.rst index c879f49dc88..50adf9c0796 100644 --- a/cuda_bindings/docs/source/module/nvrtc.rst +++ b/cuda_bindings/docs/source/module/nvrtc.rst @@ -1,7 +1,8 @@ .. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. .. SPDX-License-Identifier: Apache-2.0 -.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9f44170e12fd85fa04fcd599a18d0b6474ec7920be8f28a5c097000eb3ccb0e0 +.. !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fee6293eae318e5fe3f5cf200d625a833f48885f5cbaf2d6ae3c596d9312f670 ----- nvrtc ----- @@ -416,6 +417,26 @@ Enables (disables) the contraction of floating-point multiplies and adds/subtrac + - ``--fno-signed-zeros`` (``-fno-signed-zeros``) + +This option instructs the optimizer not to distinguish between +-0. + + + + + + + + - ``--ffinite-math-only`` (``-ffinite-math-only``) + +This option instructs the optimizer to assume that values are not nan or +-inf. + + + + + + + - ``--use_fast_math`` (``-use_fast_math``) Make use of fast math operations. ``--use_fast_math`` implies ``--ftz=true`` ``--prec-div=false`` ``--prec-sqrt=false`` ``--fmad=true``. @@ -594,9 +615,9 @@ The preprocessor by default adds the directory of each input sources to the incl - - ``--std={c++03|c++11|c++14|c++17|c++20}`` (``-std``) + - ``--std={c++03|c++11|c++14|c++17|c++20|c++23}`` (``-std``) -Set language dialect to C++03, C++11, C++14, C++17 or C++20 +Set language dialect to C++03, C++11, C++14, C++17, C++20, or C++23 @@ -730,6 +751,16 @@ Generate warnings when member initializers are reordered. + - ``--Wconversion`` (``-Wconversion``) + +Generate a warning when an implicit numeric conversion may narrow the value in the target type (e.g. ``long`` ``long`` narrowed to ``int``) + + + + + + + - ``--warning-as-error=`` ,... (``-Werror``) Make warnings of the specified kinds into errors. The following is the list of warning kinds accepted by this option: @@ -740,6 +771,16 @@ Make warnings of the specified kinds into errors. The following is the list of w + - ``--fmax-errors=`` (``-fmax-errors``) + +Specify the maximum number of errors to emit before compilation is aborted; must be greater than 0. + + + + + + + - ``--restrict`` (``-restrict``) Programmer assertion that all kernel pointer parameters are restrict pointers. @@ -902,3 +943,13 @@ Enable stack canaries in device code. Stack canaries make it more difficult to e - ``--fdevice-time-trace=`` (``-fdevice-time-trace=``) Enables the time profiler, outputting a JSON file based on given . Results can be analyzed on chrome://tracing for a flamegraph visualization. + + + + + + + - ``--utf-8`` (``-utf-8``) + +Set the source and execution character set to UTF-8 on platforms where that isn't already the default. + diff --git a/cuda_bindings/docs/source/module/runtime.rst b/cuda_bindings/docs/source/module/runtime.rst index 80b11f16644..a7c12f9dfdf 100644 --- a/cuda_bindings/docs/source/module/runtime.rst +++ b/cuda_bindings/docs/source/module/runtime.rst @@ -1,7 +1,8 @@ .. SPDX-FileCopyrightText: Copyright (c) 2021-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. .. SPDX-License-Identifier: Apache-2.0 -.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0eccd5db44f7406acb693f5dd95ad2fa17c787c11659578cf54e116eb0b06e01 +.. !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=aeabf4d9caf54446607e921c2143746c4bdc69ab464e319ee0091fdce702280f ------- runtime ------- @@ -545,6 +546,12 @@ Data types used by CUDA Runtime This indicates that an exception occurred on the device that is now contained by the GPU's error containment capability. Common causes are - a. Certain types of invalid accesses of peer GPU memory over nvlink b. Certain classes of hardware errors This leaves the process in an inconsistent state and any further CUDA work will return the same error. To continue using CUDA, the process must be terminated and relaunched. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInsufficientLoaderVersion + + + This indicates that loader version is insufficient for Fatbin + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorInvalidSource @@ -911,6 +918,12 @@ Data types used by CUDA Runtime This error indicates that a graph recapture failed and had to be terminated. + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorFabricNotReady + + + This error indicates GPU fabric is not ready within the bounded wait while the fabric manager probe is still in progress. Applications may retry after a delay; for the initialization wait budget, see environment variables such as CUDA_FABRIC_INIT_TIMEOUT_MS. + + .. autoattribute:: cuda.bindings.runtime.cudaError_t.cudaErrorUnknown @@ -1351,6 +1364,9 @@ Data types used by CUDA Runtime allow the hardware to load-balance the blocks in a cluster to the SMs + + .. autoattribute:: cuda.bindings.runtime.cudaClusterSchedulingPolicy.cudaClusterSchedulingPolicyRubinDsmemLocality + .. autoclass:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags .. autoattribute:: cuda.bindings.runtime.cudaStreamUpdateCaptureDependenciesFlags.cudaStreamAddCaptureDependencies @@ -1727,6 +1743,18 @@ Data types used by CUDA Runtime Specifies that the shared memory size requested may be a non-portable size up to :py:obj:`~.cudaDevAttrMaxSharedMemoryPerBlockOptin` + + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModeAllowOversizedSharedMemory + + + Specifies that oversized shared memory configurations may be used (with the limitation of only 8kB L1 cache) + + + .. autoattribute:: cuda.bindings.runtime.cudaSharedMemoryMode.cudaSharedMemoryModePreferOversizedSharedMemory + + + Specifies that oversized shared memory configurations may be used (with the limitation of only 8kB L1 cache), and prefer an oversized shared memory configuration + .. autoclass:: cuda.bindings.runtime.cudaFuncAttribute .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMaxDynamicSharedMemorySize @@ -1777,6 +1805,12 @@ Data types used by CUDA Runtime Required cluster scheduling policy preference + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeSharedMemoryMode + + + Setting that controls a kernel's use of non-portable or oversized shared memory configurations + + .. autoattribute:: cuda.bindings.runtime.cudaFuncAttribute.cudaFuncAttributeMax .. autoclass:: cuda.bindings.runtime.cudaFuncCache @@ -1901,6 +1935,12 @@ Data types used by CUDA Runtime A size in bytes for L2 persisting lines cache size + + .. autoattribute:: cuda.bindings.runtime.cudaLimit.cudaLimitPerBlockMemorySize + + + Per-block memory size + .. autoclass:: cuda.bindings.runtime.cudaMemoryAdvise .. autoattribute:: cuda.bindings.runtime.cudaMemoryAdvise.cudaMemAdviseSetReadMostly @@ -2830,12 +2870,30 @@ Data types used by CUDA Runtime Device supports atomic reduction operations in stream batch memory operations + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrLocalityDomainCount + + + Number of locality domains + + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrOversizedSharedMemoryPerBlock + + + The maximum oversized shared memory per block. This value may vary by chip. See :py:obj:`~.cudaFuncSetAttribute` + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrCigStreamsSupported Device supports CIG streams + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrLocalityDomainMultiprocessorCount + + + Number of multiprocessors on each locality domain + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMax .. autoclass:: cuda.bindings.runtime.cudaMemPoolAttr @@ -2923,6 +2981,12 @@ Data types used by CUDA Runtime (value type = int) Indicates whether the pool has hardware compresssion enabled + + .. autoattribute:: cuda.bindings.runtime.cudaMemPoolAttr.cudaMemPoolAttrLocalityDomainId + + + (value type = int) The locality domain id for the mempool, if the mempool is localized to a locality domain. A value of -1 indicates that the mempool is not localized to a locality domain. + .. autoclass:: cuda.bindings.runtime.cudaMemLocationType .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeInvalid @@ -2963,6 +3027,12 @@ Data types used by CUDA Runtime Location is not visible but device is accessible, id is always cudaInvalidDeviceId + + .. autoattribute:: cuda.bindings.runtime.cudaMemLocationType.cudaMemLocationTypeDeviceLocalityDomain + + + Location is a portion of device memory, specified by the locality domain ID + .. autoclass:: cuda.bindings.runtime.cudaMemAccessFlags .. autoattribute:: cuda.bindings.runtime.cudaMemAccessFlags.cudaMemAccessFlagsProtNone @@ -3322,7 +3392,13 @@ Data types used by CUDA Runtime .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupBackfill - Lets smCount be a non-multiple of minCoscheduledCount, filling the difference with other SMs. + Treats constraints as a hint, ignoring them if necessary to reach the requested smCount. Lets smCount be a non-multiple of coscheduledSmCount, filling the difference between SM count and already assigned co-scheduled groupings with other SMs. When used with cudaDevSmResourceGroupLocalityDomainId, backfill fills up to the requested smCount using the target locality domain first, then SMs not attributed to any locality domain, then SMs from other locality domains. If no SMs can be found in the requested locality domain, cudaErrorInvalidResourceConfiguration is returned. + + + .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupLocalityDomainId + + + The SMs must be located on a specific locality domain, specified by localityDomainId .. autoclass:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags @@ -4185,7 +4261,7 @@ Data types used by CUDA Runtime Valid for graph nodes, launches. This attribute is graphs-only, and passing it to a launch in a non-capturing stream will result in an error. - :cudaLaunchAttributeValue::deviceUpdatableKernelNode::deviceUpdatable can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via :py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode` which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`. + :py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.deviceUpdatable` can only be set to 0 or 1. Setting the field to 1 indicates that the corresponding kernel node should be device-updatable. On success, a handle will be returned via :py:obj:`~.cudaLaunchAttributeValue.deviceUpdatableKernelNode.devNode` which can be passed to the various device-side update functions to update the node's kernel parameters from within another kernel. For more information on the types of device updates that can be made, as well as the relevant limitations thereof, see :py:obj:`~.cudaGraphKernelNodeUpdatesApply`. Nodes which are device-updatable have additional restrictions compared to regular kernel nodes. Firstly, device-updatable nodes cannot be removed from their graph via :py:obj:`~.cudaGraphDestroyNode`. Additionally, once opted-in to this functionality, a node cannot opt out, and any attempt to set the deviceUpdatable attribute to 0 will result in an error. Device-updatable kernel nodes also cannot have their attributes copied to/from another kernel node via :py:obj:`~.cudaGraphKernelNodeCopyAttributes`. Graphs containing one or more device-updatable nodes also do not allow multiple instantiation, and neither the graph nor its instantiated version can be passed to :py:obj:`~.cudaGraphExecUpdate`. @@ -5649,6 +5725,7 @@ Some functions have overloaded C++ API template versions documented separately i .. autofunction:: cuda.bindings.runtime.cudaMemPrefetchBatchAsync .. autofunction:: cuda.bindings.runtime.cudaMemDiscardBatchAsync .. autofunction:: cuda.bindings.runtime.cudaMemDiscardAndPrefetchBatchAsync +.. autofunction:: cuda.bindings.runtime.cudaMemGetLocationInfo .. autofunction:: cuda.bindings.runtime.cudaMemAdvise .. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttribute .. autofunction:: cuda.bindings.runtime.cudaMemRangeGetAttributes @@ -6327,6 +6404,18 @@ Additionally, there are two known scenarios, where its possible for the workload - On Compute Architecture 9.x: When a module with dynamic parallelism (CDP) is loaded, all future kernels running under green contexts may use and share an additional set of 2 SMs. + + + + + + + + +Memory Copy Operations + +Green context restrictions apply to memory copy operations only when the copy is performed using a green context. For cross-device copies, green context restrictions may not be applied. + .. autofunction:: cuda.bindings.runtime.cudaDeviceGetDevResource .. autofunction:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount .. autofunction:: cuda.bindings.runtime.cudaDevSmResourceSplit diff --git a/cuda_bindings/tests/nvml/conftest.py b/cuda_bindings/tests/nvml/conftest.py index 9897420e38d..eece1d5c612 100644 --- a/cuda_bindings/tests/nvml/conftest.py +++ b/cuda_bindings/tests/nvml/conftest.py @@ -31,6 +31,8 @@ def device_info(): dev_count = None bus_id_to_board_details = {} + BoardCfg = namedtuple("BoardCfg", "name, ids_arr") + with NVMLInitializer(): dev_count = nvml.device_get_count_v2() @@ -40,22 +42,27 @@ def device_info(): dev = nvml.device_get_handle_by_index_v2(i) except nvml.NoPermissionError: continue - pci_info = nvml.device_get_pci_info_v3(dev) name = nvml.device_get_name(dev) # Get architecture name ex: Ampere, Kepler arch_id = nvml.device_get_architecture(dev) - BoardCfg = namedtuple("BoardCfg", "name, ids_arr") - board = BoardCfg(name, ids_arr=[(pci_info.pci_device_id, pci_info.pci_sub_system_id)]) + try: + pci_info = nvml.device_get_pci_info_v3(dev) + except nvml.NotSupportedError: + board = BoardCfg(name, ids_arr=[(-1, -1)]) + bus_id = "unknown" + device_id = i + else: + board = BoardCfg(name, ids_arr=[(pci_info.pci_device_id, pci_info.pci_sub_system_id)]) + bus_id = pci_info.bus_id + device_id = pci_info.device_ try: serial = nvml.device_get_serial(dev) except nvml.NvmlError: serial = None - bus_id = pci_info.bus_id - device_id = pci_info.device_ uuid = nvml.device_get_uuid(dev) BoardDetails = namedtuple("BoardDetails", "name, board, arch_id, bus_id, device_id, serial") @@ -138,10 +145,3 @@ def uuids(ngpus, handles): uuids = [nvml.device_get_uuid(handles[i]) for i in range(ngpus)] assert len(uuids) == ngpus return uuids - - -@pytest.fixture -def pci_info(ngpus, handles): - pci_info = [nvml.device_get_pci_info_v3(handles[i]) for i in range(ngpus)] - assert len(pci_info) == ngpus - return pci_info diff --git a/cuda_bindings/tests/nvml/test_cuda.py b/cuda_bindings/tests/nvml/test_cuda.py index 7a782e7403c..c0feedb0f8d 100644 --- a/cuda_bindings/tests/nvml/test_cuda.py +++ b/cuda_bindings/tests/nvml/test_cuda.py @@ -1,7 +1,6 @@ # SPDX-FileCopyrightText: Copyright (c) 2025-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. # SPDX-License-Identifier: Apache-2.0 -import os import pytest @@ -19,10 +18,15 @@ def get_nvml_device_names(): for idx in range(num_devices): handle = nvml.device_get_handle_by_index_v2(idx) name = nvml.device_get_name(handle) - info = nvml.device_get_pci_info_v3(handle) - assert isinstance(info.bus, int) + try: + info = nvml.device_get_pci_info_v3(handle) + except nvml.NotSupportedError: + bus_id = -1 + else: + bus_id = info.bus + assert isinstance(bus_id, int) assert isinstance(name, str) - result.append({"name": name, "id": info.bus}) + result.append({"name": name, "id": bus_id}) return result @@ -62,12 +66,11 @@ def test_cuda_device_order(): pytest.skip("Skipping test on Thor, which has non-standard device naming") return - if "CUDA_VISIBLE_DEVICES" not in os.environ: - # If that environment variable isn't set, the device lists should match exactly - assert cuda_devices == nvml_devices, "CUDA and NVML device lists do not match" - else: - # If the environment variable is set, there may possibly be fewer CUDA devices, - # and each of them should still be found in NVML devices. - assert len(cuda_devices) <= len(nvml_devices) - for cuda_device in cuda_devices: - assert cuda_device in nvml_devices, f"CUDA device {cuda_device} not found in NVML device list" + def compare(cuda_device, nvml_device): + return cuda_device["name"] == nvml_device["name"] and ( + nvml_device["id"] == -1 or cuda_device["id"] == nvml_device["id"] + ) + + assert len(cuda_devices) <= len(nvml_devices) + for cuda_device in cuda_devices: + assert any(compare(cuda_device, nvml_device) for nvml_device in nvml_devices) diff --git a/cuda_bindings/tests/nvml/test_device.py b/cuda_bindings/tests/nvml/test_device.py index 301bfca59d3..0d412ab24bd 100644 --- a/cuda_bindings/tests/nvml/test_device.py +++ b/cuda_bindings/tests/nvml/test_device.py @@ -28,8 +28,9 @@ def cuda_version_less_than(target): def test_device_capabilities(all_devices): for device in all_devices: - capabilities = nvml.device_get_capabilities(device) - assert isinstance(capabilities, int) + with unsupported_before(device, None): + capabilities = nvml.device_get_capabilities(device) + assert isinstance(capabilities, int) def test_clk_mon_status_t(): @@ -47,19 +48,20 @@ def test_current_clock_freqs(all_devices): def test_grid_licensable_features(all_devices): for device in all_devices: - features = nvml.device_get_grid_licensable_features_v4(device) - assert isinstance(features, nvml.GridLicensableFeatures) - # #define NVML_GRID_LICENSE_FEATURE_MAX_COUNT 3 - assert len(features.grid_licensable_features) <= 3 - assert not hasattr(features, "licensable_features_count") + with unsupported_before(device, None): + features = nvml.device_get_grid_licensable_features_v4(device) + assert isinstance(features, nvml.GridLicensableFeatures) + # #define NVML_GRID_LICENSE_FEATURE_MAX_COUNT 3 + assert len(features.grid_licensable_features) <= 3 + assert not hasattr(features, "licensable_features_count") - for feature in features.grid_licensable_features: - nvml.GridLicenseFeatureCode(feature.feature_code) - assert isinstance(feature.feature_state, int) - assert isinstance(feature.license_info, str) - assert isinstance(feature.product_name, str) - assert isinstance(feature.feature_enabled, int) - nvml.GridLicenseExpiry(feature.license_expiry) + for feature in features.grid_licensable_features: + nvml.GridLicenseFeatureCode(feature.feature_code) + assert isinstance(feature.feature_state, int) + assert isinstance(feature.license_info, str) + assert isinstance(feature.product_name, str) + assert isinstance(feature.feature_enabled, int) + nvml.GridLicenseExpiry(feature.license_expiry) def test_get_handle_by_uuidv(all_devices): @@ -84,8 +86,9 @@ def test_get_nv_link_supported_bw_modes(all_devices): def test_device_get_pdi(all_devices): for device in all_devices: - pdi = nvml.device_get_pdi(device) - assert isinstance(pdi, int) + with unsupported_before(device, None): + pdi = nvml.device_get_pdi(device) + assert isinstance(pdi, int) def test_device_get_performance_modes(all_devices): @@ -143,7 +146,7 @@ def test_get_power_management_limit(all_devices): def test_set_power_management_limit(all_devices): for device in all_devices: - with unsupported_before(device, nvml.DeviceArch.KEPLER): + with unsupported_before(device, None): try: nvml.device_set_power_management_limit_v2(device, nvml.PowerScope.GPU, 10000) except nvml.NoPermissionError: diff --git a/cuda_bindings/tests/nvml/test_pynvml.py b/cuda_bindings/tests/nvml/test_pynvml.py index 2d1029e9d9b..075f44b49b2 100644 --- a/cuda_bindings/tests/nvml/test_pynvml.py +++ b/cuda_bindings/tests/nvml/test_pynvml.py @@ -58,8 +58,15 @@ def test_device_get_handle_by_uuid(ngpus, uuids): assert len(handles) == ngpus -def test_device_get_handle_by_pci_bus_id(ngpus, pci_info): - handles = [nvml.device_get_handle_by_pci_bus_id_v2(pci_info[i].bus_id) for i in range(ngpus)] +def test_device_get_handle_by_pci_bus_id(ngpus): + pci_infos = [] + for i in range(ngpus): + handle = nvml.device_get_handle_by_index_v2(i) + with unsupported_before(handle, None): + pci_info = nvml.device_get_pci_info_v3(handle) + pci_infos.append(pci_info) + assert len(pci_infos) == ngpus + handles = [nvml.device_get_handle_by_pci_bus_id_v2(pci_infos[i].bus_id) for i in range(ngpus)] assert len(handles) == ngpus @@ -101,7 +108,12 @@ def test_device_get_p2p_status(handles, index): for h1 in handles: for h2 in handles: if h1 is not h2: - status = nvml.device_get_p2p_status(h1, h2, index) + try: + status = nvml.device_get_p2p_status(h1, h2, index) + except nvml.InvalidArgumentError: + # Some devices may not support all indices, and may + # raise InvalidArgumentError for unsupported ones. + continue assert nvml.GpuP2PStatus.P2P_STATUS_OK <= status <= nvml.GpuP2PStatus.P2P_STATUS_UNKNOWN diff --git a/cuda_bindings/tests/test_cuda.py b/cuda_bindings/tests/test_cuda.py index 192ad0f72fe..ec5448fd510 100644 --- a/cuda_bindings/tests/test_cuda.py +++ b/cuda_bindings/tests/test_cuda.py @@ -213,12 +213,9 @@ def test_cuda_repr(): value : 0 nvSciSync : fence : 0x0 - reserved : 0 keyedMutex : key : 0 - reserved : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] flags : 0 -reserved : [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0] """) assert actual_repr.split() == expected_repr.split() @@ -609,13 +606,11 @@ def test_eglFrame(): def test_char_range(): + # CUipcMemHandle_st is entirely a reserved[64] char array; verify it zero-initializes. val = cuda.CUipcMemHandle_st() - for x in range(-128, 0): - val.reserved = [x] * 64 - assert val.reserved[0] == 256 + x - for x in range(256): - val.reserved = [x] * 64 - assert val.reserved[0] == x + ptr = val.getPtr() + raw = (ctypes.c_uint8 * 64).from_address(ptr) + assert bytes(raw) == b"\x00" * 64 def test_anon_assign(): @@ -1008,7 +1003,9 @@ def test_cuGraphGetEdges_edgeData_outlives_call(device, ctx): assert ed.from_port == 0 assert ed.to_port == 0 assert int(ed.type) == 0 - assert ed.reserved == b"\x00" * 5 + # CUgraphEdgeData_st layout: from_port(1), to_port(1), type(1), reserved[5] + raw = (ctypes.c_uint8 * 8).from_address(ed.getPtr()) + assert bytes(raw[3:]) == b"\x00" * 5 finally: (err,) = cuda.cuGraphDestroy(graph) assert err == cuda.CUresult.CUDA_SUCCESS @@ -1048,7 +1045,9 @@ def test_cuGraphNodeGetDependencies_edgeData_outlives_call(device, ctx): assert ed.from_port == 0 assert ed.to_port == 0 assert int(ed.type) == 0 - assert ed.reserved == b"\x00" * 5 + # CUgraphEdgeData_st layout: from_port(1), to_port(1), type(1), reserved[5] + raw = (ctypes.c_uint8 * 8).from_address(ed.getPtr()) + assert bytes(raw[3:]) == b"\x00" * 5 finally: (err,) = cuda.cuGraphDestroy(graph) assert err == cuda.CUresult.CUDA_SUCCESS diff --git a/cuda_bindings/tests/test_cudart.py b/cuda_bindings/tests/test_cudart.py index ddb4448499b..f0f289170c4 100644 --- a/cuda_bindings/tests/test_cudart.py +++ b/cuda_bindings/tests/test_cudart.py @@ -294,7 +294,9 @@ def test_cudart_cudaGraphGetEdges_edgeData_outlives_call(): assert ed.from_port == 0 assert ed.to_port == 0 assert int(ed.type) == 0 - assert ed.reserved == b"\x00" * 5 + # cudaGraphEdgeData_st layout: from_port(1), to_port(1), type(1), reserved[5] + raw = (ctypes.c_uint8 * 8).from_address(ed.getPtr()) + assert bytes(raw[3:]) == b"\x00" * 5 finally: (err,) = cudart.cudaGraphDestroy(graph) assertSuccess(err) @@ -334,7 +336,9 @@ def test_cudart_cudaGraphNodeGetDependencies_edgeData_outlives_call(): assert ed.from_port == 0 assert ed.to_port == 0 assert int(ed.type) == 0 - assert ed.reserved == b"\x00" * 5 + # cudaGraphEdgeData_st layout: from_port(1), to_port(1), type(1), reserved[5] + raw = (ctypes.c_uint8 * 8).from_address(ed.getPtr()) + assert bytes(raw[3:]) == b"\x00" * 5 finally: (err,) = cudart.cudaGraphDestroy(graph) assertSuccess(err) diff --git a/cuda_core/cuda/core/_device.pyi b/cuda_core/cuda/core/_device.pyi index 14893fbd3c0..a086f0d2523 100644 --- a/cuda_core/cuda/core/_device.pyi +++ b/cuda_core/cuda/core/_device.pyi @@ -655,6 +655,10 @@ class Device: A tuple containing instances of available devices. """ + @classmethod + def _get_all_devices_from_cuda_driver(cls): + ... + def to_system_device(self) -> 'cuda.core.system.Device': """ Get the corresponding :class:`cuda.core.system.Device` (which is used diff --git a/cuda_core/cuda/core/_device.pyx b/cuda_core/cuda/core/_device.pyx index ea5bb62cc1b..fb2827ded55 100644 --- a/cuda_core/cuda/core/_device.pyx +++ b/cuda_core/cuda/core/_device.pyx @@ -1019,9 +1019,12 @@ class Device: tuple of Device A tuple containing instances of available devices. """ - from cuda.core import system - total = system.get_num_devices() - return tuple(cls(device_id) for device_id in range(total)) + return cls._get_all_devices_from_cuda_driver() + + @classmethod + def _get_all_devices_from_cuda_driver(cls): + Device_ensure_cuda_initialized() + return tuple(Device_ensure_tls_devices(cls)) def to_system_device(self) -> 'cuda.core.system.Device': """ diff --git a/cuda_core/cuda/core/system/_clock.pxi b/cuda_core/cuda/core/system/_clock.pxi index 56889e37d29..3b3db4e85b0 100644 --- a/cuda_core/cuda/core/system/_clock.pxi +++ b/cuda_core/cuda/core/system/_clock.pxi @@ -20,6 +20,8 @@ _CLOCKS_EVENT_REASONS_MAPPING = { nvml.ClocksEventReasons.THROTTLE_REASON_HW_THERMAL_SLOWDOWN: ClocksEventReasons.HW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN: ClocksEventReasons.HW_POWER_BRAKE_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_DISPLAY_CLOCK_SETTING: ClocksEventReasons.DISPLAY_CLOCK_SETTING, + getattr(nvml.ClocksEventReasons, "EVENT_REASON_BOARD_LIMIT", 0x200): ClocksEventReasons.BOARD_LIMIT, + getattr(nvml.ClocksEventReasons, "EVENT_REASON_RELIABILITY", 0x400): ClocksEventReasons.RELIABILITY, } diff --git a/cuda_core/cuda/core/system/_device.pyi b/cuda_core/cuda/core/system/_device.pyi index 0a51e5c9928..4e0fa8cbb88 100644 --- a/cuda_core/cuda/core/system/_device.pyi +++ b/cuda_core/cuda/core/system/_device.pyi @@ -1885,7 +1885,7 @@ class Device: An object containing the current utilization rates for the device. """ _CLOCK_ID_MAPPING = {ClockId.CURRENT: nvml.ClockId.CURRENT, ClockId.CUSTOMER_BOOST_MAX: nvml.ClockId.CUSTOMER_BOOST_MAX} -_CLOCKS_EVENT_REASONS_MAPPING = {nvml.ClocksEventReasons.EVENT_REASON_NONE: ClocksEventReasons.NONE, nvml.ClocksEventReasons.EVENT_REASON_GPU_IDLE: ClocksEventReasons.GPU_IDLE, nvml.ClocksEventReasons.EVENT_REASON_APPLICATIONS_CLOCKS_SETTING: ClocksEventReasons.APPLICATIONS_CLOCKS_SETTING, nvml.ClocksEventReasons.EVENT_REASON_SW_POWER_CAP: ClocksEventReasons.SW_POWER_CAP, nvml.ClocksEventReasons.THROTTLE_REASON_HW_SLOWDOWN: ClocksEventReasons.HW_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_SYNC_BOOST: ClocksEventReasons.SYNC_BOOST, nvml.ClocksEventReasons.EVENT_REASON_SW_THERMAL_SLOWDOWN: ClocksEventReasons.SW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_THERMAL_SLOWDOWN: ClocksEventReasons.HW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN: ClocksEventReasons.HW_POWER_BRAKE_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_DISPLAY_CLOCK_SETTING: ClocksEventReasons.DISPLAY_CLOCK_SETTING} +_CLOCKS_EVENT_REASONS_MAPPING = {nvml.ClocksEventReasons.EVENT_REASON_NONE: ClocksEventReasons.NONE, nvml.ClocksEventReasons.EVENT_REASON_GPU_IDLE: ClocksEventReasons.GPU_IDLE, nvml.ClocksEventReasons.EVENT_REASON_APPLICATIONS_CLOCKS_SETTING: ClocksEventReasons.APPLICATIONS_CLOCKS_SETTING, nvml.ClocksEventReasons.EVENT_REASON_SW_POWER_CAP: ClocksEventReasons.SW_POWER_CAP, nvml.ClocksEventReasons.THROTTLE_REASON_HW_SLOWDOWN: ClocksEventReasons.HW_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_SYNC_BOOST: ClocksEventReasons.SYNC_BOOST, nvml.ClocksEventReasons.EVENT_REASON_SW_THERMAL_SLOWDOWN: ClocksEventReasons.SW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_THERMAL_SLOWDOWN: ClocksEventReasons.HW_THERMAL_SLOWDOWN, nvml.ClocksEventReasons.THROTTLE_REASON_HW_POWER_BRAKE_SLOWDOWN: ClocksEventReasons.HW_POWER_BRAKE_SLOWDOWN, nvml.ClocksEventReasons.EVENT_REASON_DISPLAY_CLOCK_SETTING: ClocksEventReasons.DISPLAY_CLOCK_SETTING, getattr(nvml.ClocksEventReasons, 'EVENT_REASON_BOARD_LIMIT', 512): ClocksEventReasons.BOARD_LIMIT, getattr(nvml.ClocksEventReasons, 'EVENT_REASON_RELIABILITY', 1024): ClocksEventReasons.RELIABILITY} _CLOCK_TYPE_MAPPING = {ClockType.GRAPHICS: nvml.ClockType.CLOCK_GRAPHICS, ClockType.SM: nvml.ClockType.CLOCK_SM, ClockType.MEMORY: nvml.ClockType.CLOCK_MEM, ClockType.VIDEO: nvml.ClockType.CLOCK_VIDEO} _COOLER_CONTROL_MAPPING = {nvml.CoolerControl.THERMAL_COOLER_SIGNAL_TOGGLE: CoolerControl.TOGGLE, nvml.CoolerControl.THERMAL_COOLER_SIGNAL_VARIABLE: CoolerControl.VARIABLE} _COOLER_TARGET_MAPPING = {nvml.CoolerTarget.THERMAL_NONE: CoolerTarget.NONE, nvml.CoolerTarget.THERMAL_GPU: CoolerTarget.GPU, nvml.CoolerTarget.THERMAL_MEMORY: CoolerTarget.MEMORY, nvml.CoolerTarget.THERMAL_POWER_SUPPLY: CoolerTarget.POWER_SUPPLY} diff --git a/cuda_core/cuda/core/system/_device.pyx b/cuda_core/cuda/core/system/_device.pyx index 73f51cad8e3..fb4b9a3916d 100644 --- a/cuda_core/cuda/core/system/_device.pyx +++ b/cuda_core/cuda/core/system/_device.pyx @@ -106,6 +106,14 @@ _BRAND_TYPE_MAPPING = { } +if hasattr(nvml.BrandType, "BRAND_NVIDIA_DLA"): + _BRAND_TYPE_MAPPING.update({ + nvml.BrandType.BRAND_NVIDIA_DLA: "NVIDIA DLA", + nvml.BrandType.BRAND_NVIDIA_VGAMEDEV: "NVIDIA vGameDev", + nvml.BrandType.BRAND_NVIDIA_NPU: "NVIDIA NPU", + }) + + _GPU_P2P_CAPS_INDEX_MAPPING = { GpuP2PCapsIndex.READ: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_READ, GpuP2PCapsIndex.WRITE: nvml.GpuP2PCapsIndex.P2P_CAPS_INDEX_WRITE, @@ -141,7 +149,6 @@ _GPU_TOPOLOGY_LEVEL_MAPPING = { _GPU_TOPOLOGY_LEVEL_INV_MAPPING = {v: k for k, v in _GPU_TOPOLOGY_LEVEL_MAPPING.items()} - cdef class Device: """ Representation of a device. diff --git a/cuda_core/cuda/core/system/typing.py b/cuda_core/cuda/core/system/typing.py index 02246714a39..6ef9bcb2bc6 100644 --- a/cuda_core/cuda/core/system/typing.py +++ b/cuda_core/cuda/core/system/typing.py @@ -96,6 +96,8 @@ class ClocksEventReasons(StrEnum): HW_THERMAL_SLOWDOWN = "hw_thermal_slowdown" HW_POWER_BRAKE_SLOWDOWN = "hw_power_brake_slowdown" DISPLAY_CLOCK_SETTING = "display_clock_setting" + BOARD_LIMIT = "board_limit" + RELIABILITY = "reliability" class ClockType(StrEnum): diff --git a/cuda_core/examples/show_device_properties.py b/cuda_core/examples/show_device_properties.py index 566f6890948..dcfb716af1d 100644 --- a/cuda_core/examples/show_device_properties.py +++ b/cuda_core/examples/show_device_properties.py @@ -15,7 +15,7 @@ import sys -from cuda.core import Device, system +from cuda.core import Device # Convert boolean to YES or NO string @@ -219,11 +219,12 @@ def print_device_properties(properties): # Print info about all CUDA devices in the system def show_device_properties(): - ndev = system.get_num_devices() + devices = Device.get_all_devices() + ndev = len(devices) print(f"Number of GPUs: {ndev}") - for device_id in range(ndev): - device = Device(device_id) + for device in devices: + device_id = device.device_id print(f"DEVICE {device.name} (id={device_id})") device.set_current() diff --git a/cuda_core/examples/simple_multi_gpu_example.py b/cuda_core/examples/simple_multi_gpu_example.py index e4d7a1ccfb5..840051eb746 100644 --- a/cuda_core/examples/simple_multi_gpu_example.py +++ b/cuda_core/examples/simple_multi_gpu_example.py @@ -17,7 +17,7 @@ import cupy as cp -from cuda.core import Device, LaunchConfig, Program, ProgramOptions, launch, system +from cuda.core import Device, LaunchConfig, Program, ProgramOptions, launch dtype = cp.float32 size = 50000 @@ -35,7 +35,7 @@ def __cuda_stream__(self): def main(): - if system.get_num_devices() < 2: + if len(Device.get_all_devices()) < 2: print("this example requires at least 2 GPUs", file=sys.stderr) sys.exit(1) diff --git a/cuda_core/tests/system/test_system_device.py b/cuda_core/tests/system/test_system_device.py index b5fe8cccbfa..29246aa1ce4 100644 --- a/cuda_core/tests/system/test_system_device.py +++ b/cuda_core/tests/system/test_system_device.py @@ -16,6 +16,7 @@ import helpers import pytest +from cuda.core import Device as CudaDevice from cuda.core import system from cuda.core.system import typing @@ -132,7 +133,8 @@ def test_numa_node_id(): def test_device_cuda_compute_capability(): - for device in system.Device.get_all_devices(): + for cuda_device in CudaDevice.get_all_devices(): + device = cuda_device.to_system_device() cuda_compute_capability = device.cuda_compute_capability assert isinstance(cuda_compute_capability, tuple) assert len(cuda_compute_capability) == 2 @@ -310,11 +312,12 @@ def test_device_brand(): def test_device_pci_bus_id(): - for device in system.Device.get_all_devices(): + for cuda_device in CudaDevice.get_all_devices(): + device = cuda_device.to_system_device() pci_bus_id = device.pci_info.bus_id assert isinstance(pci_bus_id, str) - new_device = system.Device(pci_bus_id=device.pci_info.bus_id) + new_device = system.Device(pci_bus_id=pci_bus_id) assert new_device.index == device.index @@ -744,7 +747,8 @@ def test_pstates(): def test_compute_running_processes(): - for device in system.Device.get_all_devices(): + for cuda_device in CudaDevice.get_all_devices(): + device = cuda_device.to_system_device() with unsupported_before(device, "FERMI"): processes = device.compute_running_processes assert isinstance(processes, list) @@ -842,5 +846,5 @@ def test_uuid(): for device in system.Device.get_all_devices(): uuid = device.uuid assert isinstance(uuid, str) - assert uuid.startswith(("GPU-", "MIG-")) + assert uuid.startswith(("GPU-", "MIG-", "DLA-")) assert uuid == device.uuid diff --git a/cuda_core/tests/test_device.py b/cuda_core/tests/test_device.py index 6971911cec5..42c9b2cdf85 100644 --- a/cuda_core/tests/test_device.py +++ b/cuda_core/tests/test_device.py @@ -125,6 +125,19 @@ def test_name(): assert device.name == name.decode() +def test_get_all_devices_uses_cuda_driver_count(): + expected = handle_return(driver.cuDeviceGetCount()) + devices = Device.get_all_devices() + assert len(devices) == expected + assert [device.device_id for device in devices] == list(range(expected)) + + +def test_get_all_devices_does_not_create_context(deinit_cuda): + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + Device.get_all_devices() + assert int(handle_return(driver.cuCtxGetCurrent())) == 0 + + def test_compute_capability(): device = Device() major = handle_return( diff --git a/cuda_core/tests/test_enum_coverage.py b/cuda_core/tests/test_enum_coverage.py index 8de26b25d4b..00406aa8fbd 100644 --- a/cuda_core/tests/test_enum_coverage.py +++ b/cuda_core/tests/test_enum_coverage.py @@ -57,6 +57,7 @@ # We have some explicitly unsupported memory location types { "CU_MEM_LOCATION_TYPE_NONE", + "CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN", "CU_MEM_LOCATION_TYPE_HOST_NUMA_CURRENT", "CU_MEM_LOCATION_TYPE_INVISIBLE", "CU_MEM_LOCATION_TYPE_MAX", @@ -92,6 +93,9 @@ # We have some explicitly unsupported memory location types { "CU_MEM_LOCATION_TYPE_NONE", + # Requires a separate locality-domain id; cuda-core memory-resource + # options currently expose only device and host/NUMA placement. + "CU_MEM_LOCATION_TYPE_DEVICE_LOCALITY_DOMAIN", "CU_MEM_LOCATION_TYPE_INVISIBLE", "CU_MEM_LOCATION_TYPE_MAX", "CU_MEM_LOCATION_TYPE_INVALID", diff --git a/cuda_core/tests/test_memory.py b/cuda_core/tests/test_memory.py index 5ef48919a50..9b02908effc 100644 --- a/cuda_core/tests/test_memory.py +++ b/cuda_core/tests/test_memory.py @@ -38,9 +38,6 @@ VirtualMemoryResource, VirtualMemoryResourceOptions, ) -from cuda.core import ( - system as ccx_system, -) from cuda.core._dlpack import DLDeviceType from cuda.core._memory import IPCBufferDescriptor from cuda.core._utils.cuda_utils import CUDAError, handle_return @@ -367,7 +364,7 @@ def test_buffer_external_host(): @pytest.mark.parametrize("change_device", [True, False]) def test_buffer_external_device(change_device): - n = ccx_system.get_num_devices() + n = len(Device.get_all_devices()) if n < 1: pytest.skip("No devices found") dev_id = n - 1 @@ -391,7 +388,7 @@ def test_buffer_external_device(change_device): @pytest.mark.parametrize("change_device", [True, False]) def test_buffer_external_pinned_alloc(change_device): - n = ccx_system.get_num_devices() + n = len(Device.get_all_devices()) if n < 1: pytest.skip("No devices found") dev_id = n - 1 @@ -416,7 +413,7 @@ def test_buffer_external_pinned_alloc(change_device): @pytest.mark.parametrize("change_device", [True, False]) def test_buffer_external_pinned_registered(change_device): - n = ccx_system.get_num_devices() + n = len(Device.get_all_devices()) if n < 1: pytest.skip("No devices found") dev_id = n - 1 @@ -449,7 +446,7 @@ def test_buffer_external_pinned_registered(change_device): @pytest.mark.parametrize("change_device", [True, False]) def test_buffer_external_managed(change_device): - n = ccx_system.get_num_devices() + n = len(Device.get_all_devices()) if n < 1: pytest.skip("No devices found") dev_id = n - 1 diff --git a/cuda_core/tests/test_memory_peer_access.py b/cuda_core/tests/test_memory_peer_access.py index 68c32ce69c6..3402402d24e 100644 --- a/cuda_core/tests/test_memory_peer_access.py +++ b/cuda_core/tests/test_memory_peer_access.py @@ -5,7 +5,7 @@ from helpers.buffers import PatternGen, compare_buffer_to_constant, make_scratch_buffer from helpers.collection_interface_testers import assert_single_member_mutable_set_interface -from cuda.core import Device, DeviceMemoryResource, DeviceMemoryResourceOptions, system +from cuda.core import Device, DeviceMemoryResource, DeviceMemoryResourceOptions from cuda.core._memory import _peer_access_utils from cuda.core._memory._peer_access_utils import PeerAccessibleBySetProxy from cuda.core._utils.cuda_utils import CUDAError @@ -228,7 +228,7 @@ def test_peer_accessible_by_silently_ignores_owner(isolated_dmr_x2): def test_peer_accessible_by_rejects_invalid_inputs(isolated_dmr_x2): """``add`` raises on out-of-range/unsupported inputs; lenient methods do not.""" dmr, dev0, dev1 = isolated_dmr_x2 - bad_id = system.get_num_devices() # one past the last valid device ordinal + bad_id = len(Device.get_all_devices()) # one past the last valid CUDA device ordinal # add: validates strictly, propagates errors from Device(bad_id) with pytest.raises((ValueError, CUDAError)): diff --git a/cuda_core/tests/test_object_protocols.py b/cuda_core/tests/test_object_protocols.py index e8391c75678..cc075d43ed4 100644 --- a/cuda_core/tests/test_object_protocols.py +++ b/cuda_core/tests/test_object_protocols.py @@ -26,7 +26,6 @@ LaunchConfig, Program, Stream, - system, ) from cuda.core._program import _can_load_generated_ptx from cuda.core.graph import GraphDefinition @@ -169,7 +168,7 @@ def sample_program_nvvm(init_cuda): @pytest.fixture def sample_device_alt(init_cuda): """An alternate Device object (requires multi-GPU).""" - if system.get_num_devices() < 2: + if len(Device.get_all_devices()) < 2: pytest.skip("requires multi-GPU") device_alt = Device(1) device_alt.set_current() diff --git a/cuda_core/tests/test_tensor_map.py b/cuda_core/tests/test_tensor_map.py index 7abbaadb483..b2d6cbd6c61 100644 --- a/cuda_core/tests/test_tensor_map.py +++ b/cuda_core/tests/test_tensor_map.py @@ -9,7 +9,6 @@ Device, ManagedMemoryResourceOptions, TensorMapDescriptor, - system, ) from cuda.core._dlpack import DLDeviceType from cuda.core._tensor_map import ( @@ -384,7 +383,7 @@ def test_replace_address_requires_device_accessible(self, dev, skip_if_no_tma): desc.replace_address(host_arr) def test_replace_address_rejects_tensor_from_other_device(self, dev, skip_if_no_tma): - if system.get_num_devices() < 2: + if len(Device.get_all_devices()) < 2: pytest.skip("requires multi-GPU") dev0 = dev @@ -405,7 +404,7 @@ def test_replace_address_rejects_tensor_from_other_device(self, dev, skip_if_no_ desc.replace_address(buf1) def test_replace_address_accepts_managed_buffer_on_nonzero_device(self, init_cuda): - if system.get_num_devices() < 2: + if len(Device.get_all_devices()) < 2: pytest.skip("requires multi-GPU") dev1 = Device(1) @@ -429,7 +428,7 @@ class TestTensorMapMultiDeviceValidation: """Test multi-device validation for descriptor creation.""" def test_from_tiled_rejects_tensor_from_other_device(self, init_cuda): - if system.get_num_devices() < 2: + if len(Device.get_all_devices()) < 2: pytest.skip("requires multi-GPU") dev0 = Device(0) @@ -449,7 +448,7 @@ def test_from_tiled_rejects_tensor_from_other_device(self, init_cuda): ) def test_from_tiled_accepts_managed_buffer_on_nonzero_device(self, init_cuda): - if system.get_num_devices() < 2: + if len(Device.get_all_devices()) < 2: pytest.skip("requires multi-GPU") dev1 = Device(1) diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py index a26862c5435..378744ea420 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py @@ -115,8 +115,8 @@ class DescriptorSpec: DescriptorSpec( name="curand", packaged_with="ctk", - linux_sonames=("libcurand.so.10",), - windows_dlls=("curand64_10.dll",), + linux_sonames=("libcurand.so.10", "libcurand.so.11"), + windows_dlls=("curand64_10.dll", "curand64_11.dll"), site_packages_linux=("nvidia/cu13/lib", "nvidia/curand/lib"), site_packages_windows=("nvidia/cu13/bin/x86_64", "nvidia/curand/bin"), ),