# \_rtContextLaunch2D returned (702): Launch timeout)

**URL:** <https://forums.developer.nvidia.com/t/rtcontextlaunch2d-returned-702-launch-timeout/69297>\
**Category:** OptiX\
**Created:** [January 11, 2019, 9:46am UTC](https://forums.developer.nvidia.com/t/rtcontextlaunch2d-returned-702-launch-timeout/69297 "2019-01-11T09:46:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![0x5f3759df](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@0x5f3759df](https://forums.developer.nvidia.com/u/0x5f3759df)\
**Post date:** [January 11, 2019, 9:46am UTC](https://forums.developer.nvidia.com/t/rtcontextlaunch2d-returned-702-launch-timeout/69297/1 "2019-01-11T09:46:37Z")

</div>

Running an application using OptiX, I get the following error message when calling context-\>launch:

```auto
OptiX Error: 'Unknown error (Details: Function "RTresult _rtContextLaunch2D(RTcontext, unsigned int, RTsize, RTsize)" caught exception: Encountered a CUDA error: cudaDriver().CuMemcpyDtoHAsync( dstHost, srcDevice, byteCount, hStream.get() ) returned (702): Launch timeout
================================================================================
Backtrace:
        (0) () +0x711f17
        (1) () +0x7102cb
        (2) () +0x30fe51
        (3) () +0x5bc0c3
        (4) () +0x5bce94
        (5) () +0x1c81bf
        (6) () +0x1c8946
        (7) () +0x1c9557
        (8) () +0x17a69b
        (9) rtContextLaunch2D() +0x2b9
        (10) runSimulation(int, char**, bool) +0x1c5
        (11) __libc_start_main() +0xf0
        (12) _start() +0x29

================================================================================
)'

```

What is the problem here and how can I fix it?

System information:

```auto
Linux 4.4.0-141-generic #167-Ubuntu SMP
NVIDIA-SMI 390.87
Device 0: "GeForce GTX TITAN X"
  CUDA Driver Version / Runtime Version 9.1 / 9.1
  CUDA Capability Major/Minor version number: 5.2
NVIDIA-OptiX-SDK-5.1.1-linux64

```

---

<div class="post-metadata">

**Author:** ![droettger](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/droettger/32/14043_2.png) [@droettger](https://forums.developer.nvidia.com/u/droettger)\
**Post date:** [January 11, 2019, 11:37am UTC](https://forums.developer.nvidia.com/t/rtcontextlaunch2d-returned-702-launch-timeout/69297/2 "2019-01-11T11:37:05Z")

</div>

A launch timeout means you tried to do too much work at once or maybe had an error in your code which resulted in an endless loop.

How many rays are you shooting in a single launch?  
Does it work when reducing the workload?  
How long does it take without the timeout then?

I don’t known what timeout limits exist under Linux. Under Windows there is 2 second kernel driver timeout in Windows Display Driver Mode (WDDM) and if that’s exceeded there will be a Timeout Detection and Recovery (TDR) triggered by the OS which will stop the driver and restart it.  
(In the past like under Windows XP there was a 15 second timeout before a bluescreen.)

The standard way to overcome that would either be to do less work more often, like progressive algorithms, tiled rendering, separating additive calculations (e.g. per light), etc., or have a dedicated GPU for compute tasks which is not falling under any of the OS timeout limits, e.g. Tesla or Quadro Workstation boards in Tesla Compute Cluster (TCC) driver mode under Windows.  
Search for “TDR” on this forum, that problem has been discussed before.

---

<div class="post-metadata">

**Author:** ![TomNVIDIA](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/tomnvidia/32/14181_2.png) [@TomNVIDIA](https://forums.developer.nvidia.com/u/TomNVIDIA)\
**Post date:** [June 14, 2022, 9:05pm UTC](https://forums.developer.nvidia.com/t/rtcontextlaunch2d-returned-702-launch-timeout/69297/3 "2022-06-14T21:05:57Z")

</div>


