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

libcudnn_cnn problem #1826

Open
781574155 opened this issue Dec 1, 2024 · 2 comments
Open

libcudnn_cnn problem #1826

781574155 opened this issue Dec 1, 2024 · 2 comments

Comments

@781574155
Copy link

781574155 commented Dec 1, 2024

INFO:faster_whisper:Processing audio with duration 03:52.176
Unable to load any of {libcudnn_cnn.so.9.1.0, libcudnn_cnn.so.9.1, libcudnn_cnn.so.9, libcudnn_cnn.so}
Invalid handle. Cannot load symbol cudnnCreateConvolutionDescriptor

ctranslate2==4.5.0
torch==2.5.1
faster-whisper==1.1.0

image

@781574155
Copy link
Author

after setup LD_LIBRARY_PATH, program run correctly.

export LD_LIBRARY_PATH=/usr/local/lib/python3.11/site-packages/nvidia/cudnn/lib/:$LD_LIBRARY_PATH

It's should be correctly setup automatically!

@zhou13
Copy link

zhou13 commented Dec 2, 2024

Get the same problem.

On my machine, I have cuda 12.7, torch==2.5.1.
If I use ctranslate2==4.5.0 with torch, I got

Unable to load any of {libcudnn_cnn.so.9.1.0, libcudnn_cnn.so.9.1, libcudnn_cnn.so.9, libcudnn_cnn.so}

If I use ctranslate2==4.4.0 with torch, I got

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

Using cuda with ctranslate2 or torch individually is fine. But you cannot invoke torch.cuda before ctranslate2.

The following files exist on my environment:

.venv/lib/python3.12/site-packages/nvidia/cudnn/lib/libcudnn_cnn.so.9
/usr/lib/libcudnn_cnn.so
/usr/lib/libcudnn_cnn.so.9
/usr/lib/libcudnn_cnn.so.9.5.1

Setting LD_LIBRARY_PATH="/path/to/.venv/lib/python3.12/site-packages/nvidia/cudnn/lib" works around the problem.

The problem does not exist when torch is not loaded. However, if I remove the system libcudnn under /usr/lib/, then ctranslate2 will fail even WITHOUT torch:

Unable to load any of {libcudnn_cnn.so.9.1.0, libcudnn_cnn.so.9.1, libcudnn_cnn.so.9, libcudnn_cnn.so}

Weird problem. My hypothesis is that torch always loads /path/to/.venv/lib/python3.12/site-packages/nvidia/cudnn/lib but ld used by ctranslate2 tries to load /usr/lib/libcudnn_cnn.so. When used individually, it is fine. However, the later will fail if torch already loads the its cudnn in the same application.

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

2 participants