Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 3 of 3

Thread: Getting Java and OpenGL Playing Nicely Together

  1. #1
    Newbie Newbie
    Join Date
    Dec 2017
    Posts
    1

    Getting Java and OpenGL Playing Nicely Together

    Please can you help me with an OpenGL version configuration issue, when running a Java API that uses JavaFX / OpenGL. I'm a complete OpenGL newbie and have very little understanding of the underlying architecture.

    I would otherwise post this in "programming", but seeing as its an API I have no control over that's rendering the graphics, its a configuration issue, not a coding issue, so I'm posting it here.

    I'm trying to run the ArcGIS SDK For Java on Ubuntu. ArcGIS is an API that uses OpenGL to render 3D views of the earth (not dissimilar to Google Earth). I seem to be having OpenGL / GLSL issues getting the 2 to play nicely together.

    When I try and execute my program, I get the error:

    Code :
    Java version : 1.8.0_151 (Oracle Corporation) amd64
    Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: Error code: 18
    Error message: Internal error exception
    Additional error message: star_draw,GL_VERTEX_SHADER:0:3(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES
    at com.esri.arcgisruntime.internal.mapping.view.RenderingContext.nativeDrawMap(Native Method)

    Very simple main program:

    Code :
        @Override
        public void start(Stage stage) throws Exception {
     
            stage.setTitle("SkylaCTL");
            stage.setWidth(800);
            stage.setHeight(400);
     
            StackPane stackPane = new StackPane();
            Scene scene = new Scene(stackPane);
     
            ArcGISScene arcGISScene = new ArcGISScene();
            arcGISScene.setBasemap(Basemap.createImagery());
     
            sceneView = new SceneView();
            sceneView.setArcGISScene(arcGISScene);
            stackPane.getChildren().addAll(sceneView);
     
            stage.setScene(scene);
            stage.show();
        }

    I have no idea where to start with this. I'm hoping that the versions of supported OpenGL are not fixed, depending on the support my graphics card offers. Running glxinfo results in:

    Code :
    mark@marks-computer:~$ glxinfo | grep version
    server glx version string: 1.4
    client glx version string: 1.4
    GLX version: 1.4
        Max core profile version: 4.5
        Max compat profile version: 3.0
        Max GLES1 profile version: 1.1
        Max GLES[23] profile version: 3.2
    OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.4.0-devel
    OpenGL core profile shading language version string: 4.50
    OpenGL version string: 3.0 Mesa 17.4.0-devel
    OpenGL shading language version string: 1.30
    OpenGL ES profile version string: OpenGL ES 3.2 Mesa 17.4.0-devel
    OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

    Running lspci | grep VGA, I get:

    Code :
    00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)

    Hoping to find a way around this.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,420
    The error message you're getting:

    Quote Originally Posted by markvanwyk View Post
    Java version : 1.8.0_151 (Oracle Corporation) amd64
    Exception in thread "JavaFX Application Thread" java.lang.RuntimeException: Error code: 18
    Error message: Internal error exception
    Additional error message: star_draw,GL_VERTEX_SHADER:0:3(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, 3.00 ES, 3.10 ES, and 3.20 ES
    is consistent with this subset of the system info you've provided:

    $ glxinfo | grep version...
    OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.4.0-devel
    OpenGL core profile shading language version string: 4.50
    OpenGL version string: 3.0 Mesa 17.4.0-devel
    OpenGL shading language version string: 1.30 <=== GLSL version (compatibility profile)
    So the program you want to run needs GLSL version 1.50, but your OpenGL driver (Mesa3D) only supports GLSL version 1.30 (in the compatibility profile), which is the GLSL version provided by OpenGL version 3.0.

    Running lspci | grep VGA, I get:
    This is not a reliable way to find all the possible GPUs (display adapters) in your system. Also look through this list for anything which has 3D, Display, NVIDIA, AMD, or ATI in it for instance. I'd check to verify that you don't have another GPU in your system.

    "lshw" is another command you can use to list hardware installed in your system, including GPUs.

    00:02.0 VGA compatible controller: Intel Corporation HD Graphics 520 (rev 07)
    So you at least have this GPU buried in your Intel CPU. My guess is if you listed the renderer string in the glxinfo output, it'd say something like:

    Code :
    OpenGL renderer string: Mesa DRI Intel(R) HD Graphics 520 (Skylake GT2)

    which would indicate that your Mesa3D drivers are trying to use the Intel GPU for rendering. OpenGL 3.0 / GLSL 1.30 (compatibility profile) is just the best they can do.

    Let's see what other GPUs you unearth from running "lspci" and "lshw". You may already have an NVIDIA or AMD GPU installed in your system. If not, buy an inexpensive one, pop it in your system, and install the NVIDIA or AMD graphics drivers.

    But before doing that, you could check to see if there's an update for Mesa3D in your package manager. If so, updating to the latest version available might possibly get you better OpenGL support with Mesa3D and your existing on-chip Intel GPU.
    Last edited by Dark Photon; 12-15-2017 at 04:48 AM.

  3. #3
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    4,420
    Quote Originally Posted by markvanwyk
    $ glxinfo | grep version...
    OpenGL core profile version string: 4.5 (Core Profile) Mesa 17.4.0-devel
    OpenGL core profile shading language version string: 4.50
    OpenGL version string: 3.0 Mesa 17.4.0-devel
    OpenGL shading language version string: 1.30 <=== GLSL version (compatibility profile)
    I just happened to trip over a mention on the net that indicates that Mesa3D GL drivers never report an OpenGL Compatibility version > 3.0 (similarly for the GLSL compatibility version 1.30). I don't know the back-story on this.

    Your software wants GLSL 1.50 which is OpenGL 3.20. So no guarantees (this may very well crash or cause problems), but you might try telling Mesa3D to override the version it's reporting with:

    Code :
    export MESA_GL_VERSION_OVERRIDE=3.2COMPAT

    (or similar setenv syntax if you're using csh/tcsh). Note also that there's a MESA_GLSL_VERSION_OVERRIDE envvar if you need it (see the bottom link below).

    I figure this is worth a shot before you go buying a new GPU.

    A few links to more info on these and other Mesa3D env vars:



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •