glDebugMessageCallback on nVidia using Ubuntu

Hi,

I have successfully used glDebugMessageCallback on Windows 7 with the same GTX 465.

When I try to do this on Ubuntu 12.04, glDebugMessageCallback/ARB are null using GLEW.
Does nVidia support the ARB_debug_output for linux yet?
I was using GL 4.3 beta driver version 304.15, but also tried the later 304.43 version.

Thank you.

Only with a debug context.

Hi thokra,

What do you mean by “debug context”? The executable has to be in debug mode?

No, a GL context that has been created with GLX_CONTEXT_DEBUG_BIT_ARB as part of the context flags. How do you create your context?

Ah. I did some searching and I think the equivalent of that using freeglut is GLUT_DEBUG via glutInitContextFlags(GLUT_FORWARD_COMPATIBLE | GLUT_DEBUG). Is that the right way? I followed this: http://www.seas.upenn.edu/~pcozzi/OpenGLInsights/OpenGLInsights-ARB_debug_output.pdf


    glutInit(&argc, argv);


    glutInitContextVersion(4, 2);
    glutInitContextFlags(GLUT_FORWARD_COMPATIBLE | GLUT_DEBUG);
    glutInitContextProfile(GLUT_CORE_PROFILE);


    glutSetOption(GLUT_ACTION_ON_WINDOW_CLOSE,
        GLUT_ACTION_GLUTMAINLOOP_RETURNS);


    glutInitWindowSize(mPixelWidth, mPixelHeight);


    glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGBA | GLUT_DEPTH);


    mHandle = glutCreateWindow(k_Window_Name);
    if(mHandle < 1) {
        error(AT, "s", k_Error_System_Window);
        getchar();
        exit(0);
    }


    glutSetWindowData(this);
    glutDisplayFunc(proxyDisplay);
    glutIdleFunc(proxyIdle);
    glutKeyboardFunc(proxyKeyboard);
    glutMotionFunc(proxyMotion);
    glutMouseFunc(proxyMouse);
    glutMouseWheelFunc(proxyMouseWheel);
    glutReshapeFunc(proxyResize);


    GLenum glew_init_result = glewInit();
    if(GLEW_OK != glew_init_result) {
        error(AT, "s", glewGetErrorString(glew_init_result));
        getchar();
        exit(0);
    }


    char window_title_info[BUFSIZ];
    sprintf(window_title_info, k_Window_Title_Format, k_Window_Name,
        glGetString(GL_VERSION));
    glutSetWindowTitle(window_title_info);


    mCamera = new Camera(90.0f, 0.1f, 10000.0f);


    glEnable(GL_DEBUG_OUTPUT_SYNCHRONOUS);
    if(glDebugMessageCallback)
    glDebugMessageCallback(debugLog, nullptr);

If I change it to 4.3, the following happens:
X Error of failed request: BadMatch (invalid parameter attributes)
Major opcode of failed request: 135 (GLX)
Minor opcode of failed request: 34 ()
Serial number of failed request: 30
Current serial number in output stream: 31

Thank you again.

Should work. It’s not surprising that GLX misbehaves, since the current NVIDIA binary blob in the Ubuntu repos does only 4.2. Did you try that on the GL beta driver or on 304.43?

I see. I will migrate back to beta driver to test. I thought 304.43 would include beta 301.15 though.

Current NVidia Linux GL 4.3 driver version is 304.15.00.02 which is a beta (see the link).

And no, from the version numbers and the driver changelogs, it appears that they pretty consistently put the drivers for the new GL version on a branch and release in beta for a while, until it’s stable and then merge it back into the mainline in an official driver release.

When I try to do this on Ubuntu 12.04, glDebugMessageCallback/ARB are null using GLEW.
Does nVidia support the ARB_debug_output for linux yet?

glDebugMessageCallbackARB is from ARB_debug_output. That’s a different extension and different extension function from glDebugMessageCallback, which is from KHR_debug. They are two different extensions, two different functions, and you shouldn’t try to pretend that one comes from the other.

ARB_debug_output is generally only implemented in debug contexts. However, KHR_debug is a core OpenGL extension and a part of GL 4.3; it’s always there (assuming the implementation has KHR_debug or GL 4.3 support). However, if the context isn’t a debug context, the functions won’t necessarily do anything.

Thank you for all of your inputs. Unfortunately, I just tested with the beta drivers and it’s still core dumping on me. Using the code I posted, those functions are linked to libGLEW.so.1.9 properly, but at run-time it’s nullptr.

I am sure my code is correct because this works on Windows 7 x64 same system. I am definitely using 4.3 beta drivers because the errors I posted below my code talking about using 4.3 context no longer appears.

In case anyone is interested, I resolved and posted it here: NVIDIA releases OpenGL 4.3 beta drivers - OpenGL - Khronos Forums

This topic was automatically closed 183 days after the last reply. New replies are no longer allowed.