Two GPUs for computation and OpenGL rendering

Hi,
I have two GTX580 cards on one single node. My project needs one card for OpenGL rendering (VBO manipulation), so I use cudaGLSetGLDevice(0) to set one as rendering card. At the same time, I also need do some parallel computation on the other card. I use cudaSetDevice(1) to achieve this. However, I found once I use device 1 to do some computation and then the OpenGL rendering will be dead. I am not sure if there is something wrong with my strategy…I believe it is ok to switch between two cards if purely do some computation by alternatively using cudaSetDevice()…But maybe it is not the case if one is used to do rendering and the other to do computation. Any help is appreciate!