# RuntimeError: cuDNN error: CUDNN_STATUS_BAD_PARAM when calling cudnnBatchNormalizationForwardTraining

- **ID:** `cuda/cudnn-batch-norm-bad-param`
- **Domain:** cuda
- **Category:** runtime_error
- **Error Code:** `CUDNN_STATUS_BAD_PARAM`
- **Verification:** ai_generated
- **Fix Rate:** 78%

## Root Cause

An invalid parameter was passed to cuDNN batch normalization, such as a zero epsilon value, negative momentum, or mismatched tensor shapes between input, scale, and bias.

## Version Compatibility

| Version | Status | Introduced | Deprecated |
|---------|--------|------------|------------|
| cuDNN 8.9.5 | active | — | — |
| CUDA 12.1 | active | — | — |
| PyTorch 2.2.0 | active | — | — |
| TensorFlow 2.15 | active | — | — |

## Workarounds

1. **import torch; bn = torch.nn.BatchNorm2d(64, eps=1e-5, momentum=0.1)** (85% success)
   ```
   import torch; bn = torch.nn.BatchNorm2d(64, eps=1e-5, momentum=0.1)
   ```
2. **torch.backends.cudnn.enabled = False** (75% success)
   ```
   torch.backends.cudnn.enabled = False
   ```

## Dead Ends

- **** — Batch size does not affect parameter validation; the bad parameter error occurs regardless of batch size. (95% fail)
- **** — Deterministic mode only affects algorithm selection, not parameter checking; the bad parameter is still detected. (90% fail)
