diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 25cc1e40959..c94e3a22737 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -6,8 +6,15 @@ # Without this config, actionlint rejects non-GitHub-hosted labels. self-hosted-runner: labels: + - linux-amd64-cpu16-internal - linux-amd64-cpu8 - linux-amd64-gpu-l4-latest-1 + - linux-amd64-gpu-l4-latest-1-internal + - linux-arm64-gpu-l4-latest-1-internal + - linux-riscv64-1xrtx6000 + - linux-riscv64-4cpu-1gpu + - windows-arm64-1xgb10 + - windows-arm64-gpu-gb300-latest-1-internal # GitHub supports queued concurrency runs, but the latest actionlint release # does not yet recognize the concurrency.queue key. @@ -47,3 +54,6 @@ paths: ".github/workflows/coverage.yml": ignore: - 'specifying action "\$/[^"]+" in invalid format because ref is missing' + ".github/workflows/ctk-next-woa-validation.yml": + ignore: + - 'specifying action "\$/[^"]+" in invalid format because ref is missing' diff --git a/.github/actions/resolve-ctk-next/action.yml b/.github/actions/resolve-ctk-next/action.yml new file mode 100644 index 00000000000..9caa8332a71 --- /dev/null +++ b/.github/actions/resolve-ctk-next/action.yml @@ -0,0 +1,44 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +name: Resolve ctk-next toolkit +description: Read the checked-out CTK kitpick configuration and export its version fields + +inputs: + ctk-kitpick: + description: Optional major.minor.patch/NNN override for the checked-out configuration + default: '' + +outputs: + ctk-kitpick: + description: Combined full CUDA version and three-digit kitpick + value: ${{ steps.resolve.outputs.ctk-kitpick }} + cuda-version: + description: CUDA major.minor version + value: ${{ steps.resolve.outputs.cuda-version }} + cuda-kitpick-version: + description: CUDA major.minor.patch version + value: ${{ steps.resolve.outputs.cuda-kitpick-version }} + cuda-kitpick: + description: Three-digit kitpick number + value: ${{ steps.resolve.outputs.cuda-kitpick }} + +runs: + using: composite + steps: + - name: Read CTK kitpick configuration + id: resolve + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + env: + CTK_NEXT_KITPICK_OVERRIDE: ${{ inputs.ctk-kitpick }} + with: + script: | + const fs = require('node:fs'); + const path = require('node:path'); + const workspace = process.env.GITHUB_WORKSPACE; + const { resolveActionValues } = require(path.join(workspace, 'ci/tools/ctk_next_config.cjs')); + const configText = fs.readFileSync(path.join(workspace, 'ci/ctk-next.json'), 'utf8'); + const { outputs, environment } = resolveActionValues(configText, process.env.CTK_NEXT_KITPICK_OVERRIDE); + for (const [name, value] of Object.entries(outputs)) core.setOutput(name, value); + for (const [name, value] of Object.entries(environment)) core.exportVariable(name, value); + core.info(`CTK kitpick: ${outputs['ctk-kitpick']}`); diff --git a/.github/actions/setup-ctk-next-linux/action.yml b/.github/actions/setup-ctk-next-linux/action.yml new file mode 100644 index 00000000000..77ce142b59f --- /dev/null +++ b/.github/actions/setup-ctk-next-linux/action.yml @@ -0,0 +1,120 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# TODO: Remove or replace this PID-drop-specific action after the CUDA 13.5 PID drop. + +name: Set up ctk-next Linux toolkit + +description: Restore or install an exact CUDA kitpick on a Linux runner + +inputs: + host-platform: + description: Linux host platform (linux-64 or linux-aarch64) + required: true + cuda-version: + description: CUDA version used in artifact names + required: true + cuda-kitpick-version: + description: Full CUDA kitpick version + required: true + cuda-kitpick: + description: CUDA kitpick number + required: true + +runs: + using: composite + steps: + - name: Configure Linux architecture + shell: bash + run: | + case "${{ inputs.host-platform }}" in + linux-64) + expected_machine=x86_64 + kitpick_architecture=linux-64 + installer_glob='cuda_*_linux_kitpick*.run' + ;; + linux-aarch64) + expected_machine=aarch64 + kitpick_architecture=linux-aarch64 + installer_glob='cuda_*_linux_sbsa_kitpick*.run' + ;; + *) + echo "Unsupported Linux host platform: ${{ inputs.host-platform }}" >&2 + exit 1 + ;; + esac + + actual_machine="$(uname -m)" + if [[ "$actual_machine" != "$expected_machine" ]]; then + echo "Expected '$expected_machine', got '$actual_machine'." >&2 + exit 1 + fi + + { + echo "KITPICK_ARCHITECTURE=$kitpick_architecture" + echo "KITPICK_INSTALLER_GLOB=$installer_glob" + } >> "$GITHUB_ENV" + + - name: Restore CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} cache + id: cuda-cache + uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: cuda_toolkit + key: ctk-next-linux-wheel-full-toolkit-v1-${{ inputs.cuda-kitpick-version }}-kitpick${{ inputs.cuda-kitpick }}-${{ inputs.host-platform }} + + - name: Download CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} kitpick + if: ${{ steps.cuda-cache.outputs.cache-hit != 'true' }} + shell: bash + run: | + download_dir="$RUNNER_TEMP/kitpicks-${{ inputs.host-platform }}" + mkdir -p "$download_dir" + cd "$download_dir" + python "$GITHUB_WORKSPACE/qa/forge/download_from_kitpicks.py" \ + "${{ inputs.cuda-kitpick-version }}" \ + "${{ inputs.cuda-kitpick }}" \ + --arch="$KITPICK_ARCHITECTURE" + + mapfile -t installers < <(find "$download_dir" -maxdepth 1 -type f -name "$KITPICK_INSTALLER_GLOB" -print) + if ((${#installers[@]} != 1)); then + printf 'Expected exactly one %s kitpick installer, found %d:\n' \ + "${{ inputs.host-platform }}" "${#installers[@]}" >&2 + printf ' %s\n' "${installers[@]}" >&2 + exit 1 + fi + + chmod +x "${installers[0]}" + echo "CUDA_INSTALLER=${installers[0]}" >> "$GITHUB_ENV" + + - name: Install CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} + if: ${{ steps.cuda-cache.outputs.cache-hit != 'true' }} + shell: bash + run: | + cuda_root="$GITHUB_WORKSPACE/cuda_toolkit" + "$CUDA_INSTALLER" \ + --toolkit \ + --toolkitpath="$cuda_root" \ + --silent \ + --no-man-page \ + --override + test -x "$cuda_root/bin/nvcc" + "$cuda_root/bin/nvcc" --version + + - name: Save CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} cache + if: ${{ steps.cuda-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: cuda_toolkit + key: ctk-next-linux-wheel-full-toolkit-v1-${{ inputs.cuda-kitpick-version }}-kitpick${{ inputs.cuda-kitpick }}-${{ inputs.host-platform }} + + - name: Configure CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} + shell: bash + run: | + cuda_root="$(realpath cuda_toolkit)" + test -x "$cuda_root/bin/nvcc" + "$cuda_root/bin/nvcc" --version + echo "$cuda_root/bin" >> "$GITHUB_PATH" + { + echo "CUDA_PATH=$cuda_root" + echo "CUDA_HOME=$cuda_root" + echo "CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)" + } >> "$GITHUB_ENV" diff --git a/.github/actions/setup-ctk-next-windows/README.md b/.github/actions/setup-ctk-next-windows/README.md new file mode 100644 index 00000000000..d0fd2cb09da --- /dev/null +++ b/.github/actions/setup-ctk-next-windows/README.md @@ -0,0 +1,46 @@ +# Approved released-CUDA downloads + +`fetch_ctk` installs released CUDA using the reviewed manifest hashes in +`ci/tools/fetch_ctk_redistrib.py` (`KNOWN_REDISTRIB_SHA256`). +Unknown released CUDA versions emit a warning and proceed without a manifest pin. +The existing internal-kitpick setup path is unchanged. + +## CUDA + +The CUDA pin is the SHA256 of the exact public `redistrib_.json` bytes. +For known versions, verify this before parsing the manifest; a mismatch fails. +For unknown versions, manifest verification warns and continues. Every component +archive is checked against its SHA256 in the downloaded manifest before extraction. +Without a manifest pin, those component hashes have no independent trust anchor. +The shared action caches the assembled toolkit. Cache keys use the CUDA +version, platform, and component list; cache restores trust GitHub Actions cache +integrity. + +The initial 13.4.2 manifest was retrieved from: + + + +Its archive records match internal CUDA 13.4.2 kitpick 006; only `release_date` +differs. This is a checked release mapping, not a rule that the last kitpick is +the public release. Changing manifest whitespace also changes the pinned hash. + +## Python + +Python provisioning uses the shared `setup-hardened-python` action for both +released-CUDA and internal-kitpick jobs. It installs CPython through checksum-verified +uv distributions, creates a virtual environment, and checks that the interpreter +rejects the compromised CA keys. See that action for the pinned tool versions +and interpreter validation policy. + +## Updates and scope + +Update versions and hashes together in a reviewed PR. Obtain the expected bytes +through a trusted release process, independently cross-check the release, and +compute the digest over the actual downloaded file. Do not regenerate or accept +pins automatically during a test run. Test a supported matrix entry and verify +that changed bytes are rejected before extraction. + +These pins protect these downloads, not the whole runner. Test-package locking, +MSVC provisioning, internal-kitpick integrity, runner isolation, and protection +against persistent host modifications are separate controls. GB10 hardware +validation is still required for toolchain changes. diff --git a/.github/actions/setup-ctk-next-windows/action.yml b/.github/actions/setup-ctk-next-windows/action.yml new file mode 100644 index 00000000000..c6871e00eb1 --- /dev/null +++ b/.github/actions/setup-ctk-next-windows/action.yml @@ -0,0 +1,335 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: Set up ctk-next Windows toolchain + +description: Set up native Python, MSVC, and a released or kitpick CUDA mini-toolkit + +inputs: + host-platform: + description: Windows host platform (win-64 or win-arm64) + required: true + cuda-version: + description: Short CUDA version used by the runbooks + required: true + cuda-kitpick-version: + description: Full CUDA kitpick version + default: '' + cuda-kitpick: + description: CUDA kitpick number + default: '' + cuda-release-version: + description: Released toolkit version; empty preserves the private kitpick selection + default: '' + python-version: + description: Native Python version + required: true + +outputs: + python-path: + description: Absolute path of the venv's interpreter (from setup-hardened-python). + value: ${{ steps.hardened-python.outputs.python-path }} + python-version: + description: Full resolved Python version, e.g. "3.12.16". + value: ${{ steps.hardened-python.outputs.python-version }} + +runs: + using: composite + steps: + - name: Configure Windows architecture + shell: powershell + run: | + switch ("${{ inputs.host-platform }}") { + "win-64" { + $processorArchitecture = "AMD64" + $pythonArchitecture = "x64" + $pythonPlatform = "win-amd64" + $msvcComponent = "Microsoft.VisualStudio.Component.VC.Tools.x86.x64" + $kitpickArchitecture = "win-64" + $kitpickInstallerGlob = "cuda_*_windows_x86_64_kitpick*.exe" + } + "win-arm64" { + $processorArchitecture = "ARM64" + $pythonArchitecture = "arm64" + $pythonPlatform = "win-arm64" + $msvcComponent = "Microsoft.VisualStudio.Component.VC.Tools.ARM64" + $kitpickArchitecture = "win-arm64" + $kitpickInstallerGlob = "cuda_*_windows_arm64_kitpick*.exe" + } + default { + throw "Unsupported Windows host platform: ${{ inputs.host-platform }}" + } + } + + @( + "HOST_PLATFORM=${{ inputs.host-platform }}" + "EXPECTED_PROCESSOR_ARCHITECTURE=$processorArchitecture" + "PYTHON_ARCHITECTURE=$pythonArchitecture" + "PYTHON_PLATFORM=$pythonPlatform" + "MSVC_COMPONENT=$msvcComponent" + "KITPICK_ARCHITECTURE=$kitpickArchitecture" + "KITPICK_INSTALLER_GLOB=$kitpickInstallerGlob" + "CUDA_VERSION=${{ inputs.cuda-version }}" + "CUDA_KITPICK_VERSION=${{ inputs.cuda-kitpick-version }}" + "CUDA_KITPICK=${{ inputs.cuda-kitpick }}" + "CUDA_MAJOR=${{ inputs.cuda-version }}".Split('.')[0] + ) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + + - name: Set up Python ${{ inputs.python-version }} + id: hardened-python + uses: ./.github/actions/setup-hardened-python + with: + python-version: ${{ inputs.python-version }} + + - name: Verify Python architecture + shell: powershell + run: | + python -VV + python -c "import os, sys, sysconfig; platform = sysconfig.get_platform(); print('Python platform:', platform); sys.exit(platform != os.environ['PYTHON_PLATFORM'])" + if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE } + + - name: Install MSVC Build Tools + shell: powershell + run: | + $programFilesX86 = [Environment]::GetFolderPath("ProgramFilesX86") + $vswhere = Join-Path $programFilesX86 "Microsoft Visual Studio\Installer\vswhere.exe" + $vsRequirements = @( + $env:MSVC_COMPONENT + "Microsoft.VisualStudio.Component.Windows11SDK.26100" + ) + if (Test-Path $vswhere) { + $existingInstall = & $vswhere -latest -products "*" -requires $vsRequirements -property installationPath + if ($existingInstall) { + Write-Host "Using existing $env:EXPECTED_PROCESSOR_ARCHITECTURE MSVC installation: $existingInstall" + exit 0 + } + } + + $bootstrapper = Join-Path $env:RUNNER_TEMP "vs_buildtools.exe" + $bootstrapperUrl = "https://aka.ms/vs/17/release/vs_buildtools.exe" + $installPath = Join-Path $env:SystemDrive "BuildTools" + + Invoke-WebRequest -UseBasicParsing -Uri $bootstrapperUrl -OutFile $bootstrapper + $signature = Get-AuthenticodeSignature -FilePath $bootstrapper + if ($signature.Status -ne "Valid" -or $signature.SignerCertificate.Subject -notmatch "Microsoft Corporation") { + throw "Visual Studio Build Tools bootstrapper does not have a valid Microsoft signature." + } + + $arguments = @( + "--quiet" + "--wait" + "--norestart" + "--nocache" + "--installPath" + $installPath + "--add" + "Microsoft.VisualStudio.Workload.VCTools" + "--add" + $env:MSVC_COMPONENT + "--add" + "Microsoft.VisualStudio.Component.Windows11SDK.26100" + ) + $process = Start-Process -FilePath $bootstrapper -ArgumentList $arguments -PassThru + while (-not $process.WaitForExit(60000)) { + Write-Host "Visual Studio Build Tools installer is still running." + } + if ($process.ExitCode -notin @(0, 3010)) { + throw "Visual Studio Build Tools installer exited with code $($process.ExitCode)." + } + + if (-not (Test-Path $vswhere)) { + throw "vswhere.exe not found after installing Visual Studio Build Tools: $vswhere" + } + $installedPath = & $vswhere -latest -products "*" -requires $vsRequirements -property installationPath + if (-not $installedPath) { + throw "Visual Studio Build Tools component $env:MSVC_COMPONENT was not found after installation." + } + $vcvars = Join-Path $installedPath "VC\Auxiliary\Build\vcvarsall.bat" + if (-not (Test-Path $vcvars)) { + throw "vcvarsall.bat not found after installing Visual Studio Build Tools: $vcvars" + } + Write-Host "Installed $env:EXPECTED_PROCESSOR_ARCHITECTURE MSVC toolchain: $installedPath" + + - name: Activate MSVC + shell: powershell + run: | + $programFilesX86 = [Environment]::GetFolderPath("ProgramFilesX86") + $vswhere = Join-Path $programFilesX86 "Microsoft Visual Studio\Installer\vswhere.exe" + $vsRequirements = @( + $env:MSVC_COMPONENT + "Microsoft.VisualStudio.Component.Windows11SDK.26100" + ) + $installedPath = & $vswhere -latest -products "*" -requires $vsRequirements -property installationPath + if (-not $installedPath) { + throw "Visual Studio Build Tools component $env:MSVC_COMPONENT was not found." + } + $vcvars = Join-Path $installedPath "VC\Auxiliary\Build\vcvarsall.bat" + $vcvarsArch = if ($env:HOST_PLATFORM -eq "win-arm64") { "arm64" } else { "x64" } + + $originalEnvironment = @{} + Get-ChildItem Env: | ForEach-Object { + $originalEnvironment[$_.Name] = $_.Value + } + + $command = "`"$vcvars`" $vcvarsArch >nul && set" + $vcvarsEnvironment = & $env:ComSpec /d /s /c $command + if ($LASTEXITCODE -ne 0) { + throw "vcvarsall.bat exited with code $LASTEXITCODE." + } + + $encoding = [System.Text.UTF8Encoding]::new($false) + foreach ($line in $vcvarsEnvironment) { + $separator = $line.IndexOf("=") + if ($separator -le 0) { + continue + } + $name = $line.Substring(0, $separator) + $value = $line.Substring($separator + 1) + if (-not $originalEnvironment.ContainsKey($name) -or $originalEnvironment[$name] -ne $value) { + [Environment]::SetEnvironmentVariable($name, $value, "Process") + [System.IO.File]::AppendAllText($env:GITHUB_ENV, "$name=$value`n", $encoding) + } + } + + where.exe cl.exe + if ($LASTEXITCODE -ne 0) { + throw "cl.exe is not available after activating $vcvars." + } + + - name: Restore CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} cache + id: cuda-cache + if: ${{ inputs.cuda-release-version == '' }} + uses: actions/cache/restore@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: cuda_toolkit + key: ctk-next-windows-ci-mini-ctk-assembler-v1-${{ inputs.cuda-kitpick-version }}-kitpick${{ inputs.cuda-kitpick }}-${{ inputs.host-platform }} + + - name: Extract CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} + if: ${{ inputs.cuda-release-version == '' && steps.cuda-cache.outputs.cache-hit != 'true' }} + shell: powershell + run: | + $cudaDownloadDir = Join-Path $env:RUNNER_TEMP "kitpicks" + $sevenZip = Join-Path $env:RUNNER_TEMP "7zr.exe" + $sevenZipUrl = "https://github.com/ip7z/7zip/releases/download/26.02/7zr.exe" + $sevenZipHash = "56b8cc9f4971cef253644fafe54063ed7fdca551d4dee0f8c6baa81b855acd72" + $extractRoot = Join-Path $env:RUNNER_TEMP "cuda-$($env:CUDA_KITPICK_VERSION)-kitpick$($env:CUDA_KITPICK)-installer" + $cudaPath = Join-Path $env:GITHUB_WORKSPACE "cuda_toolkit" + $components = "cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libnvfatbin" + + Invoke-WebRequest -Uri $sevenZipUrl -OutFile $sevenZip + $actualHash = (Get-FileHash -Path $sevenZip -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actualHash -ne $sevenZipHash) { + throw "7-Zip checksum mismatch: expected $sevenZipHash, got $actualHash." + } + + New-Item -ItemType Directory -Force -Path $cudaDownloadDir | Out-Null + Push-Location $cudaDownloadDir + try { + python "$env:GITHUB_WORKSPACE\qa\forge\download_from_kitpicks.py" $env:CUDA_KITPICK_VERSION $env:CUDA_KITPICK "--arch=$env:KITPICK_ARCHITECTURE" + if ($LASTEXITCODE -ne 0) { + throw "CUDA kitpick download failed with exit code $LASTEXITCODE." + } + } + finally { + Pop-Location + } + + $installers = @(Get-ChildItem -Path $cudaDownloadDir -File -Filter $env:KITPICK_INSTALLER_GLOB) + if ($installers.Count -ne 1) { + throw "Expected exactly one $env:HOST_PLATFORM kitpick installer, found $($installers.Count)." + } + $cudaInstaller = $installers[0].FullName + + New-Item -ItemType Directory -Force -Path $extractRoot | Out-Null + $archivePatterns = @( + "cccl\*" + "cuda_crt\*" + "cuda_cudart\*" + "cuda_cupti\*" + "cuda_nvcc\*" + "cuda_nvrtc\*" + "cuda_profiler_api\*" + "libnvfatbin\*" + "libnvjitlink\*" + "libnvvm\*" + ) + & $sevenZip x -y $cudaInstaller $archivePatterns "-o$extractRoot" + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + $mergeArgs = @( + "$env:GITHUB_WORKSPACE\qa\forge\merge_windows_kitpick.py" + "--host-platform" + $env:HOST_PLATFORM + "--components" + $components + "--extract-root" + $extractRoot + "--destination" + $cudaPath + ) + python @mergeArgs + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + - name: Save CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} cache + if: ${{ inputs.cuda-release-version == '' && steps.cuda-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@668228422ae6a00e4ad889ee87cd7109ec5666a7 # v5.0.4 + with: + path: cuda_toolkit + key: ctk-next-windows-ci-mini-ctk-assembler-v1-${{ inputs.cuda-kitpick-version }}-kitpick${{ inputs.cuda-kitpick }}-${{ inputs.host-platform }} + + - name: Configure CUDA ${{ inputs.cuda-kitpick-version }}/${{ inputs.cuda-kitpick }} + if: ${{ inputs.cuda-release-version == '' }} + shell: powershell + run: | + $cudaPath = (Resolve-Path cuda_toolkit).Path + $nvcc = Join-Path $cudaPath "bin\nvcc.exe" + if (-not (Test-Path $nvcc)) { + throw "CUDA compiler not found at: $nvcc" + } + "$cudaPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + @( + "CUDA_PATH=$cudaPath" + "CUDA_HOME=$cudaPath" + "CUDA_PYTHON_PARALLEL_LEVEL=$([Math]::Min(61, [int]$env:NUMBER_OF_PROCESSORS))" + ) | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + & $nvcc --version + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + - name: Fetch released CUDA toolkit + if: ${{ inputs.cuda-release-version != '' }} + uses: ./.github/actions/fetch_ctk + with: + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ inputs.cuda-release-version }} + cuda-components: cuda_nvcc,cuda_cudart,cuda_crt,libnvvm,cuda_nvrtc,cuda_profiler_api,cuda_cccl,cuda_cupti,libnvjitlink,libnvfatbin + cuda-path: ./cuda_toolkit-${{ inputs.cuda-release-version }} + + - name: Configure released CUDA toolkit + if: ${{ inputs.cuda-release-version != '' }} + env: + CUDA_RELEASE_VERSION: ${{ inputs.cuda-release-version }} + shell: powershell + run: | + $cudaPath = (Resolve-Path "cuda_toolkit-$env:CUDA_RELEASE_VERSION").Path + $archBin = Join-Path $cudaPath "bin\$env:PYTHON_ARCHITECTURE" + if (Test-Path -LiteralPath $archBin) { + Get-ChildItem -LiteralPath $archBin | Copy-Item -Destination (Join-Path $cudaPath 'bin') -Recurse -Force + } + @("CUDA_PATH=$cudaPath", "CUDA_HOME=$cudaPath") | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append + "$cudaPath\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + $nvccOutput = & "$cudaPath\bin\nvcc.exe" --version + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + $nvccOutput | Write-Host + $expectedVersion = ($env:CUDA_RELEASE_VERSION.Split('.')[0..1] -join '.') + if (($nvccOutput -join "`n") -notmatch "release $([regex]::Escape($expectedVersion)),") { + throw "Expected CUDA $expectedVersion compiler, got: $nvccOutput" + } diff --git a/.github/actions/setup-woa-gb300/action.yml b/.github/actions/setup-woa-gb300/action.yml new file mode 100644 index 00000000000..555fc411b70 --- /dev/null +++ b/.github/actions/setup-woa-gb300/action.yml @@ -0,0 +1,102 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +name: Set up Windows ARM64 GB300 +description: Install the attested MCDM driver and ARM64 runtime on a fresh GB300 VM + +runs: + using: composite + steps: + # See https://gitlab-master.nvidia.com/jcichra/projects/-/blob/main/2026/woa/WOA-RUNNER-GUIDE.md + # This package starts in MCDM. Restarting the GPU can pause the VM. + - name: Download the GB300 MCDM driver + shell: pwsh + env: + DRIVER_BASE_URL: http://10.176.221.215:8080/AttestedDriverSigning/Attested_logod/wddm2-aarch64-dch + DRIVER_VERSION: 620.77-NProfile + run: | + $root = "$env:DRIVER_BASE_URL/$env:DRIVER_VERSION/WoA/Disk1/Display.Driver/" + $dir = Join-Path $env:RUNNER_TEMP "gb300-driver\Display.Driver" + function Get-Files([string] $url) { + $html = (Invoke-WebRequest -UseBasicParsing -Uri $url).Content + foreach ($match in [regex]::Matches($html, ' $null + $ready = $LASTEXITCODE -eq 0 -and $gpu.Count -eq 1 -and $gpu[0].Status -eq "OK" -and "$($gpu[0].Problem)" -eq "CM_PROB_NONE" -and $service.Status -eq "Running" + } + $ok = if ($ready) { $ok + 1 } else { 0 } + } while ($ok -lt 3 -and (Get-Date) -lt $deadline) + if ($ok -lt 3) { + throw "GPU not ready after 2 minutes: $($gpu.Status) / $($gpu.Problem), nvlddmkm $($service.Status)" + } + nvidia-smi + if ($LASTEXITCODE -ne 0) { throw "nvidia-smi failed ($LASTEXITCODE)" } + + - name: Install the ARM64 VC++ runtime + shell: pwsh + run: | + $redist = Join-Path $env:RUNNER_TEMP "vc_redist.arm64.exe" + curl.exe -fsSL --retry 3 -o $redist https://aka.ms/vs/17/release/vc_redist.arm64.exe + if ($LASTEXITCODE -ne 0) { throw "VC++ runtime download failed ($LASTEXITCODE)" } + $signature = Get-AuthenticodeSignature $redist + if ($signature.Status -ne "Valid" -or $signature.SignerCertificate.Subject -notmatch "O=Microsoft Corporation") { + throw "VC++ runtime is not validly signed by Microsoft: $($signature.Status)" + } + $process = Start-Process $redist -ArgumentList "/install", "/quiet", "/norestart" -Wait -PassThru + if ($process.ExitCode -notin 0, 1638, 3010) { throw "VC++ runtime installer failed: $($process.ExitCode)" } + + - name: Configure GB300 test prerequisites + shell: pwsh + run: | + Set-ItemProperty -Path 'HKLM:\SYSTEM\CurrentControlSet\Control\FileSystem' -Name LongPathsEnabled -Value 1 + git config --global core.symlinks true + if ($LASTEXITCODE -ne 0) { throw "Failed to enable Git symlinks" } + # The sample requires OpenGL 2.0; MCDM only exposes Windows' OpenGL 1.1. + # The runbook and installed-wheel jobs invoke pytest from different directories. + $deselect = @( + '--deselect=tests/example_tests/test_samples.py::test_sample[cuda_core/glInteropMipmapLod]' + '--deselect=cuda_core/tests/example_tests/test_samples.py::test_sample[cuda_core/glInteropMipmapLod]' + ) -join ' ' + "PYTEST_ADDOPTS=$env:PYTEST_ADDOPTS $deselect" | Out-File -FilePath $env:GITHUB_ENV -Encoding utf8 -Append diff --git a/.github/copy-pr-bot.yaml b/.github/copy-pr-bot.yaml index 1c328793a11..3c42a55fc60 100644 --- a/.github/copy-pr-bot.yaml +++ b/.github/copy-pr-bot.yaml @@ -5,6 +5,6 @@ # https://docs.gha-runners.nvidia.com/apps/copy-pr-bot/ enabled: true -# auto-sync ready PRs so CI starts immediately; keep draft PRs manual +# Keep automatic synchronization disabled; trigger trusted CI explicitly. auto_sync_draft: false -auto_sync_ready: true +auto_sync_ready: false diff --git a/.github/workflows/build-wheel-riscv64.yml b/.github/workflows/build-wheel-riscv64.yml new file mode 100644 index 00000000000..4cb00671fe6 --- /dev/null +++ b/.github/workflows/build-wheel-riscv64.yml @@ -0,0 +1,637 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Native riscv64 wheel build for cuda-python (pathfinder -> bindings -> core). +# +# Standalone -- not threaded through ci-linux.yml's workplan/baseline +# machinery, which is built for per-PR CI across the full Python/CUDA-major +# matrix and is overkill for a lane that triggers on-demand and on push to +# riscv64-next. Tests run in a separate workflow +# (test-wheel-linux-riscv64.yml), per repo convention. This workflow's +# CIBW_REPAIR_WHEEL_COMMAND_LINUX prints sccache stats (text) to the +# build log and writes them (JSON) to a /host-mounted file, calls +# ci/tools/chown-sccache-files.sh to fix ownership (the sccache server runs as root in the container), then +# runs auditwheel repair. Dumping stats during repair (rather than in +# CIBW_TEST_COMMAND) keeps stats collection independent of the test +# stage. CIBW_TEST_COMMAND_LINUX then compiles the Cython test +# extensions inside the container and copies the .so files back to the +# host for upload as NAME-tests artifacts. The "Report sccache stats" +# always() steps parse that file via ./.github/actions/sccache-summary and +# write a table to the job summary (GITHUB_STEP_SUMMARY). If the build +# was cancelled before repair ran, the "Recover ... sccache stats" step +# falls back to `docker exec` calling the same chown script into the +# still-running orphan container (idempotent, no guard needed). +# +# SCCACHE_ERROR_LOG is intentionally NOT set in CIBW_ENVIRONMENT_LINUX: it +# would write a root-owned file to the host workspace immediately when the +# sccache server starts, and if the job is cancelled before the chown +# runs, the file lingers and triggers the runner's "Found root-owned +# files" abort on the next job. sccache still logs via SCCACHE_LOG=info +# to stderr (captured in the job log), so diagnostics aren't lost. +# Stats filenames are per-matrix-job (e.g. sccache-stats-bindings-3.12.json) +# to avoid concurrent-write races when py3.12/3.13/3.14 run in parallel. +# +# sccache uses a two-tier cache: local disk (L1, /var/cache/sccache on the +# host) and the GitHub Actions cache service (L2, gha). SCCACHE_MULTILEVEL_CHAIN +# =disk,gha is set explicitly for clarity; rapidsai/sccache defaults to +# disk-first when the chain is omitted, but setting it makes the intent +# unambiguous. The ACTIONS_* vars are read by a github-script step (the runner +# only injects them into JS actions), which exports a ready-made +# SCCACHE_GHA_CIBW_ENV string that CIBW_ENVIRONMENT_LINUX passes into the +# container. If the credentials are missing or the endpoint is unreachable, +# that string is empty and sccache runs disk-only. A later step runs +# `sccache --start-server` in the build image with that environment. The +# HEAD probe can succeed and the storage check can still fail (Azure +# ServerBusy when egress is over the account limit). With +# SCCACHE_GHA_ENABLED set, sccache then refuses to start and fails the +# compile. When the startup check fails, the step clears +# SCCACHE_GHA_CIBW_ENV and the build keeps the local disk cache. +# +# See native_risc-v64_cibuildwheel_+_runtime_tests_870f5cf4.plan.md, stage 2. +# +# Single job. The riscv64 build inputs (CUDA headers + riscv64 +# libcudart_static.a + clang/lld) are baked into a derived cibuildwheel +# manylinux image, built locally on each riscv64 runner (no registry push) +# by ci/docker/riscv64-build/ensure-image.sh from the checked-out source +# commit. See that script for the image tag and how the build context is +# assembled. cibuildwheel 4.3.4 honors a local linux/riscv64 image +# (--pull=never). +# +# This workflow is specific to NVIDIA-dev/cuda-python-private and is not +# meant to ever be merged to NVIDIA/cuda-python. +name: "CI: Build wheels (linux-riscv64)" + +on: + workflow_dispatch: + inputs: + toolchain: + description: >- + C/C++ toolchain inside the cibuildwheel container, via + CUDA_PYTHON_TOOLCHAIN: "llvm" (clang + lld, default) or "gnu" + (gcc). + required: false + type: choice + options: + - llvm + - gnu + default: llvm + force_image_rebuild: + description: >- + Force a rebuild of the derived cibuildwheel image, ignoring any + existing local image with the same tag. Default: no (reuse the + cached image if present). + required: false + type: boolean + default: false + push: + branches: + - riscv64-next + +defaults: + run: + shell: bash --noprofile --norc -xeuo pipefail {0} + +permissions: + actions: read + contents: read + +env: + CACHE_MAX_AGE_DAYS: '90' + +jobs: + # ------------------------------------------------------------------------- + # resolve-source: pick the one commit every matrix job builds, so the + # checked-out source, the artifact names (which embed the SHA via + # ci/tools/env-vars) and the downstream test workflow all agree. + # On push, that is the pushed commit. On workflow_dispatch, it is the + # current tip of riscv64-next, resolved once here: the dispatched ref only + # supplies this workflow file, so a branch that carries just workflow + # changes can be tested against the riscv64-next sources, scripts and + # actions. Resolving once (rather than per matrix job) keeps the matrix on + # a single commit even if riscv64-next advances while jobs are queued. + # + # TEMPORARY: this job is only needed until the riscv64-next branch goes + # away (it will become ctk-next). Once that happens, the dispatched ref + # can be built directly and this job, its `needs:` wiring and the SHA + # plumbing that depends on it can be removed. + # ------------------------------------------------------------------------- + resolve-source: + name: Resolve source commit + runs-on: ubuntu-latest + timeout-minutes: 5 + outputs: + sha: ${{ steps.resolve.outputs.sha }} + steps: + - name: Resolve source commit + id: resolve + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} + EVENT_NAME: ${{ github.event_name }} + TRIGGER_SHA: ${{ github.sha }} + run: | + if [ "${EVENT_NAME}" = "workflow_dispatch" ]; then + SHA="$(gh api "repos/${GH_REPO}/commits/riscv64-next" --jq .sha)" + else + SHA="${TRIGGER_SHA}" + fi + if [[ ! "${SHA}" =~ ^[0-9a-f]{40}$ ]]; then + echo "::error title=Source commit::expected a 40-hex SHA, got: ${SHA}" >&2 + exit 1 + fi + echo "Building source commit ${SHA} (event: ${EVENT_NAME}, workflow commit: ${TRIGGER_SHA})" + echo "sha=${SHA}" >> "$GITHUB_OUTPUT" + + # ------------------------------------------------------------------------- + # build: native cibuildwheel as a Python CLI (not pypa/cibuildwheel; that + # action calls setup-python, which has no riscv64 binary). Image is + # built-if-missing here because the docker store is per-machine and this + # runner executes one job at a time. + # ------------------------------------------------------------------------- + build: + needs: resolve-source + runs-on: linux-riscv64-1xrtx6000 + timeout-minutes: 180 + strategy: + fail-fast: false + matrix: + # Narrower than build-wheel.yml's full matrix: no free-threaded + # variants yet. + python-version: ["3.12", "3.13", "3.14"] + name: py${{ matrix.python-version }} + steps: + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # Single source commit for the whole matrix; see resolve-source. + ref: ${{ needs.resolve-source.outputs.sha }} + fetch-depth: 0 + filter: blob:none + # third_party/cccl provides the CCCL headers cuda.core compiles against. + submodules: true + + - name: Trim the CCCL submodule worktree to the libcu++ headers + # cuda.core only compiles against third_party/cccl/libcudacxx/include + # (build_hooks._get_cccl_include_dirs). Dropping the rest of the tree + # means less for cibuildwheel to copy into its container. + run: git -C cuda_core/third_party/cccl sparse-checkout set --cone libcudacxx/include + + - name: Resolve CTK kitpick + uses: ./.github/actions/resolve-ctk-next + + - name: Bootstrap uv + # uv drives the host cibuildwheel venv and is copied into the manylinux + # container by build[uv]. Pin the same static musl binary as + # test-wheel-linux-riscv64.yml (uv 0.13.5 removes the compromised + # eMudhra CAs; NVIDIA/cuda-python#3195). + run: | + UV_VERSION="0.13.5" + UV_TARBALL="uv-riscv64gc-unknown-linux-musl.tar.gz" + UV_SHA256="485ffd2d7623fd98f791cb6ab45aa967f1605e3f691666fc49713e3feb2362b9" + mkdir -p "$HOME/.local/bin" + curl -fsSL \ + "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/${UV_TARBALL}" \ + -o /tmp/uv.tgz + echo "${UV_SHA256} /tmp/uv.tgz" | sha256sum -c + tar -xzf /tmp/uv.tgz -C "$HOME/.local/bin" --strip-components=1 --no-same-owner \ + "uv-riscv64gc-unknown-linux-musl/uv" + chmod +x "$HOME/.local/bin/uv" + rm /tmp/uv.tgz + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + "$HOME/.local/bin/uv" --version + + - name: Install cibuildwheel + # uv tool install is idempotent: a no-op when cibuildwheel 4.3.4 is + # already installed from a previous run (this runner reuses $HOME), so + # there is no per-leg venv rebuild. The entrypoint lands in + # ~/.local/bin, already on PATH from the Bootstrap uv step. No + # hash-pinned pip bootstrap needed: uv ships the fixed eMudhra CA store + # (NVIDIA/cuda-python#3195). + run: | + uv tool install --python python3 "cibuildwheel==4.3.4" + # Allow CPython pre-release builds (currently cp314); mirrors build-wheel.yml. + echo "CIBW_ENABLE=cpython-prerelease" >> "$GITHUB_ENV" + echo "CUDA_PYTHON_TOOLCHAIN=${{ github.event.inputs.toolchain || 'llvm' }}" >> "$GITHUB_ENV" + + - name: Prune derived build images and kitpick components older than ${{ env.CACHE_MAX_AGE_DAYS }} days + # Scope image pruning to images built by this workflow. Run before the + # image-tag/ensure step so an expired current image is rebuilt normally. + # Kitpick tarballs: mtime is the download time (cache hits do not + # refresh mtime), so age-based deletion means "downloaded >N days ago". + # download-kitpick-component.sh re-fetches and sha256-checks anything + # missing, so expiring a tarball is safe. + run: | + docker image prune -a -f \ + --filter "label=com.nvidia.cuda-python.riscv64-build=true" \ + --filter "until=$((CACHE_MAX_AGE_DAYS * 24))h" + kitpick_cache="$HOME/.cibw-kitpick-components" + if [ -d "${kitpick_cache}" ]; then + find "${kitpick_cache}" -type f -mmin "+$((CACHE_MAX_AGE_DAYS * 24 * 60))" -print -delete + find "${kitpick_cache}" -mindepth 1 -type d -empty -print -delete + fi + + - name: Ensure build image + # Tag computation, local-image check and build (if missing) live in + # ci/docker/riscv64-build/ensure-image.sh on the source commit. + id: image-tag + env: + FORCE_IMAGE_REBUILD: ${{ inputs.force_image_rebuild || 'false' }} + run: ci/docker/riscv64-build/ensure-image.sh + + - name: Prune Cython and uv caches + # Both caches are root-owned (written inside the cibuildwheel container), + # so pruning runs inside a throwaway docker run of the build image. + # Cython's load_from_cache refreshes mtime on every hit, so mtime-based + # deletion removes entries unused for CACHE_MAX_AGE_DAYS days. + # uv cache prune --ci keeps wheels built from source and drops pre-built + # wheels, unzipped wheels, stale environments, and outdated buckets. It + # also removes unknown files at the uv cache root, so the quarter stamp + # lives in $HOME (outside the uv cache) so it survives the prune. + env: + BUILD_IMAGE: ${{ steps.image-tag.outputs.image-tag }} + run: | + # Prune Cython cache entries unused for CACHE_MAX_AGE_DAYS days. + docker run --rm --pull=never \ + -v /var/cache/cython-cache:/cython-cache \ + "${BUILD_IMAGE}" \ + bash -euo pipefail -c ' + find /cython-cache -type f -mmin "+$1" -print -delete + find /cython-cache -mindepth 1 -type d -empty -print -delete + ' _ "$((CACHE_MAX_AGE_DAYS * 24 * 60))" + # Prune uv cache once per calendar quarter. + quarter="$(date -u +%Y)-Q$(( ($(date -u +%-m) + 2) / 3 ))" + stamp="$HOME/.cibw-uv-cache-last-pruned" + if [ ! -f "${stamp}" ] || [ "$(<"${stamp}")" != "${quarter}" ]; then + docker run --rm --pull=never \ + -v /var/cache/uv-cache:/uv-cache \ + -e UV_CACHE_DIR=/uv-cache \ + "${BUILD_IMAGE}" \ + uv cache prune --ci + echo "${quarter}" > "${stamp}" + else + echo "uv cache already pruned this quarter (${quarter}); skipping" + fi + + - name: Configure sccache GHA cache tier + # The runner injects ACTIONS_RUNTIME_TOKEN / ACTIONS_RESULTS_URL only + # into JavaScript actions, not into `run:` steps, so read them here + # and hand the cibuildwheel container a ready-made environment string + # (SCCACHE_GHA_CIBW_ENV) for CIBW_ENVIRONMENT_LINUX. + # ACTIONS_CACHE_URL / ACTIONS_RUNTIME_URL are not needed: sccache's + # GHA v2 backend does not read them. + # If the credentials are missing or the endpoint is unreachable, + # SCCACHE_GHA_CIBW_ENV stays empty and sccache runs disk-only. + # This HEAD probe cannot see a storage-check failure. The next step + # runs `sccache --start-server` and clears SCCACHE_GHA_CIBW_ENV when + # that fails, so the build continues on the local disk cache. + # setSecret masks the token in logs (the "Dump environment" step and + # cibuildwheel both print env vars). Doing this in JS rather than in + # a `run:` step also keeps the token out of the shell trace. + # xref: https://github.com/orgs/community/discussions/42856#discussioncomment-7678867 + uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0 + with: + script: | + const token = process.env['ACTIONS_RUNTIME_TOKEN'] || ''; + const url = process.env['ACTIONS_RESULTS_URL'] || ''; + if (token) core.setSecret(token); + + const diskOnly = (why) => { + core.warning(`${why}; sccache will use disk only`, {title: 'GHA cache'}); + core.exportVariable('SCCACHE_GHA_CIBW_ENV', ''); + }; + + if (!token || !url) { + diskOnly('ACTIONS_RUNTIME_TOKEN / ACTIONS_RESULTS_URL not set'); + return; + } + + // The results receiver returns 404 at its root; only specific + // upload paths respond. Any HTTP response means "reachable" -- + // only a connection failure or timeout falls back to disk-only. + try { + const resp = await fetch(url, {method: 'HEAD', signal: AbortSignal.timeout(10000)}); + core.info(`GHA cache endpoint reachable (HTTP ${resp.status})`); + } catch (err) { + diskOnly(`could not reach ${url} (${err})`); + return; + } + + core.exportVariable('SCCACHE_GHA_CIBW_ENV', [ + 'SCCACHE_GHA_ENABLED=true', + // Set explicitly for clarity; rapidsai/sccache defaults to disk-first when omitted. + 'SCCACHE_MULTILEVEL_CHAIN=disk,gha', + `ACTIONS_RUNTIME_TOKEN=${token}`, + `ACTIONS_RESULTS_URL=${url}`, + 'ACTIONS_CACHE_SERVICE_V2=on', + // Preprocessor cache GHA tier: also cache preprocessed source + // files in GHA (stored under /sccache/preprocessor/). Must stay + // inside SCCACHE_GHA_CIBW_ENV -- an unusable GHA preprocessor + // tier stops the sccache server. + 'SCCACHE_PREPROCESSOR_CACHE_GHA_ENABLED=true', + 'SCCACHE_PREPROCESSOR_CACHE_MULTILEVEL_CHAIN=disk,gha', + ].join(' ')); + + - name: Drop the GHA cache tier if sccache cannot start + # Same sccache binary and GHA settings the build will use. A private + # cache dir keeps the probe from attaching to the host sccache server. + # Credentials stay in an env file so the xtrace does not print them. + env: + BUILD_IMAGE: ${{ steps.image-tag.outputs.image-tag }} + run: | + if [ -z "${SCCACHE_GHA_CIBW_ENV}" ]; then + echo "GHA cache tier is disabled; sccache will use the local disk cache" + exit 0 + fi + set +x + env_file="$(mktemp)" + chmod 600 "${env_file}" + read -r -a gha_env <<< "${SCCACHE_GHA_CIBW_ENV}" + printf '%s\n' "${gha_env[@]}" > "${env_file}" + printf '%s\n' 'SCCACHE_DIR=/tmp/sccache-gha-probe' >> "${env_file}" + set -x + if timeout 60 docker run --rm --pull=never \ + --env-file "${env_file}" \ + "${BUILD_IMAGE}" \ + bash -euo pipefail -c 'sccache --start-server && sccache --stop-server' + then + echo "sccache started with the GitHub Actions cache tier" + else + echo "::warning title=GHA cache::sccache --start-server failed; sccache will use the local disk cache" + echo "SCCACHE_GHA_CIBW_ENV=" >> "${GITHUB_ENV}" + fi + rm -f "${env_file}" + + - name: Set environment variables + env: + CUDA_VER: ${{ env.CUDA_VERSION }} + HOST_PLATFORM: linux-riscv64 + PY_VER: ${{ matrix.python-version }} + SHA: ${{ needs.resolve-source.outputs.sha }} + run: | + ./ci/tools/env-vars build + # FIXME: remove this once ci/tools/env-vars is fixed + echo "SCCACHE_DIR=/var/cache/sccache" >> "$GITHUB_ENV" + + - name: Dump environment + run: | + env | sort + echo "=== Filesystem space ===" + df -h "$GITHUB_WORKSPACE" + echo "=== Docker disk usage ===" + docker system df + echo "=== Persistent CI caches ===" + du -sh \ + "$HOME/.cache/uv" \ + "$HOME/.cibw-kitpick-components" \ + /var/cache/sccache \ + /var/cache/cython-cache \ + /var/cache/uv-cache \ + 2>/dev/null || true + echo "uv cache last pruned: $(cat "$HOME/.cibw-uv-cache-last-pruned" 2>/dev/null || echo never)" + + # ── cuda.pathfinder (pure Python, no CTK link) ── + - name: Build cuda.pathfinder wheel + run: uv build --wheel --python python3 --out-dir cuda_pathfinder cuda_pathfinder + + - name: Constrain builds to the local cuda.pathfinder wheel + run: | + pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) + test "${#pathfinder_wheels[@]}" -eq 1 + test -f "${pathfinder_wheels[0]}" + mkdir -p wheel-constraints + # CIBW mounts the host filesystem under /host. + pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")" + printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" | tee wheel-constraints/cuda-bindings.txt + + # ── cuda.bindings ── + - name: Build cuda.bindings wheel + env: + CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ steps.image-tag.outputs.image-tag }} + # build[uv]: same PEP 517 orchestration, installs the isolated + # build env (and the built wheel, for testing) with uv instead of + # pip -- so only UV_* knobs matter below, not PIP_*. + CIBW_BUILD_FRONTEND: "build[uv]" + # UV_EXTRA_INDEX_URL: RISE wheels for riscv64 (e.g. Cython). + # UV_CACHE_DIR: persistent host dir, survives across runs. + # UV_CONSTRAINT / UV_BUILD_CONSTRAINT: pin to the local + # cuda-pathfinder wheel instead of an index-resolved one. + # CUDA_PYTHON_PARALLEL_LEVEL controls both Cython transpilation and + # C++ compile parallelism (both setup.py files set self.parallel + # from this var in build_extensions()). CUDA_PATH is baked into + # the image (Dockerfile ENV). + CIBW_ENVIRONMENT_LINUX: > + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + CUDA_PYTHON_TOOLCHAIN=${{ env.CUDA_PYTHON_TOOLCHAIN }} + CC="sccache cc" + CXX="sccache c++" + CUDA_PYTHON_CYTHON_CACHE_DIR=/host/var/cache/cython-cache + UV_BUILD_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-bindings.txt + UV_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-bindings.txt + UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + UV_CACHE_DIR=/host/var/cache/uv-cache + GITHUB_WORKSPACE=/host${{ github.workspace }} + SCCACHE_STATS_FILE=/host${{ github.workspace }}/sccache-stats-bindings-${{ matrix.python-version }}.json + SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} + SCCACHE_LOG=info + SCCACHE_IDLE_TIMEOUT=0 + SCCACHE_CACHE_READ_TIMEOUT_SECS=10 + ${{ env.SCCACHE_GHA_CIBW_ENV }} + # No CIBW_BEFORE_BUILD_LINUX pip upgrade: build[uv] never invokes pip. + # --init injects tini as PID 1, which correctly forwards SIGTERM to + # g++/cc1plus subprocesses when the job is cancelled or fails -- without + # it, Python's ThreadPoolExecutor does not propagate signals to its + # spawned subprocesses and they survive as orphans on the host. + CIBW_CONTAINER_ENGINE: "docker; create_args: --init" + # Dump sccache stats during repair. The test stage compiles + # Cython test extensions (see CIBW_TEST_COMMAND_LINUX). + # Per-matrix-job filename avoids concurrent-write races. chown + # immediately after the dump so a cancel during auditwheel does + # not leave a root-owned stats file on the host. + CIBW_REPAIR_WHEEL_COMMAND_LINUX: > + sccache --show-config && + sccache --show-stats && + sccache --show-stats --stats-format=json > /host${{ github.workspace }}/sccache-stats-bindings-${{ matrix.python-version }}.json && + /host${{ github.workspace }}/ci/tools/chown-sccache-files.sh && + auditwheel repair -w {dest_dir} {wheel} + # Cython + setuptools only; pins match the `test` groups in + # cuda_bindings_13/pyproject.toml and cuda_core/pyproject.toml. + # The full test group is not needed to compile the extensions + # and may not be installable on riscv64. + CIBW_TEST_REQUIRES: "cython>=3.2.5,<3.3 setuptools>=80.0.0" + CIBW_TEST_COMMAND_LINUX: > + bash /host${{ github.workspace }}/ci/tools/build-cython-tests-in-cibw.sh + {package}/tests/cython + /host${{ github.workspace }}/cuda_bindings_13/tests/cython + run: | + SECONDS=0 + cibuildwheel --output-dir "${CUDA_BINDINGS_ARTIFACTS_DIR}" ./cuda_bindings_13/ + echo "=== cuda.bindings build time: ${SECONDS}s ===" + + - name: Recover cuda.bindings sccache stats + if: always() + run: | + # If the build was cancelled before CIBW_REPAIR_WHEEL_COMMAND_LINUX + # ran, no stats file exists. Try to chown any root-owned files via + # docker exec into the still-running orphan container (idempotent, + # no guard needed). If the container is already gone (build + # completed), the stats file was already chowned during repair. + if [ ! -f "${GITHUB_WORKSPACE}/sccache-stats-bindings-${{ matrix.python-version }}.json" ]; then + CONTAINER_ID="$(docker ps -q --filter "name=cibuildwheel-" | head -n1)" + if [ -n "${CONTAINER_ID}" ]; then + docker exec "${CONTAINER_ID}" "/host${GITHUB_WORKSPACE}/ci/tools/chown-sccache-files.sh" || echo "(docker exec failed)" + fi + fi + + - name: Report sccache stats (cuda.bindings) + if: always() + uses: ./.github/actions/sccache-summary + with: + json-file: sccache-stats-bindings-${{ matrix.python-version }}.json + label: "cuda.bindings" + build-step: "Build cuda.bindings wheel" + + - name: List cuda.bindings artifacts + run: | + ls -lahR "${CUDA_BINDINGS_ARTIFACTS_DIR}" + ls -lah "${CUDA_BINDINGS_CYTHON_TESTS_DIR}"/test_*.so + + - name: Constrain cuda.core to the local wheels + run: | + pathfinder_wheels=(cuda_pathfinder/cuda_pathfinder-*.whl) + bindings_wheels=("${CUDA_BINDINGS_ARTIFACTS_DIR}"/cuda_bindings-"${BUILD_CUDA_MAJOR}".*.whl) + test "${#pathfinder_wheels[@]}" -eq 1 + test "${#bindings_wheels[@]}" -eq 1 + test -f "${pathfinder_wheels[0]}" + test -f "${bindings_wheels[0]}" + mkdir -p wheel-constraints + pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")" + bindings_uri="file:///host$(realpath "${bindings_wheels[0]}")" + { + printf 'cuda-pathfinder @ %s\n' "${pathfinder_uri}" + printf 'cuda-bindings @ %s\n' "${bindings_uri}" + } | tee wheel-constraints/cuda-core.txt + + # ── cuda.core ── + - name: Build cuda.core wheel + env: + CIBW_BUILD: ${{ env.CIBW_BUILD }} + CIBW_MANYLINUX_RISCV64_IMAGE: ${{ steps.image-tag.outputs.image-tag }} + # See the cuda.bindings step above for UV_* vs PIP_*. + CIBW_BUILD_FRONTEND: "build[uv]" + CIBW_ENVIRONMENT_LINUX: > + CUDA_PYTHON_PARALLEL_LEVEL=${{ env.CUDA_PYTHON_PARALLEL_LEVEL }} + CUDA_PYTHON_TOOLCHAIN=${{ env.CUDA_PYTHON_TOOLCHAIN }} + CC="sccache cc" + CXX="sccache c++" + CUDA_CORE_BUILD_MAJOR=${{ env.BUILD_CUDA_MAJOR }} + CUDA_PYTHON_CYTHON_CACHE_DIR=/host/var/cache/cython-cache + UV_BUILD_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-core.txt + UV_CONSTRAINT=/host/${{ github.workspace }}/wheel-constraints/cuda-core.txt + UV_EXTRA_INDEX_URL=https://pypi.riseproject.dev/simple/ + UV_CACHE_DIR=/host/var/cache/uv-cache + GITHUB_WORKSPACE=/host${{ github.workspace }} + SCCACHE_STATS_FILE=/host${{ github.workspace }}/sccache-stats-core-${{ matrix.python-version }}.json + SCCACHE_DIR=/host/${{ env.SCCACHE_DIR }} + SCCACHE_LOG=info + SCCACHE_IDLE_TIMEOUT=0 + SCCACHE_CACHE_READ_TIMEOUT_SECS=10 + ${{ env.SCCACHE_GHA_CIBW_ENV }} + # No CIBW_BEFORE_BUILD_LINUX pip upgrade: build[uv] never invokes pip. + CIBW_CONTAINER_ENGINE: "docker; create_args: --init" + # See the cuda.bindings step above for the repair / stats-file approach. + CIBW_REPAIR_WHEEL_COMMAND_LINUX: > + sccache --show-config && + sccache --show-stats && + sccache --show-stats --stats-format=json > /host${{ github.workspace }}/sccache-stats-core-${{ matrix.python-version }}.json && + /host${{ github.workspace }}/ci/tools/chown-sccache-files.sh && + auditwheel repair -w {dest_dir} {wheel} + # cuda.core does not hard-depend on cuda-bindings (it is an extra). + # The test builder imports it; UV_CONSTRAINT pins the local wheel. + CIBW_TEST_REQUIRES: "cython>=3.2.5,<3.3 setuptools>=80.0.0 cuda-bindings" + CIBW_TEST_COMMAND_LINUX: > + bash /host${{ github.workspace }}/ci/tools/build-cython-tests-in-cibw.sh + {package}/tests/cython + /host${{ github.workspace }}/cuda_core/tests/cython + run: | + SECONDS=0 + cibuildwheel --output-dir "${CUDA_CORE_ARTIFACTS_DIR}" ./cuda_core/ + echo "=== cuda.core build time: ${SECONDS}s ===" + + - name: Recover cuda.core sccache stats + if: always() + run: | + # If the build was cancelled before CIBW_REPAIR_WHEEL_COMMAND_LINUX + # ran, no stats file exists. Try to chown any root-owned files via + # docker exec into the still-running orphan container (idempotent, + # no guard needed). If the container is already gone (build + # completed), the stats file was already chowned during repair. + if [ ! -f "${GITHUB_WORKSPACE}/sccache-stats-core-${{ matrix.python-version }}.json" ]; then + CONTAINER_ID="$(docker ps -q --filter "name=cibuildwheel-" | head -n1)" + if [ -n "${CONTAINER_ID}" ]; then + docker exec "${CONTAINER_ID}" "/host${GITHUB_WORKSPACE}/ci/tools/chown-sccache-files.sh" || echo "(docker exec failed)" + fi + fi + + - name: Report sccache stats (cuda.core) + if: always() + uses: ./.github/actions/sccache-summary + with: + json-file: sccache-stats-core-${{ matrix.python-version }}.json + label: "cuda.core" + build-step: "Build cuda.core wheel" + + - name: List cuda.core artifacts + run: | + ls -lahR "${CUDA_CORE_ARTIFACTS_DIR}" + ls -lah "${CUDA_CORE_CYTHON_TESTS_DIR}"/test_*.so + + # cuda.pathfinder is a pure-Python wheel, so every matrix job produces + # the same file. Upload it once from the lowest Python-version job. + - name: Upload cuda.pathfinder build artifact + if: ${{ matrix.python-version == '3.12' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: cuda-pathfinder-wheel + path: cuda_pathfinder/cuda_pathfinder-*.whl + if-no-files-found: error + + - name: Upload cuda.bindings build artifacts + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }} + path: ${{ env.CUDA_BINDINGS_ARTIFACTS_DIR }}/*.whl + if-no-files-found: error + + - name: Upload cuda.bindings Cython tests + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_BINDINGS_ARTIFACT_NAME }}-tests + path: ${{ env.CUDA_BINDINGS_CYTHON_TESTS_DIR }}/test_*.so + if-no-files-found: error + + - name: Upload cuda.core build artifacts + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }} + path: ${{ env.CUDA_CORE_ARTIFACTS_DIR }}/*.whl + if-no-files-found: error + + - name: Upload cuda.core Cython tests + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ env.CUDA_CORE_ARTIFACT_NAME }}-tests + path: ${{ env.CUDA_CORE_CYTHON_TESTS_DIR }}/test_*.so + if-no-files-found: error + + - name: Kill any orphaned cibuildwheel containers + # When the job is cancelled or cibuildwheel's Python process is killed + # abruptly, its atexit handler may not run, leaving the manylinux + # container running on the host. Kill all cibuildwheel-* containers + # before touching workspace files so subsequent matrix jobs start clean. + if: always() + run: | + sccache --stop-server 2>/dev/null || true + docker ps -q --filter "name=cibuildwheel-" | xargs -r docker kill || true + docker ps -aq --filter "name=cibuildwheel-" | xargs -r docker rm || true diff --git a/.github/workflows/ci-linux-amd64.yml b/.github/workflows/ci-linux-amd64.yml new file mode 100644 index 00000000000..1bd44b2fc6a --- /dev/null +++ b/.github/workflows/ci-linux-amd64.yml @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Linux AMD64" + +on: + push: + branches: + - "pull-request/[0-9]+" + workflow_dispatch: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + runbook: + uses: ./.github/workflows/ci-linux.yml + with: + host-platform: linux-64 + + wheels: + uses: ./.github/workflows/ci-linux-wheel.yml + with: + host-platform: linux-64 diff --git a/.github/workflows/ci-linux-arm64.yml b/.github/workflows/ci-linux-arm64.yml new file mode 100644 index 00000000000..36807d9633a --- /dev/null +++ b/.github/workflows/ci-linux-arm64.yml @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Linux ARM64" + +on: + push: + branches: + - "pull-request/[0-9]+" + workflow_dispatch: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + runbook: + uses: ./.github/workflows/ci-linux.yml + with: + host-platform: linux-aarch64 + + wheels: + uses: ./.github/workflows/ci-linux-wheel.yml + with: + host-platform: linux-aarch64 diff --git a/.github/workflows/ci-linux-wheel.yml b/.github/workflows/ci-linux-wheel.yml new file mode 100644 index 00000000000..ff0cbe8a779 --- /dev/null +++ b/.github/workflows/ci-linux-wheel.yml @@ -0,0 +1,380 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Linux wheels" + +on: + workflow_call: + inputs: + host-platform: + description: Linux host platform (`linux-64` or `linux-aarch64`) + required: true + type: string + +permissions: + contents: read + +env: + PYTHON_VERSION: '3.13' + +jobs: + build-wheels: + name: Build installed-test wheels + if: ${{ github.repository_owner == 'nvidia-dev' }} + runs-on: + group: nv-cpu-general-internal + labels: ${{ inputs.host-platform == 'linux-aarch64' && 'linux-arm64-cpu16-internal' || 'linux-amd64-cpu16-internal' }} + timeout-minutes: ${{ inputs.host-platform == 'linux-aarch64' && 180 || 120 }} + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} + env: + HOST_PLATFORM: ${{ inputs.host-platform }} + EXPECTED_MACHINE: ${{ inputs.host-platform == 'linux-aarch64' && 'aarch64' || 'x86_64' }} + KITPICK_ARCHITECTURE: ${{ inputs.host-platform == 'linux-aarch64' && 'linux-aarch64' || 'linux-64' }} + KITPICK_INSTALLER_GLOB: ${{ inputs.host-platform == 'linux-aarch64' && 'cuda_*_linux_sbsa_kitpick*.run' || 'cuda_*_linux_kitpick*.run' }} + steps: + - name: Checkout cuda-python-private + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # setuptools-scm needs tags and complete commit ancestry. + fetch-depth: 0 + # cuda.core builds against the pinned CCCL headers. + submodules: true + persist-credentials: false + + - name: Resolve CTK kitpick + uses: ./.github/actions/resolve-ctk-next + + - name: Verify Linux runner architecture + run: | + case "$HOST_PLATFORM" in + linux-64|linux-aarch64) ;; + *) + echo "::error title=Unsupported Linux host platform::Expected linux-64 or linux-aarch64, got '$HOST_PLATFORM'." + exit 1 + ;; + esac + + actual_machine="$(uname -m)" + if [[ "$actual_machine" != "$EXPECTED_MACHINE" ]]; then + echo "::error title=Unexpected runner architecture::Expected '$EXPECTED_MACHINE', got '$actual_machine'." + exit 1 + fi + + uname -a + df -h "$GITHUB_WORKSPACE" + + - name: Set up Python 3.13 + id: host-python + uses: ./.github/actions/setup-hardened-python + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Download configured CUDA Linux kitpick + run: | + download_dir="$RUNNER_TEMP/kitpicks" + mkdir -p "$download_dir" + cd "$download_dir" + python3 "$GITHUB_WORKSPACE/qa/forge/download_from_kitpicks.py" \ + "$CUDA_KITPICK_VERSION" \ + "$CUDA_KITPICK" \ + --arch="$KITPICK_ARCHITECTURE" + + mapfile -t installers < <(find "$download_dir" -maxdepth 1 -type f -name "$KITPICK_INSTALLER_GLOB" -print) + if ((${#installers[@]} != 1)); then + printf 'Expected exactly one %s kitpick installer, found %d:\n' "$HOST_PLATFORM" "${#installers[@]}" >&2 + printf ' %s\n' "${installers[@]}" >&2 + exit 1 + fi + + chmod +x "${installers[0]}" + ls -lh "${installers[0]}" + echo "CUDA_INSTALLER=${installers[0]}" >> "$GITHUB_ENV" + + - name: Install selected CUDA toolkit for wheel builds + run: | + cuda_root="$RUNNER_TEMP/cuda-$CUDA_VERSION" + "$CUDA_INSTALLER" \ + --toolkit \ + --toolkitpath="$cuda_root" \ + --silent \ + --no-man-page \ + --override + + test -d "$cuda_root" + "$cuda_root/bin/nvcc" --version + echo "CUDA_PATH=$cuda_root" >> "$GITHUB_ENV" + echo "CUDA_HOME=$cuda_root" >> "$GITHUB_ENV" + echo "CUDA_PYTHON_PARALLEL_LEVEL=$(nproc)" >> "$GITHUB_ENV" + + - name: Install wheel build tools + run: python3 -m pip install --upgrade pip twine + + - name: Build cuda.pathfinder wheel + run: | + mkdir -p wheelhouse + python3 -m pip wheel --verbose --no-deps --wheel-dir wheelhouse ./cuda_pathfinder + + - name: Constrain cuda.bindings to the local cuda.pathfinder wheel + run: | + pathfinder_wheels=(wheelhouse/cuda_pathfinder-*.whl) + test "${#pathfinder_wheels[@]}" -eq 1 + test -f "${pathfinder_wheels[0]}" + mkdir -p wheel-constraints + pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")" + printf 'cuda-pathfinder @ %s\n' "$pathfinder_uri" > wheel-constraints/cuda-bindings.txt + + - name: Build cuda.bindings wheel + uses: pypa/cibuildwheel@b9e566a2b284570af229f6c2a33673410d0389a3 # v4.3.4 + with: + package-dir: ./cuda_bindings_13 + output-dir: wheelhouse + extras: uv + python-path: ${{ steps.host-python.outputs.python-path }} + env: + CIBW_BUILD: cp313-* + CIBW_ARCHS_LINUX: native + # build[uv]: uv, not the build interpreter's ssl module, does all downloads. + CIBW_BUILD_FRONTEND: "build[uv]" + CIBW_ENVIRONMENT_LINUX: > + CUDA_PATH=/host${{ runner.temp }}/cuda-${{ env.CUDA_VERSION }} + CUDA_HOME=/host${{ runner.temp }}/cuda-${{ env.CUDA_VERSION }} + UV_BUILD_CONSTRAINT=/host${{ github.workspace }}/wheel-constraints/cuda-bindings.txt + UV_CONSTRAINT=/host${{ github.workspace }}/wheel-constraints/cuda-bindings.txt + CIBW_ENVIRONMENT_PASS_LINUX: CUDA_PYTHON_PARALLEL_LEVEL + + - name: Constrain cuda.core to the local dependency wheels + run: | + pathfinder_wheels=(wheelhouse/cuda_pathfinder-*.whl) + bindings_wheels=(wheelhouse/cuda_bindings-"$CUDA_MAJOR".*.whl) + test "${#pathfinder_wheels[@]}" -eq 1 + test "${#bindings_wheels[@]}" -eq 1 + test -f "${pathfinder_wheels[0]}" + test -f "${bindings_wheels[0]}" + pathfinder_uri="file:///host$(realpath "${pathfinder_wheels[0]}")" + bindings_uri="file:///host$(realpath "${bindings_wheels[0]}")" + { + printf 'cuda-pathfinder @ %s\n' "$pathfinder_uri" + printf 'cuda-bindings @ %s\n' "$bindings_uri" + } > wheel-constraints/cuda-core.txt + + - name: Build cuda.core wheel + uses: pypa/cibuildwheel@b9e566a2b284570af229f6c2a33673410d0389a3 # v4.3.4 + with: + package-dir: ./cuda_core + output-dir: wheelhouse + extras: uv + python-path: ${{ steps.host-python.outputs.python-path }} + env: + CIBW_BUILD: cp313-* + CIBW_ARCHS_LINUX: native + # build[uv]: uv, not the build interpreter's ssl module, does all downloads. + CIBW_BUILD_FRONTEND: "build[uv]" + CIBW_ENVIRONMENT_LINUX: > + CUDA_PATH=/host${{ runner.temp }}/cuda-${{ env.CUDA_VERSION }} + CUDA_HOME=/host${{ runner.temp }}/cuda-${{ env.CUDA_VERSION }} + CUDA_CORE_BUILD_MAJOR=${{ env.CUDA_MAJOR }} + UV_BUILD_CONSTRAINT=/host${{ github.workspace }}/wheel-constraints/cuda-core.txt + UV_CONSTRAINT=/host${{ github.workspace }}/wheel-constraints/cuda-core.txt + CIBW_ENVIRONMENT_PASS_LINUX: CUDA_PYTHON_PARALLEL_LEVEL + + - name: Check wheel artifacts + run: | + ls -lh wheelhouse + test "$(find wheelhouse -maxdepth 1 -type f -name '*.whl' | wc -l)" -eq 3 + python3 -m twine check --strict wheelhouse/*.whl + + - name: Upload wheel artifacts + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ctk-next-${{ inputs.host-platform }}-wheels-${{ github.sha }} + path: wheelhouse/*.whl + if-no-files-found: error + retention-days: 14 + + test-wheels: + name: Test installed wheels + needs: build-wheels + if: ${{ github.repository_owner == 'nvidia-dev' }} + runs-on: + group: ${{ inputs.host-platform == 'linux-aarch64' && 'nv-gpu-arm64-l4-1gpu-internal' || 'nv-gpu-general-internal' }} + labels: ${{ inputs.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-l4-latest-1-internal' || 'linux-amd64-gpu-l4-latest-1-internal' }} + timeout-minutes: ${{ inputs.host-platform == 'linux-aarch64' && 180 || 120 }} + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} + env: + HOST_PLATFORM: ${{ inputs.host-platform }} + EXPECTED_MACHINE: ${{ inputs.host-platform == 'linux-aarch64' && 'aarch64' || 'x86_64' }} + DRIVER_URL: ${{ inputs.host-platform == 'linux-aarch64' && 'https://kitmaker-web.nvidia.com/kitpicks/nvidia-driver-r620/TRD1/018/local_installers/NVIDIA-Linux-aarch64-620.43.run' || 'https://kitmaker-web.nvidia.com/kitpicks/nvidia-driver-r620/TRD1/018/local_installers/NVIDIA-Linux-x86_64-620.43.run' }} + DRIVER_SHA256: ${{ inputs.host-platform == 'linux-aarch64' && 'fdac0a85d2fe656d00ec22b46508fac731770b6fc6850fa8519a080c88735f4f' || 'a3e551e7996fbea2fb2d29997f027319bbcef874d5b411ecb640319fe936de7b' }} + KITPICK_ARCHITECTURE: ${{ inputs.host-platform == 'linux-aarch64' && 'linux-aarch64' || 'linux-64' }} + KITPICK_INSTALLER_GLOB: ${{ inputs.host-platform == 'linux-aarch64' && 'cuda_*_linux_sbsa_kitpick*.run' || 'cuda_*_linux_kitpick*.run' }} + container: + image: ubuntu:24.04 + options: -u root --security-opt seccomp=unconfined --shm-size 16g --privileged --pid=host + env: + NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} + PIP_CACHE_DIR: /tmp/pip-cache + steps: + - name: Install system dependencies + run: | + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install \ + --no-install-recommends \ + --yes \ + build-essential \ + ca-certificates \ + git \ + libegl1 \ + libgl1 \ + util-linux \ + wget \ + xz-utils + + - name: Checkout cuda-python-private + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + # cuda.core builds against the pinned CCCL headers. + submodules: true + persist-credentials: false + + - name: Resolve CTK kitpick + uses: ./.github/actions/resolve-ctk-next + + - name: Configure Git safe directory + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Verify Linux runner architecture + run: | + actual_machine="$(uname -m)" + if [[ "$actual_machine" != "$EXPECTED_MACHINE" ]]; then + echo "::error title=Unexpected runner architecture::Expected '$EXPECTED_MACHINE', got '$actual_machine'." + exit 1 + fi + uname -a + df -h "$GITHUB_WORKSPACE" + + - name: Install NVIDIA driver 620.43 + env: + DRIVER: '620.43' + GPU_TYPE: l4 + run: ./ci/tools/install_gpu_driver.sh + + - name: Set up Python 3.13 + uses: ./.github/actions/setup-hardened-python + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Download configured CUDA Linux kitpick + run: | + download_dir="$RUNNER_TEMP/kitpicks" + mkdir -p "$download_dir" + cd "$download_dir" + python3 "$GITHUB_WORKSPACE/qa/forge/download_from_kitpicks.py" \ + "$CUDA_KITPICK_VERSION" \ + "$CUDA_KITPICK" \ + --arch="$KITPICK_ARCHITECTURE" + + mapfile -t installers < <(find "$download_dir" -maxdepth 1 -type f -name "$KITPICK_INSTALLER_GLOB" -print) + if ((${#installers[@]} != 1)); then + printf 'Expected exactly one %s kitpick installer, found %d:\n' "$HOST_PLATFORM" "${#installers[@]}" >&2 + printf ' %s\n' "${installers[@]}" >&2 + exit 1 + fi + + chmod +x "${installers[0]}" + ls -lh "${installers[0]}" + echo "CUDA_INSTALLER=${installers[0]}" >> "$GITHUB_ENV" + + - name: Install and configure selected CUDA toolkit + run: | + cuda_root="/usr/local/cuda-$CUDA_VERSION" + "$CUDA_INSTALLER" \ + --toolkit \ + --toolkitpath="$cuda_root" \ + --silent \ + --no-man-page \ + --override + + test -d "$cuda_root" + printf '%s\n' "$cuda_root/lib64" > /etc/ld.so.conf.d/ctk-next.conf + ldconfig + echo "CUDA_PATH=$cuda_root" >> "$GITHUB_ENV" + echo "CUDA_HOME=$cuda_root" >> "$GITHUB_ENV" + echo "$cuda_root/bin" >> "$GITHUB_PATH" + "$cuda_root/bin/nvcc" --version + ldconfig -p | grep -F libnvrtc.so + + - name: Download wheel artifacts + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ctk-next-${{ inputs.host-platform }}-wheels-${{ github.sha }} + path: wheelhouse + + - name: Install only the wheel artifacts + run: | + pathfinder_wheels=(wheelhouse/cuda_pathfinder-*.whl) + bindings_wheels=(wheelhouse/cuda_bindings-*.whl) + core_wheels=(wheelhouse/cuda_core-*.whl) + test "${#pathfinder_wheels[@]}" -eq 1 + test "${#bindings_wheels[@]}" -eq 1 + test "${#core_wheels[@]}" -eq 1 + + python3 -m venv "$RUNNER_TEMP/wheel-test-venv" + echo "WHEEL_TEST_VENV=$RUNNER_TEMP/wheel-test-venv" >> "$GITHUB_ENV" + "$RUNNER_TEMP/wheel-test-venv/bin/python" -m pip install --upgrade pip + "$RUNNER_TEMP/wheel-test-venv/bin/python" -m pip install \ + "${pathfinder_wheels[0]}" \ + --group ./cuda_pathfinder/pyproject.toml:test + "$RUNNER_TEMP/wheel-test-venv/bin/python" -m pip install \ + "${bindings_wheels[0]}" \ + --group ./cuda_bindings_13/pyproject.toml:test + "$RUNNER_TEMP/wheel-test-venv/bin/python" -m pip install \ + "${core_wheels[0]}" \ + --group ./cuda_core/pyproject.toml:test + "$RUNNER_TEMP/wheel-test-venv/bin/python" -m pip check + + - name: Build wheel-dependent test artifacts + run: | + export VIRTUAL_ENV="$WHEEL_TEST_VENV" + export PATH="$WHEEL_TEST_VENV/bin:$CUDA_PATH/bin:$PATH" + bash cuda_bindings_13/tests/cython/build_tests.sh + bash cuda_core/tests/cython/build_tests.sh + + - name: Verify wheel imports + run: | + "$WHEEL_TEST_VENV/bin/python" - <<'PY' + import os + from pathlib import Path + + import cuda.bindings + import cuda.core + import cuda.pathfinder + + workspace = Path(os.environ["GITHUB_WORKSPACE"]).resolve() + for module in (cuda.pathfinder, cuda.bindings, cuda.core): + module_path = Path(module.__file__).resolve() + print(f"{module.__name__}: {module_path}") + if module_path.is_relative_to(workspace): + raise SystemExit(f"{module.__name__} imported from the checkout: {module_path}") + PY + + - name: Test installed wheels + run: | + export VIRTUAL_ENV="$WHEEL_TEST_VENV" + export PATH="$WHEEL_TEST_VENV/bin:$CUDA_PATH/bin:$PATH" + test_result=0 + + # Keep child Python processes in the checkout root, away from package sources. + "$WHEEL_TEST_VENV/bin/pytest" -ra -s -vv cuda_pathfinder/tests/ || test_result=1 + "$WHEEL_TEST_VENV/bin/pytest" -ra -s -vv cuda_bindings_13/tests/ || test_result=1 + CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM=1 "$WHEEL_TEST_VENV/bin/pytest" -ra -s -vv cuda_bindings_13/tests/ || test_result=1 + "$WHEEL_TEST_VENV/bin/pytest" -ra -s -vv cuda_bindings_13/tests/cython/ || test_result=1 + "$WHEEL_TEST_VENV/bin/pytest" -ra -s -vv cuda_core/tests/ || test_result=1 + "$WHEEL_TEST_VENV/bin/pytest" -ra -s -vv cuda_core/tests/cython/ || test_result=1 + + exit "$test_result" diff --git a/.github/workflows/ci-linux.yml b/.github/workflows/ci-linux.yml new file mode 100644 index 00000000000..c141e35e550 --- /dev/null +++ b/.github/workflows/ci-linux.yml @@ -0,0 +1,159 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Linux runbook" + +on: + workflow_call: + inputs: + host-platform: + description: Linux host platform (`linux-64` or `linux-aarch64`) + required: true + type: string + +permissions: + contents: read + +jobs: + build-and-test: + name: Build and test cuda-bindings and cuda-core + if: ${{ github.repository_owner == 'nvidia-dev' }} + runs-on: + group: ${{ inputs.host-platform == 'linux-aarch64' && 'nv-gpu-arm64-l4-1gpu-internal' || 'nv-gpu-general-internal' }} + labels: ${{ inputs.host-platform == 'linux-aarch64' && 'linux-arm64-gpu-l4-latest-1-internal' || 'linux-amd64-gpu-l4-latest-1-internal' }} + timeout-minutes: ${{ inputs.host-platform == 'linux-aarch64' && 180 || 120 }} + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} + env: + GCM_INTERACTIVE: "never" + GIT_TERMINAL_PROMPT: "0" + HOST_PLATFORM: ${{ inputs.host-platform }} + EXPECTED_MACHINE: ${{ inputs.host-platform == 'linux-aarch64' && 'aarch64' || 'x86_64' }} + DRIVER_URL: ${{ inputs.host-platform == 'linux-aarch64' && 'https://kitmaker-web.nvidia.com/kitpicks/nvidia-driver-r620/TRD1/018/local_installers/NVIDIA-Linux-aarch64-620.43.run' || 'https://kitmaker-web.nvidia.com/kitpicks/nvidia-driver-r620/TRD1/018/local_installers/NVIDIA-Linux-x86_64-620.43.run' }} + DRIVER_SHA256: ${{ inputs.host-platform == 'linux-aarch64' && 'fdac0a85d2fe656d00ec22b46508fac731770b6fc6850fa8519a080c88735f4f' || 'a3e551e7996fbea2fb2d29997f027319bbcef874d5b411ecb640319fe936de7b' }} + KITPICK_ARCHITECTURE: ${{ inputs.host-platform == 'linux-aarch64' && 'linux-aarch64' || 'linux-64' }} + KITPICK_INSTALLER_GLOB: ${{ inputs.host-platform == 'linux-aarch64' && 'cuda_*_linux_sbsa_kitpick*.run' || 'cuda_*_linux_kitpick*.run' }} + PYTHON_VERSION: '3.13' + RUN_TESTS: 'true' + container: + image: ubuntu:24.04 + options: -u root --security-opt seccomp=unconfined --shm-size 16g --privileged --pid=host + env: + NVIDIA_VISIBLE_DEVICES: ${{ env.NVIDIA_VISIBLE_DEVICES }} + PIP_CACHE_DIR: /tmp/pip-cache + steps: + - name: Install system dependencies + run: | + apt-get update + DEBIAN_FRONTEND=noninteractive apt-get install \ + --no-install-recommends \ + --yes \ + build-essential \ + ca-certificates \ + git \ + libegl1 \ + libgl1 \ + util-linux \ + wget \ + xz-utils + + - name: Checkout cuda-python-private + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # setuptools-scm needs tags and complete commit ancestry. + fetch-depth: 0 + # cuda.core builds against the pinned CCCL headers. + submodules: true + persist-credentials: false + + - name: Resolve CTK kitpick + uses: ./.github/actions/resolve-ctk-next + + - name: Configure Git safe directory + run: git config --global --add safe.directory "$GITHUB_WORKSPACE" + + - name: Verify Linux runner architecture + run: | + case "$HOST_PLATFORM" in + linux-64|linux-aarch64) ;; + *) + echo "::error title=Unsupported Linux host platform::Expected linux-64 or linux-aarch64, got '$HOST_PLATFORM'." + exit 1 + ;; + esac + + actual_machine="$(uname -m)" + if [[ "$actual_machine" != "$EXPECTED_MACHINE" ]]; then + echo "::error title=Unexpected runner architecture::Expected '$EXPECTED_MACHINE', got '$actual_machine'." + exit 1 + fi + + uname -a + df -h "$GITHUB_WORKSPACE" + + - name: Install NVIDIA driver 620.43 + env: + DRIVER: '620.43' + GPU_TYPE: l4 + run: ./ci/tools/install_gpu_driver.sh + + - name: Set up Python 3.13 + uses: ./.github/actions/setup-hardened-python + with: + python-version: ${{ env.PYTHON_VERSION }} + + - name: Verify Python architecture + run: | + python3 -VV + python3 -c "import os, platform, sys; machine = platform.machine().lower(); expected = os.environ['EXPECTED_MACHINE']; print('Python machine:', machine); sys.exit(machine != expected)" + + - name: Download configured CUDA Linux kitpick + run: | + download_dir="$RUNNER_TEMP/kitpicks" + mkdir -p "$download_dir" + cd "$download_dir" + python3 "$GITHUB_WORKSPACE/qa/forge/download_from_kitpicks.py" \ + "$CUDA_KITPICK_VERSION" \ + "$CUDA_KITPICK" \ + --arch="$KITPICK_ARCHITECTURE" + + mapfile -t installers < <(find "$download_dir" -maxdepth 1 -type f -name "$KITPICK_INSTALLER_GLOB" -print) + if ((${#installers[@]} != 1)); then + printf 'Expected exactly one %s kitpick installer, found %d:\n' "$HOST_PLATFORM" "${#installers[@]}" >&2 + printf ' %s\n' "${installers[@]}" >&2 + exit 1 + fi + + chmod +x "${installers[0]}" + ls -lh "${installers[0]}" + echo "CUDA_INSTALLER=${installers[0]}" >> "$GITHUB_ENV" + + - name: Install and configure selected CUDA toolkit + run: | + cuda_root="/usr/local/cuda-$CUDA_VERSION" + "$CUDA_INSTALLER" \ + --toolkit \ + --toolkitpath="$cuda_root" \ + --silent \ + --no-man-page \ + --override + + test -d "$cuda_root" + printf '%s\n' "$cuda_root/lib64" > /etc/ld.so.conf.d/ctk-next.conf + ldconfig + "$cuda_root/bin/nvcc" --version + ldconfig -p | grep -F libnvrtc.so + + - name: Build cuda-bindings and cuda-core + run: bash qa/runbook/qa_bindings_linux_build.sh "$CUDA_VERSION" + + - name: Verify build + run: | + TestVenv/bin/python -m pip check + TestVenv/bin/python -c "import cuda.bindings.driver; import cuda.core; import os, platform, sys; sys.exit(platform.machine().lower() != os.environ['EXPECTED_MACHINE'])" + + - name: Test cuda-bindings and cuda-core + if: ${{ env.RUN_TESTS == 'true' }} + run: bash qa/runbook/qa_bindings_linux_tests.sh "$CUDA_VERSION" diff --git a/.github/workflows/ci-windows-amd64.yml b/.github/workflows/ci-windows-amd64.yml new file mode 100644 index 00000000000..73a2f6cb4eb --- /dev/null +++ b/.github/workflows/ci-windows-amd64.yml @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Windows AMD64" + +on: + push: + branches: + - "pull-request/[0-9]+" + workflow_dispatch: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + runbook: + uses: ./.github/workflows/ci-windows.yml + with: + host-platform: win-64 + + wheels: + uses: ./.github/workflows/ci-windows-wheel.yml + with: + host-platform: win-64 diff --git a/.github/workflows/ci-windows-arm64.yml b/.github/workflows/ci-windows-arm64.yml new file mode 100644 index 00000000000..a745ff4ffab --- /dev/null +++ b/.github/workflows/ci-windows-arm64.yml @@ -0,0 +1,29 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Windows ARM64" + +on: + push: + branches: + - "pull-request/[0-9]+" + workflow_dispatch: {} + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + runbook: + uses: ./.github/workflows/ci-windows.yml + with: + host-platform: win-arm64 + + wheels: + uses: ./.github/workflows/ci-windows-wheel.yml + with: + host-platform: win-arm64 diff --git a/.github/workflows/ci-windows-wheel.yml b/.github/workflows/ci-windows-wheel.yml new file mode 100644 index 00000000000..f8312bd25bc --- /dev/null +++ b/.github/workflows/ci-windows-wheel.yml @@ -0,0 +1,381 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Windows wheels" + +on: + workflow_call: + inputs: + host-platform: + description: Windows host platform (win-64 or win-arm64) + required: true + type: string + +permissions: + contents: read + +env: + GIT_VERSION: '2.55.0.3' + PYTHON_VERSION: '3.13' + +jobs: + build-wheels: + name: Build installed-test wheels + if: ${{ github.repository_owner == 'nvidia-dev' }} + runs-on: ${{ inputs.host-platform == 'win-arm64' && 'windows-arm64-1xgb10' || 'windows-amd64-cpu16-internal' }} + timeout-minutes: ${{ inputs.host-platform == 'win-arm64' && 180 || 120 }} + env: + HOST_PLATFORM: ${{ inputs.host-platform }} + EXPECTED_PROCESSOR_ARCHITECTURE: ${{ inputs.host-platform == 'win-arm64' && 'ARM64' || 'AMD64' }} + steps: + # Keep identical to the other "Set up Git for Windows ARM64" steps in .github/workflows. + - name: Set up Git for Windows ARM64 + if: ${{ inputs.host-platform == 'win-arm64' }} + timeout-minutes: 10 + shell: powershell + run: | + if (-not $env:RUNNER_TOOL_CACHE) { + throw "RUNNER_TOOL_CACHE is not set." + } + + $gitRoot = Join-Path $env:RUNNER_TOOL_CACHE "PortableGit\$env:GIT_VERSION\arm64" + $git = Join-Path $gitRoot "cmd\git.exe" + # `shell: bash` steps (e.g. setup-hardened-python) need Git's bash on PATH; + # otherwise bash resolves to the WSL launcher in System32. + $bash = Join-Path $gitRoot "bin\bash.exe" + $complete = "$gitRoot.complete" + if (-not ((Test-Path $git) -and (Test-Path $bash) -and (Test-Path $complete))) { + $archive = Join-Path $env:RUNNER_TEMP "PortableGit-$env:GIT_VERSION-arm64.7z.exe" + $archiveUrl = "https://github.com/git-for-windows/git/releases/download/v2.55.0.windows.3/PortableGit-2.55.0.3-arm64.7z.exe" + $expectedHash = "3bf26b94d9399b16a890776e468334f501742861576cbcdea2d9134643c374bd" + + Invoke-WebRequest -UseBasicParsing -Uri $archiveUrl -OutFile $archive + $actualHash = (Get-FileHash -Path $archive -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actualHash -ne $expectedHash) { + throw "PortableGit checksum mismatch: expected $expectedHash, got $actualHash." + } + + if (Test-Path $gitRoot) { + Remove-Item -Recurse -Force $gitRoot + } + New-Item -ItemType Directory -Force -Path $gitRoot | Out-Null + # PortableGit is a 7-Zip self-extractor; -y suppresses its prompts. + $process = Start-Process -FilePath $archive -ArgumentList @("-y", "-o`"$gitRoot`"") -Wait -PassThru + if ($process.ExitCode -ne 0) { + throw "PortableGit extraction exited with code $($process.ExitCode)." + } + Remove-Item -Force $archive + + foreach ($required in @($git, $bash)) { + if (-not (Test-Path $required)) { + throw "Not found after extracting PortableGit: $required" + } + } + New-Item -ItemType File -Force -Path $complete | Out-Null + } + + & $git version --build-options + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + & $bash --version + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + # Only cmd\ and bin\: usr\bin would shadow MSVC's link.exe and Windows' find.exe. + @((Split-Path $git), (Split-Path $bash)) | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Enable Git symlinks (Windows, must precede checkout) + shell: powershell + run: | + git config --global core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + # A reused runner workspace can override the global setting locally. + if (Test-Path -LiteralPath (Join-Path $env:GITHUB_WORKSPACE ".git")) { + git -C "$env:GITHUB_WORKSPACE" config --local core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + } + + - name: Checkout cuda-python-private + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # setuptools-scm needs tags and complete commit ancestry. + fetch-depth: 0 + # cuda.core builds against the pinned CCCL headers. + submodules: true + persist-credentials: false + + - name: Resolve CTK kitpick + uses: ./.github/actions/resolve-ctk-next + + - name: Verify Windows runner architecture + shell: cmd + run: | + if /I not "%PROCESSOR_ARCHITECTURE%"=="%EXPECTED_PROCESSOR_ARCHITECTURE%" ( + echo Expected %EXPECTED_PROCESSOR_ARCHITECTURE%, got %PROCESSOR_ARCHITECTURE%. + exit /b 1 + ) + + - name: Set up Windows toolchain + id: toolchain + uses: ./.github/actions/setup-ctk-next-windows + with: + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ env.CUDA_VERSION }} + cuda-kitpick-version: ${{ env.CUDA_KITPICK_VERSION }} + cuda-kitpick: ${{ env.CUDA_KITPICK }} + python-version: ${{ env.PYTHON_VERSION }} + + - name: Verify build toolchain + shell: cmd + run: | + where cl.exe || exit /b 1 + cl.exe 2>&1 | findstr /C:"Microsoft (R) C/C++" || exit /b 1 + nvcc --version || exit /b 1 + + - name: Install wheel build tools + shell: powershell + run: python -m pip install --upgrade pip twine "cibuildwheel[uv]==4.3.4" + + - name: Build cuda.pathfinder wheel + shell: powershell + run: | + New-Item -ItemType Directory -Force -Path wheelhouse | Out-Null + python -m pip wheel --verbose --no-deps --wheel-dir wheelhouse ./cuda_pathfinder + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + - name: Constrain cuda.bindings to the local cuda.pathfinder wheel + shell: powershell + run: | + $pathfinderWheels = @(Get-ChildItem wheelhouse\cuda_pathfinder-*.whl) + if ($pathfinderWheels.Count -ne 1) { + throw "Expected exactly one cuda.pathfinder wheel, found $($pathfinderWheels.Count)." + } + New-Item -ItemType Directory -Force -Path wheel-constraints | Out-Null + $pathfinderUri = [System.Uri]::new($pathfinderWheels[0].FullName).AbsoluteUri + $encoding = [System.Text.UTF8Encoding]::new($false) + [System.IO.File]::WriteAllText( + (Join-Path $PWD "wheel-constraints\cuda-bindings.txt"), + "cuda-pathfinder @ $pathfinderUri`n", + $encoding + ) + + - name: Build cuda.bindings wheel + shell: powershell + run: | + python -m cibuildwheel --output-dir wheelhouse ./cuda_bindings_13 + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + env: + CIBW_BUILD: cp313-* + CIBW_ARCHS_WINDOWS: ${{ inputs.host-platform == 'win-arm64' && 'ARM64' || 'AMD64' }} + # build[uv]: uv, not the build interpreter's ssl module, does all downloads. + # Build venvs have no pip; cibuildwheel installs delvewheel itself. + CIBW_BUILD_FRONTEND: "build[uv]" + UV_BUILD_CONSTRAINT: ${{ github.workspace }}\wheel-constraints\cuda-bindings.txt + UV_CONSTRAINT: ${{ github.workspace }}\wheel-constraints\cuda-bindings.txt + + - name: Constrain cuda.core to the local dependency wheels + shell: powershell + run: | + $pathfinderWheels = @(Get-ChildItem wheelhouse\cuda_pathfinder-*.whl) + $bindingsWheels = @(Get-ChildItem wheelhouse\cuda_bindings-*.whl) + if ($pathfinderWheels.Count -ne 1) { + throw "Expected exactly one cuda.pathfinder wheel, found $($pathfinderWheels.Count)." + } + if ($bindingsWheels.Count -ne 1) { + throw "Expected exactly one cuda.bindings wheel, found $($bindingsWheels.Count)." + } + $pathfinderUri = [System.Uri]::new($pathfinderWheels[0].FullName).AbsoluteUri + $bindingsUri = [System.Uri]::new($bindingsWheels[0].FullName).AbsoluteUri + $constraints = @( + "cuda-pathfinder @ $pathfinderUri" + "cuda-bindings @ $bindingsUri" + ) -join "`n" + $encoding = [System.Text.UTF8Encoding]::new($false) + [System.IO.File]::WriteAllText( + (Join-Path $PWD "wheel-constraints\cuda-core.txt"), + "$constraints`n", + $encoding + ) + + - name: Build cuda.core wheel + shell: powershell + run: | + python -m cibuildwheel --output-dir wheelhouse ./cuda_core + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + env: + CIBW_BUILD: cp313-* + CIBW_ARCHS_WINDOWS: ${{ inputs.host-platform == 'win-arm64' && 'ARM64' || 'AMD64' }} + # build[uv]: uv, not the build interpreter's ssl module, does all downloads. + # Build venvs have no pip; cibuildwheel installs delvewheel itself. + CIBW_BUILD_FRONTEND: "build[uv]" + CUDA_CORE_BUILD_MAJOR: ${{ env.CUDA_MAJOR }} + UV_BUILD_CONSTRAINT: ${{ github.workspace }}\wheel-constraints\cuda-core.txt + UV_CONSTRAINT: ${{ github.workspace }}\wheel-constraints\cuda-core.txt + + - name: Check wheel artifacts + shell: powershell + run: | + $wheels = @(Get-ChildItem wheelhouse\*.whl) + $wheels | Format-Table Name, Length + if ($wheels.Count -ne 3) { + throw "Expected exactly three wheel artifacts, found $($wheels.Count)." + } + $wheelPaths = @($wheels | ForEach-Object { $_.FullName }) + python -m twine check --strict @wheelPaths + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + - name: Upload wheel artifacts + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ctk-next-${{ inputs.host-platform }}-wheels-${{ github.sha }} + path: wheelhouse/*.whl + if-no-files-found: error + retention-days: 14 + + test-wheels: + name: Test installed wheels (${{ matrix.runner }}) + needs: build-wheels + if: ${{ github.repository_owner == 'nvidia-dev' }} + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(inputs.host-platform == 'win-arm64' && '["windows-arm64-1xgb10", "windows-arm64-gpu-gb300-latest-1-internal"]' || '["windows-amd64-gpu-l4-latest-1-internal"]') }} + runs-on: ${{ matrix.runner }} + timeout-minutes: ${{ inputs.host-platform == 'win-arm64' && 180 || 120 }} + env: + HOST_PLATFORM: ${{ inputs.host-platform }} + EXPECTED_PROCESSOR_ARCHITECTURE: ${{ inputs.host-platform == 'win-arm64' && 'ARM64' || 'AMD64' }} + steps: + # Keep identical to the other "Set up Git for Windows ARM64" steps in .github/workflows. + - name: Set up Git for Windows ARM64 + if: ${{ inputs.host-platform == 'win-arm64' }} + timeout-minutes: 10 + shell: powershell + run: | + if (-not $env:RUNNER_TOOL_CACHE) { + throw "RUNNER_TOOL_CACHE is not set." + } + + $gitRoot = Join-Path $env:RUNNER_TOOL_CACHE "PortableGit\$env:GIT_VERSION\arm64" + $git = Join-Path $gitRoot "cmd\git.exe" + # `shell: bash` steps (e.g. setup-hardened-python) need Git's bash on PATH; + # otherwise bash resolves to the WSL launcher in System32. + $bash = Join-Path $gitRoot "bin\bash.exe" + $complete = "$gitRoot.complete" + if (-not ((Test-Path $git) -and (Test-Path $bash) -and (Test-Path $complete))) { + $archive = Join-Path $env:RUNNER_TEMP "PortableGit-$env:GIT_VERSION-arm64.7z.exe" + $archiveUrl = "https://github.com/git-for-windows/git/releases/download/v2.55.0.windows.3/PortableGit-2.55.0.3-arm64.7z.exe" + $expectedHash = "3bf26b94d9399b16a890776e468334f501742861576cbcdea2d9134643c374bd" + + Invoke-WebRequest -UseBasicParsing -Uri $archiveUrl -OutFile $archive + $actualHash = (Get-FileHash -Path $archive -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actualHash -ne $expectedHash) { + throw "PortableGit checksum mismatch: expected $expectedHash, got $actualHash." + } + + if (Test-Path $gitRoot) { + Remove-Item -Recurse -Force $gitRoot + } + New-Item -ItemType Directory -Force -Path $gitRoot | Out-Null + # PortableGit is a 7-Zip self-extractor; -y suppresses its prompts. + $process = Start-Process -FilePath $archive -ArgumentList @("-y", "-o`"$gitRoot`"") -Wait -PassThru + if ($process.ExitCode -ne 0) { + throw "PortableGit extraction exited with code $($process.ExitCode)." + } + Remove-Item -Force $archive + + foreach ($required in @($git, $bash)) { + if (-not (Test-Path $required)) { + throw "Not found after extracting PortableGit: $required" + } + } + New-Item -ItemType File -Force -Path $complete | Out-Null + } + + & $git version --build-options + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + & $bash --version + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + # Only cmd\ and bin\: usr\bin would shadow MSVC's link.exe and Windows' find.exe. + @((Split-Path $git), (Split-Path $bash)) | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Enable Git symlinks (Windows, must precede checkout) + shell: powershell + run: | + git config --global core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + # A reused runner workspace can override the global setting locally. + if (Test-Path -LiteralPath (Join-Path $env:GITHUB_WORKSPACE ".git")) { + git -C "$env:GITHUB_WORKSPACE" config --local core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + } + + - name: Checkout cuda-python-private + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + # cuda.core builds against the pinned CCCL headers. + submodules: true + persist-credentials: false + + - name: Set up GB300 MCDM driver and runtime + if: ${{ matrix.runner == 'windows-arm64-gpu-gb300-latest-1-internal' }} + timeout-minutes: 15 + uses: ./.github/actions/setup-woa-gb300 + + - name: Resolve CTK kitpick + uses: ./.github/actions/resolve-ctk-next + + - name: Verify Windows runner architecture + shell: cmd + run: | + if /I not "%PROCESSOR_ARCHITECTURE%"=="%EXPECTED_PROCESSOR_ARCHITECTURE%" ( + echo Expected %EXPECTED_PROCESSOR_ARCHITECTURE%, got %PROCESSOR_ARCHITECTURE%. + exit /b 1 + ) + nvidia-smi || exit /b 1 + + - name: Set up Windows toolchain + id: toolchain + uses: ./.github/actions/setup-ctk-next-windows + with: + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ env.CUDA_VERSION }} + cuda-kitpick-version: ${{ env.CUDA_KITPICK_VERSION }} + cuda-kitpick: ${{ env.CUDA_KITPICK }} + python-version: ${{ env.PYTHON_VERSION }} + + - name: Download wheel artifacts + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ctk-next-${{ inputs.host-platform }}-wheels-${{ github.sha }} + path: wheelhouse + + - name: Test installed wheels + env: + WHEEL_TEST_PYTHON: ${{ steps.toolchain.outputs.python-path }} + shell: powershell + run: | + & ./ci/tools/test_windows_wheels.ps1 -PythonExecutable $env:WHEEL_TEST_PYTHON -PythonVersion $env:PYTHON_VERSION -CudaVersion $env:CUDA_VERSION diff --git a/.github/workflows/ci-windows.yml b/.github/workflows/ci-windows.yml new file mode 100644 index 00000000000..502456c20e9 --- /dev/null +++ b/.github/workflows/ci-windows.yml @@ -0,0 +1,237 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Windows runbook" + +on: + workflow_call: + inputs: + host-platform: + description: Windows host platform (win-64 or win-arm64) + required: true + type: string + +permissions: + contents: read + +jobs: + build-and-test: + name: Build and test cuda-bindings and cuda-core (${{ matrix.runner }}) + if: ${{ github.repository_owner == 'nvidia-dev' }} + strategy: + fail-fast: false + matrix: + runner: ${{ fromJSON(inputs.host-platform == 'win-arm64' && '["windows-arm64-1xgb10", "windows-arm64-gpu-gb300-latest-1-internal"]' || '["windows-amd64-gpu-l4-latest-1-internal"]') }} + runs-on: ${{ matrix.runner }} + timeout-minutes: ${{ inputs.host-platform == 'win-arm64' && 180 || 120 }} + env: + GCM_INTERACTIVE: "never" + GIT_TERMINAL_PROMPT: "0" + HOST_PLATFORM: ${{ inputs.host-platform }} + EXPECTED_PROCESSOR_ARCHITECTURE: ${{ inputs.host-platform == 'win-arm64' && 'ARM64' || 'AMD64' }} + GIT_VERSION: '2.55.0.3' + PYTHON_VERSION: '3.13' + steps: + # Keep identical to the other "Set up Git for Windows ARM64" steps in .github/workflows. + - name: Set up Git for Windows ARM64 + if: ${{ inputs.host-platform == 'win-arm64' }} + timeout-minutes: 10 + shell: powershell + run: | + if (-not $env:RUNNER_TOOL_CACHE) { + throw "RUNNER_TOOL_CACHE is not set." + } + + $gitRoot = Join-Path $env:RUNNER_TOOL_CACHE "PortableGit\$env:GIT_VERSION\arm64" + $git = Join-Path $gitRoot "cmd\git.exe" + # `shell: bash` steps (e.g. setup-hardened-python) need Git's bash on PATH; + # otherwise bash resolves to the WSL launcher in System32. + $bash = Join-Path $gitRoot "bin\bash.exe" + $complete = "$gitRoot.complete" + if (-not ((Test-Path $git) -and (Test-Path $bash) -and (Test-Path $complete))) { + $archive = Join-Path $env:RUNNER_TEMP "PortableGit-$env:GIT_VERSION-arm64.7z.exe" + $archiveUrl = "https://github.com/git-for-windows/git/releases/download/v2.55.0.windows.3/PortableGit-2.55.0.3-arm64.7z.exe" + $expectedHash = "3bf26b94d9399b16a890776e468334f501742861576cbcdea2d9134643c374bd" + + Invoke-WebRequest -UseBasicParsing -Uri $archiveUrl -OutFile $archive + $actualHash = (Get-FileHash -Path $archive -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actualHash -ne $expectedHash) { + throw "PortableGit checksum mismatch: expected $expectedHash, got $actualHash." + } + + if (Test-Path $gitRoot) { + Remove-Item -Recurse -Force $gitRoot + } + New-Item -ItemType Directory -Force -Path $gitRoot | Out-Null + # PortableGit is a 7-Zip self-extractor; -y suppresses its prompts. + $process = Start-Process -FilePath $archive -ArgumentList @("-y", "-o`"$gitRoot`"") -Wait -PassThru + if ($process.ExitCode -ne 0) { + throw "PortableGit extraction exited with code $($process.ExitCode)." + } + Remove-Item -Force $archive + + foreach ($required in @($git, $bash)) { + if (-not (Test-Path $required)) { + throw "Not found after extracting PortableGit: $required" + } + } + New-Item -ItemType File -Force -Path $complete | Out-Null + } + + & $git version --build-options + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + & $bash --version + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + # Only cmd\ and bin\: usr\bin would shadow MSVC's link.exe and Windows' find.exe. + @((Split-Path $git), (Split-Path $bash)) | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Enable Git symlinks (Windows, must precede checkout) + shell: powershell + run: | + git config --global core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + # A reused runner workspace can override the global setting locally. + if (Test-Path -LiteralPath (Join-Path $env:GITHUB_WORKSPACE ".git")) { + git -C "$env:GITHUB_WORKSPACE" config --local core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + } + + - name: Checkout ${{ github.event.repository.name }} + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # setuptools-scm needs tags and complete commit ancestry. + fetch-depth: 0 + # cuda.core builds against the pinned CCCL headers. + submodules: true + persist-credentials: false + + - name: Resolve CTK kitpick + uses: ./.github/actions/resolve-ctk-next + + - name: Verify Git checkout + shell: powershell + run: | + git version --build-options + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + $insideWorkTree = git rev-parse --is-inside-work-tree + if ($LASTEXITCODE -ne 0 -or $insideWorkTree -ne "true") { + throw "actions/checkout did not create a Git worktree." + } + git rev-parse --verify HEAD + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + $tagPatterns = @( + "v*[0-9]*" + "cuda-core-v*[0-9]*" + "cuda-pathfinder-v*[0-9]*" + ) + foreach ($tagPattern in $tagPatterns) { + git describe --dirty --tags --long --match $tagPattern + if ($LASTEXITCODE -ne 0) { + throw "Git history does not contain a tag matching: $tagPattern" + } + } + + - name: Set up GB300 MCDM driver and runtime + if: ${{ matrix.runner == 'windows-arm64-gpu-gb300-latest-1-internal' }} + timeout-minutes: 15 + uses: ./.github/actions/setup-woa-gb300 + + - name: Verify Windows runner architecture + shell: cmd + run: | + if /I not "%HOST_PLATFORM%"=="win-64" if /I not "%HOST_PLATFORM%"=="win-arm64" ( + echo Unsupported Windows host platform: %HOST_PLATFORM%. + exit /b 1 + ) + if /I not "%PROCESSOR_ARCHITECTURE%"=="%EXPECTED_PROCESSOR_ARCHITECTURE%" ( + echo Expected %EXPECTED_PROCESSOR_ARCHITECTURE%, got %PROCESSOR_ARCHITECTURE%. + exit /b 1 + ) + nvidia-smi || exit /b 1 + + - name: Set up Windows toolchain + uses: ./.github/actions/setup-ctk-next-windows + with: + host-platform: ${{ inputs.host-platform }} + cuda-version: ${{ env.CUDA_VERSION }} + cuda-kitpick-version: ${{ env.CUDA_KITPICK_VERSION }} + cuda-kitpick: ${{ env.CUDA_KITPICK }} + python-version: ${{ env.PYTHON_VERSION }} + + - name: Build cuda-bindings and cuda-core + shell: cmd + env: + PYTHON_CMD: python + run: call qa\runbook\qa_bindings_windows_build.cmd %CUDA_VERSION% + + - name: Verify build + shell: powershell + run: | + TestVenv\Scripts\python -m pip check + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + TestVenv\Scripts\python -c "import cuda.bindings.driver; import cuda.core; import os, sys, sysconfig; sys.exit(sysconfig.get_platform() != os.environ['PYTHON_PLATFORM'])" + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + $head = git rev-parse HEAD + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + $metadataCheck = @' + import importlib.metadata + import sys + + from cuda.bindings._version import __commit_id__ as bindings_commit + from cuda.core._version import __commit_id__ as core_commit + from cuda.pathfinder._version import __commit_id__ as pathfinder_commit + + packages = { + "cuda-bindings": bindings_commit, + "cuda-core": core_commit, + "cuda-pathfinder": pathfinder_commit, + } + head = sys.argv[1] + for package, commit in packages.items(): + print(f"{package} {importlib.metadata.version(package)} ({commit})") + mismatches = { + package: commit + for package, commit in packages.items() + if commit is None or not head.startswith(commit.removeprefix("g")) + } + if mismatches: + raise SystemExit(f"Package versions were not derived from HEAD {head}: {mismatches}") + '@ + $metadataCheckPath = Join-Path $env:RUNNER_TEMP "verify-scm-metadata.py" + $metadataCheck | Out-File -FilePath $metadataCheckPath -Encoding utf8 + TestVenv\Scripts\python $metadataCheckPath $head + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + $cythonTests = Get-ChildItem cuda_bindings_13\tests\cython -Filter "test_*.pyd" + if ($cythonTests.Count -eq 0) { + throw "The cuda.bindings Cython tests were not built." + } + + - name: Test cuda-bindings and cuda-core + shell: cmd + run: call qa\runbook\qa_bindings_windows_tests.cmd %CUDA_VERSION% diff --git a/.github/workflows/ctk-next-public-main-prs.yml b/.github/workflows/ctk-next-public-main-prs.yml new file mode 100644 index 00000000000..f5a22595d8d --- /dev/null +++ b/.github/workflows/ctk-next-public-main-prs.yml @@ -0,0 +1,225 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# WORK IN PROGRESS: this workflow currently validates the runner and external +# dependencies needed for ctk-next public-main PR generation; it does not create +# PRs yet. Keeping it under its permanent filename registers the workflow with +# GitHub, allowing development branches to use workflow_dispatch with --ref +# while the implementation is built incrementally. + +name: "Prepare ctk-next public-main PR group" + +on: + workflow_dispatch: + +permissions: + contents: read + +jobs: + # Milestone 0: prove that the workflow can start on the intended runner. + # Later milestones will replace this probe with the PR-group preparation. + runner-smoke-test: + name: Runner smoke test + runs-on: + group: nv-cpu-general-internal + labels: linux-amd64-cpu16-internal + timeout-minutes: 10 + steps: + - name: Checkout repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + # Forge operations require tags and complete commit ancestry. + fetch-depth: 0 + persist-credentials: false + + - name: Report runner environment + if: ${{ !cancelled() }} + run: | + echo "Hello world from GitHub Actions." + echo "Repository: $GITHUB_REPOSITORY" + echo "Ref: $GITHUB_REF" + echo "Commit: $(git rev-parse HEAD)" + echo "Runner: $RUNNER_NAME ($RUNNER_OS/$RUNNER_ARCH)" + uname -a + git --version + gh --version + if command -v node >/dev/null 2>&1; then + node --version + else + echo "node: not available (not required)" + fi + if command -v npm >/dev/null 2>&1; then + npm --version + else + echo "npm: not available (not required)" + fi + python3 --version + df -h "$GITHUB_WORKSPACE" + + - name: Verify Inference Hub authentication is configured + if: ${{ !cancelled() }} + env: + INFERENCEHUB_API_KEY_IS_CONFIGURED: ${{ secrets.INFERENCEHUB_API_KEY != '' }} + run: | + if [[ "$INFERENCEHUB_API_KEY_IS_CONFIGURED" != "true" ]]; then + echo "::error title=Inference Hub authentication unavailable::The INFERENCEHUB_API_KEY repository secret is not configured." + exit 1 + else + echo "::notice title=Inference Hub authentication available::The INFERENCEHUB_API_KEY repository secret is configured." + fi + + - name: Run Inference Hub authentication and inference smoke test + if: ${{ !cancelled() }} + env: + INFERENCEHUB_API_KEY: ${{ secrets.INFERENCEHUB_API_KEY }} + INFERENCEHUB_MODEL: azure/openai/gpt-5.6-terra + run: | + set -euo pipefail + + expected_response=CUDA_PYTHON_INFERENCEHUB_GHA_OK + response_file="$RUNNER_TEMP/inferencehub-response.json" + request=$(jq -n \ + --arg model "$INFERENCEHUB_MODEL" \ + --arg expected_response "$expected_response" \ + '{ + model: $model, + reasoning_effort: "medium", + max_completion_tokens: 128, + messages: [ + { + role: "user", + content: ("Reply with exactly " + $expected_response + " and nothing else.") + } + ] + }') + + curl --fail --silent --show-error \ + --connect-timeout 10 \ + --max-time 90 \ + --request POST \ + --header "Authorization: Bearer ${INFERENCEHUB_API_KEY}" \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --data-raw "$request" \ + --output "$response_file" \ + https://inference-api.nvidia.com/v1/chat/completions + + jq --exit-status \ + --arg expected_response "$expected_response" \ + '(.model | type == "string" and length > 0) and + (.choices | type == "array" and length > 0) and + (.choices[0].message.content | type == "string") and + (.choices[0].message.content + | gsub("^[[:space:]]+|[[:space:]]+$"; "") + == $expected_response)' \ + "$response_file" >/dev/null + + # Server response metadata is more reliable than model self-identification. + reported_model=$(jq --raw-output '.model' "$response_file") + echo "Hello world from ${reported_model} in GitHub Actions." + + - name: Probe direct Kitmaker access + if: ${{ !cancelled() }} + run: | + python3 qa/forge/download_from_kitpicks.py 13.5 + download_dir="$RUNNER_TEMP/kitpicks" + mkdir -p "$download_dir" + ( + cd "$download_dir" + python3 "$GITHUB_WORKSPACE/qa/forge/download_from_kitpicks.py" 13.5 --latest + ) + + - name: Verify cybind authentication is configured + id: cybind-auth + if: ${{ !cancelled() }} + env: + CYBIND_GITLAB_DEPLOY_USER_IS_CONFIGURED: ${{ secrets.CYBIND_GITLAB_DEPLOY_USER != '' }} + CYBIND_GITLAB_DEPLOY_TOKEN_IS_CONFIGURED: ${{ secrets.CYBIND_GITLAB_DEPLOY_TOKEN != '' }} + run: | + set -euo pipefail + + missing_secrets=() + if [[ "$CYBIND_GITLAB_DEPLOY_USER_IS_CONFIGURED" != "true" ]]; then + missing_secrets+=(CYBIND_GITLAB_DEPLOY_USER) + fi + if [[ "$CYBIND_GITLAB_DEPLOY_TOKEN_IS_CONFIGURED" != "true" ]]; then + missing_secrets+=(CYBIND_GITLAB_DEPLOY_TOKEN) + fi + if [[ "${#missing_secrets[@]}" -ne 0 ]]; then + echo "::error title=cybind authentication unavailable::Missing repository secret(s): ${missing_secrets[*]}" + exit 1 + fi + + askpass="$RUNNER_TEMP/cybind-git-askpass.sh" + umask 077 + cat >"$askpass" <<'EOF' + #!/bin/sh + case "$1" in + *Username*) printf '%s\n' "$CYBIND_GITLAB_DEPLOY_USER" ;; + *Password*) printf '%s\n' "$CYBIND_GITLAB_DEPLOY_TOKEN" ;; + *) exit 1 ;; + esac + EOF + chmod 700 "$askpass" + echo "CYBIND_GIT_ASKPASS=$askpass" >>"$GITHUB_ENV" + echo "::notice title=cybind authentication available::The cybind GitLab deploy-token secrets are configured." + + - name: Probe authenticated cybind repository access + if: ${{ !cancelled() && steps.cybind-auth.outcome == 'success' }} + env: + CYBIND_REPOSITORY_URL: https://gitlab-master.nvidia.com/leof/cybind.git + CYBIND_GITLAB_DEPLOY_USER: ${{ secrets.CYBIND_GITLAB_DEPLOY_USER }} + CYBIND_GITLAB_DEPLOY_TOKEN: ${{ secrets.CYBIND_GITLAB_DEPLOY_TOKEN }} + GIT_TERMINAL_PROMPT: "0" + run: | + set -euo pipefail + + probe_output="$RUNNER_TEMP/cybind-ls-remote.txt" + set +e + timeout 30 git -c credential.helper= -c core.askPass="$CYBIND_GIT_ASKPASS" \ + ls-remote --exit-code "$CYBIND_REPOSITORY_URL" HEAD \ + >"$probe_output" 2>&1 + probe_exit=$? + set -e + + if [[ "$probe_exit" -ne 0 ]]; then + echo "::error title=Authenticated cybind repository access unavailable::The deploy-token git ls-remote probe failed; its diagnostic follows." + sed -n '1,120p' "$probe_output" + exit "$probe_exit" + fi + + cybind_head=$(awk '$2 == "HEAD" {print $1}' "$probe_output") + if [[ -z "$cybind_head" ]]; then + echo "::error title=Unexpected cybind response::git ls-remote succeeded but did not return HEAD." + sed -n '1,120p' "$probe_output" + exit 1 + fi + + echo "::notice title=Authenticated cybind repository access available::cybind HEAD is $cybind_head." + + - name: Clone cybind main + if: ${{ !cancelled() && steps.cybind-auth.outcome == 'success' }} + env: + CYBIND_REPOSITORY_URL: https://gitlab-master.nvidia.com/leof/cybind.git + CYBIND_GITLAB_DEPLOY_USER: ${{ secrets.CYBIND_GITLAB_DEPLOY_USER }} + CYBIND_GITLAB_DEPLOY_TOKEN: ${{ secrets.CYBIND_GITLAB_DEPLOY_TOKEN }} + GIT_TERMINAL_PROMPT: "0" + run: | + set -euo pipefail + + clone_dir="$RUNNER_TEMP/cybind" + if [[ -e "$clone_dir" ]]; then + echo "::error title=cybind clone destination already exists::$clone_dir" + exit 1 + fi + + timeout 120 git -c credential.helper= -c core.askPass="$CYBIND_GIT_ASKPASS" \ + clone --branch main --single-branch "$CYBIND_REPOSITORY_URL" "$clone_dir" + + cybind_head=$(git -C "$clone_dir" rev-parse HEAD) + git -C "$clone_dir" status --short --branch + echo "::notice title=cybind clone complete::Cloned cybind main at $cybind_head." + + - name: Remove cybind authentication helper + if: ${{ always() }} + run: rm -f "${CYBIND_GIT_ASKPASS:-$RUNNER_TEMP/cybind-git-askpass.sh}" diff --git a/.github/workflows/ctk-next-woa-main-ci.yml b/.github/workflows/ctk-next-woa-main-ci.yml new file mode 100644 index 00000000000..a4d21e6e72a --- /dev/null +++ b/.github/workflows/ctk-next-woa-main-ci.yml @@ -0,0 +1,706 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "ctk-next WoA main CI" +run-name: "WoA validation ${{ inputs.correlation_id }}" + +on: + workflow_dispatch: + inputs: + schema_version: + description: Dispatch schema version + required: true + type: string + public_repository: + description: Public source repository + required: true + type: string + public_workflow_id: + description: Approved public CI workflow ID + required: true + type: string + public_run_id: + description: Exact public Actions run ID + required: true + type: string + public_sha: + description: Exact public source SHA + required: true + type: string + correlation_id: + description: Opaque cross-repository correlation ID + required: true + type: string + +permissions: {} + +concurrency: + group: woa-source-${{ inputs.public_repository }}-${{ inputs.public_run_id }} + cancel-in-progress: false + +jobs: + admit-and-stage: + if: ${{ github.repository == 'NVIDIA-dev/cuda-python-private' }} + runs-on: ubuntu-latest + timeout-minutes: 30 + outputs: + check-id: ${{ steps.admit.outputs.check_id }} + python-check-ids: ${{ steps.python-checks.outputs.check_ids }} + should-run: ${{ steps.admit.outputs.should_run }} + python-versions: ${{ steps.versions.outputs.python_versions }} + cuda-version: ${{ steps.versions.outputs.cuda_version }} + staging-artifact: ${{ steps.stage.outputs.staging_artifact }} + artifact-names: ${{ steps.stage.outputs.artifact_names }} + steps: + - name: Create public admission and reporting token + id: public-app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 + with: + client-id: ${{ vars.CUDA_PYTHON_WOA_XREPO_CI_PUBLIC_APP_CLIENT_ID }} + private-key: ${{ secrets.CUDA_PYTHON_WOA_XREPO_CI_PUBLIC_APP_PRIVATE_KEY }} + owner: NVIDIA + repositories: cuda-python + permission-actions: read + permission-checks: write + + - name: Verify public source and open Check Run + id: admit + env: + CORRELATION_ID: ${{ inputs.correlation_id }} + GH_TOKEN: ${{ steps.public-app-token.outputs.token }} + PUBLIC_REPOSITORY: ${{ inputs.public_repository }} + PUBLIC_RUN_ID: ${{ inputs.public_run_id }} + PUBLIC_SHA: ${{ inputs.public_sha }} + PUBLIC_WORKFLOW_ID: ${{ inputs.public_workflow_id }} + SCHEMA_VERSION: ${{ inputs.schema_version }} + run: | + set -euo pipefail + validation_errors=() + [[ "$SCHEMA_VERSION" == "1" ]] || validation_errors+=('`schema_version` must be exactly `1`.') + [[ "$PUBLIC_REPOSITORY" == "NVIDIA/cuda-python" ]] || validation_errors+=('`public_repository` must be `NVIDIA/cuda-python`.') + [[ "$PUBLIC_WORKFLOW_ID" == "155304118" ]] || validation_errors+=('`public_workflow_id` must be approved CI workflow ID `155304118`.') + [[ "$PUBLIC_RUN_ID" =~ ^[1-9][0-9]*$ ]] || validation_errors+=('`public_run_id` must be a positive decimal integer.') + [[ "$PUBLIC_SHA" =~ ^[0-9a-f]{40}$ ]] || validation_errors+=('`public_sha` must be a 40-character lowercase hexadecimal SHA.') + [[ "$CORRELATION_ID" =~ ^[A-Za-z0-9._:/-]{1,200}$ ]] || validation_errors+=('`correlation_id` must contain 1-200 letters, digits, periods, underscores, colons, slashes, or hyphens.') + + if (( ${#validation_errors[@]} > 0 )); then + { + echo "## WoA admission input validation failed" + echo + printf -- '- %s\n' "${validation_errors[@]}" + } | tee -a "$GITHUB_STEP_SUMMARY" >&2 + for validation_error in "${validation_errors[@]}"; do + echo "::error title=Invalid WoA dispatch input::$validation_error" + done + exit 1 + fi + + run=$(gh api \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/actions/runs/$PUBLIC_RUN_ID") + run_validation_errors=$(jq -r \ + --arg sha "$PUBLIC_SHA" \ + ' + def mismatch($field; $expected; $actual): + "`\($field)`: expected `\($expected | tojson)`, got `\($actual | tojson)`."; + (if type != "object" then + ["API response: expected a JSON object, got `\(type)`." ] + else + [ + if .repository.full_name != "NVIDIA/cuda-python" then mismatch("repository.full_name"; "NVIDIA/cuda-python"; .repository.full_name) else empty end, + if .workflow_id != 155304118 then mismatch("workflow_id"; 155304118; .workflow_id) else empty end, + if .path != ".github/workflows/ci.yml" then mismatch("path"; ".github/workflows/ci.yml"; .path) else empty end, + if .event != "push" then mismatch("event"; "push"; .event) else empty end, + if .head_branch != "main" then mismatch("head_branch"; "main"; .head_branch) else empty end, + if ((.status == "in_progress" and .conclusion == null) or + (.status == "completed" and .conclusion == "success")) then empty + else mismatch("run state"; "in_progress or successful completion"; {status, conclusion}) end, + if .head_sha != $sha then mismatch("head_sha"; $sha; .head_sha) else empty end + ] + end) | .[] + ' <<< "$run") + + if [[ -n "$run_validation_errors" ]]; then + mapfile -t validation_errors <<< "$run_validation_errors" + { + echo "## Public workflow run validation failed" + echo + echo "Public run: https://github.com/NVIDIA/cuda-python/actions/runs/$PUBLIC_RUN_ID" + echo + printf -- '- %s\n' "${validation_errors[@]}" + } | tee -a "$GITHUB_STEP_SUMMARY" >&2 + for validation_error in "${validation_errors[@]}"; do + annotation=${validation_error//'%'/'%25'} + annotation=${annotation//$'\r'/'%0D'} + annotation=${annotation//$'\n'/'%0A'} + echo "::error title=Public workflow run mismatch::$annotation" + done + exit 1 + fi + + comparison=$(gh api \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/compare/$PUBLIC_SHA...main") + jq -e '.status == "ahead" or .status == "identical"' <<< "$comparison" >/dev/null + + existing_checks=$(gh api \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/commits/$PUBLIC_SHA/check-runs?check_name=cuda-python%20WoA%20integration&filter=all&per_page=100") + if jq -e --arg id "woa:$CORRELATION_ID" ' + any(.check_runs[]; .app.id == 4954254 and .external_id == $id) + ' <<< "$existing_checks" >/dev/null; then + echo "An App-owned Check Run already records this correlation; dispatch is a no-op." + echo "should_run=false" >> "$GITHUB_OUTPUT" + exit 0 + fi + echo "should_run=true" >> "$GITHUB_OUTPUT" + + started_at=$(date -u +%Y-%m-%dT%H:%M:%SZ) + summary="Testing public Windows Arm64 wheels from exact run $PUBLIC_RUN_ID." + create_payload=$(jq -n \ + --arg details_url "https://github.com/NVIDIA-dev/cuda-python-private/actions/runs/$GITHUB_RUN_ID" \ + --arg external_id "woa:$CORRELATION_ID" \ + --arg sha "$PUBLIC_SHA" \ + --arg started_at "$started_at" \ + --arg summary "$summary" \ + '{ + name: "cuda-python WoA integration", + head_sha: $sha, + status: "in_progress", + started_at: $started_at, + details_url: $details_url, + external_id: $external_id, + output: { + title: "Windows on Arm integration testing is running", + summary: $summary + } + }') + check_id=$(gh api \ + --method POST \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + repos/NVIDIA/cuda-python/check-runs \ + --input - <<< "$create_payload" \ + --jq .id) + echo "check_id=$check_id" >> "$GITHUB_OUTPUT" + + - name: Resolve public build versions + id: versions + if: ${{ steps.admit.outputs.should_run == 'true' }} + env: + PUBLIC_SHA: ${{ inputs.public_sha }} + run: | + set -euo pipefail + versions=$(curl --fail --silent --show-error --location \ + "https://raw.githubusercontent.com/NVIDIA/cuda-python/$PUBLIC_SHA/ci/versions.yml") + cuda_version=$(yq -r '.cuda.build.version' <<< "$versions") + python_versions=$(yq -o json -I 0 '.python.supported' <<< "$versions") + if [[ ! "$cuda_version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + echo "::error::Invalid CUDA build version at public commit $PUBLIC_SHA: $cuda_version" >&2 + exit 1 + fi + jq -e ' + type == "array" and length > 0 and + all(.[]; type == "string" and test("^3\\.[0-9]+t?$")) and + (unique | length) == length + ' <<< "$python_versions" >/dev/null + echo "cuda_version=$cuda_version" >> "$GITHUB_OUTPUT" + echo "python_versions=$python_versions" >> "$GITHUB_OUTPUT" + echo "Public commit $PUBLIC_SHA: CUDA $cuda_version; Python variants $python_versions." >> "$GITHUB_STEP_SUMMARY" + + - name: Open per-Python public Check Runs + id: python-checks + if: ${{ steps.admit.outputs.should_run == 'true' }} + env: + CORRELATION_ID: ${{ inputs.correlation_id }} + CUDA_VERSION: ${{ steps.versions.outputs.cuda_version }} + GH_TOKEN: ${{ steps.public-app-token.outputs.token }} + PUBLIC_RUN_ID: ${{ inputs.public_run_id }} + PUBLIC_SHA: ${{ inputs.public_sha }} + PYTHON_VERSIONS: ${{ steps.versions.outputs.python_versions }} + run: | + set -euo pipefail + check_ids='{}' + while IFS= read -r version; do + payload=$(jq -n \ + --arg version "$version" \ + --arg cuda_version "$CUDA_VERSION" \ + --arg sha "$PUBLIC_SHA" \ + --arg external_id "woa:$CORRELATION_ID:python:$version" \ + --arg details_url "https://github.com/NVIDIA-dev/cuda-python-private/actions/runs/$GITHUB_RUN_ID" ' + { + name: ("CI (internal) / Test win-arm64 / Python " + $version + ", CUDA " + $cuda_version + " (local), GPU gb10 (push)"), + head_sha: $sha, + external_id: $external_id, + details_url: $details_url, + status: "queued", + output: { + title: ("Python " + $version + " validation is queued"), + summary: "Waiting for Windows Arm64 wheel validation." + } + }') + check_id=$(gh api --method POST \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + repos/NVIDIA/cuda-python/check-runs \ + --input - <<< "$payload" --jq .id) + check_ids=$(jq -c --arg version "$version" --argjson id "$check_id" \ + '.[$version] = $id' <<< "$check_ids") + echo "check_ids=$check_ids" >> "$GITHUB_OUTPUT" + done < <(jq -r '.[]' <<< "$PYTHON_VERSIONS") + + - name: Validate and stage exact public wheels + id: stage + if: ${{ steps.admit.outputs.should_run == 'true' }} + env: + CUDA_VERSION: ${{ steps.versions.outputs.cuda_version }} + PYTHON_VERSIONS: ${{ steps.versions.outputs.python_versions }} + CORRELATION_ID: ${{ inputs.correlation_id }} + GH_TOKEN: ${{ steps.public-app-token.outputs.token }} + PUBLIC_REPOSITORY: ${{ inputs.public_repository }} + PUBLIC_RUN_ID: ${{ inputs.public_run_id }} + PUBLIC_SHA: ${{ inputs.public_sha }} + run: | + set -euo pipefail + + artifact_names=$(jq -nc \ + --arg sha "$PUBLIC_SHA" \ + --arg cuda "$CUDA_VERSION" \ + --argjson versions "$PYTHON_VERSIONS" ' + { + pathfinder: "cuda-pathfinder-wheel", + python: (reduce $versions[] as $version ({}; + ($version | gsub("\\."; "")) as $digits | + .[$version] = { + bindings: ("cuda-bindings-python" + $digits + "-cuda" + $cuda + "-win-arm64-" + $sha), + core: ("cuda-core-python" + $digits + "-win-arm64-" + $sha) + } + )) + } + ') + expected_names=$(jq -c '[.pathfinder, (.python[] | .bindings, .core)]' <<< "$artifact_names") + ARTIFACTS_JSON='[]' + while IFS= read -r artifact_name; do + response=$(gh api --method GET \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/actions/runs/$PUBLIC_RUN_ID/artifacts" \ + -f name="$artifact_name" \ + -F per_page=100) + artifact=$(jq -c -e \ + --arg name "$artifact_name" ' + if .total_count == 1 and + (.artifacts | length) == 1 and + .artifacts[0].name == $name and + .artifacts[0].expired == false + then .artifacts[0] | {id, name, digest} + else error("expected exactly one unexpired artifact named " + $name) + end + ' <<< "$response") + ARTIFACTS_JSON=$(jq -c \ + --argjson artifact "$artifact" \ + '. + [$artifact] | sort_by(.name)' <<< "$ARTIFACTS_JSON") + done < <(jq -r '.[]' <<< "$expected_names") + expected_count=$(jq '1 + 2 * length' <<< "$PYTHON_VERSIONS") + jq -e --argjson count "$expected_count" ' + length == $count and + all(.[ ]; + (.id | type == "number") and + (.digest | test("^sha256:[0-9a-f]{64}$"))) + ' <<< "$ARTIFACTS_JSON" >/dev/null + + { + echo "Exact Windows Arm64 artifacts from public run $PUBLIC_RUN_ID:" + jq -r '.[] | "- `\(.name)` (`\(.digest)`)"' <<< "$ARTIFACTS_JSON" + } >> "$GITHUB_STEP_SUMMARY" + + mkdir -p downloads wheelhouse + while IFS= read -r artifact; do + artifact_id=$(jq -r .id <<< "$artifact") + expected_name=$(jq -r .name <<< "$artifact") + expected_digest=$(jq -r '.digest | sub("^sha256:"; "")' <<< "$artifact") + + metadata=$(gh api \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/actions/artifacts/$artifact_id") + jq -e \ + --arg digest "sha256:$expected_digest" \ + --arg name "$expected_name" \ + --arg run_id "$PUBLIC_RUN_ID" \ + '.expired == false and + .name == $name and + .digest == $digest and + (.workflow_run.id | tostring) == $run_id' <<< "$metadata" >/dev/null + + archive="downloads/$artifact_id.zip" + gh api \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/actions/artifacts/$artifact_id/zip" > "$archive" + echo "$expected_digest $archive" | sha256sum --check + mkdir "downloads/$artifact_id" + unzip -q "$archive" -d "downloads/$artifact_id" + mapfile -t wheels < <(find "downloads/$artifact_id" -type f -name '*.whl') + if (( ${#wheels[@]} != 1 )); then + echo "::error::Expected one wheel in artifact $expected_name, found ${#wheels[@]}." >&2 + exit 1 + fi + mkdir "wheelhouse/$expected_name" + cp "${wheels[0]}" "wheelhouse/$expected_name/" + done < <(jq -c '.[]' <<< "$ARTIFACTS_JSON") + + jq -n \ + --arg correlation_id "$CORRELATION_ID" \ + --arg repository "$PUBLIC_REPOSITORY" \ + --arg run_id "$PUBLIC_RUN_ID" \ + --arg sha "$PUBLIC_SHA" \ + --argjson artifacts "$ARTIFACTS_JSON" \ + --arg cuda_version "$CUDA_VERSION" \ + --argjson python_versions "$PYTHON_VERSIONS" \ + '{ + schema_version: 1, + correlation_id: $correlation_id, + public_repository: $repository, + public_run_id: $run_id, + public_sha: $sha, + artifacts: $artifacts, + cuda_version: $cuda_version, + python_versions: $python_versions + }' > wheelhouse/PROVENANCE.json + + staging_artifact="woa-stage-$PUBLIC_RUN_ID" + echo "staging_artifact=$staging_artifact" >> "$GITHUB_OUTPUT" + echo "artifact_names=$artifact_names" >> "$GITHUB_OUTPUT" + + - name: Upload verified WoA payload + if: ${{ steps.admit.outputs.should_run == 'true' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: ${{ steps.stage.outputs.staging_artifact }} + path: wheelhouse + if-no-files-found: error + retention-days: 3 + + gb10-test: + name: Test win-arm64 / Python ${{ matrix.python-version }}, CUDA ${{ needs.admit-and-stage.outputs.cuda-version }} (local), GPU gb10 + needs: admit-and-stage + if: ${{ needs.admit-and-stage.outputs.should-run == 'true' }} + runs-on: windows-arm64-1xgb10 + timeout-minutes: 180 + permissions: + contents: read + env: + PYTHON_VERSION: ${{ matrix.python-version }} + GIT_VERSION: '2.55.0.3' + strategy: + fail-fast: false + max-parallel: 2 + matrix: + python-version: ${{ fromJSON(needs.admit-and-stage.outputs.python-versions) }} + steps: + # Keep identical to the other "Set up Git for Windows ARM64" steps in .github/workflows. + - name: Set up Git for Windows ARM64 + timeout-minutes: 10 + shell: powershell + run: | + if (-not $env:RUNNER_TOOL_CACHE) { + throw "RUNNER_TOOL_CACHE is not set." + } + + $gitRoot = Join-Path $env:RUNNER_TOOL_CACHE "PortableGit\$env:GIT_VERSION\arm64" + $git = Join-Path $gitRoot "cmd\git.exe" + # `shell: bash` steps (e.g. setup-hardened-python) need Git's bash on PATH; + # otherwise bash resolves to the WSL launcher in System32. + $bash = Join-Path $gitRoot "bin\bash.exe" + $complete = "$gitRoot.complete" + if (-not ((Test-Path $git) -and (Test-Path $bash) -and (Test-Path $complete))) { + $archive = Join-Path $env:RUNNER_TEMP "PortableGit-$env:GIT_VERSION-arm64.7z.exe" + $archiveUrl = "https://github.com/git-for-windows/git/releases/download/v2.55.0.windows.3/PortableGit-2.55.0.3-arm64.7z.exe" + $expectedHash = "3bf26b94d9399b16a890776e468334f501742861576cbcdea2d9134643c374bd" + + Invoke-WebRequest -UseBasicParsing -Uri $archiveUrl -OutFile $archive + $actualHash = (Get-FileHash -Path $archive -Algorithm SHA256).Hash.ToLowerInvariant() + if ($actualHash -ne $expectedHash) { + throw "PortableGit checksum mismatch: expected $expectedHash, got $actualHash." + } + + if (Test-Path $gitRoot) { + Remove-Item -Recurse -Force $gitRoot + } + New-Item -ItemType Directory -Force -Path $gitRoot | Out-Null + # PortableGit is a 7-Zip self-extractor; -y suppresses its prompts. + $process = Start-Process -FilePath $archive -ArgumentList @("-y", "-o`"$gitRoot`"") -Wait -PassThru + if ($process.ExitCode -ne 0) { + throw "PortableGit extraction exited with code $($process.ExitCode)." + } + Remove-Item -Force $archive + + foreach ($required in @($git, $bash)) { + if (-not (Test-Path $required)) { + throw "Not found after extracting PortableGit: $required" + } + } + New-Item -ItemType File -Force -Path $complete | Out-Null + } + + & $git version --build-options + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + & $bash --version + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + # Only cmd\ and bin\: usr\bin would shadow MSVC's link.exe and Windows' find.exe. + @((Split-Path $git), (Split-Path $bash)) | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + + - name: Enable Git symlinks (Windows, must precede checkout) + shell: powershell + run: | + git config --global core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + if (Test-Path -LiteralPath (Join-Path $env:GITHUB_WORKSPACE ".git")) { + git -C "$env:GITHUB_WORKSPACE" config --local core.symlinks true + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + } + + - name: Checkout private CI tools + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + persist-credentials: false + + - name: Checkout exact public test sources + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + repository: NVIDIA/cuda-python + ref: ${{ inputs.public_sha }} + path: gb10-wheelhouse-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.python-version }}/source + persist-credentials: false + + - name: Download verified payload + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: ${{ needs.admit-and-stage.outputs.staging-artifact }} + path: gb10-wheelhouse-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.python-version }} + + - name: Verify credential isolation, runner, and source + env: + PUBLIC_RUN_ID: ${{ inputs.public_run_id }} + PUBLIC_SHA: ${{ inputs.public_sha }} + shell: powershell + run: | + $sensitiveNames = Get-ChildItem Env: | Where-Object { + $_.Name -match 'APP.*PRIVATE.*KEY|PRIVATE.*KEY|APP.*TOKEN' + } + if ($sensitiveNames) { + throw "Unexpected long-lived credential environment variable present." + } + if ($env:PROCESSOR_ARCHITECTURE -ne 'ARM64') { + throw "Expected ARM64, got $env:PROCESSOR_ARCHITECTURE." + } + nvidia-smi + if ($LASTEXITCODE -ne 0) { + exit $LASTEXITCODE + } + + $headers = @{ + Accept = 'application/vnd.github+json' + 'X-GitHub-Api-Version' = '2026-03-10' + } + $sourceRun = Invoke-RestMethod -Headers $headers -Uri "https://api.github.com/repos/NVIDIA/cuda-python/actions/runs/$env:PUBLIC_RUN_ID" + $validState = (($sourceRun.status -eq 'in_progress' -and $null -eq $sourceRun.conclusion) -or + ($sourceRun.status -eq 'completed' -and $sourceRun.conclusion -eq 'success')) + if ($sourceRun.id.ToString() -ne $env:PUBLIC_RUN_ID -or + $sourceRun.head_sha -ne $env:PUBLIC_SHA -or + $sourceRun.repository.full_name -ne 'NVIDIA/cuda-python' -or + -not $validState) { + throw "The exact public source run is no longer admissible." + } + + - name: Set up public CUDA and Windows toolchain + id: toolchain + uses: ./.github/actions/setup-ctk-next-windows + with: + host-platform: win-arm64 + python-version: ${{ matrix.python-version }} + cuda-version: ${{ needs.admit-and-stage.outputs.cuda-version }} + cuda-release-version: ${{ needs.admit-and-stage.outputs.cuda-version }} + + - name: Test exact public wheels + env: + ARTIFACT_NAMES: ${{ needs.admit-and-stage.outputs.artifact-names }} + WHEEL_TEST_PYTHON: ${{ steps.toolchain.outputs.python-path }} + WHEEL_TEST_CUDA: ${{ needs.admit-and-stage.outputs.cuda-version }} + shell: powershell + run: | + $wheelhouse = "gb10-wheelhouse-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-$env:PYTHON_VERSION" + & ./ci/tools/test_windows_wheels.ps1 -PythonExecutable $env:WHEEL_TEST_PYTHON -PythonVersion $env:PYTHON_VERSION -CudaVersion $env:WHEEL_TEST_CUDA -SourceDirectory "$wheelhouse/source" -Wheelhouse $wheelhouse -ArtifactNames $env:ARTIFACT_NAMES + + - name: Record Python result + if: ${{ always() }} + env: + JOB_STATUS: ${{ job.status }} + PUBLIC_SHA: ${{ inputs.public_sha }} + shell: powershell + run: | + $results = "gb10-wheelhouse-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-$env:PYTHON_VERSION/test-results" + New-Item -ItemType Directory -Force -Path $results | Out-Null + $record = @{ + schema_version = 1 + python_version = $env:PYTHON_VERSION + public_sha = $env:PUBLIC_SHA + private_run_id = $env:GITHUB_RUN_ID + private_run_attempt = $env:GITHUB_RUN_ATTEMPT + result = $env:JOB_STATUS + } | ConvertTo-Json + [IO.File]::WriteAllText((Join-Path (Resolve-Path $results).Path 'result.json'), $record, [Text.UTF8Encoding]::new($false)) + + - name: Upload private Python results and JUnit reports + if: ${{ always() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: woa-results-${{ github.run_id }}-${{ github.run_attempt }}-py${{ matrix.python-version }} + path: gb10-wheelhouse-${{ github.run_id }}-${{ github.run_attempt }}-${{ matrix.python-version }}/test-results + if-no-files-found: warn + retention-days: 7 + + - name: Remove downloaded wheelhouse + if: ${{ always() }} + shell: powershell + run: | + $wheelhouseName = "gb10-wheelhouse-$env:GITHUB_RUN_ID-$env:GITHUB_RUN_ATTEMPT-$env:PYTHON_VERSION" + $workspace = [IO.Path]::GetFullPath($env:GITHUB_WORKSPACE) + $wheelhouse = [IO.Path]::GetFullPath((Join-Path $workspace $wheelhouseName)) + $workspacePrefix = $workspace.TrimEnd([char[]]@('\', '/')) + [IO.Path]::DirectorySeparatorChar + + if (-not $wheelhouse.StartsWith($workspacePrefix, [StringComparison]::OrdinalIgnoreCase) -or + [IO.Path]::GetFileName($wheelhouse) -ne $wheelhouseName) { + throw "Refusing to remove unexpected wheelhouse path: $wheelhouse" + } + + if (Test-Path -LiteralPath $wheelhouse) { + Remove-Item -LiteralPath $wheelhouse -Recurse -Force + } + if (Test-Path -LiteralPath $wheelhouse) { + throw "Wheelhouse cleanup did not remove: $wheelhouse" + } + Write-Host "Removed run-specific wheelhouse: $wheelhouse" + + report: + name: Report sanitized public result + needs: + - admit-and-stage + - gb10-test + if: ${{ always() && needs.admit-and-stage.outputs.check-id != '' }} + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: {} + steps: + - name: Download private Python results + if: ${{ needs.admit-and-stage.outputs.python-check-ids != '' }} + continue-on-error: true + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + pattern: woa-results-${{ github.run_id }}-*-py* + path: python-results + merge-multiple: false + + - name: Create fresh public reporting token + id: public-app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3 + with: + client-id: ${{ vars.CUDA_PYTHON_WOA_XREPO_CI_PUBLIC_APP_CLIENT_ID }} + private-key: ${{ secrets.CUDA_PYTHON_WOA_XREPO_CI_PUBLIC_APP_PRIVATE_KEY }} + owner: NVIDIA + repositories: cuda-python + permission-actions: read + permission-checks: write + + - name: Complete aggregate and per-Python public Check Runs + env: + ADMISSION_RESULT: ${{ needs.admit-and-stage.result }} + CHECK_ID: ${{ needs.admit-and-stage.outputs.check-id }} + PYTHON_CHECK_IDS: ${{ needs.admit-and-stage.outputs.python-check-ids }} + GH_TOKEN: ${{ steps.public-app-token.outputs.token }} + TEST_RESULT: ${{ needs.gb10-test.result }} + PUBLIC_RUN_ID: ${{ inputs.public_run_id }} + PUBLIC_SHA: ${{ inputs.public_sha }} + run: | + set -euo pipefail + source_run=$(gh api \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/actions/runs/$PUBLIC_RUN_ID") + source_is_valid=$(jq -r \ + --arg sha "$PUBLIC_SHA" \ + '.repository.full_name == "NVIDIA/cuda-python" and + .head_sha == $sha and + ((.status == "in_progress" and .conclusion == null) or + (.status == "completed" and .conclusion == "success"))' <<< "$source_run") + python_check_ids="$PYTHON_CHECK_IDS" + if [[ -z "$python_check_ids" ]]; then + python_check_ids='{}' + fi + jq -e 'type == "object" and all(to_entries[]; + (.key | test("^3\\.[0-9]+t?$")) and + (.value | type == "number") and .value > 0)' <<< "$python_check_ids" >/dev/null + completed_at=$(date -u +%Y-%m-%dT%H:%M:%SZ) + details_url="https://github.com/NVIDIA-dev/cuda-python-private/actions/runs/$GITHUB_RUN_ID" + report_failed=false + publish_check() { + local check_id=$1 conclusion=$2 payload + payload=$(jq -n --arg conclusion "$conclusion" \ + --arg completed_at "$completed_at" --arg details_url "$details_url" ' + {status: "completed", conclusion: $conclusion, completed_at: $completed_at, + details_url: $details_url, output: { + title: ("Windows on Arm validation: " + $conclusion), + summary: "See Details for private test logs and JUnit reports." + }}') + if ! gh api --method PATCH \ + -H 'X-GitHub-Api-Version: 2026-03-10' \ + "repos/NVIDIA/cuda-python/check-runs/$check_id" \ + --input - <<< "$payload" >/dev/null; then + echo "::error::Could not complete public Check Run $check_id." + report_failed=true + fi + } + + aggregate=failure + if [[ "$ADMISSION_RESULT" == "success" && "$TEST_RESULT" == "success" ]] && jq -e 'length > 0' <<< "$python_check_ids" >/dev/null; then + aggregate=success + fi + while IFS=$'\t' read -r version check_id; do + conclusion=failure + result_file='' + for ((result_attempt = GITHUB_RUN_ATTEMPT; result_attempt >= 1; result_attempt--)); do + result_directory="python-results/woa-results-$GITHUB_RUN_ID-$result_attempt-py$version" + if [[ -d "$result_directory" ]]; then + result_file="$result_directory/result.json" + echo "Python $version: using results from private run $GITHUB_RUN_ID, attempt $result_attempt." + break + fi + done + if [[ "$source_is_valid" != "true" || "$ADMISSION_RESULT" == "cancelled" ]]; then + conclusion=cancelled + elif [[ "$ADMISSION_RESULT" == "success" ]]; then + if [[ -f "$result_file" ]]; then + conclusion=$(jq -er --arg version "$version" --arg sha "$PUBLIC_SHA" \ + --arg run "$GITHUB_RUN_ID" --arg attempt "$result_attempt" ' + select(type == "object" and .schema_version == 1 and + .python_version == $version and .public_sha == $sha and + .private_run_id == $run and .private_run_attempt == $attempt and + (.result == "success" or .result == "failure" or .result == "cancelled")) + | .result' "$result_file") || conclusion=failure + elif [[ "$TEST_RESULT" == "cancelled" ]]; then + conclusion=cancelled + fi + fi + if [[ "$conclusion" != "success" ]]; then aggregate=failure; fi + publish_check "$check_id" "$conclusion" + done < <(jq -r 'to_entries[] | [.key, .value] | @tsv' <<< "$python_check_ids") + if [[ "$report_failed" == "true" ]]; then aggregate=failure; fi + if [[ "$source_is_valid" != "true" || "$ADMISSION_RESULT" == "cancelled" || "$TEST_RESULT" == "cancelled" ]]; then + aggregate=cancelled + fi + publish_check "$CHECK_ID" "$aggregate" + [[ "$report_failed" == "false" ]] diff --git a/.github/workflows/inferencehub-smoke-test.yml b/.github/workflows/inferencehub-smoke-test.yml new file mode 100644 index 00000000000..bcd0f51625d --- /dev/null +++ b/.github/workflows/inferencehub-smoke-test.yml @@ -0,0 +1,67 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +name: "CI: Inference Hub smoke test" + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }}-${{ github.event_name }} + cancel-in-progress: true + +on: + pull_request: + paths: + - ".github/workflows/inferencehub-smoke-test.yml" + schedule: + # Avoid minute 0, when scheduled GitHub Actions jobs are more likely to be delayed. + - cron: "17 3 * * *" + workflow_dispatch: {} + +permissions: {} + +jobs: + smoke-test: + name: Inference Hub API + if: >- + ${{ github.repository_owner == 'NVIDIA-dev' && + (github.event_name != 'pull_request' || + github.event.pull_request.head.repo.full_name == github.repository) }} + runs-on: ubuntu-latest + timeout-minutes: 2 + steps: + - name: Verify GPT-5.6 Terra prompt response + env: + INFERENCEHUB_API_KEY: ${{ secrets.INFERENCEHUB_API_KEY }} + run: | + set -euo pipefail + + test -n "${INFERENCEHUB_API_KEY}" + # Inference Hub exposes GPT-5.6 Terra through this Azure OpenAI alias. + curl --fail --silent --show-error \ + --connect-timeout 10 \ + --max-time 90 \ + --request POST \ + --header "Authorization: Bearer ${INFERENCEHUB_API_KEY}" \ + --header 'Accept: application/json' \ + --header 'Content-Type: application/json' \ + --data-raw '{ + "model": "azure/openai/gpt-5.6-terra", + "reasoning_effort": "medium", + "max_completion_tokens": 128, + "messages": [ + { + "role": "user", + "content": "Reply with exactly CUDA_PYTHON_INFERENCEHUB_SMOKETEST_OK and nothing else." + } + ] + }' \ + https://inference-api.nvidia.com/v1/chat/completions \ + | jq --exit-status ' + (.choices | type == "array" and length > 0) and + (.choices[0].message.content | type == "string") and + (.choices[0].message.content + | gsub("^[[:space:]]+|[[:space:]]+$"; "") + == "CUDA_PYTHON_INFERENCEHUB_SMOKETEST_OK") + ' >/dev/null + + echo "Inference Hub GPT-5.6 Terra (medium) returned the expected response." diff --git a/.github/workflows/mirror-public-main.yml b/.github/workflows/mirror-public-main.yml new file mode 100644 index 00000000000..393b19dbce6 --- /dev/null +++ b/.github/workflows/mirror-public-main.yml @@ -0,0 +1,238 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# The cuda-python-private-automation GitHub App supplies a short-lived token +# with Contents and Workflows write access. This permits mirrored-main updates +# even when public commits change workflow files, and permits public tags to be +# synchronized automatically. Existing tag mismatches still require explicit +# human review and lease-protected deletion before this workflow will update +# any tags. + +name: "Mirror public main" + +on: + schedule: + - cron: "*/10 * * * *" + workflow_dispatch: + +# All repository writes use the explicitly down-scoped GitHub App token. +permissions: {} + +concurrency: + group: mirror-public-main + cancel-in-progress: false + +jobs: + mirror-public-main: + name: Mirror public main and tags + if: github.repository == 'NVIDIA-dev/cuda-python-private' + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Create GitHub App token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + client-id: ${{ vars.CUDA_PYTHON_PRIVATE_AUTOMATION_APP_CLIENT_ID }} + private-key: ${{ secrets.CUDA_PYTHON_PRIVATE_AUTOMATION_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} + permission-contents: write + permission-workflows: write + + - name: Checkout private repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + # Persist the App token so both branch and tag pushes use it. + persist-credentials: true + token: ${{ steps.app-token.outputs.token }} + + - name: Fetch public main and tags + run: | + set -euo pipefail + + git remote add public_repo https://github.com/NVIDIA/cuda-python.git + git fetch --force --no-tags public_repo \ + '+refs/heads/main:refs/remotes/public_repo/main' \ + '+refs/tags/*:refs/public-tags/*' + + - name: Mirror public main + run: | + set -euo pipefail + + public_main_oid="$(git rev-parse refs/remotes/public_repo/main)" + echo "Public main target: $public_main_oid" + + # Keep continuous public history and refuse an unexpected rewrite. + git push origin \ + 'refs/remotes/public_repo/main:refs/heads/mirrored-main' + + echo "::notice title=Public main mirrored::mirrored-main now points to $public_main_oid." + + - name: Synchronize public tags + run: | + set -euo pipefail + + declare -A private_tag_oids=() + missing_tags=() + missing_public_oids=() + mismatched_tags=() + mismatched_private_oids=() + mismatched_public_oids=() + public_tag_count=0 + private_tags_file="$RUNNER_TEMP/private-tags" + public_tags_file="$RUNNER_TEMP/public-tags" + + print_missing_tags() { + local index + for index in "${!missing_tags[@]}"; do + printf ' %s %s\n' \ + "${missing_tags[$index]}" "${missing_public_oids[$index]}" + done + } + + print_mismatched_tags() { + local index + for index in "${!mismatched_tags[@]}"; do + printf ' %s\n' "${mismatched_tags[$index]}" + printf ' cuda-python-private: %s\n' \ + "${mismatched_private_oids[$index]}" + printf ' public cuda-python: %s\n' \ + "${mismatched_public_oids[$index]}" + done + } + + print_mismatched_tag_deletions() { + local delete_ref index lease tag_name + for index in "${!mismatched_tags[@]}"; do + tag_name="${mismatched_tags[$index]}" + lease="refs/tags/$tag_name:${mismatched_private_oids[$index]}" + delete_ref=":refs/tags/$tag_name" + printf 'git push --force-with-lease=%q git@github.com:NVIDIA-dev/cuda-python-private.git %q\n' \ + "$lease" "$delete_ref" + done + } + + # Materialize both listings so set -e catches either query failing + # before synchronization interprets any partial results. + git ls-remote --tags --refs origin > "$private_tags_file" + git for-each-ref \ + --format='%(objectname) %(refname)' refs/public-tags/ \ + | sed 's# refs/public-tags/# refs/tags/#' \ + > "$public_tags_file" + + if [[ ! -s "$public_tags_file" ]]; then + echo "::error title=Public tag synchronization unavailable::The public repository returned no tags; refusing to treat an empty result as synchronized." + exit 1 + fi + + while read -r private_oid private_ref; do + private_tag_oids["$private_ref"]="$private_oid" + done < "$private_tags_file" + + while read -r public_oid public_ref; do + ((public_tag_count += 1)) + tag_name="${public_ref#refs/tags/}" + private_oid="${private_tag_oids[$public_ref]-}" + + if [[ -z "$private_oid" ]]; then + missing_tags+=("$tag_name") + missing_public_oids+=("$public_oid") + elif [[ "$private_oid" != "$public_oid" ]]; then + mismatched_tags+=("$tag_name") + mismatched_private_oids+=("$private_oid") + mismatched_public_oids+=("$public_oid") + fi + done < "$public_tags_file" + + # A mismatched tag may reflect an intentional private tag. Require a + # human to review and remove it before creating any missing tags. + if (( ${#mismatched_tags[@]} != 0 )); then + echo "::error title=Public tag mismatch requires review::One or more public CUDA Python tags differ in cuda-python-private; no tags were modified." + echo + echo "Mismatched public tags:" + print_mismatched_tags + + if (( ${#missing_tags[@]} != 0 )); then + echo + echo "Missing public tags awaiting synchronization:" + print_missing_tags + fi + + echo + echo "Review each mismatch. If the public tag should be authoritative," + echo "delete the cuda-python-private tag manually:" + print_mismatched_tag_deletions | sed 's/^/ /' + echo "The object-ID lease prevents a stale command from deleting a tag" + echo "that changed after this audit. Then rerun this workflow." + + { + echo "## Action required: resolve mismatched public tags" + echo + echo "One or more public CUDA Python tags differ in" + echo '`cuda-python-private`.' + echo + echo "### Mismatched public tags" + echo + echo '```text' + print_mismatched_tags + echo '```' + + if (( ${#missing_tags[@]} != 0 )); then + echo + echo "### Missing public tags awaiting synchronization" + echo + echo '```text' + print_missing_tags + echo '```' + fi + + echo + echo "### Resolution" + echo + echo "Review each mismatch. If the public tag should be authoritative," + echo "delete the cuda-python-private tag manually:" + echo + echo '```console' + print_mismatched_tag_deletions + echo '```' + echo + echo "The object-ID lease prevents a stale command from deleting a tag" + echo "that changed after this audit. Then rerun this workflow; it will" + echo "restore the removed tag and create any other missing public tags." + echo + echo '> **Workflow context:** The `mirrored-main` branch was updated successfully.' + echo '> No tags were modified because an existing tag mismatch requires human review.' + } >> "$GITHUB_STEP_SUMMARY" + + exit 1 + fi + + if (( ${#missing_tags[@]} == 0 )); then + echo "::notice title=Public tags synchronized::All $public_tag_count public tags exist identically in cuda-python-private." + exit 0 + fi + + echo "Missing public tags to synchronize:" + print_missing_tags + + # Push only refs fetched from the public repository. Private-only + # tags are left untouched, and a concurrent conflict fails safely. + git push origin 'refs/public-tags/*:refs/tags/*' + + missing_tag_count="${#missing_tags[@]}" + echo "::notice title=Public tags synchronized::Created $missing_tag_count missing public tag(s); all $public_tag_count public tags now exist in cuda-python-private." + + { + echo "## Public tags synchronized" + echo + echo "Created $missing_tag_count missing public tag(s):" + echo + echo '```text' + print_missing_tags + echo '```' + echo + echo "All $public_tag_count public CUDA Python tags now exist identically" + echo 'in `cuda-python-private`.' + } >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/test-wheel-linux-riscv64.yml b/.github/workflows/test-wheel-linux-riscv64.yml new file mode 100644 index 00000000000..249ffb86953 --- /dev/null +++ b/.github/workflows/test-wheel-linux-riscv64.yml @@ -0,0 +1,597 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# +# SPDX-License-Identifier: Apache-2.0 + +# Consumer workflow for riscv64 wheel artifacts produced by +# build-wheel-riscv64.yml. +# +# GitHub has no artifact-upload event. workflow_run fires once after the +# complete build run finishes. This workflow then downloads per-ABI wheel +# sets identified by the source build run ID and head SHA. +# +# Artifact naming (set by ci/tools/env-vars with HOST_PLATFORM=linux-riscv64): +# cuda-pathfinder-wheel +# cuda-bindings-python{312,313,314}-cuda{ver}-linux-riscv64-{sha} +# cuda-bindings-python{312,313,314}-cuda{ver}-linux-riscv64-{sha}-tests +# cuda-core-python{312,313,314}-linux-riscv64-{sha} +# (cuda-core-python*-tests are uploaded by the build but not yet consumed here; +# see TODO(#469) in the test job.) +# +# This workflow is specific to NVIDIA-dev/cuda-python-private and is not +# meant to ever be merged to NVIDIA/cuda-python. +name: "CI: Test wheels (linux-riscv64)" + +run-name: >- + ${{ + github.event_name == 'workflow_run' + && format('Test riscv64 wheels @ {0} (build {1})', + github.event.workflow_run.head_sha, + github.event.workflow_run.id) + || 'Test riscv64 wheels (manual)' + }} + +on: + workflow_run: + workflows: + - "CI: Build wheels (linux-riscv64)" + types: + - completed + branches: + - riscv64-next + workflow_dispatch: + inputs: + run-id: + description: >- + Build run ID from build-wheel-riscv64.yml to test. Leave empty to + resolve the latest successful run on riscv64-next automatically. + required: false + type: string + +permissions: + actions: read + contents: read + statuses: write + +jobs: + # --------------------------------------------------------------------------- + # resolve: determine the source build run and validate its artifacts. + # For workflow_run events, the run ID and head SHA come directly from the + # event payload. For workflow_dispatch, they are resolved via the GitHub API. + # Skips automatically when the triggering build did not succeed (the build + # workflow's cancel-in-progress concurrency group emits 'cancelled' for + # superseded pushes on riscv64-next). + # --------------------------------------------------------------------------- + resolve: + name: Resolve build run + if: >- + github.event_name == 'workflow_dispatch' || + github.event.workflow_run.conclusion == 'success' + runs-on: ubuntu-latest + timeout-minutes: 10 + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} + outputs: + run-id: ${{ steps.resolve.outputs.run-id }} + head-sha: ${{ steps.resolve.outputs.head-sha }} + cuda-ver: ${{ steps.validate.outputs.cuda-ver }} + matrix: ${{ steps.validate.outputs.matrix }} + steps: + - name: Resolve source build run + id: resolve + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} + INPUT_RUN_ID: ${{ inputs.run-id }} + run: | + if [[ "${{ github.event_name }}" == "workflow_run" ]]; then + RUN_ID="${{ github.event.workflow_run.id }}" + HEAD_SHA="${{ github.event.workflow_run.head_sha }}" + echo "Automatic trigger: build run ${RUN_ID} @ ${HEAD_SHA:0:7}" + + elif [[ -n "${INPUT_RUN_ID}" ]]; then + # Manual dispatch with an explicit run ID: validate its conclusion. + RUN_DATA=$(gh api "repos/${GH_REPO}/actions/runs/${INPUT_RUN_ID}" \ + --jq '{conclusion: .conclusion, head_sha: .head_sha}') + CONCLUSION=$(echo "${RUN_DATA}" | jq -r .conclusion) + if [[ "${CONCLUSION}" != "success" ]]; then + echo "::error title=Build run not successful::Run ${INPUT_RUN_ID} has conclusion '${CONCLUSION}', expected 'success'." + exit 1 + fi + RUN_ID="${INPUT_RUN_ID}" + HEAD_SHA=$(echo "${RUN_DATA}" | jq -r .head_sha) + echo "Manual trigger: explicit run ID ${RUN_ID} @ ${HEAD_SHA:0:7}" + + else + # Manual dispatch with no run ID: find the latest successful build + # on riscv64-next. + RUN_DATA=$(gh api \ + "repos/${GH_REPO}/actions/workflows/build-wheel-riscv64.yml/runs?branch=riscv64-next&status=success&per_page=1" \ + --jq '.workflow_runs[0] | {id: .id, head_sha: .head_sha}') + RUN_ID=$(echo "${RUN_DATA}" | jq -r .id) + HEAD_SHA=$(echo "${RUN_DATA}" | jq -r .head_sha) + if [[ "${RUN_ID}" == "null" || -z "${RUN_ID}" ]]; then + echo "::error title=No build found::No successful build-wheel-riscv64.yml run on riscv64-next." + exit 1 + fi + echo "Manual trigger: resolved latest build run ${RUN_ID} @ ${HEAD_SHA:0:7}" + fi + + # The artifact names embed the commit the build actually compiled. + # That is the run's head SHA, except for a build dispatched from + # another ref, which builds the riscv64-next tip instead (see + # resolve-source in build-wheel-riscv64.yml). Test, and report + # status on, the commit that was built. + BUILT_SHA=$(gh api \ + "repos/${GH_REPO}/actions/runs/${RUN_ID}/artifacts?per_page=100" \ + --jq '[.artifacts[] | select(.expired == false) | .name + | capture("^cuda-core-python[0-9]+-linux-riscv64-(?[0-9a-f]{40})$").sha] | first // empty') + if [[ -n "${BUILT_SHA}" && "${BUILT_SHA}" != "${HEAD_SHA}" ]]; then + echo "::notice title=Built commit differs from run head::Run ${RUN_ID} was triggered at ${HEAD_SHA:0:7} but built ${BUILT_SHA:0:7}; testing ${BUILT_SHA:0:7}." + HEAD_SHA="${BUILT_SHA}" + fi + + echo "run-id=${RUN_ID}" >> "$GITHUB_OUTPUT" + echo "head-sha=${HEAD_SHA}" >> "$GITHUB_OUTPUT" + + - name: Validate artifacts + id: validate + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} + RUN_ID: ${{ steps.resolve.outputs.run-id }} + HEAD_SHA: ${{ steps.resolve.outputs.head-sha }} + run: | + # Fetch all unexpired artifact names for this run (up to 100; riscv64 + # builds produce 1 + 3 per Python version, so one page is sufficient). + ARTIFACTS=$(gh api \ + "repos/${GH_REPO}/actions/runs/${RUN_ID}/artifacts?per_page=100" \ + --jq '.artifacts[] | select(.expired == false) | .name') + + # Detect the CUDA version from the bindings artifact name so callers + # do not need to hardcode it (e.g. "13.5" from cuda-bindings-python312-cuda13.5-...). + BUILD_CUDA_VER=$(grep -oP '^cuda-bindings-python[0-9]+-cuda\K[0-9]+\.[0-9]+(?=-linux-riscv64-)' \ + <<< "${ARTIFACTS}" | head -1 || true) + if [[ -z "${BUILD_CUDA_VER}" ]]; then + echo "::error title=Cannot detect CUDA version::No cuda-bindings-python*-cuda*-linux-riscv64 artifact found." + exit 1 + fi + echo "Detected build CUDA version: ${BUILD_CUDA_VER}" + echo "cuda-ver=${BUILD_CUDA_VER}" >> "$GITHUB_OUTPUT" + + # Derive the Python versions to test from the cuda.core wheel + # artifacts of the tested commit, so the test matrix follows the + # build matrix (build-wheel-riscv64.yml) without being duplicated + # here. workflow_run gives no access to the build's job outputs; + # the artifact names are the build's published record. + PY_TAGS=$(grep -oP "^cuda-core-python\K[0-9]+(?=-linux-riscv64-${HEAD_SHA}\$)" \ + <<< "${ARTIFACTS}" | sort -nu || true) + if [[ -z "${PY_TAGS}" ]]; then + echo "::error title=No Python versions found::No cuda-core-python*-linux-riscv64-${HEAD_SHA} artifact found." + exit 1 + fi + # "312" -> {"python-version": "3.12", "py-nodot": "312"} + MATRIX=$(jq -cn --arg tags "${PY_TAGS}" \ + '{include: [$tags | split("\n")[] | select(. != "") + | {"python-version": ("3." + .[1:]), "py-nodot": .}]}') + echo "Test matrix: ${MATRIX}" + echo "matrix=${MATRIX}" >> "$GITHUB_OUTPUT" + + MISSING=() + check_artifact() { + if ! grep -qxF "$1" <<< "${ARTIFACTS}"; then + MISSING+=("$1") + fi + } + + check_artifact "cuda-pathfinder-wheel" + for PY in ${PY_TAGS}; do + check_artifact "cuda-bindings-python${PY}-cuda${BUILD_CUDA_VER}-linux-riscv64-${HEAD_SHA}" + check_artifact "cuda-bindings-python${PY}-cuda${BUILD_CUDA_VER}-linux-riscv64-${HEAD_SHA}-tests" + check_artifact "cuda-core-python${PY}-linux-riscv64-${HEAD_SHA}" + done + + if [[ ${#MISSING[@]} -gt 0 ]]; then + for A in "${MISSING[@]}"; do + echo "::error title=Missing or expired artifact::${A}" + done + exit 1 + fi + echo "All expected artifacts are present and unexpired (Python: ${PY_TAGS//$'\n'/ })." + + - name: Post pending commit status + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} + HEAD_SHA: ${{ steps.resolve.outputs.head-sha }} + run: | + gh api --method POST \ + "repos/${GH_REPO}/statuses/${HEAD_SHA}" \ + -f state=pending \ + -f context="riscv64 wheel tests" \ + -f description="Tests running..." \ + -f target_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" + + # --------------------------------------------------------------------------- + # test: installed-wheel GPU tests run directly on the linux-riscv64-1xrtx6000 + # host (no container). The NVIDIA Container Toolkit is not installed on this + # runner, so containers with --gpus fail; running on the host gives native + # GPU access. + # + # uv is bootstrapped by downloading a pinned static musl binary. Python + # interpreters come from the host, not uv's managed downloads: the lane uses + # the non-PIE CPython builds installed under /opt/python/cp-cp on each + # runner (provisioning script in #738). uv's managed python-build-standalone + # builds are PIE and fragment the Sv39 address space, which breaks the CUDA + # default-mempool reservation (#640); a non-PIE interpreter loads low and + # leaves one contiguous gap. UV_PYTHON_DOWNLOADS=never ensures uv never + # silently falls back to a managed (PIE) download. uv uses its default user + # cache (~/.cache/uv) to avoid the root-owned /var/cache/uv-cache written by + # the build container. + # + # Each matrix leg creates a fresh venv in RUNNER_TEMP (--clear) so a + # leftover from an aborted job cannot leak state into a subsequent run. + # All pytest invocations use --import-mode=importlib and run from the + # checkout root so the package source directories never enter sys.path; + # an import-origin check verifies this before tests run. + # + # The CUDA runtime libraries the tests load (libcudart, libnvJitLink, + # libnvvm, libnvfatbin, libcurand, ptxas, ...) come from the riscv64 kitpick, + # staged once per host by ci/tools/ensure-riscv64-test-ctk.sh into + # ~/.cache/cuda-python-riscv64-ctk/. CUDA_PATH points at the staged tree; + # cuda.pathfinder discovers all libraries via CUDA_PATH without LD_LIBRARY_PATH. + # --------------------------------------------------------------------------- + test: + name: py${{ matrix.python-version }} + needs: resolve + runs-on: linux-riscv64-1xrtx6000 + timeout-minutes: 60 + strategy: + fail-fast: false + # One leg per Python version built by the source run; see the + # "Validate artifacts" step in the resolve job. + matrix: ${{ fromJSON(needs.resolve.outputs.matrix) }} + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} + env: + UV_EXTRA_INDEX_URL: https://pypi.riseproject.dev/simple/ + # Do not let uv download a managed Python: python-build-standalone riscv64 + # builds are PIE and trigger the Sv39 default-mempool OOM (#640/#738). The + # venv is built from the host's non-PIE interpreter under /opt/python. + UV_PYTHON_DOWNLOADS: never + steps: + - name: Checkout source at build SHA + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + ref: ${{ needs.resolve.outputs.head-sha }} + fetch-depth: 1 + persist-credentials: false + + - name: Verify GPU, driver, and glibc (preflight) + run: | + # Print diagnostics useful for catching host-environment issues: + # - nvidia-smi: confirms GPU and driver are accessible on the host. + # - ldd/uname: confirms glibc >= 2.39 so manylinux_2_39 wheels load. + uname -m + ldd --version 2>/dev/null | head -1 + if ! command -v nvidia-smi > /dev/null 2>&1; then + echo "::error title=GPU unavailable (nvidia-smi not found)::nvidia-smi is missing. Check that the NVIDIA driver is installed and on PATH on linux-riscv64-1xrtx6000." + exit 1 + fi + if ! nvidia-smi > /dev/null 2>&1; then + echo "::error title=GPU driver error::nvidia-smi returned a non-zero exit code. The NVIDIA driver may not be loaded or the GPU may be unavailable." + nvidia-smi || true + exit 1 + fi + nvidia-smi + + - name: Bootstrap uv + run: | + # Download a pinned static musl binary for riscv64gc. + # NVIDIA Container Toolkit is absent on this runner so we run on the + # host directly (GPU access is native). uv uses the host's non-PIE + # Python (see the job header), never a managed download. + # See: https://github.com/astral-sh/uv/releases + UV_VERSION="0.13.5" + UV_TARBALL="uv-riscv64gc-unknown-linux-musl.tar.gz" + UV_SHA256="485ffd2d7623fd98f791cb6ab45aa967f1605e3f691666fc49713e3feb2362b9" + mkdir -p "$HOME/.local/bin" + curl -fsSL \ + "https://github.com/astral-sh/uv/releases/download/${UV_VERSION}/${UV_TARBALL}" \ + -o /tmp/uv.tgz + echo "${UV_SHA256} /tmp/uv.tgz" | sha256sum -c + tar -xzf /tmp/uv.tgz -C "$HOME/.local/bin" --strip-components=1 --no-same-owner \ + "uv-riscv64gc-unknown-linux-musl/uv" + chmod +x "$HOME/.local/bin/uv" + rm /tmp/uv.tgz + echo "$HOME/.local/bin" >> "$GITHUB_PATH" + "$HOME/.local/bin/uv" --version + + - name: Stage riscv64 CUDA runtime libraries + # ci/tools/ensure-riscv64-test-ctk.sh comes from the build SHA checkout. + # LD_LIBRARY_PATH is intentionally not set: cuda.pathfinder discovers all + # CTK libraries via CUDA_PATH, which is the mechanism this lane tests. + run: | + ctk_root="$(ci/tools/ensure-riscv64-test-ctk.sh)" + echo "CUDA_PATH=${ctk_root}" >> "$GITHUB_ENV" + + - name: Download cuda.pathfinder wheel + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: cuda-pathfinder-wheel + path: wheels/pathfinder + run-id: ${{ needs.resolve.outputs.run-id }} + github-token: ${{ github.token }} + + - name: Download cuda.bindings wheel + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: cuda-bindings-python${{ matrix.py-nodot }}-cuda${{ needs.resolve.outputs.cuda-ver }}-linux-riscv64-${{ needs.resolve.outputs.head-sha }} + path: wheels/bindings + run-id: ${{ needs.resolve.outputs.run-id }} + github-token: ${{ github.token }} + + - name: Download cuda.core wheel + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: cuda-core-python${{ matrix.py-nodot }}-linux-riscv64-${{ needs.resolve.outputs.head-sha }} + path: wheels/core + run-id: ${{ needs.resolve.outputs.run-id }} + github-token: ${{ github.token }} + + - name: Download cuda.bindings Cython tests + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: cuda-bindings-python${{ matrix.py-nodot }}-cuda${{ needs.resolve.outputs.cuda-ver }}-linux-riscv64-${{ needs.resolve.outputs.head-sha }}-tests + path: cuda_bindings_13/tests/cython + run-id: ${{ needs.resolve.outputs.run-id }} + github-token: ${{ github.token }} + + - name: Set up Python interpreter and test venv + run: | + VENV="${RUNNER_TEMP}/test-venv" + # Use the host's non-PIE CPython (installed under /opt/python by the + # runner-provisioning script in #738), not a uv-managed PIE build, to + # avoid the Sv39 default-mempool OOM (#640). + PYBIN="/opt/python/cp${{ matrix.py-nodot }}-cp${{ matrix.py-nodot }}/bin/python${{ matrix.python-version }}" + if [[ ! -x "${PYBIN}" ]]; then + echo "::error title=Missing non-PIE interpreter::${PYBIN} not found. Provision the runner with the install-nonpie-python.sh script from #738 (sudo ./install-nonpie-python.sh ${{ matrix.python-version }})." + exit 1 + fi + # Fail loudly if the interpreter is not non-PIE (ET_EXEC); a PIE + # interpreter reintroduces the #640 address-space fragmentation. + ELF_TYPE="$(readelf -h "${PYBIN}" | awk '/Type:/ {print $2}')" + if [[ "${ELF_TYPE}" != "EXEC" ]]; then + echo "::error title=Interpreter is PIE::${PYBIN} is ${ELF_TYPE}, expected EXEC (non-PIE). Rebuild it with the #738 script." + exit 1 + fi + # --clear removes any leftover from an aborted previous run. + # Export VIRTUAL_ENV so later `uv pip` and pytest steps target this + # venv without repeating --python. + uv venv --clear "${VENV}" --python "${PYBIN}" + echo "VIRTUAL_ENV=${VENV}" >> "$GITHUB_ENV" + + - name: Install wheels and test dependencies + run: | + # pathfinder and bindings test groups are used directly as source of + # truth; all their deps (including matplotlib and numpy) resolve from + # the RISE index for cp312/cp313. + # + # cuda_core's test group is NOT used because it includes cffi, which + # has no riscv64 binary wheel for any version on either PyPI or the + # RISE index (cp313 is missing from RISE's cffi 1.17.0 build, and + # cffi 2.0.0 has no riscv64 wheel at all). Track riscv64 cffi support: + # https://github.com/riseproject-dev/python-wheels/issues/64 + # pytest is provided by the pathfinder and bindings test groups above; + # no additional packages are needed for test_stream.py and test_context.py. + uv pip install \ + wheels/pathfinder/*.whl \ + wheels/bindings/*.whl \ + wheels/core/*.whl \ + ./cuda_python_test_helpers \ + --group ./cuda_pathfinder/pyproject.toml:test \ + --group ./cuda_bindings_13/pyproject.toml:test + uv pip check + + - name: Verify wheel imports (isolation check) + run: | + # Verify that all three packages import from the installed wheels, + # not from the source tree. Running from the checkout root (not from + # within a package sub-directory) keeps the individual package + # directories out of sys.path, so the cuda/ namespace packages resolve + # only to the venv site-packages. The pytest steps below reinforce + # this with --import-mode=importlib. + "${VIRTUAL_ENV}/bin/python" - <<'PY' + import os + from pathlib import Path + + import cuda.bindings + import cuda.core + import cuda.pathfinder + + workspace = Path(os.environ["GITHUB_WORKSPACE"]).resolve() + for module in (cuda.pathfinder, cuda.bindings, cuda.core): + module_path = Path(module.__file__).resolve() + print(f"{module.__name__}: {module_path}") + if module_path.is_relative_to(workspace): + raise SystemExit( + f"::error title=Import from checkout::" + f"{module.__name__} was imported from the source tree at " + f"{module_path} instead of the installed wheel." + ) + PY + + - name: Test cuda.pathfinder (all tests) + run: | + # Run the full pathfinder test suite. Tests that need CUDA libraries + # absent on riscv64 skip gracefully because + # CUDA_PATHFINDER_TEST_*_STRICTNESS defaults to 'see_what_works'. + # PYTHONPATH adds tests/ so bare helper imports (e.g. + # child_load_nvidia_dynamic_lib_helper, conftest) resolve under + # --import-mode=importlib without exposing cuda_pathfinder/ itself. + # Temporary: curand probe fails with kitpick 13.6/006; revert with the next kitpick (PR #746). + PYTHONPATH="${GITHUB_WORKSPACE}/cuda_pathfinder/tests" \ + "${VIRTUAL_ENV}/bin/python" -m pytest -ra -v \ + --import-mode=importlib \ + --rootdir cuda_pathfinder \ + --junitxml="${RUNNER_TEMP}/junit-pathfinder-py${{ matrix.py-nodot }}.xml" \ + --deselect tests/test_load_nvidia_dynamic_lib.py::test_load_nvidia_dynamic_lib[curand] \ + cuda_pathfinder/tests/ + + - name: Test cuda.bindings (Python tests) + run: | + # Run the full cuda.bindings Python suite; tests for components + # absent on riscv64 skip cleanly. cython/ runs in the dedicated + # step below; example_tests/ needs deps (e.g. CuPy) unavailable on + # riscv64. + "${VIRTUAL_ENV}/bin/python" -m pytest -ra -v \ + --import-mode=importlib \ + --rootdir cuda_bindings_13 \ + --junitxml="${RUNNER_TEMP}/junit-bindings-py${{ matrix.py-nodot }}.xml" \ + --ignore=cuda_bindings_13/tests/cython \ + --ignore=cuda_bindings_13/tests/example_tests \ + cuda_bindings_13/tests/ + + - name: Test cuda.bindings Cython tests + run: | + # test_cython.py imports test_ccuda / test_ccudart / + # test_interoperability_cython from the .so files downloaded into + # tests/cython. PYTHONPATH adds that directory so bare-module imports + # from the compiled .so files resolve without pytest mutating sys.path. + PYTHONPATH="${GITHUB_WORKSPACE}/cuda_bindings_13/tests/cython" \ + "${VIRTUAL_ENV}/bin/python" -m pytest -ra -v \ + --import-mode=importlib \ + --rootdir cuda_bindings_13 \ + --randomly-dont-reorganize \ + --junitxml="${RUNNER_TEMP}/junit-bindings-cython-py${{ matrix.py-nodot }}.xml" \ + cuda_bindings_13/tests/cython + + # TODO(#469): add cuda.core Cython test (download cuda-core-python*-tests + # into cuda_core/tests/cython, run pytest tests/cython) once libnvrtc + # ships for riscv64. + - name: Test cuda.core + run: | + # --rootdir cuda_core picks up pytest.ini (pythonpath = tests), so + # helpers.* imports resolve. --import-mode=importlib prevents pytest + # from adding cuda_core/ to sys.path on top of that. + "${VIRTUAL_ENV}/bin/python" -m pytest -ra -v \ + --import-mode=importlib \ + --rootdir cuda_core \ + --junitxml="${RUNNER_TEMP}/junit-core-py${{ matrix.py-nodot }}.xml" \ + cuda_core/tests/graph/test_graph_definition_mutation.py::test_destroyed_node \ + cuda_core/tests/test_enum_coverage.py \ + cuda_core/tests/test_green_context.py \ + cuda_core/tests/test_strided_layout.py \ + cuda_core/tests/test_tensor_map.py \ + cuda_core/tests/test_utils.py \ + cuda_core/tests/test_device.py::test_device_alloc \ + cuda_core/tests/test_device.py::test_device_alloc_zero_bytes \ + cuda_core/tests/test_stream.py \ + cuda_core/tests/test_context.py \ + cuda_core/tests/test_program.py \ + cuda_core/tests/test_module.py \ + cuda_core/tests/test_launcher.py \ + cuda_core/tests/test_linker.py \ + cuda_core/tests/test_program_cache.py \ + cuda_core/tests/test_program_compile_cache.py \ + --deselect tests/test_green_context.py::TestGreenContextKernelLaunch + + - name: Write step summary + if: always() + run: | + { + echo "## py${{ matrix.python-version }} results" + echo "" + echo "| Suite | Tests | Failures | Errors | Skipped |" + echo "|-------|------:|---------:|-------:|--------:|" + for f in \ + "${RUNNER_TEMP}/junit-pathfinder-py${{ matrix.py-nodot }}.xml" \ + "${RUNNER_TEMP}/junit-bindings-py${{ matrix.py-nodot }}.xml" \ + "${RUNNER_TEMP}/junit-bindings-cython-py${{ matrix.py-nodot }}.xml" \ + "${RUNNER_TEMP}/junit-core-py${{ matrix.py-nodot }}.xml"; do + if [[ -f "$f" ]]; then + label=$(basename "$f" .xml | sed 's/junit-//;s/-py.*//') + tests=$(grep -oP 'tests="\K[0-9]+' "$f" || echo '?') + failures=$(grep -oP 'failures="\K[0-9]+' "$f" || echo '?') + errors=$(grep -oP 'errors="\K[0-9]+' "$f" || echo '?') + skipped=$(grep -oP 'skipped="\K[0-9]+' "$f" || echo '?') + echo "| ${label} | ${tests} | ${failures} | ${errors} | ${skipped} |" + fi + done + } >> "$GITHUB_STEP_SUMMARY" + + - name: Upload JUnit test results + if: always() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 + with: + name: junit-riscv64-py${{ matrix.py-nodot }} + path: ${{ runner.temp }}/junit-*.xml + if-no-files-found: warn + retention-days: 14 + + # --------------------------------------------------------------------------- + # report: post the final commit status on the tested SHA and write an + # overall summary. Runs even when test fails (if: always()), but skips if + # resolve was skipped (which only happens for non-success workflow_run + # completions). Uses needs.resolve.outputs.head-sha which is empty if + # resolve's first step failed, in which case status posting is also skipped. + # --------------------------------------------------------------------------- + report: + name: Post commit status + needs: [resolve, test] + if: >- + always() && + needs.resolve.result != 'skipped' + runs-on: ubuntu-latest + timeout-minutes: 5 + defaults: + run: + shell: bash --noprofile --norc -euo pipefail {0} + steps: + - name: Determine overall result + id: result + run: | + RESOLVE_RESULT="${{ needs.resolve.result }}" + TEST_RESULT="${{ needs.test.result }}" + if [[ "${RESOLVE_RESULT}" != "success" ]]; then + STATE="failure" + DESC="Resolver failed (bad run ID or missing/expired artifacts)" + elif [[ "${TEST_RESULT}" == "success" ]]; then + STATE="success" + DESC="All tests passed" + else + STATE="failure" + DESC="Tests failed or were cancelled (see Actions run for details)" + fi + echo "state=${STATE}" >> "$GITHUB_OUTPUT" + echo "description=${DESC}" >> "$GITHUB_OUTPUT" + + - name: Post final commit status + if: needs.resolve.outputs.head-sha != '' + env: + GH_REPO: ${{ github.repository }} + GH_TOKEN: ${{ github.token }} + HEAD_SHA: ${{ needs.resolve.outputs.head-sha }} + run: | + gh api --method POST \ + "repos/${GH_REPO}/statuses/${HEAD_SHA}" \ + -f state="${{ steps.result.outputs.state }}" \ + -f context="riscv64 wheel tests" \ + -f description="${{ steps.result.outputs.description }}" \ + -f target_url="${GITHUB_SERVER_URL}/${GITHUB_REPOSITORY}/actions/runs/${GITHUB_RUN_ID}" + + - name: Write run summary + if: always() + run: | + { + echo "## riscv64 wheel test summary" + echo "" + echo "| Field | Value |" + echo "|-------|-------|" + echo "| Build run ID | \`${{ needs.resolve.outputs.run-id }}\` |" + echo "| Head SHA | \`${{ needs.resolve.outputs.head-sha }}\` |" + echo "| Resolver | ${{ needs.resolve.result }} |" + echo "| Tests | ${{ needs.test.result }} |" + echo "| Commit status | **${{ steps.result.outputs.state }}** |" + } >> "$GITHUB_STEP_SUMMARY" diff --git a/.github/workflows/update-riscv64-next.yml b/.github/workflows/update-riscv64-next.yml new file mode 100644 index 00000000000..084e28f2171 --- /dev/null +++ b/.github/workflows/update-riscv64-next.yml @@ -0,0 +1,114 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Keeps the riscv64-next branch up to date with ctk-next by merging new +# ctk-next commits into it. Runs on every push to ctk-next and on demand. +# The merge fast-forwards while riscv64-next carries no commits of its own +# and records a merge commit once it does. A conflicting merge fails the +# job and requires manual conflict resolution. +# +# Merging (rather than rebasing) keeps riscv64-next commit IDs stable, so +# no force-push is needed and local clones stay usable with a plain +# `git pull`. It also records each conflict resolution once instead of +# replaying it on every subsequent ctk-next push. +# +# This workflow is specific to NVIDIA-dev/cuda-python-private and is not +# meant to ever be merged to NVIDIA/cuda-python. +name: "Update riscv64-next" + +on: + push: + branches: + - ctk-next + workflow_dispatch: + +# All repository writes use the explicitly down-scoped GitHub App token. +permissions: {} + +concurrency: + group: update-riscv64-next + cancel-in-progress: false + +jobs: + update-riscv64-next: + name: Merge ctk-next into riscv64-next + runs-on: ubuntu-latest + timeout-minutes: 15 + steps: + - name: Create GitHub App token + id: app-token + uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 + with: + client-id: ${{ vars.CUDA_PYTHON_PRIVATE_AUTOMATION_APP_CLIENT_ID }} + private-key: ${{ secrets.CUDA_PYTHON_PRIVATE_AUTOMATION_APP_PRIVATE_KEY }} + owner: ${{ github.repository_owner }} + repositories: ${{ github.event.repository.name }} + permission-contents: write + # Merged ctk-next commits may touch workflow files. + permission-workflows: write + + - name: Checkout private repository + uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0 + with: + fetch-depth: 0 + # Persist the App token so the branch push uses it. + persist-credentials: true + token: ${{ steps.app-token.outputs.token }} + + - name: Merge ctk-next into riscv64-next + run: | + set -euo pipefail + + git config user.name "cuda-python-private-automation[bot]" + git config user.email "cuda-python-private-automation[bot]@users.noreply.github.com" + + git fetch --no-tags origin \ + '+refs/heads/ctk-next:refs/remotes/origin/ctk-next' + + base_oid="$(git rev-parse refs/remotes/origin/ctk-next)" + echo "ctk-next tip: $base_oid" + + # Nothing to do if riscv64-next does not exist on the remote. + if ! git ls-remote --exit-code origin refs/heads/riscv64-next > /dev/null; then + echo "::notice title=Nothing to do::riscv64-next does not exist on the remote; skipping merge." + exit 0 + fi + + git fetch --no-tags origin \ + '+refs/heads/riscv64-next:refs/remotes/origin/riscv64-next' + + old_tip="$(git rev-parse refs/remotes/origin/riscv64-next)" + echo "riscv64-next tip: $old_tip" + + if git merge-base --is-ancestor "$base_oid" "$old_tip"; then + echo "::notice title=Merge no-op::riscv64-next already contains the ctk-next tip ($base_oid)." + exit 0 + fi + + git checkout -B riscv64-next refs/remotes/origin/riscv64-next + if ! git merge --no-edit refs/remotes/origin/ctk-next; then + git merge --abort + echo "::error title=Merge conflict::Merging ctk-next ($base_oid) into riscv64-next failed; manual conflict resolution is required." + { + echo "## Action required: merge ctk-next into riscv64-next manually" + echo + echo "Merging \`ctk-next\` (\`$base_oid\`) into \`riscv64-next\` hit" + echo "conflicts. Resolve them manually:" + echo + echo '```console' + echo "git fetch origin ctk-next riscv64-next" + echo "git checkout riscv64-next" + echo "git merge origin/ctk-next" + echo "# resolve conflicts, then:" + echo "git push origin riscv64-next" + echo '```' + } >> "$GITHUB_STEP_SUMMARY" + exit 1 + fi + + new_tip="$(git rev-parse HEAD)" + + # A plain push is a fast-forward of the branch we just merged into. + # It is rejected safely if riscv64-next moved since the fetch. + git push origin refs/heads/riscv64-next:refs/heads/riscv64-next + echo "::notice title=Updated::riscv64-next now points to $new_tip (merged ctk-next $base_oid)." diff --git a/.gitignore b/.gitignore index ea620d25a43..707ee5227dc 100644 --- a/.gitignore +++ b/.gitignore @@ -8,8 +8,8 @@ __pycache__/ # CUDA Python specific .cache/ -.cython-stdlib -.cython-bindings +.cython-stdlib* +.cython-bindings* .lycheecache .lychee-rendered/ .pytest_cache/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index bd896833b45..b37521f2e5e 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -162,7 +162,7 @@ repos: rev: "3e8a8703264a2f4a69428a0aa4dcb512790b2c8c" # frozen: v6.0.0 hooks: - id: check-added-large-files - exclude: '^(?:cuda_bindings_13/cuda/bindings/(?:nvml\.pyx|_v2/driver\.pyx)|cuda_bindings_12/cuda/bindings/(?:driver\.pyx|runtime\.pyx\.in|nvml\.pyx))$' + exclude: '^(?:cuda_bindings_13/cuda/bindings/(?:nvml\.pyx|_v2/driver\.pyx)|cuda_bindings_12/cuda/bindings/(?:driver\.pyx|runtime\.pyx\.in|nvml\.pyx)|qa/.*\.svg)$' - id: check-case-conflict - id: check-docstring-first - id: check-merge-conflict diff --git a/.spdx-ignore b/.spdx-ignore index 8246ba7079c..dfde0a08495 100644 --- a/.spdx-ignore +++ b/.spdx-ignore @@ -22,7 +22,5 @@ cuda_core/third_party/** # Generated by stubgen-pyx; regenerated on every commit so a header would be lost cuda_core/cuda/**/*.pyi -qa/ctk-next.drawio.svg - # Third-party eMudhra disclosure data, kept byte-identical to the published files ci/tools/runner_trust_probe_chains/** diff --git a/ci/README.md b/ci/README.md index 2fcd5b4ab1d..5554691f887 100644 --- a/ci/README.md +++ b/ci/README.md @@ -1,5 +1,69 @@ # Continuous Integration +## CTK-Next Toolkit + +The private Linux and Windows runbook and wheel workflows read the kitpick +from `ci/ctk-next.json` in the commit under test. Keep `ctk_kitpick` in +`major.minor.patch/NNN` form, including the three-digit kitpick number. +The file also records `cybind_sha`, the full 40-character lowercase commit +SHA used for generation. Both fields are required; no other fields are accepted. + +Each job runs `.github/actions/resolve-ctk-next` after checkout. It exports +`CUDA_VERSION` (major.minor), `CUDA_KITPICK_VERSION` (major.minor.patch), +`CUDA_KITPICK` (NNN), and `CUDA_MAJOR`. The action exposes `cuda-version`, +`cuda-kitpick-version`, `cuda-kitpick`, and the combined `ctk-kitpick` as +outputs for passing the selection between workflow jobs. `CUDA_MAJOR` is +exported only as an environment variable. The optional `ctk-kitpick` input +overrides the configured value for that job; it does not edit the file. +Persist an override in the generated review branch's configuration when later +CI must use the same kitpick. + +This selects the installed toolkit, not cybind's stored generator headers. +Choose a cybind revision containing the corresponding headers separately. +Run the resolver tests with `node --test ci/tools/tests/test_ctk_next_config.cjs`. + +## Windows Installed-Wheel Tests + +`ci-windows-wheel.yml` accepts an optional `cuda-version` such as `13.4.2`. +Omitting it preserves the private kitpick selection. Released toolkits are +downloaded from NVIDIA's redistribution manifest, checked against component +SHA-256 digests, cached by version and architecture, and unpacked into a +version-specific workspace directory. Toolkit selection is job-local; it does +not replace the machine's driver or change system-wide CUDA settings. + +Both Windows wheel CI and cross-repository WoA CI invoke +`ci/tools/test_windows_wheels.ps1`. It installs the three wheel artifacts and +test dependency groups into a fresh virtual environment, verifies Python and +CUDA runtime/NVRTC versions and installed-package import paths, builds Cython +test extensions, and runs pathfinder, bindings (including per-thread default +streams), Cython, and core tests. Existing platform-dependent skips still apply. + +Cross-repository CI reads the released CUDA version and Python matrix from +`ci/versions.yml` at `PUBLIC_SHA`, and checks out test sources at that same SHA. +It uses the private workflow's shared test runner and toolchain setup, without +rebuilding public wheels. The run-specific wheelhouse, virtual environment, +and public test checkout are removed by the existing always-run cleanup step. +Admission creates one public check per Python version in addition to the +aggregate check used by batching. Once the matrix finishes, the Ubuntu reporter +publishes each Python job's success, failure, or cancellation status using an +inline Bash/`jq` loop; no separate reporting script or repository checkout is +needed. +Each leg uploads a provenance-tagged result record and five distinct JUnit XML +reports as private artifacts before cleanup, including on failure. Missing or +invalid result records never count as success. JUnit XML is retained only for +debugging; the reporter does not parse it or publish test counts. Setup failures +and cancellations are reported separately from successful testing. Raw test names, tracebacks, +and captured output are not published to the public repository. +Each public check's Details link points to the private workflow run containing +the job logs and JUnit artifacts. Following that link requires private-repository +access; the URL itself exposes the private repository name and run ID. + +Both wheel workflows retain private JUnit artifacts for seven days. Reporting +App credentials remain on the Ubuntu admission/reporting jobs, not GB10. Results +are published after the whole matrix, not immediately after each leg. Recovery +from a whole-workflow cancellation or reporting API outage remains a separate +concern. + ## Checkout History Use the default shallow checkout for jobs that only read files or test prebuilt diff --git a/ci/ctk-next.json b/ci/ctk-next.json new file mode 100644 index 00000000000..9d566507422 --- /dev/null +++ b/ci/ctk-next.json @@ -0,0 +1,4 @@ +{ + "ctk_kitpick": "13.5.0/025", + "cybind_sha": "dc90fb84e801169907b50f5c23318070bdb7f9d8" +} diff --git a/ci/test-matrix.yml b/ci/test-matrix.yml index b234fb824ad..a88cacca89a 100644 --- a/ci/test-matrix.yml +++ b/ci/test-matrix.yml @@ -30,6 +30,9 @@ # how it was obtained; reviewers should recompute it. Treat a # CI hash mismatch as possible tampering -- never copy the # "got" value from a job log into this file. +# - DRIVER_SHA256: required whenever DRIVER is a version string. The install +# script verifies the download against it and fails closed on a mismatch +# or when it is missing. # - DRIVER: 'earliest' does not work with CUDA 12.9.1 # - DRIVER: a custom version is not supported with FLAVOR=wsl on Linux. # - ENV: optional map of extra environment variables to inject into the test diff --git a/ci/tools/chown-sccache-files.sh b/ci/tools/chown-sccache-files.sh new file mode 100755 index 00000000000..96e0d943292 --- /dev/null +++ b/ci/tools/chown-sccache-files.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +# Chown sccache-generated files on the host filesystem to the +# runner user, so they don't linger as root-owned and +# trigger the "Found root-owned files" abort on the next job. +# +# Runs as root inside the cibuildwheel container, against host paths +# via the /host mount. Callers may invoke it more than once (in-container +# and from a later docker exec); chown is idempotent, so no guard is +# needed. +# +# Reads paths from environment variables (set via CIBW_ENVIRONMENT_LINUX): +# SCCACHE_STATS_FILE -- stats file to chown (on the /host mount) +# SCCACHE_ERROR_LOG -- sccache server error log to chown +# GITHUB_WORKSPACE -- host workspace path (for uid/gid lookup) +set -euo pipefail + +# Determine the (uid, gid) of the runner user from the +# /host workspace directory owner. GITHUB_WORKSPACE is +# already /host-prefixed (set in CIBW_ENVIRONMENT_LINUX). +HOST_WS="${GITHUB_WORKSPACE:-}" +if [ -d "${HOST_WS}" ]; then + owner="$(stat -c %u "${HOST_WS}"):$(stat -c %g "${HOST_WS}")" +else + echo "[chown-sccache] warning: ${HOST_WS:-} does not exist; falling back to current uid/gid" + owner="$(id -u):$(id -g)" +fi + +for f in "${SCCACHE_STATS_FILE:-}" "${SCCACHE_ERROR_LOG:-}"; do + if [ -z "${f}" ] || [ ! -e "${f}" ]; then + echo "[chown-sccache] skip: ${f:-} does not exist" + continue + fi + if chown "${owner}" "${f}" 2>/dev/null; then + new_owner=$(stat -c '%u:%g' "${f}") + echo "[chown-sccache] ok: ${f} now owned by ${new_owner}" + else + echo "[chown-sccache] FAIL: could not chown ${f} (owner=${owner}, current=$(stat -c '%u:%g' "${f}" 2>/dev/null || echo '?'))" + fi +done diff --git a/ci/tools/ctk_next_config.cjs b/ci/tools/ctk_next_config.cjs new file mode 100644 index 00000000000..69442a63e62 --- /dev/null +++ b/ci/tools/ctk_next_config.cjs @@ -0,0 +1,59 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +"use strict"; + +function parseKitpick(value) { + const match = typeof value === "string" + ? /^([1-9][0-9]*)\.(0|[1-9][0-9]*)\.(0|[1-9][0-9]*)\/([0-9]{3})$/.exec(value) + : null; + if (!match || match[0] !== value) { + throw new TypeError("CTK kitpick must be major.minor.patch/NNN, for example 13.5.0/022."); + } + const [, major, minor, patch, kitpick] = match; + return { + ctkKitpick: value, + cudaVersion: `${major}.${minor}`, + cudaKitpickVersion: `${major}.${minor}.${patch}`, + cudaKitpick: kitpick, + cudaMajor: major, + }; +} + +function parseCybindSha(value) { + if (typeof value !== "string" || value.length !== 40 || !/^[0-9a-f]{40}$/.test(value)) { + throw new TypeError("Cybind SHA must be a full 40-character lowercase hexadecimal commit SHA."); + } + return value; +} + +function resolveConfig(config, override = "") { + if (!config || typeof config !== "object" || Array.isArray(config) + || Object.keys(config).length !== 2 + || !Object.hasOwn(config, "ctk_kitpick") || !Object.hasOwn(config, "cybind_sha")) { + throw new TypeError("ci/ctk-next.json must contain exactly two fields: ctk_kitpick and cybind_sha."); + } + const configured = parseKitpick(config.ctk_kitpick); + const cybindSha = parseCybindSha(config.cybind_sha); + return { ...(override === "" ? configured : parseKitpick(override)), cybindSha }; +} + +function resolveActionValues(configText, override = "") { + const resolved = resolveConfig(JSON.parse(configText), override); + return { + outputs: { + "ctk-kitpick": resolved.ctkKitpick, + "cuda-version": resolved.cudaVersion, + "cuda-kitpick-version": resolved.cudaKitpickVersion, + "cuda-kitpick": resolved.cudaKitpick, + }, + environment: { + CUDA_VERSION: resolved.cudaVersion, + CUDA_KITPICK_VERSION: resolved.cudaKitpickVersion, + CUDA_KITPICK: resolved.cudaKitpick, + CUDA_MAJOR: resolved.cudaMajor, + }, + }; +} + +module.exports = { parseKitpick, parseCybindSha, resolveConfig, resolveActionValues }; diff --git a/ci/tools/install_gpu_driver.ps1 b/ci/tools/install_gpu_driver.ps1 index 1957cddb541..80c47e4c5e2 100644 --- a/ci/tools/install_gpu_driver.ps1 +++ b/ci/tools/install_gpu_driver.ps1 @@ -13,8 +13,8 @@ # DRIVER Driver version, e.g. "610.47". Must NOT be 'latest' or # 'earliest' -- those are runner-pre-installed and the # workflow is expected to skip this script for them. -# DRIVER_SHA256 Expected SHA-256 hex digest of the downloaded driver -# installer. +# DRIVER_SHA256 Required. Expected SHA-256 hex digest of the downloaded +# driver installer; verified before the installer runs. # GPU_TYPE Lower-case GPU label from the matrix (e.g. "l4", "rtx4090"). # Selects the data-center vs desktop installer variant. @@ -28,7 +28,8 @@ function Install-Driver { exit 1 } - if (-not $env:DRIVER_SHA256) { + $expected = $env:DRIVER_SHA256 + if (-not $expected) { Write-Error "DRIVER_SHA256 env var is required to verify the driver installer." exit 1 } @@ -75,12 +76,13 @@ function Install-Driver { $ProgressPreference = $ProgressPreference_tmp Write-Output 'Download complete!' - $actual_sha256 = (Get-FileHash -Algorithm SHA256 -Path $filepath).Hash - if ($actual_sha256 -ne $env:DRIVER_SHA256) { - Write-Error "SHA256 mismatch for ${filepath}: expected $($env:DRIVER_SHA256), got $actual_sha256" + # Verify the installer against the pinned sha256 before running it. + $actual = (Get-FileHash -Algorithm SHA256 -Path $filepath).Hash.ToLower() + if ($actual -ne $expected.ToLower()) { + Write-Error "SHA256 mismatch for ${filepath}: expected $expected, got $actual" exit 1 } - Write-Output "SHA256 verified: $actual_sha256" + Write-Output "Driver installer sha256 verified: $actual" # Install the file with the specified path from earlier Write-Output 'Running the driver installer...' diff --git a/ci/tools/install_gpu_driver.sh b/ci/tools/install_gpu_driver.sh index a18938782f5..ea6a8d8a1bb 100755 --- a/ci/tools/install_gpu_driver.sh +++ b/ci/tools/install_gpu_driver.sh @@ -16,12 +16,15 @@ # DRIVER Driver version, e.g. "580.65.06". Must NOT be 'latest' or # 'earliest' -- those are runner-pre-installed and the # workflow is expected to skip this script for them. -# DRIVER_SHA256 Expected lowercase SHA-256 hex digest of the downloaded -# driver installer. +# DRIVER_SHA256 Required. Expected lowercase SHA-256 hex digest of the +# downloaded driver installer; verified before it runs as +# root. Inherited across the sudo and nsenter re-execs. # GPU_TYPE Lower-case GPU label from the matrix (e.g. "v100", "l4", # "h100"). Used only to pick the kernel module flavor # (Volta needs the proprietary/legacy module; everything # newer can use the open module). +# DRIVER_URL Optional full installer URL. Defaults to the public NVIDIA +# driver download for DRIVER and the detected architecture. # # Arch is detected from `uname -m`. # @@ -69,11 +72,11 @@ case "$(uname -m)" in ;; esac -URL="https://us.download.nvidia.com/XFree86/${ARCH_DIR}/${VERSION}/NVIDIA-Linux-${ARCH_SUFFIX}-${VERSION}.run" +URL="${DRIVER_URL:-https://us.download.nvidia.com/XFree86/${ARCH_DIR}/${VERSION}/NVIDIA-Linux-${ARCH_SUFFIX}-${VERSION}.run}" # Re-elevate to root if needed (sudo is preinstalled on the runner image). if [ "$(id -u)" != 0 ]; then - exec sudo -E DRIVER="$DRIVER" DRIVER_SHA256="$DRIVER_SHA256" GPU_TYPE="$GPU_TYPE" "$0" "$@" + exec sudo -E DRIVER="$DRIVER" GPU_TYPE="$GPU_TYPE" DRIVER_URL="${DRIVER_URL:-}" DRIVER_SHA256="$DRIVER_SHA256" "$0" "$@" fi echo "install_gpu_driver.sh is ALPHA -- it performs live modifications to the host driver stack and may cause issues" >&2 @@ -232,8 +235,8 @@ if [ -z "${_NVDRV_NSENTERED:-}" ] && in_container; then # ours lives in the GH workspace mount (container-only), so we pipe the # script body in via stdin instead -- the `< "$0"` fd is opened before # nsenter and stays valid across the namespace switch. Env vars (DRIVER, - # DRIVER_SHA256, GPU_TYPE, _NVDRV_NSENTERED) are inherited by the - # host-side bash. + # DRIVER_URL, DRIVER_SHA256, GPU_TYPE, _NVDRV_NSENTERED) are inherited by + # the host-side bash. _NVDRV_NSENTERED=1 nsenter -t 1 -m -p -n -i -u -- bash -s < "$0" \ || { echo "::error::host-side driver install failed (see output above; also check container has 'options: --privileged --pid=host')" >&2; exit 1; } refresh_container_libs diff --git a/ci/tools/test_windows_wheels.ps1 b/ci/tools/test_windows_wheels.ps1 new file mode 100644 index 00000000000..f1c8e5a6980 --- /dev/null +++ b/ci/tools/test_windows_wheels.ps1 @@ -0,0 +1,150 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +param( + [Parameter(Mandatory = $true)][string]$PythonExecutable, + [Parameter(Mandatory = $true)][string]$PythonVersion, + [Parameter(Mandatory = $true)][string]$CudaVersion, + [string]$SourceDirectory = '.', + [string]$Wheelhouse = 'wheelhouse', + [string]$ArtifactNames = '' +) + +$ErrorActionPreference = 'Stop' +$source = (Resolve-Path -LiteralPath $SourceDirectory).Path +$wheelhousePath = (Resolve-Path -LiteralPath $Wheelhouse).Path +$resultsDirectory = Join-Path $wheelhousePath 'test-results' +New-Item -ItemType Directory -Force -Path $resultsDirectory | Out-Null +$python = $PythonExecutable + +function Invoke-CheckedPython { + param([string[]]$Arguments) + & $python @Arguments + if ($LASTEXITCODE -ne 0) { + throw "Python command failed with exit code ${LASTEXITCODE}: $Arguments" + } +} + +if ($ArtifactNames) { + $names = $ArtifactNames | ConvertFrom-Json + $pythonArtifacts = $names.python.$PythonVersion + if (-not $names.pathfinder -or -not $pythonArtifacts.bindings -or -not $pythonArtifacts.core) { + throw "Missing artifact names for Python $PythonVersion." + } + $pathfinderDirectory = Join-Path $wheelhousePath $names.pathfinder + $bindingsDirectory = Join-Path $wheelhousePath $pythonArtifacts.bindings + $coreDirectory = Join-Path $wheelhousePath $pythonArtifacts.core + $pathfinder = @(Get-ChildItem -LiteralPath $pathfinderDirectory -Filter '*.whl' -File) + $bindings = @(Get-ChildItem -LiteralPath $bindingsDirectory -Filter '*.whl' -File) + $core = @(Get-ChildItem -LiteralPath $coreDirectory -Filter '*.whl' -File) +} +else { + $pathfinder = @(Get-ChildItem -LiteralPath $wheelhousePath -Filter 'cuda_pathfinder-*.whl' -File) + $bindings = @(Get-ChildItem -LiteralPath $wheelhousePath -Filter 'cuda_bindings-*.whl' -File) + $core = @(Get-ChildItem -LiteralPath $wheelhousePath -Filter 'cuda_core-*.whl' -File) +} +if ($pathfinder.Count -ne 1 -or $bindings.Count -ne 1 -or $core.Count -ne 1) { + throw "Expected exactly one pathfinder, bindings, and core wheel for Python $PythonVersion." +} +$wheelPaths = @($pathfinder[0].FullName, $bindings[0].FullName, $core[0].FullName) +$wheelPaths | ForEach-Object { Write-Host "Installing wheel: $_" } +$venv = Join-Path $wheelhousePath '.venv' +Invoke-CheckedPython -Arguments @('-m', 'venv', $venv) +$python = Join-Path $venv 'Scripts\python.exe' +$env:VIRTUAL_ENV = $venv +$env:PATH = "$venv\Scripts;$env:CUDA_PATH\bin;$env:PATH" +$env:EXPECTED_PYTHON_VERSION = $PythonVersion +$env:EXPECTED_CUDA_VERSION = $CudaVersion + +Push-Location $source +try { + Invoke-CheckedPython -Arguments @('-m', 'pip', 'install', '--no-cache-dir', '--upgrade', 'pip') + $installArguments = @('-m', 'pip', 'install', '--no-cache-dir') + $wheelPaths + @( + '--group', './cuda_pathfinder/pyproject.toml:test', + '--group', './cuda_bindings_13/pyproject.toml:test', + '--group', './cuda_core/pyproject.toml:test' + ) + Invoke-CheckedPython -Arguments $installArguments + Invoke-CheckedPython -Arguments @('-m', 'pip', 'check') + + $verifyEnvironment = @' +import ctypes +import os +import sys +import sysconfig +from pathlib import Path + +import cuda.bindings +import cuda.core +import cuda.pathfinder + +expected_python = os.environ["EXPECTED_PYTHON_VERSION"] +expected_pair = tuple(map(int, expected_python.rstrip("t").split(".")[:2])) +print(f"Python: {sys.executable}; {sys.version}", flush=True) +assert sys.version_info[:2] == expected_pair, (sys.version_info, expected_python) +assert sysconfig.get_platform() == os.environ["PYTHON_PLATFORM"], sysconfig.get_platform() +assert bool(sysconfig.get_config_var("Py_GIL_DISABLED")) == expected_python.endswith("t") +if expected_python.endswith("t"): + assert not sys._is_gil_enabled(), "The GIL is unexpectedly enabled" +for module in (cuda.pathfinder, cuda.bindings, cuda.core): + module_path = Path(module.__file__).resolve() + print(f"{module.__name__}: {module_path}", flush=True) + assert module_path.is_relative_to(Path(sys.prefix).resolve()), module_path + +cuda_root = Path(os.environ["CUDA_PATH"]).resolve() +expected_cuda = tuple(map(int, os.environ["EXPECTED_CUDA_VERSION"].split(".")[:2])) +for name, query in (("cudart", "cudaRuntimeGetVersion"), ("nvrtc", "nvrtcVersion")): + loaded = cuda.pathfinder.load_nvidia_dynamic_lib(name) + assert loaded.abs_path, (name, loaded) + library_path = Path(loaded.abs_path).resolve() + assert library_path.is_relative_to(cuda_root), (name, library_path, cuda_root) + library = ctypes.WinDLL(str(library_path)) + if query == "cudaRuntimeGetVersion": + version = ctypes.c_int() + assert library.cudaRuntimeGetVersion(ctypes.byref(version)) == 0 + actual_cuda = (version.value // 1000, version.value % 1000 // 10) + else: + major, minor = ctypes.c_int(), ctypes.c_int() + assert library.nvrtcVersion(ctypes.byref(major), ctypes.byref(minor)) == 0 + actual_cuda = (major.value, minor.value) + print(f"{library_path}: {actual_cuda}", flush=True) + assert actual_cuda == expected_cuda, (library_path, actual_cuda, expected_cuda) +'@ + $verifyPath = Join-Path $venv 'verify-environment.py' + [IO.File]::WriteAllText($verifyPath, $verifyEnvironment, [Text.UTF8Encoding]::new($false)) + Invoke-CheckedPython -Arguments @($verifyPath) + + cmd /d /c 'call cuda_bindings_13\tests\cython\build_tests.bat' + if ($LASTEXITCODE -ne 0) { + throw "Cython test build failed with exit code $LASTEXITCODE." + } + + $script:testResult = 0 + function Invoke-Pytest { + param([string]$TestPath, [string]$Suite) + $report = Join-Path $resultsDirectory "junit-$Suite.xml" + & $python -m pytest -ra -s -vv --junitxml $report $TestPath + if ($LASTEXITCODE -ne 0) { + $script:testResult = 1 + } + } + + Invoke-Pytest 'cuda_pathfinder/tests' 'pathfinder' + Invoke-Pytest 'cuda_bindings_13/tests' 'bindings' + $previousStreamMode = $env:CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM + $env:CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM = '1' + try { + Invoke-Pytest 'cuda_bindings_13/tests' 'bindings-ptds' + } + finally { + $env:CUDA_PYTHON_CUDA_PER_THREAD_DEFAULT_STREAM = $previousStreamMode + } + Invoke-Pytest 'cuda_bindings_13/tests/cython' 'bindings-cython' + Invoke-Pytest 'cuda_core/tests' 'core' + if ($script:testResult -ne 0) { + throw 'One or more installed-wheel test suites failed.' + } +} +finally { + Pop-Location +} diff --git a/ci/tools/tests/test_ctk_next_config.cjs b/ci/tools/tests/test_ctk_next_config.cjs new file mode 100644 index 00000000000..43ad1f6665a --- /dev/null +++ b/ci/tools/tests/test_ctk_next_config.cjs @@ -0,0 +1,155 @@ +// SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +// SPDX-License-Identifier: Apache-2.0 + +"use strict"; + +const assert = require("node:assert/strict"); +const fs = require("node:fs"); +const path = require("node:path"); +const test = require("node:test"); +const { parseKitpick, parseCybindSha, resolveConfig, resolveActionValues } = require("../ctk_next_config.cjs"); + +const cybindSha = "4359948d95d5aaba056be96622f21924cfa1c58d"; + +const root = path.resolve(__dirname, "../../.."); +const action = fs.readFileSync(path.join(root, ".github/actions/resolve-ctk-next/action.yml"), "utf8"); + +// Agent-authored tests (gpt-6); Node tests do not use pytest provenance markers. +test("kitpick parsing preserves the suffix and derives full, short, and major versions", () => { + assert.deepEqual(parseKitpick("13.5.0/016"), { + ctkKitpick: "13.5.0/016", + cudaVersion: "13.5", + cudaKitpickVersion: "13.5.0", + cudaKitpick: "016", + cudaMajor: "13", + }); + assert.deepEqual(parseKitpick("14.0.1/002"), { + ctkKitpick: "14.0.1/002", + cudaVersion: "14.0", + cudaKitpickVersion: "14.0.1", + cudaKitpick: "002", + cudaMajor: "14", + }); +}); + +for (const invalid of [ + null, undefined, 13.5, {}, [], "", "13.5/022", "13.5.0/22", "13.5.0/0022", + "013.5.0/022", "13.05.0/022", "13.5.00/022", "0.5.0/022", + "cuda-r13-5/13.5.0/022", "13.5.0/022\n", "13.5.0/022\r\n", " 13.5.0/022", + "13.5.0/022 ", "13.5.0/022;echo injected", +]) { + test(`invalid kitpick is rejected: ${JSON.stringify(invalid)}`, () => { + assert.throws(() => parseKitpick(invalid), /major\.minor\.patch\/NNN/); + }); +} + +test("override selection validates the file and never mutates its config", () => { + const config = { ctk_kitpick: "13.5.0/016", cybind_sha: cybindSha }; + assert.deepEqual(resolveConfig(config), { ...parseKitpick("13.5.0/016"), cybindSha }); + assert.deepEqual(resolveConfig(config, "13.5.0/022"), { ...parseKitpick("13.5.0/022"), cybindSha }); + assert.deepEqual(config, { ctk_kitpick: "13.5.0/016", cybind_sha: cybindSha }); + assert.throws(() => resolveConfig({ ...config, ctk_kitpick: "invalid" }, "13.5.0/022"), /major\.minor/); + assert.throws(() => resolveConfig({ ...config, cybind_sha: "main" }, "13.5.0/022"), /40-character lowercase/); + assert.throws(() => resolveConfig(config, null), /major\.minor/); +}); + +test("cybind parsing preserves an exact SHA and the checked-in configuration resolves", () => { + assert.equal(parseCybindSha(cybindSha), cybindSha); + const config = JSON.parse(fs.readFileSync(path.join(root, "ci/ctk-next.json"), "utf8")); + assert.deepEqual(resolveConfig(config), { ...parseKitpick(config.ctk_kitpick), cybindSha: config.cybind_sha }); +}); + +for (const invalid of [ + null, undefined, 123, {}, [], "", "main", cybindSha.slice(0, 39), `${cybindSha}0`, + cybindSha.toUpperCase(), `g${cybindSha.slice(1)}`, `${cybindSha}\n`, `${cybindSha}\r\n`, + ` ${cybindSha}`, `${cybindSha} `, `${cybindSha};echo injected`, +]) { + test(`invalid cybind SHA is rejected: ${JSON.stringify(invalid)}`, () => { + assert.throws(() => parseCybindSha(invalid), /40-character lowercase/); + assert.throws(() => resolveConfig({ ctk_kitpick: "13.5.0/016", cybind_sha: invalid }), /40-character lowercase/); + }); +} + +for (const invalid of [ + null, [], "13.5.0/016", {}, { ctk_kitpick: "13.5.0/016" }, { cybind_sha: cybindSha }, + { ctk_kitpick: "13.5.0/016", typo: true }, { cybind_sha: cybindSha, typo: true }, + { ctk_kitpick: "13.5.0/016", cybind_sha: cybindSha, typo: true }, +]) { + test(`invalid config schema is rejected: ${JSON.stringify(invalid)}`, () => { + assert.throws(() => resolveConfig(invalid), /exactly two fields/); + }); +} + +test("action values include every declared output and CUDA field", () => { + const { outputs, environment } = resolveActionValues( + `{\r\n "ctk_kitpick": "13.5.0/022",\r\n "cybind_sha": "${cybindSha}"\r\n}\r\n`, + ); + assert.deepEqual(outputs, { + "ctk-kitpick": "13.5.0/022", + "cuda-version": "13.5", + "cuda-kitpick-version": "13.5.0", + "cuda-kitpick": "022", + }); + assert.deepEqual(environment, { + CUDA_VERSION: "13.5", + CUDA_KITPICK_VERSION: "13.5.0", + CUDA_KITPICK: "022", + CUDA_MAJOR: "13", + }); + for (const name of Object.keys(outputs)) { + assert.ok(action.includes(`value: \${{ steps.resolve.outputs.${name} }}`)); + } +}); + +test("action values use the override when supplied", () => { + const config = `{"ctk_kitpick":"13.5.0/016","cybind_sha":"${cybindSha}"}\n`; + const { outputs, environment } = resolveActionValues(config, "14.0.1/003"); + assert.equal(outputs["ctk-kitpick"], "14.0.1/003"); + assert.equal(environment.CUDA_MAJOR, "14"); + assert.equal(environment.CUDA_KITPICK, "003"); +}); + +test("workflow expressions stay out of the action's inline script", () => { + const scriptStart = action.indexOf("script: |"); + assert.ok(scriptStart >= 0, "The resolver action must contain an inline script block."); + assert.match(action, /CTK_NEXT_KITPICK_OVERRIDE: \$\{\{ inputs\.ctk-kitpick \}\}/); + assert.ok(!action.slice(scriptStart).includes("${{"), "Workflow inputs must enter the script through the environment."); +}); + +for (const [label, config, override] of [ + ["malformed JSON", "{", ""], + ["missing cybind SHA", '{"ctk_kitpick":"13.5.0/016"}', ""], + ["invalid kitpick", `{"ctk_kitpick":null,"cybind_sha":"${cybindSha}"}`, ""], + ["invalid cybind SHA", '{"ctk_kitpick":"13.5.0/016","cybind_sha":"main"}', "13.5.0/022"], + ["invalid override", `{"ctk_kitpick":"13.5.0/016","cybind_sha":"${cybindSha}"}`, "13.5.0/22"], +]) { + test(`action values reject ${label}`, () => { + assert.throws(() => resolveActionValues(config, override)); + }); +} + +test("all six reusable jobs resolve their own checkout before consuming the toolkit", () => { + let jobsChecked = 0; + for (const file of ["ci-linux.yml", "ci-linux-wheel.yml", "ci-windows.yml", "ci-windows-wheel.yml"]) { + const workflow = fs.readFileSync(path.join(root, ".github/workflows", file), "utf8"); + const jobs = workflow.split(/^ [a-z][a-z-]*:\n/gm).slice(1).filter((part) => part.includes(" steps:\n")); + assert.equal(jobs.length, file.includes("wheel") ? 2 : 1); + for (const job of jobs) { + const checkout = job.indexOf("uses: actions/checkout@"); + const resolver = job.indexOf("uses: ./.github/actions/resolve-ctk-next"); + assert.ok(checkout >= 0 && resolver > checkout, `${file}: checkout must precede the resolver`); + assert.equal(job.match(/uses: \.\/\.github\/actions\/resolve-ctk-next/g).length, 1); + const consumer = job.indexOf(file.includes("windows") + ? "uses: ./.github/actions/setup-ctk-next-windows" + : "python3 \"$GITHUB_WORKSPACE/qa/forge/download_from_kitpicks.py\""); + assert.ok(consumer > resolver, `${file}: toolkit setup must follow the resolver`); + if (file.includes("windows")) { + assert.ok(job.indexOf("name: Set up Git for Windows ARM64") < checkout); + } + jobsChecked++; + } + assert.doesNotMatch(workflow, /^\s+CUDA_(?:VERSION|KITPICK_VERSION|KITPICK):/m); + assert.doesNotMatch(workflow, /cuda-13\.5|cuda_bindings-13\.|CUDA_CORE_BUILD_MAJOR[=:] *'?13/); + } + assert.equal(jobsChecked, 6); +}); diff --git a/cuda_bindings_13/cuda/bindings/_internal/cudla.pxd b/cuda_bindings_13/cuda/bindings/_internal/cudla.pxd index 52b1b777056..939699eca5a 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/cudla.pxd +++ b/cuda_bindings_13/cuda/bindings/_internal/cudla.pxd @@ -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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6866708da9b12dc99b597cd56196b66a1f2645198821b572326bb0858b5906d3 +# This code was automatically generated across versions from 1.5.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=701253c5a5be5634e27d4bc830eda88e9b897613863d2e1422637dc52c8ed81b # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/cudla_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/cudla_linux.pyx index 1624403751a..938b78a9a4b 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/cudla_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c45f2cb738d8336a435dae2e5398dc561e360788ee832d40c684a2e17515ae47 +# This code was automatically generated across versions from 1.5.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2909e2380144f08628aed7f5dbaa68a6a896d581db51220275d17e5f0d25a901 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/cudla_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/cudla_windows.pyx index a7e8da22d80..e19b8c9db2f 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/cudla_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=23ad0c59749e78f838cc290fb24960736dbdaceca13f2c6544ba4e0732c23cde +# This code was automatically generated across versions from 1.5.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e7b4276bb13c49bbed08c28161b24962aa97459cce46e1737990f85e1da4a098 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/cufile.pxd b/cuda_bindings_13/cuda/bindings/_internal/cufile.pxd index 9754670ed67..86e055e7e96 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/cufile.pxd +++ b/cuda_bindings_13/cuda/bindings/_internal/cufile.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ce1a8b4cfbbc98d5a6e7975adbfa4e5be9f62da604eb3841691dc555b4b72e76 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9db5375db32884558903626bbd4daf55f574bc6521dd32025dbc14e7d794841f # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/cufile_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/cufile_linux.pyx index 7c1217c6c59..d345aa5d211 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/cufile_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=38e48c1ea5af3be92228b849ae38423ddcf662dc7c50d1bf8fea3e01a5b05f71 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a1b1d162a751fc4b28b1a1a573e0fb179e229db446b51c7cbc3b60fc68048002 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/driver.pxd b/cuda_bindings_13/cuda/bindings/_internal/driver.pxd index d44e4b612bb..6a6d6362d63 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/driver.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b45f017467bf91c9ba21a48072bd362bdf84509c674379435823618c2aebc954 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0761aba524b5d77c085be564dae555c0eb3b559389881f2a0d1084a678ea4502 from ..cydriver cimport * @@ -536,3 +537,5 @@ cdef CUresult _cuMemGetLocationInfo(CUdeviceptr ptr, size_t size, size_t summary 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 +cdef CUresult _cuFabricCpyBatchAsync(size_t numOps, CUDA_FABRIC_COPY_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult _cuTensorMapSetAllocationClass(CUtensorMap* tensorMap, CUtensorMapAllocClass allocClass, CUtensorMapAllocClass* outAllocClass) except ?CUDA_ERROR_NOT_FOUND nogil diff --git a/cuda_bindings_13/cuda/bindings/_internal/driver_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/driver_linux.pyx index ced9445af82..6c70076f63b 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/driver_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cf88d68f5d0521e0872350a3e27b7c90b33d32c0d3d1211ae1aa746da98a588d +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a9e21c758260bd92ddb4ad506a6df0221e4d8b3a80f84e1592d3c09a16632711 # <<<< PREAMBLE CONTENT >>>> @@ -591,6 +592,8 @@ cdef void* __cuMemGetLocationInfo = NULL cdef void* __cuGraphAddNode_v3 = NULL cdef void* __cuGraphNodeSetParams_v2 = NULL cdef void* __cuCheckpointOperationComplete = NULL +cdef void* __cuFabricCpyBatchAsync = NULL +cdef void* __cuTensorMapSetAllocationClass = NULL cdef int _init_driver() except -1 nogil: global _cyb___py_driver_init @@ -2183,6 +2186,12 @@ cdef int _init_driver() except -1 nogil: global __cuCheckpointOperationComplete cuGetProcAddress_v2('cuCheckpointOperationComplete', &__cuCheckpointOperationComplete, 13041, ptds_mode, NULL) + global __cuFabricCpyBatchAsync + cuGetProcAddress_v2('cuFabricCpyBatchAsync', &__cuFabricCpyBatchAsync, 13050, ptds_mode, NULL) + + global __cuTensorMapSetAllocationClass + cuGetProcAddress_v2('cuTensorMapSetAllocationClass', &__cuTensorMapSetAllocationClass, 13050, ptds_mode, NULL) + _cyb_atomic_int_store(&_cyb___py_driver_init, 1) return 0 @@ -3771,6 +3780,12 @@ cpdef dict _inspect_function_pointers(): global __cuCheckpointOperationComplete data["__cuCheckpointOperationComplete"] = __cuCheckpointOperationComplete + + global __cuFabricCpyBatchAsync + data["__cuFabricCpyBatchAsync"] = __cuFabricCpyBatchAsync + + global __cuTensorMapSetAllocationClass + data["__cuTensorMapSetAllocationClass"] = __cuTensorMapSetAllocationClass _cyb_func_ptrs = data return data @@ -9031,3 +9046,23 @@ cdef CUresult _cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) raise FunctionNotFoundError("function cuCheckpointOperationComplete is not found") return (__cuCheckpointOperationComplete)( handle) + + +cdef CUresult _cuFabricCpyBatchAsync(size_t numOps, CUDA_FABRIC_COPY_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFabricCpyBatchAsync + _check_or_init_driver() + if __cuFabricCpyBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuFabricCpyBatchAsync is not found") + return (__cuFabricCpyBatchAsync)( + numOps, opList, flags, hStream) + + +cdef CUresult _cuTensorMapSetAllocationClass(CUtensorMap* tensorMap, CUtensorMapAllocClass allocClass, CUtensorMapAllocClass* outAllocClass) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapSetAllocationClass + _check_or_init_driver() + if __cuTensorMapSetAllocationClass == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapSetAllocationClass is not found") + return (__cuTensorMapSetAllocationClass)( + tensorMap, allocClass, outAllocClass) diff --git a/cuda_bindings_13/cuda/bindings/_internal/driver_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/driver_windows.pyx index eb27c475ed8..74a58a083dc 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/driver_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=407fc621da7a0e722426cccfd66003e6769c32bc671f8ff28cf6fe979ed11b1a +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2859d063dea4ba56ba991a2551674bc33ec3dbf76e31b64e4004e0555d16e3d8 # <<<< PREAMBLE CONTENT >>>> @@ -592,6 +593,8 @@ cdef void* __cuMemGetLocationInfo = NULL cdef void* __cuGraphAddNode_v3 = NULL cdef void* __cuGraphNodeSetParams_v2 = NULL cdef void* __cuCheckpointOperationComplete = NULL +cdef void* __cuFabricCpyBatchAsync = NULL +cdef void* __cuTensorMapSetAllocationClass = NULL cdef int _init_driver() except -1 nogil: global _cyb___py_driver_init @@ -2186,6 +2189,12 @@ cdef int _init_driver() except -1 nogil: global __cuCheckpointOperationComplete cuGetProcAddress_v2('cuCheckpointOperationComplete', &__cuCheckpointOperationComplete, 13041, ptds_mode, NULL) + global __cuFabricCpyBatchAsync + cuGetProcAddress_v2('cuFabricCpyBatchAsync', &__cuFabricCpyBatchAsync, 13050, ptds_mode, NULL) + + global __cuTensorMapSetAllocationClass + cuGetProcAddress_v2('cuTensorMapSetAllocationClass', &__cuTensorMapSetAllocationClass, 13050, ptds_mode, NULL) + _cyb_atomic_int_store(&_cyb___py_driver_init, 1) return 0 @@ -3774,6 +3783,12 @@ cpdef dict _inspect_function_pointers(): global __cuCheckpointOperationComplete data["__cuCheckpointOperationComplete"] = __cuCheckpointOperationComplete + + global __cuFabricCpyBatchAsync + data["__cuFabricCpyBatchAsync"] = __cuFabricCpyBatchAsync + + global __cuTensorMapSetAllocationClass + data["__cuTensorMapSetAllocationClass"] = __cuTensorMapSetAllocationClass _cyb_func_ptrs = data return data @@ -9034,3 +9049,23 @@ cdef CUresult _cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) raise FunctionNotFoundError("function cuCheckpointOperationComplete is not found") return (__cuCheckpointOperationComplete)( handle) + + +cdef CUresult _cuFabricCpyBatchAsync(size_t numOps, CUDA_FABRIC_COPY_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuFabricCpyBatchAsync + _check_or_init_driver() + if __cuFabricCpyBatchAsync == NULL: + with gil: + raise FunctionNotFoundError("function cuFabricCpyBatchAsync is not found") + return (__cuFabricCpyBatchAsync)( + numOps, opList, flags, hStream) + + +cdef CUresult _cuTensorMapSetAllocationClass(CUtensorMap* tensorMap, CUtensorMapAllocClass allocClass, CUtensorMapAllocClass* outAllocClass) except ?CUDA_ERROR_NOT_FOUND nogil: + global __cuTensorMapSetAllocationClass + _check_or_init_driver() + if __cuTensorMapSetAllocationClass == NULL: + with gil: + raise FunctionNotFoundError("function cuTensorMapSetAllocationClass is not found") + return (__cuTensorMapSetAllocationClass)( + tensorMap, allocClass, outAllocClass) diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvfatbin.pxd b/cuda_bindings_13/cuda/bindings/_internal/nvfatbin.pxd index 4eadeab01c8..76c71d423c5 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvfatbin.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4fc8b05be8a1a25737a1940a53339f6af3b7a1d4e513558109aaac48b3222681 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=89fa4f9d955e82b5d045bbbd002502ea5181de0d281fb711b15a49a73744f627 from ..cynvfatbin cimport * diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvfatbin_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvfatbin_linux.pyx index 37250984d38..a2e9a90247f 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvfatbin_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4bf2730251b3d81162f91091cba3d7fbb1d95f8a7e5b74f5957c39ac47d22eff +# This code was automatically generated across versions from 12.4.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=11f4c3514d9dbd77bc6e762ab20e5c5715918a78128464ae62e7bd418edc88ce # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvfatbin_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvfatbin_windows.pyx index 1e418bec4e6..7cce5b92905 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvfatbin_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a3224a93fd799648bec24b3ed8b1e81c8eeff581fef9060f812e8d299c853a26 +# This code was automatically generated across versions from 12.4.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=dad183c22fcab79ccbe6152448a5d6f23177bed7bbac4489549c2adfbcc9b439 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvjitlink.pxd b/cuda_bindings_13/cuda/bindings/_internal/nvjitlink.pxd index bb1419ae946..beb1bf541b1 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvjitlink.pxd +++ b/cuda_bindings_13/cuda/bindings/_internal/nvjitlink.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f54caf5830f0b76772ca6e06487bc94eef354c725f6e6f3c908b993860ba6787 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=11f0793b70dc7c9515f74bf7a42b439294f1664107b49570acd101c3d16ab000 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvjitlink_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvjitlink_linux.pyx index ba20aa4b482..9a2c8d2f494 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvjitlink_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=dba1e396a2c0ab32045c04616c33ee9d515633a0ef0271726c7039783988d5e8 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c2ad2f8858df59e78fa3ed2708a1f7592dbb9aaad6b9b23029bded50f9af30f5 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvjitlink_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvjitlink_windows.pyx index c35c6a91d13..0cedf966679 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvjitlink_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e413ace365d4acd7019fb9dd78af2b46206fd4633cce4a5c905c39e1934911d5 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=42d6fda09ff6fb202c3260ffe6c4b132934c0dc2da81f47a7015e9a0eb495144 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvml.pxd b/cuda_bindings_13/cuda/bindings/_internal/nvml.pxd index 11504e0f41d..afe2fb1134b 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvml.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=25a9a64fc7aed96ba4ab9be2bd7b2c8c2b464e7d8fb7dab7b2dd85b32da0efe3 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=de94985178eb75ca4faf992258f1ea2b67ee0ea2e804d6e687d599bbff6877b0 from ..cynvml cimport * @@ -382,3 +383,11 @@ cdef nvmlReturn_t _nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, nvmlEventSe cdef nvmlReturn_t _nvmlEventSetGetContextData_v1(nvmlEventSet_t set, nvmlEventSetGetContextData_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t _nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlEccBankRemapperStatus_v1_t* pBankRemapperStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetGpuUptime_v1(nvmlDevice_t device, nvmlGpuUptime_v1_t* uptime) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings_v2(nvmlSystemConfComputeSettings_v2_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo_v3(nvmlDevice_t device, nvmlNvLinkInfo_v3_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvlinkRemapTableInfo_v1(nvmlDevice_t device, nvmlNvlinkGetRemapTableInfo_v1_t* remapTableInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetNvlinkNvleReady_v1(nvmlDevice_t device, nvmlNvlinkSetNvleReady_v1_t* setNvleReady) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceLockNvlinkRemapTable_v1(nvmlDevice_t device, nvmlNvlinkLockRemapTable_v1_t* remapTableLockInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceSetupNvlinkNvleEncryptionKey_v1(nvmlDevice_t device, nvmlNvlinkSetupNvleEncryptionKey_v1_t* encryptionKey) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t _nvmlDeviceGetNvlinkNvlePrivateInfo_v1(nvmlDevice_t device, nvmlNvlinkNvlePrivateInfo_v1_t* privateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvml_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvml_linux.pyx index fee348381f7..2024e71c2de 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvml_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d9fb0bf1d20a4742bc4fc5592772f41b04cdf47d403545f57cfbd6644724a7f4 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ee7b19dfb38ccc03dd526b35dc77d344bf068658c92c0d5095a5b363b93c659e # <<<< PREAMBLE CONTENT >>>> @@ -434,6 +435,14 @@ cdef void* __nvmlEventSetGetContextInfo_v1 = NULL cdef void* __nvmlEventSetGetContextData_v1 = NULL cdef void* __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 = NULL cdef void* __nvmlDeviceGetBankRemapperStatus_v1 = NULL +cdef void* __nvmlDeviceGetGpuUptime_v1 = NULL +cdef void* __nvmlSystemGetConfComputeSettings_v2 = NULL +cdef void* __nvmlDeviceGetNvLinkInfo_v3 = NULL +cdef void* __nvmlDeviceGetNvlinkRemapTableInfo_v1 = NULL +cdef void* __nvmlDeviceSetNvlinkNvleReady_v1 = NULL +cdef void* __nvmlDeviceLockNvlinkRemapTable_v1 = NULL +cdef void* __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 = NULL +cdef void* __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 = NULL cdef int _init_nvml() except -1 nogil: global _cyb___py_nvml_init @@ -3031,6 +3040,62 @@ cdef int _init_nvml() except -1 nogil: handle = load_library() __nvmlDeviceGetBankRemapperStatus_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetBankRemapperStatus_v1') + global __nvmlDeviceGetGpuUptime_v1 + __nvmlDeviceGetGpuUptime_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetGpuUptime_v1') + if __nvmlDeviceGetGpuUptime_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetGpuUptime_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetGpuUptime_v1') + + global __nvmlSystemGetConfComputeSettings_v2 + __nvmlSystemGetConfComputeSettings_v2 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlSystemGetConfComputeSettings_v2') + if __nvmlSystemGetConfComputeSettings_v2 == NULL: + if handle == NULL: + handle = load_library() + __nvmlSystemGetConfComputeSettings_v2 = _cyb_dlsym(handle, 'nvmlSystemGetConfComputeSettings_v2') + + global __nvmlDeviceGetNvLinkInfo_v3 + __nvmlDeviceGetNvLinkInfo_v3 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvLinkInfo_v3') + if __nvmlDeviceGetNvLinkInfo_v3 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvLinkInfo_v3 = _cyb_dlsym(handle, 'nvmlDeviceGetNvLinkInfo_v3') + + global __nvmlDeviceGetNvlinkRemapTableInfo_v1 + __nvmlDeviceGetNvlinkRemapTableInfo_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvlinkRemapTableInfo_v1') + if __nvmlDeviceGetNvlinkRemapTableInfo_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvlinkRemapTableInfo_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetNvlinkRemapTableInfo_v1') + + global __nvmlDeviceSetNvlinkNvleReady_v1 + __nvmlDeviceSetNvlinkNvleReady_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetNvlinkNvleReady_v1') + if __nvmlDeviceSetNvlinkNvleReady_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetNvlinkNvleReady_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetNvlinkNvleReady_v1') + + global __nvmlDeviceLockNvlinkRemapTable_v1 + __nvmlDeviceLockNvlinkRemapTable_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceLockNvlinkRemapTable_v1') + if __nvmlDeviceLockNvlinkRemapTable_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceLockNvlinkRemapTable_v1 = _cyb_dlsym(handle, 'nvmlDeviceLockNvlinkRemapTable_v1') + + global __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceSetupNvlinkNvleEncryptionKey_v1') + if __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 = _cyb_dlsym(handle, 'nvmlDeviceSetupNvlinkNvleEncryptionKey_v1') + + global __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 + __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 = _cyb_dlsym(_cyb_RTLD_DEFAULT, 'nvmlDeviceGetNvlinkNvlePrivateInfo_v1') + if __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 == NULL: + if handle == NULL: + handle = load_library() + __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 = _cyb_dlsym(handle, 'nvmlDeviceGetNvlinkNvlePrivateInfo_v1') + _cyb_atomic_int_store(&_cyb___py_nvml_init, 1) return 0 @@ -4157,6 +4222,30 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetBankRemapperStatus_v1 data["__nvmlDeviceGetBankRemapperStatus_v1"] = __nvmlDeviceGetBankRemapperStatus_v1 + + global __nvmlDeviceGetGpuUptime_v1 + data["__nvmlDeviceGetGpuUptime_v1"] = __nvmlDeviceGetGpuUptime_v1 + + global __nvmlSystemGetConfComputeSettings_v2 + data["__nvmlSystemGetConfComputeSettings_v2"] = __nvmlSystemGetConfComputeSettings_v2 + + global __nvmlDeviceGetNvLinkInfo_v3 + data["__nvmlDeviceGetNvLinkInfo_v3"] = __nvmlDeviceGetNvLinkInfo_v3 + + global __nvmlDeviceGetNvlinkRemapTableInfo_v1 + data["__nvmlDeviceGetNvlinkRemapTableInfo_v1"] = __nvmlDeviceGetNvlinkRemapTableInfo_v1 + + global __nvmlDeviceSetNvlinkNvleReady_v1 + data["__nvmlDeviceSetNvlinkNvleReady_v1"] = __nvmlDeviceSetNvlinkNvleReady_v1 + + global __nvmlDeviceLockNvlinkRemapTable_v1 + data["__nvmlDeviceLockNvlinkRemapTable_v1"] = __nvmlDeviceLockNvlinkRemapTable_v1 + + global __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + data["__nvmlDeviceSetupNvlinkNvleEncryptionKey_v1"] = __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + + global __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 + data["__nvmlDeviceGetNvlinkNvlePrivateInfo_v1"] = __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 _cyb_func_ptrs = data return data @@ -7877,3 +7966,83 @@ cdef nvmlReturn_t _nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlE raise FunctionNotFoundError("function nvmlDeviceGetBankRemapperStatus_v1 is not found") return (__nvmlDeviceGetBankRemapperStatus_v1)( device, pBankRemapperStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuUptime_v1(nvmlDevice_t device, nvmlGpuUptime_v1_t* uptime) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuUptime_v1 + _check_or_init_nvml() + if __nvmlDeviceGetGpuUptime_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuUptime_v1 is not found") + return (__nvmlDeviceGetGpuUptime_v1)( + device, uptime) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings_v2(nvmlSystemConfComputeSettings_v2_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeSettings_v2 + _check_or_init_nvml() + if __nvmlSystemGetConfComputeSettings_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeSettings_v2 is not found") + return (__nvmlSystemGetConfComputeSettings_v2)( + settings) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo_v3(nvmlDevice_t device, nvmlNvLinkInfo_v3_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkInfo_v3 + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkInfo_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkInfo_v3 is not found") + return (__nvmlDeviceGetNvLinkInfo_v3)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkRemapTableInfo_v1(nvmlDevice_t device, nvmlNvlinkGetRemapTableInfo_v1_t* remapTableInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkRemapTableInfo_v1 + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkRemapTableInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkRemapTableInfo_v1 is not found") + return (__nvmlDeviceGetNvlinkRemapTableInfo_v1)( + device, remapTableInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetNvlinkNvleReady_v1(nvmlDevice_t device, nvmlNvlinkSetNvleReady_v1_t* setNvleReady) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvlinkNvleReady_v1 + _check_or_init_nvml() + if __nvmlDeviceSetNvlinkNvleReady_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvlinkNvleReady_v1 is not found") + return (__nvmlDeviceSetNvlinkNvleReady_v1)( + device, setNvleReady) + + +cdef nvmlReturn_t _nvmlDeviceLockNvlinkRemapTable_v1(nvmlDevice_t device, nvmlNvlinkLockRemapTable_v1_t* remapTableLockInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceLockNvlinkRemapTable_v1 + _check_or_init_nvml() + if __nvmlDeviceLockNvlinkRemapTable_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceLockNvlinkRemapTable_v1 is not found") + return (__nvmlDeviceLockNvlinkRemapTable_v1)( + device, remapTableLockInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetupNvlinkNvleEncryptionKey_v1(nvmlDevice_t device, nvmlNvlinkSetupNvleEncryptionKey_v1_t* encryptionKey) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + _check_or_init_nvml() + if __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 is not found") + return (__nvmlDeviceSetupNvlinkNvleEncryptionKey_v1)( + device, encryptionKey) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkNvlePrivateInfo_v1(nvmlDevice_t device, nvmlNvlinkNvlePrivateInfo_v1_t* privateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkNvlePrivateInfo_v1 is not found") + return (__nvmlDeviceGetNvlinkNvlePrivateInfo_v1)( + device, privateInfo) diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvml_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvml_windows.pyx index e0d834524b9..d2dd9a7cf53 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvml_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cc3fa2a97922f0213659b0616cb357c6530c01acadea396038c1158f28e78533 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=80639e4c5019f366391d04f1e41318d8042f5e2dbf38bfd2f5e829fdd4720990 # <<<< PREAMBLE CONTENT >>>> @@ -434,6 +435,14 @@ cdef void* __nvmlEventSetGetContextInfo_v1 = NULL cdef void* __nvmlEventSetGetContextData_v1 = NULL cdef void* __nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1 = NULL cdef void* __nvmlDeviceGetBankRemapperStatus_v1 = NULL +cdef void* __nvmlDeviceGetGpuUptime_v1 = NULL +cdef void* __nvmlSystemGetConfComputeSettings_v2 = NULL +cdef void* __nvmlDeviceGetNvLinkInfo_v3 = NULL +cdef void* __nvmlDeviceGetNvlinkRemapTableInfo_v1 = NULL +cdef void* __nvmlDeviceSetNvlinkNvleReady_v1 = NULL +cdef void* __nvmlDeviceLockNvlinkRemapTable_v1 = NULL +cdef void* __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 = NULL +cdef void* __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 = NULL cdef int _init_nvml() except -1 nogil: global _cyb___py_nvml_init @@ -1554,6 +1563,30 @@ cdef int _init_nvml() except -1 nogil: global __nvmlDeviceGetBankRemapperStatus_v1 __nvmlDeviceGetBankRemapperStatus_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetBankRemapperStatus_v1') + global __nvmlDeviceGetGpuUptime_v1 + __nvmlDeviceGetGpuUptime_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetGpuUptime_v1') + + global __nvmlSystemGetConfComputeSettings_v2 + __nvmlSystemGetConfComputeSettings_v2 = _cyb_GetProcAddress(handle, 'nvmlSystemGetConfComputeSettings_v2') + + global __nvmlDeviceGetNvLinkInfo_v3 + __nvmlDeviceGetNvLinkInfo_v3 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvLinkInfo_v3') + + global __nvmlDeviceGetNvlinkRemapTableInfo_v1 + __nvmlDeviceGetNvlinkRemapTableInfo_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvlinkRemapTableInfo_v1') + + global __nvmlDeviceSetNvlinkNvleReady_v1 + __nvmlDeviceSetNvlinkNvleReady_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetNvlinkNvleReady_v1') + + global __nvmlDeviceLockNvlinkRemapTable_v1 + __nvmlDeviceLockNvlinkRemapTable_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceLockNvlinkRemapTable_v1') + + global __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceSetupNvlinkNvleEncryptionKey_v1') + + global __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 + __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 = _cyb_GetProcAddress(handle, 'nvmlDeviceGetNvlinkNvlePrivateInfo_v1') + _cyb_atomic_int_store(&_cyb___py_nvml_init, 1) return 0 @@ -2680,6 +2713,30 @@ cpdef dict _inspect_function_pointers(): global __nvmlDeviceGetBankRemapperStatus_v1 data["__nvmlDeviceGetBankRemapperStatus_v1"] = __nvmlDeviceGetBankRemapperStatus_v1 + + global __nvmlDeviceGetGpuUptime_v1 + data["__nvmlDeviceGetGpuUptime_v1"] = __nvmlDeviceGetGpuUptime_v1 + + global __nvmlSystemGetConfComputeSettings_v2 + data["__nvmlSystemGetConfComputeSettings_v2"] = __nvmlSystemGetConfComputeSettings_v2 + + global __nvmlDeviceGetNvLinkInfo_v3 + data["__nvmlDeviceGetNvLinkInfo_v3"] = __nvmlDeviceGetNvLinkInfo_v3 + + global __nvmlDeviceGetNvlinkRemapTableInfo_v1 + data["__nvmlDeviceGetNvlinkRemapTableInfo_v1"] = __nvmlDeviceGetNvlinkRemapTableInfo_v1 + + global __nvmlDeviceSetNvlinkNvleReady_v1 + data["__nvmlDeviceSetNvlinkNvleReady_v1"] = __nvmlDeviceSetNvlinkNvleReady_v1 + + global __nvmlDeviceLockNvlinkRemapTable_v1 + data["__nvmlDeviceLockNvlinkRemapTable_v1"] = __nvmlDeviceLockNvlinkRemapTable_v1 + + global __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + data["__nvmlDeviceSetupNvlinkNvleEncryptionKey_v1"] = __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + + global __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 + data["__nvmlDeviceGetNvlinkNvlePrivateInfo_v1"] = __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 _cyb_func_ptrs = data return data @@ -6399,3 +6456,83 @@ cdef nvmlReturn_t _nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlE raise FunctionNotFoundError("function nvmlDeviceGetBankRemapperStatus_v1 is not found") return (__nvmlDeviceGetBankRemapperStatus_v1)( device, pBankRemapperStatus) + + +cdef nvmlReturn_t _nvmlDeviceGetGpuUptime_v1(nvmlDevice_t device, nvmlGpuUptime_v1_t* uptime) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetGpuUptime_v1 + _check_or_init_nvml() + if __nvmlDeviceGetGpuUptime_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetGpuUptime_v1 is not found") + return (__nvmlDeviceGetGpuUptime_v1)( + device, uptime) + + +cdef nvmlReturn_t _nvmlSystemGetConfComputeSettings_v2(nvmlSystemConfComputeSettings_v2_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlSystemGetConfComputeSettings_v2 + _check_or_init_nvml() + if __nvmlSystemGetConfComputeSettings_v2 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlSystemGetConfComputeSettings_v2 is not found") + return (__nvmlSystemGetConfComputeSettings_v2)( + settings) + + +cdef nvmlReturn_t _nvmlDeviceGetNvLinkInfo_v3(nvmlDevice_t device, nvmlNvLinkInfo_v3_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvLinkInfo_v3 + _check_or_init_nvml() + if __nvmlDeviceGetNvLinkInfo_v3 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvLinkInfo_v3 is not found") + return (__nvmlDeviceGetNvLinkInfo_v3)( + device, info) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkRemapTableInfo_v1(nvmlDevice_t device, nvmlNvlinkGetRemapTableInfo_v1_t* remapTableInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkRemapTableInfo_v1 + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkRemapTableInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkRemapTableInfo_v1 is not found") + return (__nvmlDeviceGetNvlinkRemapTableInfo_v1)( + device, remapTableInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetNvlinkNvleReady_v1(nvmlDevice_t device, nvmlNvlinkSetNvleReady_v1_t* setNvleReady) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetNvlinkNvleReady_v1 + _check_or_init_nvml() + if __nvmlDeviceSetNvlinkNvleReady_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetNvlinkNvleReady_v1 is not found") + return (__nvmlDeviceSetNvlinkNvleReady_v1)( + device, setNvleReady) + + +cdef nvmlReturn_t _nvmlDeviceLockNvlinkRemapTable_v1(nvmlDevice_t device, nvmlNvlinkLockRemapTable_v1_t* remapTableLockInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceLockNvlinkRemapTable_v1 + _check_or_init_nvml() + if __nvmlDeviceLockNvlinkRemapTable_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceLockNvlinkRemapTable_v1 is not found") + return (__nvmlDeviceLockNvlinkRemapTable_v1)( + device, remapTableLockInfo) + + +cdef nvmlReturn_t _nvmlDeviceSetupNvlinkNvleEncryptionKey_v1(nvmlDevice_t device, nvmlNvlinkSetupNvleEncryptionKey_v1_t* encryptionKey) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 + _check_or_init_nvml() + if __nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceSetupNvlinkNvleEncryptionKey_v1 is not found") + return (__nvmlDeviceSetupNvlinkNvleEncryptionKey_v1)( + device, encryptionKey) + + +cdef nvmlReturn_t _nvmlDeviceGetNvlinkNvlePrivateInfo_v1(nvmlDevice_t device, nvmlNvlinkNvlePrivateInfo_v1_t* privateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + global __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 + _check_or_init_nvml() + if __nvmlDeviceGetNvlinkNvlePrivateInfo_v1 == NULL: + with gil: + raise FunctionNotFoundError("function nvmlDeviceGetNvlinkNvlePrivateInfo_v1 is not found") + return (__nvmlDeviceGetNvlinkNvlePrivateInfo_v1)( + device, privateInfo) diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvrtc.pxd b/cuda_bindings_13/cuda/bindings/_internal/nvrtc.pxd index 1da9da1cdcf..dad9dc1febe 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvrtc.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1710f2e6f38e8023555cf41d7faf7c3aba487689e58eddac250903cc33d6d4fe +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=422a328a3929758e32e387a80e109becf925cb44c26e297c9bc5bd98bda143f5 from ..cynvrtc cimport * diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvrtc_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvrtc_linux.pyx index 136b056b608..257281a5065 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvrtc_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7e4f779cb95262a9ce50e2c887489437d1a16d883f4f45476378655bb5e1fc69 +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4b8bf2b614194103e6044e31bba087de5108eff89a71ccda8ecbad4a7cd11b3d # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvrtc_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvrtc_windows.pyx index 482a4de3f2d..d5e60627860 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvrtc_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b9e4b87d212e5799014bbf50cb40078826014cfcc73ff22c6c74deeb39a5a905 +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d30f175b45d5d13b4ab94e2d8ca65c2096b886fb128e84100afe7e5ea36ddadb # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvvm.pxd b/cuda_bindings_13/cuda/bindings/_internal/nvvm.pxd index 5b9abafa5df..1db2793526f 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvvm.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6be47c668a3a1086937075cb5f4798941232ec81027841b98ee6ca66c277ff0c +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bfa9d7f6a8fdb9eed033d43cad1941c1085f7ed98803035a9b04f8a822a62cee from ..cynvvm cimport * diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvvm_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvvm_linux.pyx index 9d87f31b892..ba4ab6f2acb 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvvm_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=dd3979ce7ab7c6374aa8a0ed49624576a4ede9f29a9e05f8c70bd9422ae797f3 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b63e88b9936064bc652ff09506f38a21d710943165b8dfb2b845dee71924b748 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/nvvm_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/nvvm_windows.pyx index c33126df053..20f5e62e7f0 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/nvvm_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=640a4399ee31052cd30898b0e6e73d424683a67376594d4e6d92c80918cdcdaa +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=232ead28b0246d94834ba9ae9e8f28ba6e9e5584b20c7e0f14f40c5cc7005337 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_internal/runtime.pxd b/cuda_bindings_13/cuda/bindings/_internal/runtime.pxd index f7f47c97856..01427444505 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/runtime.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0ffe9d8d30b5d068a7a7a368d66ca9f4904fbc62224f8617c3968dd73f017e25 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=624f582b71fa48eead402a87353c9a1dd99cfbd6a9119047ec03675bc84a8dc1 from ..cyruntime cimport * # EGL/GL/VDPAU helper declarations (implementations included in runtime_linux/windows.pyx) diff --git a/cuda_bindings_13/cuda/bindings/_internal/runtime_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/runtime_linux.pyx index 1ae37127bd1..ba51341695c 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/runtime_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8a9a7693abb19d9b8586773190de738ea06eff697d16683a49ce67bfa4426788 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5a96b0120a494b4d577fe472c6179b5bade29596b87bddd27e483f5ad93b8086 import os from libc.stdint cimport uintptr_t diff --git a/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds.pxd b/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds.pxd index 322ecce25ce..1294f9550bc 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=997d3bde508f97fcb58d0bfe138041c865c8c738f43dec215826d8498ad73cf2 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a6f7235ff363ca96c5969adb4299797a3fd46bb859a5887b6edb59bb1ff864c9 from ..cyruntime cimport * diff --git a/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds_linux.pyx b/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds_linux.pyx index 730bd35b917..a51965c380e 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds_linux.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0a50966ff0481d081895f8a962cedc08239c3637de07e4a554eec0cdf08d6670 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=efdfeedc8c70d71ef1ab8f572386c9cb81f649d00ce44c5eac8a3c06b24f597d cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM diff --git a/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds_windows.pyx index 730bd35b917..a51965c380e 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/runtime_ptds_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0a50966ff0481d081895f8a962cedc08239c3637de07e4a554eec0cdf08d6670 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=efdfeedc8c70d71ef1ab8f572386c9cb81f649d00ce44c5eac8a3c06b24f597d cdef extern from "": """ #define CUDA_API_PER_THREAD_DEFAULT_STREAM diff --git a/cuda_bindings_13/cuda/bindings/_internal/runtime_windows.pyx b/cuda_bindings_13/cuda/bindings/_internal/runtime_windows.pyx index 01a9d803c50..958e70ae7fa 100644 --- a/cuda_bindings_13/cuda/bindings/_internal/runtime_windows.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ea5305267da9d9a72f329179f57a5ba85d5ba93f7dbb80eb6deb188f735f3d68 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8e3c74dc94d73a3d7aeab8e2bc04a7809a08d1e2f1c5490fd93999f49359858e import os from libc.stdint cimport uintptr_t diff --git a/cuda_bindings_13/cuda/bindings/_v2/driver.pxd b/cuda_bindings_13/cuda/bindings/_v2/driver.pxd index ace8959f3f8..e78e3b3260a 100644 --- a/cuda_bindings_13/cuda/bindings/_v2/driver.pxd +++ b/cuda_bindings_13/cuda/bindings/_v2/driver.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6fcf904a35d5aa857ef919763d56c49656afa5977ed8be2f91f7cad840af7ed6 +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=610c082a452fc1862d3c71545cbccfc2607ab446b3c6ad74f390894678ac84bb # <<<< PREAMBLE CONTENT >>>> @@ -66,6 +67,8 @@ ctypedef CUcheckpointCustomStoragePerDeviceData CheckpointCustomStoragePerDevice ctypedef CUcoredumpStatusCallback coredumpStatusCallback ctypedef CUcheckpointCustomStorageInfo CheckpointCustomStorageInfo ctypedef CUasyncCallback asyncCallback +ctypedef CUfabricCpyOperand FabricCpyOperand +ctypedef CUDA_FABRIC_COPY_BATCH_OP_st FabricCopyBatchOp ctypedef CUgraphRecaptureCallback graphRecaptureCallback @@ -199,6 +202,8 @@ ctypedef CUlogicalEndpointType _LogicalEndpointType ctypedef CUlogicalEndpointFlag _LogicalEndpointFlag ctypedef CUgraphRecaptureStatus _GraphRecaptureStatus ctypedef CUcliqueType _CliqueType +ctypedef CUtensorMapAllocClass _TensorMapAllocClass +ctypedef CUfabricCpyOperandType _FabricCpyOperandType ############################################################################### @@ -719,3 +724,5 @@ cpdef object mem_get_location_info(uint64_t ptr, size_t size, size_t summary_gra cpdef intptr_t graph_add_node_v3(intptr_t h_graph, dependencies, dependency_data, size_t num_dependencies, node_params) except? 0 cpdef graph_node_set_params_v2(intptr_t h_node, node_params) cpdef checkpoint_operation_complete(intptr_t handle) +cpdef fabric_cpy_batch_async(size_t num_ops, intptr_t op_list, unsigned long long flags, intptr_t h_stream) +cpdef tensor_map_set_allocation_class(tensor_map, int alloc_class, intptr_t out_alloc_class) diff --git a/cuda_bindings_13/cuda/bindings/_v2/driver.pyx b/cuda_bindings_13/cuda/bindings/_v2/driver.pyx index 65f0f99a6b2..e0d3eccfec8 100644 --- a/cuda_bindings_13/cuda/bindings/_v2/driver.pyx +++ b/cuda_bindings_13/cuda/bindings/_v2/driver.pyx @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2aeb6615dc0c6ffb24ee43dc713535be3e3dca8dcf13c42bdc7d3a1cf3326c11 +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b49a013d828d765cf31540fe63c42d8d68eace7302cdc0fc42b4c59d44743442 # <<<< PREAMBLE CONTENT >>>> @@ -592,6 +593,8 @@ class DeviceAttribute(_cyb_FastEnum): LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED = (cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_UNICAST_ACCESS_ON_OWNER_DEVICE_SUPPORTED, 'Device supports unicast logical endpoint access on the owner device') LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT = (cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT, 'Number of multiprocessors on each locality domain') LOGICAL_ENDPOINT_SUPPORTED_HANDLE_TYPES = (cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_LOGICAL_ENDPOINT_SUPPORTED_HANDLE_TYPES, 'Handle types supported with logical endpoint IPC') + VULKAN_CIG_STREAMS_SUPPORTED = (cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_STREAMS_SUPPORTED, 'Device supports CIG streams with Vulkan') + TENSOR_MAP_LARGE_TENSOR_MIN_SIZE = (cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE, 'Minimum contiguous, accessible size in bytes required when the large tensor-map allocation class is effective. Devices with a 128 KiB backing precondition report 131072; devices where allocation-class selection is a no-op report INT_MAX.') 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 mapping link') MAX = cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_MAX @@ -765,7 +768,7 @@ class JitOption(_cyb_FastEnum): REFERENCED_VARIABLE_NAMES = (cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_NAMES, '[Deprecated] Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0') REFERENCED_VARIABLE_COUNT = (cydriver.CUjit_option_enum.CU_JIT_REFERENCED_VARIABLE_COUNT, '[Deprecated] Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0') OPTIMIZE_UNUSED_DEVICE_VARIABLES = (cydriver.CUjit_option_enum.CU_JIT_OPTIMIZE_UNUSED_DEVICE_VARIABLES, '[Deprecated] Only valid with LTO-IR compiled with toolkits prior to CUDA 12.0') - POSITION_INDEPENDENT_CODE = (cydriver.CUjit_option_enum.CU_JIT_POSITION_INDEPENDENT_CODE, 'Generate position independent code (0: false) Option type: int Applies to: compiler only') + POSITION_INDEPENDENT_CODE = (cydriver.CUjit_option_enum.CU_JIT_POSITION_INDEPENDENT_CODE, '[Deprecated]') MIN_CTA_PER_SM = (cydriver.CUjit_option_enum.CU_JIT_MIN_CTA_PER_SM, 'This option hints to the JIT compiler the minimum number of CTAs from the kernel’s grid to be mapped to a SM. This option is ignored when used together with `CU_JIT_MAX_REGISTERS` or `CU_JIT_THREADS_PER_BLOCK`. Optimizations based on this option need `CU_JIT_MAX_THREADS_PER_BLOCK` to be specified as well. For kernels already using PTX directive .minnctapersm, this option will be ignored by default. Use `CU_JIT_OVERRIDE_DIRECTIVE_VALUES` to let this option take precedence over the PTX directive. Option type: unsigned int Applies to: compiler only') MAX_THREADS_PER_BLOCK = (cydriver.CUjit_option_enum.CU_JIT_MAX_THREADS_PER_BLOCK, 'Maximum number threads in a thread block, computed as the product of the maximum extent specifed for each dimension of the block. This limit is guaranteed not to be exeeded in any invocation of the kernel. Exceeding the the maximum number of threads results in runtime error or kernel launch failure. For kernels already using PTX directive .maxntid, this option will be ignored by default. Use `CU_JIT_OVERRIDE_DIRECTIVE_VALUES` to let this option take precedence over the PTX directive. Option type: int Applies to: compiler only') OVERRIDE_DIRECTIVE_VALUES = (cydriver.CUjit_option_enum.CU_JIT_OVERRIDE_DIRECTIVE_VALUES, 'This option lets the values specified using `CU_JIT_MAX_REGISTERS`, `CU_JIT_THREADS_PER_BLOCK`, `CU_JIT_MAX_THREADS_PER_BLOCK` and `CU_JIT_MIN_CTA_PER_SM` take precedence over any PTX directives. (0: Disable, default; 1: Enable) Option type: int Applies to: compiler only') @@ -956,7 +959,10 @@ class GraphNodeType(_cyb_FastEnum): MEM_FREE = (cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEM_FREE, 'Memory Free Node') BATCH_MEM_OP = (cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_BATCH_MEM_OP, 'Batch MemOp Node See `cuStreamBatchMemOp` and `CUstreamBatchMemOpType` for what these nodes can do.') CONDITIONAL = (cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_CONDITIONAL, 'Conditional Node May be used to implement a conditional execution path or loop inside of a graph. The graph(s) contained within the body of the conditional node can be selectively executed or iterated upon based on the value of a conditional variable. Handles must be created in advance of creating the node using `cuGraphConditionalHandleCreate`. The following restrictions apply to graphs which contain conditional nodes: The graph cannot be used in a child node. Only one instantiation of the graph may exist at any point in time. The graph cannot be cloned. To set the control value, supply a default value when creating the handle and/or call `cudaGraphSetConditional` from device code.') + MEMCPY_BATCH = (cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY_BATCH, 'Batch Memcpy Node') RESERVED_16 = (cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_RESERVED_16, 'Reserved') + EXTERNAL_ENGINE = (cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXTERNAL_ENGINE, 'Reserved for External Engine node') + FABRIC_CPY_BATCH = (cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_FABRIC_CPY_BATCH, 'Fabric copy batch node') class GraphDependencyType(_cyb_FastEnum): """ @@ -1680,6 +1686,8 @@ class GraphDebugDotFlags(_cyb_FastEnum): BATCH_MEM_OP_NODE_PARAMS = (cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS, 'Adds batch mem op node parameters to output') EXTRA_TOPO_INFO = (cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO, 'Adds edge numbering information') CONDITIONAL_NODE_PARAMS = (cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS, 'Adds conditional node parameters to output') + MEMCPY_BATCH_NODE_PARAMS = (cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_BATCH_NODE_PARAMS, 'Adds batch memcpy node parameters to the output') + FABRIC_CPY_BATCH_NODE_PARAMS = (cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_FABRIC_CPY_BATCH_NODE_PARAMS, 'Adds fabric copy batch node parameters') class UserObjectFlags(_cyb_FastEnum): """ @@ -1788,6 +1796,7 @@ class CoredumpGenerationFlags(_cyb_FastEnum): SKIP_CONSTBANK_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_CONSTBANK_MEMORY GZIP_COMPRESS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_GZIP_COMPRESS FAULTED_CONTEXTS_ONLY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_FAULTED_CONTEXTS_ONLY + SKIP_TENSOR_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_TENSOR_MEMORY NO_ERRBAR_AT_EXIT = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_NO_ERRBAR_AT_EXIT LOG_ONLY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LOG_ONLY LIGHTWEIGHT_FLAGS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LIGHTWEIGHT_FLAGS @@ -2057,6 +2066,7 @@ class DevSmResourceGroupFlags(_cyb_FastEnum): DEFAULT = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_DEFAULT BACKFILL = cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_BACKFILL 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 localityDomainId') + LOCALITY_DOMAIN_SUPPLEMENTAL_SMS = (cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS, 'Modifier to `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID` which allows selection of SMs in the locality domain exceeding the `CUdevice_attribute`::CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT') class DevSmResourceSplitByCountFlags(_cyb_FastEnum): """ @@ -2109,6 +2119,7 @@ class StreamCigDataType(_cyb_FastEnum): See `CUstreamCigDataType`. """ D3D12_COMMAND_LIST = (cydriver.CUstreamCigDataType_enum.STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST, 'D3D12 Command List Handle') + VULKAN_COMMAND_BUFFER_HANDLE_NV = (cydriver.CUstreamCigDataType_enum.STREAM_CIG_DATA_TYPE_VULKAN_COMMAND_BUFFER_HANDLE_NV, 'Vulkan Command Buffer Internal NVIDIA Handle') class LogicalEndpointIpcHandleType(_cyb_FastEnum): """ @@ -2117,8 +2128,8 @@ class LogicalEndpointIpcHandleType(_cyb_FastEnum): See `CUlogicalEndpointIpcHandleType`. """ - NONE = cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE - FABRIC = cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC + NONE = (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE, 'Does not allow any export mechanism') + FABRIC = (cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC, 'Allows export to a fabric handle (`CUlogicalEndpointFabricHandle`)') class LogicalEndpointType(_cyb_FastEnum): """ @@ -2158,6 +2169,35 @@ class CliqueType(_cyb_FastEnum): UNICAST_LOGICAL_ENDPOINT = (cydriver.CUcliqueType_enum.CU_CLIQUE_TYPE_UNICAST_LOGICAL_ENDPOINT, 'Unicast logical endpoint clique') MULTICAST_LOGICAL_ENDPOINT = (cydriver.CUcliqueType_enum.CU_CLIQUE_TYPE_MULTICAST_LOGICAL_ENDPOINT, 'Multicast logical endpoint clique') +class TensorMapAllocClass(_cyb_FastEnum): + """ + Tensor-map allocation class. On devices where allocation-class + selection affects Tensor Memory Accelerator (TMA) out-of-bounds address + generation, this controls the mode encoded in a `CUtensorMap`. The + "large" class enables a wider (128 KiB) OOB address-generation window + that improves performance but is only safe when the tensor's base + allocation is backed by a contiguous, accessible region of at least + `CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE` bytes. On + devices where allocation-class selection has no effect, all requests + have the same SMALL effective behavior. + + See `CUtensorMapAllocClass`. + """ + AUTO = (cydriver.CUtensorMapAllocClass_enum.CU_TENSOR_MAP_ALLOC_CLASS_AUTO, 'Recompute the effective allocation class from the tensor-map layout.') + SMALL = (cydriver.CUtensorMapAllocClass_enum.CU_TENSOR_MAP_ALLOC_CLASS_SMALL, 'Request the "small" class (safe 4 KiB OOB window).') + LARGE = (cydriver.CUtensorMapAllocClass_enum.CU_TENSOR_MAP_ALLOC_CLASS_LARGE, 'Request the "large" class (128 KiB OOB window); when LARGE is effective, the caller guarantees the effective base allocation is accessible for at least `CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE` bytes before use.') + +class FabricCpyOperandType(_cyb_FastEnum): + """ + These flags allow applications to convey the operand type for + individual copies specified in `cuFabricCpyBatchAsync`. + + See `CUfabricCpyOperandType`. + """ + POINTER = (cydriver.CUfabricCpyOperandType_enum.CU_FABRIC_COPY_OPERAND_TYPE_POINTER, 'Copy operand is a valid pointer.') + LOGICAL_ENDPOINT = (cydriver.CUfabricCpyOperandType_enum.CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT, 'Copy operand is a logical endpoint.') + MAX = cydriver.CUfabricCpyOperandType_enum.CU_FABRIC_COPY_OPERAND_TYPE_MAX + ############################################################################### # Enums for C preprocessor constants (`#define`), grouped by what they are used for. # The values are taken from the C constants, so they track the CTK header. @@ -19159,6 +19199,191 @@ cdef class EventRecordNodeParams: return obj +cdef _get_fabric_cpy_batch_node_params_v1_dtype_offsets(): + cdef CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 pod + return _numpy.dtype({ + 'names': ['num_ops', 'op_list', 'flags_', 'ctx', 'g_ctx'], + 'formats': [_numpy.uint64, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.numOps)) - (&pod), + (&(pod.opList)) - (&pod), + (&(pod.flags)) - (&pod), + (&(pod.ctx)) - (&pod), + (&(pod.gCtx)) - (&pod), + ], + 'itemsize': sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1), + }) + +fabric_cpy_batch_node_params_v1_dtype = _get_fabric_cpy_batch_node_params_v1_dtype_offsets() + +cdef class FabricCpyBatchNodeParamsV1: + """Empty-initialize an instance of `CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1`. + + + .. seealso:: `CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1` + """ + cdef: + CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 *_ptr + object _owner + bint _owns_ptr + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1)) + if self._ptr == NULL: + raise MemoryError("Error allocating FabricCpyBatchNodeParamsV1") + self._owns_ptr = True + self._owner = None + self._readonly = False + + def __dealloc__(self): + cdef CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 *ptr + if self._owns_ptr and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.FabricCpyBatchNodeParamsV1 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 FabricCpyBatchNodeParamsV1 other_ + if not isinstance(other, FabricCpyBatchNodeParamsV1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This FabricCpyBatchNodeParamsV1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1), view.len) + ) + _cyb_memmove(self._ptr, view.buf, sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1)) + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def num_ops(self): + """int: """ + return self._ptr[0].numOps + + @num_ops.setter + def num_ops(self, val): + if self._readonly: + raise ValueError("This FabricCpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].numOps = val + + @property + def op_list(self): + """int: """ + return (self._ptr[0].opList) + + @op_list.setter + def op_list(self, val): + if self._readonly: + raise ValueError("This FabricCpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].opList = val + + @property + def flags_(self): + """int: """ + return self._ptr[0].flags + + @flags_.setter + def flags_(self, val): + if self._readonly: + raise ValueError("This FabricCpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].flags = val + + @property + def ctx(self): + """int: """ + return (self._ptr[0].ctx) + + @ctx.setter + def ctx(self, val): + if self._readonly: + raise ValueError("This FabricCpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].ctx = val + + @property + def g_ctx(self): + """int: """ + return (self._ptr[0].gCtx) + + @g_ctx.setter + def g_ctx(self, val): + if self._readonly: + raise ValueError("This FabricCpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].gCtx = val + + @staticmethod + def from_buffer(buffer): + """Create an FabricCpyBatchNodeParamsV1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1), FabricCpyBatchNodeParamsV1) + + @staticmethod + def from_data(data): + """Create an FabricCpyBatchNodeParamsV1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `fabric_cpy_batch_node_params_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "fabric_cpy_batch_node_params_v1_dtype", fabric_cpy_batch_node_params_v1_dtype, FabricCpyBatchNodeParamsV1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an FabricCpyBatchNodeParamsV1 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 FabricCpyBatchNodeParamsV1 obj = FabricCpyBatchNodeParamsV1.__new__(FabricCpyBatchNodeParamsV1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1)) + if obj._ptr == NULL: + raise MemoryError("Error allocating FabricCpyBatchNodeParamsV1") + _cyb_memcpy((obj._ptr), ptr, sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1)) + obj._owns_ptr = True + obj._owner = None + else: + obj._ptr = ptr + obj._owns_ptr = False + obj._owner = owner + obj._readonly = readonly + return obj + + cdef _get_stream_cig_capture_params_dtype_offsets(): cdef CUstreamCigCaptureParams pod return _numpy.dtype({ @@ -24727,6 +24952,239 @@ cdef class MemAllocNodeParams_v2: return obj +cdef _get_memcpy_batch_node_params_v1_dtype_offsets(): + cdef CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 pod + return _numpy.dtype({ + 'names': ['count', 'dsts', 'srcs', 'sizes', 'attrs', 'attrs_idxs', 'num_attrs', 'ctx', 'g_ctx'], + 'formats': [_numpy.uint64, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.intp, _numpy.uint64, _numpy.intp, _numpy.intp], + 'offsets': [ + (&(pod.count)) - (&pod), + (&(pod.dsts)) - (&pod), + (&(pod.srcs)) - (&pod), + (&(pod.sizes)) - (&pod), + (&(pod.attrs)) - (&pod), + (&(pod.attrsIdxs)) - (&pod), + (&(pod.numAttrs)) - (&pod), + (&(pod.ctx)) - (&pod), + (&(pod.gCtx)) - (&pod), + ], + 'itemsize': sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1), + }) + +memcpy_batch_node_params_v1_dtype = _get_memcpy_batch_node_params_v1_dtype_offsets() + +cdef class MemcpyBatchNodeParamsV1: + """Empty-initialize an instance of `CUDA_MEMCPY_BATCH_NODE_PARAMS_V1`. + + + .. seealso:: `CUDA_MEMCPY_BATCH_NODE_PARAMS_V1` + """ + cdef: + CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 *_ptr + object _owner + bint _owns_ptr + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1)) + if self._ptr == NULL: + raise MemoryError("Error allocating MemcpyBatchNodeParamsV1") + self._owns_ptr = True + self._owner = None + self._readonly = False + + def __dealloc__(self): + cdef CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 *ptr + if self._owns_ptr and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.MemcpyBatchNodeParamsV1 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 MemcpyBatchNodeParamsV1 other_ + if not isinstance(other, MemcpyBatchNodeParamsV1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1), view.len) + ) + _cyb_memmove(self._ptr, view.buf, sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1)) + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def count(self): + """int: """ + return self._ptr[0].count + + @count.setter + def count(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].count = val + + @property + def dsts(self): + """int: """ + return (self._ptr[0].dsts) + + @dsts.setter + def dsts(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].dsts = val + + @property + def srcs(self): + """int: """ + return (self._ptr[0].srcs) + + @srcs.setter + def srcs(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].srcs = val + + @property + def sizes(self): + """int: """ + return (self._ptr[0].sizes) + + @sizes.setter + def sizes(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].sizes = val + + @property + def attrs(self): + """int: """ + return (self._ptr[0].attrs) + + @attrs.setter + def attrs(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].attrs = val + + @property + def attrs_idxs(self): + """int: """ + return (self._ptr[0].attrsIdxs) + + @attrs_idxs.setter + def attrs_idxs(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].attrsIdxs = val + + @property + def num_attrs(self): + """int: """ + return self._ptr[0].numAttrs + + @num_attrs.setter + def num_attrs(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].numAttrs = val + + @property + def ctx(self): + """int: """ + return (self._ptr[0].ctx) + + @ctx.setter + def ctx(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].ctx = val + + @property + def g_ctx(self): + """int: """ + return (self._ptr[0].gCtx) + + @g_ctx.setter + def g_ctx(self, val): + if self._readonly: + raise ValueError("This MemcpyBatchNodeParamsV1 instance is read-only") + self._ptr[0].gCtx = val + + @staticmethod + def from_buffer(buffer): + """Create an MemcpyBatchNodeParamsV1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1), MemcpyBatchNodeParamsV1) + + @staticmethod + def from_data(data): + """Create an MemcpyBatchNodeParamsV1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `memcpy_batch_node_params_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "memcpy_batch_node_params_v1_dtype", memcpy_batch_node_params_v1_dtype, MemcpyBatchNodeParamsV1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an MemcpyBatchNodeParamsV1 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 MemcpyBatchNodeParamsV1 obj = MemcpyBatchNodeParamsV1.__new__(MemcpyBatchNodeParamsV1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1)) + if obj._ptr == NULL: + raise MemoryError("Error allocating MemcpyBatchNodeParamsV1") + _cyb_memcpy((obj._ptr), ptr, sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1)) + obj._owns_ptr = True + obj._owner = None + else: + obj._ptr = ptr + obj._owns_ptr = False + obj._owner = owner + obj._readonly = readonly + return obj + + cdef _get__py_anon_pod40_dtype_offsets(): cdef cuda_bindings_driver__anon_pod40 pod return _numpy.dtype({ @@ -25031,8 +25489,8 @@ cdef class MemCpy3dOperand_v1: cdef _get_graph_node_params_dtype_offsets(): cdef CUgraphNodeParams pod return _numpy.dtype({ - 'names': ['type', 'reserved0', 'reserved1', 'kernel', 'memcpy', 'memset', 'host', 'graph', 'event_wait', 'event_record', 'ext_sem_signal', 'ext_sem_wait', 'alloc', 'free', 'mem_op', 'conditional', 'as_bytes', 'reserved2'], - 'formats': [_numpy.int32, (_numpy.int32, 3), (_numpy.int64, 29), kernel_node_params_v3_dtype, mem_cpy_node_params_dtype, mem_set_node_params_v2_dtype, host_node_params_v2_dtype, child_graph_node_params_dtype, event_wait_node_params_dtype, event_record_node_params_dtype, ext_sem_signal_node_params_v2_dtype, ext_sem_wait_node_params_v2_dtype, mem_alloc_node_params_v2_dtype, mem_free_node_params_dtype, batch_mem_op_node_params_v2_dtype, conditional_node_params_dtype, (_numpy.int8, 232), _numpy.int64], + 'names': ['type', 'reserved0', 'reserved1', 'kernel', 'memcpy', 'memset', 'host', 'graph', 'event_wait', 'event_record', 'ext_sem_signal', 'ext_sem_wait', 'alloc', 'free', 'mem_op', 'conditional', 'memcpy_batch', 'fabric_cpy_batch', 'as_bytes', 'reserved2'], + 'formats': [_numpy.int32, (_numpy.int32, 3), (_numpy.int64, 29), kernel_node_params_v3_dtype, mem_cpy_node_params_dtype, mem_set_node_params_v2_dtype, host_node_params_v2_dtype, child_graph_node_params_dtype, event_wait_node_params_dtype, event_record_node_params_dtype, ext_sem_signal_node_params_v2_dtype, ext_sem_wait_node_params_v2_dtype, mem_alloc_node_params_v2_dtype, mem_free_node_params_dtype, batch_mem_op_node_params_v2_dtype, conditional_node_params_dtype, memcpy_batch_node_params_v1_dtype, fabric_cpy_batch_node_params_v1_dtype, (_numpy.int8, 232), _numpy.int64], 'offsets': [ (&(pod.type)) - (&pod), (&(pod.reserved0)) - (&pod), @@ -25050,6 +25508,8 @@ cdef _get_graph_node_params_dtype_offsets(): (&(pod.free)) - (&pod), (&(pod.memOp)) - (&pod), (&(pod.conditional)) - (&pod), + (&(pod.memcpyBatch)) - (&pod), + (&(pod.fabricCpyBatch)) - (&pod), (&(pod.asBytes)) - (&pod), (&(pod.reserved2)) - (&pod), ], @@ -25330,6 +25790,38 @@ cdef class GraphNodeParams: cdef ConditionalNodeParams val_ = val _cyb_memcpy(&(self._ptr[0].conditional), (val_._get_ptr()), sizeof(CUDA_CONDITIONAL_NODE_PARAMS) * 1) + @property + def memcpy_batch(self): + """MemcpyBatchNodeParamsV1: """ + return MemcpyBatchNodeParamsV1.from_ptr( + &(self._ptr[0].memcpyBatch), + readonly=self._readonly, + owner=self, + ) + + @memcpy_batch.setter + def memcpy_batch(self, val): + if self._readonly: + raise ValueError("This GraphNodeParams instance is read-only") + cdef MemcpyBatchNodeParamsV1 val_ = val + _cyb_memcpy(&(self._ptr[0].memcpyBatch), (val_._get_ptr()), sizeof(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1) * 1) + + @property + def fabric_cpy_batch(self): + """FabricCpyBatchNodeParamsV1: """ + return FabricCpyBatchNodeParamsV1.from_ptr( + &(self._ptr[0].fabricCpyBatch), + readonly=self._readonly, + owner=self, + ) + + @fabric_cpy_batch.setter + def fabric_cpy_batch(self, val): + if self._readonly: + raise ValueError("This GraphNodeParams instance is read-only") + cdef FabricCpyBatchNodeParamsV1 val_ = val + _cyb_memcpy(&(self._ptr[0].fabricCpyBatch), (val_._get_ptr()), sizeof(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1) * 1) + @property def type(self): """int: """ @@ -26836,7 +27328,7 @@ cpdef str get_error_name(int error): cpdef init(unsigned int flags): - """Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process. Currently, the ``flags`` parameter must be 0. If :func:`init` has not been called, any function from the driver API will return ``CUDA_ERROR_NOT_INITIALIZED``. + """Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process. Currently, the ``flags`` parameter must be 0. If :func:`init` has not been called, any function from the driver API will return ``CUDA_ERROR_NOT_INITIALIZED``. Repeated calls to :func:`init` have no additional effect. Note: cuInit preloads various libraries needed for JIT compilation. To opt-out of this behavior, set the environment variable CUDA_FORCE_PRELOAD_LIBRARIES=0. @@ -34245,7 +34737,7 @@ cpdef intptr_t import_external_memory(mem_handle_desc) except? 0: ``CU_EXTERNAL_MEMORY_HANDLE_TYPE_DMABUF_FD``, then ``CUDA_EXTERNAL_MEMORY_HANDLE_DESC.handle.fd`` must be a valid file descriptor referencing a dma_buf object and ``CUDA_EXTERNAL_MEMORY_HANDLE_DESC.flags`` - must be zero. Importing a dma_buf object is supported only on Tegra platform + must be zero. Importing a dma_buf object is supported on Tegra platforms starting with Thor series. Mapping an imported dma_buf object as CUDA mipmapped array using ``cuExternalMemoryGetMappedMipmappedArray`` is not supported. The size of the memory object must be specified in @@ -35925,6 +36417,9 @@ cpdef intptr_t graph_add_kernel_node_v2(intptr_t h_graph, dependencies, size_t n Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. note:: Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface reference is undefined @@ -35959,6 +36454,9 @@ cpdef object graph_kernel_node_get_params_v2(intptr_t h_node): Returns: CUDA_KERNEL_NODE_PARAMS_v2: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphKernelNodeGetParams_v2` """ cdef KernelNodeParams_v2 node_params_py = KernelNodeParams_v2() @@ -35978,6 +36476,9 @@ cpdef graph_kernel_node_set_params_v2(intptr_t h_node, node_params): h_node (intptr_t): Node to set the parameters for. node_params (intptr_t): Parameters to copy. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphKernelNodeSetParams_v2` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36018,6 +36519,9 @@ cpdef intptr_t graph_add_memcpy_node(intptr_t h_graph, dependencies, size_t num_ Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddMemcpyNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36041,6 +36545,9 @@ cpdef object graph_memcpy_node_get_params(intptr_t h_node): Returns: CUDA_MEMCPY3D_v2: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphMemcpyNodeGetParams` """ cdef MemCpy3d_v2 node_params_py = MemCpy3d_v2() @@ -36060,6 +36567,9 @@ cpdef graph_memcpy_node_set_params(intptr_t h_node, node_params): h_node (intptr_t): Node to set the parameters for. node_params (intptr_t): Parameters to copy. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphMemcpyNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36092,6 +36602,9 @@ cpdef intptr_t graph_add_memset_node(intptr_t h_graph, dependencies, size_t num_ Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddMemsetNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36115,6 +36628,9 @@ cpdef object graph_memset_node_get_params(intptr_t h_node): Returns: CUDA_MEMSET_NODE_PARAMS_v1: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphMemsetNodeGetParams` """ cdef MemSetNodeParams_v1 node_params_py = MemSetNodeParams_v1() @@ -36134,6 +36650,9 @@ cpdef graph_memset_node_set_params(intptr_t h_node, node_params): h_node (intptr_t): Node to set the parameters for. node_params (intptr_t): Parameters to copy. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphMemsetNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36166,6 +36685,9 @@ cpdef intptr_t graph_add_host_node(intptr_t h_graph, dependencies, size_t num_de Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddHostNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36189,6 +36711,9 @@ cpdef object graph_host_node_get_params(intptr_t h_node): Returns: CUDA_HOST_NODE_PARAMS_v1: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphHostNodeGetParams` """ cdef HostNodeParams_v1 node_params_py = HostNodeParams_v1() @@ -36208,6 +36733,9 @@ cpdef graph_host_node_set_params(intptr_t h_node, node_params): h_node (intptr_t): Node to set the parameters for. node_params (intptr_t): Parameters to copy. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphHostNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36241,6 +36769,9 @@ cpdef intptr_t graph_add_child_graph_node(intptr_t h_graph, dependencies, size_t Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddChildGraphNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36267,6 +36798,9 @@ cpdef intptr_t graph_child_graph_node_get_graph(intptr_t h_node) except? 0: Returns: intptr_t: Location to store a handle to the graph. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphChildGraphNodeGetGraph` """ cdef CUgraph ph_graph @@ -36300,6 +36834,9 @@ cpdef intptr_t graph_add_empty_node(intptr_t h_graph, dependencies, size_t num_d Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddEmptyNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36335,6 +36872,9 @@ cpdef intptr_t graph_add_event_record_node(intptr_t h_graph, dependencies, size_ Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddEventRecordNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36357,6 +36897,9 @@ cpdef intptr_t graph_event_record_node_get_event(intptr_t h_node) except? 0: Returns: intptr_t: Pointer to return the event. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphEventRecordNodeGetEvent` """ cdef CUevent event_out @@ -36375,6 +36918,9 @@ cpdef graph_event_record_node_set_event(intptr_t h_node, intptr_t event): h_node (intptr_t): Node to set the event for. event (intptr_t): Event to use. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. note:: This function will reset the node's context to the event's device context. .. seealso:: `cuGraphEventRecordNodeSetEvent` @@ -36409,6 +36955,9 @@ cpdef intptr_t graph_add_event_wait_node(intptr_t h_graph, dependencies, size_t Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddEventWaitNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36431,6 +36980,9 @@ cpdef intptr_t graph_event_wait_node_get_event(intptr_t h_node) except? 0: Returns: intptr_t: Pointer to return the event. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphEventWaitNodeGetEvent` """ cdef CUevent event_out @@ -36449,6 +37001,9 @@ cpdef graph_event_wait_node_set_event(intptr_t h_node, intptr_t event): h_node (intptr_t): Node to set the event for. event (intptr_t): Event to use. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphEventWaitNodeSetEvent` """ with nogil: @@ -36481,6 +37036,9 @@ cpdef intptr_t graph_add_external_semaphores_signal_node(intptr_t h_graph, depen Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddExternalSemaphoresSignalNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36510,6 +37068,9 @@ cpdef object graph_external_semaphores_signal_node_get_params(intptr_t h_node): CUDA_EXT_SEM_SIGNAL_NODE_PARAMS_v1: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphExternalSemaphoresSignalNodeGetParams` """ cdef ExtSemSignalNodeParams_v1 params_out_py = ExtSemSignalNodeParams_v1() @@ -36530,6 +37091,9 @@ cpdef graph_external_semaphores_signal_node_set_params(intptr_t h_node, node_par h_node (intptr_t): Node to set the parameters for. node_params (intptr_t): Parameters to copy. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphExternalSemaphoresSignalNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36563,6 +37127,9 @@ cpdef intptr_t graph_add_external_semaphores_wait_node(intptr_t h_graph, depende Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddExternalSemaphoresWaitNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36592,6 +37159,9 @@ cpdef object graph_external_semaphores_wait_node_get_params(intptr_t h_node): CUDA_EXT_SEM_WAIT_NODE_PARAMS_v1: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphExternalSemaphoresWaitNodeGetParams` """ cdef ExtSemWaitNodeParams_v1 params_out_py = ExtSemWaitNodeParams_v1() @@ -36612,6 +37182,9 @@ cpdef graph_external_semaphores_wait_node_set_params(intptr_t h_node, node_param h_node (intptr_t): Node to set the parameters for. node_params (intptr_t): Parameters to copy. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphExternalSemaphoresWaitNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36644,6 +37217,9 @@ cpdef intptr_t graph_add_batch_mem_op_node(intptr_t h_graph, dependencies, size_ Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. note:: Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that @@ -36678,6 +37254,9 @@ cpdef object graph_batch_mem_op_node_get_params(intptr_t h_node): CUDA_BATCH_MEM_OP_NODE_PARAMS_v1: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphBatchMemOpNodeGetParams` """ cdef BatchMemOpNodeParams_v1 node_params_out_py = BatchMemOpNodeParams_v1() @@ -36699,6 +37278,9 @@ cpdef graph_batch_mem_op_node_set_params(intptr_t h_node, node_params): h_node (intptr_t): Node to set the parameters for. node_params (intptr_t): Parameters to copy. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeSetParams``. .. seealso:: `cuGraphBatchMemOpNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36733,6 +37315,9 @@ cpdef graph_exec_batch_mem_op_node_set_params(intptr_t h_graph_exec, intptr_t h_ graphExec was instantiated. node_params (intptr_t): Updated Parameters to set. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecBatchMemOpNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -36795,6 +37380,9 @@ cpdef intptr_t graph_add_mem_alloc_node(intptr_t h_graph, dependencies, size_t n Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddMemAllocNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36821,6 +37409,9 @@ cpdef object graph_mem_alloc_node_get_params(intptr_t h_node): Returns: CUDA_MEM_ALLOC_NODE_PARAMS_v1: Pointer to return the parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphMemAllocNodeGetParams` """ cdef MemAllocNodeParams_v1 params_out_py = MemAllocNodeParams_v1() @@ -36868,6 +37459,9 @@ cpdef intptr_t graph_add_mem_free_node(intptr_t h_graph, dependencies, size_t nu Returns: intptr_t: Returns newly created node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphAddNode``. .. seealso:: `cuGraphAddMemFreeNode` """ cdef _cyb_nullable_unique_ptr[ _cyb_vector[void*] ] _dependencies_ @@ -36890,6 +37484,9 @@ cpdef uint64_t graph_mem_free_node_get_params(intptr_t h_node) except? 0: Returns: uint64_t: Pointer to return the device address. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraph_nodeGetParams``. .. seealso:: `cuGraphMemFreeNodeGetParams` """ cdef CUdeviceptr dptr_out @@ -37516,6 +38113,9 @@ cpdef graph_exec_kernel_node_set_params_v2(intptr_t h_graph_exec, intptr_t h_nod was instantiated. node_params (intptr_t): Updated Parameters to set. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecKernelNodeSetParams_v2` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -37549,6 +38149,9 @@ cpdef graph_exec_memcpy_node_set_params(intptr_t h_graph_exec, intptr_t h_node, copy_params (intptr_t): The updated parameters to set. ctx (intptr_t): Context on which to run the node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecMemcpyNodeSetParams` """ cdef intptr_t _copy_params_ptr_ = 0 if copy_params is None else int(copy_params) @@ -37586,6 +38189,9 @@ cpdef graph_exec_memset_node_set_params(intptr_t h_graph_exec, intptr_t h_node, memset_params (intptr_t): The updated parameters to set. ctx (intptr_t): Context on which to run the node. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecMemsetNodeSetParams` """ cdef intptr_t _memset_params_ptr_ = 0 if memset_params is None else int(memset_params) @@ -37612,6 +38218,9 @@ cpdef graph_exec_host_node_set_params(intptr_t h_graph_exec, intptr_t h_node, no instantiate graphExec. node_params (intptr_t): The updated parameters to set. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecHostNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -37645,6 +38254,9 @@ cpdef graph_exec_child_graph_node_set_params(intptr_t h_graph_exec, intptr_t h_n child_graph (intptr_t): The graph supplying the updated parameters. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecChildGraphNodeSetParams` """ with nogil: @@ -37669,6 +38281,9 @@ cpdef graph_exec_event_record_node_set_event(intptr_t h_graph_exec, intptr_t h_n graphExec was instantiated. event (intptr_t): Updated event to use. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecEventRecordNodeSetEvent` """ with nogil: @@ -37693,6 +38308,9 @@ cpdef graph_exec_event_wait_node_set_event(intptr_t h_graph_exec, intptr_t h_nod graphExec was instantiated. event (intptr_t): Updated event to use. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecEventWaitNodeSetEvent` """ with nogil: @@ -37719,6 +38337,9 @@ cpdef graph_exec_external_semaphores_signal_node_set_params(intptr_t h_graph_exe graphExec was instantiated. node_params (intptr_t): Updated Parameters to set. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecExternalSemaphoresSignalNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -37746,6 +38367,9 @@ cpdef graph_exec_external_semaphores_wait_node_set_params(intptr_t h_graph_exec, graphExec was instantiated. node_params (intptr_t): Updated Parameters to set. + .. note:: + This function will be deprecated in a future CUDA release. Please migrate to + ``cuGraphExecNodeSetParams``. .. seealso:: `cuGraphExecExternalSemaphoresWaitNodeSetParams` """ cdef intptr_t _node_params_ptr_ = 0 if node_params is None else int(node_params) @@ -37779,8 +38403,6 @@ cpdef graph_node_set_enabled(intptr_t h_graph_exec, intptr_t h_node, unsigned in is_enabled (unsigned int): Node is enabled if != 0, otherwise the node is disabled. - .. note:: - Currently only kernel, memset and memcpy nodes are supported. .. seealso:: `cuGraphNodeSetEnabled` """ with nogil: @@ -37805,8 +38427,6 @@ cpdef unsigned int graph_node_get_enabled(intptr_t h_graph_exec, intptr_t h_node Returns: unsigned int: Location to return the enabled status of the node. - .. note:: - Currently only kernel, memset and memcpy nodes are supported. .. note:: This function will not reflect device-side updates for device-updatable kernel nodes. @@ -39618,7 +40238,8 @@ cpdef object tensor_map_encode_tiled(int tensor_data_type, uint32_t tensor_rank, parameters describing a tiled region and returns it in ``tensor_map``. Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, - should only be accessed through CUDA APIs and PTX. + should only be accessed through CUDA APIs and PTX. Encoding resolves the + descriptor allocation class using ``CU_TENSOR_MAP_ALLOC_CLASS_AUTO``. The parameters passed are bound to the following requirements:. - ``tensor_map`` address must be aligned to 64 bytes. @@ -39786,7 +40407,8 @@ cpdef object tensor_map_encode_im2col(int tensor_data_type, uint32_t tensor_rank parameters describing a im2col memory layout and returns it in ``tensor_map``. Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, - should only be accessed through CUDA APIs and PTX. + should only be accessed through CUDA APIs and PTX. Encoding resolves the + descriptor allocation class using ``CU_TENSOR_MAP_ALLOC_CLASS_AUTO``. The parameters passed are bound to the following requirements:. - ``tensor_map`` address must be aligned to 64 bytes. @@ -39970,7 +40592,8 @@ cpdef object tensor_map_encode_im2col_wide(int tensor_data_type, uint32_t tensor layout in memory is either NDHWC, NHWC, or NWC. This API is only supported on devices of compute capability 10.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only - be accessed through CUDA APIs and PTX. + be accessed through CUDA APIs and PTX. Encoding resolves the descriptor + allocation class using ``CU_TENSOR_MAP_ALLOC_CLASS_AUTO``. The parameters passed are bound to the following requirements:. - ``tensor_map`` address must be aligned to 64 bytes. @@ -40591,10 +41214,7 @@ cpdef intptr_t green_ctx_create(intptr_t desc, int dev, unsigned int flags) exce The API does not set the green context current. In order to set it current, you need to explicitly set it current by first converting the green context to a ``CUcontext`` using ``cuCtxFromGreenCtx`` and subsequently calling - ``cuCtxSetCurrent`` / ``cuCtxPushCurrent``. It should be noted that a green - context can be current to only one thread at a time. There is no internal - synchronization to make API calls accessing the same green context from - multiple threads work. + ``cuCtxSetCurrent`` / ``cuCtxPushCurrent``. Note: The API is not supported on 32-bit platforms. The supported flags are:. @@ -42695,12 +43315,22 @@ cpdef tuple dev_sm_resource_split(unsigned int nb_groups, input, unsigned int fl 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. + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. When used with + ``CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS``, backfill + follows the same behavior after first consuming all SMs from the target + locality domain. - ``CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID:`` Specifies that the SM partition should be localized to the specified ``localityDomainId``. + - ``CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS:`` Modifier + to ``CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`` which allows selection + of SMs in the locality domain exceeding the ``CUdevice_attribute``::CU_DE + VICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT. - ``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. + ``CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`` is set in flags. The + special value ``CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID_ANY`` specifies + that the partitioned SMs must be selected from the union of all available + locality domains in the input SM resource. Example params and their effect:. A group_params array element is defined in the following order:. @@ -42851,15 +43481,17 @@ cpdef stream_begin_capture_to_cig(intptr_t h_stream, stream_cig_capture_params): Support for CIG streams with D3D12 can be determined using :func:`device_get_attribute` with - ``CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED``. + ``CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED``. Likewise support for CIG + streams with Vulkan can be determined using :func:`device_get_attribute` with + ``CU_DEVICE_ATTRIBUTE_VULKAN_CIG_STREAMS_SUPPORTED``. Begin CIG (CUDA in Graphics) capture on ``h_stream`` for the graphics API as provided in ``stream_cig_capture_params``. When a stream is in CIG capture mode, all operations pushed into the stream will not be executed, but will - instead be captured into a graphics API command list/command buffer. All kernel + instead be captured into a graphics API command list/buffer. All kernel launches and memory copy/memory set operations on the CIG stream will be - recorded. When the command list is executed by the graphics API, all the + recorded. When the command list/buffer is executed by the graphics API, all the stream's operations will execute in order along with other graphics API - commands in the command list. + commands in the command list/buffer. CIG stream capture may not be initiated if ``stream`` is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it was initiated, and it may only be initiated if the stream is not already in CIG capture mode. @@ -42867,23 +43499,25 @@ cpdef stream_begin_capture_to_cig(intptr_t h_stream, stream_cig_capture_params): operation will fail and ``CUDA_ERROR_INVALID_CONTEXT`` will be returned. Data from the graphics client can be shared with CUDA via the ``streamSharedData`` in ``stream_cig_capture_params``. The format of - ``streamSharedData`` is dependent on the type of the graphics client. For - D3D12, ``streamSharedData`` is an ID3D12CommandList object pointer. The command - list must be in ready state for recording commands whenever kernels are - launched on the stream. The command list provided must belong to the graphics - API device that the CIG context was created with, otherwise the behavior will - be undefined. - The stream object may not be destroyed until its associated command list has - finished executing on the GPU. The command list/command buffer used for capture - may not be submitted for execution before a call to ``cuStreamEndCaptureToCig`` - is made on the associated stream. + ``sharedData`` is dependent on the type of the graphics client. For D3D12, + ``sharedData`` is an ID3D12CommandList object pointer. For Vulkan, + ``sharedData`` is an internal NVIDIA handle obtained via + vkGetCommandBufferInternalHandleNV from the VK_NV_internal_handle extension. A + VkCommandBuffer cannot be passed directly. The command buffer must be in the + recording state whenever kernels are launched on the stream. The command + list/buffer provided must belong to a device corresponding to the CIG context's + device, otherwise the behavior will be undefined. + The stream object may not be destroyed until its associated command list/buffer + has finished executing on the GPU. The command buffer used for capture may not + be submitted for execution before a call to ``cuStreamEndCaptureToCig`` is made + on the associated stream. Graphics resources to be accessed by work recorded on the CIG stream must use - UAV barriers on the command list prior to recording work that accesses them on - the stream. - Resubmission of the same recorded command list is not allowed. Further more, - care must be taken for the order of execution of the recorded CUDA work with - regards to other CUDA work submitted under the same CIG context. Out-of-order - execution can lead to device hangs or exceptions. + UAV/pipeline barriers on the command list/buffer prior to recording work that + accesses them on the stream. + Resubmission of the same recorded command list/buffer is not allowed. Further + more, care must be taken for the order of execution of the recorded CUDA work + with regards to other CUDA work submitted under the same CIG context. Out-of- + order execution can lead to device hangs or exceptions. CIG capture mode operates similarly to ``cuStreamBeginCapture`` with the ``CU_STREAM_CAPTURE_MODE_RELAXED`` option. There are additional limitations to streams in CIG capture mode. The following functions are not allowed for CIG @@ -43099,7 +43733,9 @@ cpdef coredump_deregister_start_callback(intptr_t callback): .. note:: It is the caller's responsibility to deregister callbacks before they go out of - scope. + scope. The handle must identify a currently registered start callback; handles + returned by other registration APIs and handles that were already deregistered + are invalid. .. seealso:: `cuCoredumpDeregisterStartCallback` """ with nogil: @@ -43119,7 +43755,9 @@ cpdef coredump_deregister_complete_callback(intptr_t callback): .. note:: It is the caller's responsibility to deregister callbacks before they go out of - scope. + scope. The handle must identify a currently registered complete callback; + handles returned by other registration APIs and handles that were already + deregistered are invalid. .. seealso:: `cuCoredumpDeregisterCompleteCallback` """ with nogil: @@ -43773,6 +44411,105 @@ cpdef checkpoint_operation_complete(intptr_t handle): __status__ = cuCheckpointOperationComplete(handle) check_status(__status__) + +cpdef fabric_cpy_batch_async(size_t num_ops, intptr_t op_list, unsigned long long flags, intptr_t h_stream): + """Performs a batch of copies over a fabric asynchronously. + + The batch as a whole executes in stream order but copies within a batch are not + guaranteed to execute in any specific order. Specifying dependent copies within + a single batch results in undefined behavior. + Performs copies as specified in the ``op_list`` array. The length of this array + is specified in ``num_ops``. Each entry describes a copy operation including + source and destination operands (``CUDA_FABRIC_COPY_BATCH_OP.src`` and + ``CUDA_FABRIC_COPY_BATCH_OP.dst``) and the size in bytes + (``CUDA_FABRIC_COPY_BATCH_OP.size``). A size of zero makes that operation a no- + op while preserving its position in the batch. Its operands are still + validated. + The following operand type combinations are supported:. + + - ``CU_FABRIC_COPY_OPERAND_TYPE_POINTER`` to + ``CU_FABRIC_COPY_OPERAND_TYPE_POINTER``: Copy between two device-accessible + pointers. At least one operand must be local to the stream's device. + - ``CU_FABRIC_COPY_OPERAND_TYPE_POINTER`` to + ``CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT``: -- copy from a local + pointer to a remote UNICAST or MULTICAST logical endpoint at the specified + offset. + - ``CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT`` to + ``CU_FABRIC_COPY_OPERAND_TYPE_POINTER``: -- copy from a remote UNICAST + logical endpoint at the specified offset to a local pointer. + + A single batch may contain a heterogeneous mix of operation types. + For a POINTER operand, ``CUfabricCpyOperand.op.ptr.ptr`` must contain the + pointer where the copy begins. For managed memory or pageable memory on + supported devices, ``CUfabricCpyOperand.op.ptr.locHint`` may hint the location + of the operand. + For a LOGICAL_ENDPOINT operand, ``CUfabricCpyOperand.op.le.id`` specifies the + logical endpoint and ``CUfabricCpyOperand.op.le.offset`` specifies the byte + offset into that endpoint. + \notes. + + Args: + num_ops (size_t): Total number of copy operations. + op_list (intptr_t): Array of size ``num_ops`` containing the copy + operations. + flags (unsigned long long): Flags for future use, must be zero. + h_stream (intptr_t): Stream to enqueue the operations in. Must not + be the legacy NULL stream. + + .. seealso:: `cuFabricCpyBatchAsync` + """ + with nogil: + __status__ = cuFabricCpyBatchAsync(num_ops, op_list, flags, h_stream) + check_status(__status__) + + +cpdef tensor_map_set_allocation_class(tensor_map, int alloc_class, intptr_t out_alloc_class): + """Sets the allocation class of an already-encoded tensor map. + + Requests a Tensor Memory Accelerator (TMA) allocation class for an existing + ``tensor_map`` that was previously initialized by a tensor-map encoding API. No + re-encoding of the tensor is performed. + ``alloc_class`` selects the class:. + + - ``CU_TENSOR_MAP_ALLOC_CLASS_SMALL`` requests the safe 4 KiB window. + - ``CU_TENSOR_MAP_ALLOC_CLASS_LARGE`` requests the 128 KiB window. When LARGE + is the effective class, the caller guarantees that, before the tensor map is + used, its effective base allocation is backed by a contiguous, accessible + region of at least ``CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE`` + bytes. Violating this is undefined behavior at kernel execution time, not an + error of this API. + - ``CU_TENSOR_MAP_ALLOC_CLASS_AUTO`` re-evaluates the encoded tensor geometry + using the driver's conservative contiguity policy. The global address is not + inspected. + + On architectures where allocation-class selection affects TMA OOB address + generation, this function adjusts only the encoded selector through an in-place + read-modify-write of ``tensor_map``. The caller must externally synchronize + this call with all other host and device access to the same descriptor storage, + including device-side tensormap.replace operations. + If ``out_alloc_class`` is non-NULL it receives the class actually in effect + after the call, which is always ``CU_TENSOR_MAP_ALLOC_CLASS_SMALL`` or + ``CU_TENSOR_MAP_ALLOC_CLASS_LARGE`` (never ``CU_TENSOR_MAP_ALLOC_CLASS_AUTO``). + If ``out_alloc_class`` is non-NULL, it is initialized to + ``CU_TENSOR_MAP_ALLOC_CLASS_SMALL`` before validation. On failure, + ``tensor_map`` is not modified and ``out_alloc_class`` remains SMALL. + On architectures where allocation-class selection has no effect, all three + requests succeed without changing ``tensor_map`` and report + ``CU_TENSOR_MAP_ALLOC_CLASS_SMALL``. + + Args: + tensor_map (intptr_t): Tensor map to modify in place. + alloc_class (TensorMapAllocClass): Requested allocation class. + out_alloc_class (intptr_t): Optional; receives the resulting + allocation class. + + .. seealso:: `cuTensorMapSetAllocationClass` + """ + cdef intptr_t _tensor_map_ptr_ = 0 if tensor_map is None else int(tensor_map) + with nogil: + __status__ = cuTensorMapSetAllocationClass(_tensor_map_ptr_, alloc_class, out_alloc_class) + check_status(__status__) + # Aliases graph_instantiate = graph_instantiate_with_flags # `cuGraphGetEdges` & co. are the `_v2` functions on CUDA 13.0 and later. diff --git a/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pxd b/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pxd index 98c657180e1..7b75b6029fc 100644 --- a/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pxd +++ b/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=94a2cbbfd690b8a9ff436e4e424f67a8ab35631b4ed8790516952e3afbc94de3 +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cceabf1ede278dc81aa66ea67cbde2e0ae50a3dc611f33226e57e34de7eb62c7 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx b/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx index 5926513718d..6ce14cffbaa 100644 --- a/cuda_bindings_13/cuda/bindings/_v2/nvrtc.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=19c58d80d518d7503530eddd3838b601f741b4e53ee1d46aa8ab4f8d62731795 +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=271443bbbf125f5d8263c4c6a06835895a59a8facce68b6c8b5f3d8a7a8a0c93 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cudla.pxd b/cuda_bindings_13/cuda/bindings/cudla.pxd index 9b30ff4beaa..9007433b576 100644 --- a/cuda_bindings_13/cuda/bindings/cudla.pxd +++ b/cuda_bindings_13/cuda/bindings/cudla.pxd @@ -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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6eb337830ce6124c51007631ed0be6c3232fcd43f6d1e53f28b060ec0adf97f8 +# This code was automatically generated across versions from 1.5.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fa2269e11c6d585a7992b1e0e6c13a1090dd44bd00ac9eec727ef7db8c246f2d # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cudla.pyx b/cuda_bindings_13/cuda/bindings/cudla.pyx index f1c31030b9a..b75bf3301b5 100644 --- a/cuda_bindings_13/cuda/bindings/cudla.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=92945a025bf01ceb29f21539fb32be8db41c402bec2606a8d92b79e869a0c0ed +# This code was automatically generated across versions from 1.5.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e53df2232a111db40a0792914290c825f236ce2eac0182adad2dc7c7c0b4d588 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cufile.pxd b/cuda_bindings_13/cuda/bindings/cufile.pxd index ac4a24851f5..352017973fc 100644 --- a/cuda_bindings_13/cuda/bindings/cufile.pxd +++ b/cuda_bindings_13/cuda/bindings/cufile.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5b9d3a05eab53628d366c602ae3125fede0d25b2cc48137e2b1f7dcb29068650 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bf9e30c46fe014e5245c62c6c9a118ad9b083a390d5483325a586a74bc633db3 diff --git a/cuda_bindings_13/cuda/bindings/cufile.pyx b/cuda_bindings_13/cuda/bindings/cufile.pyx index d88ac812ef4..bb451f1598e 100644 --- a/cuda_bindings_13/cuda/bindings/cufile.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=51aa8097269246ec75ca06d0fd4f4ba97a110908146a66dfed09997c052406f3 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=1100d14bd3dea3d6880407efaa32281cffedbfd0237994e8a01fb792e5ab1e37 # <<<< PREAMBLE CONTENT >>>> @@ -3324,6 +3325,7 @@ class DriverStatusFlags(_cyb_FastEnum): NVME_P2P_SUPPORTED = (CU_FILE_NVME_P2P_SUPPORTED, 'Do not use this macro. This is deprecated now') SCATEFS_SUPPORTED = (CU_FILE_SCATEFS_SUPPORTED, 'Support for ScateFS') VIRTIOFS_SUPPORTED = (CU_FILE_VIRTIOFS_SUPPORTED, 'Support for VirtioFS') + PANFS_SUPPORTED = (CU_FILE_PANFS_SUPPORTED, 'Support for PanFS') MAX_TARGET_TYPES = (CU_FILE_MAX_TARGET_TYPES, 'Maximum FS supported') class DriverControlFlags(_cyb_FastEnum): diff --git a/cuda_bindings_13/cuda/bindings/cycudla.pxd b/cuda_bindings_13/cuda/bindings/cycudla.pxd index bd47c37e1c6..19017877b82 100644 --- a/cuda_bindings_13/cuda/bindings/cycudla.pxd +++ b/cuda_bindings_13/cuda/bindings/cycudla.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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 1.5.0 to 13.5.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=f769acaca3dada01ba364b7053e43bcc2439f912fee376ebf3f2139fd8786203 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7c7e9cac175d1a98e00293e41bd89d58af2a958127213b19140e2f5654a90c70 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cycudla.pyx b/cuda_bindings_13/cuda/bindings/cycudla.pyx index 7249bd7135c..ddc270a9014 100644 --- a/cuda_bindings_13/cuda/bindings/cycudla.pyx +++ b/cuda_bindings_13/cuda/bindings/cycudla.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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ef5d2f05cc1ae1fe20b8f9133f0e88a82406c97909ee9327fe4ed0645dae6ecb +# This code was automatically generated across versions from 1.5.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=e063bd6c9c9ee59b0385be896d11dc2569ec5770073ff2e5db4b976140418363 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cycufile.pxd b/cuda_bindings_13/cuda/bindings/cycufile.pxd index 0daa8e4ebd6..a32af9c2292 100644 --- a/cuda_bindings_13/cuda/bindings/cycufile.pxd +++ b/cuda_bindings_13/cuda/bindings/cycufile.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0f9f241649c57abeccbf6b668c54cbeaa1c2fa990ff783bfc114b617a7773aba +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4debd6e4ce762ec2cea6afca48974930c3d6972b4403bd1212825c7f839c8839 # <<<< PREAMBLE CONTENT >>>> @@ -114,6 +115,7 @@ cdef extern from 'cufile.h': CU_FILE_NVME_P2P_SUPPORTED CU_FILE_SCATEFS_SUPPORTED CU_FILE_VIRTIOFS_SUPPORTED + CU_FILE_PANFS_SUPPORTED CU_FILE_MAX_TARGET_TYPES cdef extern from 'cufile.h': diff --git a/cuda_bindings_13/cuda/bindings/cycufile.pyx b/cuda_bindings_13/cuda/bindings/cycufile.pyx index 71e499b791d..03e2719f91e 100644 --- a/cuda_bindings_13/cuda/bindings/cycufile.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=331732354093d8b2560607ca720e2d2a8a4531704b11582ac7c5811f14261273 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a66c7ba2d664b9ad62703f2e247408e21d801b24e0991eb2727d91e520101594 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cydriver.pxd b/cuda_bindings_13/cuda/bindings/cydriver.pxd index e399609ff07..b49448b1438 100644 --- a/cuda_bindings_13/cuda/bindings/cydriver.pxd +++ b/cuda_bindings_13/cuda/bindings/cydriver.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=76bc92829a6025611352b8808094ca11e65a8544a0ac60687fbd65d282d7aa77 +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7d5baf6dd221974fdd0a3787e7b4adde506306c735972c8c0369977e67dca6b0 # <<<< PREAMBLE CONTENT >>>> @@ -419,6 +420,8 @@ cdef extern from 'cuda.h': 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_VULKAN_CIG_STREAMS_SUPPORTED + CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED CU_DEVICE_ATTRIBUTE_MAX ctypedef CUdevice_attribute_enum CUdevice_attribute @@ -720,7 +723,10 @@ cdef extern from 'cuda.h': CU_GRAPH_NODE_TYPE_MEM_FREE CU_GRAPH_NODE_TYPE_BATCH_MEM_OP CU_GRAPH_NODE_TYPE_CONDITIONAL + CU_GRAPH_NODE_TYPE_MEMCPY_BATCH CU_GRAPH_NODE_TYPE_RESERVED_16 + CU_GRAPH_NODE_TYPE_EXTERNAL_ENGINE + CU_GRAPH_NODE_TYPE_FABRIC_CPY_BATCH ctypedef CUgraphNodeType_enum CUgraphNodeType cdef extern from 'cuda.h': @@ -1277,6 +1283,8 @@ cdef extern from 'cuda.h': CU_GRAPH_DEBUG_DOT_FLAGS_BATCH_MEM_OP_NODE_PARAMS CU_GRAPH_DEBUG_DOT_FLAGS_EXTRA_TOPO_INFO CU_GRAPH_DEBUG_DOT_FLAGS_CONDITIONAL_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_BATCH_NODE_PARAMS + CU_GRAPH_DEBUG_DOT_FLAGS_FABRIC_CPY_BATCH_NODE_PARAMS ctypedef CUgraphDebugDot_flags_enum CUgraphDebugDot_flags cdef extern from 'cuda.h': @@ -1357,6 +1365,7 @@ cdef extern from 'cuda.h': CU_COREDUMP_SKIP_CONSTBANK_MEMORY CU_COREDUMP_GZIP_COMPRESS CU_COREDUMP_FAULTED_CONTEXTS_ONLY + CU_COREDUMP_SKIP_TENSOR_MEMORY CU_COREDUMP_NO_ERRBAR_AT_EXIT CU_COREDUMP_LOG_ONLY CU_COREDUMP_LIGHTWEIGHT_FLAGS @@ -1568,6 +1577,7 @@ cdef extern from 'cuda.h': CU_DEV_SM_RESOURCE_GROUP_DEFAULT CU_DEV_SM_RESOURCE_GROUP_BACKFILL CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS cdef extern from 'cuda.h': ctypedef enum CUdevSmResourceSplitByCount_flags "CUdevSmResourceSplitByCount_flags": @@ -1604,6 +1614,7 @@ cdef extern from 'cuda.h': cdef extern from 'cuda.h': ctypedef enum CUstreamCigDataType_enum: STREAM_CIG_DATA_TYPE_D3D12_COMMAND_LIST + STREAM_CIG_DATA_TYPE_VULKAN_COMMAND_BUFFER_HANDLE_NV ctypedef CUstreamCigDataType_enum CUstreamCigDataType cdef extern from 'cuda.h': @@ -1639,8 +1650,22 @@ cdef extern from 'cuda.h': CU_CLIQUE_TYPE_UNICAST_LOGICAL_ENDPOINT CU_CLIQUE_TYPE_MULTICAST_LOGICAL_ENDPOINT ctypedef CUcliqueType_enum CUcliqueType + +cdef extern from 'cuda.h': + ctypedef enum CUtensorMapAllocClass_enum: + CU_TENSOR_MAP_ALLOC_CLASS_AUTO + CU_TENSOR_MAP_ALLOC_CLASS_SMALL + CU_TENSOR_MAP_ALLOC_CLASS_LARGE + ctypedef CUtensorMapAllocClass_enum CUtensorMapAllocClass + +cdef extern from 'cuda.h': + ctypedef enum CUfabricCpyOperandType_enum: + CU_FABRIC_COPY_OPERAND_TYPE_POINTER + CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT + CU_FABRIC_COPY_OPERAND_TYPE_MAX + ctypedef CUfabricCpyOperandType_enum CUfabricCpyOperandType cdef enum: _CURESULT_INTERNAL_LOADING_ERROR = CUresult.CUDA_ERROR_NOT_FOUND -cdef enum: CUDA_VERSION = 13040 +cdef enum: CUDA_VERSION = 13050 # TYPES @@ -1820,6 +1845,8 @@ cdef extern from 'cuda.h': ctypedef unsigned int CUlogIterator 'CUlogIterator' +ctypedef CUDA_FABRIC_COPY_BATCH_OP_st CUDA_FABRIC_COPY_BATCH_OP_v1 + cdef extern from 'cuda.h': ctypedef struct CUctx_st: pass @@ -2307,6 +2334,10 @@ cdef extern from 'cuda.h': ctypedef CUextent3D_v1 CUextent3D 'CUextent3D' +cdef extern from 'cuda.h': + ctypedef CUDA_FABRIC_COPY_BATCH_OP_v1 CUDA_FABRIC_COPY_BATCH_OP 'CUDA_FABRIC_COPY_BATCH_OP' + + cdef extern from 'cuda.h': cdef struct CUDA_KERNEL_NODE_PARAMS_st: CUfunction func @@ -2491,6 +2522,11 @@ cdef extern from 'cuda.h': CUstreamCigParam* streamCigParams ctypedef CUstreamCigCaptureParams_st CUstreamCigCaptureParams +cdef extern from 'cuda.h': + ctypedef struct cuda_bindings_driver__anon_pod53 "std::remove_all_extentsop.le)>::type": + CUlogicalEndpointId id + cuuint64_t offset + cdef extern from 'cuda.h': ctypedef struct CUDA_CONDITIONAL_NODE_PARAMS 'CUDA_CONDITIONAL_NODE_PARAMS': CUgraphConditionalHandle handle @@ -2744,6 +2780,15 @@ cdef extern from 'cuda.h': CUgreenCtx gCtx ctypedef CUDA_EVENT_RECORD_NODE_PARAMS_st CUDA_EVENT_RECORD_NODE_PARAMS +cdef extern from 'cuda.h': + cdef struct CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st: + size_t numOps + CUDA_FABRIC_COPY_BATCH_OP* opList + unsigned long long flags + CUcontext ctx + CUgreenCtx gCtx + ctypedef CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 + cdef extern from 'cuda.h': cdef struct CUasyncNotificationInfo_st: CUasyncNotificationType type @@ -2877,6 +2922,10 @@ cdef extern from 'cuda.h': CUlaunchAttributeValue value ctypedef CUlaunchAttribute_st CUlaunchAttribute +cdef extern from 'cuda.h': + ctypedef CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 CUDA_FABRIC_CPY_BATCH_NODE_PARAMS 'CUDA_FABRIC_CPY_BATCH_NODE_PARAMS' + + cdef extern from 'cuda.h': ctypedef void (*CUasyncCallback 'CUasyncCallback')( CUasyncNotificationInfo* info, @@ -3064,6 +3113,11 @@ cdef extern from 'cuda.h': size_t layerHeight CUmemLocation locHint +cdef extern from 'cuda.h': + ctypedef struct cuda_bindings_driver__anon_pod52 "std::remove_all_extentsop.ptr)>::type": + CUdeviceptr ptr + CUmemLocation locHint + cdef extern from 'cuda.h': cdef struct CUDA_BATCH_MEM_OP_NODE_PARAMS_v1_st: CUcontext ctx @@ -3124,6 +3178,11 @@ cdef extern from 'cuda.h': cuda_bindings_driver__anon_pod41 ptr cuda_bindings_driver__anon_pod42 array +cdef extern from 'cuda.h': + ctypedef union cuda_bindings_driver__anon_pod51 "std::remove_all_extentsop)>::type": + cuda_bindings_driver__anon_pod52 ptr + cuda_bindings_driver__anon_pod53 le + 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' @@ -3146,20 +3205,50 @@ cdef extern from 'cuda.h': CUdeviceptr dptr ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v2_st CUDA_MEM_ALLOC_NODE_PARAMS_v2 +cdef extern from 'cuda.h': + cdef struct CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st: + size_t count + CUdeviceptr* dsts + CUdeviceptr* srcs + size_t* sizes + CUmemcpyAttributes* attrs + size_t* attrsIdxs + size_t numAttrs + CUcontext ctx + CUgreenCtx gCtx + ctypedef CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 + cdef extern from 'cuda.h': cdef struct CUmemcpy3DOperand_st: CUmemcpy3DOperandType type cuda_bindings_driver__anon_pod40 op ctypedef CUmemcpy3DOperand_st CUmemcpy3DOperand_v1 +cdef extern from 'cuda.h': + cdef struct CUfabricCpyOperand_st: + CUfabricCpyOperandType type + cuda_bindings_driver__anon_pod51 op + ctypedef CUfabricCpyOperand_st CUfabricCpyOperand + cdef extern from 'cuda.h': ctypedef CUDA_MEM_ALLOC_NODE_PARAMS_v1 CUDA_MEM_ALLOC_NODE_PARAMS 'CUDA_MEM_ALLOC_NODE_PARAMS' +cdef extern from 'cuda.h': + ctypedef CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 CUDA_MEMCPY_BATCH_NODE_PARAMS 'CUDA_MEMCPY_BATCH_NODE_PARAMS' + + cdef extern from 'cuda.h': ctypedef CUmemcpy3DOperand_v1 CUmemcpy3DOperand 'CUmemcpy3DOperand' +cdef extern from 'cuda.h': + ctypedef struct CUDA_FABRIC_COPY_BATCH_OP_st 'CUDA_FABRIC_COPY_BATCH_OP_st': + CUfabricCpyOperand src + CUfabricCpyOperand dst + size_t size + unsigned int flags + cdef extern from 'cuda.h': cdef struct CUgraphNodeParams_st: CUgraphNodeType type @@ -3178,6 +3267,8 @@ cdef extern from 'cuda.h': CUDA_MEM_FREE_NODE_PARAMS free CUDA_BATCH_MEM_OP_NODE_PARAMS_v2 memOp CUDA_CONDITIONAL_NODE_PARAMS conditional + CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 memcpyBatch + CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 fabricCpyBatch char asBytes[232] long long reserved2 ctypedef CUgraphNodeParams_st CUgraphNodeParams @@ -3767,6 +3858,8 @@ cdef CUresult cuMemGetLocationInfo(CUdeviceptr ptr, size_t size, size_t summaryG 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 +cdef CUresult cuFabricCpyBatchAsync(size_t numOps, CUDA_FABRIC_COPY_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil +cdef CUresult cuTensorMapSetAllocationClass(CUtensorMap* tensorMap, CUtensorMapAllocClass allocClass, CUtensorMapAllocClass* outAllocClass) except ?CUDA_ERROR_NOT_FOUND nogil # TODO: Extract these defines somehow? @@ -3918,3 +4011,5 @@ cdef enum: CUDA_EGL_INFINITE_TIMEOUT = 4294967295 cdef enum: RESOURCE_ABI_VERSION = 1 cdef enum: RESOURCE_ABI_EXTERNAL_BYTES = 42 + +cdef enum: CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID_ANY = 4294967295 diff --git a/cuda_bindings_13/cuda/bindings/cydriver.pyx b/cuda_bindings_13/cuda/bindings/cydriver.pyx index 82676152c39..78815f76e7e 100644 --- a/cuda_bindings_13/cuda/bindings/cydriver.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=99b0dd6a5b631fb108b5d2422c62f8fd4660630dda543978357a03d96c5dc201 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2ff8c021f0bf8f1bba3120c7b1fdc5e4c304ed157093114f6e6a16264bf64d5a from ._internal cimport driver as _driver cdef CUresult cuGetErrorString(CUresult error, const char** pStr) except ?CUDA_ERROR_NOT_FOUND nogil: @@ -2101,3 +2102,11 @@ cdef CUresult cuGraphNodeSetParams_v2(CUgraphNode hNode, CUgraphNodeParams* node cdef CUresult cuCheckpointOperationComplete(CUcheckpointOperationHandle handle) except ?CUDA_ERROR_NOT_FOUND nogil: return _driver._cuCheckpointOperationComplete(handle) + + +cdef CUresult cuFabricCpyBatchAsync(size_t numOps, CUDA_FABRIC_COPY_BATCH_OP* opList, unsigned long long flags, CUstream hStream) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuFabricCpyBatchAsync(numOps, opList, flags, hStream) + + +cdef CUresult cuTensorMapSetAllocationClass(CUtensorMap* tensorMap, CUtensorMapAllocClass allocClass, CUtensorMapAllocClass* outAllocClass) except ?CUDA_ERROR_NOT_FOUND nogil: + return _driver._cuTensorMapSetAllocationClass(tensorMap, allocClass, outAllocClass) diff --git a/cuda_bindings_13/cuda/bindings/cynvfatbin.pxd b/cuda_bindings_13/cuda/bindings/cynvfatbin.pxd index b61707a47c8..921ffd6d54c 100644 --- a/cuda_bindings_13/cuda/bindings/cynvfatbin.pxd +++ b/cuda_bindings_13/cuda/bindings/cynvfatbin.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.5.0. Do not modify it directly. @@ -11,7 +11,8 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4eaac7021af14308210cbd9dd8bf938f0b09d395ef079368750627da493fa06e +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9fa8296c2008ced4250a959c1637d310eef0ec783bcac07be100a2729b489e86 ctypedef enum nvFatbinResult "nvFatbinResult": NVFATBIN_SUCCESS "NVFATBIN_SUCCESS" = 0 NVFATBIN_ERROR_INTERNAL "NVFATBIN_ERROR_INTERNAL" diff --git a/cuda_bindings_13/cuda/bindings/cynvfatbin.pyx b/cuda_bindings_13/cuda/bindings/cynvfatbin.pyx index a943e7bbf01..68f42ddb24b 100644 --- a/cuda_bindings_13/cuda/bindings/cynvfatbin.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.4.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ac4e507008fec5a9a6963e6539b4a783ca1908452fc4bdb300119af7a1312ff0 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cae9def669a30d980e2d283e79e54b2b8dd66ea83b619fca337bfcfe68cb993f from ._internal cimport nvfatbin as _nvfatbin diff --git a/cuda_bindings_13/cuda/bindings/cynvjitlink.pxd b/cuda_bindings_13/cuda/bindings/cynvjitlink.pxd index 1c240342c91..d4b8778ec1d 100644 --- a/cuda_bindings_13/cuda/bindings/cynvjitlink.pxd +++ b/cuda_bindings_13/cuda/bindings/cynvjitlink.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. @@ -11,7 +11,8 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7bd3a5876758225a37a98b496a1423047d3a446a4a0956ebc11b17f0abe2128a +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6caf7252fc92d67d1b473713bd78d0c968e5e74a5e00e180b966bef4f60d4043 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cynvjitlink.pyx b/cuda_bindings_13/cuda/bindings/cynvjitlink.pyx index 0359f23f216..46b59f13872 100644 --- a/cuda_bindings_13/cuda/bindings/cynvjitlink.pyx +++ b/cuda_bindings_13/cuda/bindings/cynvjitlink.pyx @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=3abd933ead70f75181084a0ac8ea01c523839c18b93820a2c560e9b945de6d3e +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d7f30a1963c698654505b04926f8b0e5bc5d5676ee43a061d63df171919a2bb0 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/cynvml.pxd b/cuda_bindings_13/cuda/bindings/cynvml.pxd index 780241c5a3a..4b2e05c41bd 100644 --- a/cuda_bindings_13/cuda/bindings/cynvml.pxd +++ b/cuda_bindings_13/cuda/bindings/cynvml.pxd @@ -2,7 +2,7 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. @@ -11,7 +11,8 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=60a5b20aeb8f2f1b807c72675995ed6bf5943e58f3b9ab24933f51d4a7246f6f +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2218b3adf35777c7458164676dfd21023364671562e580c362be62654d0756bd ctypedef enum nvmlBridgeChipType_t "nvmlBridgeChipType_t": NVML_BRIDGE_CHIP_PLX "NVML_BRIDGE_CHIP_PLX" = 0 NVML_BRIDGE_CHIP_BRO4 "NVML_BRIDGE_CHIP_BRO4" = 1 @@ -198,8 +199,8 @@ ctypedef enum nvmlBrandType_t "nvmlBrandType_t": NVML_BRAND_GEFORCE_RTX "NVML_BRAND_GEFORCE_RTX" = 15 NVML_BRAND_TITAN_RTX "NVML_BRAND_TITAN_RTX" = 16 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_NVIDIA_VGAMEDEV "NVML_BRAND_NVIDIA_VGAMEDEV" = 18 NVML_BRAND_COUNT "NVML_BRAND_COUNT" = 20 ctypedef enum nvmlTemperatureThresholds_t "nvmlTemperatureThresholds_t": @@ -1811,6 +1812,34 @@ ctypedef struct nvmlEccBankRemapperHistogram_v1_t 'nvmlEccBankRemapperHistogram_ unsigned int maxSpareGroupCount unsigned int noSpareGroupCount +ctypedef struct nvmlGpuUptime_v1_t 'nvmlGpuUptime_v1_t': + unsigned int uptime + +ctypedef struct nvmlSystemConfComputeSettings_v2_t 'nvmlSystemConfComputeSettings_v2_t': + unsigned int version + unsigned int environment + unsigned int ccFeature + unsigned int devToolsMode + unsigned int multiGpuMode + unsigned int tdispState + +ctypedef struct nvmlNvlinkGetRemapTableInfo_v1_t 'nvmlNvlinkGetRemapTableInfo_v1_t': + unsigned int alid + unsigned int flaRemapTabAddr[4096] + unsigned int gpaRemapTabAddr[4096] + unsigned int remapTabSize + +ctypedef struct nvmlNvlinkSetNvleReady_v1_t 'nvmlNvlinkSetNvleReady_v1_t': + unsigned char bNvleReady + +ctypedef struct nvmlNvlinkLockRemapTable_v1_t 'nvmlNvlinkLockRemapTable_v1_t': + unsigned char bRemapTableLocked + unsigned char bRemapTableLockDisabled + +ctypedef struct nvmlNvlinkNvlePrivateInfo_v1_t 'nvmlNvlinkNvlePrivateInfo_v1_t': + unsigned char data[256] + unsigned int size + ctypedef nvmlPciInfoExt_v1_t nvmlPciInfoExt_t 'nvmlPciInfoExt_t' ctypedef nvmlCoolerInfo_v1_t nvmlCoolerInfo_t 'nvmlCoolerInfo_t' @@ -2198,6 +2227,13 @@ ctypedef struct nvmlEccBankRemapperStatus_v1_t 'nvmlEccBankRemapperStatus_v1_t': unsigned int bPending nvmlEccBankRemapperHistogram_v1_t histogram +ctypedef struct nvmlNvlinkSetupNvleEncryptionKey_v1_t 'nvmlNvlinkSetupNvleEncryptionKey_v1_t': + unsigned char nvleKey[32] + unsigned int localGpuAlid + unsigned int remoteGpuAlid + nvmlNvlinkNvlePrivateInfo_v1_t localGpuNvlePrivateInfo + nvmlNvlinkNvlePrivateInfo_v1_t remoteGpuNvlePrivateInfo + ctypedef nvmlVgpuTypeIdInfo_v1_t nvmlVgpuTypeIdInfo_t 'nvmlVgpuTypeIdInfo_t' ctypedef nvmlVgpuTypeMaxInstance_v1_t nvmlVgpuTypeMaxInstance_t 'nvmlVgpuTypeMaxInstance_t' @@ -2311,6 +2347,11 @@ ctypedef struct nvmlNvLinkInfo_v2_t 'nvmlNvLinkInfo_v2_t': unsigned int isNvleEnabled nvmlNvlinkFirmwareInfo_t firmwareInfo +ctypedef struct nvmlNvLinkInfo_v3_t 'nvmlNvLinkInfo_v3_t': + unsigned int isNvleEnabled + nvmlNvlinkFirmwareInfo_t firmwareInfo + unsigned int isNvleReady + ctypedef struct nvmlPwrModelMetricsDlppm1x_t 'nvmlPwrModelMetricsDlppm1x_t': unsigned char bValid nvmlCoreRailMetrics_t coreRail @@ -2750,3 +2791,11 @@ cdef nvmlReturn_t nvmlEventSetGetContextInfo_v1(nvmlEventSet_t set, nvmlEventSet cdef nvmlReturn_t nvmlEventSetGetContextData_v1(nvmlEventSet_t set, nvmlEventSetGetContextData_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEventSet_t set, nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1_t* params) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil cdef nvmlReturn_t nvmlDeviceGetBankRemapperStatus_v1(nvmlDevice_t device, nvmlEccBankRemapperStatus_v1_t* pBankRemapperStatus) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetGpuUptime_v1(nvmlDevice_t device, nvmlGpuUptime_v1_t* uptime) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlSystemGetConfComputeSettings_v2(nvmlSystemConfComputeSettings_v2_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvLinkInfo_v3(nvmlDevice_t device, nvmlNvLinkInfo_v3_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvlinkRemapTableInfo_v1(nvmlDevice_t device, nvmlNvlinkGetRemapTableInfo_v1_t* remapTableInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetNvlinkNvleReady_v1(nvmlDevice_t device, nvmlNvlinkSetNvleReady_v1_t* setNvleReady) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceLockNvlinkRemapTable_v1(nvmlDevice_t device, nvmlNvlinkLockRemapTable_v1_t* remapTableLockInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceSetupNvlinkNvleEncryptionKey_v1(nvmlDevice_t device, nvmlNvlinkSetupNvleEncryptionKey_v1_t* encryptionKey) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil +cdef nvmlReturn_t nvmlDeviceGetNvlinkNvlePrivateInfo_v1(nvmlDevice_t device, nvmlNvlinkNvlePrivateInfo_v1_t* privateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil diff --git a/cuda_bindings_13/cuda/bindings/cynvml.pyx b/cuda_bindings_13/cuda/bindings/cynvml.pyx index c309bc66eaa..93a30dee37b 100644 --- a/cuda_bindings_13/cuda/bindings/cynvml.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f5af75e5d248a615a2165cbd490ef48486c2b9e3a3957aec27050eda3de5f329 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=199f4fd7d30daf94bbc8db51d748556933c2a21335d59171b053b4f0a95300a1 from ._internal cimport nvml as _nvml @@ -1490,3 +1491,35 @@ cdef nvmlReturn_t nvmlEventSetGetGpuOperationalEventContextLegacyXid_v1(nvmlEven 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) + + +cdef nvmlReturn_t nvmlDeviceGetGpuUptime_v1(nvmlDevice_t device, nvmlGpuUptime_v1_t* uptime) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetGpuUptime_v1(device, uptime) + + +cdef nvmlReturn_t nvmlSystemGetConfComputeSettings_v2(nvmlSystemConfComputeSettings_v2_t* settings) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlSystemGetConfComputeSettings_v2(settings) + + +cdef nvmlReturn_t nvmlDeviceGetNvLinkInfo_v3(nvmlDevice_t device, nvmlNvLinkInfo_v3_t* info) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvLinkInfo_v3(device, info) + + +cdef nvmlReturn_t nvmlDeviceGetNvlinkRemapTableInfo_v1(nvmlDevice_t device, nvmlNvlinkGetRemapTableInfo_v1_t* remapTableInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvlinkRemapTableInfo_v1(device, remapTableInfo) + + +cdef nvmlReturn_t nvmlDeviceSetNvlinkNvleReady_v1(nvmlDevice_t device, nvmlNvlinkSetNvleReady_v1_t* setNvleReady) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetNvlinkNvleReady_v1(device, setNvleReady) + + +cdef nvmlReturn_t nvmlDeviceLockNvlinkRemapTable_v1(nvmlDevice_t device, nvmlNvlinkLockRemapTable_v1_t* remapTableLockInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceLockNvlinkRemapTable_v1(device, remapTableLockInfo) + + +cdef nvmlReturn_t nvmlDeviceSetupNvlinkNvleEncryptionKey_v1(nvmlDevice_t device, nvmlNvlinkSetupNvleEncryptionKey_v1_t* encryptionKey) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceSetupNvlinkNvleEncryptionKey_v1(device, encryptionKey) + + +cdef nvmlReturn_t nvmlDeviceGetNvlinkNvlePrivateInfo_v1(nvmlDevice_t device, nvmlNvlinkNvlePrivateInfo_v1_t* privateInfo) except?_NVMLRETURN_T_INTERNAL_LOADING_ERROR nogil: + return _nvml._nvmlDeviceGetNvlinkNvlePrivateInfo_v1(device, privateInfo) diff --git a/cuda_bindings_13/cuda/bindings/cynvrtc.pxd b/cuda_bindings_13/cuda/bindings/cynvrtc.pxd index 62f3056d226..bf1ed169759 100644 --- a/cuda_bindings_13/cuda/bindings/cynvrtc.pxd +++ b/cuda_bindings_13/cuda/bindings/cynvrtc.pxd @@ -2,12 +2,13 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. # ENUMS -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a5c9499b37f9bbb764b0cac167daeae7f4539de7093938c95d2fdc83fe70e8f6 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=5b16793f08d2e0113f1ebcebbbe356e5096abf3e81dbf58b024fcfa14c8125b8 cdef extern from 'nvrtc.h': ctypedef enum nvrtcResult "nvrtcResult": NVRTC_SUCCESS diff --git a/cuda_bindings_13/cuda/bindings/cynvrtc.pyx b/cuda_bindings_13/cuda/bindings/cynvrtc.pyx index 77481cfd41f..6eee265afce 100644 --- a/cuda_bindings_13/cuda/bindings/cynvrtc.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=6f99f863837a6b8fb2da89dfe53cb7a4d42ae5e413c181bbfb8e557a1fec0bff +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d7548251dfb92e4a7da232b0bd2b750e238cdd56d74a0b854e114ea929ccca5f from ._internal cimport nvrtc as _nvrtc cdef const char* nvrtcGetErrorString(nvrtcResult result) except?NULL nogil: diff --git a/cuda_bindings_13/cuda/bindings/cynvvm.pxd b/cuda_bindings_13/cuda/bindings/cynvvm.pxd index 1dea8578b40..bb554c5b0a9 100644 --- a/cuda_bindings_13/cuda/bindings/cynvvm.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. ############################################################################### @@ -10,7 +10,8 @@ ############################################################################### # enums -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=060a4e1d735676d6239664555a8a07b292481085ca0f5b5f362ce5289f20ca6d +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=c12ce37b868d7c34e57facd60a9eda1ea152c08392ecc3ec91ecf1ac126b02f3 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_13/cuda/bindings/cynvvm.pyx b/cuda_bindings_13/cuda/bindings/cynvvm.pyx index 45028385633..213470d6a0c 100644 --- a/cuda_bindings_13/cuda/bindings/cynvvm.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f235b24d553d40a065b8e5df12f584994d30eb6a3f52fc0dd35d7202c703f05b +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=30288493ce598b7570349ba972c62fb320b983facfdb60c293a98914c6be89ac from ._internal cimport nvvm as _nvvm diff --git a/cuda_bindings_13/cuda/bindings/cyruntime.pxd b/cuda_bindings_13/cuda/bindings/cyruntime.pxd index e094549ad95..cf7e79d0789 100644 --- a/cuda_bindings_13/cuda/bindings/cyruntime.pxd +++ b/cuda_bindings_13/cuda/bindings/cyruntime.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.0 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=f686e003b0aa5d1800d2f631b8927a9a6fe84f33dc46f1764070ad7480f2821c +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=afc35f47aec4df956b6a71d2f5701fdcc5958ed47af3d5707d11189642f95fd9 # <<<< PREAMBLE CONTENT >>>> @@ -729,6 +730,7 @@ cdef extern from 'driver_types.h': cudaDevAttrOversizedSharedMemoryPerBlock cudaDevAttrCigStreamsSupported cudaDevAttrLocalityDomainMultiprocessorCount + cudaDevAttrTensorMapLargeTensorMinSize cudaDevAttrMax cudaDevAttrCooperativeMultiDeviceLaunch cudaDevAttrMaxTimelineSemaphoreInteropSupported @@ -912,7 +914,9 @@ cdef extern from 'driver_types.h': cudaGraphNodeTypeMemAlloc cudaGraphNodeTypeMemFree cudaGraphNodeTypeConditional + cudaGraphNodeTypeMemcpyBatch cudaGraphNodeTypeReserved16 + cudaGraphNodeTypeExternalEngine cudaGraphNodeTypeCount cdef extern from 'driver_types.h': @@ -980,6 +984,7 @@ cdef extern from 'driver_types.h': cudaGraphDebugDotFlagsKernelNodeAttributes cudaGraphDebugDotFlagsHandles cudaGraphDebugDotFlagsConditionalNodeParams + cudaGraphDebugDotFlagsMemcpyBatchNodeParams cdef extern from 'driver_types.h': cdef enum cudaGraphInstantiateFlags: @@ -1293,6 +1298,7 @@ cdef extern from 'driver_types.h': cudaDevSmResourceGroupDefault cudaDevSmResourceGroupBackfill cudaDevSmResourceGroupLocalityDomainId + cudaDevSmResourceGroupLocalityDomainSupplementalSms cdef extern from 'driver_types.h': cdef enum cudaDevSmResourceSplitByCount_flags: @@ -2117,7 +2123,8 @@ cdef extern from 'driver_types.h': void* win32SecurityAttributes size_t maxSize unsigned short usage - unsigned char reserved[54] + unsigned char reserved[53] + unsigned char reserved1 cdef extern from 'driver_types.h': cdef struct cudaMemcpyAttributes: @@ -2175,6 +2182,17 @@ cdef extern from 'driver_types.h': size_t bytesize void* dptr +cdef extern from 'driver_types.h': + cdef struct cudaMemcpyBatchNodeParams: + size_t count + void** dsts + void** srcs + size_t* sizes + cudaMemcpyAttributes* attrs + size_t* attrsIdxs + size_t numAttrs + cudaExecutionContext_t ctx + cdef extern from 'driver_types.h': ctypedef union cuda_bindings_runtime__anon_pod10 "std::remove_all_extentsop)>::type": cuda_bindings_runtime__anon_pod11 ptr @@ -2202,6 +2220,7 @@ cdef extern from 'driver_types.h': cudaMemAllocNodeParamsV2 alloc cudaMemFreeNodeParams free cudaConditionalNodeParams conditional + cudaMemcpyBatchNodeParams memcpyBatch long long reserved2 cdef extern from 'driver_types.h': @@ -2715,6 +2734,11 @@ cdef extern from 'cuda_runtime_api.h': cdef enum: CUDA_EGL_MAX_PLANES = 3 +# cudaDevSmResourceGroupLocalityDomainIdAny is defined as (~0u) in driver_types.h; the +# pyclibrary-based cython-gen parser can't evaluate that expression, so hardcode the value +cdef enum: + cudaDevSmResourceGroupLocalityDomainIdAny = 4294967295 + # libraryPropertyType_t (starts lowercase, outside type pattern) cdef extern from 'library_types.h': ctypedef enum libraryPropertyType_t 'libraryPropertyType_t': diff --git a/cuda_bindings_13/cuda/bindings/cyruntime.pyx b/cuda_bindings_13/cuda/bindings/cyruntime.pyx index 2e6e08aa3cf..51b5e560bce 100644 --- a/cuda_bindings_13/cuda/bindings/cyruntime.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. +# This code was automatically generated across versions from 12.9.0 to 13.5.0. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d40a4f5510e4271a0984232f64fe01ac712187b248fb15167fbc8e40f024d512 +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8cbe7325db08ed0a75ca77c12aa9257afcb69094841f2dda179ab8f0002b606d from ._internal cimport runtime as _runtime cdef cudaError_t cudaDeviceReset() except ?cudaErrorCallRequiresNewerDriver nogil: diff --git a/cuda_bindings_13/cuda/bindings/driver.pxd b/cuda_bindings_13/cuda/bindings/driver.pxd index 6f328056ca1..5c170054d5d 100644 --- a/cuda_bindings_13/cuda/bindings/driver.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=335719e84ce1d6e1fcd12d7a0d627d5c7f8be1a80379cae902ebe72fa3b1a03f +# This code was automatically generated with version 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=03b11a3bd50b1901f21552ab6d329d58ae39917a0e29cf186706b09925c9450d cimport cuda.bindings.cydriver as cydriver include "_lib/utils.pxd" @@ -4874,6 +4875,187 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: cdef CUevent _event +cdef class CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st: + """ + CUDA Batch Memcpy Node Parameters + + Attributes + ---------- + + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays. This field cannot be + updated in an instantiated graph. + + + dsts : CUdeviceptr + Array of destination pointers. This field can be updated in an + instantiated graph. + + + srcs : CUdeviceptr + Array of source pointers. This field can be updated in an + instantiated graph. + + + sizes : size_t + Array of sizes for memcpy operations. This field can be updated in + an instantiated graph. A size of 0 disables the individual copy + operation. + + + attrs : CUmemcpyAttributes + Array of memcpy attributes. The array contents cannot be updated in + an instantiated graph. + + + attrsIdxs : size_t + Array of indices specifying which copies each entry in `attrs` + applies to. The array contents cannot be updated in an instantiated + graph. + + + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. This field cannot be + updated in an instantiated graph. + + + ctx : CUcontext + Preferred context to use for the copies. This field cannot be + updated in an instantiated graph. + + + gCtx : CUgreenCtx + Preferred green context to use for the copies. This field cannot be + updated in an instantiated graph. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cydriver.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st* _val_ptr + cdef cydriver.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st* _pvt_ptr + + cdef size_t _dsts_length + cdef cydriver.CUdeviceptr* _dsts + + + cdef size_t _srcs_length + cdef cydriver.CUdeviceptr* _srcs + + + cdef _HelperInputVoidPtr _cysizes + + + cdef size_t _attrs_length + cdef cydriver.CUmemcpyAttributes* _attrs + + + cdef _HelperInputVoidPtr _cyattrsIdxs + + + cdef CUcontext _ctx + + + cdef CUgreenCtx _gCtx + + +cdef class CUDA_FABRIC_COPY_BATCH_OP_st: + """ + Struct representing a single copy operation for use with + cuFabricCpyBatchAsync + + Attributes + ---------- + + src : CUfabricCpyOperand + Source copy operand. + + + dst : CUfabricCpyOperand + Destination copy operand. + + + size : size_t + Size in bytes. Zero makes this operation a no-op. + + + flags : unsigned int + Additional flags for fabric copy. Must be 0. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cydriver.CUDA_FABRIC_COPY_BATCH_OP_st _pvt_val + cdef cydriver.CUDA_FABRIC_COPY_BATCH_OP_st* _pvt_ptr + + cdef CUfabricCpyOperand _src + + + cdef CUfabricCpyOperand _dst + + +cdef class CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st: + """ + CUDA fabric copy batch node parameters The application must keep + every logical endpoint ID referenced by `opList` valid and bound + for as long as a graph or executable graph may use the node. Fabric + copy batch nodes are not supported in device-launched graphs or + conditional nodes. + + Attributes + ---------- + + numOps : size_t + Number of entries in `opList`. This field cannot be updated after + instantiation. + + + opList : CUDA_FABRIC_COPY_BATCH_OP + Array of fabric copy operations. Logical endpoint IDs and operand + types cannot be updated after instantiation. + + + flags : unsigned long long + Flags for future use. Must be zero and cannot be updated after + instantiation. + + + ctx : CUcontext + Preferred context. This field cannot be updated after + instantiation. + + + gCtx : CUgreenCtx + Preferred green context. This field cannot be updated after + instantiation. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cydriver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st* _val_ptr + cdef cydriver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st* _pvt_ptr + + cdef size_t _opList_length + cdef cydriver.CUDA_FABRIC_COPY_BATCH_OP* _opList + + + cdef CUcontext _ctx + + + cdef CUgreenCtx _gCtx + + cdef class CUgraphNodeParams_st: """ Graph node parameters. See cuGraphAddNode. @@ -4937,6 +5119,14 @@ cdef class CUgraphNodeParams_st: Conditional node parameters. + memcpyBatch : CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 + Batch memcpy node parameters. + + + fabricCpyBatch : CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 + Fabric copy batch node parameters. + + asBytes : bytes Padding as bytes @@ -4989,6 +5179,12 @@ cdef class CUgraphNodeParams_st: cdef CUDA_CONDITIONAL_NODE_PARAMS _conditional + cdef CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 _memcpyBatch + + + cdef CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 _fabricCpyBatch + + cdef class CUcheckpointCustomStoragePerDeviceData_st: """ Per-GPU data for zero-copy mapped device memory used with CUDA @@ -5368,6 +5564,114 @@ cdef class CUlogicalEndpointProp_struct: cdef anon_struct27 _multicast +cdef class anon_struct28: + """ + Attributes + ---------- + + ptr : CUdeviceptr + + + + locHint : CUmemLocation + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cydriver.CUfabricCpyOperand_st* _pvt_ptr + + cdef CUdeviceptr _ptr + + + cdef CUmemLocation _locHint + + +cdef class anon_struct29: + """ + Attributes + ---------- + + id : CUlogicalEndpointId + + + + offset : cuuint64_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cydriver.CUfabricCpyOperand_st* _pvt_ptr + + cdef CUlogicalEndpointId _id + + + cdef cuuint64_t _offset + + +cdef class anon_union22: + """ + Attributes + ---------- + + ptr : anon_struct28 + + + + le : anon_struct29 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cydriver.CUfabricCpyOperand_st* _pvt_ptr + + cdef anon_struct28 _ptr + + + cdef anon_struct29 _le + + +cdef class CUfabricCpyOperand_st: + """ + Struct representing an operand for copy with cuFabricCpyBatchAsync + + Attributes + ---------- + + type : CUfabricCpyOperandType + + + + op : anon_union22 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cydriver.CUfabricCpyOperand_st* _val_ptr + cdef cydriver.CUfabricCpyOperand_st* _pvt_ptr + + cdef anon_union22 _op + + cdef class CUdevSmResource_st: """ Attributes @@ -5545,7 +5849,7 @@ cdef class CUdevResource_st: cdef cydriver.CUdevResource_st* _nextResource -cdef class anon_union21: +cdef class anon_union24: """ Attributes ---------- @@ -5575,7 +5879,7 @@ cdef class CUeglFrame_st: Attributes ---------- - frame : anon_union21 + frame : anon_union24 @@ -5624,7 +5928,7 @@ cdef class CUeglFrame_st: cdef cydriver.CUeglFrame_st* _val_ptr cdef cydriver.CUeglFrame_st* _pvt_ptr - cdef anon_union21 _frame + cdef anon_union24 _frame cdef class CUdeviceptr: @@ -10525,6 +10829,276 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS(CUDA_EVENT_WAIT_NODE_PARAMS_st): """ pass +cdef class CUDA_MEMCPY_BATCH_NODE_PARAMS_V1(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st): + """ + CUDA Batch Memcpy Node Parameters + + Attributes + ---------- + + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays. This field cannot be + updated in an instantiated graph. + + + dsts : CUdeviceptr + Array of destination pointers. This field can be updated in an + instantiated graph. + + + srcs : CUdeviceptr + Array of source pointers. This field can be updated in an + instantiated graph. + + + sizes : size_t + Array of sizes for memcpy operations. This field can be updated in + an instantiated graph. A size of 0 disables the individual copy + operation. + + + attrs : CUmemcpyAttributes + Array of memcpy attributes. The array contents cannot be updated in + an instantiated graph. + + + attrsIdxs : size_t + Array of indices specifying which copies each entry in `attrs` + applies to. The array contents cannot be updated in an instantiated + graph. + + + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. This field cannot be + updated in an instantiated graph. + + + ctx : CUcontext + Preferred context to use for the copies. This field cannot be + updated in an instantiated graph. + + + gCtx : CUgreenCtx + Preferred green context to use for the copies. This field cannot be + updated in an instantiated graph. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_MEMCPY_BATCH_NODE_PARAMS(CUDA_MEMCPY_BATCH_NODE_PARAMS_V1): + """ + CUDA Batch Memcpy Node Parameters + + Attributes + ---------- + + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays. This field cannot be + updated in an instantiated graph. + + + dsts : CUdeviceptr + Array of destination pointers. This field can be updated in an + instantiated graph. + + + srcs : CUdeviceptr + Array of source pointers. This field can be updated in an + instantiated graph. + + + sizes : size_t + Array of sizes for memcpy operations. This field can be updated in + an instantiated graph. A size of 0 disables the individual copy + operation. + + + attrs : CUmemcpyAttributes + Array of memcpy attributes. The array contents cannot be updated in + an instantiated graph. + + + attrsIdxs : size_t + Array of indices specifying which copies each entry in `attrs` + applies to. The array contents cannot be updated in an instantiated + graph. + + + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. This field cannot be + updated in an instantiated graph. + + + ctx : CUcontext + Preferred context to use for the copies. This field cannot be + updated in an instantiated graph. + + + gCtx : CUgreenCtx + Preferred green context to use for the copies. This field cannot be + updated in an instantiated graph. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_FABRIC_COPY_BATCH_OP_v1(CUDA_FABRIC_COPY_BATCH_OP_st): + """ + Struct representing a single copy operation for use with + cuFabricCpyBatchAsync + + Attributes + ---------- + + src : CUfabricCpyOperand + Source copy operand. + + + dst : CUfabricCpyOperand + Destination copy operand. + + + size : size_t + Size in bytes. Zero makes this operation a no-op. + + + flags : unsigned int + Additional flags for fabric copy. Must be 0. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_FABRIC_COPY_BATCH_OP(CUDA_FABRIC_COPY_BATCH_OP_v1): + """ + Struct representing a single copy operation for use with + cuFabricCpyBatchAsync + + Attributes + ---------- + + src : CUfabricCpyOperand + Source copy operand. + + + dst : CUfabricCpyOperand + Destination copy operand. + + + size : size_t + Size in bytes. Zero makes this operation a no-op. + + + flags : unsigned int + Additional flags for fabric copy. Must be 0. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st): + """ + CUDA fabric copy batch node parameters The application must keep + every logical endpoint ID referenced by `opList` valid and bound + for as long as a graph or executable graph may use the node. Fabric + copy batch nodes are not supported in device-launched graphs or + conditional nodes. + + Attributes + ---------- + + numOps : size_t + Number of entries in `opList`. This field cannot be updated after + instantiation. + + + opList : CUDA_FABRIC_COPY_BATCH_OP + Array of fabric copy operations. Logical endpoint IDs and operand + types cannot be updated after instantiation. + + + flags : unsigned long long + Flags for future use. Must be zero and cannot be updated after + instantiation. + + + ctx : CUcontext + Preferred context. This field cannot be updated after + instantiation. + + + gCtx : CUgreenCtx + Preferred green context. This field cannot be updated after + instantiation. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUDA_FABRIC_CPY_BATCH_NODE_PARAMS(CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1): + """ + CUDA fabric copy batch node parameters The application must keep + every logical endpoint ID referenced by `opList` valid and bound + for as long as a graph or executable graph may use the node. Fabric + copy batch nodes are not supported in device-launched graphs or + conditional nodes. + + Attributes + ---------- + + numOps : size_t + Number of entries in `opList`. This field cannot be updated after + instantiation. + + + opList : CUDA_FABRIC_COPY_BATCH_OP + Array of fabric copy operations. Logical endpoint IDs and operand + types cannot be updated after instantiation. + + + flags : unsigned long long + Flags for future use. Must be zero and cannot be updated after + instantiation. + + + ctx : CUcontext + Preferred context. This field cannot be updated after + instantiation. + + + gCtx : CUgreenCtx + Preferred green context. This field cannot be updated after + instantiation. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + cdef class CUgraphNodeParams(CUgraphNodeParams_st): """ Graph node parameters. See cuGraphAddNode. @@ -10588,6 +11162,14 @@ cdef class CUgraphNodeParams(CUgraphNodeParams_st): Conditional node parameters. + memcpyBatch : CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 + Batch memcpy node parameters. + + + fabricCpyBatch : CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 + Fabric copy batch node parameters. + + asBytes : bytes Padding as bytes @@ -10885,6 +11467,28 @@ cdef class CUlogicalEndpointProp(CUlogicalEndpointProp_struct): A bitmask of flags defined in CUlogicalEndpointFlag + Methods + ------- + getPtr() + Get memory address of class instance + """ + pass + +cdef class CUfabricCpyOperand(CUfabricCpyOperand_st): + """ + Struct representing an operand for copy with cuFabricCpyBatchAsync + + Attributes + ---------- + + type : CUfabricCpyOperandType + + + + op : anon_union22 + + + Methods ------- getPtr() @@ -11094,7 +11698,7 @@ cdef class CUeglFrame_v1(CUeglFrame_st): Attributes ---------- - frame : anon_union21 + frame : anon_union24 @@ -11150,7 +11754,7 @@ cdef class CUeglFrame(CUeglFrame_v1): Attributes ---------- - frame : anon_union21 + frame : anon_union24 diff --git a/cuda_bindings_13/cuda/bindings/driver.pyx b/cuda_bindings_13/cuda/bindings/driver.pyx index ef2feb43e43..e5233f9cdde 100644 --- a/cuda_bindings_13/cuda/bindings/driver.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8932ee959b6a2f1e69316f813cb8e8492c8e112094812dc1310c49970f00779a +# This code was automatically generated with version 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7e8ddfdcb44c704e1875519c9a88ca86dd770177983cc9208f643eab6fb00723 from typing import Any, Optional import cython import ctypes @@ -355,6 +356,14 @@ CU_DEVICE_CPU = cydriver.CU_DEVICE_CPU #: Device that represents an invalid device CU_DEVICE_INVALID = cydriver.CU_DEVICE_INVALID +#: Special value `localityDomainId` when :py:obj:`~.cuDevSmResourceSplit` +#: is called with `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID`. Selects +#: SMs from the union of all available locality domains in the input SM +#: resource. See also: +#: :py:obj:`~.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID` for the set of +#: SMs in a single locality domain. +CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID_ANY = cydriver.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID_ANY + #: Maximum number of planes per frame MAX_PLANES = cydriver.MAX_PLANES @@ -2405,6 +2414,21 @@ class CUdevice_attribute(_FastEnum): ) + CU_DEVICE_ATTRIBUTE_VULKAN_CIG_STREAMS_SUPPORTED = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_STREAMS_SUPPORTED, + 'Device supports CIG streams with Vulkan\n' + ) + + + CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE = ( + cydriver.CUdevice_attribute_enum.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE, + 'Minimum contiguous, accessible size in bytes required when the large\n' + 'tensor-map allocation class is effective. Devices with a 128 KiB backing\n' + 'precondition report 131072; devices where allocation-class selection is a\n' + 'no-op report INT_MAX.\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' @@ -3243,9 +3267,7 @@ class CUjit_option(_FastEnum): CU_JIT_POSITION_INDEPENDENT_CODE = ( cydriver.CUjit_option_enum.CU_JIT_POSITION_INDEPENDENT_CODE, - 'Generate position independent code (0: false)\n' - 'Option type: int\n' - 'Applies to: compiler only\n' + '[Deprecated]\n' ) @@ -3958,11 +3980,29 @@ class CUgraphNodeType(_FastEnum): ) + CU_GRAPH_NODE_TYPE_MEMCPY_BATCH = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_MEMCPY_BATCH, + 'Batch Memcpy Node\n' + ) + + CU_GRAPH_NODE_TYPE_RESERVED_16 = ( cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_RESERVED_16, 'Reserved\n' ) + + CU_GRAPH_NODE_TYPE_EXTERNAL_ENGINE = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_EXTERNAL_ENGINE, + 'Reserved for External Engine node\n' + ) + + + CU_GRAPH_NODE_TYPE_FABRIC_CPY_BATCH = ( + cydriver.CUgraphNodeType_enum.CU_GRAPH_NODE_TYPE_FABRIC_CPY_BATCH, + 'Fabric copy batch node\n' + ) + class CUgraphDependencyType(_FastEnum): """ Type annotations that can be applied to graph edges as part of @@ -4544,6 +4584,12 @@ class CUstreamCigDataType(_FastEnum): 'D3D12 Command List Handle\n' ) + + STREAM_CIG_DATA_TYPE_VULKAN_COMMAND_BUFFER_HANDLE_NV = ( + cydriver.CUstreamCigDataType_enum.STREAM_CIG_DATA_TYPE_VULKAN_COMMAND_BUFFER_HANDLE_NV, + 'Vulkan Command Buffer Internal NVIDIA Handle\n' + ) + class CUlibraryOption(_FastEnum): """ Library options to be specified with @@ -5744,6 +5790,41 @@ class CUtensorMapIm2ColWideMode(_FastEnum): CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 = cydriver.CUtensorMapIm2ColWideMode_enum.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 +class CUtensorMapAllocClass(_FastEnum): + """ + Tensor-map allocation class. On devices where allocation-class + selection affects Tensor Memory Accelerator (TMA) out-of-bounds + address generation, this controls the mode encoded in a + :py:obj:`~.CUtensorMap`. The "large" class enables a wider (128 + KiB) OOB address-generation window that improves performance but is + only safe when the tensor's base allocation is backed by a + contiguous, accessible region of at least + :py:obj:`~.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE` + bytes. On devices where allocation-class selection has no effect, + all requests have the same SMALL effective behavior. + """ + + + CU_TENSOR_MAP_ALLOC_CLASS_AUTO = ( + cydriver.CUtensorMapAllocClass_enum.CU_TENSOR_MAP_ALLOC_CLASS_AUTO, + 'Recompute the effective allocation class from the tensor-map layout.\n' + ) + + + CU_TENSOR_MAP_ALLOC_CLASS_SMALL = ( + cydriver.CUtensorMapAllocClass_enum.CU_TENSOR_MAP_ALLOC_CLASS_SMALL, + 'Request the "small" class (safe 4 KiB OOB window).\n' + ) + + + CU_TENSOR_MAP_ALLOC_CLASS_LARGE = ( + cydriver.CUtensorMapAllocClass_enum.CU_TENSOR_MAP_ALLOC_CLASS_LARGE, + 'Request the "large" class (128 KiB OOB window); when LARGE is effective,\n' + 'the caller guarantees the effective base allocation is accessible for at\n' + 'least :py:obj:`~.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE`\n' + 'bytes before use.\n' + ) + class CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS(_FastEnum): """ Access flags that specify the level of access the current context's @@ -6651,6 +6732,18 @@ class CUgraphDebugDot_flags(_FastEnum): 'Adds conditional node parameters to output\n' ) + + CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_BATCH_NODE_PARAMS = ( + cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_BATCH_NODE_PARAMS, + 'Adds batch memcpy node parameters to the output\n' + ) + + + CU_GRAPH_DEBUG_DOT_FLAGS_FABRIC_CPY_BATCH_NODE_PARAMS = ( + cydriver.CUgraphDebugDot_flags_enum.CU_GRAPH_DEBUG_DOT_FLAGS_FABRIC_CPY_BATCH_NODE_PARAMS, + 'Adds fabric copy batch node parameters\n' + ) + class CUuserObject_flags(_FastEnum): """ Flags for user objects for graphs @@ -6848,9 +6941,18 @@ class CUlogicalEndpointIpcHandleType(_FastEnum): endpoint """ - CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE = cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE - CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC = cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE = ( + cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE, + 'Does not allow any export mechanism\n' + ) + + + CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC = ( + cydriver.CUlogicalEndpointIpcHandleType_enum.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC, + 'Allows export to a fabric handle\n' + '(:py:obj:`~.CUlogicalEndpointFabricHandle`)\n' + ) class CUlogicalEndpointType(_FastEnum): """ @@ -6881,6 +6983,26 @@ class CUlogicalEndpointFlag(_FastEnum): 'logical endpoint\n' ) +class CUfabricCpyOperandType(_FastEnum): + """ + These flags allow applications to convey the operand type for + individual copies specified in :py:obj:`~.cuFabricCpyBatchAsync`. + """ + + + CU_FABRIC_COPY_OPERAND_TYPE_POINTER = ( + cydriver.CUfabricCpyOperandType_enum.CU_FABRIC_COPY_OPERAND_TYPE_POINTER, + 'Copy operand is a valid pointer.\n' + ) + + + CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT = ( + cydriver.CUfabricCpyOperandType_enum.CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT, + 'Copy operand is a logical endpoint.\n' + ) + + CU_FABRIC_COPY_OPERAND_TYPE_MAX = cydriver.CUfabricCpyOperandType_enum.CU_FABRIC_COPY_OPERAND_TYPE_MAX + class CUgraphRecaptureStatus(_FastEnum): """ @@ -6956,12 +7078,14 @@ class CUCoredumpGenerationFlags(_FastEnum): CU_COREDUMP_SKIP_CONSTBANK_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_CONSTBANK_MEMORY - CU_COREDUMP_LIGHTWEIGHT_FLAGS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LIGHTWEIGHT_FLAGS - CU_COREDUMP_GZIP_COMPRESS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_GZIP_COMPRESS CU_COREDUMP_FAULTED_CONTEXTS_ONLY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_FAULTED_CONTEXTS_ONLY + CU_COREDUMP_SKIP_TENSOR_MEMORY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_TENSOR_MEMORY + + CU_COREDUMP_LIGHTWEIGHT_FLAGS = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LIGHTWEIGHT_FLAGS + CU_COREDUMP_NO_ERRBAR_AT_EXIT = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_NO_ERRBAR_AT_EXIT CU_COREDUMP_LOG_ONLY = cydriver.CUCoredumpGenerationFlags.CU_COREDUMP_LOG_ONLY @@ -6995,6 +7119,14 @@ class CUdevSmResourceGroup_flags(_FastEnum): 'localityDomainId\n' ) + + CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS = ( + cydriver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS, + 'Modifier to :py:obj:`~.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID` which\n' + 'allows selection of SMs in the locality domain exceeding the\n' + ':py:obj:`~.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT`\n' + ) + class CUdevSmResourceSplitByCount_flags(_FastEnum): """ @@ -23202,6 +23334,607 @@ cdef class CUDA_EVENT_WAIT_NODE_PARAMS_st: self._event._pvt_ptr[0] = cyevent +cdef class CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st: + """ + CUDA Batch Memcpy Node Parameters + + Attributes + ---------- + + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays. This field cannot be + updated in an instantiated graph. + + + dsts : CUdeviceptr + Array of destination pointers. This field can be updated in an + instantiated graph. + + + srcs : CUdeviceptr + Array of source pointers. This field can be updated in an + instantiated graph. + + + sizes : size_t + Array of sizes for memcpy operations. This field can be updated in + an instantiated graph. A size of 0 disables the individual copy + operation. + + + attrs : CUmemcpyAttributes + Array of memcpy attributes. The array contents cannot be updated in + an instantiated graph. + + + attrsIdxs : size_t + Array of indices specifying which copies each entry in `attrs` + applies to. The array contents cannot be updated in an instantiated + graph. + + + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. This field cannot be + updated in an instantiated graph. + + + ctx : CUcontext + Preferred context to use for the copies. This field cannot be + updated in an instantiated graph. + + + gCtx : CUgreenCtx + Preferred green context to use for the copies. This field cannot be + updated in an instantiated graph. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cydriver.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + self._gCtx = CUgreenCtx(_ptr=&self._pvt_ptr[0].gCtx) + def __dealloc__(self): + if self._dsts is not NULL: + free(self._dsts) + self._pvt_ptr[0].dsts = NULL + if self._srcs is not NULL: + free(self._srcs) + self._pvt_ptr[0].srcs = NULL + if self._attrs is not NULL: + free(self._attrs) + self._pvt_ptr[0].attrs = NULL + if self._val_ptr is not NULL: + free(self._val_ptr) + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['count : ' + str(self.count)] + except ValueError: + str_list += ['count : '] + + + try: + str_list += ['dsts : ' + str(self.dsts)] + except ValueError: + str_list += ['dsts : '] + + + try: + str_list += ['srcs : ' + str(self.srcs)] + except ValueError: + str_list += ['srcs : '] + + + try: + str_list += ['sizes : ' + str(self.sizes)] + except ValueError: + str_list += ['sizes : '] + + + try: + str_list += ['attrs : ' + str(self.attrs)] + except ValueError: + str_list += ['attrs : '] + + + try: + str_list += ['attrsIdxs : ' + str(self.attrsIdxs)] + except ValueError: + str_list += ['attrsIdxs : '] + + + try: + str_list += ['numAttrs : ' + str(self.numAttrs)] + except ValueError: + str_list += ['numAttrs : '] + + + 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 '' + + @property + def count(self): + return self._pvt_ptr[0].count + @count.setter + def count(self, size_t count): + self._pvt_ptr[0].count = count + + + @property + def dsts(self): + if self._pvt_ptr[0].dsts == NULL: + return [] + return [ + CUdeviceptr(init_value=self._pvt_ptr[0].dsts[x]) + for x in range(self._pvt_ptr[0].count) + ] + @dsts.setter + def dsts(self, val): + raise AttributeError( + "dsts shares its count field with srcs on this " + "struct and cannot be set independently; use " + "set_dsts_srcs(...) to set them together." + ) + + + @property + def srcs(self): + if self._pvt_ptr[0].srcs == NULL: + return [] + return [ + CUdeviceptr(init_value=self._pvt_ptr[0].srcs[x]) + for x in range(self._pvt_ptr[0].count) + ] + @srcs.setter + def srcs(self, val): + raise AttributeError( + "srcs shares its count field with dsts on this " + "struct and cannot be set independently; use " + "set_dsts_srcs(...) to set them together." + ) + + + @property + def sizes(self): + return self._pvt_ptr[0].sizes + @sizes.setter + def sizes(self, sizes): + self._cysizes = _HelperInputVoidPtr(sizes) + self._pvt_ptr[0].sizes = self._cysizes.cptr + + + @property + def attrs(self): + if self._pvt_ptr[0].attrs == NULL: + return [] + out_attrs = [CUmemcpyAttributes() for _idx in range(self._pvt_ptr[0].numAttrs)] + for _idx in range(len(out_attrs)): + string.memcpy(out_attrs[_idx].getPtr(), &self._pvt_ptr[0].attrs[_idx], sizeof(cydriver.CUmemcpyAttributes)) + return out_attrs + @attrs.setter + def attrs(self, val): + cdef cydriver.CUmemcpyAttributes* _attrs_new + if len(val) == 0: + free(self._attrs) + self._attrs = NULL + self._attrs_length = 0 + self._pvt_ptr[0].numAttrs = 0 + self._pvt_ptr[0].attrs = NULL + else: + if self._attrs_length != len(val): + _attrs_new = calloc(len(val), sizeof(cydriver.CUmemcpyAttributes)) + if _attrs_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUmemcpyAttributes))) + for idx in range(len(val)): + string.memcpy(&_attrs_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUmemcpyAttributes)) + free(self._attrs) + self._attrs = _attrs_new + self._attrs_length = len(val) + self._pvt_ptr[0].numAttrs = len(val) + 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.CUmemcpyAttributes)) + self._pvt_ptr[0].numAttrs = len(val) + + + @property + def attrsIdxs(self): + return self._pvt_ptr[0].attrsIdxs + @attrsIdxs.setter + def attrsIdxs(self, attrsIdxs): + self._cyattrsIdxs = _HelperInputVoidPtr(attrsIdxs) + self._pvt_ptr[0].attrsIdxs = self._cyattrsIdxs.cptr + + + @property + def numAttrs(self): + return self._pvt_ptr[0].numAttrs + @numAttrs.setter + def numAttrs(self, size_t numAttrs): + self._pvt_ptr[0].numAttrs = numAttrs + + + @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 + + def set_dsts_srcs(self, dsts, srcs): + """Set dsts, srcs together: they share this struct's count field and can't be set independently.""" + if len(srcs) != len(dsts): + raise ValueError('dsts and srcs must all have the same length') + + _dsts_converted = [int(v) for v in dsts] + _srcs_converted = [int(v) for v in srcs] + cdef cydriver.CUdeviceptr* _dsts_new = NULL + if len(_dsts_converted) > 0: + _dsts_new = calloc(len(_dsts_converted), sizeof(cydriver.CUdeviceptr)) + if _dsts_new is NULL: + raise MemoryError('Failed to allocate length x size memory for dsts') + for _idx in range(len(_dsts_converted)): + _dsts_new[_idx] = _dsts_converted[_idx] + + cdef cydriver.CUdeviceptr* _srcs_new = NULL + if len(_srcs_converted) > 0: + _srcs_new = calloc(len(_srcs_converted), sizeof(cydriver.CUdeviceptr)) + if _srcs_new is NULL: + free(_dsts_new); raise MemoryError('Failed to allocate length x size memory for srcs') + for _idx in range(len(_srcs_converted)): + _srcs_new[_idx] = _srcs_converted[_idx] + + free(self._dsts) + self._dsts = _dsts_new + self._dsts_length = len(dsts) + self._pvt_ptr[0].dsts = _dsts_new + + free(self._srcs) + self._srcs = _srcs_new + self._srcs_length = len(srcs) + self._pvt_ptr[0].srcs = _srcs_new + + self._pvt_ptr[0].count = len(dsts) + +cdef class CUDA_FABRIC_COPY_BATCH_OP_st: + """ + Struct representing a single copy operation for use with + cuFabricCpyBatchAsync + + Attributes + ---------- + + src : CUfabricCpyOperand + Source copy operand. + + + dst : CUfabricCpyOperand + Destination copy operand. + + + size : size_t + Size in bytes. Zero makes this operation a no-op. + + + flags : unsigned int + Additional flags for fabric copy. Must be 0. + + + 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): + self._src = CUfabricCpyOperand(_ptr=&self._pvt_ptr[0].src) + self._src._owner = self + self._dst = CUfabricCpyOperand(_ptr=&self._pvt_ptr[0].dst) + self._dst._owner = self + def __dealloc__(self): + self._src = None + self._dst = None + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['src :\n' + '\n'.join([' ' + line for line in str(self.src).splitlines()])] + except ValueError: + str_list += ['src : '] + + + try: + str_list += ['dst :\n' + '\n'.join([' ' + line for line in str(self.dst).splitlines()])] + except ValueError: + str_list += ['dst : '] + + + try: + str_list += ['size : ' + str(self.size)] + except ValueError: + str_list += ['size : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def src(self): + return self._src + @src.setter + def src(self, src not None : CUfabricCpyOperand): + string.memcpy(&self._pvt_ptr[0].src, src.getPtr(), sizeof(self._pvt_ptr[0].src)) + + + @property + def dst(self): + return self._dst + @dst.setter + def dst(self, dst not None : CUfabricCpyOperand): + string.memcpy(&self._pvt_ptr[0].dst, dst.getPtr(), sizeof(self._pvt_ptr[0].dst)) + + + @property + def size(self): + return self._pvt_ptr[0].size + @size.setter + def size(self, size_t size): + self._pvt_ptr[0].size = size + + + @property + def flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, unsigned int flags): + self._pvt_ptr[0].flags = flags + + +cdef class CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st: + """ + CUDA fabric copy batch node parameters The application must keep + every logical endpoint ID referenced by `opList` valid and bound + for as long as a graph or executable graph may use the node. Fabric + copy batch nodes are not supported in device-launched graphs or + conditional nodes. + + Attributes + ---------- + + numOps : size_t + Number of entries in `opList`. This field cannot be updated after + instantiation. + + + opList : CUDA_FABRIC_COPY_BATCH_OP + Array of fabric copy operations. Logical endpoint IDs and operand + types cannot be updated after instantiation. + + + flags : unsigned long long + Flags for future use. Must be zero and cannot be updated after + instantiation. + + + ctx : CUcontext + Preferred context. This field cannot be updated after + instantiation. + + + gCtx : CUgreenCtx + Preferred green context. This field cannot be updated after + instantiation. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cydriver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + self._ctx = CUcontext(_ptr=&self._pvt_ptr[0].ctx) + self._gCtx = CUgreenCtx(_ptr=&self._pvt_ptr[0].gCtx) + def __dealloc__(self): + if self._opList is not NULL: + free(self._opList) + self._pvt_ptr[0].opList = NULL + if self._val_ptr is not NULL: + free(self._val_ptr) + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['numOps : ' + str(self.numOps)] + except ValueError: + str_list += ['numOps : '] + + + try: + str_list += ['opList : ' + str(self.opList)] + except ValueError: + str_list += ['opList : '] + + + try: + str_list += ['flags : ' + str(self.flags)] + except ValueError: + str_list += ['flags : '] + + + 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 '' + + @property + def numOps(self): + return self._pvt_ptr[0].numOps + @numOps.setter + def numOps(self, size_t numOps): + self._pvt_ptr[0].numOps = numOps + + + @property + def opList(self): + if self._pvt_ptr[0].opList == NULL: + return [] + out_opList = [CUDA_FABRIC_COPY_BATCH_OP() for _idx in range(self._pvt_ptr[0].numOps)] + for _idx in range(len(out_opList)): + string.memcpy(out_opList[_idx].getPtr(), &self._pvt_ptr[0].opList[_idx], sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP)) + return out_opList + @opList.setter + def opList(self, val): + cdef cydriver.CUDA_FABRIC_COPY_BATCH_OP* _opList_new + if len(val) == 0: + free(self._opList) + self._opList = NULL + self._opList_length = 0 + self._pvt_ptr[0].numOps = 0 + self._pvt_ptr[0].opList = NULL + else: + if self._opList_length != len(val): + _opList_new = calloc(len(val), sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP)) + if _opList_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP))) + for idx in range(len(val)): + string.memcpy(&_opList_new[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP)) + free(self._opList) + self._opList = _opList_new + self._opList_length = len(val) + self._pvt_ptr[0].numOps = len(val) + self._pvt_ptr[0].opList = _opList_new + else: + for idx in range(len(val)): + string.memcpy(&self._opList[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP)) + self._pvt_ptr[0].numOps = len(val) + + + @property + def flags(self): + return self._pvt_ptr[0].flags + @flags.setter + def flags(self, unsigned long long flags): + self._pvt_ptr[0].flags = flags + + + @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 CUgraphNodeParams_st: """ Graph node parameters. See cuGraphAddNode. @@ -23265,6 +23998,14 @@ cdef class CUgraphNodeParams_st: Conditional node parameters. + memcpyBatch : CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 + Batch memcpy node parameters. + + + fabricCpyBatch : CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 + Fabric copy batch node parameters. + + asBytes : bytes Padding as bytes @@ -23307,6 +24048,10 @@ cdef class CUgraphNodeParams_st: self._memOp._owner = self self._conditional = CUDA_CONDITIONAL_NODE_PARAMS(_ptr=&self._pvt_ptr[0].conditional) self._conditional._owner = self + self._memcpyBatch = CUDA_MEMCPY_BATCH_NODE_PARAMS_V1(_ptr=&self._pvt_ptr[0].memcpyBatch) + self._memcpyBatch._owner = self + self._fabricCpyBatch = CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1(_ptr=&self._pvt_ptr[0].fabricCpyBatch) + self._fabricCpyBatch._owner = self def __dealloc__(self): self._kernel = None self._memcpy = None @@ -23321,6 +24066,8 @@ cdef class CUgraphNodeParams_st: self._free = None self._memOp = None self._conditional = None + self._memcpyBatch = None + self._fabricCpyBatch = None if self._val_ptr is not NULL: free(self._val_ptr) def getPtr(self): @@ -23413,6 +24160,18 @@ cdef class CUgraphNodeParams_st: str_list += ['conditional : '] + try: + str_list += ['memcpyBatch :\n' + '\n'.join([' ' + line for line in str(self.memcpyBatch).splitlines()])] + except ValueError: + str_list += ['memcpyBatch : '] + + + try: + str_list += ['fabricCpyBatch :\n' + '\n'.join([' ' + line for line in str(self.fabricCpyBatch).splitlines()])] + except ValueError: + str_list += ['fabricCpyBatch : '] + + try: str_list += ['asBytes : ' + str(self.asBytes)] except ValueError: @@ -23534,6 +24293,22 @@ cdef class CUgraphNodeParams_st: string.memcpy(&self._pvt_ptr[0].conditional, conditional.getPtr(), sizeof(self._pvt_ptr[0].conditional)) + @property + def memcpyBatch(self): + return self._memcpyBatch + @memcpyBatch.setter + def memcpyBatch(self, memcpyBatch not None : CUDA_MEMCPY_BATCH_NODE_PARAMS_V1): + string.memcpy(&self._pvt_ptr[0].memcpyBatch, memcpyBatch.getPtr(), sizeof(self._pvt_ptr[0].memcpyBatch)) + + + @property + def fabricCpyBatch(self): + return self._fabricCpyBatch + @fabricCpyBatch.setter + def fabricCpyBatch(self, fabricCpyBatch not None : CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1): + string.memcpy(&self._pvt_ptr[0].fabricCpyBatch, fabricCpyBatch.getPtr(), sizeof(self._pvt_ptr[0].fabricCpyBatch)) + + @property def asBytes(self): return PyBytes_FromStringAndSize(self._pvt_ptr[0].asBytes, 232) @@ -24595,6 +25370,299 @@ cdef class CUlogicalEndpointProp_struct: self._pvt_ptr[0].flags = flags +cdef class anon_struct28: + """ + Attributes + ---------- + + ptr : CUdeviceptr + + + + locHint : CUmemLocation + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + self._ptr = CUdeviceptr(_ptr=&self._pvt_ptr[0].op.ptr.ptr) + self._locHint = CUmemLocation(_ptr=&self._pvt_ptr[0].op.ptr.locHint) + self._locHint._owner = self + def __dealloc__(self): + self._locHint = None + def getPtr(self): + return &self._pvt_ptr[0].op.ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['ptr : ' + str(self.ptr)] + except ValueError: + str_list += ['ptr : '] + + + try: + str_list += ['locHint :\n' + '\n'.join([' ' + line for line in str(self.locHint).splitlines()])] + except ValueError: + str_list += ['locHint : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def ptr(self): + return self._ptr + @ptr.setter + def ptr(self, ptr): + cdef cydriver.CUdeviceptr cyptr + if ptr is None: + cyptr = 0 + elif isinstance(ptr, (CUdeviceptr)): + pptr = int(ptr) + cyptr = pptr + else: + pptr = int(CUdeviceptr(ptr)) + cyptr = pptr + self._ptr._pvt_ptr[0] = cyptr + + + + @property + def locHint(self): + return self._locHint + @locHint.setter + def locHint(self, locHint not None : CUmemLocation): + string.memcpy(&self._pvt_ptr[0].op.ptr.locHint, locHint.getPtr(), sizeof(self._pvt_ptr[0].op.ptr.locHint)) + + +cdef class anon_struct29: + """ + Attributes + ---------- + + id : CUlogicalEndpointId + + + + offset : cuuint64_t + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + self._id = CUlogicalEndpointId(_ptr=&self._pvt_ptr[0].op.le.id) + self._offset = cuuint64_t(_ptr=&self._pvt_ptr[0].op.le.offset) + def __dealloc__(self): + pass + def getPtr(self): + return &self._pvt_ptr[0].op.le + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['id : ' + str(self.id)] + except ValueError: + str_list += ['id : '] + + + try: + str_list += ['offset : ' + str(self.offset)] + except ValueError: + str_list += ['offset : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def id(self): + return self._id + @id.setter + def id(self, id): + cdef cydriver.CUlogicalEndpointId cyid + if id is None: + cyid = 0 + elif isinstance(id, (CUlogicalEndpointId)): + pid = int(id) + cyid = pid + else: + pid = int(CUlogicalEndpointId(id)) + cyid = pid + self._id._pvt_ptr[0] = cyid + + + + @property + def offset(self): + return self._offset + @offset.setter + def offset(self, offset): + cdef cydriver.cuuint64_t cyoffset + if offset is None: + cyoffset = 0 + elif isinstance(offset, (cuuint64_t)): + poffset = int(offset) + cyoffset = poffset + else: + poffset = int(cuuint64_t(offset)) + cyoffset = poffset + self._offset._pvt_ptr[0] = cyoffset + + + +cdef class anon_union22: + """ + Attributes + ---------- + + ptr : anon_struct28 + + + + le : anon_struct29 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr): + self._pvt_ptr = _ptr + + def __init__(self, void_ptr _ptr): + self._ptr = anon_struct28(_ptr=self._pvt_ptr) + self._ptr._owner = self + self._le = anon_struct29(_ptr=self._pvt_ptr) + self._le._owner = self + def __dealloc__(self): + self._ptr = None + self._le = None + def getPtr(self): + return &self._pvt_ptr[0].op + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['ptr :\n' + '\n'.join([' ' + line for line in str(self.ptr).splitlines()])] + except ValueError: + str_list += ['ptr : '] + + + try: + str_list += ['le :\n' + '\n'.join([' ' + line for line in str(self.le).splitlines()])] + except ValueError: + str_list += ['le : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def ptr(self): + return self._ptr + @ptr.setter + def ptr(self, ptr not None : anon_struct28): + string.memcpy(&self._pvt_ptr[0].op.ptr, ptr.getPtr(), sizeof(self._pvt_ptr[0].op.ptr)) + + + @property + def le(self): + return self._le + @le.setter + def le(self, le not None : anon_struct29): + string.memcpy(&self._pvt_ptr[0].op.le, le.getPtr(), sizeof(self._pvt_ptr[0].op.le)) + + +cdef class CUfabricCpyOperand_st: + """ + Struct representing an operand for copy with cuFabricCpyBatchAsync + + Attributes + ---------- + + type : CUfabricCpyOperandType + + + + op : anon_union22 + + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + def __cinit__(self, void_ptr _ptr = 0): + if _ptr == 0: + self._val_ptr = calloc(1, sizeof(cydriver.CUfabricCpyOperand_st)) + self._pvt_ptr = self._val_ptr + else: + self._pvt_ptr = _ptr + def __init__(self, void_ptr _ptr = 0): + self._op = anon_union22(_ptr=self._pvt_ptr) + self._op._owner = self + def __dealloc__(self): + self._op = None + if self._val_ptr is not NULL: + free(self._val_ptr) + 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 += ['op :\n' + '\n'.join([' ' + line for line in str(self.op).splitlines()])] + except ValueError: + str_list += ['op : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def type(self): + return CUfabricCpyOperandType(self._pvt_ptr[0].type) + @type.setter + def type(self, type not None : CUfabricCpyOperandType): + self._pvt_ptr[0].type = int(type) + + + @property + def op(self): + return self._op + @op.setter + def op(self, op not None : anon_union22): + string.memcpy(&self._pvt_ptr[0].op, op.getPtr(), sizeof(self._pvt_ptr[0].op)) + + cdef class CUdevSmResource_st: """ Attributes @@ -25160,7 +26228,7 @@ cdef class CUdevResource_st: string.memcpy(&self._nextResource[idx], (val[idx])._pvt_ptr, sizeof(cydriver.CUdevResource_st)) -cdef class anon_union21: +cdef class anon_union24: """ Attributes ---------- @@ -25240,7 +26308,7 @@ cdef class CUeglFrame_st: Attributes ---------- - frame : anon_union21 + frame : anon_union24 @@ -25292,7 +26360,7 @@ cdef class CUeglFrame_st: else: self._pvt_ptr = _ptr def __init__(self, void_ptr _ptr = 0): - self._frame = anon_union21(_ptr=self._pvt_ptr) + self._frame = anon_union24(_ptr=self._pvt_ptr) self._frame._owner = self def __dealloc__(self): self._frame = None @@ -25371,7 +26439,7 @@ cdef class CUeglFrame_st: def frame(self): return self._frame @frame.setter - def frame(self, frame not None : anon_union21): + def frame(self, frame not None : anon_union24): string.memcpy(&self._pvt_ptr[0].frame, frame.getPtr(), sizeof(self._pvt_ptr[0].frame)) @@ -25898,7 +26966,7 @@ def cuGetErrorName(error not None : CUresult): @cython.embedsignature(True) def cuInit(unsigned int Flags): - """ Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process. Currently, the `Flags` parameter must be 0. If :py:obj:`~.cuInit()` has not been called, any function from the driver API will return :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`. + """ Initialize the CUDA driver API Initializes the driver API and must be called before any other function from the driver API in the current process. Currently, the `Flags` parameter must be 0. If :py:obj:`~.cuInit()` has not been called, any function from the driver API will return :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`. Repeated calls to :py:obj:`~.cuInit()` have no additional effect. Note: cuInit preloads various libraries needed for JIT compilation. To opt-out of this behavior, set the environment variable @@ -38139,8 +39207,8 @@ def cuLogicalEndpointExport(leId, handleType not None : CUlogicalEndpointIpcHand that can be used to share the logical endpoint with other processes. The recipient process can convert the shareable handle back into a logical endpoint id using :py:obj:`~.cuLogicalEndpointImport`. The - implementation of what this `handle` is and how it can be transfered is - defined by the requested handle type in `handletype`. + implementation of what this `handle` is and how it can be transferred + is defined by the requested handle type in `handletype`. Parameters ---------- @@ -38330,6 +39398,103 @@ def cuLogicalEndpointQuery(leId, count): return (_CUresult(err), None) return (_CUresult_SUCCESS, queryStatus) +@cython.embedsignature(True) +def cuFabricCpyBatchAsync(size_t numOps, opList : Optional[tuple[CUDA_FABRIC_COPY_BATCH_OP] | list[CUDA_FABRIC_COPY_BATCH_OP]], unsigned long long flags, hStream): + """ Performs a batch of copies over a fabric asynchronously. + + The batch as a whole executes in stream order but copies within a batch + are not guaranteed to execute in any specific order. Specifying + dependent copies within a single batch results in undefined behavior. + + Performs copies as specified in the `opList` array. The length of this + array is specified in `numOps`. Each entry describes a copy operation + including source and destination operands + (:py:obj:`~.CUDA_FABRIC_COPY_BATCH_OP.src` and + :py:obj:`~.CUDA_FABRIC_COPY_BATCH_OP.dst`) and the size in bytes + (:py:obj:`~.CUDA_FABRIC_COPY_BATCH_OP.size`). A size of zero makes that + operation a no-op while preserving its position in the batch. Its + operands are still validated. + + The following operand type combinations are supported: + + - :py:obj:`~.CU_FABRIC_COPY_OPERAND_TYPE_POINTER` to + :py:obj:`~.CU_FABRIC_COPY_OPERAND_TYPE_POINTER`: Copy between two + device-accessible pointers. At least one operand must be local to the + stream's device. + + - :py:obj:`~.CU_FABRIC_COPY_OPERAND_TYPE_POINTER` to + :py:obj:`~.CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT`: -- copy + from a local pointer to a remote UNICAST or MULTICAST logical + endpoint at the specified offset. + + - :py:obj:`~.CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT` to + :py:obj:`~.CU_FABRIC_COPY_OPERAND_TYPE_POINTER`: -- copy from a + remote UNICAST logical endpoint at the specified offset to a local + pointer. + + A single batch may contain a heterogeneous mix of operation types. + + For a POINTER operand, :py:obj:`~.CUfabricCpyOperand.op.ptr.ptr` must + contain the pointer where the copy begins. For managed memory or + pageable memory on supported devices, + :py:obj:`~.CUfabricCpyOperand.op.ptr.locHint` may hint the location of + the operand. + + For a LOGICAL_ENDPOINT operand, :py:obj:`~.CUfabricCpyOperand.op.le.id` + specifies the logical endpoint and + :py:obj:`~.CUfabricCpyOperand.op.le.offset` specifies the byte offset + into that endpoint. + + \notes + + Parameters + ---------- + numOps : size_t + Total number of copy operations. + opList : list[:py:obj:`~.CUDA_FABRIC_COPY_BATCH_OP`] + Array of size `numOps` containing the copy operations. + flags : unsigned long long + Flags for future use, must be zero. + hStream : :py:obj:`~.CUstream` or :py:obj:`~.cudaStream_t` + Stream to enqueue the operations in. Must not be the legacy NULL + stream. + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_SUPPORTED` + + See Also + -------- + :py:obj:`~.cuLogicalEndpointCreate`, :py:obj:`~.cuLogicalEndpointBindAddr`, :py:obj:`~.cuLogicalEndpointBindMem` + """ + cdef cydriver.CUstream cyhStream + if hStream is None: + phStream = 0 + elif isinstance(hStream, (CUstream,)): + phStream = int(hStream) + else: + phStream = int(CUstream(hStream)) + cyhStream = phStream + opList = [] if opList is None else opList + if not all(isinstance(_x, (CUDA_FABRIC_COPY_BATCH_OP,)) for _x in opList): + raise TypeError("Argument 'opList' is not instance of type (expected tuple[cydriver.CUDA_FABRIC_COPY_BATCH_OP,] or list[cydriver.CUDA_FABRIC_COPY_BATCH_OP,]") + if numOps > len(opList): raise RuntimeError("List is too small: " + str(len(opList)) + " < " + str(numOps)) + cdef cydriver.CUDA_FABRIC_COPY_BATCH_OP* cyopList = NULL + if len(opList) > 1: + cyopList = calloc(len(opList), sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP)) + if cyopList is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(opList)) + 'x' + str(sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP))) + for idx in range(len(opList)): + string.memcpy(&cyopList[idx], (opList[idx])._pvt_ptr, sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP)) + elif len(opList) == 1: + cyopList = (opList[0])._pvt_ptr + with nogil: + err = cydriver.cuFabricCpyBatchAsync(numOps, cyopList, flags, cyhStream) + if len(opList) > 1 and cyopList is not NULL: + free(cyopList) + return (_CUresult(err),) + @cython.embedsignature(True) def cuPointerGetAttribute(attribute not None : CUpointer_attribute, ptr): """ Returns information about a pointer. @@ -39764,16 +40929,20 @@ def cuStreamBeginCaptureToCig(hStream, streamCigCaptureParams : Optional[CUstrea Support for CIG streams with D3D12 can be determined using :py:obj:`~.cuDeviceGetAttribute()` with - :py:obj:`~.CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED`. + :py:obj:`~.CU_DEVICE_ATTRIBUTE_D3D12_CIG_STREAMS_SUPPORTED`. Likewise + support for CIG streams with Vulkan can be determined using + :py:obj:`~.cuDeviceGetAttribute()` with + :py:obj:`~.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_STREAMS_SUPPORTED`. Begin CIG (CUDA in Graphics) capture on `hStream` for the graphics API as provided in `streamCigCaptureParams`. When a stream is in CIG capture mode, all operations pushed into the stream will not be executed, but will instead be captured into a graphics API command - list/command buffer. All kernel launches and memory copy/memory set - operations on the CIG stream will be recorded. When the command list is + list/buffer. All kernel launches and memory copy/memory set operations + on the CIG stream will be recorded. When the command list/buffer is executed by the graphics API, all the stream's operations will execute - in order along with other graphics API commands in the command list. + in order along with other graphics API commands in the command + list/buffer. CIG stream capture may not be initiated if `stream` is CU_STREAM_LEGACY. Capture must be ended on the same stream in which it @@ -39786,26 +40955,30 @@ def cuStreamBeginCaptureToCig(hStream, streamCigCaptureParams : Optional[CUstrea Data from the graphics client can be shared with CUDA via the `streamSharedData` in `streamCigCaptureParams`. The format of - `streamSharedData` is dependent on the type of the graphics client. For - D3D12, `streamSharedData` is an ID3D12CommandList object pointer. The - command list must be in ready state for recording commands whenever - kernels are launched on the stream. The command list provided must - belong to the graphics API device that the CIG context was created - with, otherwise the behavior will be undefined. + `sharedData` is dependent on the type of the graphics client. For + D3D12, `sharedData` is an ID3D12CommandList object pointer. For Vulkan, + `sharedData` is an internal NVIDIA handle obtained via + vkGetCommandBufferInternalHandleNV from the VK_NV_internal_handle + extension. A VkCommandBuffer cannot be passed directly. The command + buffer must be in the recording state whenever kernels are launched on + the stream. The command list/buffer provided must belong to a device + corresponding to the CIG context's device, otherwise the behavior will + be undefined. The stream object may not be destroyed until its associated command - list has finished executing on the GPU. The command list/command buffer - used for capture may not be submitted for execution before a call to + list/buffer has finished executing on the GPU. The command buffer used + for capture may not be submitted for execution before a call to :py:obj:`~.cuStreamEndCaptureToCig` is made on the associated stream. Graphics resources to be accessed by work recorded on the CIG stream - must use UAV barriers on the command list prior to recording work that - accesses them on the stream. + must use UAV/pipeline barriers on the command list/buffer prior to + recording work that accesses them on the stream. - Resubmission of the same recorded command list is not allowed. Further - more, care must be taken for the order of execution of the recorded - CUDA work with regards to other CUDA work submitted under the same CIG - context. Out-of-order execution can lead to device hangs or exceptions. + Resubmission of the same recorded command list/buffer is not allowed. + Further more, care must be taken for the order of execution of the + recorded CUDA work with regards to other CUDA work submitted under the + same CIG context. Out-of-order execution can lead to device hangs or + exceptions. CIG capture mode operates similarly to `cuStreamBeginCapture` with the `CU_STREAM_CAPTURE_MODE_RELAXED` option. There are additional @@ -41183,7 +42356,7 @@ def cuStreamDestroy(hStream): Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` :py:obj:`~.CUDA_ERROR_EXTERNAL_DEVICE` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` See Also -------- @@ -41797,7 +42970,7 @@ 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 platform starting + Importing a dma_buf object is supported on Tegra platforms starting with Thor series. Mapping an imported dma_buf object as CUDA mipmapped array using :py:obj:`~.cuExternalMemoryGetMappedMipmappedArray` is not supported. @@ -41886,7 +43059,7 @@ def cuExternalMemoryGetMappedBuffer(extMem, bufferDesc : Optional[CUDA_EXTERNAL_ Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_ALREADY_MAPPED`, :py:obj:`~.CUDA_ERROR_INVALID_HANDLE` devPtr : :py:obj:`~.CUdeviceptr` Returned device pointer to buffer @@ -44799,6 +45972,8 @@ def cuGraphAddKernelNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li Notes ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. + Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. """ dependencies = [] if dependencies is None else dependencies @@ -44863,6 +46038,10 @@ def cuGraphKernelNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphKernelNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -44900,6 +46079,10 @@ def cuGraphKernelNodeSetParams(hNode, nodeParams : Optional[CUDA_KERNEL_NODE_PAR See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphKernelNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -44961,6 +46144,10 @@ def cuGraphAddMemcpyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuGraphMemcpyNodeGetParams`, :py:obj:`~.cuGraphMemcpyNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ cdef cydriver.CUcontext cyctx if ctx is None: @@ -45023,6 +46210,10 @@ def cuGraphMemcpyNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphMemcpyNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45060,6 +46251,10 @@ def cuGraphMemcpyNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMCPY3D]): See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuMemcpy3D`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphMemcpyNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45111,6 +46306,10 @@ def cuGraphAddMemsetNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | li See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuGraphMemsetNodeGetParams`, :py:obj:`~.cuGraphMemsetNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ cdef cydriver.CUcontext cyctx if ctx is None: @@ -45173,6 +46372,10 @@ def cuGraphMemsetNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphMemsetNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45210,6 +46413,10 @@ def cuGraphMemsetNodeSetParams(hNode, nodeParams : Optional[CUDA_MEMSET_NODE_PAR See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuMemsetD2D32`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphMemsetNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45259,6 +46466,10 @@ def cuGraphAddHostNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | list See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuLaunchHostFunc`, :py:obj:`~.cuGraphHostNodeGetParams`, :py:obj:`~.cuGraphHostNodeSetParams`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): @@ -45313,6 +46524,10 @@ def cuGraphHostNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuLaunchHostFunc`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphHostNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45350,6 +46565,10 @@ def cuGraphHostNodeSetParams(hNode, nodeParams : Optional[CUDA_HOST_NODE_PARAMS] See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuLaunchHostFunc`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphHostNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45402,6 +46621,10 @@ def cuGraphAddChildGraphNode(hGraph, dependencies : Optional[tuple[CUgraphNode] See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphChildGraphNodeGetGraph`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphClone` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ cdef cydriver.CUgraph cychildGraph if childGraph is None: @@ -45468,6 +46691,10 @@ def cuGraphChildGraphNodeGetGraph(hNode): See Also -------- :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphNodeFindInClone` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45520,6 +46747,10 @@ def cuGraphAddEmptyNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | lis See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): @@ -45587,6 +46818,10 @@ def cuGraphAddEventRecordNode(hGraph, dependencies : Optional[tuple[CUgraphNode] See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ cdef cydriver.CUevent cyevent if event is None: @@ -45648,6 +46883,10 @@ def cuGraphEventRecordNodeGetEvent(hNode): See Also -------- :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphEventRecordNodeSetEvent`, :py:obj:`~.cuGraphEventWaitNodeGetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45688,6 +46927,8 @@ def cuGraphEventRecordNodeSetEvent(hNode, event): Notes ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. + This function will reset the node's context to the event's device context. """ cdef cydriver.CUevent cyevent @@ -45747,6 +46988,10 @@ def cuGraphAddEventWaitNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ cdef cydriver.CUevent cyevent if event is None: @@ -45808,6 +47053,10 @@ def cuGraphEventWaitNodeGetEvent(hNode): See Also -------- :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphEventWaitNodeSetEvent`, :py:obj:`~.cuGraphEventRecordNodeGetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -45845,6 +47094,10 @@ def cuGraphEventWaitNodeSetEvent(hNode, event): See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphEventWaitNodeGetEvent`, :py:obj:`~.cuGraphEventRecordNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUevent cyevent if event is None: @@ -45902,6 +47155,10 @@ def cuGraphAddExternalSemaphoresSignalNode(hGraph, dependencies : Optional[tuple See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeGetParams`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): @@ -45962,6 +47219,10 @@ def cuGraphExternalSemaphoresSignalNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46000,6 +47261,10 @@ def cuGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[CU See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46050,6 +47315,10 @@ def cuGraphAddExternalSemaphoresWaitNode(hGraph, dependencies : Optional[tuple[C See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeGetParams`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): @@ -46110,6 +47379,10 @@ def cuGraphExternalSemaphoresWaitNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuLaunchKernel`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46148,6 +47421,10 @@ def cuGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[CUDA See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46200,6 +47477,8 @@ def cuGraphAddBatchMemOpNode(hGraph, dependencies : Optional[tuple[CUgraphNode] Notes ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. + Warning: Improper use of this API may deadlock the application. Synchronization ordering established through this API is not visible to CUDA. CUDA tasks that are (even indirectly) ordered by this API should also have that order expressed with CUDA-visible dependencies such as events. This ensures that the scheduler does not serialize them in an improper order. """ dependencies = [] if dependencies is None else dependencies @@ -46260,6 +47539,10 @@ def cuGraphBatchMemOpNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuGraphAddBatchMemOpNode`, :py:obj:`~.cuGraphBatchMemOpNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46300,6 +47583,10 @@ def cuGraphBatchMemOpNodeSetParams(hNode, nodeParams : Optional[CUDA_BATCH_MEM_O See Also -------- :py:obj:`~.cuGraphNodeSetParams`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuGraphAddBatchMemOpNode`, :py:obj:`~.cuGraphBatchMemOpNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46360,6 +47647,10 @@ def cuGraphExecBatchMemOpNodeSetParams(hGraphExec, hNode, nodeParams : Optional[ See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuStreamBatchMemOp`, :py:obj:`~.cuGraphAddBatchMemOpNode`, :py:obj:`~.cuGraphBatchMemOpNodeGetParams`, :py:obj:`~.cuGraphBatchMemOpNodeSetParams`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46458,6 +47749,10 @@ def cuGraphAddMemAllocNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddMemFreeNode`, :py:obj:`~.cuGraphMemAllocNodeGetParams`, :py:obj:`~.cuDeviceGraphMemTrim`, :py:obj:`~.cuDeviceGetGraphMemAttribute`, :py:obj:`~.cuDeviceSetGraphMemAttribute`, :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ dependencies = [] if dependencies is None else dependencies if not all(isinstance(_x, (CUgraphNode,)) for _x in dependencies): @@ -46515,6 +47810,10 @@ def cuGraphMemAllocNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuGraphAddMemAllocNode`, :py:obj:`~.cuGraphMemFreeNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -46584,6 +47883,10 @@ def cuGraphAddMemFreeNode(hGraph, dependencies : Optional[tuple[CUgraphNode] | l See Also -------- :py:obj:`~.cuGraphAddNode`, :py:obj:`~.cuGraphAddMemAllocNode`, :py:obj:`~.cuGraphMemFreeNodeGetParams`, :py:obj:`~.cuDeviceGraphMemTrim`, :py:obj:`~.cuDeviceGetGraphMemAttribute`, :py:obj:`~.cuDeviceSetGraphMemAttribute`, :py:obj:`~.cuMemAllocAsync`, :py:obj:`~.cuMemFreeAsync`, :py:obj:`~.cuGraphCreate`, :py:obj:`~.cuGraphDestroyNode`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphAddEmptyNode`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphAddNode`. """ cdef cydriver.CUdeviceptr cydptr if dptr is None: @@ -46645,6 +47948,10 @@ def cuGraphMemFreeNodeGetParams(hNode): See Also -------- :py:obj:`~.cuGraphNodeGetParams`, :py:obj:`~.cuGraphAddMemFreeNode`, :py:obj:`~.cuGraphMemAllocNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphNodeGetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -48052,6 +49359,10 @@ def cuGraphExecKernelNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddKernelNode`, :py:obj:`~.cuGraphKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -48116,6 +49427,10 @@ def cuGraphExecMemcpyNodeSetParams(hGraphExec, hNode, copyParams : Optional[CUDA See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddMemcpyNode`, :py:obj:`~.cuGraphMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUcontext cyctx if ctx is None: @@ -48193,6 +49508,10 @@ def cuGraphExecMemsetNodeSetParams(hGraphExec, hNode, memsetParams : Optional[CU See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddMemsetNode`, :py:obj:`~.cuGraphMemsetNodeSetParams`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUcontext cyctx if ctx is None: @@ -48253,6 +49572,10 @@ def cuGraphExecHostNodeSetParams(hGraphExec, hNode, nodeParams : Optional[CUDA_H See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddHostNode`, :py:obj:`~.cuGraphHostNodeSetParams`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -48313,6 +49636,10 @@ def cuGraphExecChildGraphNodeSetParams(hGraphExec, hNode, childGraph): See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddChildGraphNode`, :py:obj:`~.cuGraphChildGraphNodeGetGraph`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUgraph cychildGraph if childGraph is None: @@ -48373,6 +49700,10 @@ def cuGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddEventRecordNode`, :py:obj:`~.cuGraphEventRecordNodeGetEvent`, :py:obj:`~.cuGraphEventWaitNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUevent cyevent if event is None: @@ -48433,6 +49764,10 @@ def cuGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddEventWaitNode`, :py:obj:`~.cuGraphEventWaitNodeGetEvent`, :py:obj:`~.cuGraphEventRecordNodeSetEvent`, :py:obj:`~.cuEventRecordWithFlags`, :py:obj:`~.cuStreamWaitEvent`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUevent cyevent if event is None: @@ -48497,6 +49832,10 @@ def cuGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePara See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -48554,6 +49893,10 @@ def cuGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodeParams See Also -------- :py:obj:`~.cuGraphExecNodeSetParams`, :py:obj:`~.cuGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cuImportExternalSemaphore`, :py:obj:`~.cuSignalExternalSemaphoresAsync`, :py:obj:`~.cuWaitExternalSemaphoresAsync`, :py:obj:`~.cuGraphExecKernelNodeSetParams`, :py:obj:`~.cuGraphExecMemcpyNodeSetParams`, :py:obj:`~.cuGraphExecMemsetNodeSetParams`, :py:obj:`~.cuGraphExecHostNodeSetParams`, :py:obj:`~.cuGraphExecChildGraphNodeSetParams`, :py:obj:`~.cuGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cuGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cuGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cuGraphExecNodeSetParams`. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -48617,10 +49960,6 @@ def cuGraphNodeSetEnabled(hGraphExec, hNode, unsigned int isEnabled): See Also -------- :py:obj:`~.cuGraphNodeGetEnabled`, :py:obj:`~.cuGraphExecUpdate`, :py:obj:`~.cuGraphInstantiate` :py:obj:`~.cuGraphLaunch` - - Notes - ----- - Currently only kernel, memset and memcpy nodes are supported. """ cdef cydriver.CUgraphNode cyhNode if hNode is None: @@ -48673,8 +50012,6 @@ def cuGraphNodeGetEnabled(hGraphExec, hNode): Notes ----- - Currently only kernel, memset and memcpy nodes are supported. - This function will not reflect device-side updates for device-updatable kernel nodes. """ cdef cydriver.CUgraphNode cyhNode @@ -52139,6 +53476,8 @@ def cuTensorMapEncodeTiled(tensorDataType not None : CUtensorMapDataType, tensor Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX. + Encoding resolves the descriptor allocation class using + :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_AUTO`. The parameters passed are bound to the following requirements: @@ -52445,6 +53784,8 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso Tensor map objects are only supported on devices of compute capability 9.0 or higher. Additionally, a tensor map object is an opaque value, and, as such, should only be accessed through CUDA APIs and PTX. + Encoding resolves the descriptor allocation class using + :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_AUTO`. The parameters passed are bound to the following requirements: @@ -52763,381 +54104,455 @@ def cuTensorMapEncodeIm2col(tensorDataType not None : CUtensorMapDataType, tenso cdef cydriver.CUtensorMapDataType cytensorDataType = int(tensorDataType) cdef _HelperInputVoidPtrStruct cyglobalAddressHelper cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) - cdef vector[int] cypixelBoxLowerCorner = pixelBoxLowerCorner - cdef vector[int] cypixelBoxUpperCorner = pixelBoxUpperCorner + cdef vector[int] cypixelBoxLowerCorner = pixelBoxLowerCorner + cdef vector[int] cypixelBoxUpperCorner = pixelBoxUpperCorner + cdef cydriver.CUtensorMapInterleave cyinterleave = int(interleave) + cdef cydriver.CUtensorMapSwizzle cyswizzle = int(swizzle) + cdef cydriver.CUtensorMapL2promotion cyl2Promotion = int(l2Promotion) + cdef cydriver.CUtensorMapFloatOOBfill cyoobFill = int(oobFill) + with nogil: + err = cydriver.cuTensorMapEncodeIm2col(tensorMap._pvt_ptr, cytensorDataType, cytensorRank, cyglobalAddress, cyglobalDim, cyglobalStrides, cypixelBoxLowerCorner.data(), cypixelBoxUpperCorner.data(), cychannelsPerPixel, cypixelsPerColumn, cyelementStrides, cyinterleave, cyswizzle, cyl2Promotion, cyoobFill) + _helper_input_void_ptr_free(&cyglobalAddressHelper) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, tensorMap) + +@cython.embedsignature(True) +def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, mode not None : CUtensorMapIm2ColWideMode, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): + """ Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension. + + Creates a descriptor for Tensor Memory Access (TMA) object specified by + the parameters describing a im2col memory layout and where the row is + always loaded along the W dimensuin and returns it in `tensorMap`. This + assumes the tensor layout in memory is either NDHWC, NHWC, or NWC. + + This API is only supported on devices of compute capability 10.0 or + higher. Additionally, a tensor map object is an opaque value, and, as + such, should only be accessed through CUDA APIs and PTX. Encoding + resolves the descriptor allocation class using + :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_AUTO`. + + The parameters passed are bound to the following requirements: + + - `tensorMap` address must be aligned to 64 bytes. + + - `tensorDataType` has to be an enum from + :py:obj:`~.CUtensorMapDataType` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B` copies '16 x U4' + packed values to memory aligned as 8 bytes. There are no gaps between + packed values. :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B` + copies '16 x U4' packed values to memory aligned as 16 bytes. There + are 8 byte gaps between every 8 byte chunk of packed values. + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` copies '16 x U6' + packed values to memory aligned as 16 bytes. There are 4 byte gaps + between every 12 byte chunk of packed values. + + - `tensorRank`, which specifies the number of tensor dimensions, must + be 3, 4, or 5. + + - `globalAddress`, which specifies the starting address of the memory + region described, must be 16 byte aligned. The following requirements + need to also be met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, + `globalAddress` must be 32 byte aligned. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `globalAddress` + must be 32 byte aligned. + + `globalDim` array, which specifies tensor size of each of the + `tensorRank` dimensions, must be non-zero and less than or equal to + 2^32. Additionally, the following requirements need to be met for the + packed data types: + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, globalDim[0] must + be a multiple of 128. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, `globalDim`[0] must + be a multiple of 2. + + - Dimension for the packed data types must reflect the number of + individual U# values. + + `globalStrides` array, which specifies tensor stride of each of the + lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 + and less than 2^40. Additionally, the following requirements need to be + met: + + - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, the + strides must be a multiple of 32. + + - When `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, the strides must + be a multiple of 32. Each following dimension specified includes + previous dimension stride: + + - **View CUDA Toolkit Documentation for a C++ code example** + + `pixelBoxLowerCornerWidth` specifies the coordinate offset W of the + bounding box from left corner. The offset must be within range [-32768, + 32767]. + + - `pixelBoxUpperCornerWidth` specifies the coordinate offset W of the + bounding box from right corner. The offset must be within range + [-32768, 32767]. + + The bounding box specified by `pixelBoxLowerCornerWidth` and + `pixelBoxUpperCornerWidth` must have non-zero area. Note that the size + of the box along D and H dimensions is always equal to one. + + - `channelsPerPixel`, which specifies the number of elements which must + be accessed along C dimension, must be less than or equal to 256. + Additionally, when `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `channelsPerPixel` + must be 128. + + - `pixelsPerColumn`, which specifies the number of elements that must + be accessed along the W dimension, must be less than or equal to + 1024. This field is ignored when `mode` is + :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128`. + + - `elementStrides` array, which specifies the iteration step along each + of the `tensorRank` dimensions, must be non-zero and less than or + equal to 8. Note that when `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the first element of this + array is ignored since TMA doesn’t support the stride for dimension + zero. When all elements of the `elementStrides` array are one, + `boxDim` specifies the number of elements to load. However, if + `elementStrides`[i] is not equal to one for some `i`, then TMA loads + ceil( `boxDim`[i] / `elementStrides`[i]) number of elements along + i-th dimension. To load N elements along i-th dimension, `boxDim`[i] + must be set to N * `elementStrides`[i]. + + - `interleave` specifies the interleaved layout of type + :py:obj:`~.CUtensorMapInterleave`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 + bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 + uses 32 bytes. When `interleave` is + :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the bounding box inner + dimension (computed as `channelsPerPixel` multiplied by element size + in bytes derived from `tensorDataType`) must be less than or equal to + the swizzle size. + + - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension + to be <= 64. + + - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner + dimension to be <= 128. Additionally, `tensorDataType` of + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` requires + `interleave` to be :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`. + + - `mode`, which describes loading of elements loaded along the W + dimension, has to be one of the following + :py:obj:`~.CUtensorMapIm2ColWideMode` types: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W` allows the number of + elements loaded along the W dimension to be specified via the + `pixelsPerColumn` field. + + - `swizzle`, which specifies the shared memory bank swizzling pattern, + must be one of the following :py:obj:`~.CUtensorMapSwizzle` modes + (other swizzle modes are not supported): + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Data are organized in a specific order in global memory; however, + this may not match the order in which the application accesses data + in shared memory. This difference in data organization may cause bank + conflicts when shared memory is accessed. In order to avoid this + problem, data can be loaded to shared memory with shuffling across + shared memory banks. When the `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`, only the following + swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_64B (Store only) + + - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) When the + `tensorDataType` is + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, only the + following swizzle modes are supported: + + - CU_TENSOR_MAP_SWIZZLE_128B (Load only) + + - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) + + Additionally, :py:obj:`~.CU_TENSOR_MAP_SWIZZLE_96B` is supported only + when `mode` is :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W`. + + - `l2Promotion` specifies L2 fetch size which indicates the byte + granularity at which L2 requests are filled from DRAM. It must be of + type :py:obj:`~.CUtensorMapL2promotion`, which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - `oobFill`, which indicates whether zero or a special NaN constant + should be used to fill out-of-bound elements, must be of type + :py:obj:`~.CUtensorMapFloatOOBfill` which is defined as: + + - **View CUDA Toolkit Documentation for a C++ code example** + + - Note that + :py:obj:`~.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA` can + only be used when `tensorDataType` represents a floating-point data + type, and when `tensorDataType` is not + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, and + :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`. + + Parameters + ---------- + tensorDataType : :py:obj:`~.CUtensorMapDataType` + Tensor data type + tensorRank : Any + Dimensionality of tensor; must be at least 3 + globalAddress : Any + Starting address of memory region described by tensor + globalDim : list[:py:obj:`~.cuuint64_t`] + Array containing tensor size (number of elements) along each of the + `tensorRank` dimensions + globalStrides : list[:py:obj:`~.cuuint64_t`] + Array containing stride size (in bytes) along each of the + `tensorRank` - 1 dimensions + pixelBoxLowerCornerWidth : int + Width offset of left box corner + pixelBoxUpperCornerWidth : int + Width offset of right box corner + channelsPerPixel : Any + Number of channels per pixel + pixelsPerColumn : Any + Number of pixels per column + elementStrides : list[:py:obj:`~.cuuint32_t`] + Array containing traversal stride in each of the `tensorRank` + dimensions + interleave : :py:obj:`~.CUtensorMapInterleave` + Type of interleaved layout the tensor addresses + mode : :py:obj:`~.CUtensorMapIm2ColWideMode` + W or W128 mode + swizzle : :py:obj:`~.CUtensorMapSwizzle` + Bank swizzling pattern inside shared memory + l2Promotion : :py:obj:`~.CUtensorMapL2promotion` + L2 promotion size + oobFill : :py:obj:`~.CUtensorMapFloatOOBfill` + Indicate whether zero or special NaN constant will be used to fill + out-of-bound elements + + Returns + ------- + CUresult + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + tensorMap : :py:obj:`~.CUtensorMap` + Tensor map object to create + + See Also + -------- + :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapReplaceAddress` + """ + cdef cydriver.cuuint32_t* cyelementStrides + cdef size_t elementStridesLen + cdef cydriver.cuuint32_t[5] elementStridesStatic + elementStridesLen = 0 if elementStrides is None else len(elementStrides) + if elementStridesLen == 0: + cyelementStrides = NULL + elif elementStridesLen == 1: + cyelementStrides = ( elementStrides[0])._pvt_ptr + elif elementStridesLen <= 5: + for idx in range(elementStridesLen): + elementStridesStatic[idx] = ( elementStrides[idx])._pvt_ptr[0] + cyelementStrides = elementStridesStatic + else: + raise ValueError("Argument 'elementStrides' too long, must be <= 5") + cdef cydriver.cuuint32_t cypixelsPerColumn + if pixelsPerColumn is None: + ppixelsPerColumn = 0 + elif isinstance(pixelsPerColumn, (cuuint32_t,)): + ppixelsPerColumn = int(pixelsPerColumn) + else: + ppixelsPerColumn = int(cuuint32_t(pixelsPerColumn)) + cypixelsPerColumn = ppixelsPerColumn + cdef cydriver.cuuint32_t cychannelsPerPixel + if channelsPerPixel is None: + pchannelsPerPixel = 0 + elif isinstance(channelsPerPixel, (cuuint32_t,)): + pchannelsPerPixel = int(channelsPerPixel) + else: + pchannelsPerPixel = int(cuuint32_t(channelsPerPixel)) + cychannelsPerPixel = pchannelsPerPixel + cdef cydriver.cuuint64_t* cyglobalStrides + cdef size_t globalStridesLen + cdef cydriver.cuuint64_t[5] globalStridesStatic + globalStridesLen = 0 if globalStrides is None else len(globalStrides) + if globalStridesLen == 0: + cyglobalStrides = NULL + elif globalStridesLen == 1: + cyglobalStrides = ( globalStrides[0])._pvt_ptr + elif globalStridesLen <= 5: + for idx in range(globalStridesLen): + globalStridesStatic[idx] = ( globalStrides[idx])._pvt_ptr[0] + cyglobalStrides = globalStridesStatic + else: + raise ValueError("Argument 'globalStrides' too long, must be <= 5") + cdef cydriver.cuuint64_t* cyglobalDim + cdef size_t globalDimLen + cdef cydriver.cuuint64_t[5] globalDimStatic + globalDimLen = 0 if globalDim is None else len(globalDim) + if globalDimLen == 0: + cyglobalDim = NULL + elif globalDimLen == 1: + cyglobalDim = ( globalDim[0])._pvt_ptr + elif globalDimLen <= 5: + for idx in range(globalDimLen): + globalDimStatic[idx] = ( globalDim[idx])._pvt_ptr[0] + cyglobalDim = globalDimStatic + else: + raise ValueError("Argument 'globalDim' too long, must be <= 5") + cdef cydriver.cuuint32_t cytensorRank + if tensorRank is None: + ptensorRank = 0 + elif isinstance(tensorRank, (cuuint32_t,)): + ptensorRank = int(tensorRank) + else: + ptensorRank = int(cuuint32_t(tensorRank)) + cytensorRank = ptensorRank + cdef CUtensorMap tensorMap = CUtensorMap() + cdef cydriver.CUtensorMapDataType cytensorDataType = int(tensorDataType) + cdef _HelperInputVoidPtrStruct cyglobalAddressHelper + cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) cdef cydriver.CUtensorMapInterleave cyinterleave = int(interleave) + cdef cydriver.CUtensorMapIm2ColWideMode cymode = int(mode) cdef cydriver.CUtensorMapSwizzle cyswizzle = int(swizzle) cdef cydriver.CUtensorMapL2promotion cyl2Promotion = int(l2Promotion) cdef cydriver.CUtensorMapFloatOOBfill cyoobFill = int(oobFill) with nogil: - err = cydriver.cuTensorMapEncodeIm2col(tensorMap._pvt_ptr, cytensorDataType, cytensorRank, cyglobalAddress, cyglobalDim, cyglobalStrides, cypixelBoxLowerCorner.data(), cypixelBoxUpperCorner.data(), cychannelsPerPixel, cypixelsPerColumn, cyelementStrides, cyinterleave, cyswizzle, cyl2Promotion, cyoobFill) + err = cydriver.cuTensorMapEncodeIm2colWide(tensorMap._pvt_ptr, cytensorDataType, cytensorRank, cyglobalAddress, cyglobalDim, cyglobalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, cychannelsPerPixel, cypixelsPerColumn, cyelementStrides, cyinterleave, cymode, cyswizzle, cyl2Promotion, cyoobFill) _helper_input_void_ptr_free(&cyglobalAddressHelper) if err != cydriver.CUDA_SUCCESS: return (_CUresult(err), None) return (_CUresult_SUCCESS, tensorMap) @cython.embedsignature(True) -def cuTensorMapEncodeIm2colWide(tensorDataType not None : CUtensorMapDataType, tensorRank, globalAddress, globalDim : Optional[tuple[cuuint64_t] | list[cuuint64_t]], globalStrides : Optional[tuple[cuuint64_t] | list[cuuint64_t]], int pixelBoxLowerCornerWidth, int pixelBoxUpperCornerWidth, channelsPerPixel, pixelsPerColumn, elementStrides : Optional[tuple[cuuint32_t] | list[cuuint32_t]], interleave not None : CUtensorMapInterleave, mode not None : CUtensorMapIm2ColWideMode, swizzle not None : CUtensorMapSwizzle, l2Promotion not None : CUtensorMapL2promotion, oobFill not None : CUtensorMapFloatOOBfill): - """ Create a tensor map descriptor object representing im2col memory region, but where the elements are exclusively loaded along the W dimension. - - Creates a descriptor for Tensor Memory Access (TMA) object specified by - the parameters describing a im2col memory layout and where the row is - always loaded along the W dimensuin and returns it in `tensorMap`. This - assumes the tensor layout in memory is either NDHWC, NHWC, or NWC. - - This API is only supported on devices of compute capability 10.0 or - higher. Additionally, a tensor map object is an opaque value, and, as - such, should only be accessed through CUDA APIs and PTX. - - The parameters passed are bound to the following requirements: - - - `tensorMap` address must be aligned to 64 bytes. - - - `tensorDataType` has to be an enum from - :py:obj:`~.CUtensorMapDataType` which is defined as: - - - **View CUDA Toolkit Documentation for a C++ code example** - - - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B` copies '16 x U4' - packed values to memory aligned as 8 bytes. There are no gaps between - packed values. :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B` - copies '16 x U4' packed values to memory aligned as 16 bytes. There - are 8 byte gaps between every 8 byte chunk of packed values. - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` copies '16 x U6' - packed values to memory aligned as 16 bytes. There are 4 byte gaps - between every 12 byte chunk of packed values. - - - `tensorRank`, which specifies the number of tensor dimensions, must - be 3, 4, or 5. - - - `globalAddress`, which specifies the starting address of the memory - region described, must be 16 byte aligned. The following requirements - need to also be met: - - - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, - `globalAddress` must be 32 byte aligned. - - - When `tensorDataType` is - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `globalAddress` - must be 32 byte aligned. - - `globalDim` array, which specifies tensor size of each of the - `tensorRank` dimensions, must be non-zero and less than or equal to - 2^32. Additionally, the following requirements need to be met for the - packed data types: - - - When `tensorDataType` is - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, globalDim[0] must - be a multiple of 128. - - - When `tensorDataType` is - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, `globalDim`[0] must - be a multiple of 2. - - - Dimension for the packed data types must reflect the number of - individual U# values. - - `globalStrides` array, which specifies tensor stride of each of the - lower `tensorRank` - 1 dimensions in bytes, must be a multiple of 16 - and less than 2^40. Additionally, the following requirements need to be - met: - - - When `interleave` is :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_32B`, the - strides must be a multiple of 32. - - - When `tensorDataType` is - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, the strides must - be a multiple of 32. Each following dimension specified includes - previous dimension stride: - - - **View CUDA Toolkit Documentation for a C++ code example** - - `pixelBoxLowerCornerWidth` specifies the coordinate offset W of the - bounding box from left corner. The offset must be within range [-32768, - 32767]. - - - `pixelBoxUpperCornerWidth` specifies the coordinate offset W of the - bounding box from right corner. The offset must be within range - [-32768, 32767]. - - The bounding box specified by `pixelBoxLowerCornerWidth` and - `pixelBoxUpperCornerWidth` must have non-zero area. Note that the size - of the box along D and H dimensions is always equal to one. - - - `channelsPerPixel`, which specifies the number of elements which must - be accessed along C dimension, must be less than or equal to 256. - Additionally, when `tensorDataType` is - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` or - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, `channelsPerPixel` - must be 128. - - - `pixelsPerColumn`, which specifies the number of elements that must - be accessed along the W dimension, must be less than or equal to - 1024. This field is ignored when `mode` is - :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128`. - - - `elementStrides` array, which specifies the iteration step along each - of the `tensorRank` dimensions, must be non-zero and less than or - equal to 8. Note that when `interleave` is - :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the first element of this - array is ignored since TMA doesn’t support the stride for dimension - zero. When all elements of the `elementStrides` array are one, - `boxDim` specifies the number of elements to load. However, if - `elementStrides`[i] is not equal to one for some `i`, then TMA loads - ceil( `boxDim`[i] / `elementStrides`[i]) number of elements along - i-th dimension. To load N elements along i-th dimension, `boxDim`[i] - must be set to N * `elementStrides`[i]. - - - `interleave` specifies the interleaved layout of type - :py:obj:`~.CUtensorMapInterleave`, which is defined as: - - - **View CUDA Toolkit Documentation for a C++ code example** - - - TMA supports interleaved layouts like NC/8HWC8 where C8 utilizes 16 - bytes in memory assuming 2 byte per channel or NC/16HWC16 where C16 - uses 32 bytes. When `interleave` is - :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`, the bounding box inner - dimension (computed as `channelsPerPixel` multiplied by element size - in bytes derived from `tensorDataType`) must be less than or equal to - the swizzle size. - - - CU_TENSOR_MAP_SWIZZLE_64B requires the bounding box inner dimension - to be <= 64. - - - CU_TENSOR_MAP_SWIZZLE_128B* require the bounding box inner - dimension to be <= 128. Additionally, `tensorDataType` of - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B` requires - `interleave` to be :py:obj:`~.CU_TENSOR_MAP_INTERLEAVE_NONE`. - - - `mode`, which describes loading of elements loaded along the W - dimension, has to be one of the following - :py:obj:`~.CUtensorMapIm2ColWideMode` types: - - - **View CUDA Toolkit Documentation for a C++ code example** - - - :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W` allows the number of - elements loaded along the W dimension to be specified via the - `pixelsPerColumn` field. - - - `swizzle`, which specifies the shared memory bank swizzling pattern, - must be one of the following :py:obj:`~.CUtensorMapSwizzle` modes - (other swizzle modes are not supported): - - - **View CUDA Toolkit Documentation for a C++ code example** - - - Data are organized in a specific order in global memory; however, - this may not match the order in which the application accesses data - in shared memory. This difference in data organization may cause bank - conflicts when shared memory is accessed. In order to avoid this - problem, data can be loaded to shared memory with shuffling across - shared memory banks. When the `tensorDataType` is - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`, only the following - swizzle modes are supported: - - - CU_TENSOR_MAP_SWIZZLE_64B (Store only) - - - CU_TENSOR_MAP_SWIZZLE_128B (Load & Store) - - - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load & Store) When the - `tensorDataType` is - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, only the - following swizzle modes are supported: - - - CU_TENSOR_MAP_SWIZZLE_128B (Load only) - - - CU_TENSOR_MAP_SWIZZLE_128B_ATOM_32B (Load only) - - Additionally, :py:obj:`~.CU_TENSOR_MAP_SWIZZLE_96B` is supported only - when `mode` is :py:obj:`~.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W`. - - - `l2Promotion` specifies L2 fetch size which indicates the byte - granularity at which L2 requests are filled from DRAM. It must be of - type :py:obj:`~.CUtensorMapL2promotion`, which is defined as: - - - **View CUDA Toolkit Documentation for a C++ code example** - - - `oobFill`, which indicates whether zero or a special NaN constant - should be used to fill out-of-bound elements, must be of type - :py:obj:`~.CUtensorMapFloatOOBfill` which is defined as: +def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): + """ Modify an existing tensor map descriptor with an updated global address. - - **View CUDA Toolkit Documentation for a C++ code example** + Modifies the descriptor for Tensor Memory Access (TMA) object passed in + `tensorMap` with an updated `globalAddress`. - - Note that - :py:obj:`~.CU_TENSOR_MAP_FLOAT_OOB_FILL_NAN_REQUEST_ZERO_FMA` can - only be used when `tensorDataType` represents a floating-point data - type, and when `tensorDataType` is not - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN8B`, - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U4_ALIGN16B`, and - :py:obj:`~.CU_TENSOR_MAP_DATA_TYPE_16U6_ALIGN16B`. + Tensor map objects are only supported on devices of compute capability + 9.0 or higher. Additionally, a tensor map object is an opaque value, + and, as such, should only be accessed through CUDA API calls. Parameters ---------- - tensorDataType : :py:obj:`~.CUtensorMapDataType` - Tensor data type - tensorRank : Any - Dimensionality of tensor; must be at least 3 + tensorMap : :py:obj:`~.CUtensorMap` + Tensor map object to modify globalAddress : Any - Starting address of memory region described by tensor - globalDim : list[:py:obj:`~.cuuint64_t`] - Array containing tensor size (number of elements) along each of the - `tensorRank` dimensions - globalStrides : list[:py:obj:`~.cuuint64_t`] - Array containing stride size (in bytes) along each of the - `tensorRank` - 1 dimensions - pixelBoxLowerCornerWidth : int - Width offset of left box corner - pixelBoxUpperCornerWidth : int - Width offset of right box corner - channelsPerPixel : Any - Number of channels per pixel - pixelsPerColumn : Any - Number of pixels per column - elementStrides : list[:py:obj:`~.cuuint32_t`] - Array containing traversal stride in each of the `tensorRank` - dimensions - interleave : :py:obj:`~.CUtensorMapInterleave` - Type of interleaved layout the tensor addresses - mode : :py:obj:`~.CUtensorMapIm2ColWideMode` - W or W128 mode - swizzle : :py:obj:`~.CUtensorMapSwizzle` - Bank swizzling pattern inside shared memory - l2Promotion : :py:obj:`~.CUtensorMapL2promotion` - L2 promotion size - oobFill : :py:obj:`~.CUtensorMapFloatOOBfill` - Indicate whether zero or special NaN constant will be used to fill - out-of-bound elements + Starting address of memory region described by tensor, must follow + previous alignment requirements Returns ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` - tensorMap : :py:obj:`~.CUtensorMap` - Tensor map object to create See Also -------- - :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapReplaceAddress` + :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide` """ - cdef cydriver.cuuint32_t* cyelementStrides - cdef size_t elementStridesLen - cdef cydriver.cuuint32_t[5] elementStridesStatic - elementStridesLen = 0 if elementStrides is None else len(elementStrides) - if elementStridesLen == 0: - cyelementStrides = NULL - elif elementStridesLen == 1: - cyelementStrides = ( elementStrides[0])._pvt_ptr - elif elementStridesLen <= 5: - for idx in range(elementStridesLen): - elementStridesStatic[idx] = ( elementStrides[idx])._pvt_ptr[0] - cyelementStrides = elementStridesStatic - else: - raise ValueError("Argument 'elementStrides' too long, must be <= 5") - cdef cydriver.cuuint32_t cypixelsPerColumn - if pixelsPerColumn is None: - ppixelsPerColumn = 0 - elif isinstance(pixelsPerColumn, (cuuint32_t,)): - ppixelsPerColumn = int(pixelsPerColumn) - else: - ppixelsPerColumn = int(cuuint32_t(pixelsPerColumn)) - cypixelsPerColumn = ppixelsPerColumn - cdef cydriver.cuuint32_t cychannelsPerPixel - if channelsPerPixel is None: - pchannelsPerPixel = 0 - elif isinstance(channelsPerPixel, (cuuint32_t,)): - pchannelsPerPixel = int(channelsPerPixel) - else: - pchannelsPerPixel = int(cuuint32_t(channelsPerPixel)) - cychannelsPerPixel = pchannelsPerPixel - cdef cydriver.cuuint64_t* cyglobalStrides - cdef size_t globalStridesLen - cdef cydriver.cuuint64_t[5] globalStridesStatic - globalStridesLen = 0 if globalStrides is None else len(globalStrides) - if globalStridesLen == 0: - cyglobalStrides = NULL - elif globalStridesLen == 1: - cyglobalStrides = ( globalStrides[0])._pvt_ptr - elif globalStridesLen <= 5: - for idx in range(globalStridesLen): - globalStridesStatic[idx] = ( globalStrides[idx])._pvt_ptr[0] - cyglobalStrides = globalStridesStatic - else: - raise ValueError("Argument 'globalStrides' too long, must be <= 5") - cdef cydriver.cuuint64_t* cyglobalDim - cdef size_t globalDimLen - cdef cydriver.cuuint64_t[5] globalDimStatic - globalDimLen = 0 if globalDim is None else len(globalDim) - if globalDimLen == 0: - cyglobalDim = NULL - elif globalDimLen == 1: - cyglobalDim = ( globalDim[0])._pvt_ptr - elif globalDimLen <= 5: - for idx in range(globalDimLen): - globalDimStatic[idx] = ( globalDim[idx])._pvt_ptr[0] - cyglobalDim = globalDimStatic - else: - raise ValueError("Argument 'globalDim' too long, must be <= 5") - cdef cydriver.cuuint32_t cytensorRank - if tensorRank is None: - ptensorRank = 0 - elif isinstance(tensorRank, (cuuint32_t,)): - ptensorRank = int(tensorRank) - else: - ptensorRank = int(cuuint32_t(tensorRank)) - cytensorRank = ptensorRank - cdef CUtensorMap tensorMap = CUtensorMap() - cdef cydriver.CUtensorMapDataType cytensorDataType = int(tensorDataType) + cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap is not None else NULL cdef _HelperInputVoidPtrStruct cyglobalAddressHelper cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) - cdef cydriver.CUtensorMapInterleave cyinterleave = int(interleave) - cdef cydriver.CUtensorMapIm2ColWideMode cymode = int(mode) - cdef cydriver.CUtensorMapSwizzle cyswizzle = int(swizzle) - cdef cydriver.CUtensorMapL2promotion cyl2Promotion = int(l2Promotion) - cdef cydriver.CUtensorMapFloatOOBfill cyoobFill = int(oobFill) with nogil: - err = cydriver.cuTensorMapEncodeIm2colWide(tensorMap._pvt_ptr, cytensorDataType, cytensorRank, cyglobalAddress, cyglobalDim, cyglobalStrides, pixelBoxLowerCornerWidth, pixelBoxUpperCornerWidth, cychannelsPerPixel, cypixelsPerColumn, cyelementStrides, cyinterleave, cymode, cyswizzle, cyl2Promotion, cyoobFill) + err = cydriver.cuTensorMapReplaceAddress(cytensorMap_ptr, cyglobalAddress) _helper_input_void_ptr_free(&cyglobalAddressHelper) - if err != cydriver.CUDA_SUCCESS: - return (_CUresult(err), None) - return (_CUresult_SUCCESS, tensorMap) + return (_CUresult(err),) @cython.embedsignature(True) -def cuTensorMapReplaceAddress(tensorMap : Optional[CUtensorMap], globalAddress): - """ Modify an existing tensor map descriptor with an updated global address. +def cuTensorMapSetAllocationClass(tensorMap : Optional[CUtensorMap], allocClass not None : CUtensorMapAllocClass): + """ Sets the allocation class of an already-encoded tensor map. - Modifies the descriptor for Tensor Memory Access (TMA) object passed in - `tensorMap` with an updated `globalAddress`. + Requests a Tensor Memory Accelerator (TMA) allocation class for an + existing `tensorMap` that was previously initialized by a tensor-map + encoding API. No re-encoding of the tensor is performed. - Tensor map objects are only supported on devices of compute capability - 9.0 or higher. Additionally, a tensor map object is an opaque value, - and, as such, should only be accessed through CUDA API calls. + `allocClass` selects the class: + + - :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_SMALL` requests the safe 4 KiB + window. + + - :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_LARGE` requests the 128 KiB + window. When LARGE is the effective class, the caller guarantees + that, before the tensor map is used, its effective base allocation is + backed by a contiguous, accessible region of at least + :py:obj:`~.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE` + bytes. Violating this is undefined behavior at kernel execution time, + not an error of this API. + + - :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_AUTO` re-evaluates the encoded + tensor geometry using the driver's conservative contiguity policy. + The global address is not inspected. + + On architectures where allocation-class selection affects TMA OOB + address generation, this function adjusts only the encoded selector + through an in-place read-modify-write of `tensorMap`. The caller must + externally synchronize this call with all other host and device access + to the same descriptor storage, including device-side tensormap.replace + operations. + + If `outAllocClass` is non-NULL it receives the class actually in effect + after the call, which is always + :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_SMALL` or + :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_LARGE` (never + :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_AUTO`). If `outAllocClass` is non- + NULL, it is initialized to :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_SMALL` + before validation. On failure, `tensorMap` is not modified and + `outAllocClass` remains SMALL. + + On architectures where allocation-class selection has no effect, all + three requests succeed without changing `tensorMap` and report + :py:obj:`~.CU_TENSOR_MAP_ALLOC_CLASS_SMALL`. Parameters ---------- tensorMap : :py:obj:`~.CUtensorMap` - Tensor map object to modify - globalAddress : Any - Starting address of memory region described by tensor, must follow - previous alignment requirements + Tensor map to modify in place + allocClass : :py:obj:`~.CUtensorMapAllocClass` + Requested allocation class Returns ------- CUresult :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_DEINITIALIZED`, :py:obj:`~.CUDA_ERROR_NOT_INITIALIZED`, :py:obj:`~.CUDA_ERROR_INVALID_CONTEXT`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE` + outAllocClass : :py:obj:`~.CUtensorMapAllocClass` + Optional; receives the resulting allocation class See Also -------- - :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide` + :py:obj:`~.cuTensorMapEncodeTiled`, :py:obj:`~.cuTensorMapEncodeIm2col`, :py:obj:`~.cuTensorMapEncodeIm2colWide`, :py:obj:`~.cuTensorMapReplaceAddress` """ cdef cydriver.CUtensorMap* cytensorMap_ptr = tensorMap._pvt_ptr if tensorMap is not None else NULL - cdef _HelperInputVoidPtrStruct cyglobalAddressHelper - cdef void* cyglobalAddress = _helper_input_void_ptr(globalAddress, &cyglobalAddressHelper) + cdef cydriver.CUtensorMapAllocClass cyallocClass = int(allocClass) + cdef cydriver.CUtensorMapAllocClass outAllocClass with nogil: - err = cydriver.cuTensorMapReplaceAddress(cytensorMap_ptr, cyglobalAddress) - _helper_input_void_ptr_free(&cyglobalAddressHelper) - return (_CUresult(err),) + err = cydriver.cuTensorMapSetAllocationClass(cytensorMap_ptr, cyallocClass, &outAllocClass) + if err != cydriver.CUDA_SUCCESS: + return (_CUresult(err), None) + return (_CUresult_SUCCESS, CUtensorMapAllocClass(outAllocClass)) @cython.embedsignature(True) def cuDeviceCanAccessPeer(dev, peerDev): @@ -53876,7 +55291,7 @@ def cuGetProcAddress(char* symbol, int cudaVersion, flags): would be cuMemAlloc and `cudaVersion` would be the ABI compatible CUDA version for the _v2 variant. cudaVersion : int - The CUDA version to look for the requested driver symbol + The CUDA version to look for the requested driver symbol. flags : Any Flags to specify search options. @@ -54002,6 +55417,10 @@ def cuCoredumpGetAttribute(attrib not None : CUcoredumpSettings): - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not include constbank memory. + - :py:obj:`~.CU_COREDUMP_SKIP_TENSOR_MEMORY` - Coredump will not + include tensor memory data. Tensor memory metadata may still be + included. + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it's not a part of it already. @@ -54137,6 +55556,10 @@ def cuCoredumpGetAttributeGlobal(attrib not None : CUcoredumpSettings): - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not include constbank memory. + - :py:obj:`~.CU_COREDUMP_SKIP_TENSOR_MEMORY` - Coredump will not + include tensor memory data. Tensor memory metadata may still be + included. + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it's not a part of it already. @@ -54279,6 +55702,10 @@ def cuCoredumpSetAttribute(attrib not None : CUcoredumpSettings, value): - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not include constbank memory. + - :py:obj:`~.CU_COREDUMP_SKIP_TENSOR_MEMORY` - Coredump will not + include tensor memory data. Tensor memory metadata may still be + included. + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it's not a part of it already. @@ -54428,6 +55855,10 @@ def cuCoredumpSetAttributeGlobal(attrib not None : CUcoredumpSettings, value): - :py:obj:`~.CU_COREDUMP_SKIP_CONSTBANK_MEMORY` - Coredump will not include constbank memory. + - :py:obj:`~.CU_COREDUMP_SKIP_TENSOR_MEMORY` - Coredump will not + include tensor memory data. Tensor memory metadata may still be + included. + - :py:obj:`~.CU_COREDUMP_GZIP_COMPRESS` - The generated coredump will be compressed with gzip, and .gz suffix will be appended to the filename, if it's not a part of it already. @@ -54499,7 +55930,7 @@ def cuCoredumpRegisterStartCallback(callback, userData): Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` callbackOut : :py:obj:`~.CUcoredumpCallbackHandle` Location to store the callback handle (optional, may be NULL) @@ -54549,7 +55980,7 @@ def cuCoredumpRegisterCompleteCallback(callback, userData): Returns ------- CUresult - :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` + :py:obj:`~.CUDA_SUCCESS`, :py:obj:`~.CUDA_ERROR_INVALID_VALUE`, :py:obj:`~.CUDA_ERROR_NOT_PERMITTED`, :py:obj:`~.CUDA_ERROR_OUT_OF_MEMORY` callbackOut : :py:obj:`~.CUcoredumpCallbackHandle` Location to store the callback handle (optional, may be NULL) @@ -54595,7 +56026,7 @@ def cuCoredumpDeregisterStartCallback(callback): 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_PERMITTED` See Also -------- @@ -54603,7 +56034,7 @@ def cuCoredumpDeregisterStartCallback(callback): Notes ----- - It is the caller's responsibility to deregister callbacks before they go out of scope. + It is the caller's responsibility to deregister callbacks before they go out of scope. The handle must identify a currently registered start callback; handles returned by other registration APIs and handles that were already deregistered are invalid. """ cdef cydriver.CUcoredumpCallbackHandle cycallback if callback is None: @@ -54633,7 +56064,7 @@ def cuCoredumpDeregisterCompleteCallback(callback): 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_PERMITTED` See Also -------- @@ -54641,7 +56072,7 @@ def cuCoredumpDeregisterCompleteCallback(callback): Notes ----- - It is the caller's responsibility to deregister callbacks before they go out of scope. + It is the caller's responsibility to deregister callbacks before they go out of scope. The handle must identify a currently registered complete callback; handles returned by other registration APIs and handles that were already deregistered are invalid. """ cdef cydriver.CUcoredumpCallbackHandle cycallback if callback is None: @@ -54695,10 +56126,7 @@ def cuGreenCtxCreate(desc, dev, unsigned int flags): current, you need to explicitly set it current by first converting the green context to a :py:obj:`~.CUcontext` using :py:obj:`~.cuCtxFromGreenCtx` and subsequently calling - :py:obj:`~.cuCtxSetCurrent` / :py:obj:`~.cuCtxPushCurrent`. It should - be noted that a green context can be current to only one thread at a - time. There is no internal synchronization to make API calls accessing - the same green context from multiple threads work. + :py:obj:`~.cuCtxSetCurrent` / :py:obj:`~.cuCtxPushCurrent`. Note: The API is not supported on 32-bit platforms. @@ -55199,14 +56627,25 @@ def cuDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[CUdevResource] 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. + CUDA_ERROR_INVALID_RESOURCE_CONFIGURATION is returned. When used with + `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS`, backfill + follows the same behavior after first consuming all SMs from the target + locality domain. - `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID:` Specifies that the SM partition should be localized to the specified `localityDomainId`. + - `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS:` Modifier + to :py:obj:`~.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID` which allows + selection of SMs in the locality domain exceeding the + :py:obj:`~.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT`. + - `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. + `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID` is set in flags. The + special value `CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID_ANY` + specifies that the partitioned SMs must be selected from the union + of all available locality domains in the input SM resource. Example params and their effect: @@ -58120,6 +59559,33 @@ def sizeof(objType): if objType == CUDA_EVENT_WAIT_NODE_PARAMS: return sizeof(cydriver.CUDA_EVENT_WAIT_NODE_PARAMS) + if objType == CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st: + return sizeof(cydriver.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st) + + if objType == CUDA_MEMCPY_BATCH_NODE_PARAMS_V1: + return sizeof(cydriver.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1) + + if objType == CUDA_MEMCPY_BATCH_NODE_PARAMS: + return sizeof(cydriver.CUDA_MEMCPY_BATCH_NODE_PARAMS) + + if objType == CUDA_FABRIC_COPY_BATCH_OP_st: + return sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP_st) + + if objType == CUDA_FABRIC_COPY_BATCH_OP_v1: + return sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP_v1) + + if objType == CUDA_FABRIC_COPY_BATCH_OP: + return sizeof(cydriver.CUDA_FABRIC_COPY_BATCH_OP) + + if objType == CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st: + return sizeof(cydriver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st) + + if objType == CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1: + return sizeof(cydriver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1) + + if objType == CUDA_FABRIC_CPY_BATCH_NODE_PARAMS: + return sizeof(cydriver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS) + if objType == CUgraphNodeParams_st: return sizeof(cydriver.CUgraphNodeParams_st) @@ -58198,6 +59664,12 @@ def sizeof(objType): if objType == CUlogicalEndpointProp: return sizeof(cydriver.CUlogicalEndpointProp) + if objType == CUfabricCpyOperand_st: + return sizeof(cydriver.CUfabricCpyOperand_st) + + if objType == CUfabricCpyOperand: + return sizeof(cydriver.CUfabricCpyOperand) + if objType == CUgraphRecaptureCallback: return sizeof(cydriver.CUgraphRecaptureCallback) diff --git a/cuda_bindings_13/cuda/bindings/nvfatbin.pxd b/cuda_bindings_13/cuda/bindings/nvfatbin.pxd index 192e7f55fde..f01f6a8d680 100644 --- a/cuda_bindings_13/cuda/bindings/nvfatbin.pxd +++ b/cuda_bindings_13/cuda/bindings/nvfatbin.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.4.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9ead77b928fe2009e92249025e5b38bf079a25fc0d9737aafd3cbeddb5c86661 +# This code was automatically generated across versions from 12.4.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b9d7a2d3185392f24d4d855bed7726dd25cccb3ef04437cba3387c269d7bc7a7 diff --git a/cuda_bindings_13/cuda/bindings/nvfatbin.pyx b/cuda_bindings_13/cuda/bindings/nvfatbin.pyx index d5c16d7b6e5..0b5bea43274 100644 --- a/cuda_bindings_13/cuda/bindings/nvfatbin.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=a7b1e6452305b24e9ce950d8adbc14639f922708f50252656f28e0fe2e3cd464 +# This code was automatically generated across versions from 12.4.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cb398ea8016b7008bacb1863cb6313fbefb174f691ac1f4909b630bbaaab8612 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/nvjitlink.pxd b/cuda_bindings_13/cuda/bindings/nvjitlink.pxd index b383554eaca..1b73f353101 100644 --- a/cuda_bindings_13/cuda/bindings/nvjitlink.pxd +++ b/cuda_bindings_13/cuda/bindings/nvjitlink.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=bdd807ca03377f36b064e28eaa2421255316987c009a65a55f05fbc1a22e2bf3 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=0c3c3115d20a0f395e78f830e40b0c3feeb827248a45803664ce5f4850d839c9 diff --git a/cuda_bindings_13/cuda/bindings/nvjitlink.pyx b/cuda_bindings_13/cuda/bindings/nvjitlink.pyx index 3294c90b9e8..b2dbd5a5f5e 100644 --- a/cuda_bindings_13/cuda/bindings/nvjitlink.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=fa69db9162a1215e162a49f33d17f368a9a3a6ac8bcd89b30f4069ba2919e3f3 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b9aa76171866a367ace1f1c8b531f60ed13e55aa638823e22213a9a835dd6d77 # <<<< PREAMBLE CONTENT >>>> diff --git a/cuda_bindings_13/cuda/bindings/nvml.pxd b/cuda_bindings_13/cuda/bindings/nvml.pxd index cfda90b966a..e185402fa5d 100644 --- a/cuda_bindings_13/cuda/bindings/nvml.pxd +++ b/cuda_bindings_13/cuda/bindings/nvml.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.9.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8d1afafeb9369977927ce07c70187f6f0927eb5f556b6f4e3569d6ce58980e7a +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=48f4cf8e0afa266eeb30a8e85723f232ad54caeb5c5cd74dd6c0a28fc5a3554f @@ -464,3 +465,11 @@ cpdef object device_get_nv_link_telemetry_samples_v1(intptr_t device) cpdef event_set_register_gpu_operational_events_v1(intptr_t event_set, config) cpdef object event_set_get_context_count_v1(intptr_t set) cpdef object device_get_bank_remapper_status_v1(intptr_t device) +cpdef object device_get_gpu_uptime_v1(intptr_t device) +cpdef object system_get_conf_compute_settings_v2() +cpdef object device_get_nvlink_info_v3(intptr_t device) +cpdef object device_get_nvlink_remap_table_info_v1(intptr_t device) +cpdef device_set_nvlink_nvle_ready_v1(intptr_t device, set_nvle_ready) +cpdef device_lock_nvlink_remap_table_v1(intptr_t device, remap_table_lock_info) +cpdef device_setup_nvlink_nvle_encryption_key_v1(intptr_t device, encryption_key) +cpdef object device_get_nvlink_nvle_private_info_v1(intptr_t device) diff --git a/cuda_bindings_13/cuda/bindings/nvml.pyx b/cuda_bindings_13/cuda/bindings/nvml.pyx index 42e1b8bd222..93af7b1c141 100644 --- a/cuda_bindings_13/cuda/bindings/nvml.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b9fa4fb6c95c7d5ac8e8a53cc16619a8a1012a0e30bb53b850d9afc19ea9fd67 +# This code was automatically generated across versions from 12.9.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=81d28c2d42272e2af619cad87f6ad93f87f2ab7de821647b4e3f19d1b1c326ed # <<<< PREAMBLE CONTENT >>>> @@ -312,14 +313,14 @@ class ValueType(_cyb_FastEnum): See `nvmlValueType_t`. """ - DOUBLE = NVML_VALUE_TYPE_DOUBLE - UNSIGNED_INT = NVML_VALUE_TYPE_UNSIGNED_INT - UNSIGNED_LONG = NVML_VALUE_TYPE_UNSIGNED_LONG - UNSIGNED_LONG_LONG = NVML_VALUE_TYPE_UNSIGNED_LONG_LONG - SIGNED_LONG_LONG = NVML_VALUE_TYPE_SIGNED_LONG_LONG - SIGNED_INT = NVML_VALUE_TYPE_SIGNED_INT - UNSIGNED_SHORT = NVML_VALUE_TYPE_UNSIGNED_SHORT - COUNT = NVML_VALUE_TYPE_COUNT + DOUBLE = (NVML_VALUE_TYPE_DOUBLE, 'Double-precision floating-point value.') + UNSIGNED_INT = (NVML_VALUE_TYPE_UNSIGNED_INT, 'Unsigned 32-bit integer value.') + UNSIGNED_LONG = (NVML_VALUE_TYPE_UNSIGNED_LONG, 'Unsigned long integer value.') + UNSIGNED_LONG_LONG = (NVML_VALUE_TYPE_UNSIGNED_LONG_LONG, 'Unsigned 64-bit integer value.') + SIGNED_LONG_LONG = (NVML_VALUE_TYPE_SIGNED_LONG_LONG, 'Signed 64-bit integer value.') + SIGNED_INT = (NVML_VALUE_TYPE_SIGNED_INT, 'Signed 32-bit integer value.') + UNSIGNED_SHORT = (NVML_VALUE_TYPE_UNSIGNED_SHORT, 'Unsigned 16-bit integer value.') + COUNT = (NVML_VALUE_TYPE_COUNT, 'Maximum value above +1.') class PerfPolicyType(_cyb_FastEnum): """ @@ -486,10 +487,10 @@ class BrandType(_cyb_FastEnum): BRAND_TITAN_RTX = TITAN_RTX # backward-compat alias NVIDIA_DLA = NVML_BRAND_NVIDIA_DLA BRAND_NVIDIA_DLA = NVIDIA_DLA # backward-compat alias - NVIDIA_VGAMEDEV = NVML_BRAND_NVIDIA_VGAMEDEV - BRAND_NVIDIA_VGAMEDEV = NVIDIA_VGAMEDEV # backward-compat alias NVIDIA_NPU = NVML_BRAND_NVIDIA_NPU BRAND_NVIDIA_NPU = NVIDIA_NPU # backward-compat alias + NVIDIA_VGAMEDEV = NVML_BRAND_NVIDIA_VGAMEDEV + BRAND_NVIDIA_VGAMEDEV = NVIDIA_VGAMEDEV # backward-compat alias COUNT = NVML_BRAND_COUNT BRAND_COUNT = COUNT # backward-compat alias @@ -723,7 +724,7 @@ class Return(_cyb_FastEnum): ERROR_CORRUPTED_INFOROM = (NVML_ERROR_CORRUPTED_INFOROM, 'infoROM is corrupted') ERROR_GPU_IS_LOST = (NVML_ERROR_GPU_IS_LOST, 'The GPU has fallen off the bus or has otherwise become inaccessible.') ERROR_RESET_REQUIRED = (NVML_ERROR_RESET_REQUIRED, 'The GPU requires a reset before it can be used again.') - ERROR_OPERATING_SYSTEM = (NVML_ERROR_OPERATING_SYSTEM, 'The GPU control device has been blocked by the operating system/cgroups.') + ERROR_OPERATING_SYSTEM = (NVML_ERROR_OPERATING_SYSTEM, 'A generic operating system error occurred.') ERROR_LIB_RM_VERSION_MISMATCH = (NVML_ERROR_LIB_RM_VERSION_MISMATCH, 'RM detects a driver/library version mismatch.') ERROR_IN_USE = (NVML_ERROR_IN_USE, 'An operation cannot be performed because the GPU is currently in use.') ERROR_MEMORY = (NVML_ERROR_MEMORY, 'Insufficient memory.') @@ -1946,6 +1947,8 @@ class GpmMetricId(_cyb_FastEnum): class PowerProfileType(_cyb_FastEnum): """ + Workload power profile identifiers. + See `nvmlPowerProfileType_t`. """ MAX_P = NVML_POWER_PROFILE_MAX_P @@ -20567,7 +20570,7 @@ cdef class EventSetWait_v3: @property def attributes(self): - """int: [out] Bitmask of `NVML_OPERATIONAL_EVENT_ATTR_*` values for structured events. May contain newer bits not named in this header. 0 for NVML event-bit events. May include `NVML_OPERATIONAL_EVENT_ATTR_OVERFLOW` if events or associated payloads were dropped.""" + """int: [out] Bitmask of `NVML_OPERATIONAL_EVENT_ATTR_*` values for structured events. May contain newer bits not named in this header. 0 for NVML event-bit events.""" return self._ptr[0].attributes @attributes.setter @@ -21165,6 +21168,899 @@ cdef class EccBankRemapperHistogram_v1: return obj +cdef _get_gpu_uptime_v1_dtype_offsets(): + cdef nvmlGpuUptime_v1_t pod + return _numpy.dtype({ + 'names': ['uptime'], + 'formats': [_numpy.uint32], + 'offsets': [ + (&(pod.uptime)) - (&pod), + ], + 'itemsize': sizeof(nvmlGpuUptime_v1_t), + }) + +gpu_uptime_v1_dtype = _get_gpu_uptime_v1_dtype_offsets() + +cdef class GpuUptime_v1: + """Empty-initialize an instance of `nvmlGpuUptime_v1_t`. + + + .. seealso:: `nvmlGpuUptime_v1_t` + """ + cdef: + nvmlGpuUptime_v1_t _data + nvmlGpuUptime_v1_t *_ptr + object _owner + bint _readonly + + def __init__(self): + self._ptr = &self._data + self._owner = None + self._readonly = False + + def __repr__(self): + return f"<{__name__}.GpuUptime_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 GpuUptime_v1 other_ + if not isinstance(other, GpuUptime_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlGpuUptime_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlGpuUptime_v1_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This GpuUptime_v1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlGpuUptime_v1_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlGpuUptime_v1_t), view.len) + ) + _cyb_memmove(&self._data, view.buf, sizeof(nvmlGpuUptime_v1_t)) + self._ptr = &self._data + self._owner = None + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def uptime(self): + """int: [out] Number of seconds the GPU has been up since it was initialized by the driver""" + return self._ptr[0].uptime + + @uptime.setter + def uptime(self, val): + if self._readonly: + raise ValueError("This GpuUptime_v1 instance is read-only") + self._ptr[0].uptime = val + + @staticmethod + def from_buffer(buffer): + """Create an GpuUptime_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlGpuUptime_v1_t), GpuUptime_v1) + + @staticmethod + def from_data(data): + """Create an GpuUptime_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `gpu_uptime_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "gpu_uptime_v1_dtype", gpu_uptime_v1_dtype, GpuUptime_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an GpuUptime_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 GpuUptime_v1 obj = GpuUptime_v1.__new__(GpuUptime_v1) + if owner is None: + _cyb_memcpy(&obj._data, ptr, sizeof(nvmlGpuUptime_v1_t)) + obj._ptr = &obj._data + obj._owner = None + else: + obj._ptr = ptr + obj._owner = owner + obj._readonly = readonly + return obj + + +cdef _get_system_conf_compute_settings_v2_dtype_offsets(): + cdef nvmlSystemConfComputeSettings_v2_t pod + return _numpy.dtype({ + 'names': ['version', 'environment', 'cc_feature', 'dev_tools_mode', 'multi_gpu_mode', 'tdisp_state'], + 'formats': [_numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32, _numpy.uint32], + 'offsets': [ + (&(pod.version)) - (&pod), + (&(pod.environment)) - (&pod), + (&(pod.ccFeature)) - (&pod), + (&(pod.devToolsMode)) - (&pod), + (&(pod.multiGpuMode)) - (&pod), + (&(pod.tdispState)) - (&pod), + ], + 'itemsize': sizeof(nvmlSystemConfComputeSettings_v2_t), + }) + +system_conf_compute_settings_v2_dtype = _get_system_conf_compute_settings_v2_dtype_offsets() + +cdef class SystemConfComputeSettings_v2: + """Empty-initialize an instance of `nvmlSystemConfComputeSettings_v2_t`. + + + .. seealso:: `nvmlSystemConfComputeSettings_v2_t` + """ + cdef: + nvmlSystemConfComputeSettings_v2_t _data + nvmlSystemConfComputeSettings_v2_t *_ptr + object _owner + bint _readonly + + def __init__(self): + self._ptr = &self._data + self._owner = None + self._readonly = False + + def __repr__(self): + return f"<{__name__}.SystemConfComputeSettings_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 SystemConfComputeSettings_v2 other_ + if not isinstance(other, SystemConfComputeSettings_v2): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlSystemConfComputeSettings_v2_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlSystemConfComputeSettings_v2_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v2 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlSystemConfComputeSettings_v2_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlSystemConfComputeSettings_v2_t), view.len) + ) + _cyb_memmove(&self._data, view.buf, sizeof(nvmlSystemConfComputeSettings_v2_t)) + self._ptr = &self._data + self._owner = None + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def version(self): + """int: """ + return self._ptr[0].version + + @version.setter + def version(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v2 instance is read-only") + self._ptr[0].version = val + + @property + def environment(self): + """int: """ + return self._ptr[0].environment + + @environment.setter + def environment(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v2 instance is read-only") + self._ptr[0].environment = val + + @property + def cc_feature(self): + """int: """ + return self._ptr[0].ccFeature + + @cc_feature.setter + def cc_feature(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v2 instance is read-only") + self._ptr[0].ccFeature = val + + @property + def dev_tools_mode(self): + """int: """ + return self._ptr[0].devToolsMode + + @dev_tools_mode.setter + def dev_tools_mode(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v2 instance is read-only") + self._ptr[0].devToolsMode = val + + @property + def multi_gpu_mode(self): + """int: """ + return self._ptr[0].multiGpuMode + + @multi_gpu_mode.setter + def multi_gpu_mode(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v2 instance is read-only") + self._ptr[0].multiGpuMode = val + + @property + def tdisp_state(self): + """int: """ + return self._ptr[0].tdispState + + @tdisp_state.setter + def tdisp_state(self, val): + if self._readonly: + raise ValueError("This SystemConfComputeSettings_v2 instance is read-only") + self._ptr[0].tdispState = val + + @staticmethod + def from_buffer(buffer): + """Create an SystemConfComputeSettings_v2 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlSystemConfComputeSettings_v2_t), SystemConfComputeSettings_v2) + + @staticmethod + def from_data(data): + """Create an SystemConfComputeSettings_v2 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `system_conf_compute_settings_v2_dtype` holding the data. + """ + return _cyb_from_data(data, "system_conf_compute_settings_v2_dtype", system_conf_compute_settings_v2_dtype, SystemConfComputeSettings_v2) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an SystemConfComputeSettings_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 SystemConfComputeSettings_v2 obj = SystemConfComputeSettings_v2.__new__(SystemConfComputeSettings_v2) + if owner is None: + _cyb_memcpy(&obj._data, ptr, sizeof(nvmlSystemConfComputeSettings_v2_t)) + obj._ptr = &obj._data + obj._owner = None + else: + obj._ptr = ptr + obj._owner = owner + obj._readonly = readonly + return obj + + +cdef _get_nvlink_get_remap_table_info_v1_dtype_offsets(): + cdef nvmlNvlinkGetRemapTableInfo_v1_t pod + return _numpy.dtype({ + 'names': ['alid', 'fla_remap_tab_addr', 'gpa_remap_tab_addr', 'remap_tab_size'], + 'formats': [_numpy.uint32, (_numpy.uint32, 4096), (_numpy.uint32, 4096), _numpy.uint32], + 'offsets': [ + (&(pod.alid)) - (&pod), + (&(pod.flaRemapTabAddr)) - (&pod), + (&(pod.gpaRemapTabAddr)) - (&pod), + (&(pod.remapTabSize)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), + }) + +nvlink_get_remap_table_info_v1_dtype = _get_nvlink_get_remap_table_info_v1_dtype_offsets() + +cdef class NvlinkGetRemapTableInfo_v1: + """Empty-initialize an instance of `nvmlNvlinkGetRemapTableInfo_v1_t`. + + + .. seealso:: `nvmlNvlinkGetRemapTableInfo_v1_t` + """ + cdef: + nvmlNvlinkGetRemapTableInfo_v1_t _data + nvmlNvlinkGetRemapTableInfo_v1_t *_ptr + object _owner + bint _readonly + + def __init__(self): + self._ptr = &self._data + self._owner = None + self._readonly = False + + def __repr__(self): + return f"<{__name__}.NvlinkGetRemapTableInfo_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 NvlinkGetRemapTableInfo_v1 other_ + if not isinstance(other, NvlinkGetRemapTableInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkGetRemapTableInfo_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This NvlinkGetRemapTableInfo_v1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlNvlinkGetRemapTableInfo_v1_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), view.len) + ) + _cyb_memmove(&self._data, view.buf, sizeof(nvmlNvlinkGetRemapTableInfo_v1_t)) + self._ptr = &self._data + self._owner = None + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def alid(self): + """int: ALID of the GPU.""" + return self._ptr[0].alid + + @alid.setter + def alid(self, val): + if self._readonly: + raise ValueError("This NvlinkGetRemapTableInfo_v1 instance is read-only") + self._ptr[0].alid = val + + @property + def fla_remap_tab_addr(self): + """~_numpy.uint32: (array of length 4096).FLA remap table addrs for all the remap table entries.""" + if self._ptr[0].remapTabSize == 0: + return _numpy.array([]) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].remapTabSize,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) + arr.data = (&(self._ptr[0].flaRemapTabAddr)) + return _numpy.asarray(arr) + + @fla_remap_tab_addr.setter + def fla_remap_tab_addr(self, val): + if self._readonly: + raise ValueError("This NvlinkGetRemapTableInfo_v1 instance is read-only") + if len(val) > 4096: + raise ValueError(f"Too many elements for field fla_remap_tab_addr, max is 4096, got {len(val)}") + self._ptr[0].remapTabSize = len(val) + if len(val) == 0: + return + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].remapTabSize,), itemsize=sizeof(unsigned int), format="I", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) + _cyb_memcpy((&(self._ptr[0].flaRemapTabAddr)), (arr.data), sizeof(unsigned int) * len(val)) + + @property + def gpa_remap_tab_addr(self): + """~_numpy.uint32: (array of length 4096).SPA/GPA remap table addrs for all the remap table entries.""" + if self._ptr[0].remapTabSize == 0: + return _numpy.array([]) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].remapTabSize,), itemsize=sizeof(unsigned int), format="I", mode="c", allocate_buffer=False) + arr.data = (&(self._ptr[0].gpaRemapTabAddr)) + return _numpy.asarray(arr) + + @gpa_remap_tab_addr.setter + def gpa_remap_tab_addr(self, val): + if self._readonly: + raise ValueError("This NvlinkGetRemapTableInfo_v1 instance is read-only") + if len(val) > 4096: + raise ValueError(f"Too many elements for field gpa_remap_tab_addr, max is 4096, got {len(val)}") + self._ptr[0].remapTabSize = len(val) + if len(val) == 0: + return + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].remapTabSize,), itemsize=sizeof(unsigned int), format="I", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint32) + _cyb_memcpy((&(self._ptr[0].gpaRemapTabAddr)), (arr.data), sizeof(unsigned int) * len(val)) + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkGetRemapTableInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkGetRemapTableInfo_v1_t), NvlinkGetRemapTableInfo_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkGetRemapTableInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_get_remap_table_info_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_get_remap_table_info_v1_dtype", nvlink_get_remap_table_info_v1_dtype, NvlinkGetRemapTableInfo_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkGetRemapTableInfo_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 NvlinkGetRemapTableInfo_v1 obj = NvlinkGetRemapTableInfo_v1.__new__(NvlinkGetRemapTableInfo_v1) + if owner is None: + _cyb_memcpy(&obj._data, ptr, sizeof(nvmlNvlinkGetRemapTableInfo_v1_t)) + obj._ptr = &obj._data + obj._owner = None + else: + obj._ptr = ptr + obj._owner = owner + obj._readonly = readonly + return obj + + +cdef _get_nvlink_set_nvle_ready_v1_dtype_offsets(): + cdef nvmlNvlinkSetNvleReady_v1_t pod + return _numpy.dtype({ + 'names': ['b_nvle_ready'], + 'formats': [_numpy.uint8], + 'offsets': [ + (&(pod.bNvleReady)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetNvleReady_v1_t), + }) + +nvlink_set_nvle_ready_v1_dtype = _get_nvlink_set_nvle_ready_v1_dtype_offsets() + +cdef class NvlinkSetNvleReady_v1: + """Empty-initialize an instance of `nvmlNvlinkSetNvleReady_v1_t`. + + + .. seealso:: `nvmlNvlinkSetNvleReady_v1_t` + """ + cdef: + nvmlNvlinkSetNvleReady_v1_t _data + nvmlNvlinkSetNvleReady_v1_t *_ptr + object _owner + bint _readonly + + def __init__(self): + self._ptr = &self._data + self._owner = None + self._readonly = False + + def __repr__(self): + return f"<{__name__}.NvlinkSetNvleReady_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 NvlinkSetNvleReady_v1 other_ + if not isinstance(other, NvlinkSetNvleReady_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSetNvleReady_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkSetNvleReady_v1_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This NvlinkSetNvleReady_v1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlNvlinkSetNvleReady_v1_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlNvlinkSetNvleReady_v1_t), view.len) + ) + _cyb_memmove(&self._data, view.buf, sizeof(nvmlNvlinkSetNvleReady_v1_t)) + self._ptr = &self._data + self._owner = None + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def b_nvle_ready(self): + """int: Whether NVLE is ready on the GPU.""" + return self._ptr[0].bNvleReady + + @b_nvle_ready.setter + def b_nvle_ready(self, val): + if self._readonly: + raise ValueError("This NvlinkSetNvleReady_v1 instance is read-only") + self._ptr[0].bNvleReady = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkSetNvleReady_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkSetNvleReady_v1_t), NvlinkSetNvleReady_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkSetNvleReady_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_set_nvle_ready_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_set_nvle_ready_v1_dtype", nvlink_set_nvle_ready_v1_dtype, NvlinkSetNvleReady_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkSetNvleReady_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 NvlinkSetNvleReady_v1 obj = NvlinkSetNvleReady_v1.__new__(NvlinkSetNvleReady_v1) + if owner is None: + _cyb_memcpy(&obj._data, ptr, sizeof(nvmlNvlinkSetNvleReady_v1_t)) + obj._ptr = &obj._data + obj._owner = None + else: + obj._ptr = ptr + obj._owner = owner + obj._readonly = readonly + return obj + + +cdef _get_nvlink_lock_remap_table_v1_dtype_offsets(): + cdef nvmlNvlinkLockRemapTable_v1_t pod + return _numpy.dtype({ + 'names': ['b_remap_table_locked', 'b_remap_table_lock_disabled'], + 'formats': [_numpy.uint8, _numpy.uint8], + 'offsets': [ + (&(pod.bRemapTableLocked)) - (&pod), + (&(pod.bRemapTableLockDisabled)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkLockRemapTable_v1_t), + }) + +nvlink_lock_remap_table_v1_dtype = _get_nvlink_lock_remap_table_v1_dtype_offsets() + +cdef class NvlinkLockRemapTable_v1: + """Empty-initialize an instance of `nvmlNvlinkLockRemapTable_v1_t`. + + + .. seealso:: `nvmlNvlinkLockRemapTable_v1_t` + """ + cdef: + nvmlNvlinkLockRemapTable_v1_t _data + nvmlNvlinkLockRemapTable_v1_t *_ptr + object _owner + bint _readonly + + def __init__(self): + self._ptr = &self._data + self._owner = None + self._readonly = False + + def __repr__(self): + return f"<{__name__}.NvlinkLockRemapTable_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 NvlinkLockRemapTable_v1 other_ + if not isinstance(other, NvlinkLockRemapTable_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkLockRemapTable_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkLockRemapTable_v1_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This NvlinkLockRemapTable_v1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlNvlinkLockRemapTable_v1_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlNvlinkLockRemapTable_v1_t), view.len) + ) + _cyb_memmove(&self._data, view.buf, sizeof(nvmlNvlinkLockRemapTable_v1_t)) + self._ptr = &self._data + self._owner = None + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def b_remap_table_locked(self): + """int: Whether the remap table of the GPU is locked.""" + return self._ptr[0].bRemapTableLocked + + @b_remap_table_locked.setter + def b_remap_table_locked(self, val): + if self._readonly: + raise ValueError("This NvlinkLockRemapTable_v1 instance is read-only") + self._ptr[0].bRemapTableLocked = val + + @property + def b_remap_table_lock_disabled(self): + """int: Whether locking of the remap table is disabled.""" + return self._ptr[0].bRemapTableLockDisabled + + @b_remap_table_lock_disabled.setter + def b_remap_table_lock_disabled(self, val): + if self._readonly: + raise ValueError("This NvlinkLockRemapTable_v1 instance is read-only") + self._ptr[0].bRemapTableLockDisabled = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkLockRemapTable_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkLockRemapTable_v1_t), NvlinkLockRemapTable_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkLockRemapTable_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_lock_remap_table_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_lock_remap_table_v1_dtype", nvlink_lock_remap_table_v1_dtype, NvlinkLockRemapTable_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkLockRemapTable_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 NvlinkLockRemapTable_v1 obj = NvlinkLockRemapTable_v1.__new__(NvlinkLockRemapTable_v1) + if owner is None: + _cyb_memcpy(&obj._data, ptr, sizeof(nvmlNvlinkLockRemapTable_v1_t)) + obj._ptr = &obj._data + obj._owner = None + else: + obj._ptr = ptr + obj._owner = owner + obj._readonly = readonly + return obj + + +cdef _get_nvlink_nvle_private_info_v1_dtype_offsets(): + cdef nvmlNvlinkNvlePrivateInfo_v1_t pod + return _numpy.dtype({ + 'names': ['data_', 'size_'], + 'formats': [(_numpy.uint8, 256), _numpy.uint32], + 'offsets': [ + (&(pod.data)) - (&pod), + (&(pod.size)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), + }) + +nvlink_nvle_private_info_v1_dtype = _get_nvlink_nvle_private_info_v1_dtype_offsets() + +cdef class NvlinkNvlePrivateInfo_v1: + """Empty-initialize an instance of `nvmlNvlinkNvlePrivateInfo_v1_t`. + + + .. seealso:: `nvmlNvlinkNvlePrivateInfo_v1_t` + """ + cdef: + nvmlNvlinkNvlePrivateInfo_v1_t *_ptr + object _owner + bint _owns_ptr + bint _readonly + + def __init__(self): + self._ptr = _cyb_calloc(1, sizeof(nvmlNvlinkNvlePrivateInfo_v1_t)) + if self._ptr == NULL: + raise MemoryError("Error allocating NvlinkNvlePrivateInfo_v1") + self._owns_ptr = True + self._owner = None + self._readonly = False + + def __dealloc__(self): + cdef nvmlNvlinkNvlePrivateInfo_v1_t *ptr + if self._owns_ptr and self._ptr != NULL: + ptr = self._ptr + self._ptr = NULL + _cyb_free(ptr) + + def __repr__(self): + return f"<{__name__}.NvlinkNvlePrivateInfo_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 NvlinkNvlePrivateInfo_v1 other_ + if not isinstance(other, NvlinkNvlePrivateInfo_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkNvlePrivateInfo_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This NvlinkNvlePrivateInfo_v1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlNvlinkNvlePrivateInfo_v1_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), view.len) + ) + _cyb_memmove(self._ptr, view.buf, sizeof(nvmlNvlinkNvlePrivateInfo_v1_t)) + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def data_(self): + """~_numpy.uint8: (array of length 256).Buffer that receives the opaque private info blob.""" + if self._ptr[0].size == 0: + return _numpy.array([]) + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].size,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + arr.data = (&(self._ptr[0].data)) + return _numpy.asarray(arr) + + @data_.setter + def data_(self, val): + if self._readonly: + raise ValueError("This NvlinkNvlePrivateInfo_v1 instance is read-only") + if len(val) > 256: + raise ValueError(f"Too many elements for field data_, max is 256, got {len(val)}") + self._ptr[0].size = len(val) + if len(val) == 0: + return + cdef _cyb_view.array arr = _cyb_view.array(shape=(self._ptr[0].size,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _cyb_memcpy((&(self._ptr[0].data)), (arr.data), sizeof(unsigned char) * len(val)) + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkNvlePrivateInfo_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkNvlePrivateInfo_v1_t), NvlinkNvlePrivateInfo_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkNvlePrivateInfo_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_nvle_private_info_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_nvle_private_info_v1_dtype", nvlink_nvle_private_info_v1_dtype, NvlinkNvlePrivateInfo_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkNvlePrivateInfo_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 NvlinkNvlePrivateInfo_v1 obj = NvlinkNvlePrivateInfo_v1.__new__(NvlinkNvlePrivateInfo_v1) + if owner is None: + obj._ptr = _cyb_malloc(sizeof(nvmlNvlinkNvlePrivateInfo_v1_t)) + if obj._ptr == NULL: + raise MemoryError("Error allocating NvlinkNvlePrivateInfo_v1") + _cyb_memcpy((obj._ptr), ptr, sizeof(nvmlNvlinkNvlePrivateInfo_v1_t)) + obj._owns_ptr = True + obj._owner = None + else: + obj._ptr = ptr + obj._owns_ptr = False + obj._owner = owner + obj._readonly = readonly + return obj + + cdef _get_excluded_device_info_dtype_offsets(): cdef nvmlExcludedDeviceInfo_t pod return _numpy.dtype({ @@ -26321,6 +27217,195 @@ cdef class EccBankRemapperStatus_v1: return obj +cdef _get_nvlink_setup_nvle_encryption_key_v1_dtype_offsets(): + cdef nvmlNvlinkSetupNvleEncryptionKey_v1_t pod + return _numpy.dtype({ + 'names': ['nvle_key', 'local_gpu_alid', 'remote_gpu_alid', 'local_gpu_nvle_private_info', 'remote_gpu_nvle_private_info'], + 'formats': [(_numpy.uint8, 32), _numpy.uint32, _numpy.uint32, nvlink_nvle_private_info_v1_dtype, nvlink_nvle_private_info_v1_dtype], + 'offsets': [ + (&(pod.nvleKey)) - (&pod), + (&(pod.localGpuAlid)) - (&pod), + (&(pod.remoteGpuAlid)) - (&pod), + (&(pod.localGpuNvlePrivateInfo)) - (&pod), + (&(pod.remoteGpuNvlePrivateInfo)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), + }) + +nvlink_setup_nvle_encryption_key_v1_dtype = _get_nvlink_setup_nvle_encryption_key_v1_dtype_offsets() + +cdef class NvlinkSetupNvleEncryptionKey_v1: + """Empty-initialize an instance of `nvmlNvlinkSetupNvleEncryptionKey_v1_t`. + + + .. seealso:: `nvmlNvlinkSetupNvleEncryptionKey_v1_t` + """ + cdef: + nvmlNvlinkSetupNvleEncryptionKey_v1_t _data + nvmlNvlinkSetupNvleEncryptionKey_v1_t *_ptr + object _owner + bint _readonly + + def __init__(self): + self._ptr = &self._data + self._owner = None + self._readonly = False + + def __repr__(self): + return f"<{__name__}.NvlinkSetupNvleEncryptionKey_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 NvlinkSetupNvleEncryptionKey_v1 other_ + if not isinstance(other, NvlinkSetupNvleEncryptionKey_v1): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This NvlinkSetupNvleEncryptionKey_v1 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), view.len) + ) + _cyb_memmove(&self._data, view.buf, sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t)) + self._ptr = &self._data + self._owner = None + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + else: + setattr(self, key, val) + + @property + def local_gpu_nvle_private_info(self): + """NvlinkNvlePrivateInfo_v1: NVLE private info of the local GPU.""" + return NvlinkNvlePrivateInfo_v1.from_ptr( + &(self._ptr[0].localGpuNvlePrivateInfo), + readonly=self._readonly, + owner=self, + ) + + @local_gpu_nvle_private_info.setter + def local_gpu_nvle_private_info(self, val): + if self._readonly: + raise ValueError("This NvlinkSetupNvleEncryptionKey_v1 instance is read-only") + cdef NvlinkNvlePrivateInfo_v1 val_ = val + _cyb_memcpy(&(self._ptr[0].localGpuNvlePrivateInfo), (val_._get_ptr()), sizeof(nvmlNvlinkNvlePrivateInfo_v1_t) * 1) + + @property + def remote_gpu_nvle_private_info(self): + """NvlinkNvlePrivateInfo_v1: NVLE private info of the remote GPU.""" + return NvlinkNvlePrivateInfo_v1.from_ptr( + &(self._ptr[0].remoteGpuNvlePrivateInfo), + readonly=self._readonly, + owner=self, + ) + + @remote_gpu_nvle_private_info.setter + def remote_gpu_nvle_private_info(self, val): + if self._readonly: + raise ValueError("This NvlinkSetupNvleEncryptionKey_v1 instance is read-only") + cdef NvlinkNvlePrivateInfo_v1 val_ = val + _cyb_memcpy(&(self._ptr[0].remoteGpuNvlePrivateInfo), (val_._get_ptr()), sizeof(nvmlNvlinkNvlePrivateInfo_v1_t) * 1) + + @property + def nvle_key(self): + """~_numpy.uint8: (array of length 32).Key secret from which keyMgr will derive the key.""" + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(unsigned char), format="B", mode="c", allocate_buffer=False) + arr.data = (&(self._ptr[0].nvleKey)) + return _numpy.asarray(arr) + + @nvle_key.setter + def nvle_key(self, val): + if self._readonly: + raise ValueError("This NvlinkSetupNvleEncryptionKey_v1 instance is read-only") + if len(val) != 32: + raise ValueError(f"Expected length { 32 } for field nvle_key, got {len(val)}") + cdef _cyb_view.array arr = _cyb_view.array(shape=(32,), itemsize=sizeof(unsigned char), format="B", mode="c") + arr[:] = _numpy.asarray(val, dtype=_numpy.uint8) + _cyb_memcpy((&(self._ptr[0].nvleKey)), (arr.data), sizeof(unsigned char) * len(val)) + + @property + def local_gpu_alid(self): + """int: ALID of the local GPU.""" + return self._ptr[0].localGpuAlid + + @local_gpu_alid.setter + def local_gpu_alid(self, val): + if self._readonly: + raise ValueError("This NvlinkSetupNvleEncryptionKey_v1 instance is read-only") + self._ptr[0].localGpuAlid = val + + @property + def remote_gpu_alid(self): + """int: ALID of the remote GPU.""" + return self._ptr[0].remoteGpuAlid + + @remote_gpu_alid.setter + def remote_gpu_alid(self, val): + if self._readonly: + raise ValueError("This NvlinkSetupNvleEncryptionKey_v1 instance is read-only") + self._ptr[0].remoteGpuAlid = val + + @staticmethod + def from_buffer(buffer): + """Create an NvlinkSetupNvleEncryptionKey_v1 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t), NvlinkSetupNvleEncryptionKey_v1) + + @staticmethod + def from_data(data): + """Create an NvlinkSetupNvleEncryptionKey_v1 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nvlink_setup_nvle_encryption_key_v1_dtype` holding the data. + """ + return _cyb_from_data(data, "nvlink_setup_nvle_encryption_key_v1_dtype", nvlink_setup_nvle_encryption_key_v1_dtype, NvlinkSetupNvleEncryptionKey_v1) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvlinkSetupNvleEncryptionKey_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 NvlinkSetupNvleEncryptionKey_v1 obj = NvlinkSetupNvleEncryptionKey_v1.__new__(NvlinkSetupNvleEncryptionKey_v1) + if owner is None: + _cyb_memcpy(&obj._data, ptr, sizeof(nvmlNvlinkSetupNvleEncryptionKey_v1_t)) + obj._ptr = &obj._data + obj._owner = None + else: + obj._ptr = ptr + obj._owner = owner + obj._readonly = readonly + return obj + + cdef _get_vgpu_instances_utilization_info_v1_dtype_offsets(): cdef nvmlVgpuInstancesUtilizationInfo_v1_t pod return _numpy.dtype({ @@ -27895,6 +28980,160 @@ cdef class NvLinkInfo_v2: return obj +cdef _get_nv_link_info_v3_dtype_offsets(): + cdef nvmlNvLinkInfo_v3_t pod + return _numpy.dtype({ + 'names': ['is_nvle_enabled', 'firmware_info', 'is_nvle_ready'], + 'formats': [_numpy.uint32, nvlink_firmware_info_dtype, _numpy.uint32], + 'offsets': [ + (&(pod.isNvleEnabled)) - (&pod), + (&(pod.firmwareInfo)) - (&pod), + (&(pod.isNvleReady)) - (&pod), + ], + 'itemsize': sizeof(nvmlNvLinkInfo_v3_t), + }) + +nv_link_info_v3_dtype = _get_nv_link_info_v3_dtype_offsets() + +cdef class NvLinkInfo_v3: + """Empty-initialize an instance of `nvmlNvLinkInfo_v3_t`. + + + .. seealso:: `nvmlNvLinkInfo_v3_t` + """ + cdef: + nvmlNvLinkInfo_v3_t _data + nvmlNvLinkInfo_v3_t *_ptr + object _owner + bint _readonly + + def __init__(self): + self._ptr = &self._data + self._owner = None + self._readonly = False + + def __repr__(self): + return f"<{__name__}.NvLinkInfo_v3 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 NvLinkInfo_v3 other_ + if not isinstance(other, NvLinkInfo_v3): + return False + other_ = other + return (_cyb_memcmp((self._ptr), (other_._ptr), sizeof(nvmlNvLinkInfo_v3_t)) == 0) + + def __getbuffer__(self, _cyb_cpython.Py_buffer *buffer, int flags): + _cyb___getbuffer(self, buffer, self._ptr, sizeof(nvmlNvLinkInfo_v3_t), self._readonly) + + def __releasebuffer__(self, Py_buffer *buffer): + pass + + def __setitem__(self, key, val): + cdef _cyb_Py_buffer view + if key == 0: + if self._readonly: + raise ValueError("This NvLinkInfo_v3 instance is read-only") + _cyb_PyObject_GetBuffer(val, &view, _cyb_PyBUF_SIMPLE) + try: + if view.len < sizeof(nvmlNvLinkInfo_v3_t): + raise ValueError( + "source buffer too small: expected at least %d bytes, got %d" % (sizeof(nvmlNvLinkInfo_v3_t), view.len) + ) + _cyb_memmove(&self._data, view.buf, sizeof(nvmlNvLinkInfo_v3_t)) + self._ptr = &self._data + self._owner = None + self._readonly = view.readonly != 0 + finally: + _cyb_PyBuffer_Release(&view) + 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_v3 instance is read-only") + cdef NvlinkFirmwareInfo val_ = val + _cyb_memcpy(&(self._ptr[0].firmwareInfo), (val_._get_ptr()), sizeof(nvmlNvlinkFirmwareInfo_t) * 1) + + @property + def is_nvle_enabled(self): + """int: OUT - NVLINK encryption enablement.""" + return self._ptr[0].isNvleEnabled + + @is_nvle_enabled.setter + def is_nvle_enabled(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v3 instance is read-only") + self._ptr[0].isNvleEnabled = val + + @property + def is_nvle_ready(self): + """int: OUT - Whether NVLE is ready on the GPU.""" + return self._ptr[0].isNvleReady + + @is_nvle_ready.setter + def is_nvle_ready(self, val): + if self._readonly: + raise ValueError("This NvLinkInfo_v3 instance is read-only") + self._ptr[0].isNvleReady = val + + @staticmethod + def from_buffer(buffer): + """Create an NvLinkInfo_v3 instance with the memory from the given buffer.""" + return _cyb_from_buffer(buffer, sizeof(nvmlNvLinkInfo_v3_t), NvLinkInfo_v3) + + @staticmethod + def from_data(data): + """Create an NvLinkInfo_v3 instance wrapping the given NumPy array. + + Args: + data (_numpy.ndarray): a single-element array of dtype `nv_link_info_v3_dtype` holding the data. + """ + return _cyb_from_data(data, "nv_link_info_v3_dtype", nv_link_info_v3_dtype, NvLinkInfo_v3) + + @staticmethod + def from_ptr(intptr_t ptr, bint readonly=False, object owner=None): + """Create an NvLinkInfo_v3 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 NvLinkInfo_v3 obj = NvLinkInfo_v3.__new__(NvLinkInfo_v3) + if owner is None: + _cyb_memcpy(&obj._data, ptr, sizeof(nvmlNvLinkInfo_v3_t)) + obj._ptr = &obj._data + obj._owner = None + else: + obj._ptr = ptr + obj._owner = owner + obj._readonly = readonly + return obj + + cdef _get_pwr_model_metrics_dlppm1x_dtype_offsets(): cdef nvmlPwrModelMetricsDlppm1x_t pod return _numpy.dtype({ @@ -29415,6 +30654,10 @@ cpdef init_v2(): This method needs to be called once before any usage of NVML Library APIs. For all products. + .. note:: + With the environment variable ``NVML_MPS_DEVICE_ENUMERATION`` set to 1, this + API selects the MPS locality-domain view described in ``MPS Locality Domain + Device Enumeration``. .. note:: A reference count of the number of initializations is maintained, and a corresponding call to :func:`shutdown` needs to be issued once usage of the @@ -29443,6 +30686,10 @@ cpdef init_with_flags(unsigned int flags): flags (unsigned int): NVML_INIT_FLAG_* flags that can modify NVML Init behavior. + .. note:: + With the environment variable ``NVML_MPS_DEVICE_ENUMERATION`` set to 1, this + API selects the MPS locality-domain view. ``NVML_INIT_FLAG_NO_ATTACH`` is not + supported in that view. See ``MPS Locality Domain Device Enumeration``. .. note:: A reference count of the number of initializations is maintained, and a corresponding call to :func:`shutdown` needs to be issued once usage of the @@ -29467,6 +30714,9 @@ cpdef shutdown(): times than :func:`init_v2` or :func:`init_with_flags`. For all products. + .. note:: + The final matching shutdown releases the process-local MPS locality-domain view + described in ``MPS Locality Domain Device Enumeration``. .. seealso:: `nvmlShutdown` """ with nogil: @@ -29482,6 +30732,9 @@ cpdef str error_string(int result): Args: result (Return): NVML error code to convert. + .. note:: + This helper is available in the MPS locality-domain view described in ``MPS + Locality Domain Device Enumeration``. .. seealso:: `nvmlErrorString` """ cdef const char *_output_cstr_ @@ -29517,13 +30770,15 @@ cpdef str system_get_nvml_version(): """Retrieves the version of the NVML library. For all products. - The version identifier is an alphanumeric string. It will not exceed 80 - characters in length (including the NULL terminator). See - nvmlConstants::NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE. Returns: str: Reference in which to return the version identifier. + .. note:: + This query is available in the MPS locality-domain view described in ``MPS + Locality Domain Device Enumeration``. The version identifier is an alphanumeric + string. It will not exceed 80 characters in length (including the NULL + terminator). See nvmlConstants::NVML_SYSTEM_NVML_VERSION_BUFFER_SIZE. .. seealso:: `nvmlSystemGetNVMLVersion` """ cdef unsigned int length = 80 @@ -29538,7 +30793,7 @@ cpdef int system_get_cuda_driver_version() except *: """Retrieves the version of the CUDA driver. For all products. - The CUDA driver version returned will be retreived from the currently installed + The CUDA driver version returned will be retrieved from the currently installed version of CUDA. If the cuda library is not found, this function will return a known supported version number. @@ -29850,6 +31105,10 @@ cpdef unsigned int device_get_count_v2() except? 0: unsigned int: Reference in which to return the number of accessible devices. + .. note:: + In the MPS locality-domain view, this API returns the number of MPS-reported + device entries. Each locality domain has its own NVML index and + ``nvmlDevice_t`` handle. See ``MPS Locality Domain Device Enumeration``. .. seealso:: `nvmlDeviceGetCount_v2` """ cdef unsigned int device_count @@ -29919,6 +31178,9 @@ cpdef intptr_t device_get_handle_by_index_v2(unsigned int index) except? 0: Returns: intptr_t: Reference in which to return the device handle. + .. note:: + In the MPS locality-domain view, this API returns the locality-domain handle + associated with ``index``. See ``MPS Locality Domain Device Enumeration``. .. seealso:: `nvmlDeviceGetHandleByIndex_v2` """ cdef Device device @@ -29971,6 +31233,10 @@ cpdef intptr_t device_get_handle_by_uuid(uuid) except? 0: intptr_t: Reference in which to return the device handle or MIG device handle. + .. note:: + In the MPS locality-domain view, this API returns the locality-domain handle + whose MPS-provided UUID matches ``uuid``. See ``MPS Locality Domain Device + Enumeration``. .. seealso:: `nvmlDeviceGetHandleByUUID` """ if not isinstance(uuid, str): @@ -30007,6 +31273,11 @@ cpdef intptr_t device_get_handle_by_pci_bus_id_v2(pci_bus_id) except? 0: .. note:: NVML 4.304 and older version of nvmlDeviceGetHandleByPciBusId"_v1" returns NVML_ERROR_NOT_FOUND instead of NVML_ERROR_NO_PERMISSION. + .. note:: + In the MPS locality-domain view, multiple locality domains can share a PCI bus + ID. This API returns the first matching handle in NVML enumeration order. Use + UUID or index to select a specific locality domain. See ``MPS Locality Domain + Device Enumeration``. .. seealso:: `nvmlDeviceGetHandleByPciBusId_v2` """ if not isinstance(pci_bus_id, str): @@ -30036,6 +31307,9 @@ cpdef str device_get_name(intptr_t device): Returns: str: Reference in which to return the product name. + .. note:: + In the MPS locality-domain view, this API returns the name supplied by MPS for + the locality domain. See ``MPS Locality Domain Device Enumeration``. .. seealso:: `nvmlDeviceGetName` """ cdef unsigned int length = 96 @@ -30091,6 +31365,9 @@ cpdef unsigned int device_get_index(intptr_t device) except? 0: unsigned int: Reference in which to return the NVML index of the device. + .. note:: + In the MPS locality-domain view, this API returns the NVML index of the + locality-domain handle. See ``MPS Locality Domain Device Enumeration``. .. seealso:: `nvmlDeviceGetIndex` """ cdef unsigned int index @@ -30244,6 +31521,10 @@ cpdef object device_get_cpu_affinity(intptr_t device, unsigned int cpu_set_size) CPUs, 64 CPUs per unsigned long on 64-bit machines, 32 on 32-bit machines. + .. note:: + In the MPS locality-domain view, this API returns the CPU affinity of the + physical parent associated with the locality-domain handle. See ``MPS Locality + Domain Device Enumeration``. .. seealso:: `nvmlDeviceGetCpuAffinity` """ cdef _cyb_view.array _cpu_set_alloc_ = _cyb_view.array(shape=(max(cpu_set_size, 1),), itemsize=sizeof(unsigned long), format="L", mode="c") @@ -30295,6 +31576,9 @@ cpdef unsigned int device_get_numa_node_id(intptr_t device) except? 0: Returns: unsigned int: NUMA node ID of the device. + .. note:: + In the MPS locality-domain view, this API returns the NUMA node supplied by MPS + for the locality domain. See ``MPS Locality Domain Device Enumeration``. .. seealso:: `nvmlDeviceGetNumaNodeId` """ cdef unsigned int node @@ -30366,6 +31650,10 @@ cpdef int device_get_p2p_status(intptr_t device1, intptr_t device2, int p2p_inde int: Reference in which to return the status of the ``p2p_index`` between ``device1`` and ``device2``. + .. note:: + In the MPS locality-domain view, this API returns the directed P2P status + supplied by MPS for the two locality-domain handles. See ``MPS Locality Domain + Device Enumeration``. .. seealso:: `nvmlDeviceGetP2PStatus` """ cdef _GpuP2PStatus p2p_status @@ -30393,6 +31681,9 @@ cpdef str device_get_uuid(intptr_t device): Returns: str: Reference in which to return the GPU UUID. + .. note:: + In the MPS locality-domain view, this API returns the UUID supplied by MPS for + the locality domain. See ``MPS Locality Domain Device Enumeration``. .. seealso:: `nvmlDeviceGetUUID` """ cdef unsigned int length = 96 @@ -30669,6 +31960,11 @@ cpdef object device_get_pci_info_v3(intptr_t device): Returns: nvmlPciInfo_t: Reference in which to return the PCI info. + .. note:: + In the MPS locality-domain view, this API and its v1 and v2 variants return the + PCI attributes supplied by MPS. Multiple locality domains can report the same + physical parent's PCI attributes. See ``MPS Locality Domain Device + Enumeration``. .. seealso:: `nvmlDeviceGetPciInfo_v3` """ cdef PciInfo pci_py = PciInfo() @@ -31672,6 +32968,10 @@ cpdef object device_get_memory_info_v2(intptr_t device): On certain SOC platforms, the integrated GPU (iGPU) does not use a dedicated framebuffer but instead shares memory with the system. As a result, ``NVML_ERROR_NOT_SUPPORTED`` will be returned in this case. + .. note:: + In the MPS locality-domain view, this API returns MPS-provided total, used, + free, and reserved memory for the locality domain. See ``MPS Locality Domain + Device Enumeration``. .. seealso:: `nvmlDeviceGetMemoryInfo_v2` """ cdef Memory_v2 memory_py = Memory_v2() @@ -31727,6 +33027,10 @@ cpdef tuple device_get_cuda_compute_capability(intptr_t device): - int: Reference in which to return the minor CUDA compute capability. + .. note:: + In the MPS locality-domain view, this API returns the compute capability + supplied by MPS for the locality domain. See ``MPS Locality Domain Device + Enumeration``. .. seealso:: `nvmlDeviceGetCudaComputeCapability` """ cdef int major @@ -32666,7 +33970,7 @@ cpdef unsigned int device_get_bus_type(intptr_t device) except? 0: return. - - ``NVML_SUCCESS`` if the bus ``type`` is successfully retreived. + - ``NVML_SUCCESS`` if the bus ``type`` is successfully retrieved. - ``NVML_ERROR_UNINITIALIZED`` if the library has not been successfully initialized. - ``NVML_ERROR_INVALID_ARGUMENT`` if ``device`` is invalid or ``type`` is NULL. @@ -32966,6 +34270,10 @@ cpdef int device_get_accounting_mode(intptr_t device) except? -1: Returns: int: Reference in which to return the current accounting mode. + .. note:: + In the MPS locality-domain view, this API returns the physical parent's + accounting mode as reported by MPS. See ``MPS Locality Domain Device + Enumeration``. .. seealso:: `nvmlDeviceGetAccountingMode` """ cdef _EnableState mode @@ -37088,7 +38396,7 @@ cpdef object device_get_bank_remapper_status_v1(intptr_t device): Returns: nvmlEccBankRemapperStatus_v1_t: Reference to - ``nvmlEccBankRemapperStatus_t``. + ``nvmlEccBankRemapperStatus_v1_t``. .. seealso:: `nvmlDeviceGetBankRemapperStatus_v1` """ @@ -37100,6 +38408,174 @@ cpdef object device_get_bank_remapper_status_v1(intptr_t device): return p_bank_remapper_status_py +cpdef object device_get_gpu_uptime_v1(intptr_t device): + """Retrieves the GPU uptime. The uptime denotes the number of seconds elapsed since the GPU was initialized by the driver. The uptime resets to zero on a host reboot, driver unload/reload, or a GPU reset. + + For MIG device handles, the parent GPU uptime is returned. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlGpuUptime_v1_t: Reference in which to return the GPU uptime. + + .. seealso:: `nvmlDeviceGetGpuUptime_v1` + """ + cdef GpuUptime_v1 uptime_py = GpuUptime_v1() + cdef nvmlGpuUptime_v1_t *uptime = (uptime_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetGpuUptime_v1(device, uptime) + check_status(__status__) + return uptime_py + + +cpdef object system_get_conf_compute_settings_v2(): + """Get Conf Computing System Settings, version 2. + + Returns everything ``nvmlSystemGetConfComputeSettings`` reports, plus the TDISP + state of the GPUs in ``tdispState``. + All GPUs, and therefore all TDIs, are expected to be in the same state. If they + are not, the system level state is ambiguous and NVML_ERROR_UNKNOWN is + returned. + For Hopper ™️ or newer fully supported devices. Supported on Linux, Windows + TCC. + + Returns: + nvmlSystemConfComputeSettings_v2_t: System CC settings. + + .. seealso:: `nvmlSystemGetConfComputeSettings_v2` + """ + cdef SystemConfComputeSettings_v2 settings_py = SystemConfComputeSettings_v2() + cdef nvmlSystemConfComputeSettings_v2_t *settings = (settings_py._get_ptr()) + settings.version = NVML_VERSION_STRUCT(sizeof(nvmlSystemConfComputeSettings_v2_t), 2) + with nogil: + __status__ = nvmlSystemGetConfComputeSettings_v2(settings) + check_status(__status__) + return settings_py + + +cpdef object device_get_nvlink_info_v3(intptr_t device): + """Query NVLINK information associated with this device (v3). + + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlNvLinkInfo_v3_t: Reference to ``nvmlNvLinkInfo_v3_t``. + + .. seealso:: `nvmlDeviceGetNvLinkInfo_v3` + """ + cdef NvLinkInfo_v3 info_py = NvLinkInfo_v3() + cdef nvmlNvLinkInfo_v3_t *info = (info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetNvLinkInfo_v3(device, info) + check_status(__status__) + return info_py + + +cpdef object device_get_nvlink_remap_table_info_v1(intptr_t device): + """Get the NVLink remap table information. + + This API returns the remap table addresses for all the entries in the FLA and + SPA/GPA remap tables. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlNvlinkGetRemapTableInfo_v1_t: Reference to + ``nvmlNvlinkGetRemapTableInfo_v1_t`` struct. + + .. seealso:: `nvmlDeviceGetNvlinkRemapTableInfo_v1` + """ + cdef NvlinkGetRemapTableInfo_v1 remap_table_info_py = NvlinkGetRemapTableInfo_v1() + cdef nvmlNvlinkGetRemapTableInfo_v1_t *remap_table_info = (remap_table_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetNvlinkRemapTableInfo_v1(device, remap_table_info) + check_status(__status__) + return remap_table_info_py + + +cpdef device_set_nvlink_nvle_ready_v1(intptr_t device, set_nvle_ready): + """Set the NVLink NVLE ready state. + + This API signals whether NVLE (NVLink Encryption) is ready on the given device. + + Args: + device (intptr_t): The identifier of the target device. + set_nvle_ready (intptr_t): Reference to + ``nvmlNvlinkSetNvleReady_v1_t`` struct. + + .. seealso:: `nvmlDeviceSetNvlinkNvleReady_v1` + """ + cdef intptr_t _set_nvle_ready_ptr_ = 0 if set_nvle_ready is None else int(set_nvle_ready) + with nogil: + __status__ = nvmlDeviceSetNvlinkNvleReady_v1(device, _set_nvle_ready_ptr_) + check_status(__status__) + + +cpdef device_lock_nvlink_remap_table_v1(intptr_t device, remap_table_lock_info): + """Lock the NVLink remap table to prevent MSE from making further updates. + + This API requests to lock the remap table to prevent MSE (Multi-Socket Engine) + from making any further updates to the remap table for the given links. + + Args: + device (intptr_t): The identifier of the target device. + remap_table_lock_info (intptr_t): Reference to + ``nvmlNvlinkLockRemapTable_v1_t`` struct. + + .. seealso:: `nvmlDeviceLockNvlinkRemapTable_v1` + """ + cdef intptr_t _remap_table_lock_info_ptr_ = 0 if remap_table_lock_info is None else int(remap_table_lock_info) + with nogil: + __status__ = nvmlDeviceLockNvlinkRemapTable_v1(device, _remap_table_lock_info_ptr_) + check_status(__status__) + + +cpdef device_setup_nvlink_nvle_encryption_key_v1(intptr_t device, encryption_key): + """Setup the NVLink NVLE encryption key. + + This API sets the NVLE encryption key between GPUs with the given ALIDs. + + Args: + device (intptr_t): The identifier of the target device. + encryption_key (intptr_t): Reference to + ``nvmlNvlinkSetupNvleEncryptionKey_v1_t`` struct. + + .. seealso:: `nvmlDeviceSetupNvlinkNvleEncryptionKey_v1` + """ + cdef intptr_t _encryption_key_ptr_ = 0 if encryption_key is None else int(encryption_key) + with nogil: + __status__ = nvmlDeviceSetupNvlinkNvleEncryptionKey_v1(device, _encryption_key_ptr_) + check_status(__status__) + + +cpdef object device_get_nvlink_nvle_private_info_v1(intptr_t device): + """Get NVLink NVLE private (opaque) information. + + This API retrieves opaque NVLE private information for the given device and + copies it into the ``data`` buffer, setting ``size`` to the number of bytes + written. + + Args: + device (intptr_t): The identifier of the target device. + + Returns: + nvmlNvlinkNvlePrivateInfo_v1_t: Reference to + ``nvmlNvlinkNvlePrivateInfo_v1_t`` struct. + + .. seealso:: `nvmlDeviceGetNvlinkNvlePrivateInfo_v1` + """ + cdef NvlinkNvlePrivateInfo_v1 private_info_py = NvlinkNvlePrivateInfo_v1() + cdef nvmlNvlinkNvlePrivateInfo_v1_t *private_info = (private_info_py._get_ptr()) + with nogil: + __status__ = nvmlDeviceGetNvlinkNvlePrivateInfo_v1(device, private_info) + check_status(__status__) + return private_info_py + + cpdef str system_get_driver_branch(): """Retrieves the driver branch of the NVIDIA driver installed on the system. diff --git a/cuda_bindings_13/cuda/bindings/nvrtc.pxd b/cuda_bindings_13/cuda/bindings/nvrtc.pxd index 247992ac87d..240bae861e4 100644 --- a/cuda_bindings_13/cuda/bindings/nvrtc.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=7b6ce83d58b42aae0455e262bb73a1c97c41e08e4ed6c8ec7dfb74e3cc754202 +# This code was automatically generated with version 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=8624adff129b8d53ce64f44d09df5e98e9d67618f93d357aff7b386453ad5e1a cimport cuda.bindings.cynvrtc as cynvrtc include "_lib/utils.pxd" diff --git a/cuda_bindings_13/cuda/bindings/nvrtc.pyx b/cuda_bindings_13/cuda/bindings/nvrtc.pyx index a44c48b935d..e79f81603a0 100644 --- a/cuda_bindings_13/cuda/bindings/nvrtc.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=014131536ed098f8c76a069b25d8ff44edd3f2554ae23b127e1b686ae2d6a69d +# This code was automatically generated with version 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=cfe234e76ab16f38dab987b5feb5ec9ee56d72604f8613b3a1ec2d7391acfd59 from typing import Any, Optional import cython import ctypes diff --git a/cuda_bindings_13/cuda/bindings/nvvm.pxd b/cuda_bindings_13/cuda/bindings/nvvm.pxd index 9e78ece8069..cd7e3cd5257 100644 --- a/cuda_bindings_13/cuda/bindings/nvvm.pxd +++ b/cuda_bindings_13/cuda/bindings/nvvm.pxd @@ -2,8 +2,9 @@ # # SPDX-License-Identifier: Apache-2.0 # -# This code was automatically generated across versions from 12.0.1 to 13.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=ee88a87ab53668207e31e3b38c1593a3cd3724e02300ebea7574aafb509bb3b6 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=831cab73f0e9b5604c76de87c01625a63e6315a8acc224055c922881802cebc8 diff --git a/cuda_bindings_13/cuda/bindings/nvvm.pyx b/cuda_bindings_13/cuda/bindings/nvvm.pyx index 75d6a4723cf..dcd45962249 100644 --- a/cuda_bindings_13/cuda/bindings/nvvm.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d8933fb727fe70e6c790346a9c502409553a5f982b92288b6044a85229e6ce48 +# This code was automatically generated across versions from 12.0.1 to 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=90f0855f2c44ec303ab33a7a295adc1f822fd7458bdb6687d67cee0a23e016c4 # <<<< PREAMBLE CONTENT >>>> @@ -323,6 +324,9 @@ cpdef compile_program(intptr_t prog, int num_options, options): architectures (compute capability compute_100 or greater). Using this option implies that the operations in incoming ``prog`` are compliant with targeted PTX version. If not set, highest available PTX version is used. + - -nvvm-latest Use the most recent LLVM-based NVVM release. Previews this newer + NVVM on all GPU architectures. No-op for Blackwell and later where it is + already the default. Args: prog (intptr_t): NVVM program. @@ -453,7 +457,7 @@ cpdef int llvm_version(arch) except? 0: arch (str): Architecture string. Returns: - int: IR version number. + int: LLVM IR version number. .. seealso:: `nvvmLLVMVersion` """ diff --git a/cuda_bindings_13/cuda/bindings/runtime.pxd b/cuda_bindings_13/cuda/bindings/runtime.pxd index e2c1125c753..85e6d6b061b 100644 --- a/cuda_bindings_13/cuda/bindings/runtime.pxd +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=9aed2c4f6e06c8af7d8e05b8da369992de701809a2165dc6bd0cc05e135934f5 +# This code was automatically generated with version 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=b602e308933d3b20cc1ee6846aabc92efc279a9a39a14ccf01dc713477f04962 cimport cuda.bindings.cyruntime as cyruntime include "_lib/utils.pxd" @@ -3413,6 +3414,83 @@ cdef class cudaConditionalNodeParams: cdef cudaExecutionContext_t _ctx +cdef class cudaMemcpyBatchNodeParams: + """ + CUDA Batch Memcpy Node Parameters + + Attributes + ---------- + + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays. This field cannot be + updated in an instantiated graph. + + + dsts : Any + Array of destination pointers. This field can be updated in an + instantiated graph. + + + srcs : Any + Array of source pointers. This field can be updated in an + instantiated graph. + + + sizes : size_t + Array of sizes for memcpy operations. This field can be updated in + an instantiated graph. A size of 0 disables the individual copy + operation. + + + attrs : cudaMemcpyAttributes + Array of memcpy attributes. This field cannot be updated in an + instantiated graph. + + + attrsIdxs : size_t + Array of indices specifying which copies each entry in `attrs` + applies to. The array contents cannot be updated in an instantiated + graph. + + + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. The array contents cannot + be updated in an instantiated graph. + + + ctx : cudaExecutionContext_t + Preferred CUDA Execution Context to use for the copies. This field + cannot be updated in an instantiated graph. + + + Methods + ------- + getPtr() + Get memory address of class instance + """ + cdef object _owner + cdef cyruntime.cudaMemcpyBatchNodeParams _pvt_val + cdef cyruntime.cudaMemcpyBatchNodeParams* _pvt_ptr + + cdef _HelperKernelParams _cydsts + + + cdef _HelperKernelParams _cysrcs + + + cdef _HelperInputVoidPtr _cysizes + + + cdef size_t _attrs_length + cdef cyruntime.cudaMemcpyAttributes* _attrs + + + cdef _HelperInputVoidPtr _cyattrsIdxs + + + cdef cudaExecutionContext_t _ctx + + cdef class cudaChildGraphNodeParams: """ Child graph node parameters @@ -3556,6 +3634,10 @@ cdef class cudaGraphNodeParams: Conditional node parameters. + memcpyBatch : cudaMemcpyBatchNodeParams + Batch memcpy node parameters. + + Methods ------- getPtr() @@ -3601,6 +3683,9 @@ cdef class cudaGraphNodeParams: cdef cudaConditionalNodeParams _conditional + cdef cudaMemcpyBatchNodeParams _memcpyBatch + + cdef class cudaGraphEdgeData_st: """ Optional annotation for edges in a CUDA graph. Note, all edges diff --git a/cuda_bindings_13/cuda/bindings/runtime.pyx b/cuda_bindings_13/cuda/bindings/runtime.pyx index a0486b038cf..26bf0bbcafd 100644 --- a/cuda_bindings_13/cuda/bindings/runtime.pyx +++ b/cuda_bindings_13/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.4.1. Do not modify it directly. -# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=4cc5d08de16bc7cac781ba6e469ffe16b0d8e30beea5ec6f5e579f0fae24e834 +# This code was automatically generated with version 13.5.0. Do not modify it directly. +# !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +# CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=d89a0bb18c16c19f1c64d88495ed9169e0a21055a530efd0e41f1fc973cfa4f9 from typing import Any, Optional import cython import ctypes @@ -260,6 +261,13 @@ cudaNvSciSyncAttrSignal = cyruntime.cudaNvSciSyncAttrSignal #: to be filled by :py:obj:`~.cudaDeviceGetNvSciSyncAttributes`. cudaNvSciSyncAttrWait = cyruntime.cudaNvSciSyncAttrWait +#: Special value for localityDomainId when cudaDevSmResourceSplit is called +#: with cudaDevSmResourceGroupLocalityDomainId. Selects SMs from the union +#: of all available locality domains in the input SM resource. See also: +#: cudaDevSmResourceGroupLocalityDomainId for the set of SMs in a single +#: locality domain. +cudaDevSmResourceGroupLocalityDomainIdAny = cyruntime.cudaDevSmResourceGroupLocalityDomainIdAny + #: This port activates when the kernel has finished executing. cudaGraphKernelNodePortDefault = cyruntime.cudaGraphKernelNodePortDefault @@ -4931,6 +4939,15 @@ class cudaDeviceAttr(_FastEnum): 'Number of multiprocessors on each locality domain\n' ) + + cudaDevAttrTensorMapLargeTensorMinSize = ( + cyruntime.cudaDeviceAttr.cudaDevAttrTensorMapLargeTensorMinSize, + 'Smallest tensor size in bytes at which TMA descriptors are treated as\n' + '"large" (BASE_128KB OOB mode). tensors >= this threshold are eligible for\n' + 'the tensormap.replace.assume_large PTX modifier. Returns INT_MAX on devices\n' + 'without this distinction where assume_large is a no-op.\n' + ) + cudaDevAttrMax = cyruntime.cudaDeviceAttr.cudaDevAttrMax class cudaMemPoolAttr(_FastEnum): @@ -5527,7 +5544,10 @@ class cudaDevSmResourceGroup_flags(_FastEnum): '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' + 'cudaErrorInvalidResourceConfiguration is returned. When used with\n' + '`cudaDevSmResourceGroupLocalityDomainNonPortableId`, backfill follows the\n' + 'same behavior after first consuming all SMs from the target locality\n' + 'domain.\n' ) @@ -5537,6 +5557,14 @@ class cudaDevSmResourceGroup_flags(_FastEnum): 'localityDomainId\n' ) + + cudaDevSmResourceGroupLocalityDomainSupplementalSms = ( + cyruntime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupLocalityDomainSupplementalSms, + 'Modifier to `cudaDevSmResourceGroupLocalityDomainId` which allows selection\n' + 'of SMs in the locality domain exceeding the\n' + ':py:obj:`~.cudaDeviceAttr.cudaDevAttrLocalityDomainMultiprocessorCount`.\n' + ) + class cudaDevSmResourceSplitByCount_flags(_FastEnum): """ @@ -6022,11 +6050,23 @@ class cudaGraphNodeType(_FastEnum): ) + cudaGraphNodeTypeMemcpyBatch = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeMemcpyBatch, + 'Batch Memcpy Node\n' + ) + + cudaGraphNodeTypeReserved16 = ( cyruntime.cudaGraphNodeType.cudaGraphNodeTypeReserved16, 'Reserved.\n' ) + + cudaGraphNodeTypeExternalEngine = ( + cyruntime.cudaGraphNodeType.cudaGraphNodeTypeExternalEngine, + 'Reserved for External Engine node\n' + ) + cudaGraphNodeTypeCount = cyruntime.cudaGraphNodeType.cudaGraphNodeTypeCount class cudaGraphChildGraphNodeOwnership(_FastEnum): @@ -6275,6 +6315,12 @@ class cudaGraphDebugDotFlags(_FastEnum): 'Adds :py:obj:`~.cudaConditionalNodeParams` to output\n' ) + + cudaGraphDebugDotFlagsMemcpyBatchNodeParams = ( + cyruntime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyBatchNodeParams, + 'Adds batch memcpy node parameters to the output\n' + ) + class cudaGraphInstantiateFlags(_FastEnum): """ Flags for instantiating a graph @@ -17163,6 +17209,232 @@ cdef class cudaConditionalNodeParams: self._ctx._pvt_ptr[0] = cyctx +cdef class cudaMemcpyBatchNodeParams: + """ + CUDA Batch Memcpy Node Parameters + + Attributes + ---------- + + count : size_t + Size of `dsts`, `srcs` and `sizes` arrays. This field cannot be + updated in an instantiated graph. + + + dsts : Any + Array of destination pointers. This field can be updated in an + instantiated graph. + + + srcs : Any + Array of source pointers. This field can be updated in an + instantiated graph. + + + sizes : size_t + Array of sizes for memcpy operations. This field can be updated in + an instantiated graph. A size of 0 disables the individual copy + operation. + + + attrs : cudaMemcpyAttributes + Array of memcpy attributes. This field cannot be updated in an + instantiated graph. + + + attrsIdxs : size_t + Array of indices specifying which copies each entry in `attrs` + applies to. The array contents cannot be updated in an instantiated + graph. + + + numAttrs : size_t + Size of `attrs` and `attrsIdxs` arrays. The array contents cannot + be updated in an instantiated graph. + + + ctx : cudaExecutionContext_t + Preferred CUDA Execution Context to use for the copies. This field + cannot be updated in an instantiated graph. + + + 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): + self._ctx = cudaExecutionContext_t(_ptr=&self._pvt_ptr[0].ctx) + def __dealloc__(self): + if self._attrs is not NULL: + free(self._attrs) + self._pvt_ptr[0].attrs = NULL + def getPtr(self): + return self._pvt_ptr + def __repr__(self): + if self._pvt_ptr is not NULL: + str_list = [] + + try: + str_list += ['count : ' + str(self.count)] + except ValueError: + str_list += ['count : '] + + + try: + str_list += ['dsts : ' + str(self.dsts)] + except ValueError: + str_list += ['dsts : '] + + + try: + str_list += ['srcs : ' + str(self.srcs)] + except ValueError: + str_list += ['srcs : '] + + + try: + str_list += ['sizes : ' + str(self.sizes)] + except ValueError: + str_list += ['sizes : '] + + + try: + str_list += ['attrs : ' + str(self.attrs)] + except ValueError: + str_list += ['attrs : '] + + + try: + str_list += ['attrsIdxs : ' + str(self.attrsIdxs)] + except ValueError: + str_list += ['attrsIdxs : '] + + + try: + str_list += ['numAttrs : ' + str(self.numAttrs)] + except ValueError: + str_list += ['numAttrs : '] + + + try: + str_list += ['ctx : ' + str(self.ctx)] + except ValueError: + str_list += ['ctx : '] + + return '\n'.join(str_list) + else: + return '' + + @property + def count(self): + return self._pvt_ptr[0].count + @count.setter + def count(self, size_t count): + self._pvt_ptr[0].count = count + + + @property + def dsts(self): + return self._pvt_ptr[0].dsts + @dsts.setter + def dsts(self, dsts): + self._cydsts = _HelperKernelParams(dsts) + self._pvt_ptr[0].dsts = self._cydsts.ckernelParams + + + @property + def srcs(self): + return self._pvt_ptr[0].srcs + @srcs.setter + def srcs(self, srcs): + self._cysrcs = _HelperKernelParams(srcs) + self._pvt_ptr[0].srcs = self._cysrcs.ckernelParams + + + @property + def sizes(self): + return self._pvt_ptr[0].sizes + @sizes.setter + def sizes(self, sizes): + self._cysizes = _HelperInputVoidPtr(sizes) + self._pvt_ptr[0].sizes = self._cysizes.cptr + + + @property + def attrs(self): + if self._pvt_ptr[0].attrs == NULL: + return [] + out_attrs = [cudaMemcpyAttributes() for _idx in range(self._pvt_ptr[0].numAttrs)] + for _idx in range(len(out_attrs)): + string.memcpy(out_attrs[_idx].getPtr(), &self._pvt_ptr[0].attrs[_idx], sizeof(cyruntime.cudaMemcpyAttributes)) + return out_attrs + @attrs.setter + def attrs(self, val): + cdef cyruntime.cudaMemcpyAttributes* _attrs_new + if len(val) == 0: + free(self._attrs) + self._attrs = NULL + self._attrs_length = 0 + self._pvt_ptr[0].numAttrs = 0 + self._pvt_ptr[0].attrs = NULL + else: + if self._attrs_length != len(val): + _attrs_new = calloc(len(val), sizeof(cyruntime.cudaMemcpyAttributes)) + if _attrs_new is NULL: + raise MemoryError('Failed to allocate length x size memory: ' + str(len(val)) + 'x' + str(sizeof(cyruntime.cudaMemcpyAttributes))) + for idx in range(len(val)): + string.memcpy(&_attrs_new[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemcpyAttributes)) + free(self._attrs) + self._attrs = _attrs_new + self._attrs_length = len(val) + self._pvt_ptr[0].numAttrs = len(val) + self._pvt_ptr[0].attrs = _attrs_new + else: + for idx in range(len(val)): + string.memcpy(&self._attrs[idx], (val[idx])._pvt_ptr, sizeof(cyruntime.cudaMemcpyAttributes)) + self._pvt_ptr[0].numAttrs = len(val) + + + @property + def attrsIdxs(self): + return self._pvt_ptr[0].attrsIdxs + @attrsIdxs.setter + def attrsIdxs(self, attrsIdxs): + self._cyattrsIdxs = _HelperInputVoidPtr(attrsIdxs) + self._pvt_ptr[0].attrsIdxs = self._cyattrsIdxs.cptr + + + @property + def numAttrs(self): + return self._pvt_ptr[0].numAttrs + @numAttrs.setter + def numAttrs(self, size_t numAttrs): + self._pvt_ptr[0].numAttrs = numAttrs + + + @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 cudaChildGraphNodeParams: """ Child graph node parameters @@ -17443,6 +17715,10 @@ cdef class cudaGraphNodeParams: Conditional node parameters. + memcpyBatch : cudaMemcpyBatchNodeParams + Batch memcpy node parameters. + + Methods ------- getPtr() @@ -17479,6 +17755,8 @@ cdef class cudaGraphNodeParams: self._free._owner = self self._conditional = cudaConditionalNodeParams(_ptr=&self._pvt_ptr[0].conditional) self._conditional._owner = self + self._memcpyBatch = cudaMemcpyBatchNodeParams(_ptr=&self._pvt_ptr[0].memcpyBatch) + self._memcpyBatch._owner = self def __dealloc__(self): self._kernel = None self._memcpy = None @@ -17492,6 +17770,7 @@ cdef class cudaGraphNodeParams: self._alloc = None self._free = None self._conditional = None + self._memcpyBatch = None if self._val_ptr is not NULL: free(self._val_ptr) def getPtr(self): @@ -17577,6 +17856,12 @@ cdef class cudaGraphNodeParams: except ValueError: str_list += ['conditional : '] + + try: + str_list += ['memcpyBatch :\n' + '\n'.join([' ' + line for line in str(self.memcpyBatch).splitlines()])] + except ValueError: + str_list += ['memcpyBatch : '] + return '\n'.join(str_list) else: return '' @@ -17685,6 +17970,14 @@ cdef class cudaGraphNodeParams: string.memcpy(&self._pvt_ptr[0].conditional, conditional.getPtr(), sizeof(self._pvt_ptr[0].conditional)) + @property + def memcpyBatch(self): + return self._memcpyBatch + @memcpyBatch.setter + def memcpyBatch(self, memcpyBatch not None : cudaMemcpyBatchNodeParams): + string.memcpy(&self._pvt_ptr[0].memcpyBatch, memcpyBatch.getPtr(), sizeof(self._pvt_ptr[0].memcpyBatch)) + + cdef class cudaGraphEdgeData_st: """ Optional annotation for edges in a CUDA graph. Note, all edges @@ -22026,20 +22319,22 @@ def cudaSetDevice(int device): `device`. Any streams or events created from this host thread will be associated with `device`. Any kernels launched from this host thread using the <<<>>> operator or :py:obj:`~.cudaLaunchKernel()` will be - executed on `device`. + executed on `device` when using the NULL or per-thread streams + (otherwise, they will be executed on the device associated with the + stream). This call may be made from any host thread, to any device, and at any time. This function will do no synchronization with the previous or new device, and should only take significant time when it initializes the runtime's context state. This call will bind the primary context of the specified device to the calling thread and all the subsequent memory - allocations, stream and event creations, and kernel launches will be - associated with the primary context. This function will also - immediately initialize the runtime state on the primary context, and - the context will be current on `device` immediately. This function will - return an error if the device is in - :py:obj:`~.cudaComputeModeExclusiveProcess` and is occupied by another - process or if the device is in :py:obj:`~.cudaComputeModeProhibited`. + allocations, stream and event creations will be associated with the + primary context. This function will also immediately initialize the + runtime state on the primary context, and the context will be current + on `device` immediately. This function will return an error if the + device is in :py:obj:`~.cudaComputeModeExclusiveProcess` and is + occupied by another process or if the device is in + :py:obj:`~.cudaComputeModeProhibited`. It is not required to call :py:obj:`~.cudaInitDevice` before using this function. @@ -22677,7 +22972,7 @@ def cudaStreamDestroy(stream): Returns ------- cudaError_t - :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` :py:obj:`~.cudaErrorExternalDevice` + :py:obj:`~.cudaSuccess`, :py:obj:`~.cudaErrorInvalidValue`, :py:obj:`~.cudaErrorInvalidResourceHandle` See Also -------- @@ -32213,6 +32508,8 @@ def cudaGraphAddKernelNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t Notes ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. + Kernels launched using graphs must not use texture and surface references. Reading or writing through any texture or surface reference is undefined behavior. This restriction does not apply to texture and surface objects. """ pDependencies = [] if pDependencies is None else pDependencies @@ -32277,6 +32574,10 @@ def cudaGraphKernelNodeGetParams(node): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphKernelNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -32314,6 +32615,10 @@ def cudaGraphKernelNodeSetParams(node, pNodeParams : Optional[cudaKernelNodePara See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphKernelNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -32489,6 +32794,10 @@ def cudaGraphAddMemcpyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaMemcpy3D`, :py:obj:`~.cudaGraphAddMemcpyNodeToSymbol`, :py:obj:`~.cudaGraphAddMemcpyNodeFromSymbol`, :py:obj:`~.cudaGraphAddMemcpyNode1D`, :py:obj:`~.cudaGraphMemcpyNodeGetParams`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -32637,6 +32946,10 @@ def cudaGraphMemcpyNodeGetParams(node): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaMemcpy3D`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -32674,6 +32987,10 @@ def cudaGraphMemcpyNodeSetParams(node, pNodeParams : Optional[cudaMemcpy3DParms] See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaMemcpy3D`, :py:obj:`~.cudaGraphMemcpyNodeSetParamsToSymbol`, :py:obj:`~.cudaGraphMemcpyNodeSetParamsFromSymbol`, :py:obj:`~.cudaGraphMemcpyNodeSetParams1D`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -32783,6 +33100,10 @@ def cudaGraphAddMemsetNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaGraphMemsetNodeGetParams`, :py:obj:`~.cudaGraphMemsetNodeSetParams`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -32837,6 +33158,10 @@ def cudaGraphMemsetNodeGetParams(node): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphMemsetNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -32874,6 +33199,10 @@ def cudaGraphMemsetNodeSetParams(node, pNodeParams : Optional[cudaMemsetParams]) See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaMemset2D`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphMemsetNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -32923,6 +33252,10 @@ def cudaGraphAddHostNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaLaunchHostFunc`, :py:obj:`~.cudaGraphHostNodeGetParams`, :py:obj:`~.cudaGraphHostNodeSetParams`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -32977,6 +33310,10 @@ def cudaGraphHostNodeGetParams(node): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaLaunchHostFunc`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphHostNodeSetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -33014,6 +33351,10 @@ def cudaGraphHostNodeSetParams(node, pNodeParams : Optional[cudaHostNodeParams]) See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaLaunchHostFunc`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphHostNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -33066,6 +33407,10 @@ def cudaGraphAddChildGraphNode(graph, pDependencies : Optional[tuple[cudaGraphNo See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphChildGraphNodeGetGraph`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphClone` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ cdef cyruntime.cudaGraph_t cychildGraph if childGraph is None: @@ -33132,6 +33477,10 @@ def cudaGraphChildGraphNodeGetGraph(node): See Also -------- :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphNodeFindInClone` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -33184,6 +33533,10 @@ def cudaGraphAddEmptyNode(graph, pDependencies : Optional[tuple[cudaGraphNode_t] See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -33253,6 +33606,10 @@ def cudaGraphAddEventRecordNode(graph, pDependencies : Optional[tuple[cudaGraphN See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ cdef cyruntime.cudaEvent_t cyevent if event is None: @@ -33314,6 +33671,10 @@ def cudaGraphEventRecordNodeGetEvent(node): See Also -------- :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphEventWaitNodeGetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -33351,6 +33712,10 @@ def cudaGraphEventRecordNodeSetEvent(node, event): See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphEventRecordNodeGetEvent`, :py:obj:`~.cudaGraphEventWaitNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaEvent_t cyevent if event is None: @@ -33412,6 +33777,10 @@ def cudaGraphAddEventWaitNode(graph, pDependencies : Optional[tuple[cudaGraphNod See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ cdef cyruntime.cudaEvent_t cyevent if event is None: @@ -33473,6 +33842,10 @@ def cudaGraphEventWaitNodeGetEvent(node): See Also -------- :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphEventRecordNodeGetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -33510,6 +33883,10 @@ def cudaGraphEventWaitNodeSetEvent(node, event): See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphEventWaitNodeGetEvent`, :py:obj:`~.cudaGraphEventRecordNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaEvent_t cyevent if event is None: @@ -33567,6 +33944,10 @@ def cudaGraphAddExternalSemaphoresSignalNode(graph, pDependencies : Optional[tup See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeGetParams`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -33627,6 +34008,10 @@ def cudaGraphExternalSemaphoresSignalNodeGetParams(hNode): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cyhNode if hNode is None: @@ -33665,6 +34050,10 @@ def cudaGraphExternalSemaphoresSignalNodeSetParams(hNode, nodeParams : Optional[ See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cyhNode if hNode is None: @@ -33715,6 +34104,10 @@ def cudaGraphAddExternalSemaphoresWaitNode(graph, pDependencies : Optional[tuple See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeGetParams`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -33775,6 +34168,10 @@ def cudaGraphExternalSemaphoresWaitNodeGetParams(hNode): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaLaunchKernel`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cyhNode if hNode is None: @@ -33813,6 +34210,10 @@ def cudaGraphExternalSemaphoresWaitNodeSetParams(hNode, nodeParams : Optional[cu See Also -------- :py:obj:`~.cudaGraphNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cyhNode if hNode is None: @@ -33902,6 +34303,10 @@ def cudaGraphAddMemAllocNode(graph, pDependencies : Optional[tuple[cudaGraphNode See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaGraphMemAllocNodeGetParams`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -33959,6 +34364,10 @@ def cudaGraphMemAllocNodeGetParams(node): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphMemFreeNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -34028,6 +34437,10 @@ def cudaGraphAddMemFreeNode(graph, pDependencies : Optional[tuple[cudaGraphNode_ See Also -------- :py:obj:`~.cudaGraphAddNode`, :py:obj:`~.cudaGraphAddMemAllocNode`, :py:obj:`~.cudaGraphMemFreeNodeGetParams`, :py:obj:`~.cudaDeviceGraphMemTrim`, :py:obj:`~.cudaDeviceGetGraphMemAttribute`, :py:obj:`~.cudaDeviceSetGraphMemAttribute`, :py:obj:`~.cudaMallocAsync`, :py:obj:`~.cudaFreeAsync`, :py:obj:`~.cudaGraphCreate`, :py:obj:`~.cudaGraphDestroyNode`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphAddEmptyNode`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphAddMemsetNode` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphAddNode`. """ pDependencies = [] if pDependencies is None else pDependencies if not all(isinstance(_x, (cudaGraphNode_t,driver.CUgraphNode)) for _x in pDependencies): @@ -34084,6 +34497,10 @@ def cudaGraphMemFreeNodeGetParams(node): See Also -------- :py:obj:`~.cudaGraphNodeGetParams`, :py:obj:`~.cudaGraphAddMemFreeNode`, :py:obj:`~.cudaGraphMemFreeNodeGetParams` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphNodeGetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -35569,6 +35986,10 @@ def cudaGraphExecKernelNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddKernelNode`, :py:obj:`~.cudaGraphKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -35631,6 +36052,10 @@ def cudaGraphExecMemcpyNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddMemcpyNode`, :py:obj:`~.cudaGraphMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParamsToSymbol`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParamsFromSymbol`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams1D`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -35770,6 +36195,10 @@ def cudaGraphExecMemsetNodeSetParams(hGraphExec, node, pNodeParams : Optional[cu See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddMemsetNode`, :py:obj:`~.cudaGraphMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -35822,6 +36251,10 @@ def cudaGraphExecHostNodeSetParams(hGraphExec, node, pNodeParams : Optional[cuda See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddHostNode`, :py:obj:`~.cudaGraphHostNodeSetParams`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cynode if node is None: @@ -35882,6 +36315,10 @@ def cudaGraphExecChildGraphNodeSetParams(hGraphExec, node, childGraph): See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddChildGraphNode`, :py:obj:`~.cudaGraphChildGraphNodeGetGraph`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaGraph_t cychildGraph if childGraph is None: @@ -35942,6 +36379,10 @@ def cudaGraphExecEventRecordNodeSetEvent(hGraphExec, hNode, event): See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddEventRecordNode`, :py:obj:`~.cudaGraphEventRecordNodeGetEvent`, :py:obj:`~.cudaGraphEventWaitNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaEvent_t cyevent if event is None: @@ -36002,6 +36443,10 @@ def cudaGraphExecEventWaitNodeSetEvent(hGraphExec, hNode, event): See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddEventWaitNode`, :py:obj:`~.cudaGraphEventWaitNodeGetEvent`, :py:obj:`~.cudaGraphEventRecordNodeSetEvent`, :py:obj:`~.cudaEventRecordWithFlags`, :py:obj:`~.cudaStreamWaitEvent`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaEvent_t cyevent if event is None: @@ -36066,6 +36511,10 @@ def cudaGraphExecExternalSemaphoresSignalNodeSetParams(hGraphExec, hNode, nodePa See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresSignalNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresWaitNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cyhNode if hNode is None: @@ -36123,6 +36572,10 @@ def cudaGraphExecExternalSemaphoresWaitNodeSetParams(hGraphExec, hNode, nodePara See Also -------- :py:obj:`~.cudaGraphExecNodeSetParams`, :py:obj:`~.cudaGraphAddExternalSemaphoresWaitNode`, :py:obj:`~.cudaImportExternalSemaphore`, :py:obj:`~.cudaSignalExternalSemaphoresAsync`, :py:obj:`~.cudaWaitExternalSemaphoresAsync`, :py:obj:`~.cudaGraphExecKernelNodeSetParams`, :py:obj:`~.cudaGraphExecMemcpyNodeSetParams`, :py:obj:`~.cudaGraphExecMemsetNodeSetParams`, :py:obj:`~.cudaGraphExecHostNodeSetParams`, :py:obj:`~.cudaGraphExecChildGraphNodeSetParams`, :py:obj:`~.cudaGraphExecEventRecordNodeSetEvent`, :py:obj:`~.cudaGraphExecEventWaitNodeSetEvent`, :py:obj:`~.cudaGraphExecExternalSemaphoresSignalNodeSetParams`, :py:obj:`~.cudaGraphExecUpdate`, :py:obj:`~.cudaGraphInstantiate` + + Notes + ----- + This function will be deprecated in a future CUDA release. Please migrate to :py:obj:`~.cudaGraphExecNodeSetParams`. """ cdef cyruntime.cudaGraphNode_t cyhNode if hNode is None: @@ -37402,7 +37855,7 @@ def cudaGetDriverEntryPointByVersion(char* symbol, unsigned int cudaVersion, uns example, for the driver API :py:obj:`~.cuMemAlloc_v2`, `symbol` would be cuMemAlloc. cudaVersion : unsigned int - The CUDA version to look for the requested driver symbol + The CUDA version to look for the requested driver symbol. flags : unsigned long long Flags to specify search options. @@ -38266,7 +38719,25 @@ def cudaDevSmResourceSplit(unsigned int nbGroups, input_ : Optional[cudaDevResou 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. + :py:obj:`~.cudaErrorInvalidResourceConfiguration` is returned. When + used with `cudaDevSmResourceGroupLocalityDomainSupplementalSms`, + backfill follows the same behavior after first consuming all SMs from + the target locality domain. + + - `cudaDevSmResourceGroupLocalityDomainId:` Specifies that the SM + partition should be localized to the specified `localityDomainId`. + + - `cudaDevSmResourceGroupLocalityDomainSupplementalSms:` Modifier to + `cudaDevSmResourceGroupLocalityDomainId` which allows selection of SMs + in the locality domain exceeding the + :py:obj:`~.cudaDeviceAttr.cudaDevAttrLocalityDomainMultiprocessorCount`. + + - `localityDomainId:` Specifies the locality domain that the + partitioned SMs must be located on. Only valid when + `cudaDevSmResourceGroupLocalityDomainId` is set in flags. The + special value `cudaDevSmResourceGroupLocalityDomainIdAny` specifies + that the partitioned SMs must be selected from the union of all + available locality domains in the input SM resource. Example params and their effect: @@ -40540,6 +41011,9 @@ def sizeof(objType): if objType == cudaConditionalNodeParams: return sizeof(cyruntime.cudaConditionalNodeParams) + if objType == cudaMemcpyBatchNodeParams: + return sizeof(cyruntime.cudaMemcpyBatchNodeParams) + if objType == cudaChildGraphNodeParams: return sizeof(cyruntime.cudaChildGraphNodeParams) diff --git a/cuda_bindings_13/docs/source/module/driver.rst b/cuda_bindings_13/docs/source/module/driver.rst index 81a618223b4..84f1f5d70e1 100644 --- a/cuda_bindings_13/docs/source/module/driver.rst +++ b/cuda_bindings_13/docs/source/module/driver.rst @@ -1,9 +1,10 @@ .. 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.4.1. Do not modify it directly. +.. This code was automatically generated with version 13.5.0. Do not modify it directly. -.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=36581a940ea8eab6240dfa90b5b0598bb90a5cfa8364156b1626801c89c39a2d +.. !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=2b852c2617d3f143c9e9ee0c36d17428d6b920b8dc3200db58e9481f42f7a074 ------ driver ------ @@ -87,6 +88,8 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUDA_CHILD_GRAPH_NODE_PARAMS_st .. autoclass:: cuda.bindings.driver.CUDA_EVENT_RECORD_NODE_PARAMS_st .. autoclass:: cuda.bindings.driver.CUDA_EVENT_WAIT_NODE_PARAMS_st +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1_st +.. autoclass:: cuda.bindings.driver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1_st .. autoclass:: cuda.bindings.driver.CUgraphNodeParams_st .. autoclass:: cuda.bindings.driver.CUcheckpointCustomStoragePerDeviceData_st .. autoclass:: cuda.bindings.driver.CUcheckpointCustomStorageInfo_st @@ -1985,6 +1988,18 @@ Data types used by CUDA driver Handle types supported with logical endpoint IPC + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_VULKAN_CIG_STREAMS_SUPPORTED + + + Device supports CIG streams with Vulkan + + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE + + + Minimum contiguous, accessible size in bytes required when the large tensor-map allocation class is effective. Devices with a 128 KiB backing precondition report 131072; devices where allocation-class selection is a no-op report INT_MAX. + + .. autoattribute:: cuda.bindings.driver.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_GPU_DIRECT_RDMA_WITH_LOCALIZED_MEMORY_SUPPORTED @@ -2828,11 +2843,7 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_POSITION_INDEPENDENT_CODE - Generate position independent code (0: false) - - Option type: int - - Applies to: compiler only + [Deprecated] .. autoattribute:: cuda.bindings.driver.CUjit_option.CU_JIT_MIN_CTA_PER_SM @@ -3487,11 +3498,29 @@ Data types used by CUDA driver call :py:obj:`~.cudaGraphSetConditional` from device code. + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_MEMCPY_BATCH + + + Batch Memcpy Node + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_RESERVED_16 Reserved + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_EXTERNAL_ENGINE + + + Reserved for External Engine node + + + .. autoattribute:: cuda.bindings.driver.CUgraphNodeType.CU_GRAPH_NODE_TYPE_FABRIC_CPY_BATCH + + + Fabric copy batch node + .. autoclass:: cuda.bindings.driver.CUgraphDependencyType .. autoattribute:: cuda.bindings.driver.CUgraphDependencyType.CU_GRAPH_DEPENDENCY_TYPE_DEFAULT @@ -3872,6 +3901,12 @@ Data types used by CUDA driver D3D12 Command List Handle + + .. autoattribute:: cuda.bindings.driver.CUstreamCigDataType.STREAM_CIG_DATA_TYPE_VULKAN_COMMAND_BUFFER_HANDLE_NV + + + Vulkan Command Buffer Internal NVIDIA Handle + .. autoclass:: cuda.bindings.driver.CUlibraryOption .. autoattribute:: cuda.bindings.driver.CUlibraryOption.CU_LIBRARY_HOST_UNIVERSAL_FUNCTION_AND_DATA_TABLE @@ -4880,6 +4915,25 @@ Data types used by CUDA driver .. autoattribute:: cuda.bindings.driver.CUtensorMapIm2ColWideMode.CU_TENSOR_MAP_IM2COL_WIDE_MODE_W128 +.. autoclass:: cuda.bindings.driver.CUtensorMapAllocClass + + .. autoattribute:: cuda.bindings.driver.CUtensorMapAllocClass.CU_TENSOR_MAP_ALLOC_CLASS_AUTO + + + Recompute the effective allocation class from the tensor-map layout. + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapAllocClass.CU_TENSOR_MAP_ALLOC_CLASS_SMALL + + + Request the "small" class (safe 4 KiB OOB window). + + + .. autoattribute:: cuda.bindings.driver.CUtensorMapAllocClass.CU_TENSOR_MAP_ALLOC_CLASS_LARGE + + + Request the "large" class (128 KiB OOB window); when LARGE is effective, the caller guarantees the effective base allocation is accessible for at least :py:obj:`~.CU_DEVICE_ATTRIBUTE_TENSOR_MAP_LARGE_TENSOR_MIN_SIZE` bytes before use. + .. autoclass:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS .. autoattribute:: cuda.bindings.driver.CUDA_POINTER_ATTRIBUTE_ACCESS_FLAGS.CU_POINTER_ATTRIBUTE_ACCESS_FLAG_NONE @@ -5611,6 +5665,18 @@ Data types used by CUDA driver Adds conditional node parameters to output + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_MEMCPY_BATCH_NODE_PARAMS + + + Adds batch memcpy node parameters to the output + + + .. autoattribute:: cuda.bindings.driver.CUgraphDebugDot_flags.CU_GRAPH_DEBUG_DOT_FLAGS_FABRIC_CPY_BATCH_NODE_PARAMS + + + Adds fabric copy batch node parameters + .. autoclass:: cuda.bindings.driver.CUuserObject_flags .. autoattribute:: cuda.bindings.driver.CUuserObject_flags.CU_USER_OBJECT_NO_DESTRUCTOR_SYNC @@ -6596,6 +6662,12 @@ Data types used by CUDA driver .. autoclass:: cuda.bindings.driver.CUDA_CHILD_GRAPH_NODE_PARAMS .. autoclass:: cuda.bindings.driver.CUDA_EVENT_RECORD_NODE_PARAMS .. autoclass:: cuda.bindings.driver.CUDA_EVENT_WAIT_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 +.. autoclass:: cuda.bindings.driver.CUDA_MEMCPY_BATCH_NODE_PARAMS +.. autoclass:: cuda.bindings.driver.CUDA_FABRIC_COPY_BATCH_OP_v1 +.. autoclass:: cuda.bindings.driver.CUDA_FABRIC_COPY_BATCH_OP +.. autoclass:: cuda.bindings.driver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS_V1 +.. autoclass:: cuda.bindings.driver.CUDA_FABRIC_CPY_BATCH_NODE_PARAMS .. autoclass:: cuda.bindings.driver.CUgraphNodeParams .. autoclass:: cuda.bindings.driver.CUcheckpointCustomStoragePerDeviceData .. autoclass:: cuda.bindings.driver.CUcheckpointOperationHandle @@ -7320,8 +7392,14 @@ This section describes the logical endpoint functions of the low-level CUDA driv .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointIpcHandleType.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_NONE + Does not allow any export mechanism + + .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointIpcHandleType.CU_LOGICAL_ENDPOINT_IPC_HANDLE_TYPE_FABRIC + + Allows export to a fabric handle (:py:obj:`~.CUlogicalEndpointFabricHandle`) + .. autoclass:: cuda.bindings.driver.CUlogicalEndpointType .. autoattribute:: cuda.bindings.driver.CUlogicalEndpointType.CU_LOGICAL_ENDPOINT_TYPE_INVALID @@ -7361,6 +7439,36 @@ This section describes the logical endpoint functions of the low-level CUDA driv .. autofunction:: cuda.bindings.driver.cuLogicalEndpointGetLimits .. autofunction:: cuda.bindings.driver.cuLogicalEndpointQuery +Fabric Copy +----------- + +MANBRIEF fabric copy functions of the low-level CUDA driver API (CURRENT_FILE) ENDMANBRIEF + + + +This section describes the fabric copy functions of the low-level CUDA driver application programming interface. + +.. autoclass:: cuda.bindings.driver.CUfabricCpyOperand_st +.. autoclass:: cuda.bindings.driver.CUDA_FABRIC_COPY_BATCH_OP_st +.. autoclass:: cuda.bindings.driver.CUfabricCpyOperandType + + .. autoattribute:: cuda.bindings.driver.CUfabricCpyOperandType.CU_FABRIC_COPY_OPERAND_TYPE_POINTER + + + Copy operand is a valid pointer. + + + .. autoattribute:: cuda.bindings.driver.CUfabricCpyOperandType.CU_FABRIC_COPY_OPERAND_TYPE_LOGICAL_ENDPOINT + + + Copy operand is a logical endpoint. + + + .. autoattribute:: cuda.bindings.driver.CUfabricCpyOperandType.CU_FABRIC_COPY_OPERAND_TYPE_MAX + +.. autoclass:: cuda.bindings.driver.CUfabricCpyOperand +.. autofunction:: cuda.bindings.driver.cuFabricCpyBatchAsync + Unified Addressing ------------------ @@ -7763,6 +7871,7 @@ This section describes the tensor map object management functions of the low-lev .. autofunction:: cuda.bindings.driver.cuTensorMapEncodeIm2col .. autofunction:: cuda.bindings.driver.cuTensorMapEncodeIm2colWide .. autofunction:: cuda.bindings.driver.cuTensorMapReplaceAddress +.. autofunction:: cuda.bindings.driver.cuTensorMapSetAllocationClass Peer Context Memory Access -------------------------- @@ -7870,6 +7979,9 @@ This section describes the coredump attribute control functions of the low-level .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_FAULTED_CONTEXTS_ONLY + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_SKIP_TENSOR_MEMORY + + .. autoattribute:: cuda.bindings.driver.CUCoredumpGenerationFlags.CU_COREDUMP_NO_ERRBAR_AT_EXIT @@ -8143,6 +8255,12 @@ Green context restrictions apply to memory copy operations only when the copy is The SMs must be located on a specific locality domain, specified by localityDomainId + + .. autoattribute:: cuda.bindings.driver.CUdevSmResourceGroup_flags.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_SUPPLEMENTAL_SMS + + + Modifier to :py:obj:`~.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID` which allows selection of SMs in the locality domain exceeding the :py:obj:`~.CUdevice_attribute.CU_DEVICE_ATTRIBUTE_LOCALITY_DOMAIN_MULTIPROCESSOR_COUNT` + .. autoclass:: cuda.bindings.driver.CUdevSmResourceSplitByCount_flags .. autoattribute:: cuda.bindings.driver.CUdevSmResourceSplitByCount_flags.CU_DEV_SM_RESOURCE_SPLIT_IGNORE_SM_COSCHEDULING @@ -8205,6 +8323,10 @@ Green context restrictions apply to memory copy operations only when the copy is .. autofunction:: cuda.bindings.driver.cuGreenCtxStreamCreate .. autofunction:: cuda.bindings.driver.cuGreenCtxGetId .. autofunction:: cuda.bindings.driver.cuStreamGetDevResource +.. autoattribute:: cuda.bindings.driver.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID_ANY + + Special value ``localityDomainId`` when :py:obj:`~.cuDevSmResourceSplit` is called with ``CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID``. Selects SMs from the union of all available locality domains in the input SM resource. See also: :py:obj:`~.CU_DEV_SM_RESOURCE_GROUP_LOCALITY_DOMAIN_ID` for the set of SMs in a single locality domain. + Error Log Management Functions ------------------------------ diff --git a/cuda_bindings_13/docs/source/module/nvrtc.rst b/cuda_bindings_13/docs/source/module/nvrtc.rst index bedf6ed179d..efc9dc2d6bc 100644 --- a/cuda_bindings_13/docs/source/module/nvrtc.rst +++ b/cuda_bindings_13/docs/source/module/nvrtc.rst @@ -1,9 +1,10 @@ .. 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.4.1. Do not modify it directly. +.. This code was automatically generated with version 13.5.0. Do not modify it directly. -.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=03c58049a86a77a6113432e5935ea831b2fd6d6980b3f98f20b0025d043e801a +.. !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=991ba9259310a4699c05a606a4a2cd78ebc7f10f9166c23fe7faad6f6d1cef8c ----- nvrtc ----- @@ -147,7 +148,7 @@ NVRTC defines the following types and functions for bundled headers installation Supported Compile Options ------------------------- -NVRTC supports the compile options below. Option names with two preceding dashs (``--``) are long option names and option names with one preceding dash (``-``) are short option names. Short option names can be used instead of long option names. When a compile option takes an argument, an assignment operator (``=``) is used to separate the compile option argument from the compile option name, e.g., ``"--gpu-architecture=compute_100"``. Alternatively, the compile option name and the argument can be specified in separate strings without an assignment operator, .e.g, ``"--gpu-architecture"`` ``"compute_100"``. Single-character short option names, such as ``-D``, ``-U``, and ``-I``, do not require an assignment operator, and the compile option name and the argument can be present in the same string with or without spaces between them. For instance, ``"-D="``, ``"-D"``, and ``"-D "`` are all supported. +NVRTC supports the compile options below. Option names with two preceding dashes (``--``) are long option names and option names with one preceding dash (``-``) are short option names. Short option names can be used instead of long option names. When a compile option takes an argument, an assignment operator (``=``) is used to separate the compile option argument from the compile option name, e.g., ``"--gpu-architecture=compute_100"``. Alternatively, the compile option name and the argument can be specified in separate strings without an assignment operator, .e.g, ``"--gpu-architecture"`` ``"compute_100"``. Single-character short option names, such as ``-D``, ``-U``, and ``-I``, do not require an assignment operator, and the compile option name and the argument can be present in the same string with or without spaces between them. For instance, ``"-D="``, ``"-D"``, and ``"-D "`` are all supported. @@ -231,6 +232,16 @@ Do extensible whole program compilation of device code. + - ``--tile-preview=SIMT`` (``-tile-preview``) + +Enable Tile preview features and define the macro ``__CUDACC_TILE_PREVIEW_SIMT__`` . + + + + + + + - ``--enable-tile`` (``-enable-tile``) Enable support for Tile constructs (e.g. ``__tile__`` ) and define the macro ``__CUDACC_TILE__`` . @@ -265,7 +276,7 @@ Enable support for parsing Tile constructs and define the macro ``__CUDACC_TILE_ Consider an unannotated function or static storage duration variable as having an implicit ``__tile__`` annotation. If the static storage duration variable violates Tile restrictions (e.g. cannot be of pointer type), then the implicit annotation is silently omitted by default; use ``-diagnose-implicit-tile-var`` to enable compiler diagnostics for such cases. -``-default-tile`` can be used in conjunction with ``-default-device``. If both flags are specified, the unannotated function and/or static storage duration variable will be considered to have both ``__tile__`` and ``__device__`` implict annotations. There will be a separate copy of the function/variable in the generated SIMT and cuda_tile programs, at present. +``-default-tile`` can be used in conjunction with ``-default-device``. If both flags are specified, the unannotated function and/or static storage duration variable will be considered to have both ``__tile__`` and ``__device__`` implicit annotations. There will be a separate copy of the function/variable in the generated SIMT and cuda_tile programs, at present. @@ -721,7 +732,7 @@ Print a message in the compilation log, if a PCH file was created or used in the - ``--instantiate-templates-in-pch={true|false}`` (``-instantiate-templates-in-pch``) -Enable or disable instantiatiation of templates before PCH creation. Instantiating templates may increase the size of the PCH file, while reducing the compilation cost when using the PCH file (since some template instantiations can be skipped). +Enable or disable instantiation of templates before PCH creation. Instantiating templates may increase the size of the PCH file, while reducing the compilation cost when using the PCH file (since some template instantiations can be skipped). diff --git a/cuda_bindings_13/docs/source/module/runtime.rst b/cuda_bindings_13/docs/source/module/runtime.rst index f27a847e25f..8835342259c 100644 --- a/cuda_bindings_13/docs/source/module/runtime.rst +++ b/cuda_bindings_13/docs/source/module/runtime.rst @@ -1,9 +1,10 @@ .. 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.4.1. Do not modify it directly. +.. This code was automatically generated with version 13.5.0. Do not modify it directly. -.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=408acc02ad695c94ce3060966b62863084ed3f1ac77da7e731e37b3cf7cf9b27 +.. !!! WARNING: THIS FILE CONTAINS PRERELEASE APIs !!! +.. CYTHON-BINDINGS-GENERATED-DO-NOT-MODIFY-THIS-FILE: format=1; content-sha256=01cfe296b73bd10da8a14aa9816628bb5a826bff3d4894cfce257fc9c83728fa ------- runtime ------- @@ -66,6 +67,7 @@ Data types used by CUDA Runtime .. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitNodeParams .. autoclass:: cuda.bindings.runtime.cudaExternalSemaphoreWaitNodeParamsV2 .. autoclass:: cuda.bindings.runtime.cudaConditionalNodeParams +.. autoclass:: cuda.bindings.runtime.cudaMemcpyBatchNodeParams .. autoclass:: cuda.bindings.runtime.cudaChildGraphNodeParams .. autoclass:: cuda.bindings.runtime.cudaEventRecordNodeParams .. autoclass:: cuda.bindings.runtime.cudaEventWaitNodeParams @@ -2895,6 +2897,12 @@ Data types used by CUDA Runtime Number of multiprocessors on each locality domain + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrTensorMapLargeTensorMinSize + + + Smallest tensor size in bytes at which TMA descriptors are treated as "large" (BASE_128KB OOB mode). tensors >= this threshold are eligible for the tensormap.replace.assume_large PTX modifier. Returns INT_MAX on devices without this distinction where assume_large is a no-op. + + .. autoattribute:: cuda.bindings.runtime.cudaDeviceAttr.cudaDevAttrMax .. autoclass:: cuda.bindings.runtime.cudaMemPoolAttr @@ -3393,7 +3401,7 @@ Data types used by CUDA Runtime .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.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. 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. + 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. When used with ``cudaDevSmResourceGroupLocalityDomainNonPortableId``, backfill follows the same behavior after first consuming all SMs from the target locality domain. .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupLocalityDomainId @@ -3401,6 +3409,12 @@ Data types used by CUDA Runtime The SMs must be located on a specific locality domain, specified by localityDomainId + + .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroup_flags.cudaDevSmResourceGroupLocalityDomainSupplementalSms + + + Modifier to ``cudaDevSmResourceGroupLocalityDomainId`` which allows selection of SMs in the locality domain exceeding the :py:obj:`~.cudaDeviceAttr.cudaDevAttrLocalityDomainMultiprocessorCount`. + .. autoclass:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags .. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceSplitByCount_flags.cudaDevSmResourceSplitIgnoreSmCoscheduling @@ -3834,12 +3848,24 @@ Data types used by CUDA Runtime call :py:obj:`~.cudaGraphSetConditional` from device code. + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeMemcpyBatch + + + Batch Memcpy Node + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeReserved16 Reserved. + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeExternalEngine + + + Reserved for External Engine node + + .. autoattribute:: cuda.bindings.runtime.cudaGraphNodeType.cudaGraphNodeTypeCount .. autoclass:: cuda.bindings.runtime.cudaGraphChildGraphNodeOwnership @@ -4100,6 +4126,12 @@ Data types used by CUDA Runtime Adds :py:obj:`~.cudaConditionalNodeParams` to output + + .. autoattribute:: cuda.bindings.runtime.cudaGraphDebugDotFlags.cudaGraphDebugDotFlagsMemcpyBatchNodeParams + + + Adds batch memcpy node parameters to the output + .. autoclass:: cuda.bindings.runtime.cudaGraphInstantiateFlags .. autoattribute:: cuda.bindings.runtime.cudaGraphInstantiateFlags.cudaGraphInstantiateFlagAutoFreeOnLaunch @@ -5426,6 +5458,10 @@ Data types used by CUDA Runtime When /p flags of :py:obj:`~.cudaDeviceGetNvSciSyncAttributes` is set to this, it indicates that application need waiter specific NvSciSyncAttr to be filled by :py:obj:`~.cudaDeviceGetNvSciSyncAttributes`. +.. autoattribute:: cuda.bindings.runtime.cudaDevSmResourceGroupLocalityDomainIdAny + + Special value for localityDomainId when cudaDevSmResourceSplit is called with cudaDevSmResourceGroupLocalityDomainId. Selects SMs from the union of all available locality domains in the input SM resource. See also: cudaDevSmResourceGroupLocalityDomainId for the set of SMs in a single locality domain. + .. autoattribute:: cuda.bindings.runtime.cudaGraphKernelNodePortDefault This port activates when the kernel has finished executing. diff --git a/cuda_bindings_13/tests/test_cuda.py b/cuda_bindings_13/tests/test_cuda.py index c8fa0262a04..a2ad692b4d3 100644 --- a/cuda_bindings_13/tests/test_cuda.py +++ b/cuda_bindings_13/tests/test_cuda.py @@ -1401,3 +1401,47 @@ def test_array_member_assignment_and_aliased_dealloc(): del inner assert outer.attrs == ctypes.addressof(attrs) assert outer.num_attrs == 8 + + +@pytest.mark.skipif(driver.CUDA_VERSION < 13050, reason="Graph batch node parameters require CUDA 13.5 headers") +@pytest.mark.parametrize( + "member_name,wrapper_name,dtype_name,count_name", + [ + ("memcpy_batch", "MemcpyBatchNodeParamsV1", "memcpy_batch_node_params_v1_dtype", "count"), + ("fabric_cpy_batch", "FabricCpyBatchNodeParamsV1", "fabric_cpy_batch_node_params_v1_dtype", "num_ops"), + ], +) +@pytest.mark.agent_authored(model="gpt-6") +def test_graph_batch_node_params_runtime(member_name, wrapper_name, dtype_name, count_name): + wrapper_type = getattr(driver, wrapper_name) + member_dtype = getattr(driver, dtype_name) + assert driver.graph_node_params_dtype.fields[member_name][0] == member_dtype + + params = driver.GraphNodeParams() + member = getattr(params, member_name) + assert isinstance(member, wrapper_type) + assert memoryview(member).nbytes == member_dtype.itemsize + + # The typed getter aliases the embedded struct, including through NumPy. + setattr(member, count_name, 7) + assert getattr(getattr(params, member_name), count_name) == 7 + array = np.frombuffer(params, dtype=driver.graph_node_params_dtype, count=1) + assert array[member_name][count_name][0] == 7 + array[member_name][count_name][0] = 9 + assert getattr(member, count_name) == 9 + + # Assigning an arm copies its scalar fields instead of aliasing the source. + replacement = wrapper_type() + setattr(replacement, count_name, 11) + setattr(params, member_name, replacement) + setattr(replacement, count_name, 13) + assert getattr(getattr(params, member_name), count_name) == 11 + + readonly = driver.GraphNodeParams.from_buffer(bytes(memoryview(params))) + readonly_member = getattr(readonly, member_name) + assert isinstance(readonly_member, wrapper_type) + assert getattr(readonly_member, count_name) == 11 + with pytest.raises(ValueError, match="read-only"): + setattr(readonly_member, count_name, 17) + with pytest.raises(ValueError, match="read-only"): + setattr(readonly, member_name, replacement) diff --git a/cuda_bindings_13/tests/test_graph_node_params_lifetime.py b/cuda_bindings_13/tests/test_graph_node_params_lifetime.py new file mode 100644 index 00000000000..0653cd1fee3 --- /dev/null +++ b/cuda_bindings_13/tests/test_graph_node_params_lifetime.py @@ -0,0 +1,218 @@ +# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved. +# SPDX-License-Identifier: Apache-2.0 + +"""Memory-safety and correctness tests for AUTO_LOWPP_CLASS wrappers around +CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 / CUgraphNodeParams and similar embedded/batch +structs. + +These do not require a CUDA device: they exercise the pure-Python/Cython +wrapper objects (buffer allocation, getters/setters, __dealloc__ ordering) +without calling into the driver. Tests that would previously segfault use a +fresh subprocess (via run_python_snippet) so a crash is reported as a failed +assertion instead of taking down the whole pytest run. + +dsts and srcs share CUDA_MEMCPY_BATCH_NODE_PARAMS_V1's `count` field and so +cannot be set independently (setting one would silently invalidate the +other's length); they're set together via set_dsts_srcs(dsts, srcs) instead. +""" + +import pytest +from cuda_python_test_helpers.subprocess_runner import run_python_snippet + +import cuda.bindings.driver as cuda + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_embedded_batch_member_survives_parent_deletion(): + """Deleting a CUgraphNodeParams whose embedded memcpyBatch was populated + must not crash: the parent's __dealloc__ must release its cached + memcpyBatch wrapper before freeing its own buffer, since that wrapper's + own __dealloc__ writes through the same memory.""" + result = run_python_snippet( + """ +import gc +import cuda.bindings.driver as cuda + +params = cuda.CUgraphNodeParams() +params.memcpyBatch.set_dsts_srcs([1, 2, 3], [4, 5, 6]) +del params +gc.collect() +print("ok") +""" + ) + assert result.stdout.strip() == "ok" + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_dsts_and_srcs_cannot_be_set_independently(): + """dsts and srcs share the same public `count` field but each keeps its + own private backing buffer. Setting them independently would let one + setter overwrite the shared count field written by the other, so each + property setter raises, pointing at set_dsts_srcs instead.""" + batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() + with pytest.raises(AttributeError, match="set_dsts_srcs"): + batch.dsts = [1, 2, 3] + with pytest.raises(AttributeError, match="set_dsts_srcs"): + batch.srcs = [1, 2, 3] + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_set_dsts_srcs_requires_matching_lengths(): + batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() + with pytest.raises(ValueError, match="same length"): + batch.set_dsts_srcs([1, 2], [3, 4, 5]) + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_set_dsts_srcs_updates_both_and_shared_count(): + batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() + batch.set_dsts_srcs([1, 2, 3], [4, 5, 6]) + assert [int(x) for x in batch.dsts] == [1, 2, 3] + assert [int(x) for x in batch.srcs] == [4, 5, 6] + assert batch.count == 3 + + # Reassigning to a different length must not leave dsts and srcs (or the + # count they share) inconsistent with each other. + batch.set_dsts_srcs([7], [8]) + assert [int(x) for x in batch.dsts] == [7] + assert [int(x) for x in batch.srcs] == [8] + assert batch.count == 1 + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_sibling_members_sharing_a_count_field_do_not_crash_in_subprocess(): + """Regression check for the NULL-pointer write this used to be: before + set_dsts_srcs existed, setting dsts then srcs independently would have + srcs's setter see the count field dsts's setter just wrote, wrongly + conclude its own (still-NULL) buffer didn't need allocating, and write + through NULL. Run out-of-process since this is exactly the kind of bug + that segfaults instead of raising.""" + result = run_python_snippet( + """ +import cuda.bindings.driver as cuda + +batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() +batch.set_dsts_srcs([1, 2, 3], [4, 5, 6]) +assert [int(x) for x in batch.dsts] == [1, 2, 3] +assert [int(x) for x in batch.srcs] == [4, 5, 6] +print("ok") +""" + ) + assert result.stdout.strip() == "ok" + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_memcpy_batch_assignment_is_a_shallow_copy(): + """params.memcpyBatch = batch does a raw memcpy of batch's bytes, same as + every other embedded-struct/struct-array assignment in these bindings + (e.g. CUgraphNodeParams.conditional, CUDA_MEMCPY_BATCH_NODE_PARAMS_V1.attrs): + none of them deep-copy or retain a source object's own owned buffers. + So params.memcpyBatch.dsts ends up aliasing batch's dsts buffer, and + freeing batch (its buffer, not just the Python object) invalidates it. + This documents that as accepted, existing behavior, not something this + struct's setter is expected to protect against.""" + params = cuda.CUgraphNodeParams() + batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() + batch.set_dsts_srcs([10, 20, 30], [40, 50, 60]) + params.memcpyBatch = batch + assert [int(x) for x in params.memcpyBatch.dsts] == [10, 20, 30] + assert int(params.memcpyBatch.dsts[0]) == int(batch.dsts[0]) + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_dsts_getter_returns_value_copies_not_aliases(): + """Elements returned by the dsts getter must be independent copies: if + they instead alias the backing buffer, replacing dsts (which frees the + old buffer) leaves previously-returned elements pointing at freed + memory.""" + result = run_python_snippet( + """ +import gc +import cuda.bindings.driver as cuda + +batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() +batch.set_dsts_srcs([100, 200], [1, 2]) +elems = batch.dsts +batch.set_dsts_srcs([999], [1]) # frees and replaces the old backing buffer +gc.collect() +assert [int(x) for x in elems] == [100, 200] +print("ok") +""" + ) + assert result.stdout.strip() == "ok" + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_dsts_getter_reads_public_count_field(): + """The dsts/srcs getters must read the struct's own public `count` field + rather than a private, Python-setter-only length. A driver call that + populates a CUDA_MEMCPY_BATCH_NODE_PARAMS_V1 in place (e.g. reading back + node params) only ever sets `count`, never any private bookkeeping. This + simulates that by creating a second wrapper around the same memory + address, whose own private state was never touched.""" + batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() + batch.set_dsts_srcs([11, 22, 33], [1, 2, 3]) + + aliased = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1(_ptr=batch.getPtr()) + assert aliased.count == 3 + assert [int(x) for x in aliased.dsts] == [11, 22, 33] + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_attrs_struct_list_reads_public_num_attrs_field(): + """Same as test_dsts_getter_reads_public_count_field, but for the + struct-list (attrs / numAttrs) getter path rather than the primitive-list + (dsts / count) path. attrs is independently settable (it doesn't share + numAttrs with any other member with real list semantics), so it keeps + its own setter rather than needing a combined one.""" + batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() + batch.attrs = [cuda.CUmemcpyAttributes(), cuda.CUmemcpyAttributes()] + + aliased = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1(_ptr=batch.getPtr()) + assert aliased.numAttrs == 2 + assert len(aliased.attrs) == 2 + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_set_dsts_srcs_raises_without_leaking_or_mutating_on_bad_element(): + """A conversion failure partway through set_dsts_srcs must not leave + dsts/srcs partially overwritten, and must not leak the freshly-allocated + replacement buffers.""" + batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() + batch.set_dsts_srcs([1, 2, 3], [4, 5, 6]) + before_dsts = [int(x) for x in batch.dsts] + before_srcs = [int(x) for x in batch.srcs] + before_count = batch.count + + with pytest.raises((ValueError, TypeError)): + batch.set_dsts_srcs([1, 2, "not-an-int"], [4, 5, 6]) + + assert batch.count == before_count + assert [int(x) for x in batch.dsts] == before_dsts + assert [int(x) for x in batch.srcs] == before_srcs + + +@pytest.mark.agent_authored(model="claude-sonnet-5") +def test_set_dsts_srcs_exception_safety_in_subprocess(): + """Same as the test above, but run out-of-process: pre-fix, the resize + path allocated the new buffers and started writing into them before + validating every element, which is memory-unsafe enough to be worth + checking under a fresh interpreter too.""" + result = run_python_snippet( + """ +import cuda.bindings.driver as cuda + +batch = cuda.CUDA_MEMCPY_BATCH_NODE_PARAMS_V1() +batch.set_dsts_srcs([1, 2, 3], [4, 5, 6]) +try: + batch.set_dsts_srcs([1, 2, 3, 4, "not-an-int"], [4, 5, 6, 7, 8]) + raise SystemExit("expected an exception") +except (ValueError, TypeError): + pass +assert batch.count == 3 +assert [int(x) for x in batch.dsts] == [1, 2, 3] +assert [int(x) for x in batch.srcs] == [4, 5, 6] +print("ok") +""" + ) + assert result.stdout.strip() == "ok" diff --git a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py index 4a5035e2577..5d9bb3e363e 100644 --- a/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py +++ b/cuda_pathfinder/cuda/pathfinder/_dynamic_libs/descriptor_catalog.py @@ -362,6 +362,7 @@ class DescriptorSpec: packaged_with="ctk", linux_sonames=("libcupti.so.13", "libcupti.so.12"), windows_dlls=( + "cupti64_13.dll", "cupti64_2026.3.1.dll", "cupti64_2026.3.0.dll", "cupti64_2026.2.1.dll",