CTranslate2: v4.5.0 is not compatible with `torch>=2.*.*+cu121`
Hello the last release works great with versions of pytorch that use python cuda packages, but when torch that is precompiled with cuda binaries is installed, this error appears:
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
the only solution so far is to downgrade to 4.4.0 although CuDNN v9.1 is installed both using pip and bundled with pytorch https://github.com/jhj0517/Whisper-WebUI/pull/348
Update:
as per @BBC-Esq research, ctranslate2>=4.5.0 uses CuDNN v9 which requires CUDA >= 12.3.
Since most issues occur from a conflicting torch and ctranslate2 installations these are tested working combinations:
| Torch Version | CT2 Version |
|---|---|
2.*.*+cu121 |
<=4.4.0 |
2.*.*+cu124 |
>=4.5.0 |
>=2.4.0 |
>=4.5.0 |
<2.4.0 |
<4.5.0 |
For google colab users, the quick solution is to downgrade to 4.4.0 as of 24/10/2024 as colab uses torch==2.5.0+cu12.1
About this issue
- Original URL
- State: open
- Created 2 years ago
- Reactions: 7
- Comments: 25 (4 by maintainers)
@BBC-Esq the problem here is not a cuda vs cudnn compatibility because as per the compatibility matrix we should not be having this issue, it’s an environment setup issue that might involve a mismatch between cuda/cudnn pathes CT2 should support all cuda 12 versions CT2 >=4.5 should support all cudnn 9 versions along with cuda 12, any difference in the minor or patch versions should not break compatibility
Update: it’s compatible with
torch==2.*+cu124so it’s only incompatible with 12.1, I’ll open a PR to solve thisapparently there are two cudnn versions installed in colab
adding the pip cudnn path to
LD_LIBRARY_PATHwill probably solve the problem torch is using the v9 pip installation and ignoring the v8 whilectranslate2is looking for v9 in the v8 installation path probably the best way forward is to make CT2 compatible with pip CUDA libraries without needing to modify the path