Could not initialize shared resources for X11GraphicsDevice- Ubuntu 14.04, Matlab 2017b

I have a machine with running Ubuntu 14.04, Nvidia GeForce 1080 Ti and MAtlab 2017b. I am facing this error which ,I believe, has been reported previously in this post for 2017a https://www.mathworks.com/matlabcentral/answers/342906-could-not-initialize-shared-resources-for-x11graphicsdevice and the error message is the same :
com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x413b9df1, isOwner false, <30fe5aac, af2eb55>[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
according to the above post there were some suggestions that could resolve the issue that i try but didnt work for me: 1- "libstdc++.so.6" solution
2-
$ matlab -softwareopengl
3-Trying different version of the Nvidia drivers :
NVIDIA binary driver -Version 384.130 from NVIDIA-380 (open source)
NVIDIA binary driver -Version 396.18 from NVIDIA-396 (open source)
NVIDIA binary driver -Version 390.48 from NVIDIA-390 (open source)
is there any solution or recommendation to rectify that problem.

Answers (1)

I have the same problem and i am searching since 2 days all the day for a solution. I can't even plot basic things. I am actually destroying my ubuntu system by trying various things out. At this point i would rather start thinking if octave is the better solution

7 Comments

i have tried to find the reply from Mathworks support team but unfortunately couldnt . anyhow, they advised me change something regarding the OpenGl by using one single command and everyhting went well afterwards. Therefore, you can just send them an email and hopefully they will reply as soon as possible . You dont need to instal or unistall anyhting from your system. Hope my answer will help you
Sadly not. I've seen this solution before. Thank you for your response anyway
Hi,
I am on Ubuntu 20.04 beta and running the nvidia on-demand prime profile, and get the same error. I can solve this (see the Archwiki) by starting matlab from terminal:
export MESA_LOADER_DRIVER_OVERRIDE=i965; matlab
Or (additionaly) you can change the EXEC in /usr/share/applications/matlab.desktop to:
Exec=env MESA_LOADER_DRIVER_OVERRIDE=i965 matlab -desktop
Bless you this worked for me after hours of suffering

Sign in to comment.

Categories

Asked:

on 1 May 2018

Commented:

on 12 Jan 2026

Community Treasure Hunt

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

Start Hunting!