361.28 crashes Matlab R2016a

Dear nVidia Support Team,

I experienced a problematic behavior with the 361.28 version of the nVidia driver under CentOS 6.7 running the most recent Matlab version R2016a. Directly after initialization Matlab crashes giving an error message:

###############################################################################
    MATLAB crash file:/home/xxxxxx/matlab_crash_dump.5931-1:

------------------------------------------------------------------------
           Segmentation violation detected at Wed Mar 16 15:21:57 2016
    ------------------------------------------------------------------------

    Configuration:
      Crash Decoding : Disabled
      Crash Mode : continue (default)
      Current Graphics Driver: Unknown hardware
      Current Visual : 0x21 (class 4, depth 24)
      Default Encoding : UTF-8
      GNU C Library : 2.12 stable
      Host Name : monkey.xxx.xx.xxx.xx
      MATLAB Architecture : glnxa64
      MATLAB Root : /software/Matlab.R2016a
      MATLAB Version : 9.0.0.341360 (R2016a)
      OpenGL : hardware
      Operating System : Linux 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64
      Processor ID : x86 Family 6 Model 45 Stepping 7, GenuineIntel
      Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
      Window System : CentOS (11500000), display :0.0

    Fault Count: 1

Abnormal termination:
    Segmentation violation

    Register State (from fault):
      RAX = 00007fdeddc8fcf0 RBX = 0000000000000000
      RCX = 0000000000000001 RDX = 0000000000000000
      RSP = 00007fdeddc8fcc0 RBP = 00007fdec840b680
      RSI = 0000000000000000 RDI = 00007fdeddc8fd98

       R8 = 00000000000000a8 R9 = 00000038b388405a
      R10 = 0000000000000000 R11 = 00000038b3883dda
      R12 = 00007fdec8787680 R13 = 00007fdec840b680
      R14 = 00007fdec880aed0 R15 = 00007fdec89481c0

      RIP = 00000037ab65420d EFL = 0000000000010202

       CS = 0033 FS = 0000 GS = 0000

    Stack Trace (from fault):
    [ 0] 0x00000037ab65420d /usr/lib64/nvidia/libGL.so.1+00344589

If this problem is reproducible, please submit a Service Request via:
        http://www.mathworks.com/support/contact_us/ [^]

    A technical support engineer might contact you with further information.

    Thank you for your help.
###############################################################################

As I use by standard the kmod-nvidia driver from the ElRepo repository, I needed to track down whether the problem is due to the driver itself or the packaging from ElRepo. Therefore, I removed the kmod-nvidia version and installed the Linux driver supplied by nVidia. The same error behavior was found:

################################################################

MATLAB crash file:/home/xxxxxx/matlab_crash_dump.3983-1:

------------------------------------------------------------------------
       Segmentation violation detected at Wed Mar 23 11:13:47 2016
------------------------------------------------------------------------

Configuration:
  Crash Decoding : Disabled
  Crash Mode : continue (default)
  Current Graphics Driver: Unknown hardware
  Current Visual : 0x21 (class 4, depth 24)
  Default Encoding : UTF-8
  GNU C Library : 2.12 stable
  Host Name : monkey.xxx.xx.xxx.xx
  MATLAB Architecture : glnxa64
  MATLAB Root : /software/Matlab.R2016a
  MATLAB Version : 9.0.0.341360 (R2016a)
  OpenGL : hardware
  Operating System : Linux 2.6.32-573.18.1.el6.x86_64 #1 SMP Tue Feb 9 22:46:17 UTC 2016 x86_64
  Processor ID : x86 Family 6 Model 45 Stepping 7, GenuineIntel
  Virtual Machine : Java 1.7.0_60-b19 with Oracle Corporation Java HotSpot(TM) 64-Bit Server VM mixed mode
  Window System : CentOS (11500000), display :0.0

Fault Count: 1

Abnormal termination:
Segmentation violation

Register State (from fault):
  RAX = 00007f8de9c37e70 RBX = 0000000000000000
  RCX = 0000000000000001 RDX = 0000000000000000
  RSP = 00007f8de9c37e40 RBP = 00007f8ddc0524d0
  RSI = 0000000000000000 RDI = 00007f8de9c37f18

   R8 = 00000000000000a8 R9 = 00000038b388405a
  R10 = 0000000000000000 R11 = 00000038b3883dda
  R12 = 00007f8ddc0405d0 R13 = 00007f8ddc0524d0
  R14 = 00007f8ddc397f30 R15 = 00007f8ddc353410

  RIP = 00007f8ee4bde20d EFL = 0000000000010206

   CS = 0033 FS = 0000 GS = 0000

Stack Trace (from fault):
[ 0] 0x00007f8ee4bde20d /usr/lib64/libGL.so.1+00344589

If this problem is reproducible, please submit a Service Request via:
    http://www.mathworks.com/support/contact_us/ [^]

A technical support engineer might contact you with further information.

Thank you for your help.

#######################################################################

This problem occurs only with Matlab R2016a, with the second-latest version R2015b this error does not occur. However, for me it is not possible to determine if the problem comes through the driver or Matlab. As with the 361.xx drivers a choice between GLVND or non-GLVND was made possible, a possible error could be there.

With the prior driver version 352.79 all Matlab version run correctly and no problem occurs.

I attached the nvidia-bug-report.log.gz file which I created after the Matlab crash.
nvidia-bug-report.log.gz (132 KB)

I can confirm that (direct install of the Linux driver supplied by nVidia, openSUSE 13.2).
With the latest beta driver (364.12) Matlab R2016a seems to work again, but I get this exception shortly after startup:

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x7a00792d, isOwner false, <3513b7ee, 2190857b>[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 GLX_BAD_SCREEN
	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

I can confirm the error that dliw is getting. I also see this exact error with matlab 2016, and I am also using the 364.12 driver on linux mint 17.3.

In matlab if you call >> opengl info
you get a low level graphics error. From the error log:

com.jogamp.opengl.GLException: Profile GL_DEFAULT is not available on X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x2b83ed6, isOwner false, <e2554ff, 34ef389a>[count 0, qsz 0, owner ]]], but:
at com.jogamp.opengl.GLProfile.get(GLProfile.java:990)
at com.jogamp.opengl.GLProfile.getDefault(GLProfile.java:721)
at com.jogamp.opengl.GLCapabilities.(GLCapabilities.java:84)
at com.mathworks.hg.uij.OpenGLUtils$MyGLListener.getGLInformation(OpenGLUtils.java:320)
at com.mathworks.hg.uij.OpenGLUtils$MyGLListener.getGLData(OpenGLUtils.java:498)
at com.mathworks.hg.uij.OpenGLUtils.getGLData(OpenGLUtils.java:78)

Matlab claims to be talking with Nvidia about this error. Will Nvidia be fixing this?

I too am getting this issue at work, and it’s definitely hurting my productivity :(.

I am using Matlab 2015b which works with 364.14 driver

Which one is latest Matlab R2016a or Matlab 2015b ?

The latest version is Matlab R2016a.

we are tracking this issue under bug 1744483

Hello,

I have the same problem. Matlab 2016a crashes after using opengl, e.g. ‘opengl info’. Do you have any solutions to this issue so far?

Regards,
Denis

Hi everyone,

I sent a crash report and the Matlab engineering team told me to downgrade my graphics driver to version 352.79:

http://www.nvidia.com/Download/driverResults.aspx/97645/en-us

I did it too (for driver version 364), the problem is that older versions than 364 will cause a problem with the internal monitor of my laptop with ubuntu 16.04 (see also http://askubuntu.com/questions/760876/internal-laptop-display-is-disconnected-lvds-0-disconnected )

As I was recommended from the MathWorks support, you can temporarily solve the problem by running matlab with the -softwareopengl flag, without having to downgrade your graphic card driver.

For those needing help, you can simply edit your/create the /usr/share/applications/matlab.desktop file as follows:

[Desktop Entry]
Version=9.0
Type=Application
Terminal=true
Exec=matlab -softwareopengl
Name=MATLAB
Icon=/usr/share/icons/hicolor/256x256/apps/matlab.png
Categories=Development;Math;Science
Comment=Scientific computing environment
StartupNotify=true
StartupWMClass=com-mathworks-util-PostVMInit

a good looking matlab icon can be found under http://www.mathworks.com/matlabcentral/fileexchange/24085-matlab-icon-for-linux–with-transparency- and has to be saved under /usr/share/icons/hicolor/256x256/apps/

Could this be fixed in the nvidia-361 driver for the next release? Matlab support told me this is possible an error with the NVidia driver. I would like to use the Optimus technique, I guess the open-source 364 version doesn’t support the Optimus tech.

I have tried the desktop shortcut file, by setting +x mode, it works. Thanks!

The same problem appears with the driver version 361.42, too.

On the same issue, working on a Lenovo ThinkPad W530 with Fedora 23 and a nvidia Quadro K2000M, I upgraded nvidia driver to 367.27 version (last one) and the problem was solved

greetings

Also confirm here that 367.27 works as well on my Lenovo Thinkpad P50 with a Quadra M1000M GPU. Thanks.

After a first test the problem seems to be solved with Driver Version 367.27 under CentOS 6, too.

Edit: Unfortunately the problem is only solved in respect that it is possible to start Matlab. However, when opening a number of figure windows or when closing a lot of figure windows using ‘close all’, Matlab16a still tends to crash. This is true for both 367.27 and 367.35. Still, this problem does not occur on earlier Matlab versions (I tested Matlab15b).

I can also verify this bug on my linux desktop running Linux Mint 17.3. Matlab 2016 gives an opengl exception at startup. Also the command opengl info generates a low level graphics error.

This problem occurs even when using Nvidia 367 and 370 drivers. Matlab claims it’s an Nvidia bug and will do nothing to rectify it even though Matlab 2015 works just fine.

I’m curious if there is any hope for a fix or if Nvidia is aware of this problem. I assume they are since the Matlab rep. claimed they had spoken with Nvidia about it.

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x647be1fc, isOwner false, <1319aee, 5fb27fde>[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)

I have the same problem as described by SevenThunders in previous post. I’m using Linux Mint Debian Edition with GTX 1070 and currently have 367.44 drivers, I’ve tried 352.79 and 370.23 (beta) drivers as well but the problem persists.
currently I’m running matlab with -softwareopengl flag.
startup error

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x7f83d89a, isOwner false, <2901a7dd, 2bb3b333>[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

error after opengl info

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]

I also confirm the same error on Ubuntu 16.04 using driver 361.42 with GTX 950M on MATLAB 2014b.

Using the flag -softwareopengl the error is not shown at startup, but when I try to plot:

a=[1:100]; b=sin(linspace(0,2*pi,100)); plot(a,b)
javax.media.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for :0
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:316)
	at jogamp.opengl.SharedResourceRunner.run(SharedResourceRunner.java:295)
	at java.lang.Thread.run(Unknown Source)
Caused by: javax.media.opengl.GLException: glXGetConfig(0x1) failed: error code GLX_BAD_SCREEN
	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:433)
	at jogamp.opengl.x11.glx.X11GLXGraphicsConfigurationFactory.chooseGraphicsConfigurationStatic(X11GLXGraphicsConfigurationFactory.java:239)
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createMutableSurfaceImpl(X11GLXDrawableFactory.java:511)
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory.createDummySurfaceImpl(X11GLXDrawableFactory.java:522)
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:276)
	... 2 more
Exception in thread "AWT-EventQueue-0" javax.media.opengl.GLException: Profile GL_DEFAULT is not available on X11GraphicsDevice[type .x11, connection :0, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x1d5abd41, isOwner false, <303f0575, 797f5d11>[count 0, qsz 0, owner <NULL>]]], but: []
	at javax.media.opengl.GLProfile.get(GLProfile.java:901)
	at javax.media.opengl.GLProfile.getDefault(GLProfile.java:632)
	at javax.media.opengl.GLCapabilities.<init>(GLCapabilities.java:84)
	at com.mathworks.hg.peer.JavaSceneServerPeer.getCaps(JavaSceneServerPeer.java:147)
	at com.mathworks.hg.peer.JavaSceneServerPeer.doCreateCanvas(JavaSceneServerPeer.java:676)
	at com.mathworks.hg.peer.JavaSceneServerPeer.access$200(JavaSceneServerPeer.java:50)
	at com.mathworks.hg.peer.JavaSceneServerPeer$2.run(JavaSceneServerPeer.java:650)
	at java.awt.event.InvocationEvent.dispatch(Unknown Source)
	at java.awt.EventQueue.dispatchEventImpl(Unknown Source)
	at java.awt.EventQueue.access$200(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.awt.EventQueue$3.run(Unknown Source)
	at java.security.AccessController.doPrivileged(Native Method)
	at java.security.ProtectionDomain$1.doIntersectionPrivilege(Unknown Source)
	at java.awt.EventQueue.dispatchEvent(Unknown Source)
	at java.awt.EventDispatchThread.pumpOneEventForFilters(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForFilter(Unknown Source)
	at java.awt.EventDispatchThread.pumpEventsForHierarchy(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.pumpEvents(Unknown Source)
	at java.awt.EventDispatchThread.run(Unknown Source)

So the flag did not solve the error, just hid it.

EDIT: Using X.Org X server (open source) driver fixed the problem, but I think that is not the solution for those who want to use proprietary drivers…

EDIT 2: It still crashing when I try to manipulate 3d graphic such as:

logo

And then, pan or rotate the plot.