cuGLInit() fails in Single/Horizontal span mode What could cause cuGLInit() to fail?

I am experiencing some problems with Cuda and OpenGL initialization.
When I am trying to run cuGLInit() using multiple screens (and one graphics card), it fails (and produces the error CUDA_ERROR_UNKNOWN) if I set the mode to “Horizontal span” or “Single”. It also fails if I only use one screen. In conclusion, it only works when I use two screens in dual mode.

My card is a 8800 GTS. My code is integrated into a larger framework so there might be an issue with OpenGL that I don’t know about.

Thus, my question is: what could cause cuGLInit() to fail? The only reason mentioned in the programming guide “if the needed OpenGL driver facilities are not available”. Any help would be appreciated!


An update: I checked for OpenGL errors, and it seems like cuGLInit() fails when OpenGL is in an error state (which it for some reason is for the particular scenegraph I was testing). Thus, when I check for OpenGL errors and thereby reset the error flag, cuGLInit works just fine.
Is one of the requirements for the initialization of Cuda and OpenGL interoperability to work that the OpenGL state is free from errors?