I am unable to get hardware based OpenGL rendering to work in MATLAB R2015a or R2014b. Prior to R2014b, and the rewrite of the MATLAB graphics stack, everything worked fine. From MATLAB
>> opengl info
Version: '3.0 Mesa 10.6.5'
Vendor: 'Intel Open Source Technology Center'
Renderer: 'Mesa DRI Intel(R) Sandybridge Mobile '
MaxTextureSize: 8192
Visual: 'Visual 0xac, (RGBA 32 bits (8 8 8 8), Z depth 16 bits, Hardware acceleration, Double buffer, Antialias 4 samples)'
Software: 'true'
SupportsGraphicsSmoothing: 1
SupportsDepthPeelTransparency: 1
SupportsAlignVertexCenters: 1
Extensions: {199x1 cell}
MaxFrameBufferSize: 8192
I was expecting/wanting "Software" to be false.
$ ldd /opt/tmw/matlab/bin/glnxa64/glren.so | grep libGL
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f0a3b871000)
libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00007f0a3b5ef000)
suggests that MATLAB is finding the system libraries (which is what TMW says I want) and TMW confirms that the library versions libGL.so.1.2.0 and libGLU.so.1.3.1 are compatible.
$ LIBGL_DEBUG=verbose matlab
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/tls/i965_dri.so
libGL: OpenDriver: trying /usr/lib/xorg/modules/dri/i965_dri.so
libGL: Using DRI2 for screen 0
Does not provide any useful info. I have been in contact with TMW technical support and they have decided it is not a MATLAB issue despite
$ glxinfo | grep render
direct rendering: Yes
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Mobile
suggesting hardware based OpenGL is working outside MATLAB. I have done most of my testing on Arch Linux with an Intel graphics card, but have also tried ATI and Nvidia cards without any luck. I recently created a Debian 7 chroot, since that is an officially supported OS, but still had no luck with the Intel card.
Everything has been done with the stock Arch kernel. Could that be the cause of the problem? How do I debug/trace the issue?
Best Answer
For me the followed works (under ArchLinux with R2017a (prerelease) with a laptop having only intel graphics):
Note that in the last step I'm calling the MATLAB executable directly (not the helper script that performs some LD_* manipulation)