# \[SOLVED\] Sample cuda program crash

**URL:** <https://forums.developer.nvidia.com/t/solved-sample-cuda-program-crash/46831>\
**Category:** CUDA Programming and Performance\
**Created:** [December 16, 2016, 10:47am UTC](https://forums.developer.nvidia.com/t/solved-sample-cuda-program-crash/46831 "2016-12-16T10:47:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![aLbErT\_h](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aLbErT\_h](https://forums.developer.nvidia.com/u/aLbErT_h)\
**Post date:** [December 16, 2016, 10:47am UTC](https://forums.developer.nvidia.com/t/solved-sample-cuda-program-crash/46831/1 "2016-12-16T10:47:21Z")

</div>

Hi,

I’m doing some test with the CUDA sample that we can find in this article [Separate Compilation and Linking of CUDA C++ Device Code | NVIDIA Technical Blog](https://devblogs.nvidia.com/parallelforall/separate-compilation-linking-cuda-device-code/)

If I execute the code as it is on the article it works fine. But if I change the number of iterations in the main function it crash. The change is the following:

```auto
int main(int argc, char ** argv)
{
        ...
        for(int i=0; i<500000; i++) // I have change the number iterations from 100 to 500000
        {
                float dt = (float)rand()/(float) RAND_MAX; // Random distance each step
                advanceParticles<<< 1 + n/256, 256>>>(dt, devPArray, n);
                cudaDeviceSynchronize();
        }
        ...

```

The only change that I have done is the number of iterations from 100 to 500000. The impact of this change is that the device crash and I need to reset the workstation.

Then I have a question:

- Is there a kernel launch limit?

If there are not a limit, why the program crash?

Thank you.

---

<div class="post-metadata">

**Author:** ![Robert\_Crovella](https://sea2.discourse-cdn.com/nvidia/user_avatar/forums.developer.nvidia.com/robert_crovella/32/14043_2.png) [@Robert\_Crovella](https://forums.developer.nvidia.com/u/Robert_Crovella)\
**Post date:** [December 16, 2016, 7:55pm UTC](https://forums.developer.nvidia.com/t/solved-sample-cuda-program-crash/46831/2 "2016-12-16T19:55:14Z")

</div>

In the cross-posting:

[url][c++ - Sample cuda program crash - Stack Overflow](http://stackoverflow.com/questions/41186537/sample-cuda-program-crash%5B/url%5D)

OP has now reported this in the comments:

"Hi, I tried with texmode and the execution crash. I get the following message: [820.536748] NVRM: Xid (PCI:0000:01:00): 79, GPU has fallen off the bus. "

So it would appear to be a system or hardware problem.

---

<div class="post-metadata">

**Author:** ![aLbErT\_h](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@aLbErT\_h](https://forums.developer.nvidia.com/u/aLbErT_h)\
**Post date:** [December 20, 2016, 9:26am UTC](https://forums.developer.nvidia.com/t/solved-sample-cuda-program-crash/46831/3 "2016-12-20T09:26:38Z")

</div>

Hi,

Finally I found the problem. It’s a temperature problem.
