-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Windows build #5
Comments
Would love this!! I want to run whisper on my ancient i7-5500U and right now with OpenAI's version on Windows 10, I can only transcribe 100 minutes in 24 hours. |
Here is my recommendation, for x86 windows and multiple targets at once in a single binary format with zero to minimal changes: https://github.com/jart/cosmopolitan For a demo of what is possible with this: https://redbean.dev/ Info here: https://justine.lol/cosmopolitan/ I have used it for small internal projects. And works fine. Basically this is how it works:
Doesn't work if you use libc functions that are not implemented, most are. If you get issues, this is your safe way to mitigate missing headers etc: https://github.com/fabriziobertocci/cosmo-include Here are more resources to get you started: https://github.com/shmup/awesome-cosmopolitan Wish you good fun! I'm sure you'll love it. Oh by the way. If you have real issues: https://github.com/jart/cosmopolitan/issues the crew is really cool and made up wizards / ex googlers, helpful - they respond quick, try to resolve issues soon. Cheers |
PS. If you go the cosmopolitan way, you could also think of using redbean to encapsulate it and provide a web ui - would be cool. |
Thanks for the ideas - cosmopolitan sounds like an interesting option! Will give it a thought |
@ggerganov for Windows there is a POSIX threads API for Windows from - pthreads4w I tried compiling ggml.c in VisualStudio 2017 with pthreads4w, but it didn't work for me :( |
Hi, i created pull request for adding windows support with build in Visual Studio 2022 @ggerganov please, see my pull request, thank's |
This project has support for the MSVC compiler, so you are able to compile it with Visual Studio. You should use the 2017-2022 versions to ensure compatibility. The "Desktop development with C++" should provide most of the stuff we need to compile. Launch Developer Command Prompt for whatever version of your VS, then use cmake to build a VS project. In the root directory of the repo, execute this command: cmake -S . -B ./build This will tell cmake to take the current directory as a source and generate a VS project inside the Screenshots |
it seems not support VS2017, when I build this with VS2017, many errors display. but It can build succeed on VS2022,Thanks! But when running it, I had this error: Assertion failed:rc==0,file ****\ggml.c,line 6522, I checked the ggml.c,found it failed when create multi thread. any one had the same issue and any idea that can fix it? |
Trying to get this working with Visual Studio 2022 on Windows as well, but I seem to be stuck on this error when building the solution: Do you have any possible pointers? I'm not very familiar with building C on Windows. |
Disclaimer: I'm in the same boat as you being unfamiliar with this build process. I don't know what I'm doing with it. I found that if I open the main.vcxproj file that Visual Studio 2022 created when I initially opened the whisper.cpp folder in the Visual Studio, there are instances of m.lib in there. I did a find and replace to remove each m.lib (and its semi-colon), and then I was able to get Visual Studio to build whisper.cpp. (I don't know if Visual Studio auto-reloads changes to this file, so I closed it before editing the file.) I do get an error trying to run an audio file through whisper.cpp after compiling, but it's the same error I had previously when I managed to hobble together a Windows build previously, so I don't know whether removing references to m.lib from the project file causes this error or not. (The error is |
Seems like some commits after the commit that adds MSVC support (#42) broke the compilation. I'm no expert at C++, but you can try to look at the changes or checkout your git to that earlier commit so that you can compile successfully. |
I ran into the same issue with |
Hi I found an error in CMakeLists.txt, the Also, there is no FindSDL2.cmake module in CMake for Windows, you can verify this if you download the official installer v3.24.2 |
Is anyone able to build as shared library on Windows? I get the following error when calling from Python: Current thread 0x0000434c (most recent call first):
File "C:\Users\willi\Documents\src\buzz\whispercpp_test.py", line 18 in <module>
Windows fatal exception: access violation
Current thread 0x0000434c (most recent call first):
File "C:\Users\willi\Documents\src\buzz\whispercpp_test.py", line 18 in <module>
Windows fatal exception: access violation
Current thread 0x0000434c (most recent call first):
File "C:\Users\willi\Documents\src\buzz\whispercpp_test.py", line 18 in <module>
Windows fatal exception: stack overflow Full description: #9 (comment) |
Hi @chidiwilliams, I'm really bad with Windows and I don't even have a machine to try on, so I won't be able to help with the build. The original idea was to be able to build the project on Windows using |
- __AVX2__ should already be defined due to /arch:AVX2 - _CRT_SECURE_NO_WARNINGS should be defined both for shared and static lib
@ggerganov hi, this commit is broken. AVX not working, please revert change! |
Is it impossible for you to check out an earlier commit? |
I fixed AVX support in this commit (need adding defenition |
@CHERTS https://learn.microsoft.com/en-us/cpp/build/reference/arch-x64?view=msvc-170 If someone else can confirm that it does not work for them too, then I will add it back, but for now I will assume it is likely something wrong in your environment. |
I didn't find the /arch:AVX2 option in the generated *.vcxproj files. I think it's a challenge |
我也遇到同样的问题,这是由于utf-8编码导致的。 |
If you want to build windows files on github, you can make a simple rule to build them.
|
We now have automated Window builds + produced binaries + instructions for cross-compiling from Linux to Windows using MinGW. The README is updated with appropriate links. I think we can finally close this issue. Thanks to everyone that helped! |
Set the project "main" as startup project |
ref ggerganov#5 : MSVC build
- __AVX2__ should already be defined due to /arch:AVX2 - _CRT_SECURE_NO_WARNINGS should be defined both for shared and static lib
I used Git for Windows SDK(https://gitforwindows.org/) that comes with Git Bash which has MingW, make, gcc, and g++. Used Running with the tiny model: However, for me this was ~1.2 seconds slower than the provided prebuilt binary. Building with CLBlast:In the same git bash, window, have to install this package: https://packages.msys2.org/package/mingw-w64-x86_64-clblast?repo=mingw64 Command to install the package: pacman -S mingw-w64-x86_64-clblast Next, build by running:
Running on the same example... above here it takes more than 8 seconds. Build success on Windows but the performance is somewhat lower. I don't know why, Maybe my PC is slower or Idk. |
ref ggerganov#5 : MSVC build
- __AVX2__ should already be defined due to /arch:AVX2 - _CRT_SECURE_NO_WARNINGS should be defined both for shared and static lib
@ggerganov It seams that the latest build lacks Windows binaries. |
Would be nice if someone can help and provide build instructions for Windows.
I think the only thing that might need an update is the pthread dependency in ggml.c.
The rest of the code should build successfully.
Probably a
.bat
script to download the models would also be nice since no Bash on Windows.The text was updated successfully, but these errors were encountered: