Problem
After training to a certain number of iterations, an error is reported:
RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling cublasSgemm( handle, opa, opb, m, n, k, &alpha, a, lda, b, ldb, &beta, c, ldc)
Possible causes
- The shape dimension does not match
- Variables are not on the same device
- pytorch and cuda versions do not match
Solution
Add os.environ['CUDA_VISIBLE_DEVICES'] = '0'
at the beginning of the train.py file, and set device='cuda'
.
But there is a strange phenomenon: if you do not set the visible gpu, but specify device='cuda:0'
, it will also report an error.
Read More:
- [Solved] RuntimeError: CUDA error: CUBLAS_STATUS_EXECUTION_FAILED when calling `cubla…
- [Solved] RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED
- How to Solve RuntimeError: cuDNN error: CUDNN_STATUS_EXECUTION_FAILED
- [Solved] RuntimeError: cublas runtime error : resource allocation failed at
- [Solved] RuntimeError: cuda runtime error (100) : no CUDA-capable device is detected at
- pytorch: RuntimeError CUDA error device-side assert triggered
- [Solved] RuntimeError: CUDA error: device-side assert triggered CUDA kernel errors
- RuntimeError: CUDA error: an illegal memory access was encountered
- Pytorch CUDA Error: UserWarning: CUDA initialization: CUDA unknown error…
- [DL Common Issue] RuntimeError: CUDA error 59: Device-side assert triggered
- [How to Solve] RuntimeError: CUDA out of memory.
- How to Solve Error: RuntimeError CUDA out of memory
- [Solved] RuntimeError: cuda runtime error (801) : operation not supported at
- [Solved] RuntimeError: cuda runtime error: device-side assert trigger
- [Solved] Pycharm paddle Error: Error: (External) CUDA error(35), CUDA driver version is insufficient for CUDA
- [Solved] torchsummary Error: RuntimeError: Input type (torch.cuda.FloatTensor) and weight type (torch.F
- Pytorch torch.cuda.FloatTensor Error: RuntimeError: one of the variables needed for gradient computation has…
- [Solved] RuntimeError: Input type (torch.FloatTensor) and weight type (torch.cuda.FloatTensor) should be the
- [Solved] RuntimeError: cublas runtime error : unknown error at C:/w/b/win…cu:225
- [Solved] Using summary to View network parameters Error: RuntimeError: Input type (torch.cuda.FloatTensor)