# Cudamemcpy error cudaErrorLaunchTimeout

**URL:** <https://forums.developer.nvidia.com/t/cudamemcpy-error-cudaerrorlaunchtimeout/22386>\
**Category:** CUDA Programming and Performance\
**Created:** [May 11, 2011, 9:03am UTC](https://forums.developer.nvidia.com/t/cudamemcpy-error-cudaerrorlaunchtimeout/22386 "2011-05-11T09:03:39Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Warlord88](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/warlord88/32/439482_2.png) [@Warlord88](https://forums.developer.nvidia.com/u/Warlord88)\
**Post date:** [May 11, 2011, 9:03am UTC](https://forums.developer.nvidia.com/t/cudamemcpy-error-cudaerrorlaunchtimeout/22386/1 "2011-05-11T09:03:39Z")

</div>

Hi,

I am doing some matrix computations using CUDA. I follow the usual sequence of

- Copy data to device

- Do computations on device

- Copy data from device to host

The third step gives me error, so I cannot copy data from device back to host.

This happens only for matrix of larger size, i.e. 5000x5000. For 500x500 and 1000x1000 sizes, there is no problem.

The error code returned is 6, which is cudaErrorLaunchTimeout. The description in my driver\_types.h file is as follows:

> [@](#):
>
> /\*\*
> 
> - This indicates that the device kernel took too long to execute. This can
> 
> - only occur if timeouts are enabled - see the device property
> 
> - \ref ::cudaDeviceProp::kernelExecTimeoutEnabled “kernelExecTimeoutEnabled”
> 
> - for more information. The device cannot be used until ::cudaThreadExit()
> 
> - is called. All existing device memory allocations are invalid and must be
> 
> - reconstructed if the program is to continue using CUDA.
> 
> \*/
> 
> cudaErrorLaunchTimeout = 6,

I placed a cudaGetLastError() statement right after the kernel launch and it returned cudaSuccess.

Immediately after this, there is the Cudamemcpy() statement which returns the above error.

Any idea what is happening? There is some response on this thread - [The Official NVIDIA Forums | NVIDIA](http://forums.nvidia.com/index.php?showtopic=70109). But I don’t have any monitor connected to device.

Any help will be appreciated.

---

<div class="post-metadata">

**Author:** ![hyqneuron](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/hyqneuron/32/9902_2.png) [@hyqneuron](https://forums.developer.nvidia.com/u/hyqneuron)\
**Post date:** [May 13, 2011, 3:57pm UTC](https://forums.developer.nvidia.com/t/cudamemcpy-error-cudaerrorlaunchtimeout/22386/2 "2011-05-13T15:57:51Z")

</div>

You need to disable display driver timeout

---

<div class="post-metadata">

**Author:** ![Warlord88](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/warlord88/32/439482_2.png) [@Warlord88](https://forums.developer.nvidia.com/u/Warlord88)\
**Post date:** [May 14, 2011, 3:24am UTC](https://forums.developer.nvidia.com/t/cudamemcpy-error-cudaerrorlaunchtimeout/22386/3 "2011-05-14T03:24:54Z")

</div>

I think I got it. The device was actually running an X11 session, and the runtime was exceeding 5 seconds. That might have been the problem since when I executed on a device without X11, it ran fine.
