The application may have hit an error when dereferencing Unified Memory from the host. Please rerun the application under cuda-gdb or Nsight Eclipse Edition to catch host side errors.

Hello,

I got a strange thing happening. I made a code which is just doing a simple movement of some particles on the cpu and then the positions are copied to the gpu and used to create a density map which then plotted with opengl.

I ran the code on my laptop with 750m gpu and 7.5 kit. no problem.

Next I tried it on to desktop computers, one with 750 and the other with 980 8.0 kit. In both it seem are some problems. If I run it direct the program crashes. If I run it with cuda-memcheck I get the error mentioned, if I include -g -G flags the program now runs but much slower than my laptop. In addition some functions seems to trigger the problem even if they are never called.

I am not sure what happens here. It is a problem with opengl or with CUDA. The error seems to suggest a problem with the pointers, but it only happens on the desktop computers. Where should I start the debugging?
How do I do debugging if I have the opengl calls, so far i was not able to.

Thank you in advance

(short story the program works on my laptop, but not on two other computers)

Start right there. If by crash you mean a seg fault or something like that, then start by figuring out the reason for the seg fault. A seg fault can always be localized to a single line of code that actually triggers the fault. Deduce the reason for the fault based on that line, then work backward in the code to figure out why that condition (e.g. dereference of invalid pointer) is arising.

If the “crash” is something else, e.g. an application-reported error, I would start there as well.

Hello,

Thank you for replying. I supposed there is some bug. I checked of course my code, but the gl part I am clueless. I copied code form some tutorials I must have forgotten something. I do not know why it works on my laptop but not on the desktop, but it is better to be sure that everything is ok before I can start to do real work.