From e12af460eda05120f78d8066dd06d9ec1e33055a Mon Sep 17 00:00:00 2001 From: Daniel Hiltgen Date: Wed, 26 Feb 2025 09:20:52 -0800 Subject: [PATCH] Add cuda Blackwell architecture for v12 (#9350) * Add cuda Blackwell architecture for v12 * Win: Split rocm out to separate zip file * Reduce CC matrix The 6.2 and 7.2 architectures only appear on Jetsons, so they were wasting space. The 5.0 should be forward compatible with 5.2 and 5.3. --- CMakePresets.json | 4 ++-- scripts/build_windows.ps1 | 17 +++++++++++++++-- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/CMakePresets.json b/CMakePresets.json index 68546bde7..6b6545337 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -21,14 +21,14 @@ "name": "CUDA 11", "inherits": [ "CUDA" ], "cacheVariables": { - "CMAKE_CUDA_ARCHITECTURES": "50;52;53;60;61;62;70;72;75;80;86" + "CMAKE_CUDA_ARCHITECTURES": "50;52;53;60;61;70;75;80;86" } }, { "name": "CUDA 12", "inherits": [ "CUDA" ], "cacheVariables": { - "CMAKE_CUDA_ARCHITECTURES": "50;52;53;60;61;62;70;72;75;80;86;87;89;90;90a" + "CMAKE_CUDA_ARCHITECTURES": "50;60;61;70;75;80;86;87;89;90;90a;100" } }, { diff --git a/scripts/build_windows.ps1 b/scripts/build_windows.ps1 index 465cc5518..312c3db54 100644 --- a/scripts/build_windows.ps1 +++ b/scripts/build_windows.ps1 @@ -222,13 +222,26 @@ function buildInstaller() { function distZip() { if (Test-Path -Path "${script:SRC_DIR}\dist\windows-amd64") { + if (Test-Path -Path "${script:SRC_DIR}\dist\windows-amd64\lib\ollama\rocm") { + write-host "Generating stand-alone distribution zip file ${script:SRC_DIR}\dist\ollama-windows-amd64-rocm.zip" + # Temporarily adjust paths so we can retain the same directory structure + Remove-Item -ea 0 -r "${script:SRC_DIR}\dist\windows-amd64-rocm" + mkdir -Force -path "${script:SRC_DIR}\dist\windows-amd64-rocm\lib\ollama" + Write-Output "Extract this ROCm zip file to the same location where you extracted ollama-windows-amd64.zip" > "${script:SRC_DIR}\dist\windows-amd64-rocm\README.txt" + Move-Item -path "${script:SRC_DIR}\dist\windows-amd64\lib\ollama\rocm" -destination "${script:SRC_DIR}\dist\windows-amd64-rocm\lib\ollama" + Compress-Archive -CompressionLevel Optimal -Path "${script:SRC_DIR}\dist\windows-amd64-rocm\*" -DestinationPath "${script:SRC_DIR}\dist\ollama-windows-amd64-rocm.zip" -Force + } + write-host "Generating stand-alone distribution zip file ${script:SRC_DIR}\dist\ollama-windows-amd64.zip" - Compress-Archive -Path "${script:SRC_DIR}\dist\windows-amd64\*" -DestinationPath "${script:SRC_DIR}\dist\ollama-windows-amd64.zip" -Force + Compress-Archive -CompressionLevel Optimal -Path "${script:SRC_DIR}\dist\windows-amd64\*" -DestinationPath "${script:SRC_DIR}\dist\ollama-windows-amd64.zip" -Force + if (Test-Path -Path "${script:SRC_DIR}\dist\windows-amd64-rocm") { + Move-Item -destination "${script:SRC_DIR}\dist\windows-amd64\lib\ollama\rocm" -path "${script:SRC_DIR}\dist\windows-amd64-rocm\lib\ollama" + } } if (Test-Path -Path "${script:SRC_DIR}\dist\windows-arm64") { write-host "Generating stand-alone distribution zip file ${script:SRC_DIR}\dist\ollama-windows-arm64.zip" - Compress-Archive -Path "${script:SRC_DIR}\dist\windows-arm64\*" -DestinationPath "${script:SRC_DIR}\dist\ollama-windows-arm64.zip" -Force + Compress-Archive -CompressionLevel Optimal -Path "${script:SRC_DIR}\dist\windows-arm64\*" -DestinationPath "${script:SRC_DIR}\dist\ollama-windows-arm64.zip" -Force } }