-
-
Notifications
You must be signed in to change notification settings - Fork 94
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
Failed to load native whisper library #65
Comments
Hello @milanstamenkovic, Did you also install the Runtime package with the same version? e.g
|
If you installed that, or try to run the examples without success, the most likely issue is that you're missing glibc dependency. |
Hi @sandrohanea, I installed both packages, but didn't know about glibc and it seems that it wasn't installed. System.Exception: Failed to load native whisper library. Error: Unknown error Not sure if by "missing glibc dependency", You meant to install it in ubuntu. |
Hello, |
Hi @sandrohanea , Taking your steps to see which library is missing I found that I'm missing GLIB_2.32 and GLIBC_2.34. As I found out, it is not recommended to mess with those dependencies so I tried to upgrade ubuntu packages but that didn't do anything. I deployed code to server which is running Ubuntu 20.04.5 LTS and it throws the same error. As I can see here I recompiled whistler.cpp and replaced the original file.. I'm not sure where this original file should be, I checked everything that is installed with Whisper.net and Whisper.net.Runtime and I couldn't find where I should replace it. Because I don't have previous experience with this kind of integration, can You please confirm that I'm doing everything that is needed:
Is regular workflow expected to be this way or there is something else under the hood? |
Hello @milanstamenkovic, You don't need to rebuild the library, just to ensure that the native library can be loaded. You can use Once Navigate to that path and execute This is not a normal flow as usually all the dependencies are automatically provisioned in most of the distributions. |
I've found out providing custom LD_LIBRARY_PATH=$(pwd)/bin/x64/Debug/net6.0/runtimes/linux-x64/:$LD_LIBRARY_PATH dotnet watch run Otherwise I always got |
In working with containers, I found that I needed to be sure to include the latest GLIBC libraries, and using a base image of Ubuntu 22.04 (Jammy) solved this problem for me |
Hello all, Also, VS 2019 redistributable is not required on Windows and not VS 2022 as before. Ofc, on both platforms, the library is working with the latest GLIBC and/or latest VS. |
For me, the demo with clblast GPU, one need to download and copy clblast.dll to the exe directory, or somewhere in path, download from https://github.com/CNugteren/CLBlast/releases/tag/1.6.0 . The demo with cublas GPU on windows, one need to download https://developer.nvidia.com/cuda-toolkit , and only need to install CUBLAS, CUDART runtime. Then copy the dlls from C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v12.1\bin. The 3 needed dlls are : cublas64_12.dll , cublasLt64_12.dll and cudart64_12.dll |
@sandrohanea I got my application working without problems on macOS Ventura, Ubuntu 20.22 and Windows 11 ARM64. Windows 11 on an x64 machine unfortunately fails with:
I followed all suggestions in this and the other threads except for hunting down a GLIBC since it only relates to Linux as far as I can tell. The suggestion to use a custom loader doesn't work with the provided code because the I've been trying the "Simple" example with version 1.4.6 of the project packages on an up-to-date install of Win 11 that has VS 2022 installed (including C++ development package). |
same problem |
same problem。env is windows 11, and user net 6.0 version. |
[[Failed to load native whisper library. Error: The specified module could not be found.] I created a console application from scratch, installed everything necessary, and then run it in debug mode: Resulted with error. The compiler was in AnyCpu mode. Then I changed to x64 (tested with debug + release modes): Then, sometimes I get this error and sometimes I don't. The ratio is approximately 1 to 5. If it fails 5 times, it works correctly once???.... I know it's meaningless, but that's how it is. I have no idea why. I tried everything written in other titles as well as what is written in this title. It does not work. Has anyone experienced similar problems? Did anyone find a solution? |
Hello, I also have a similar problem. But on another computer the same project runs without errors. what could it be? |
running into a similar problem |
Issue is fixed for me. In my case I found that I did not have CUDA Toolkit 12 installed (I had 11.8) I used the "Dependency Walker" tool to find the native library dependency issue. It has been useful on several occasions. https://github.com/isindicic/DependencyWalker.Net I dropped the "\whisper.net.runtime.cublas\1.4.7\build\win-x64\whisper.dll" file into the tool's gui and it pointed out that it could not find the cuda12_XX DLLs, which prompted me to install CUDA 12. |
BTW I was able to run whisper.net with CUDA support on Linux.
And then copy the shared library to 'runtimes' (renamed to whisper.so):
I also had to set the LD_LIBRARY_PATH variable to /runtimes/linux-x64/ to let the system find the shared library. Note: don't use the main whisper.cpp repo to compile whisper as that may not be compatible. Use the one referenced from the Whisper.net repo as a git submodule. |
Yes, that should work. It is still in my plan, and hopefully will make it automatically in Whisper.net.Cublas in the next release 1.5.0. |
I solved this problem by running VS with administrator privileges |
Added the exact dependencies for each runtime in the readme. Also we support multiple runtimes now referenced at the same time in one project. see https://github.com/sandrohanea/whisper.net?tab=readme-ov-file#multiple-runtimes-support |
I can't get it work, I keep getting error "Failed to load native whisper library". Not sure if I'm supposed to do something rather then adding packages in project, downloading model and creating processor. I'm doing exactly what is done in Simple example.
The error appears at following line:
using var whisperFactory = WhisperFactory.FromPath("ggml-base.bin");
I'm integrating into dotnet core 5 application running on linux-x64 machine.
Should I manually run whisper library or add it somewhere? Not sure that I understand the process at all..
`
`
The text was updated successfully, but these errors were encountered: