# Matlab crashes after insatlling PTB: com.jogamp.opengl.GLException

**URL:** <https://psychtoolbox.discourse.group/t/matlab-crashes-after-insatlling-ptb-com-jogamp-opengl-glexception/74>\
**Category:** Uncategorized\
**Created:** [November 15, 2017, 8:24am UTC](https://psychtoolbox.discourse.group/t/matlab-crashes-after-insatlling-ptb-com-jogamp-opengl-glexception/74 "2017-11-15T08:24:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jonathan.oesterle](https://avatars.discourse-cdn.com/v4/letter/j/2bfe46/32.png) [@jonathan.oesterle](https://psychtoolbox.discourse.group/u/jonathan.oesterle)\
**Post date:** [November 15, 2017, 8:24am UTC](https://psychtoolbox.discourse.group/t/matlab-crashes-after-insatlling-ptb-com-jogamp-opengl-glexception/74/1 "2017-11-15T08:24:49Z")

</div>

Hi!

I recently installed Matlab 2016b and used DownloadPsychtoolbox.m to install PTB.

At the end of the installation, I get this:

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.  
Your version of Matlab R2014b or later was setup to use its own software OpenGL renderer.  
As this is completely unsuitable for Psychtoolbox, i have changed the setting to use the  
system provided hardware accelerated OpenGL library. You need to quit and restart Matlab  
for these changes to take effect, otherwise visual stimulation will be broken.  
  
Press any key to continue to confirm you read and understood this.  
com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0.0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x3edd14b8, isOwner false, \<247b5c46, 1ee70a60\>[count 0, qsz 0, owner \<NULL\>]]]  
&nbsp;&nbsp;&nbsp; at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:326)  
&nbsp;&nbsp;&nbsp; at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:297)  
&nbsp;&nbsp;&nbsp; at java.lang.Thread.run(Unknown Source)  
Caused by: com.jogamp.opengl.GLException: main-SharedResourceRunner: Error making temp context(1) current: display 0x7f59b80019f0, context 0x7f59b809d180, drawable X11OnscreenGLXDrawable[Realized true,  
&nbsp;&nbsp;&nbsp; Factory&nbsp;&nbsp; jogamp.opengl.x11.glx.X11GLXDrawableFactory@378eaf9d,  
&nbsp;&nbsp;&nbsp; Handle&nbsp;&nbsp;&nbsp; 0x4400003,  
&nbsp;&nbsp;&nbsp; Surface&nbsp;&nbsp; WrappedSurface[ displayHandle 0x7f59b80019f0  
, surfaceHandle 0x4400003  
, size 64x64  
, UOB[OWNS\_SURFACE | WINDOW\_INVISIBLE]  
, X11GLXGraphicsConfiguration[X11GraphicsScreen[X11GraphicsDevice[type .x11, connection :0.0, unitID 0, handle 0x7f59b80019f0, owner true, ResourceToolkitLock[obj 0x78ab88e9, isOwner true, \<45a9b6e3, 92614d0\>[count 2, qsz 0, owner \<main-SharedResourceRunner\>]]], idx 0], visualID 0x363, fbConfigID 0x10d,  
&nbsp;&nbsp;&nbsp; requested GLCaps[rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 16/0/0, dbl, mono&nbsp; , hw, GLProfile[GL2/GL2.sw], on-scr[.]],  
&nbsp;&nbsp;&nbsp; chosen&nbsp;&nbsp;&nbsp; GLCaps[glx vid 0x363, fbc 0x10d: rgba 8/8/8/0, opaque, accum-rgba 0/0/0/0, dp/st/ms 24/0/0, dbl, mono&nbsp; , hw, GLProfile[GL2/GL2.sw], on-scr[.]]]  
, surfaceLock \<23206861, 24a4ca4b\>[count 1, qsz 0, owner \<main-SharedResourceRunner\>]  
, X11DummyUpstreamSurfaceHook[pixel 64x64]  
, upstreamSurface false ]]  
&nbsp;&nbsp;&nbsp; at jogamp.opengl.x11.glx.X11GLXContext.createImpl(X11GLXContext.java:371)  
&nbsp;&nbsp;&nbsp; at jogamp.opengl.GLContextImpl.makeCurrentWithinLock(GLContextImpl.java:759)  
&nbsp;&nbsp;&nbsp; at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:642)  
&nbsp;&nbsp;&nbsp; at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)  
&nbsp;&nbsp;&nbsp; at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:297)  
&nbsp;&nbsp;&nbsp; ... 2 more

Then, the following command makes Matlab crash:

[window, windowRect] = PsychImaging('OpenWindow', screenNumber, grey);

... and I get the those errors in the terminal:

libGL error: unable to load driver: nouveau\_dri.so  
libGL error: driver pointer missing  
libGL error: failed to load driver: nouveau  
libGL error: unable to load driver: swrast\_dri.so  
libGL error: failed to load driver: swrast  
libGL error: unable to load driver: nouveau\_dri.so  
libGL error: driver pointer missing  
libGL error: failed to load driver: nouveau  
libGL error: unable to load driver: swrast\_dri.so  
libGL error: failed to load driver: swrast

What could I do about it?

I'm using a Debian Linux 4.9.0-3-amd64 x86\_64.

Best regards,

Jonathan

---

<div class="post-metadata">

**Author:** ![mariokleiner](https://avatars.discourse-cdn.com/v4/letter/m/13edae/32.png) [@mariokleiner](https://psychtoolbox.discourse.group/u/mariokleiner)\
**Post date:** [November 16, 2017, 2:43pm UTC](https://psychtoolbox.discourse.group/t/matlab-crashes-after-insatlling-ptb-com-jogamp-opengl-glexception/74/2 "2017-11-16T14:43:56Z")

</div>

-\> Probably Matlab screwing up libraries: Try this:  
  
sudo dpkg-reconfigure **matlab** - **support**  
  
and answer yes when it asks if it should remove/rename Matlab libraries. This step is needed after each upgrade/install of Matlab to fix Matlab brain-damage.  
  
-mario
