cuda
runtime_error
ai_generated
partial
RuntimeError: CUDA error: misaligned address
ID: cuda/misaligned-address
55%Fix Rate
78%Confidence
3Evidence
2023-01-01First Seen
Version Compatibility
| Version | Status | Introduced | Deprecated | Notes |
|---|---|---|---|---|
| 12 | active | — | — | — |
Root Cause
CUDA kernel accessed memory at an address not aligned to the required boundary. Often caused by custom CUDA kernels or corrupted tensors.
genericWorkarounds
-
85% success Set CUDA_LAUNCH_BLOCKING=1 to get the exact kernel and line
CUDA_LAUNCH_BLOCKING=1 python train.py
-
80% success Check for integer overflow in index calculations for large tensors
Use torch.long for indices when tensor dimensions exceed 2^31
-
75% success Verify custom CUDA kernel alignment with alignof() and aligned_alloc()
Dead Ends
Common approaches that don't work:
-
Increase GPU memory allocation
90% fail
This is an alignment error, not an out-of-memory error; more memory does not fix wrong addresses
-
Disable CUDA memory caching allocator
82% fail
The caching allocator does not cause misalignment; disabling it only hurts performance
Error Chain
Frequently confused with: