MATLAB: CUDA_ERROR​_LAUNCH_TI​MEOUT

cudacuda_error_launch_timeoutfevalkernelParallel Computing Toolbox

Hi
I am trying to execute PTX code, as the help file "Executing CUDA or PTX Code on the GPU" suggests.
I have executed the example successfully. But when I try to do the same with my own kernel, y retrieve this error:
??? Error using ==> feval
An error occurred during: retrieving information about free memory. The CUDA error was:
CUDA_ERROR_LAUNCH_TIMEOUT.
Any suggestions please?
Thanks,
María.

Best Answer

What type of cards do you have?
Do you have your user desktop extended to both graphics cards?
In general, this error occurs when a long running gpuArray or CUDA code is run on a GPU that is used for both graphics rendering and CUDA computations. The error is triggered by the Operating System, which limits the time that the GPU can dedicate to computations, vs. rendering the user desktop.
This limit does not apply to GPUs which do not have the desktop extended to them, such as standalone GPU accelerators, or cards running under TCC driver on Windows.
For this reason it is recommended that gpuArray and CUDAkernel evaluations be run on a GPU that is NOT attached to a display and does not have the Windows or Linux desktop extended onto it.
On the Windows Vista, Windows 7 operating systems individual GPU kernels running on GPUs that are responsible for desktop rendering are limited to a 2 second runtime.
If your system has GPUs without a display attached then you can manually modify the system configuration to disable the TDR mechanism. Disabling the TDR timeout will allow kernels to run for extended periods of time without triggering an error. In addition, on Windows, Tesla cards running under Tesla Compute Cluster drivers are not subject to this limitation.
For information on how to modify or disable the TDR timeout on Windows Vista and Windows 7 refer to:
Related Question