Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Project build for examples/stream for Windows (CUDA 12.1) #2053

Open
LeoSpace-bit opened this issue Apr 14, 2024 · 1 comment
Open

Project build for examples/stream for Windows (CUDA 12.1) #2053

LeoSpace-bit opened this issue Apr 14, 2024 · 1 comment

Comments

@LeoSpace-bit
Copy link

Through CMake I managed to build main.exe and project for MS VS 2022, attempts to build project for Stream were not successful.

Please help me either with setting CMakeLists.txt or with setting paths in MS VS 2022 project to connect header files, "common-sdl.h", "common.h", "whisper.h"

@Zapotecatl
Copy link

Zapotecatl commented May 17, 2024

This is how I did the settings in Visual Studio 2019 (no CUDA, I hope helps for someone).

---Donwload and install CMake---
https://cmake.org/download/

---Donwload SDL----
https://github.com/libsdl-org/SDL/releases/tag/release-2.28.5
Source code (zip)
Unzip

---SDL2---

cd C:\Users\Jorge\Downloads\SDL-release-2.28.5\SDL-release-2.28.5
cmake -B build
cmake --build build --config Release --target install -j 14 --

---Whispercpp---

cd D:\Whisper\
git clone https://github.com/ggerganov/whisper.cpp.git
cd D:\Whisper\whisper.cpp
cmake -B build
cmake .. -DWHISPER_BUILD_EXAMPLES=1 -DWHISPER_SDL2=1 -DSDL2_DIR="C:/C:/Program Files (x86)/SDL2" -DCMAKE_PREFIX_PATH="C:/Program Files (x86)/SDL2/cmake"
cmake .. --build build --config Release 

Download ggml-base.en.bin in models folder
https://huggingface.co/ggerganov/whisper.cpp/tree/main

------------In Visual Studio-------------

Let's say you want to replicate the stream example.

Create a console application, for example: SpeechRecognizer

In properties select: All the configurations
Release x64

Now add these files into you project:
common.h
common-sdl.h
ggml.h
whisper.h
stream.cpp

C/C++>>Additional include directories:
C:\Program Files (x86)\SDL2\include\SDL2

Configuration Properties>>C/C++>>Preporocessor>>Preprocessor Definitions: _CRT_SECURE_NO_WARNINGS

Create a Lib folder in your project, for example:
D:\Whisper\SpeechRecognizer\Lib

In Lib folder add these libs:
common.lib (D:\Whisper\whisper.cpp\build\examples\Release)
common-sdl.lib (D:\Whisper\whisper.cpp\build\examples\Release)
SDL2.lib (C:\Users\Jorge\Downloads\SDL-release-2.28.5\SDL-release-2.28.5\build\Release)
whisper.lib (D:\Whisper\whisper.cpp\build\Release)

Linker>>General>>AdditionalLibrary Directories:
D:\Whisper\SpeechRecognizer\Lib

Linker>>Input>>Additional Dependencies:
common.lib;common-sdl.lib;whisper.lib;SDL2.lib

In stream.cpp before the main function add:

#undef main

Build your project.

Add the dlls in the folder where is your exe: SDL2.dll and whisper.dll

In your command line write something like this:

stream -m D:\\Whisper\\whisper.cpp\\models\\ggml-base.en.bin -t 8 --step 500 --length 5000

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants