Skip to content

Build Binaries for OpenWhispr #15

Build Binaries for OpenWhispr

Build Binaries for OpenWhispr #15

name: Build Binaries for OpenWhispr
on:
workflow_dispatch:
inputs:
version_tag:
description: 'Version tag for release (e.g., v1.0.0)'
required: true
type: string
push:
tags:
- 'openwhispr-*'
permissions:
contents: write
env:
# RTX 20-50 (Turing through Blackwell). sm_120 requires CUDA Toolkit >= 12.8.
CUDA_ARCHITECTURES: "75;80;86;89;120"
jobs:
build-macos-arm64:
runs-on: macos-14 # M1 runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: macos-arm64
- name: Build whisper.cpp
# GGML_BLAS=OFF: ggml-blas imports $NEWLAPACK$ILP64 Accelerate symbols that
# don't exist before macOS 13.3, and Metal runs the graph on arm64 so BLAS
# is idle. Keeps Monterey (12.x) working. See OpenWhispr/openwhispr#764.
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_OSX_DEPLOYMENT_TARGET=12.0 \
-DGGML_BLAS=OFF \
-DWHISPER_METAL=ON \
-DGGML_METAL=ON \
-DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
- name: Package binaries
run: |
mkdir -p dist
cp build/bin/whisper-cli dist/whisper-cpp-darwin-arm64
chmod +x dist/whisper-cpp-darwin-arm64
cp build/bin/whisper-server dist/whisper-server-darwin-arm64
chmod +x dist/whisper-server-darwin-arm64
cd dist
zip whisper-cpp-darwin-arm64.zip whisper-cpp-darwin-arm64
zip whisper-server-darwin-arm64.zip whisper-server-darwin-arm64
- name: Verify deployment target and symbols
run: |
for bin in dist/whisper-cpp-darwin-arm64 dist/whisper-server-darwin-arm64; do
minos=$(otool -l "$bin" | awk '/LC_BUILD_VERSION/{f=1} f && /minos/{print $2; exit}')
[ "$minos" = "12.0" ] || { echo "$bin: expected minos 12.0, got $minos"; exit 1; }
if nm -u "$bin" | grep -q 'NEWLAPACK'; then echo "$bin: imports \$NEWLAPACK\$ILP64 but targets macOS < 13.3"; exit 1; fi
done
- name: Upload whisper-cli artifact
uses: actions/upload-artifact@v4
with:
name: whisper-cpp-darwin-arm64
path: dist/whisper-cpp-darwin-arm64.zip
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-darwin-arm64
path: dist/whisper-server-darwin-arm64.zip
build-macos-x64:
runs-on: macos-14 # Cross-compile for x64 on arm64 runner
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: macos-x64
- name: Build whisper.cpp for x64
# 13.3 floor matches upstream llama.cpp/whisper.cpp releases: ggml-blas
# (Accelerate GEMM, worth keeping on CPU-only x64) imports $NEWLAPACK$ILP64
# symbols that only exist on macOS >= 13.3. See OpenWhispr/openwhispr#764.
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DCMAKE_OSX_ARCHITECTURES=x86_64 \
-DCMAKE_OSX_DEPLOYMENT_TARGET=13.3 \
-DWHISPER_METAL=OFF \
-DGGML_METAL=OFF \
-DGGML_NATIVE=OFF \
-DBUILD_SHARED_LIBS=OFF
cmake --build build --config Release -j $(sysctl -n hw.logicalcpu)
- name: Package binaries
run: |
mkdir -p dist
cp build/bin/whisper-cli dist/whisper-cpp-darwin-x64
chmod +x dist/whisper-cpp-darwin-x64
cp build/bin/whisper-server dist/whisper-server-darwin-x64
chmod +x dist/whisper-server-darwin-x64
cd dist
zip whisper-cpp-darwin-x64.zip whisper-cpp-darwin-x64
zip whisper-server-darwin-x64.zip whisper-server-darwin-x64
- name: Verify deployment target
run: |
for bin in dist/whisper-cpp-darwin-x64 dist/whisper-server-darwin-x64; do
minos=$(otool -l "$bin" | awk '/LC_BUILD_VERSION/{f=1} f && /minos/{print $2; exit}')
[ "$minos" = "13.3" ] || { echo "$bin: expected minos 13.3, got $minos"; exit 1; }
done
- name: Upload whisper-cli artifact
uses: actions/upload-artifact@v4
with:
name: whisper-cpp-darwin-x64
path: dist/whisper-cpp-darwin-x64.zip
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-darwin-x64
path: dist/whisper-server-darwin-x64.zip
build-windows-x64-cpu:
runs-on: windows-2022
steps:
- name: Free up disk space
shell: pwsh
run: |
# Remove unnecessary tools to free up disk space
Remove-Item -Recurse -Force "C:\hostedtoolcache\CodeQL" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\Java*" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\go" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\Python" -ErrorAction SilentlyContinue
- name: Checkout
uses: actions/checkout@v4
- name: Install Ninja
run: choco install ninja -y
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: windows-x64-cpu
variant: sccache
- name: Build whisper.cpp (CPU-only)
shell: cmd
run: |
cmake -S . -B build -G "Ninja Multi-Config" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_C_COMPILER_LAUNCHER=sccache ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DBUILD_SHARED_LIBS=OFF ^
-DGGML_NATIVE=OFF ^
-DGGML_CUDA=OFF ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build build --config Release -j %NUMBER_OF_PROCESSORS%
- name: Package binaries
shell: pwsh
run: |
mkdir dist
Copy-Item build\bin\Release\whisper-cli.exe dist\whisper-cpp-win32-x64-cpu.exe
Copy-Item build\bin\Release\whisper-server.exe dist\whisper-server-win32-x64-cpu.exe
Set-Location dist
Compress-Archive -Path whisper-cpp-win32-x64-cpu.exe -DestinationPath whisper-cpp-win32-x64-cpu.zip
Compress-Archive -Path whisper-server-win32-x64-cpu.exe -DestinationPath whisper-server-win32-x64-cpu.zip
- name: Upload whisper-cli artifact
uses: actions/upload-artifact@v4
with:
name: whisper-cpp-win32-x64-cpu
path: dist/whisper-cpp-win32-x64-cpu.zip
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-win32-x64-cpu
path: dist/whisper-server-win32-x64-cpu.zip
build-windows-x64-cuda:
runs-on: windows-2022
steps:
- name: Free up disk space
shell: pwsh
run: |
# Remove unnecessary tools to free up disk space
Remove-Item -Recurse -Force "C:\hostedtoolcache\CodeQL" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\Java*" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\go" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\Python" -ErrorAction SilentlyContinue
- name: Checkout
uses: actions/checkout@v4
- name: Install Ninja
run: choco install ninja -y
- name: Install CUDA Toolkit 12.9.1
run: |
$CUDA_VERSION = "12.9.1"
$CUDA_TOOLKIT_DIR = "C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v$CUDA_VERSION"
$CUDA_DOWNLOAD = "https://developer.download.nvidia.com/compute/cuda/redist"
# Component versions for CUDA 12.9.1
$CUDART_VER = "12.9.79"
$NVCC_VER = "12.9.86"
$NVRTC_VER = "12.9.86"
$CUBLAS_VER = "12.9.1.4"
$NVTX_VER = "12.9.79"
$PROFILER_VER = "12.9.79"
$VS_VER = "12.9.79"
$CCCL_VER = "12.9.27"
# Create CUDA toolkit directory
New-Item -ItemType Directory -Force -Path $CUDA_TOOLKIT_DIR
# Install unzip
choco install unzip -y
# Download CUDA components from official NVIDIA CDN
curl -O "$CUDA_DOWNLOAD/cuda_cudart/windows-x86_64/cuda_cudart-windows-x86_64-${CUDART_VER}-archive.zip"
curl -O "$CUDA_DOWNLOAD/cuda_nvcc/windows-x86_64/cuda_nvcc-windows-x86_64-${NVCC_VER}-archive.zip"
curl -O "$CUDA_DOWNLOAD/cuda_nvrtc/windows-x86_64/cuda_nvrtc-windows-x86_64-${NVRTC_VER}-archive.zip"
curl -O "$CUDA_DOWNLOAD/libcublas/windows-x86_64/libcublas-windows-x86_64-${CUBLAS_VER}-archive.zip"
curl -O "$CUDA_DOWNLOAD/cuda_nvtx/windows-x86_64/cuda_nvtx-windows-x86_64-${NVTX_VER}-archive.zip"
curl -O "$CUDA_DOWNLOAD/cuda_profiler_api/windows-x86_64/cuda_profiler_api-windows-x86_64-${PROFILER_VER}-archive.zip"
curl -O "$CUDA_DOWNLOAD/visual_studio_integration/windows-x86_64/visual_studio_integration-windows-x86_64-${VS_VER}-archive.zip"
curl -O "$CUDA_DOWNLOAD/cuda_cccl/windows-x86_64/cuda_cccl-windows-x86_64-${CCCL_VER}-archive.zip"
# Extract all components
unzip -q '*.zip' -d $CUDA_TOOLKIT_DIR
# Copy extracted files to CUDA toolkit directory
xcopy "$CUDA_TOOLKIT_DIR\cuda_cudart-windows-x86_64-${CUDART_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvcc-windows-x86_64-${NVCC_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvrtc-windows-x86_64-${NVRTC_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
xcopy "$CUDA_TOOLKIT_DIR\libcublas-windows-x86_64-${CUBLAS_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
xcopy "$CUDA_TOOLKIT_DIR\cuda_nvtx-windows-x86_64-${NVTX_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
xcopy "$CUDA_TOOLKIT_DIR\cuda_profiler_api-windows-x86_64-${PROFILER_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
xcopy "$CUDA_TOOLKIT_DIR\cuda_cccl-windows-x86_64-${CCCL_VER}-archive\*" "$CUDA_TOOLKIT_DIR" /E /I /H /Y
xcopy "$CUDA_TOOLKIT_DIR\visual_studio_integration-windows-x86_64-${VS_VER}-archive\visual_studio_integration\MSBuildExtensions\*" "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\MSBuild\Microsoft\VC\v170\BuildCustomizations" /E /I /H /Y
# Set environment variables
echo "$CUDA_TOOLKIT_DIR\bin" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append
echo "CUDA_PATH=$CUDA_TOOLKIT_DIR" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8
- name: Verify CUDA installation
run: nvcc --version
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: windows-x64-cuda
variant: sccache
- name: Build whisper.cpp with CUDA
shell: cmd
run: |
cmake -S . -B build -G "Ninja Multi-Config" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_C_COMPILER_LAUNCHER=sccache ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DBUILD_SHARED_LIBS=OFF ^
-DGGML_NATIVE=OFF ^
-DGGML_CUDA=ON ^
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCHITECTURES }}" ^
-DCMAKE_CUDA_FLAGS="--use-local-env" ^
-DCMAKE_CUDA_HOST_COMPILER="cl.exe" ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build build --config Release -j %NUMBER_OF_PROCESSORS%
- name: Package binaries with CUDA DLLs
shell: pwsh
run: |
$CUDA_PATH = $env:CUDA_PATH
mkdir dist
# Copy main binaries
Copy-Item build\bin\Release\whisper-cli.exe dist\whisper-cpp-win32-x64-cuda.exe
Copy-Item build\bin\Release\whisper-server.exe dist\whisper-server-win32-x64-cuda.exe
# Required CUDA runtime DLLs for GPU acceleration
$cudaDlls = @("cudart64_12.dll", "cublas64_12.dll", "cublasLt64_12.dll")
$bundledDlls = @()
foreach ($dll in $cudaDlls) {
$dllPath = Join-Path $CUDA_PATH "bin\$dll"
if (Test-Path $dllPath) {
Write-Host "Bundling $dll"
Copy-Item $dllPath dist\
$bundledDlls += $dll
} else {
Write-Host "Warning: $dll not found at $dllPath"
}
}
Write-Host "Contents of dist folder:"
Get-ChildItem dist | Format-Table Name, Length
# Fail if no CUDA DLLs were bundled
if ($bundledDlls.Count -eq 0) {
Write-Error "No CUDA DLLs were bundled. Build failed."
exit 1
}
# Create zip archives with dynamically built file lists
Set-Location dist
$cliFiles = @("whisper-cpp-win32-x64-cuda.exe") + $bundledDlls
$serverFiles = @("whisper-server-win32-x64-cuda.exe") + $bundledDlls
Compress-Archive -Path $cliFiles -DestinationPath whisper-cpp-win32-x64-cuda.zip
Compress-Archive -Path $serverFiles -DestinationPath whisper-server-win32-x64-cuda.zip
- name: Upload whisper-cli artifact
uses: actions/upload-artifact@v4
with:
name: whisper-cpp-win32-x64-cuda
path: dist/whisper-cpp-win32-x64-cuda.zip
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-win32-x64-cuda
path: dist/whisper-server-win32-x64-cuda.zip
build-linux-x64-cpu:
runs-on: ubuntu-22.04
steps:
- name: Free up disk space
run: |
# Remove unnecessary tools to free up disk space for builds
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
df -h
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: linux-x64-cpu
- name: Build whisper.cpp (CPU-only)
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_NATIVE=OFF \
-DGGML_CUDA=OFF
cmake --build build --config Release -j $(nproc)
- name: Package binaries
run: |
mkdir -p dist
cp build/bin/whisper-cli dist/whisper-cpp-linux-x64-cpu
chmod +x dist/whisper-cpp-linux-x64-cpu
cp build/bin/whisper-server dist/whisper-server-linux-x64-cpu
chmod +x dist/whisper-server-linux-x64-cpu
cd dist
zip whisper-cpp-linux-x64-cpu.zip whisper-cpp-linux-x64-cpu
zip whisper-server-linux-x64-cpu.zip whisper-server-linux-x64-cpu
- name: Upload whisper-cli artifact
uses: actions/upload-artifact@v4
with:
name: whisper-cpp-linux-x64-cpu
path: dist/whisper-cpp-linux-x64-cpu.zip
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-linux-x64-cpu
path: dist/whisper-server-linux-x64-cpu.zip
build-linux-x64-cuda:
runs-on: ubuntu-22.04
steps:
- name: Free up disk space
run: |
# Remove unnecessary tools to free up disk space for CUDA build
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
df -h
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake wget
- name: Install CUDA Toolkit 12.9
run: |
# Download and install CUDA keyring
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb
sudo dpkg -i cuda-keyring_1.1-1_all.deb
sudo apt-get update
# Install minimal CUDA toolkit (compiler and libraries only, no driver)
sudo apt-get install -y cuda-toolkit-12-9
# Set environment variables
echo "/usr/local/cuda-12.9/bin" >> $GITHUB_PATH
echo "CUDA_PATH=/usr/local/cuda-12.9" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/usr/local/cuda-12.9/lib64:$LD_LIBRARY_PATH" >> $GITHUB_ENV
- name: Verify CUDA installation
run: |
export PATH=/usr/local/cuda-12.9/bin:$PATH
nvcc --version
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: linux-x64-cuda
- name: Build whisper.cpp with CUDA
run: |
export PATH=/usr/local/cuda-12.9/bin:$PATH
export CUDA_PATH=/usr/local/cuda-12.9
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_NATIVE=OFF \
-DGGML_CUDA=ON \
-DCMAKE_CUDA_COMPILER=/usr/local/cuda-12.9/bin/nvcc \
-DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCHITECTURES }}"
cmake --build build --config Release -j $(nproc)
- name: Package binaries
run: |
mkdir -p dist
cp build/bin/whisper-cli dist/whisper-cpp-linux-x64-cuda
chmod +x dist/whisper-cpp-linux-x64-cuda
cp build/bin/whisper-server dist/whisper-server-linux-x64-cuda
chmod +x dist/whisper-server-linux-x64-cuda
cd dist
zip whisper-cpp-linux-x64-cuda.zip whisper-cpp-linux-x64-cuda
zip whisper-server-linux-x64-cuda.zip whisper-server-linux-x64-cuda
- name: Upload whisper-cli artifact
uses: actions/upload-artifact@v4
with:
name: whisper-cpp-linux-x64-cuda
path: dist/whisper-cpp-linux-x64-cuda.zip
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-linux-x64-cuda
path: dist/whisper-server-linux-x64-cuda.zip
build-linux-x64-vulkan:
runs-on: ubuntu-22.04
steps:
- name: Free up disk space
run: |
sudo rm -rf /usr/share/dotnet
sudo rm -rf /usr/local/lib/android
sudo rm -rf /opt/ghc
sudo rm -rf /opt/hostedtoolcache/CodeQL
df -h
- name: Checkout
uses: actions/checkout@v4
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install -y build-essential cmake wget gnupg
- name: Install Vulkan SDK
run: |
sudo install -d -m 0755 /etc/apt/keyrings
wget -qO - https://packages.lunarg.com/lunarg-signing-key-pub.asc \
| sudo gpg --dearmor -o /etc/apt/keyrings/lunarg.gpg
echo "deb [signed-by=/etc/apt/keyrings/lunarg.gpg] https://packages.lunarg.com/vulkan jammy main" \
| sudo tee /etc/apt/sources.list.d/lunarg-vulkan-jammy.list
sudo apt-get update
sudo apt-get install -y vulkan-sdk
- name: Verify Vulkan SDK
run: |
echo "VULKAN_SDK=${VULKAN_SDK}"
glslc --version
dpkg -l | grep -E 'vulkan|shaderc' || true
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: linux-x64-vulkan
- name: Build whisper.cpp with Vulkan
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER_LAUNCHER=ccache \
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
-DBUILD_SHARED_LIBS=OFF \
-DGGML_NATIVE=OFF \
-DGGML_CUDA=OFF \
-DGGML_VULKAN=ON
cmake --build build --config Release -j $(nproc)
- name: Package binaries
run: |
mkdir -p dist
cp build/bin/whisper-server dist/whisper-server-linux-x64-vulkan
chmod +x dist/whisper-server-linux-x64-vulkan
cd dist
zip whisper-server-linux-x64-vulkan.zip whisper-server-linux-x64-vulkan
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-linux-x64-vulkan
path: dist/whisper-server-linux-x64-vulkan.zip
build-windows-x64-vulkan:
runs-on: windows-2022
steps:
- name: Free up disk space
shell: pwsh
run: |
Remove-Item -Recurse -Force "C:\hostedtoolcache\CodeQL" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\Java*" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\go" -ErrorAction SilentlyContinue
Remove-Item -Recurse -Force "C:\hostedtoolcache\Python" -ErrorAction SilentlyContinue
- name: Checkout
uses: actions/checkout@v4
- name: Install Ninja
run: choco install ninja -y
- name: Setup MSVC
uses: ilammy/msvc-dev-cmd@v1
- name: Install Vulkan SDK
shell: pwsh
# SDK 1.4.313.2 ships SPIRV-HeadersConfig.cmake, which ggml-vulkan's
# find_package(SPIRV-Headers CONFIG REQUIRED) needs; 1.3.290.0 did not.
# Matches llama.cpp's proven Windows Vulkan recipe (direct LunarG installer).
run: |
curl.exe -o "$env:RUNNER_TEMP/VulkanSDK-Installer.exe" -L "https://sdk.lunarg.com/sdk/download/1.4.313.2/windows/vulkansdk-windows-X64-1.4.313.2.exe"
& "$env:RUNNER_TEMP\VulkanSDK-Installer.exe" --accept-licenses --default-answer --confirm-command install
Add-Content $env:GITHUB_ENV "VULKAN_SDK=C:\VulkanSDK\1.4.313.2"
Add-Content $env:GITHUB_PATH "C:\VulkanSDK\1.4.313.2\Bin"
- name: Verify Vulkan SDK
shell: pwsh
run: |
Write-Host "VULKAN_SDK=$env:VULKAN_SDK"
& "$env:VULKAN_SDK\Bin\glslc.exe" --version
- name: Setup ccache
uses: hendrikmuhs/ccache-action@v1
with:
key: windows-x64-vulkan
variant: sccache
- name: Build whisper.cpp with Vulkan
shell: cmd
run: |
cmake -S . -B build -G "Ninja Multi-Config" ^
-DCMAKE_BUILD_TYPE=Release ^
-DCMAKE_C_COMPILER_LAUNCHER=sccache ^
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
-DBUILD_SHARED_LIBS=OFF ^
-DGGML_NATIVE=OFF ^
-DGGML_CUDA=OFF ^
-DGGML_VULKAN=ON ^
-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
cmake --build build --config Release -j %NUMBER_OF_PROCESSORS%
- name: Package binary
shell: pwsh
run: |
mkdir dist
Copy-Item build\bin\Release\whisper-server.exe dist\whisper-server-win32-x64-vulkan.exe
# vulkan-1.dll is provided by the user's GPU driver install — do not bundle.
# whisper-server is statically linked against ggml-vulkan, so no other runtime DLLs are needed.
Write-Host "Contents of dist folder:"
Get-ChildItem dist | Format-Table Name, Length
Set-Location dist
Compress-Archive -Path whisper-server-win32-x64-vulkan.exe -DestinationPath whisper-server-win32-x64-vulkan.zip
- name: Upload whisper-server artifact
uses: actions/upload-artifact@v4
with:
name: whisper-server-win32-x64-vulkan
path: dist/whisper-server-win32-x64-vulkan.zip
create-release:
needs: [build-macos-arm64, build-macos-x64, build-windows-x64-cpu, build-windows-x64-cuda, build-windows-x64-vulkan, build-linux-x64-cpu, build-linux-x64-cuda, build-linux-x64-vulkan]
runs-on: ubuntu-latest
steps:
- name: Download all artifacts
uses: actions/download-artifact@v4
with:
path: artifacts
- name: Prepare release files
run: |
mkdir release
mv artifacts/whisper-cpp-darwin-arm64/whisper-cpp-darwin-arm64.zip release/
mv artifacts/whisper-cpp-darwin-x64/whisper-cpp-darwin-x64.zip release/
mv artifacts/whisper-cpp-win32-x64-cpu/whisper-cpp-win32-x64-cpu.zip release/
mv artifacts/whisper-cpp-win32-x64-cuda/whisper-cpp-win32-x64-cuda.zip release/
mv artifacts/whisper-cpp-linux-x64-cpu/whisper-cpp-linux-x64-cpu.zip release/
mv artifacts/whisper-cpp-linux-x64-cuda/whisper-cpp-linux-x64-cuda.zip release/
mv artifacts/whisper-server-darwin-arm64/whisper-server-darwin-arm64.zip release/
mv artifacts/whisper-server-darwin-x64/whisper-server-darwin-x64.zip release/
mv artifacts/whisper-server-win32-x64-cpu/whisper-server-win32-x64-cpu.zip release/
mv artifacts/whisper-server-win32-x64-cuda/whisper-server-win32-x64-cuda.zip release/
mv artifacts/whisper-server-linux-x64-cpu/whisper-server-linux-x64-cpu.zip release/
mv artifacts/whisper-server-linux-x64-cuda/whisper-server-linux-x64-cuda.zip release/
mv artifacts/whisper-server-win32-x64-vulkan/whisper-server-win32-x64-vulkan.zip release/
mv artifacts/whisper-server-linux-x64-vulkan/whisper-server-linux-x64-vulkan.zip release/
ls -la release/
- name: Determine version
id: version
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "version=${{ github.event.inputs.version_tag }}" >> $GITHUB_OUTPUT
else
echo "version=${{ github.ref_name }}" >> $GITHUB_OUTPUT
fi
- name: Create Release
uses: softprops/action-gh-release@v1
with:
tag_name: ${{ steps.version.outputs.version }}
name: OpenWhispr Binaries ${{ steps.version.outputs.version }}
body: |
Pre-built whisper.cpp binaries for OpenWhispr. CPU, CUDA, and Vulkan variants are included.
## GPU Acceleration
- **macOS ARM64**: Metal GPU acceleration (M1/M2/M3/M4)
- **Windows x64**: NVIDIA CUDA build (bundled DLLs), Vulkan build (any Vulkan-capable GPU), and CPU build
- **Linux x64**: NVIDIA CUDA build (requires system CUDA), Vulkan build (any Vulkan-capable GPU), and CPU build
- **macOS x64**: CPU only (Intel Macs, requires macOS 13.3+)
## whisper-cli binaries
- `whisper-cpp-darwin-arm64.zip` - macOS Apple Silicon with Metal
- `whisper-cpp-darwin-x64.zip` - macOS Intel (CPU only)
- `whisper-cpp-win32-x64-cpu.zip` - Windows x64 CPU-only
- `whisper-cpp-win32-x64-cuda.zip` - Windows x64 with CUDA (includes bundled CUDA DLLs)
- `whisper-cpp-linux-x64-cpu.zip` - Linux x64 CPU-only
- `whisper-cpp-linux-x64-cuda.zip` - Linux x64 with CUDA
## whisper-server binaries
- `whisper-server-darwin-arm64.zip` - macOS Apple Silicon with Metal
- `whisper-server-darwin-x64.zip` - macOS Intel (CPU only)
- `whisper-server-win32-x64-cpu.zip` - Windows x64 CPU-only
- `whisper-server-win32-x64-cuda.zip` - Windows x64 with CUDA (includes bundled CUDA DLLs)
- `whisper-server-win32-x64-vulkan.zip` - Windows x64 with Vulkan (uses system Vulkan loader)
- `whisper-server-linux-x64-cpu.zip` - Linux x64 CPU-only
- `whisper-server-linux-x64-cuda.zip` - Linux x64 with CUDA
- `whisper-server-linux-x64-vulkan.zip` - Linux x64 with Vulkan (uses system Vulkan loader)
## Requirements
- **Windows CUDA build**: No additional requirements - CUDA DLLs are bundled.
- **Windows Vulkan build**: Requires an up-to-date GPU driver that ships the Vulkan runtime (`vulkan-1.dll`). All modern NVIDIA/AMD/Intel drivers include it.
- **Windows CPU build**: No requirements.
- **Linux CUDA build**: Install latest NVIDIA drivers and CUDA toolkit for GPU acceleration.
- **Linux Vulkan build**: Requires the system Vulkan loader (`libvulkan.so.1`, typically from the `libvulkan1` package) and a Vulkan-capable GPU driver (Mesa for AMD/Intel, NVIDIA proprietary driver for NVIDIA).
- **Linux CPU build**: No requirements.
- **All other platforms**: No requirements.
## Supported NVIDIA GPUs (CUDA builds)
Compute capabilities 7.5+ (RTX 2000 series through RTX 40 series)
files: release/*
draft: false
prerelease: false
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}