MATLAB Answers

4

MATLAB R2016b graphics bug (Linux)

Asked by Balz Maag on 2 Jun 2017
Latest activity Answered by maxime ferez on 23 Sep 2019 at 11:46
Hey everyone,
I'm facing some weird graphics behaviour when I try to display variables or output variables to the command window. The GUI gets completely messed up, see the screenshot.
I'm using R2016b on Ubuntu 16.04. Opengl seems to work:
Version: '3.0 Mesa 12.0.6'
Vendor: 'Intel Open Source Technology Center'
Renderer: 'Mesa DRI Intel(R) Kabylake GT2 '
MaxTextureSize: 8192
Visual: 'Visual 0xe7, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Doubl…'
Software: 'false'
HardwareSupportLevel: 'full'
SupportsGraphicsSmoothing: 1
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
Extensions: {231×1 cell}
MaxFrameBufferSize: 8192
Does anyone have clue what the problem could be?
Thanks!

  0 Comments

Sign in to comment.

3 Answers

Answer by Kushagr Gupta on 9 Jun 2017

Use Software OpenGL Instead
You can work around many graphics issues by using the software version of OpenGL® built-into MATLAB instead of using your graphics hardware. In some cases, MATLAB automatically switches to software OpenGL, for example, if it detects known issues such as outdated drivers or graphics virtualization. Software OpenGL does not support some graphics features, such as graphics smoothing.
To switch from hardware to software OpenGL, start MATLAB from the command prompt on your system using this command:
matlab -softwareopengl
To set your preferences so that MATLAB always starts with software OpenGL on this computer, execute this command at the MATLAB command line:
opengl('save','software')
Use OpenGL Compliant Graphics Hardware
For the best results with graphics, use graphics hardware that is compliant with OpenGL 2.1 or later. For more information about the graphics features that different versions of OpenGL support, see System Requirements for Graphics. Upgrade Your Graphics Hardware Drivers
Graphics hardware vendors frequently provide updated graphics drivers that improve hardware performance. To help ensure that your graphics hardware works with MATLAB, upgrade your graphics drivers to the latest versions available.
Check your computer manufacturer website for driver updates, for example, Dell® or HP®. If no updates are provided, then check your graphics hardware vendor website.
If you saved a setting to always start MATLAB with software OpenGL, then after updating your drivers, you can revert that setting by executing:
opengl('save','hardware')
Then, restart MATLAB.

  4 Comments

Show 1 older comment
Ulrich
on 9 Apr 2018
I run a Fedora system, and have the same issue. I can confirm that the software opengl version DOES NOT fix this issue!
Shannon
on 31 May 2018
I am also trying to use Matlab 2017a with Ubuntu 18.04 and the opengl version does not fix this.
I have the same issue, and terminal already reads "MATLAB is selecting SOFTWARE OPENGL rendering."
Matlab 2017a, debian stretch.

Sign in to comment.


Answer by Michael
on 26 Jun 2018

This issue was discussed in another post. I had the issue, but was able to solve it. Set the following environment variables (change the XXX to the correct version installed). If it works, add these lines to your .bashrc script.
export J2D_D3D=false export MATLAB_JAVA=/usr/lib/jvm/java-XXX-openjdk/jre

  4 Comments

Show 1 older comment
That solution did not solve the issue with ubuntu 18.04.
Michael, can you post a link to the previous discussion that you mention about? And also where did you learn about your fix method of adding that line to .bashrc script?
Here is the link .
In the fix, the "export" command is used, which I knew to be a command used in the .bashrc.

Sign in to comment.


Answer by maxime ferez on 23 Sep 2019 at 11:46

hello everyone, I'm working on ubuntu 18.04.3 LTS and matlab R2017a. I have the same problem. Did someone find the solution to resolve this problem? Because I tried the different answers and it doesn't work
Thanks

  0 Comments

Sign in to comment.