CTranslate2: CUDA 12 support (libcublas.so.11 is not found)
Per https://opennmt.net/CTranslate2/installation.html the requirement says “Install CUDA 11.2 or above to use the GPU.”
I’m on arch linux with the latest cuda 12.1.1-3 which has libcublas.so.12 and not libcublas.so.11
I’m trying to use CTranslate2 via faster-whisper and it blows up here https://github.com/guillaumekln/faster-whisper/blob/1bb7e33b933dde488a17fd556a1114ee0d58d34b/faster_whisper/transcribe.py#L564
with
--> 564 return self.model.encode(features, to_cpu=to_cpu)
RuntimeError: Library libcublas.so.11 is not found or cannot be loaded
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 5
- Comments: 25 (3 by maintainers)
The major release 4.0.0 supports CUDA 12 now. Feel free to test it if there is any issue about this. Thanks!
If anyone else is encountering this on Colab (or other Ubuntu jammy systems), one workaround for now is to install the libcublas11 package. This can be accomplished by including the following at the start of a Colab notebook:
Here is updated ctranslate2 install for Ubuntu 22.04 with cuda 12.x. You should pip uninstall the existing ctranslate2 before proceeding.
intel mkl
ubuntu 22.04
clone
build
python binding
final step:
pip install the file generated in the “dist” folder. The name of the file is different due to python version and arch.
If you have to use cuda 12 and want a quick hacky fix, one way to try is:
ln -s /usr/local/cuda/lib64/libcublas.so.12 /usr/local/cuda/lib64/libcublas.so.11
since ctranslate2 uses standard cublas apis, this usually won’t produce an error. You can keep all other configs as-is.
The tests shows that “Faster-Whisper with CUDA v12” has -10% drop in performance.
RTX 3050 GPU:
build manually possible. bellow is a bash history to reference: