I've been using the Brainstorm with Matlab runtime R2020a update 6 then update 7 for about a year with OpenGL without any issues on Ubuntu 20.04. Recently I updated my system and now I'm hitting the following error with starting brainstorm:
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue by running this command: opengl problems,
then restart MATLAB.
To share details of this issue with MathWorks technical support, please
include this file with your service request: /home/hipuser/jogl.ex.109
The file jogl.ex.109 contains:
com.jogamp.opengl.GLException: MATLAB Compiler Runtime: createImpl ARB n/a but required, profile > GL2 requested (OpenGL >= 3.1). Requested: GLProfile[GL4bc/GL4bc.hw], current: 4.6 (Compat profile, compat[ES2, ES3, ES31], FBO, hardware) - 4.6.0 NVIDIA 470.74
at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:418)
at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:759)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:642)
at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
at jogamp.opengl.GLDrawableHelper.invokeGLImpl(GLDrawableHelper.java:1263)
at jogamp.opengl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:1131)
at jogamp.opengl.GLAutoDrawableBase.defaultDisplay(GLAutoDrawableBase.java:466)
at com.jogamp.opengl.GLAutoDrawableDelegate.display(GLAutoDrawableDelegate.java:190)
at com.mathworks.hg.uij.OpenGLUtils$MyGLListener.getGLInformation(OpenGLUtils.java:355)
at com.mathworks.hg.uij.OpenGLUtils$MyGLListener.getGLData(OpenGLUtils.java:512)
at com.mathworks.hg.uij.OpenGLUtils.getGLData(OpenGLUtils.java:79)
This is a Matlab-related issue, not a Brainstorm issue per se. Therefore this is not something we will be able to fix on our end. Fixing this issue involves most likely for you to find the correct combination of libraries on your system.
The most appropriate way to get help with this issue would be to post a bug report on the Mathworks website, with all the information on how to reproduce the error.
If you get a decent workaround from the Mathworks support, please share it here.
If you don't , we could work on adding extra input parameters to completely disable the use of JOGL from the command line. However, since we won't be able to reproduce your system-specific issues, this would require for you to test this on your end, with a full installation of Matlab (not the Matlab Runtime).
Does Brainstorm start from a full Matlab install on this system?
If Brainstorm does NOT start, please try the following:
Once you've figured out how to fix your startup option, let me know and I'll work on adding an extra command-line option nojogl, or something like that.
If jogl is disabled, we won't have OpenGL support, right?
The Matlab OpenGL renderer would still be available.
The only thing that would not work anymore is the rendering of connectivity graphs using JOGL. This would be a very minor issue, as we now have a Matlab version of these graphs available: https://neuroimage.usc.edu/brainstorm/Tutorials/ConnectivityGraph
Another question, I saw you have a version of brainstorm for the 2021 runtime, would that contain a newer version of JOGL?
No. The developments of JOGL are stalled and so are their integration in Matlab.
Our next step is to get rid of it completely in the Brainstorm distribution.
We will keep it for a few more months while we finish debugging the new functions.
You should not worry about losing this JOGL support.
However, you could try the 2021a compiled package, maybe in that Runtime version, your bug doesn't exist anymore (independently from the JOGL version)
With all the cash and power available at HBP, you could not find any computer where you could recompile Brainstorm without JOGL?...
Once you've figured out how to fix your startup option, let me know and I'll work on adding an extra command-line option nojogl , or something like that.
We are currently working on making the brainstorm code base lighter.
I decided to anticipate this complete removal of the JOGL libraries, which were going to be more and more complicated to maintain:
I recompiled Brainstorm without the JOGL .jar files.
Please try again with the latest compiled version.
Note that we are also in the process of removing all the compiled files from the github repository, therefore to get the compiled version of Brainstorm, you need to download it from the website. http://neuroimage.usc.edu/bst/getupdate.php?c=UbsM09&src=0&bin=1