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

whisper.dll not work when import in python #895

Open
DanielusG opened this issue May 8, 2023 · 4 comments
Open

whisper.dll not work when import in python #895

DanielusG opened this issue May 8, 2023 · 4 comments

Comments

@DanielusG
Copy link

Hi, i create a fork of a pybind11 binding of whisper.cpp project in https://github.com/DanielusG/pywhispercpp.git because the author was no longer updating it and I wanted to implement CuBLAS.

In this fork, I created commits that allowed whisper to use CuBLAS and thus accelerate whisper using the GPU, as well as adding features such as the probability of tokens.

It works fine on linux and shows my GPU in use, but when I'm on Windows, it compiles without errors, but when I import the library a DLL error comes up.

Even just a suggestion on how I can debug the dll would be fine. I am not an expert in this field so any suggestions would be well appreciated!

The error using my fork on windows:
ImportError: DLL load failed while importing _pywhispercpp:

i followed the error with the library called dlltracer and it returns:

Failed \Device\HarddiskVolume7\Windows\System32\msvcp140.dll
Failed \Device\HarddiskVolume7\Program Files\Python310\vcruntime140_1.dll

It may appear that the error is Microsoft VC C++. But it is correctly installed and I have tried essentially all versions

The problem only and only appears on windows and compile with CUDA support, if I disable CUDA support it works on windows as well.

So I'm wondering, why is it that when I enable CUDA suddenly whisper looks for Visual Studio DLLs?

I suspect the DLLs are just a superficial problem, but the underlying problem is essentially something else, perhaps an unhandled exception when launching the DLL. Is there any way to debug the DLL? I've searched everywhere on the net there don't seem to be any suggestions, some say to use Visual Studio to debug the DLL, but I haven't been able to get it to work at all

Any help and/or suggestions will be welcome.

P.S. A heartfelt THANK YOU to the entire community who strive every day to bring innovation open to all, thank you❤️

@vivekuppal
Copy link

I ran into the exact same problem when working on this fork
https://github.com/dnhkng/whisper.cpp/tree/master

To resolve this I had to take the following steps

Then I was able to load the whisper.dll correctly in python

FYI @dnhkng

@DanielusG
Copy link
Author

I ran into the exact same problem when working on this fork https://github.com/dnhkng/whisper.cpp/tree/master

To resolve this I had to take the following steps

Then I was able to load the whisper.dll correctly in python

FYI @dnhkng

Thank you so much for sharing the solution with me!
I will try the solution as soon as I can

@muhammadalhawari
Copy link

I ran into the exact same problem when working on this fork https://github.com/dnhkng/whisper.cpp/tree/master

To resolve this I had to take the following steps

* Use dependenciesgui.exe from https://github.com/lucasg/Dependencies to figure out all the dlls required for loading whisper.dll.

* Copied all the required dlls into the current directory.

Then I was able to load the whisper.dll correctly in python

FYI @dnhkng

Hi, I tried to solve this by using your solution, but somehow I can't understand some things..

  1. where do we find whisper.dll?
  2. what do you mean by current directory?

Need help, thanks..

@dnhkng
Copy link
Contributor

dnhkng commented Dec 23, 2023

@muhammadalhawari See this post on the DLLs you need for windows: #1524 (comment)

For the whisper DLL, you have to compile that yourself. For the working directory, that just means where you are running the python scripts.

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

4 participants