Why cudaGLSetGLDevice failed, even though it's called in the first line of main function
问题 I want to use interoperability between OpenGL and CUDA. I know, as some tutorials said, the first step is to choose device. However, when I called the cudaGLSetGLDevice(0) in the first line of the main function, the program exited with the information "cudaSafeCall() Runtime API error 36: cannot set while device is active in this process." Actually, even though I use cudaDeviceProp and cudaChooseDevice before calling cudaGLSetDevice, the error still exists. Believe me, my computer just has