# Problem with big integers

**URL:** <https://forums.developer.nvidia.com/t/problem-with-big-integers/3747>\
**Category:** CUDA Programming and Performance\
**Created:** [May 16, 2008, 2:55pm UTC](https://forums.developer.nvidia.com/t/problem-with-big-integers/3747 "2008-05-16T14:55:18Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Picknick3r](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@Picknick3r](https://forums.developer.nvidia.com/u/Picknick3r)\
**Post date:** [May 16, 2008, 2:55pm UTC](https://forums.developer.nvidia.com/t/problem-with-big-integers/3747/1 "2008-05-16T14:55:18Z")

</div>

Hi all,

I encountered a strange problem:

My CUDA kernel starts with the following lines of code:

```auto
__global__ void cudaDecomp(unsigned char* g_prevFrame, unsigned char* g_currFrame, unsigned char* g_compPixels, unsigned char* g_index, unsigned int* g_memIndex, unsigned int width, unsigned int height, unsigned int bpp)

{

	unsigned char* g_pixelSet = g_compPixels+g_memIndex[bid]*4;

...

```

g\_memIndex holds integers for memory positions which can get quite big, the more blocks I use. For small amount of blocks everything works fine in device and emulation mode. But when the values in g\_memIndex come close to 32000 and above the programm crashes in device mode. No problems in Emulation mode. The only error I get from cudaGetLastError is “unspecified launch failure”. Somtimes the system freezes completly.

I’am really stuck here and would be very glad if someone could help.Are there possibly hardware restrictions which limit the integers to a certain size?

Thanks

Picknick3r

---

<div class="post-metadata">

**Author:** ![MisterAnderson42](https://developer.download.nvidia.com/images/forums/profile-default-devtalk-84.png) [@MisterAnderson42](https://forums.developer.nvidia.com/u/MisterAnderson42)\
**Post date:** [May 16, 2008, 4:06pm UTC](https://forums.developer.nvidia.com/t/problem-with-big-integers/3747/2 "2008-05-16T16:06:07Z")

</div>

There are no restrictions on integer size in the device.

“Unspecified launch error” sometimes means that you have read/written outside of an allocated array. Check all your accesses and memory allocations. If you are running on linux, running your emulation build through valgrind can be invaluable.
