4

I get the following error when i open matlab2016a on my ubuntu 14.04 with GTX1080:

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x17b50086, isOwner false, <6c356992, 26a627be>[count 0, qsz 0, owner <NULL>]]]
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)
    at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)
    at java.lang.Thread.run(Unknown Source)
Caused by: com.jogamp.opengl.GLException: glXGetConfig(0x1) failed: error code Unknown error code 6
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.glXGetConfig(X11GLXGraphicsConfiguration.java:570)
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfiguration.XVisualInfo2GLCapabilities(X11GLXGraphicsConfiguration.java:500)
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationXVisual(X11GLXGraphicsConfigurationFactory.java:434)
    at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(X11GLXGraphicsConfigurationFactory.java:240)
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createMutableSurfaceImpl(X11GLXDrawableFactory.java:524)
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createDummySurfaceImpl(X11GLXDrawableFactory.java:535)
    at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:283)
    ... 2 more

Has there been any fix for this? I've seen posts on nvidia forum(https://devtalk.nvidia.com/default/topic/926199/361-28-crashes-matlab-r2016a/) and here and I tried couple solutions but none of them worked. I installed ppa nvidia driver(not the driver from the nvidia website). Is this a nvidia driver the issue?

3
  • In cas you haven't, install matlab-support package: sudo apt-get install matlab-support
    – user308164
    Commented Jan 4, 2017 at 9:13
  • yep, i tried that. it didn't work.
    – MoneyBall
    Commented Jan 4, 2017 at 11:24
  • For anyone else who is having this problem, a workaround is to add '<path to MATLAB>/sys/opengl/lib/glnxa64' to the LD_LIBRARY_PATH env variable. This forces MATLAB to use included mesa drivers, which don't have this problem.
    – JAustin
    Commented Aug 17, 2017 at 14:43

2 Answers 2

12

In Linux command line, type matlab -softwareopengl, it will start Matlab with normality. To make this default, inside Matlab command line, type opengl('save','software'). It works with Matlab R2019b on Ubuntu 18.04.

1
  • 1
    Also worked for me, in quite a different setting (Ubuntu 20.04, Matlab R2022a, Intel UHD 620 on Dell Latitude 7300). Thank you!
    – loxo
    Commented Jun 1, 2022 at 14:35
0

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....

1
  • 1
    For ML 2017a on Ubuntu 14.04 this fix did not solve my problem, even made it worse. ML was not launching due to lack of some resources. I had to revert the file to the original libstdc++.so.6
    – Elod
    Commented Apr 28, 2017 at 11:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .