MATLAB Answers

Error using gpuArray/subsasgn An unexpected error occurred during CUDA execution. The CUDA error was: CUDA_ERROR_LAUNCH_FAILED

5 views (last 30 days)
Elham Kashani
Elham Kashani on 14 Sep 2021
Answered: Joss Knight on 16 Sep 2021 at 17:34
My Matlab code is running on a workstation and it is on GPU. Whenever I sign out the workstation after a while this error occure:
"Error using gpuArray/subsasgn
An unexpected error occurred during CUDA execution. The CUDA error
was:
CUDA_ERROR_LAUNCH_FAILED"
What is the poroblem and how can it be fixed?

Answers (1)

Joss Knight
Joss Knight on 16 Sep 2021 at 17:34
What version of MATLAB are you using, what GPU and what platform?
This sounds like a problem seen before with workstation 'Sleep' or 'Suspend' power modes. Some period after you sign out your workstation enables this mode and GPU compute stops functioning in running applications. Typically this can be avoided by disabling Sleep mode, closing MATLAB before signing out, or ensuring that you are driving your display with a different GPU than you are using for compute.
Some versions of this issue have fixes, depending on your card and OS. You can also try updating your GPU driver.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by