# RuntimeError: cuDNN version mismatch: PyTorch was compiled against cuDNN X but linked against cuDNN Y

- **ID:** `pytorch/cudnn-version-mismatch`
- **Domain:** pytorch
- **Category:** build_error
- **Verification:** ai_generated
- **Fix Rate:** 85%

## Root Cause

Installed PyTorch binary was compiled with a different cuDNN version than the one installed on the system or in the environment.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| 1.12 | active | — | — |
| 1.13 | active | — | — |
| 2.0 | active | — | — |
| 2.1 | active | — | — |
| 2.2 | active | — | — |
| 2.3 | active | — | — |

## Workarounds

1. **Install PyTorch with the matching cuDNN version using conda or pip from pytorch.org, ensuring the cudatoolkit package matches. For example: conda install pytorch torchvision torchaudio cudatoolkit=11.8 -c pytorch** (90% success)
   ```
   Install PyTorch with the matching cuDNN version using conda or pip from pytorch.org, ensuring the cudatoolkit package matches. For example: conda install pytorch torchvision torchaudio cudatoolkit=11.8 -c pytorch
   ```
2. **Use a Docker container from PyTorch's official images to avoid system-level cuDNN conflicts.** (95% success)
   ```
   Use a Docker container from PyTorch's official images to avoid system-level cuDNN conflicts.
   ```

## Dead Ends

- **** — This only changes the visible version but doesn't fix the underlying library path. (60% fail)
- **** — This may break other CUDA-dependent libraries that need the system cuDNN. (50% fail)
