MATLAB failing to find hardware OpenGL

32 views (last 30 days)
Stephen Eick
Stephen Eick on 10 Sep 2015
Commented: Lasse on 31 Jan 2023
Here's a few things I know:
  • I have a Intel® Core™ i5-5200U CPU @ 2.20GHz
  • I'm running on Linux Mint
  • My version of MATLAB is R2015b
  • The output from "glxinfo | grep rende" indicates I have hardware support for OpenGL(posted below):
direct rendering: Yes
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer,
OpenGL renderer string: Mesa DRI Intel(R) Broadwell
GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_packed_depth_stencil,
GL_NV_blend_square, GL_NV_conditional_render, GL_NV_depth_clamp,
Looks good, right? Well, when I start up MATLAB and run "opengl info", this is what I get:
MATLAB has experienced a low-level graphics error, and may not have drawn correctly.
Read about what you can do to prevent this issue at Resolving Low-Level Graphics Issues then restart MATLAB.
To share details of this issue with MathWorks technical support,
please include this file with your service request.
Version: ''
Vendor: ''
Renderer: 'None'
RendererDriverVersion: ''
RendererDriverReleaseDate: ''
MaxTextureSize: 0
Visual: ''
Software: 1
HardwareSupportLevel: 'none'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 0
SupportsAlignVertexCenters: 0
Extensions: {}
MaxFrameBufferSize: 0
Uhhhh...that looks like sort of a problem. Running "opengl hardwarebasic", then "opengl info" gives the exact same result back.
So, I tried opening MATLAB with the -softwareopengl flag. Now, "opengl info" give this:
Version: '2.1 Mesa 7.2'
Vendor: 'Brian Paul'
Renderer: 'Mesa X11'
MaxTextureSize: 2048
Visual: 'Visual 0x5f, (RGBA 32 b…'
Software: 'true'
HardwareSupportLevel: 'none'
SupportsGraphicsSmoothing: 0
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 0
Extensions: {114x1 cell}
MaxFrameBufferSize: 4096
Well, that's certainly better! At least it's something...
My question is: why is MATLAB failing to see and use the hardware? Is there anything I can do to get MATLAB to play nice?
One other thing (which may or may not be related) I've encountered recently has to deal with displaying images. I read an image using imread no problem. If I view the image using imshow, it looks perfect. However, if I view the image using image or imagesc, the curves on the image (it's a black and white image of Saturn) become very jagged, and the image loses a notable amount of detail. Is this a result of software OpenGL?

Answers (1)

riyas a
riyas a on 14 Apr 2017
Its OPENGL and libstdc++ issue
First, install a few packages
$ sudo apt-get install lib64stdc++6:i386
$ sudo apt-get install mesa-utils
Then update some links:
cd <your_matlab_location>/sys/os/glnxa64/
$ sudo mv libstdc++.so.6 libstdc++.so.6.bak
$ sudo ln -s /usr/lib64/libstdc++.so.6 libstdc++.so.6
then run matlab check whether mesa is updated in matlab terminal
>> opengl info
Version: '3.0 Mesa 17.0.3'
Vendor: 'Intel Open Source Technology Center' ..............
HardwareSupportLevel: 'full'
..........
Now opengl should be working....
  6 Comments
Vincenzo Brancaccio
Vincenzo Brancaccio on 29 Jan 2023
Amazing! It finally solved it, thanks!
Lasse
Lasse on 31 Jan 2023
thank you sooo much!! I dont know what I did with those lines or why they were necessary but my 3d graphic runs with more than 1fps now

Sign in to comment.

Categories

Find more on Graphics Performance in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!