当我在配备 GTX1080 的 ubuntu 14.04 上打开 matlab2016a 时出现以下错误:
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
有办法解决这个问题吗?我在 nvidia 论坛上看到过帖子(https://devtalk.nvidia.com/default/topic/926199/361-28-crashes-matlab-r2016a/) 和这里,我尝试了几个解决方案,但都没有奏效。我安装了 ppa nvidia 驱动程序(不是来自 nvidia 网站的驱动程序)。这是 nvidia 驱动程序的问题吗?
答案1
在 Linux 命令行中输入matlab -softwareopengl
,它将正常启动 Matlab。要将其设为默认,请在 Matlab 命令行中输入opengl('save','software')
。它适用于 Ubuntu 18.04 上的 Matlab R2019b。
答案2
它的 OPENGL 和 libstdc++ 问题
首先,安装一些软件包
$ sudo apt-get install lib64stdc++6:i386
$ sudo apt-get install mesa-utils
然后更新一些链接:
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
然后运行 matlab 检查 matlab 终端中的 mesa 是否更新
>> opengl info
Version: '3.0 Mesa 17.0.3'
Vendor: 'Intel Open Source Technology Center' ..............
HardwareSupportLevel: 'full'
..........
现在 opengl 应该可以工作了....