我想使用Xvfb无头测试WebGL代码。有人知道怎么做吗?
我有2台机器 - 都运行Ubuntu。一个使用NVidia卡,另一个使用ATI:
NVidia机器:
ipmi:~ $>xvfb-run glxinfo
name of display: :455
display: :455 screen: 0
direct rendering: No (If you want to find out why, try setting LIBGL_DEBUG=verbose)
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method,
GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_MESA_copy_sub_buffer, GLX_INTEL_swap_event
client glx vendor string: NVIDIA Corporation
client glx version string: 1.4
...
ipmi:~ $>xvfb-run glxgears
3725 frames in 5.0 seconds = 741.884 FPS
3840 frames in 5.0 seconds = 767.310 FPS
4080 frames in 5.0 seconds = 814.811 FPS
4120 frames in 5.0 seconds = 821.859 FPS
ATI机器:
shaka:~ $>xvfb-run glxinfo
name of display: :99
display: :99 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
GLX_ARB_multisample, GLX_EXT_visual_info, GLX_EXT_visual_rating,
GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, GLX_OML_swap_method,
GLX_SGI_make_current_read, GLX_SGIS_multisample, GLX_SGIX_fbconfig,
GLX_SGIX_pbuffer, GLX_MESA_copy_sub_buffer, GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
shaka:~ $>xvfb-run glxgears
4326 frames in 5.0 seconds = 865.095 FPS
4343 frames in 5.0 seconds = 868.540 FPS
即使shaka支持使用Mesa进行直接渲染,我也无法获得WebGL上下文。
谢谢!
答案 0 :(得分:0)
使用现代X11,最好忽略Xvfb
并使用dummy
显示驱动程序。有关使用它的信息,请参阅http://www.x.org/wiki/XorgTesting上的“其他说明”(您可能会指定具有必要xorg.conf
部分的自定义Device
)。 http://www.karlrunge.com/x11vnc/Xdummy是另一种使用虚拟驱动程序的方法。