diff --git a/CUDNN_TROUBLESHOOTING.md b/CUDNN_TROUBLESHOOTING.md new file mode 100644 index 00000000..80b12e56 --- /dev/null +++ b/CUDNN_TROUBLESHOOTING.md @@ -0,0 +1,76 @@ +# Troubleshooting cuDNN Loading Errors + +This guide helps resolve common cuDNN-related errors when running WhisperX on GPU. These issues typically occur when the system can't locate cuDNN libraries or finds conflicting versions. + +## Unable to Load cuDNN Libraries + +If you encounter the following error when running WhisperX: + +`Unable to load any of {libcudnn_cnn.so.9.1.0, libcudnn_cnn.so.9.1, libcudnn_cnn.so.9, libcudnn_cnn.so}` + +This means the cuDNN libraries are installed (via whisperx dependencies) but aren't in a location where the system's dynamic linker can find them. + +### Solution 1: Add to LD_LIBRARY_PATH (Recommended) + +Add this at the start of your Python script or notebook: + +```python +import os + +# Get current LD_LIBRARY_PATH +original = os.environ.get("LD_LIBRARY_PATH", "") + +cudnn_path = "/usr/local/lib/python3.12/dist-packages/nvidia/cudnn/lib/" +os.environ['LD_LIBRARY_PATH'] = original + ":" + cudnn_path +``` + +**Note:** Adjust the Python version (`python3.12`) to match your environment. + +### Solution 2: Symlink to LD_LIBRARY_PATH Directory + +If Solution 1 didn't work and you still get the "unable to load" error, symlink the libraries to a directory that's already in your `LD_LIBRARY_PATH`: + +1. Check what's in your LD_LIBRARY_PATH: `echo "$LD_LIBRARY_PATH"` +2. Assuming that there is only one path set. + Symlink the downloaded libcudnn files to that path: + `ln -s /usr/local/lib/python3.12/dist-packages/nvidia/cudnn/lib/libcudnn* "$LD_LIBRARY_PATH"/` + + **Note:** If `LD_LIBRARY_PATH` contains multiple paths (separated by `:`), pick one directory and use it instead of `"$LD_LIBRARY_PATH"`. For example: `/usr/lib/x86_64-linux-gnu/` + +## cuDNN Version Incompatibility + +If you encounter this error: + +``` +RuntimeError: cuDNN version incompatibility: PyTorch was compiled against (9, 10, 2) but found runtime version (9, 2, 1) +``` + +This means PyTorch is finding a different cuDNN version than the one it was compiled with. **PyTorch comes bundled with its own cuDNN**, but a conflicting cuDNN in `LD_LIBRARY_PATH` is taking precedence. + +### Solution: Remove Conflicting cuDNN from Path + +Check if there's a conflicting cuDNN path: + +```bash +echo $LD_LIBRARY_PATH +``` + +If you see paths pointing to older cuDNN installations (e.g., system-installed cuDNN or manually downloaded), try one of these: + +**Option 1: Clear LD_LIBRARY_PATH temporarily** + +```python +import os +# Let PyTorch use its bundled cuDNN +os.environ.pop('LD_LIBRARY_PATH', None) +``` + +**Option 2: Set LD_LIBRARY_PATH to only the correct version** + +```python +import os +# Point only to the cuDNN that matches PyTorch's compiled version +os.environ['LD_LIBRARY_PATH'] = "/usr/local/lib/python3.12/dist-packages/nvidia/cudnn/lib/" +``` + +**Note:** This error is unlikely on a clean install. If it occurs anyway, [open an issue](https://github.com/m-bain/whisperX/issues). If you've modified system libraries or CUDA/cuDNN, the options above should help resolve most cases. diff --git a/pyproject.toml b/pyproject.toml index bdb3c545..926d6975 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -2,7 +2,7 @@ urls = { repository = "https://github.com/m-bain/whisperx" } authors = [{ name = "Max Bain" }] name = "whisperx" -version = "3.7.2" +version = "3.7.4" description = "Time-Accurate Automatic Speech Recognition using Whisper." readme = "README.md" requires-python = ">=3.9, <3.14" @@ -19,8 +19,8 @@ dependencies = [ "av<16.0.0", "numpy>=2.1.0,<2.3.0; python_version >='3.13'", "pyannote-audio>=3.3.2,<4.0.0", - "torch>=2.7.1", - "torchaudio", + "torch~=2.8.0", + "torchaudio~=2.8.0", "transformers>=4.48.0", "triton>=3.3.0; sys_platform == 'linux' and platform_machine == 'x86_64'" # only install triton on x86_64 Linux ] diff --git a/uv.lock b/uv.lock index 07f1daaf..c6b122a9 100644 --- a/uv.lock +++ b/uv.lock @@ -4006,7 +4006,7 @@ wheels = [ [[package]] name = "whisperx" -version = "3.7.2" +version = "3.7.4" source = { editable = "." } dependencies = [ { name = "av" }, @@ -4039,12 +4039,12 @@ requires-dist = [ { name = "onnxruntime", marker = "python_full_version < '3.10'", specifier = ">=1.19,<1.20.0" }, { name = "pandas", specifier = ">=2.2.3,<2.3.0" }, { name = "pyannote-audio", specifier = ">=3.3.2,<4.0.0" }, - { name = "torch", marker = "sys_platform == 'darwin'", specifier = ">=2.7.1", index = "https://download.pytorch.org/whl/cpu" }, - { name = "torch", marker = "platform_machine != 'x86_64' and sys_platform != 'darwin'", specifier = ">=2.7.1", index = "https://download.pytorch.org/whl/cpu" }, - { name = "torch", marker = "platform_machine == 'x86_64' and sys_platform != 'darwin'", specifier = ">=2.7.1", index = "https://download.pytorch.org/whl/cu128" }, - { name = "torchaudio", marker = "sys_platform == 'darwin'", index = "https://download.pytorch.org/whl/cpu" }, - { name = "torchaudio", marker = "platform_machine != 'x86_64' and sys_platform != 'darwin'", index = "https://download.pytorch.org/whl/cpu" }, - { name = "torchaudio", marker = "platform_machine == 'x86_64' and sys_platform != 'darwin'", index = "https://download.pytorch.org/whl/cu128" }, + { name = "torch", marker = "sys_platform == 'darwin'", specifier = "~=2.8.0", index = "https://download.pytorch.org/whl/cpu" }, + { name = "torch", marker = "platform_machine != 'x86_64' and sys_platform != 'darwin'", specifier = "~=2.8.0", index = "https://download.pytorch.org/whl/cpu" }, + { name = "torch", marker = "platform_machine == 'x86_64' and sys_platform != 'darwin'", specifier = "~=2.8.0", index = "https://download.pytorch.org/whl/cu128" }, + { name = "torchaudio", marker = "sys_platform == 'darwin'", specifier = "~=2.8.0", index = "https://download.pytorch.org/whl/cpu" }, + { name = "torchaudio", marker = "platform_machine != 'x86_64' and sys_platform != 'darwin'", specifier = "~=2.8.0", index = "https://download.pytorch.org/whl/cpu" }, + { name = "torchaudio", marker = "platform_machine == 'x86_64' and sys_platform != 'darwin'", specifier = "~=2.8.0", index = "https://download.pytorch.org/whl/cu128" }, { name = "transformers", specifier = ">=4.48.0" }, { name = "triton", marker = "platform_machine == 'x86_64' and sys_platform == 'linux'", specifier = ">=3.3.0", index = "https://download.pytorch.org/whl/cu128" }, ]