# InternalError: cuDNN initialization failed: CUDNN_STATUS_NOT_INITIALIZED

- **ID:** `tensorflow/cudnn-status-not-initialized`
- **Domain:** tensorflow
- **Category:** gpu_error
- **Error Code:** `CUDNN_INIT`
- **Verification:** ai_generated
- **Fix Rate:** 75%

## Root Cause

cuDNN library failed to initialize, often due to incompatible CUDA/cuDNN version or insufficient GPU memory for internal buffers.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| tensorflow 2.10.0 | active | — | — |
| tensorflow 2.11.0 | active | — | — |
| tensorflow 2.12.0 | active | — | — |

## Workarounds

1. **Check and align CUDA and cuDNN versions by running `nvidia-smi` and `cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2`. Then install matching TensorFlow: `pip install tensorflow==2.12.0`.** (85% success)
   ```
   Check and align CUDA and cuDNN versions by running `nvidia-smi` and `cat /usr/include/cudnn_version.h | grep CUDNN_MAJOR -A 2`. Then install matching TensorFlow: `pip install tensorflow==2.12.0`.
   ```
2. **Set environment variable `export TF_CPP_MAX_VLOG_LEVEL=1` before running the script to get detailed cuDNN logs, then adjust library paths accordingly.** (70% success)
   ```
   Set environment variable `export TF_CPP_MAX_VLOG_LEVEL=1` before running the script to get detailed cuDNN logs, then adjust library paths accordingly.
   ```

## Dead Ends

- **** — The issue is usually a system-level library mismatch, not a Python package problem. (90% fail)
- **** — Memory growth does not help with cuDNN initialization; it only controls dynamic allocation. (95% fail)
- **** — Older versions may have the same or worse cuDNN compatibility issues. (80% fail)
