diff --git a/.github/scripts/build-cuda.sh b/.github/scripts/build-cuda.sh index e15bbabdb..a4f4b4b0a 100644 --- a/.github/scripts/build-cuda.sh +++ b/.github/scripts/build-cuda.sh @@ -8,13 +8,17 @@ set -xeuo pipefail if [[ -v CUDA_TARGETS ]]; then build_capability="${CUDA_TARGETS}" elif [ "${RUNNER_ARCH}" = "ARM64" ]; then - build_capability="75;80;90" + if [ "${RUNNER_OS}" = "Windows" ]; then + build_capability="121" + else + build_capability="75;80;90" - # CUDA 12.8-12.9: Add sm100/sm120 - [[ "${CUDA_VERSION}" == 12.8.* || "${CUDA_VERSION}" == 12.9.* ]] && build_capability="75;80;90;100;120" + # CUDA 12.8-12.9: Add sm100/sm120 + [[ "${CUDA_VERSION}" == 12.8.* || "${CUDA_VERSION}" == 12.9.* ]] && build_capability="75;80;90;100;120" - # CUDA 13.0+: Add sm100/sm110/sm120 - [[ "${CUDA_VERSION}" == 13.*.* ]] && build_capability="75;80;90;100;110;120;121" + # CUDA 13.0+: Add sm100/sm110/sm120 + [[ "${CUDA_VERSION}" == 13.*.* ]] && build_capability="75;80;90;100;110;120;121" + fi else # By default, target Pascal through Hopper. build_capability="60;70;75;80;86;89;90" diff --git a/.github/scripts/install-cuda-woa.ps1 b/.github/scripts/install-cuda-woa.ps1 new file mode 100644 index 000000000..1d65a949f --- /dev/null +++ b/.github/scripts/install-cuda-woa.ps1 @@ -0,0 +1,27 @@ +# Installs the CUDA 13.4 preview toolkit for Windows arm64. +$ErrorActionPreference = "Stop" + +$url = "https://packages.nvidia.com/prerelease/cuda/13.4.0/local_installers/cuda_13.4.0_windows_arm64.exe" +$subPackages = @( + "nvcc_13.4", "crt_13.4", "nvvm_13.4", "nvptxcompiler_13.4", + "cudart_13.4", "cublas_13.4", "cublas_dev_13.4", "thrust_13.4" +) +$cudaPath = "$env:ProgramFiles\NVIDIA GPU Computing Toolkit\CUDA\v13.4" +$installer = Join-Path $env:RUNNER_TEMP "cuda_13.4.0.exe" + +Write-Host "Downloading $url" +curl.exe --fail --location --retry 3 --output $installer $url +if ($LASTEXITCODE -ne 0) { throw "Failed to download $url" } + +Write-Host "Installing subpackages: $($subPackages -join ' ')" +$proc = Start-Process -FilePath $installer -ArgumentList (@("-s", "-n") + $subPackages) -Wait -PassThru +Remove-Item $installer -Force +if ($proc.ExitCode -ne 0) { throw "CUDA installer exited with code $($proc.ExitCode)" } + +if (-not (Test-Path "$cudaPath\bin\nvcc.exe")) { throw "nvcc not found under $cudaPath" } + +Write-Host "Installed CUDA to $cudaPath" +& "$cudaPath\bin\nvcc.exe" --version + +"CUDA_PATH=$cudaPath" | Out-File $env:GITHUB_ENV -Append +"$cudaPath\bin" | Out-File $env:GITHUB_PATH -Append diff --git a/.github/workflows/python-package.yml b/.github/workflows/python-package.yml index ce9c2e287..e0ba325c2 100644 --- a/.github/workflows/python-package.yml +++ b/.github/workflows/python-package.yml @@ -60,12 +60,15 @@ jobs: os: [ubuntu-22.04, ubuntu-22.04-arm, windows-2025] cuda_version: ["11.8.0", "12.1.1", "12.4.1", "12.6.3", "12.8.1", "13.0.2", "13.2.0"] + include: + - os: windows-11-vs2026-arm + cuda_version: "13.4.0" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 # Windows: We install Cuda on the agent (slow) - uses: Jimver/cuda-toolkit@3d45d157f327c09c04b50ee6ccdea2d9d017ec76 # v0.2.35 - if: runner.os == 'Windows' + if: runner.os == 'Windows' && runner.arch == 'X64' id: cuda-toolkit with: cuda: ${{ matrix.cuda_version }} @@ -75,11 +78,16 @@ jobs: use-github-cache: false use-local-cache: false log-file-suffix: ${{ runner.os }}-${{ runner.arch }}-${{matrix.cuda_version}}.txt + - name: Install CUDA Toolkit (WoA) + if: runner.os == 'Windows' && runner.arch == 'ARM64' + run: ./.github/scripts/install-cuda-woa.ps1 + shell: pwsh - name: Setup MSVC if: runner.os == 'Windows' uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0 with: - toolset: "14.44" + arch: ${{ runner.arch == 'ARM64' && 'arm64' || 'x64' }} + toolset: ${{ runner.arch == 'X64' && '14.44' || '' }} - name: Build C++ run: bash .github/scripts/build-cuda.sh env: diff --git a/README.md b/README.md index 6f7555533..585574a39 100644 --- a/README.md +++ b/README.md @@ -161,6 +161,14 @@ bitsandbytes has the following minimum requirements for all platforms:
cuda