I’m not sure whether or not to post this in the CUDA forums, or in here.
CUDA_SAFE_CALL(cudaGLRegisterBufferObject(pixelBufferIndex));
Gives me the following assertion from the scenegraph:
I have a little hunch that Open GL isn’t initialized in my code, but the function referenced to in the manual, that is supposed to initialize gl with cuda “cuGLInit()”.
The problem is that neither cuGLInit() nor cudaGLInit() exists.
Looking at the simple GL example bundled with CUDA there is a initGLfunction that looks like this:
CUTBoolean initGL()
{
// initialize necessary OpenGL extensions
glewInit();
if (! glewIsSupported( "GL_VERSION_2_0 "
"GL_ARB_pixel_buffer_object"
)) {
fprintf( stderr, "ERROR: Support for necessary OpenGL extensions missing.");
fflush( stderr);
return CUTFalse;
}
// default initialization
glClearColor( 0.0, 0.0, 0.0, 1.0);
glDisable( GL_DEPTH_TEST);
// viewport
glViewport( 0, 0, window_width, window_height);
// projection
glMatrixMode( GL_PROJECTION);
glLoadIdentity();
gluPerspective(60.0, (GLfloat)window_width / (GLfloat) window_height, 0.1, 10.0);
CUT_CHECK_ERROR_GL();
return CUTTrue;
}
Do I really have to set up a seperate gl context that cuda can use?