@@ -110,7 +110,69 @@ jobs:
110110 name : whisper-server-darwin-x64
111111 path : dist/whisper-server-darwin-x64.zip
112112
113- build-windows-x64 :
113+ build-windows-x64-cpu :
114+ runs-on : windows-2022
115+ steps :
116+ - name : Free up disk space
117+ shell : pwsh
118+ run : |
119+ # Remove unnecessary tools to free up disk space
120+ Remove-Item -Recurse -Force "C:\hostedtoolcache\CodeQL" -ErrorAction SilentlyContinue
121+ Remove-Item -Recurse -Force "C:\hostedtoolcache\Java*" -ErrorAction SilentlyContinue
122+ Remove-Item -Recurse -Force "C:\hostedtoolcache\go" -ErrorAction SilentlyContinue
123+ Remove-Item -Recurse -Force "C:\hostedtoolcache\Python" -ErrorAction SilentlyContinue
124+
125+ - name : Checkout
126+ uses : actions/checkout@v4
127+
128+ - name : Install Ninja
129+ run : choco install ninja -y
130+
131+ - name : Setup MSVC
132+ uses : ilammy/msvc-dev-cmd@v1
133+
134+ - name : Setup ccache
135+ uses : hendrikmuhs/ccache-action@v1
136+ with :
137+ key : windows-x64-cpu
138+ variant : sccache
139+
140+ - name : Build whisper.cpp (CPU-only)
141+ shell : cmd
142+ run : |
143+ cmake -S . -B build -G "Ninja Multi-Config" ^
144+ -DCMAKE_BUILD_TYPE=Release ^
145+ -DCMAKE_C_COMPILER_LAUNCHER=sccache ^
146+ -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
147+ -DBUILD_SHARED_LIBS=OFF ^
148+ -DGGML_NATIVE=OFF ^
149+ -DGGML_CUDA=OFF ^
150+ -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
151+ cmake --build build --config Release -j %NUMBER_OF_PROCESSORS%
152+
153+ - name : Package binaries
154+ shell : pwsh
155+ run : |
156+ mkdir dist
157+ Copy-Item build\bin\Release\whisper-cli.exe dist\whisper-cpp-win32-x64-cpu.exe
158+ Copy-Item build\bin\Release\whisper-server.exe dist\whisper-server-win32-x64-cpu.exe
159+ Set-Location dist
160+ Compress-Archive -Path whisper-cpp-win32-x64-cpu.exe -DestinationPath whisper-cpp-win32-x64-cpu.zip
161+ Compress-Archive -Path whisper-server-win32-x64-cpu.exe -DestinationPath whisper-server-win32-x64-cpu.zip
162+
163+ - name : Upload whisper-cli artifact
164+ uses : actions/upload-artifact@v4
165+ with :
166+ name : whisper-cpp-win32-x64-cpu
167+ path : dist/whisper-cpp-win32-x64-cpu.zip
168+
169+ - name : Upload whisper-server artifact
170+ uses : actions/upload-artifact@v4
171+ with :
172+ name : whisper-server-win32-x64-cpu
173+ path : dist/whisper-server-win32-x64-cpu.zip
174+
175+ build-windows-x64-cuda :
114176 runs-on : windows-2022
115177 steps :
116178 - name : Free up disk space
@@ -192,40 +254,133 @@ jobs:
192254 - name : Build whisper.cpp with CUDA
193255 shell : cmd
194256 run : |
195- call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\VC\Auxiliary\Build\vcvars64.bat"
196257 cmake -S . -B build -G "Ninja Multi-Config" ^
197258 -DCMAKE_BUILD_TYPE=Release ^
198259 -DCMAKE_C_COMPILER_LAUNCHER=sccache ^
199260 -DCMAKE_CXX_COMPILER_LAUNCHER=sccache ^
200261 -DBUILD_SHARED_LIBS=OFF ^
262+ -DGGML_NATIVE=OFF ^
201263 -DGGML_CUDA=ON ^
202264 -DCMAKE_CUDA_ARCHITECTURES="${{ env.CUDA_ARCHITECTURES }}" ^
203265 -DCMAKE_CUDA_FLAGS="--use-local-env" ^
204- -DCMAKE_CUDA_HOST_COMPILER="cl.exe"
266+ -DCMAKE_CUDA_HOST_COMPILER="cl.exe" ^
267+ -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreaded
205268 cmake --build build --config Release -j %NUMBER_OF_PROCESSORS%
206269
207- - name : Package binaries
270+ - name : Package binaries with CUDA DLLs
271+ shell : pwsh
208272 run : |
273+ $CUDA_PATH = $env:CUDA_PATH
209274 mkdir dist
210- copy build\bin\Release\whisper-cli.exe dist\whisper-cpp-win32-x64.exe
211- copy build\bin\Release\whisper-server.exe dist\whisper-server-win32-x64.exe
275+
276+ # Copy main binaries
277+ Copy-Item build\bin\Release\whisper-cli.exe dist\whisper-cpp-win32-x64-cuda.exe
278+ Copy-Item build\bin\Release\whisper-server.exe dist\whisper-server-win32-x64-cuda.exe
279+
280+ # Required CUDA runtime DLLs for GPU acceleration
281+ $cudaDlls = @("cudart64_12.dll", "cublas64_12.dll", "cublasLt64_12.dll")
282+ $bundledDlls = @()
283+
284+ foreach ($dll in $cudaDlls) {
285+ $dllPath = Join-Path $CUDA_PATH "bin\$dll"
286+ if (Test-Path $dllPath) {
287+ Write-Host "Bundling $dll"
288+ Copy-Item $dllPath dist\
289+ $bundledDlls += $dll
290+ } else {
291+ Write-Host "Warning: $dll not found at $dllPath"
292+ }
293+ }
294+
295+ Write-Host "Contents of dist folder:"
296+ Get-ChildItem dist | Format-Table Name, Length
297+
298+ # Fail if no CUDA DLLs were bundled
299+ if ($bundledDlls.Count -eq 0) {
300+ Write-Error "No CUDA DLLs were bundled. Build failed."
301+ exit 1
302+ }
303+
304+ # Create zip archives with dynamically built file lists
305+ Set-Location dist
306+ $cliFiles = @("whisper-cpp-win32-x64-cuda.exe") + $bundledDlls
307+ $serverFiles = @("whisper-server-win32-x64-cuda.exe") + $bundledDlls
308+
309+ Compress-Archive -Path $cliFiles -DestinationPath whisper-cpp-win32-x64-cuda.zip
310+ Compress-Archive -Path $serverFiles -DestinationPath whisper-server-win32-x64-cuda.zip
311+
312+ - name : Upload whisper-cli artifact
313+ uses : actions/upload-artifact@v4
314+ with :
315+ name : whisper-cpp-win32-x64-cuda
316+ path : dist/whisper-cpp-win32-x64-cuda.zip
317+
318+ - name : Upload whisper-server artifact
319+ uses : actions/upload-artifact@v4
320+ with :
321+ name : whisper-server-win32-x64-cuda
322+ path : dist/whisper-server-win32-x64-cuda.zip
323+
324+ build-linux-x64-cpu :
325+ runs-on : ubuntu-22.04
326+ steps :
327+ - name : Free up disk space
328+ run : |
329+ # Remove unnecessary tools to free up disk space for builds
330+ sudo rm -rf /usr/share/dotnet
331+ sudo rm -rf /usr/local/lib/android
332+ sudo rm -rf /opt/ghc
333+ sudo rm -rf /opt/hostedtoolcache/CodeQL
334+ df -h
335+
336+ - name : Checkout
337+ uses : actions/checkout@v4
338+
339+ - name : Install dependencies
340+ run : |
341+ sudo apt-get update
342+ sudo apt-get install -y build-essential cmake
343+
344+ - name : Setup ccache
345+ uses : hendrikmuhs/ccache-action@v1
346+ with :
347+ key : linux-x64-cpu
348+
349+ - name : Build whisper.cpp (CPU-only)
350+ run : |
351+ cmake -B build \
352+ -DCMAKE_BUILD_TYPE=Release \
353+ -DCMAKE_C_COMPILER_LAUNCHER=ccache \
354+ -DCMAKE_CXX_COMPILER_LAUNCHER=ccache \
355+ -DBUILD_SHARED_LIBS=OFF \
356+ -DGGML_NATIVE=OFF \
357+ -DGGML_CUDA=OFF
358+ cmake --build build --config Release -j $(nproc)
359+
360+ - name : Package binaries
361+ run : |
362+ mkdir -p dist
363+ cp build/bin/whisper-cli dist/whisper-cpp-linux-x64-cpu
364+ chmod +x dist/whisper-cpp-linux-x64-cpu
365+ cp build/bin/whisper-server dist/whisper-server-linux-x64-cpu
366+ chmod +x dist/whisper-server-linux-x64-cpu
212367 cd dist
213- Compress-Archive -Path whisper-cpp-win32 -x64.exe -DestinationPath whisper-cpp-win32 -x64.zip
214- Compress-Archive -Path whisper-server-win32 -x64.exe -DestinationPath whisper-server-win32 -x64.zip
368+ zip whisper-cpp-linux -x64-cpu.zip whisper-cpp-linux -x64-cpu
369+ zip whisper-server-linux -x64-cpu.zip whisper-server-linux -x64-cpu
215370
216371 - name : Upload whisper-cli artifact
217372 uses : actions/upload-artifact@v4
218373 with :
219- name : whisper-cpp-win32 -x64
220- path : dist/whisper-cpp-win32 -x64.zip
374+ name : whisper-cpp-linux -x64-cpu
375+ path : dist/whisper-cpp-linux -x64-cpu .zip
221376
222377 - name : Upload whisper-server artifact
223378 uses : actions/upload-artifact@v4
224379 with :
225- name : whisper-server-win32 -x64
226- path : dist/whisper-server-win32 -x64.zip
380+ name : whisper-server-linux -x64-cpu
381+ path : dist/whisper-server-linux -x64-cpu .zip
227382
228- build-linux-x64 :
383+ build-linux-x64-cuda :
229384 runs-on : ubuntu-22.04
230385 steps :
231386 - name : Free up disk space
@@ -288,28 +443,28 @@ jobs:
288443 - name : Package binaries
289444 run : |
290445 mkdir -p dist
291- cp build/bin/whisper-cli dist/whisper-cpp-linux-x64
292- chmod +x dist/whisper-cpp-linux-x64
293- cp build/bin/whisper-server dist/whisper-server-linux-x64
294- chmod +x dist/whisper-server-linux-x64
446+ cp build/bin/whisper-cli dist/whisper-cpp-linux-x64-cuda
447+ chmod +x dist/whisper-cpp-linux-x64-cuda
448+ cp build/bin/whisper-server dist/whisper-server-linux-x64-cuda
449+ chmod +x dist/whisper-server-linux-x64-cuda
295450 cd dist
296- zip whisper-cpp-linux-x64.zip whisper-cpp-linux-x64
297- zip whisper-server-linux-x64.zip whisper-server-linux-x64
451+ zip whisper-cpp-linux-x64-cuda .zip whisper-cpp-linux-x64-cuda
452+ zip whisper-server-linux-x64-cuda .zip whisper-server-linux-x64-cuda
298453
299454 - name : Upload whisper-cli artifact
300455 uses : actions/upload-artifact@v4
301456 with :
302- name : whisper-cpp-linux-x64
303- path : dist/whisper-cpp-linux-x64.zip
457+ name : whisper-cpp-linux-x64-cuda
458+ path : dist/whisper-cpp-linux-x64-cuda .zip
304459
305460 - name : Upload whisper-server artifact
306461 uses : actions/upload-artifact@v4
307462 with :
308- name : whisper-server-linux-x64
309- path : dist/whisper-server-linux-x64.zip
463+ name : whisper-server-linux-x64-cuda
464+ path : dist/whisper-server-linux-x64-cuda .zip
310465
311466 create-release :
312- needs : [build-macos-arm64, build-macos-x64, build-windows-x64, build-linux-x64]
467+ needs : [build-macos-arm64, build-macos-x64, build-windows-x64-cpu , build-windows-x64-cuda, build- linux-x64-cpu, build-linux-x64-cuda ]
313468 runs-on : ubuntu-latest
314469 steps :
315470 - name : Download all artifacts
@@ -322,12 +477,16 @@ jobs:
322477 mkdir release
323478 mv artifacts/whisper-cpp-darwin-arm64/whisper-cpp-darwin-arm64.zip release/
324479 mv artifacts/whisper-cpp-darwin-x64/whisper-cpp-darwin-x64.zip release/
325- mv artifacts/whisper-cpp-win32-x64/whisper-cpp-win32-x64.zip release/
326- mv artifacts/whisper-cpp-linux-x64/whisper-cpp-linux-x64.zip release/
480+ mv artifacts/whisper-cpp-win32-x64-cpu/whisper-cpp-win32-x64-cpu.zip release/
481+ mv artifacts/whisper-cpp-win32-x64-cuda/whisper-cpp-win32-x64-cuda.zip release/
482+ mv artifacts/whisper-cpp-linux-x64-cpu/whisper-cpp-linux-x64-cpu.zip release/
483+ mv artifacts/whisper-cpp-linux-x64-cuda/whisper-cpp-linux-x64-cuda.zip release/
327484 mv artifacts/whisper-server-darwin-arm64/whisper-server-darwin-arm64.zip release/
328485 mv artifacts/whisper-server-darwin-x64/whisper-server-darwin-x64.zip release/
329- mv artifacts/whisper-server-win32-x64/whisper-server-win32-x64.zip release/
330- mv artifacts/whisper-server-linux-x64/whisper-server-linux-x64.zip release/
486+ mv artifacts/whisper-server-win32-x64-cpu/whisper-server-win32-x64-cpu.zip release/
487+ mv artifacts/whisper-server-win32-x64-cuda/whisper-server-win32-x64-cuda.zip release/
488+ mv artifacts/whisper-server-linux-x64-cpu/whisper-server-linux-x64-cpu.zip release/
489+ mv artifacts/whisper-server-linux-x64-cuda/whisper-server-linux-x64-cuda.zip release/
331490 ls -la release/
332491
333492 - name : Determine version
@@ -345,29 +504,36 @@ jobs:
345504 tag_name : ${{ steps.version.outputs.version }}
346505 name : OpenWhispr Binaries ${{ steps.version.outputs.version }}
347506 body : |
348- Pre-built whisper.cpp binaries for OpenWhispr.
507+ Pre-built whisper.cpp binaries for OpenWhispr. CPU and CUDA variants are included.
349508
350509 ## GPU Acceleration
351510 - **macOS ARM64**: Metal GPU acceleration (M1/M2/M3/M4)
352- - **Windows x64**: NVIDIA CUDA GPU acceleration (auto-fallback to CPU if no NVIDIA GPU)
353- - **Linux x64**: NVIDIA CUDA GPU acceleration (auto-fallback to CPU if no NVIDIA GPU)
511+ - **Windows x64**: NVIDIA CUDA build (bundled DLLs) and CPU build
512+ - **Linux x64**: NVIDIA CUDA build (requires system CUDA) and CPU build
354513 - **macOS x64**: CPU only (Intel Macs)
355514
356515 ## whisper-cli binaries
357516 - `whisper-cpp-darwin-arm64.zip` - macOS Apple Silicon with Metal
358517 - `whisper-cpp-darwin-x64.zip` - macOS Intel (CPU only)
359- - `whisper-cpp-win32-x64.zip` - Windows x64 with CUDA
360- - `whisper-cpp-linux-x64.zip` - Linux x64 with CUDA
518+ - `whisper-cpp-win32-x64-cpu.zip` - Windows x64 CPU-only
519+ - `whisper-cpp-win32-x64-cuda.zip` - Windows x64 with CUDA (includes bundled CUDA DLLs)
520+ - `whisper-cpp-linux-x64-cpu.zip` - Linux x64 CPU-only
521+ - `whisper-cpp-linux-x64-cuda.zip` - Linux x64 with CUDA
361522
362523 ## whisper-server binaries
363524 - `whisper-server-darwin-arm64.zip` - macOS Apple Silicon with Metal
364525 - `whisper-server-darwin-x64.zip` - macOS Intel (CPU only)
365- - `whisper-server-win32-x64.zip` - Windows x64 with CUDA
366- - `whisper-server-linux-x64.zip` - Linux x64 with CUDA
526+ - `whisper-server-win32-x64-cpu.zip` - Windows x64 CPU-only
527+ - `whisper-server-win32-x64-cuda.zip` - Windows x64 with CUDA (includes bundled CUDA DLLs)
528+ - `whisper-server-linux-x64-cpu.zip` - Linux x64 CPU-only
529+ - `whisper-server-linux-x64-cuda.zip` - Linux x64 with CUDA
367530
368531 ## Requirements
369- - **NVIDIA GPU users**: Install latest NVIDIA drivers for GPU acceleration
370- - **Non-NVIDIA users**: No requirements, automatic CPU fallback
532+ - **Windows CUDA build**: No additional requirements - CUDA DLLs are bundled.
533+ - **Windows CPU build**: No requirements.
534+ - **Linux CUDA build**: Install latest NVIDIA drivers and CUDA toolkit for GPU acceleration.
535+ - **Linux CPU build**: No requirements.
536+ - **All other platforms**: No requirements.
371537
372538 ## Supported NVIDIA GPUs
373539 Compute capabilities 7.5+ (RTX 2000 series through RTX 40 series)
0 commit comments