I have OpenGL 2.1.0, but jogl thinks I only have version 1.4

According to glxinfo I have:

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce Go 7400/PCI/SSE2
OpenGL version string: 2.1.0 NVIDIA 97.46

But when I ask jogl it says:

GL_VENDOR: NVIDIA Corporation
GL_RENDERER: GeForce Go 7400/PCI/SSE2
GL_VERSION: 1.4 (2.1.0 NVIDIA 97.46)

And isExtensionAvailable says that I have version 1.4 and not 1.5

I’m running the latest nightly build under Fedora Core 6

Actually if you perform a glGetString() you’ll see that the version string is “1.4 (2.1.0 NVIDIA 97.46)”. I don’t fully understand the semantics of this kind of version string but it seems to be more and more common. There were some constraints in JOGL’s code which parses this version string which I’ve relaxed to make this case work. The changes have been checked in and will show up in a future nightly build, but our nightly build system is down right now so you might want to build from the source if you need this fix urgently.

Thanks. I got the new version and now it thinks I’ve got version 2.1. But my program still doesn’t work.

This code

if (gl.isFunctionAvailable("glUseProgram")) gl.glUseProgram(0);

produces (with debug=True in FunctionAvailabilityCache)

!!! CHECKING FOR AVAILABILITY OF: glUseProgram
!!! AVAILABILITY OF glUseProgram: true
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Method "glUseProgram" not available
        at com.sun.opengl.impl.GLImpl.glUseProgram(GLImpl.java:23058)
        at isExtensionAvailable.init(isExtensionAvailable.java:60)
        at com.sun.opengl.impl.GLDrawableHelper.init(GLDrawableHelper.java:72)
        at javax.media.opengl.GLCanvas$InitAction.run(GLCanvas.java:271)
        at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:189)
        at javax.media.opengl.GLCanvas.maybeDoSingleThreadedWorkaround(GLCanvas.java:265)
        at javax.media.opengl.GLCanvas.display(GLCanvas.java:130)
        at javax.media.opengl.GLCanvas.paint(GLCanvas.java:142)
        at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
        at sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:56)
        at sun.awt.RepaintArea.paint(RepaintArea.java:224)
        at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:645)
        at java.awt.Component.dispatchEventImpl(Component.java:4031)
        at java.awt.Component.dispatchEvent(Component.java:3803)
        at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
        at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
        at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
        at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
        at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

It looks like something strange is going on where glxinfo and JOGL are getting different return results from glGetVersion. Apparently when the JOGL app is running you really only have access to OpenGL 1.4 and JOGL’s attempt to parse the vendor-specific information out of the GL_VERSION string is incorrect.

Can you compile this version of glxinfo.c and post the output of running it with the -v option? I want to make sure that no postprocessing is occurring on the GL_VERSION string.

If it really returns “2.1.0 NVIDIA 97.46”, and not “1.4 (2.1.0 NVIDIA 97.46)”, then we need to look further into the differences between the C and JOGL OpenGL context setup code.

./glxinfo -v

name of display: :0.0
display: :0  screen: 0
direct rendering: Yes
server glx vendor string: NVIDIA Corporation
server glx version string: 1.4
server glx extensions:
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig, 
    GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control, 
    GLX_EXT_texture_from_pixmap, GLX_ARB_multisample, GLX_NV_float_buffer, 
    GLX_ARB_fbconfig_float
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_visual_info, 
    GLX_EXT_visual_rating, GLX_EXT_import_context, GLX_SGI_video_sync, 
    GLX_NV_swap_group, GLX_NV_video_out, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGI_swap_control, GLX_NV_float_buffer, GLX_ARB_fbconfig_float, 
    GLX_EXT_fbconfig_packed_float, GLX_EXT_texture_from_pixmap, 
    GLX_EXT_framebuffer_sRGB
GLX extensions:
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_SGIX_fbconfig, 
    GLX_SGIX_pbuffer, GLX_SGI_video_sync, GLX_SGI_swap_control, 
    GLX_EXT_texture_from_pixmap, GLX_ARB_multisample, GLX_NV_float_buffer, 
    GLX_ARB_fbconfig_float, GLX_ARB_get_proc_address
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce Go 7400/PCI/SSE2
OpenGL version string: 2.1.0 NVIDIA 97.46
OpenGL extensions:
    GL_ARB_color_buffer_float, GL_ARB_depth_texture, GL_ARB_draw_buffers, 
    GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, 
    GL_ARB_fragment_shader, GL_ARB_half_float_pixel, GL_ARB_imaging, 
    GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, 
    GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, 
    GL_ARB_shadow, GL_ARB_shader_objects, GL_ARB_shading_language_100, 
    GL_ARB_texture_border_clamp, GL_ARB_texture_compression, 
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add, 
    GL_ARB_texture_env_combine, GL_ARB_texture_env_dot3, GL_ARB_texture_float, 
    GL_ARB_texture_mirrored_repeat, GL_ARB_texture_non_power_of_two, 
    GL_ARB_texture_rectangle, GL_ARB_transpose_matrix, 
    GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, GL_ARB_vertex_shader, 
    GL_ARB_window_pos, GL_ATI_draw_buffers, GL_ATI_texture_float, 
    GL_ATI_texture_mirror_once, GL_S3_s3tc, GL_EXT_texture_env_add, 
    GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 
    GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_compiled_vertex_array, 
    GL_EXT_Cg_shader, GL_EXT_depth_bounds_test, GL_EXT_draw_range_elements, 
    GL_EXT_fog_coord, GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
    GL_EXT_framebuffer_object, GL_EXT_gpu_program_parameters, 
    GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil, 
    GL_EXT_packed_pixels, GL_EXT_pixel_buffer_object, GL_EXT_point_parameters, 
    GL_EXT_rescale_normal, GL_EXT_secondary_color, 
    GL_EXT_separate_specular_color, GL_EXT_shadow_funcs, 
    GL_EXT_stencil_clear_tag, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, 
    GL_EXT_texture3D, GL_EXT_texture_compression_s3tc, 
    GL_EXT_texture_cube_map, GL_EXT_texture_edge_clamp, 
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod, 
    GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, 
    GL_EXT_texture_object, GL_EXT_texture_sRGB, GL_EXT_timer_query, 
    GL_EXT_vertex_array, GL_IBM_rasterpos_clip, 
    GL_IBM_texture_mirrored_repeat, GL_KTX_buffer_region, GL_NV_blend_square, 
    GL_NV_copy_depth_to_color, GL_NV_depth_clamp, GL_NV_fence, 
    GL_NV_float_buffer, GL_NV_fog_distance, GL_NV_fragment_program, 
    GL_NV_fragment_program_option, GL_NV_fragment_program2, 
    GL_NV_framebuffer_multisample_coverage, GL_NV_half_float, 
    GL_NV_light_max_exponent, GL_NV_multisample_filter_hint, 
    GL_NV_occlusion_query, GL_NV_packed_depth_stencil, GL_NV_pixel_data_range, 
    GL_NV_point_sprite, GL_NV_primitive_restart, GL_NV_register_combiners, 
    GL_NV_register_combiners2, GL_NV_texgen_reflection, 
    GL_NV_texture_compression_vtc, GL_NV_texture_env_combine4, 
    GL_NV_texture_expand_normal, GL_NV_texture_rectangle, 
    GL_NV_texture_shader, GL_NV_texture_shader2, GL_NV_texture_shader3, 
    GL_NV_vertex_array_range, GL_NV_vertex_array_range2, GL_NV_vertex_program, 
    GL_NV_vertex_program1_1, GL_NV_vertex_program2, 
    GL_NV_vertex_program2_option, GL_NV_vertex_program3, 
    GL_NVX_conditional_render, GL_SGIS_generate_mipmap, GL_SGIS_texture_lod, 
    GL_SGIX_depth_texture, GL_SGIX_shadow, GL_SUN_slice_accum

Visual ID: 21  depth=24  class=TrueColor
    bufferSize=32 level=0 renderType=rgba doubleBuffer=1 stereo=0
    rgba: redSize=8 greenSize=8 blueSize=8 alphaSize=0
    auxBuffers=4 depthSize=24 stencilSize=8
    accum: redSize=16 greenSize=16 blueSize=16 alphaSize=16
    multiSample=0  multiSampleBuffers=0
    visualCaveat=None
    Opaque.
.
.
.

This is bizarre behavior. What does the following JOGL program print?


import java.awt.Frame;
import javax.media.opengl.*;

public class TestGLVersion {
  static class Listener implements GLEventListener {
    public void init(GLAutoDrawable drawable) {
      GL gl = drawable.getGL();
      System.out.println("TestGLVersion OpenGL vendor string: " + gl.glGetString(GL.GL_VENDOR));
      System.out.println("TestGLVersion OpenGL renderer string: " + gl.glGetString(GL.GL_RENDERER));
      System.out.println("TestGLVersion OpenGL version string: " + gl.glGetString(GL.GL_VERSION));
      new Thread(new Runnable() {
          public void run() {
            System.exit(0);
          }
        }).start();
    }
    public void display(GLAutoDrawable drawable) {}
    public void reshape(GLAutoDrawable drawable, int x, int y, int w, int h) {}
    public void displayChanged(GLAutoDrawable drawable, boolean unused1, boolean unused2) {}
  }

  public static void main(String[] args) {
    Frame frame = new Frame();
    GLCapabilities caps = new GLCapabilities();
    caps.setRedBits(15);
    caps.setGreenBits(15);
    caps.setBlueBits(15);
    caps.setDepthBits(0);
    caps.setDoubleBuffered(false);
    GLCanvas canvas = new GLCanvas(caps);
    canvas.addGLEventListener(new Listener());
    frame.setUndecorated(true);
    frame.add(canvas);
    frame.setSize(1, 1);
    frame.setVisible(true);
  }
}

I’m trying to contact someone at NVidia to ask about this.

At this point my best guess is that a non-conformant visual is being selected. JOGL doesn’t place any requirements right now on the conformance of the visual chosen using glXChooseVisual. Can you run with -Djogl.debug.X11GLDrawableFactory and provide the output of running your program (especially the lines saying " glXChooseVisual recommended…") along with all of the output from “glxinfo -v”?

My colleague at NVidia asks also whether you can run nvidia-bug-report.sh? You can email me the output at kbr at dev dot java dot net.

Output from the program you posted:


$ java -Djogl.debug.X11GLDrawableFactory TestGLVersion
!!! GLX server vendor : NVIDIA Corporation
!!! GLX server version: 1.4
!!! GLX client vendor : SGI
!!! GLX client version: 1.4
!!! glXChooseVisual recommended null visual
TestGLVersion OpenGL vendor string: NVIDIA Corporation
TestGLVersion OpenGL renderer string: GeForce Go 7400/PCI/SSE2
TestGLVersion OpenGL version string: 1.4 (2.1.0 NVIDIA 97.46)

I’ve emailed the output from glxinfo -v and nvidia-bug-report.sh

Did you get my email replies?

I suspect you may have a mismatched gluegen-rt.jar and jogl.jar. Can you please delete all copies of all JOGL- and GlueGen-related jars and .so’s from your disk, re-download the current nightly build, re-set up your CLASSPATH and LD_LIBRARY_PATH, and retest?

Tim provided me a login account to investigate this problem and to make a long story short it turns out the symlink to /usr/lib contained within the JPackage “compatibility” Java RPMs was the culprit. This has come up before. The solution is to not install the JPackage RPMs, but instead to download the Java installers from Sun’s web site. The JOGL User’s Guide has been updated with caution against using the JPackage RPMs.

If you’ve already installed jpackage the fix is:

# yum erase java-1.5.0-sun-compat.noarch

and then just put /usr/java/jdk1.5.0_09/bin/ (or wherever Sun’s java binary lives) in your path before /usr/bin