VirtualGL常见问题解决方法
文章目录
这里我使用VGL主要是因为通过ssh连接服务器跑程序时,时常会出现渲染的问题。会报错导致程序中断
"ValueError: Failed to initialize Pyglet window with an OpenGL >= 3+ context. If you're logged in via SSH, ensure that you're running your script with vglrun (i.e. VirtualGL). The internal error message was "Could not create GL context""
因此我们需要利用VGL去解决
下面就VGL使用过程中个人碰到一些问题进行记录:
问题1:libGL error
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
这里应该是你本机的nvidia驱动的问题,在自己电脑上通过ssh利用vgl跑程序出现的错误。(这里我在远程运行vglrun glxgears
会出现这个问题,但是齿轮还是可以正常显示)
我的解决方法是:在远程的服务器上登录自己的docker,然后跑相同的程序,问题得到解决。(不报错,正常显示齿轮)
问题2:470: Broken pipe
[VGL] ERROR: Could not send data to client. Client may have disconnected.
[VGL] ERROR: in send--
[VGL] 470: Broken pipe
这里报错其实已经提示你怎么去解决,这里是vglclient没有打开,导致传输通道没有打开。
解决方法:远程服务器输入:vglclient
,出现以下提示证明打开成功,再次运行程序没有报错。
问题3:X Error of failed request: GLXUnsupportedPrivateRequest
[VGL] WARNING: The OpenGL rendering context obtained on X display
[VGL] *********:10.0 is indirect, which may cause performance to suffer.
[VGL] If *******:10.0 is a local X display, then the framebuffer device
[VGL] permissions may be set incorrectly.
WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug!
X Error of failed request: GLXUnsupportedPrivateRequest
Major opcode of failed request: 145 (GLX)
Minor opcode of failed request: 16 (X_GLXVendorPrivate)
Serial number of failed request: 28
Current serial number in output stream: 30
这个问题我还是解决了很长时间,偶然尝试解决的。
解决方法:更换显示的port。
之前我都是export VGL_DISPLAY="********:10.0"
(******是我的docker_name), 然后运行vglrun glxgears
就运行成功了,重启了服务器以后发现就不能运行vgl了,后来将10.0
改成11.0
以后又恢复正常了。
后续遇到问题会持续更新…(有问题直接评论)