Skip to content

Commit 77e8a07

Browse files
committed
Bump whisper.cpp version
1 parent 9871dd6 commit 77e8a07

File tree

3 files changed

+57
-20
lines changed

3 files changed

+57
-20
lines changed

CMakeLists.txt

Lines changed: 15 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ option(WHISPERCPP_WITH_HIPBLAS "Build Whisper with hipBLAS support" OFF)
1010

1111
set(CMAKE_OSX_ARCHITECTURES_ "$ENV{MACOS_ARCH}")
1212

13-
set(Whispercpp_Build_GIT_TAG "f68298ce06ca3edd6e6f3f21c3d0bb5f073942c3")
13+
set(Whispercpp_Build_GIT_TAG "c4e1861d2c24b186cbbac6c07480aaa298b0e6d9")
1414

1515
if(${CMAKE_BUILD_TYPE} STREQUAL Release OR ${CMAKE_BUILD_TYPE} STREQUAL
1616
RelWithDebInfo)
@@ -41,18 +41,9 @@ endif()
4141

4242
if(WIN32)
4343
if(WHISPERCPP_WITH_CUDA)
44-
# Build with CUDA Check that CUDA_TOOLKIT_ROOT_DIR is set
45-
if(NOT DEFINED CUDA_TOOLKIT_ROOT_DIR)
46-
message(
47-
FATAL_ERROR
48-
"CUDA_TOOLKIT_ROOT_DIR is not set. Please set it to the root directory of your CUDA "
49-
"installation, e.g. `C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4`"
50-
)
51-
endif(NOT DEFINED CUDA_TOOLKIT_ROOT_DIR)
52-
53-
set(WHISPER_ADDITIONAL_ENV "CUDAToolkit_ROOT=${CUDA_TOOLKIT_ROOT_DIR}")
54-
set(WHISPER_ADDITIONAL_CMAKE_ARGS
55-
-DGGML_CUDA=ON -DCMAKE_GENERATOR_TOOLSET=cuda=${CUDA_TOOLKIT_ROOT_DIR})
44+
# Build with CUDA
45+
set(WHISPER_ADDITIONAL_ENV "")
46+
set(WHISPER_ADDITIONAL_CMAKE_ARGS -DGGML_CUDA=ON)
5647
set(WHISPER_CMAKE_GENERATOR ${CMAKE_GENERATOR})
5748
elseif(WHISPERCPP_WITH_HIPBLAS)
5849
# Build with hipBLAS
@@ -104,12 +95,8 @@ if(WIN32)
10495
<INSTALL_DIR>/bin/${CMAKE_SHARED_LIBRARY_PREFIX}whisper${CMAKE_SHARED_LIBRARY_SUFFIX}
10596
<INSTALL_DIR>/lib/${CMAKE_IMPORT_LIBRARY_PREFIX}whisper${CMAKE_IMPORT_LIBRARY_SUFFIX}
10697
CMAKE_GENERATOR ${CMAKE_GENERATOR}
107-
INSTALL_COMMAND
108-
${CMAKE_COMMAND} --install <BINARY_DIR> --config ${Whispercpp_BUILD_TYPE}
109-
&& ${CMAKE_COMMAND} -E copy
110-
<BINARY_DIR>/${Whispercpp_BUILD_TYPE}/whisper.lib <INSTALL_DIR>/lib &&
111-
${CMAKE_COMMAND} -E copy <SOURCE_DIR>/ggml/include/ggml.h
112-
<INSTALL_DIR>/include
98+
INSTALL_COMMAND ${CMAKE_COMMAND} --install <BINARY_DIR> --config
99+
${Whispercpp_BUILD_TYPE}
113100
CONFIGURE_COMMAND
114101
${CMAKE_COMMAND} -E env ${WHISPER_ADDITIONAL_ENV} ${CMAKE_COMMAND}
115102
<SOURCE_DIR> -B <BINARY_DIR> -G ${WHISPER_CMAKE_GENERATOR}
@@ -179,6 +166,15 @@ if(WIN32)
179166
"${HIP_PATH_STR}/bin/amd_comgr_2.dll")
180167
install(FILES ${HIPBLAS_DLLS} DESTINATION ${CMAKE_SOURCE_DIR}/release/bin)
181168
else()
169+
# Check that CUDA_TOOLKIT_ROOT_DIR is set
170+
if(NOT DEFINED CUDA_TOOLKIT_ROOT_DIR)
171+
message(
172+
FATAL_ERROR
173+
"CUDA_TOOLKIT_ROOT_DIR is not set. Please set it to the root directory of your CUDA "
174+
"installation, e.g. `C:/Program Files/NVIDIA GPU Computing Toolkit/CUDA/v11.4`"
175+
)
176+
endif(NOT DEFINED CUDA_TOOLKIT_ROOT_DIR)
177+
182178
# normalize CUDA path with file(TO_CMAKE_PATH)
183179
file(TO_CMAKE_PATH ${CUDA_TOOLKIT_ROOT_DIR} CUDA_TOOLKIT_ROOT_DIR)
184180
# find the CUDA DLLs for cuBLAS in the bin directory of the CUDA

README.md

Lines changed: 38 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,39 @@
1-
# occ-ai-dep-whispercpp
1+
# Whisper.cpp prebuilt binaries
22
Whisper.cpp prebuilt binaries for static and dynamic linking
3+
4+
## Building on Windows
5+
6+
You will need MSVS 2022 installed.
7+
8+
Set up environment variables, e.g.:
9+
10+
```powershell
11+
> $env:BUILD_WITH_ACCEL="cuda"
12+
> $env:CUDA_TOOLKIT_ROOT_DIR="C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.5"
13+
```
14+
15+
Acceleration options: `cpu`, `cuda` and `hipblas`
16+
17+
For `hipblas` make sure `$env:HIP_PATH` points to the HIP installation folder, e.g. where `$env:HIP_PATH\bin\clang.exe` would be located.
18+
19+
The HIP installer can be downloaded from https://download.amd.com/developer/eula/rocm-hub/AMD-Software-PRO-Edition-24.Q3-Win10-Win11-For-HIP.exe.
20+
21+
Run the build script:
22+
23+
```powershell
24+
> ./Build-Windows.ps1 -Version 0.0.6
25+
```
26+
27+
## Building on Mac OS
28+
29+
Set the `MACOS_ARCH` env variable to `x86_64` or `arm64`:
30+
31+
```bash
32+
$ export MACOS_ARCH=x86_64
33+
```
34+
35+
Run the build script:
36+
37+
```bash
38+
$ ./build-macos.sh 0.0.6
39+
```

build-windows.ps1

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ if ($env:BUILD_WITH_ACCEL -eq $null) {
88
exit
99
}
1010

11+
$env:CMAKE_TOOLCHAIN_FILE=""
12+
$env:VCPKG_ROOT=""
13+
1114
$cmakeArgs = @()
1215
if ($env:BUILD_WITH_ACCEL -eq "cpu") {
1316
$cmakeArgs += ("-DWHISPERCPP_WITH_CUDA=OFF")
@@ -23,6 +26,7 @@ if ($env:BUILD_WITH_ACCEL -eq "cpu") {
2326
} else {
2427
$cmakeArgs += (
2528
"-DWHISPERCPP_WITH_CUDA=ON",
29+
"-DCMAKE_GENERATOR=Visual Studio 17 2022",
2630
"-DCUDA_TOOLKIT_ROOT_DIR=$env:CUDA_TOOLKIT_ROOT_DIR"
2731
)
2832
$zipFileName = "whispercpp-windows-cuda-$Version.zip"

0 commit comments

Comments
 (0)