技术 · 2022年4月19日 0

解决MATLAB“X11GLXDrawableFactory – Could not initialize shared resources for X11GraphicsDevice”的方法

打开MATLAB R2020a出现以下报错:

com.jogamp.opengl.GLException: X11GLXDrawableFactory - Could not initialize shared resources for X11GraphicsDevice[type .x11, connection :1, unitID 0, handle 0x0, owner false, ResourceToolkitLock[obj 0x455894f2, isOwner false, <7b607dc3, c355187>[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(Thread.java:748)
Caused by: java.lang.NullPointerException
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:688)
	at jogamp.opengl.GLContextImpl.makeCurrent(GLContextImpl.java:580)
	at jogamp.opengl.x11.glx.X11GLXDrawableFactory$SharedResourceImplementation.createSharedResource(X11GLXDrawableFactory.java:297)
	... 2 more

在MATLAB中输入以下命令

opengl('save','software');

重新打开MATLAB,错误提示消失。

(个人存档备用)

心情表态
+1
0
+1
0
+1
0
+1
0
+1
0
+1
0