我有一个 Ubuntu 14.04 系统,安装了以下软件包:
libegl1-mesa:amd64
libegl1-mesa-drivers:amd64
libgl1-mesa-dri:amd64
libgl1-mesa-dri:i386
libgl1-mesa-glx:amd64
libgl1-mesa-glx:i386
libglapi-mesa:amd64
libglapi-mesa:i386
libgles2-mesa:amd64
libglu1-mesa:amd64
libopenvg1-mesa:amd64
libwayland-egl1-mesa:amd64
mesa-utils
xvfb
我想在 xvfb 下启动一个应用程序。我首先启动 xvfb:
$ Xvfb :1 -screen 0 1024x768x24 +extension GLX +render -noreset >> xsession.log 2>&1 &
然后检查 xvfb 日志文件:
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension Present
Initializing built-in extension DRI3
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension SELinux
Initializing built-in extension GLX
这表明没有错误。另外,GLX 似乎已正确加载。现在,如果我检查服务器
$ glxinfo -display :1
我明白了
name of display: :1
Xlib: extension "GLX" missing on display ":1".
...
Error: couldn't find RGB GLX visual or fbconfig
Xlib: extension "GLX" missing on display ":1".
...
Error: couldn't find RGB GLX visual or fbconfig
Xlib: extension "GLX" missing on display ":1".
...
事实上,我想在此服务器上启动且需要 GLX 的应用程序无法启动。
在检查了几个文档页面和论坛后,我不知道这里出了什么问题。如果 GLX 扩展未正确加载,为什么 X 服务器日志文件不显示任何错误?有什么我应该检查的吗?
答案1
Xvfb(X虚拟帧缓冲区)是Xsever虚拟的,不支持真正的硬件加速。
您需要生成 openGL 调用,其中 虚拟GL,通过真实的 3D Xserver 和 2D 渲染将真实调用分叉到 Xvfb 或另一个 2D Xserver。
$ Xvfb :1 -screen 0 1024x768x24 +extension GLX +render -noreset >> xsession.log 2>&1 &
$ env DISPLAY=:1 vglrun glxinfo
答案2
在我的日志文件中,我看到初始化内置扩展 GLX 之前一切都很好,但随后是
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Internal error: Could not resolve keysym XF86AudioMicMute
Errors from xkbcomp are not fatal to the X server
可能关键问题是xkbcomp?
答案3
在维基百科中页Xvfb 中写道:“与真正的显示服务器不同,Xvfb 不支持现代 X11 扩展,例如合成、Randr 或 GLX。Xdummy 是一种更新的替代方案,它支持这些扩展并提供与 Xvfb 相同的功能。”