faster-whisper: Could not load library libcudnn_ops_infer.so.8
Could not load library libcudnn_ops_infer.so.8. Error: libcudnn_ops_infer.so.8: cannot open shared object file: No such file or directory
I’m using “nvidia/cuda:12.2.0-base-ubuntu20.04” image on google cloud with nvidia t4 gpus.
The normal whisper package model works fine on cuda.
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 12
- Comments: 46 (2 by maintainers)
Sweet. I was able to get this working.
I installed the NVIDIA software in the README. That caused issues. Had the same
libcudnn_ops_infer.so.8error as the original poster.Steps to fix:
sudo apt-get purge nvidia-*thensudo apt autoremovethensudo apt install system76-driver-nvidiapip install nvidia-cublas-cu11 nvidia-cudnn-cu11pip install faster-whisperjfk.flakfrom thetest/datadirectoryLD_LIBRARY_PATHenv varHope this helps someone!
If you are installing CUDA via pip in a virtual environment (and the same goes for on host, VM, or in a container):
My previous comment about needing to downgrade my host CUDA toolkit and drivers was wrong. You just need to have a host system with drivers that supports up to or past the CUDA version required by the library.
If you continue to have trouble, please provide the pip dependencies installed in your dev/prod environment, where those deps are located in the environment, and also post the outputs of the following:
For everyone that has this issue, what fixed it for me was to include the path to torch too in
LD_LIBRARY_PATH. The docker image I run ispytorch/pytorch:2.0.1-cuda11.7-cudnn8-runtimeThe line below adds torch as well as cudnn and cublas to the path.
For me installing the cuDNN 8 libraries using
sudo apt install libcudnn8on Ubuntu 22.04 fixed the issue!Solution: if you are on
CUDA=12.xand havecuDNN=9, then installctranslate==4.5.0Thanks @seaBFH ! After that, find where they are.
If you see like this, ./.venv/lib/python3.10/site-packages/nvidia/cudnn/lib/libcudnn_ops_train.so.8 ./.venv/lib/python3.10/site-packages/nvidia/cudnn/lib/libcudnn_ops_infer.so.8
Then, do like this. It worked for me.
I used in Ubuntu 24.04
sudo apt install nvidia-cudnnProblem: Could not load library libcudnn_ops_infer.so.8. Error: libcublas.so.11: cannot open shared object file: No such file or directory Aborted (core dumped)
Use python to check the path of the lib
Add the LD_LIBRARY_PATH variable in bashrc, the content is the data printed by python.
After modification, remember to close the current terminal and reopen a new terminal so that the above configuration will take effect.
Just a note: vast.ai machine was Ubuntu 22.04 x84_64 machine. And I tested it for this machine only.
Here is what helped me:
It is not trivial to install version 8! If you go to the official website to install cuDNN and enter your machine’s details, you will only get the latest version — version 9. I tried it, but it doesn’t work (even when you link from calls of version 8 to version 9).
Official Website
So, you would need to go to archive and submit your request for version 8.
After that, you will get a file called
.deb. In my case, I gotcudnn-local-repo-ubuntu2204-8.9.7.29_1.0-1_amd64.debHere is how you install it:
Maybe you would also need to do that:
You can find cuBLAS and cuDNN libs for Linux there at Releases -> https://github.com/Purfview/whisper-standalone-win
Not tested, report if they work.
As in “at least 11.8” or “exactly 11.8”? I have CUDA Version: 12.0 installed (in WSL2/Ubuntu) but get this error.
cudnn 8.x.x.x is very important. https://docs.nvidia.com/deeplearning/cudnn/latest/installation/linux.html
Hi everybody, and thank you for helping me in solving this issue!
Expanding on @justinthelaw comment I have used the following command instead:
With this you append the paths to the
$LD_LIBRARY_PATHrather than overwriting it. In the path,/path/to/venvmust be substituted with the actual location (and name) of your virtual environment. The same applies topython3.x, where thexmust be substituted with the Python version in use.As a final comment,
exportapplies only to the terminal in which it is issued. One may consider to append it to the$HOME/.bashrcscript to make it persistent.解决了 ,用的现成的docker镜像搞定了,可以参考下我写的博客 https://blog.csdn.net/CXY00000/article/details/147079214?spm=1001.2014.3001.5501
Just find the location of
libcudnn_ops_infer.so.8, and add it toLD_LIBRARY_PATH:it work for me:
It happened in the
docker-compose/docker. To solve it I had to execute the next command inside the docker:Check if your
LD_LIBRARY_PATHis specified and points to your cuda location.Another solution is to install
nvidia-cudnnin your venv. You could simply run:link: https://pypi.org/project/nvidia-cudnn/
That really worked for me!
For me
pip install ctranslate2==4.5.0worked (instead ofpip install ctranslate==4.5.0as https://github.com/SYSTRAN/faster-whisper/issues/516#issuecomment-2628799793 said), thanks for the fix @sheldonrong 🙌🏻✨@SeaDude your solution is the only one that worked! thank you
Just doing this command fixed the issue for me. No need for
export LD_LIBRARY_PATH=...in my case.I have been using it but I was hoping to use faster-whisper for obvious reasons…
@justinthelaw try adding path to
.../**/torch/libto theLD_LIBRARY_PATH.