Error Accessing VBO 8Vertex Buffer Object) errors on runtime at cudaGLMapBufferObject

EDIT: problem solved, i was having an extra cudaThreadExit() call somewhere. that function ends cuda

so should only be called when done with everything

im having this weird error on my application. these are the steps i made for programming the vbo access

  1. first i create the VBO with the memory needed.

  2. i wrote a kernel that fills the VBO with the mesh data, its called only one time at the beginning (works ok)

  3. then when i press a button i call a similar kernel that only moves those vertexes around. (ERROR COMES HERE)

the error comes here when before calling the kernel i do the cudaGLMapBufferObject,

[code]void myCudaActualizarVertices(GLuint vbo, double delta, unsigned int numNodos){