From 5ddc4ea8dd54ff0fec8c52c4e2732efa0d4df822 Mon Sep 17 00:00:00 2001 From: turboderp <11859846+turboderp@users.noreply.github.com> Date: Sun, 10 May 2026 12:51:52 +0200 Subject: [PATCH] Actions: cu132 wheel experiment, attempt #2 --- .github/workflows/build_cu132.yml | 87 +++++++++++++++++++++++++++++-- 1 file changed, 84 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build_cu132.yml b/.github/workflows/build_cu132.yml index 2841f62..15730ff 100644 --- a/.github/workflows/build_cu132.yml +++ b/.github/workflows/build_cu132.yml @@ -1,4 +1,4 @@ -name: Build Wheels & Release +name: Build Wheels & Release, cu132 only on: workflow_dispatch: @@ -250,13 +250,14 @@ jobs: } echo "$cudaRoot\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "$cudaRoot\bin\x64" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "$cudaRoot\libnvvp" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append echo "CUDA_PATH=$cudaRoot" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 echo "CUDA_PATH_V13_2=$cudaRoot" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 $required = @( "$cudaRoot\bin\nvcc.exe", - "$cudaRoot\bin\nvrtc64_*.dll", + "$cudaRoot\bin\x64\nvrtc64_*.dll", "$cudaRoot\lib\x64\cublas.lib" ) foreach ($pattern in $required) { @@ -265,6 +266,86 @@ jobs: } } + - name: Install Linux CUDA 13.2 + if: runner.os != 'Windows' && contains(matrix.cuda, '13.2') + run: | + $ErrorActionPreference = "Stop" + + function Download-WithRetry { + param( + [Parameter(Mandatory=$true)][string]$Url, + [Parameter(Mandatory=$true)][string]$OutFile, + [int]$MaxAttempts = 5 + ) + + for ($attempt = 1; $attempt -le $MaxAttempts; $attempt++) { + try { + Write-Host "Downloading $Url (attempt $attempt/$MaxAttempts)" + /usr/bin/curl -fL --retry 5 --retry-delay 5 --retry-all-errors -o $OutFile $Url + + if (-not (Test-Path $OutFile)) { throw "File was not created: $OutFile" } + $size = (Get-Item $OutFile).Length + if ($size -le 0) { throw "Downloaded file is empty: $OutFile" } + + Write-Host "Downloaded $OutFile ($size bytes)" + return + } + catch { + Write-Warning "Download failed for $Url : $_" + if ($attempt -eq $MaxAttempts) { throw } + Start-Sleep -Seconds ([Math]::Min(60, 5 * $attempt)) + } + } + } + + $cudaRoot = Join-Path $env:RUNNER_TEMP 'cuda-13.2' + New-Item -ItemType Directory -Force -Path $cudaRoot | Out-Null + + $baseUrl = "https://developer.download.nvidia.com/compute/cuda/redist" + $packages = @( + "cuda_cudart/linux-x86_64/cuda_cudart-linux-x86_64-13.2.75-archive.tar.xz", + "cuda_nvcc/linux-x86_64/cuda_nvcc-linux-x86_64-13.2.78-archive.tar.xz", + "cuda_nvrtc/linux-x86_64/cuda_nvrtc-linux-x86_64-13.2.78-archive.tar.xz", + "libcublas/linux-x86_64/libcublas-linux-x86_64-13.4.0.1-archive.tar.xz", + "cuda_nvtx/linux-x86_64/cuda_nvtx-linux-x86_64-13.2.75-archive.tar.xz", + "cuda_profiler_api/linux-x86_64/cuda_profiler_api-linux-x86_64-13.2.75-archive.tar.xz", + "cuda_cccl/linux-x86_64/cuda_cccl-linux-x86_64-13.2.75-archive.tar.xz", + "libcusparse/linux-x86_64/libcusparse-linux-x86_64-12.7.10.1-archive.tar.xz", + "libcusolver/linux-x86_64/libcusolver-linux-x86_64-12.2.0.1-archive.tar.xz", + "libcurand/linux-x86_64/libcurand-linux-x86_64-10.4.2.55-archive.tar.xz", + "libcufft/linux-x86_64/libcufft-linux-x86_64-12.2.0.46-archive.tar.xz" + ) + + foreach ($package in $packages) { + $fileName = Split-Path $package -Leaf + Download-WithRetry "$baseUrl/$package" $fileName + /usr/bin/tar -xJf $fileName -C $cudaRoot + } + + foreach ($archiveDir in Get-ChildItem $cudaRoot -Directory -Filter '*-archive') { + /bin/cp -a "$($archiveDir.FullName)/." "$cudaRoot/" + } + if (-not (Test-Path "$cudaRoot/lib64")) { + /bin/ln -s "$cudaRoot/lib" "$cudaRoot/lib64" + } + + echo "$cudaRoot/bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append + echo "CUDA_HOME=$cudaRoot" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + echo "CUDA_PATH=$cudaRoot" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + echo "CUDACXX=$cudaRoot/bin/nvcc" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + echo "LD_LIBRARY_PATH=$cudaRoot/lib:$env:LD_LIBRARY_PATH" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + + $required = @( + "$cudaRoot/bin/nvcc", + "$cudaRoot/lib/libnvrtc.so", + "$cudaRoot/lib/libcublas.so" + ) + foreach ($pattern in $required) { + if (-not (Test-Path $pattern)) { + throw "Missing required CUDA file: $pattern" + } + } + - name: Install Linux CUDA ${{ matrix.cuda }} uses: Jimver/cuda-toolkit@v0.2.24 id: cuda-toolkit-Linux @@ -272,7 +353,7 @@ jobs: cuda: "${{ matrix.cuda }}" linux-local-args: '["--toolkit"]' method: "network" - if: runner.os != 'Windows' && matrix.cuda != '' + if: runner.os != 'Windows' && matrix.cuda != '' && !contains(matrix.cuda, '13.2') - name: Install CUDA build dependencies if: matrix.cuda != ''