Cuda program + Opengl Program

Hi all,
I have a random problem to run at the same time 2 different programs:

  • Program 1 Is a simple cuda programs
  • program 2 Is an opengl application (it can be glxgears also…)

In normal case, I haven’t problem, I can execute this two different program
and all works right.

But sometimes if I run the opengl application before the cuda,
the last one have problem in memory allocation an not work; when I close the opengl
application cuda start working without problems…and at this point I can restart the opengl
an all work right …

Someone can help me …