Test drive VirtualGL on FreeBSD/Intel HD Graphics

Meowthink meowthink at gmail.com
Wed Feb 15 14:27:39 UTC 2012


Hello all,

Thanks to kib's work, FreeBSD can use Intel's modern GPUs/drivers to
accelerate recently. It's worth to test such configuration(FreeBSD on
Intel GPU) can serve VirtualGL well or not.

Environment:
Intel i3-2100T (2nd Generation Core Processor Family Integrated
Graphics Controller)
FreeBSD 9.0-STABLE #50 r231739M: Wed Feb 15 15:11:05 CST 2012
root at test.example.org:/usr/obj/usr/src/sys/GENERIC  amd64

Compile/Install:
All prerequirements in BUILDING.txt seems available through port collection.
Works followed instructions, since svn rev 4811 (I used to patch
CMakeFiles.txt before but it's been fixed:-))

Configure:
The script vglserver_config didn't provide FreeBSD branches. But it
seems like users in wheel group get proper permission (/dev/dri,
/opt/VirtualGL etc.) without running it.
sshd must be enabled.

Running:
Functional with following problems until svn rev 4812 (rev 4813 seems break)

Poblems:

1. Broken with V-Sync.

I used to think this is a problem lies in GEM or DRI, describing it at
http://lists.freebsd.org/pipermail/freebsd-x11/2011-December/011337.html
Then I narrowed it down to V-Sync (it maybe lies in vgl, or maybe in
mesa, or in intel's driver).

To solve this problem, one can adding following section into driconf:

    <device screen="0" driver="dri2">
        <application name="Default">
            <option name="vblank_mode" value="1" />
        </application>
    </device>

(value="0" is either OK)

Or running vglrun by some prefix

vblank_mode=0 vglrun ...

Yes, this setvar can be add into vglrun script, but I don't know if
this will affect others, and it also results some annoying warnings in
console.

2. Readback performance bottleneck.

Without dedicated faster memories, it's reasonably that Intel GPUs
won't provide very well performance, especially on pixel operations.

When using mesa-7.11.2 and other stuffs from the concurrent xorg-dev
branch xorg_7_5_2
(http://lists.freebsd.org/pipermail/freebsd-ports/2012-February/072859.html),
the glxspheres demo reports

Polygons in scene: 62464
Visual ID of window: 0x24
Context is Direct
OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Desktop
Readback    -    9.39 Mpixels/sec-   10.01 fps
9.439577 frames/sec - 8.849037 Mpixels/sec
Compress 0  -   33.74 Mpixels/sec-   35.99 fps
Total       -    8.96 Mpixels/sec-    9.55 fps-   13.66 Mbits/sec (15.7:1)
Readback    -    9.41 Mpixels/sec-   10.03 fps
9.431724 frames/sec - 8.841675 Mpixels/sec
Compress 0  -   32.93 Mpixels/sec-   35.13 fps
Total       -    8.83 Mpixels/sec-    9.42 fps-   14.04 Mbits/sec (15.1:1)
Readback    -    9.41 Mpixels/sec-   10.04 fps
9.439071 frames/sec - 8.848563 Mpixels/sec

...and glreadtest measures
glReadPixels():   9.320 Mpixels/sec (min = 9.312, max = 9.332, sdev = 0.003429)
glReadPixels() accounted for 100.00% of total readback time
(An interesting thing is that, though glDrawPixels differs a lot among
pixel formats, glReadPixels always performs around 9.3Mpixels/sec. So
a complete typescript is attached.)

The bottleneck is at readback, and the poor performance
~9.3Mpixels/sec is only capable of running apps at 640x480x30fps!
When doing readpixels benchmark from mesa-demo (also in attached
typescript), I found that there maybe have room of VirtualGL to
optimize, as vgl's readback speed seems stuck to the 10x10 in
mesa-demo's readpixels benchmark, which give better results on larger
reads.

Some recent developments on mesa claim to improve performance
(http://lists.freedesktop.org/archives/mesa-dev/2011-November/014015.html).
So I also give a try.
I got mesa compiled from git branch master, snb-magic-8850-g78734e3,
nearly same as release 8.0. Yes it really improves readback
performance to simple apps such as glxgears (with exception such as
glxspheres, will be described later)

Readback    -   20.67 Mpixels/sec-  229.68 fps
Compress 0  -   24.28 Mpixels/sec-  269.77 fps
Total       -    9.68 Mpixels/sec-  107.53 fps-   23.00 Mbits/sec (10.1:1)

but this version of mesa on FreeBSD w/Intel GPU patch has BIG problem
on Z-buffer. I can't figure out which part the problem lies in yet,
but the result is obversely, as glxspheres gets

Polygons in scene: 62464
Visual ID of window: 0x24
Context is Direct
OpenGL Renderer: Mesa DRI Intel(R) Sandybridge Desktop
Readback    -   25.01 Mpixels/sec-   26.68 fps
0.585122 frames/sec - 0.548516 Mpixels/sec
Compress 0  -   34.08 Mpixels/sec-   36.35 fps
Total       -    0.55 Mpixels/sec-    0.59 fps-    0.73 Mbits/sec (18.1:1)
Readback    -   25.63 Mpixels/sec-   27.34 fps
0.361668 frames/sec - 0.339042 Mpixels/sec
Compress 0  -   35.74 Mpixels/sec-   38.12 fps
Total       -    0.34 Mpixels/sec-    0.36 fps-    0.49 Mbits/sec (16.5:1)

What a terrible result! hmmm... definitely this is not VirtualGL's
problem, but excuse me for a little off-topic here. I can trace down
the problem to Z-buffer, because by commenting out the line 311 in
glxspheres.c, //glEnable(GL_DEPTH_TEST); , the program draws as fast
as others, through the drawing looks corrupt.
Running glxspheres locally results nearly same, and the result of
readpixels seems reflecting bad Z performance too.
May anyone here give a help on how to narrow down the problem?

Anyway, the ~20Mpixels/sec performance is capable of running apps at
640x480x60fps flawlessly or even 1024x768x25fps, far more better now.

3. App-specific: VirtualBox + VirtualGL didn't work
VirtualBox 4.1.8_OSE r75467 from redports. Command line vglrun
VirtualBox -startvm ... didn't work, switch +v +tr shows that fake
libs are not loaded. I doubt this is due to VirtualBox binary is just
a wrapper, not linked to libGL.so.1
/usr/local/bin/VirtualBox:
	libthr.so.3 => /lib/libthr.so.3 (0x800850000)
	libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x800a73000)
	libm.so.5 => /lib/libm.so.5 (0x800d83000)
	libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x800fa4000)
	libc.so.7 => /lib/libc.so.7 (0x8011b1000)

Using the chromium way by doing
$ export CR_SYSTEM_GL_PATH=/opt/VirtualGL/fakelib/64/
$ vglrun -nodl +v +tr VirtualBox -startvm windows
...
[VGL] Shared memory segment ID for vglconfig: 65541
[VGL] VirtualGL v2.3.1 64-bit (Build 20120209)
[VGL] Undefined symbol "glXChooseVisual"
[VGL] WARNING: Could not load GLX/OpenGL symbols using RTLD_NEXT.  Attempting
[VGL]    to load GLX/OpenGL symbols directly from libGL.so.1.
[VGL] Undefined symbol "XCheckMaskEvent"
[VGL] WARNING: Could not load X11 symbols using RTLD_NEXT.  Attempting
[VGL]    to load X11 symbols directly from libX11.
[VGL] Opening local display :0
Segmentation fault

I tried +de and use gdb to trace. It seems that VirtualBox confused
with which display is for X11(VirtualGL server) and which is
remote(VirtualGL client). Details available at:
http://pastebin.com/FaNAAwbK

Conclusion:
It works!
Although the performance is not as good as professional level cards.
It's still fun to play with. With the enhancement of hw/driver, this
must be more and more useful.

Thanks for your time.

Regards,
Meowthink
-------------- next part --------------
$ glxinfo
name of display: localhost:0.0
display: localhost:0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_framebuffer_sRGB, 
    GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent, 
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGI_make_current_read, GLX_SGI_swap_control, GLX_SGI_video_sync, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_EXT_texture_from_pixmap, 
    GLX_INTEL_swap_event
GLX version: 1.4
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control, 
    GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample, 
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 
    GLX_EXT_texture_from_pixmap
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Desktop 
OpenGL version string: 2.1 Mesa 7.11.2
OpenGL shading language version string: 1.20
OpenGL extensions:
    GL_ARB_multisample, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 
    GL_EXT_blend_logic_op, GL_EXT_blend_minmax, GL_EXT_blend_subtract, 
    GL_EXT_copy_texture, GL_EXT_polygon_offset, GL_EXT_subtexture, 
    GL_EXT_texture_object, GL_EXT_vertex_array, GL_EXT_compiled_vertex_array, 
    GL_EXT_texture, GL_EXT_texture3D, GL_IBM_rasterpos_clip, 
    GL_ARB_point_parameters, GL_EXT_draw_range_elements, GL_EXT_packed_pixels, 
    GL_EXT_point_parameters, GL_EXT_rescale_normal, 
    GL_EXT_separate_specular_color, GL_EXT_texture_edge_clamp, 
    GL_SGIS_generate_mipmap, GL_SGIS_texture_border_clamp, 
    GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_ARB_framebuffer_sRGB, 
    GL_ARB_multitexture, GL_EXT_framebuffer_sRGB, 
    GL_IBM_multimode_draw_arrays, GL_IBM_texture_mirrored_repeat, 
    GL_3DFX_texture_compression_FXT1, GL_ARB_texture_cube_map, 
    GL_ARB_texture_env_add, GL_ARB_transpose_matrix, 
    GL_EXT_blend_func_separate, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, 
    GL_EXT_secondary_color, GL_EXT_texture_env_add, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, 
    GL_INGR_blend_func_separate, GL_NV_blend_square, GL_NV_light_max_exponent, 
    GL_NV_texgen_reflection, GL_NV_texture_env_combine4, 
    GL_SUN_multi_draw_arrays, GL_ARB_texture_border_clamp, 
    GL_ARB_texture_compression, GL_EXT_framebuffer_object, 
    GL_EXT_texture_env_dot3, GL_MESA_window_pos, GL_NV_packed_depth_stencil, 
    GL_NV_texture_rectangle, GL_NV_vertex_program, GL_ARB_depth_texture, 
    GL_ARB_occlusion_query, GL_ARB_shadow, GL_ARB_texture_env_combine, 
    GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, 
    GL_ARB_texture_mirrored_repeat, GL_ARB_window_pos, GL_ATI_envmap_bumpmap, 
    GL_EXT_stencil_two_side, GL_EXT_texture_cube_map, GL_NV_depth_clamp, 
    GL_NV_vertex_program1_1, GL_APPLE_client_storage, GL_APPLE_packed_pixels, 
    GL_APPLE_vertex_array_object, GL_ARB_draw_buffers, 
    GL_ARB_fragment_program, GL_ARB_fragment_shader, GL_ARB_shader_objects, 
    GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ATI_draw_buffers, 
    GL_ATI_texture_env_combine3, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap, 
    GL_MESA_pack_invert, GL_MESA_ycbcr_texture, GL_ARB_depth_clamp, 
    GL_ARB_fragment_program_shadow, GL_ARB_half_float_pixel, 
    GL_ARB_point_sprite, GL_ARB_shading_language_100, GL_ARB_sync, 
    GL_ARB_texture_non_power_of_two, GL_ARB_vertex_buffer_object, 
    GL_ATI_blend_equation_separate, GL_EXT_blend_equation_separate, 
    GL_OES_read_format, GL_ARB_color_buffer_float, GL_ARB_pixel_buffer_object, 
    GL_ARB_texture_compression_rgtc, GL_ARB_texture_rectangle, 
    GL_EXT_pixel_buffer_object, GL_EXT_texture_compression_rgtc, 
    GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_ARB_framebuffer_object, 
    GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
    GL_EXT_packed_depth_stencil, GL_APPLE_object_purgeable, 
    GL_ARB_vertex_array_object, GL_ATI_separate_stencil, GL_EXT_draw_buffers2, 
    GL_EXT_gpu_program_parameters, GL_EXT_texture_env_combine, 
    GL_EXT_texture_sRGB_decode, GL_EXT_timer_query, GL_OES_EGL_image, 
    GL_ARB_copy_buffer, GL_ARB_half_float_vertex, GL_ARB_map_buffer_range, 
    GL_ARB_texture_rg, GL_ARB_texture_swizzle, GL_ARB_vertex_array_bgra, 
    GL_EXT_separate_shader_objects, GL_EXT_texture_swizzle, 
    GL_EXT_vertex_array_bgra, GL_NV_conditional_render, 
    GL_ARB_ES2_compatibility, GL_ARB_draw_elements_base_vertex, 
    GL_ARB_explicit_attrib_location, GL_ARB_fragment_coord_conventions, 
    GL_ARB_provoking_vertex, GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, 
    GL_ARB_shader_texture_lod, GL_EXT_provoking_vertex, GL_EXT_texture_snorm, 
    GL_MESA_texture_signed_rgba, GL_ARB_robustness

32 GLX Visuals
   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------
0x21 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x22 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x9d 24 tc  0 24  0 r  .  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0x9e 24 tc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0x9f 24 tc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xa0 24 tc  0 24  0 r  .  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa1 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa2 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa3 24 tc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xa4 24 tc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xa5 24 tc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xa6 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xa7 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa8 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xa9 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xaa 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0xab 24 dc  0 24  0 r  .  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xac 24 dc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xad 24 dc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xae 24 dc  0 24  0 r  .  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xaf 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xb0 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xb1 24 dc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xb2 24 dc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xb3 24 dc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xb4 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xb5 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xb6 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xb7 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xb8 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xb9 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x6c 32 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None

$ ./glreadtest

GLreadtest v2.3.1 (Build 20120209)

./glreadtest -h for advanced usage.

Rendering to Pbuffer using GLX on display localhost:0.0
FB Config = 0x73
Drawable size = 701 x 701 pixels
Using 1-byte row alignment

>>>>>>>>>>  PIXEL FORMAT:  LUM  <<<<<<<<<<
glDrawPixels():   3.707 Mpixels/sec
glReadPixels():   558: ERROR: Bogus data read back.

>>>>>>>>>>  PIXEL FORMAT:  RED  <<<<<<<<<<
glDrawPixels():   3.772 Mpixels/sec
glReadPixels():   9.577 Mpixels/sec (min = 9.574, max = 9.603, sdev = 0.006106)
glReadPixels() accounted for 100.00% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  BGRA  <<<<<<<<<<
glDrawPixels():   28.46 Mpixels/sec
glReadPixels():   9.325 Mpixels/sec (min = 9.322, max = 9.333, sdev = 0.002067)
glReadPixels() accounted for 100.00% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  ABGR  <<<<<<<<<<
glDrawPixels():   3.740 Mpixels/sec
glReadPixels():   9.343 Mpixels/sec (min = 9.332, max = 9.348, sdev = 0.005665)
glReadPixels() accounted for 100.00% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  BGR  <<<<<<<<<<
glDrawPixels():   3.765 Mpixels/sec
glReadPixels():   9.428 Mpixels/sec (min = 9.426, max = 9.447, sdev = 0.004328)
glReadPixels() accounted for 100.00% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  RGBA  <<<<<<<<<<
glDrawPixels():   14.80 Mpixels/sec
glReadPixels():   9.376 Mpixels/sec (min = 9.368, max = 9.385, sdev = 0.003214)
glReadPixels() accounted for 100.00% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  RGB  <<<<<<<<<<
glDrawPixels():   14.81 Mpixels/sec
glReadPixels():   9.443 Mpixels/sec (min = 9.441, max = 9.457, sdev = 0.003304)
glReadPixels() accounted for 100.00% of total readback time

$ ./readpixels
glReadPixels(10 x 10, RGBA/ubyte): 27306.7 images/sec, 10.4 Mpixels/sec
glReadPixels(100 x 100, RGBA/ubyte): 907.8 images/sec, 34.6 Mpixels/sec
glReadPixels(500 x 500, RGBA/ubyte): 37.4 images/sec, 35.7 Mpixels/sec
glReadPixels(1000 x 1000, RGBA/ubyte): 9.4 images/sec, 35.7 Mpixels/sec
glReadPixels(10 x 10, BGRA/ubyte): 27306.7 images/sec, 10.4 Mpixels/sec
glReadPixels(100 x 100, BGRA/ubyte): 905.4 images/sec, 34.5 Mpixels/sec
glReadPixels(500 x 500, BGRA/ubyte): 37.3 images/sec, 35.5 Mpixels/sec
glReadPixels(1000 x 1000, BGRA/ubyte): 9.3 images/sec, 35.6 Mpixels/sec
glReadPixels(10 x 10, RGB/565): 27283.9 images/sec, 5.2 Mpixels/sec
glReadPixels(100 x 100, RGB/565): 897.5 images/sec, 17.1 Mpixels/sec
glReadPixels(500 x 500, RGB/565): 36.9 images/sec, 17.6 Mpixels/sec
glReadPixels(1000 x 1000, RGB/565): 9.2 images/sec, 17.6 Mpixels/sec
glReadPixels(10 x 10, L/ubyte): 27058.6 images/sec, 2.6 Mpixels/sec
glReadPixels(100 x 100, L/ubyte): 906.2 images/sec, 8.6 Mpixels/sec
glReadPixels(500 x 500, L/ubyte): 37.4 images/sec, 8.9 Mpixels/sec
glReadPixels(1000 x 1000, L/ubyte): 9.4 images/sec, 8.9 Mpixels/sec
glReadPixels(10 x 10, Z/uint): 26969.5 images/sec, 10.3 Mpixels/sec
glReadPixels(100 x 100, Z/uint): 844.2 images/sec, 32.2 Mpixels/sec
glReadPixels(500 x 500, Z/uint): 34.7 images/sec, 33.1 Mpixels/sec
glReadPixels(1000 x 1000, Z/uint): 8.6 images/sec, 32.9 Mpixels/sec
glReadPixels(10 x 10, Z+S/uint): 31782.7 images/sec, 12.1 Mpixels/sec
glReadPixels(100 x 100, Z+S/uint): 1583.9 images/sec, 60.4 Mpixels/sec
glReadPixels(500 x 500, Z+S/uint): 66.3 images/sec, 63.2 Mpixels/sec
glReadPixels(1000 x 1000, Z+S/uint): 17.4 images/sec, 66.3 Mpixels/sec
$ 
-------------- next part --------------
$ export LD_LIBRARY_PATH=/opt/mesa/lib
$ glxinfo
name of display: localhost:0.0
display: localhost:0  screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_multisample, GLX_EXT_import_context, GLX_EXT_texture_from_pixmap, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_OML_swap_method, GLX_SGI_make_current_read, GLX_SGI_swap_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_INTEL_swap_event
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
client glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_framebuffer_sRGB, 
    GLX_EXT_create_context_es2_profile, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control, 
    GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample, 
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 
    GLX_EXT_texture_from_pixmap, GLX_INTEL_swap_event
GLX version: 1.4
GLX extensions:
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_swap_control, 
    GLX_OML_swap_method, GLX_OML_sync_control, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync, GLX_SGIS_multisample, 
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 
    GLX_EXT_texture_from_pixmap
OpenGL vendor string: Tungsten Graphics, Inc
OpenGL renderer string: Mesa DRI Intel(R) Sandybridge Desktop 
OpenGL version string: 2.1 Mesa 8.0-devel (git-78734e3)
OpenGL shading language version string: 1.30
OpenGL extensions:
    GL_ARB_multisample, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_blend_color, 
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_copy_texture, 
    GL_EXT_polygon_offset, GL_EXT_subtexture, GL_EXT_texture_object, 
    GL_EXT_vertex_array, GL_EXT_compiled_vertex_array, GL_EXT_texture, 
    GL_EXT_texture3D, GL_IBM_rasterpos_clip, GL_ARB_point_parameters, 
    GL_EXT_draw_range_elements, GL_EXT_packed_pixels, GL_EXT_point_parameters, 
    GL_EXT_rescale_normal, GL_EXT_separate_specular_color, 
    GL_EXT_texture_edge_clamp, GL_SGIS_generate_mipmap, 
    GL_SGIS_texture_border_clamp, GL_SGIS_texture_edge_clamp, 
    GL_SGIS_texture_lod, GL_ARB_framebuffer_sRGB, GL_ARB_multitexture, 
    GL_EXT_framebuffer_sRGB, GL_IBM_multimode_draw_arrays, 
    GL_IBM_texture_mirrored_repeat, GL_3DFX_texture_compression_FXT1, 
    GL_ARB_texture_cube_map, GL_ARB_texture_env_add, GL_ARB_transpose_matrix, 
    GL_EXT_blend_func_separate, GL_EXT_fog_coord, GL_EXT_multi_draw_arrays, 
    GL_EXT_secondary_color, GL_EXT_texture_env_add, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_lod_bias, 
    GL_INGR_blend_func_separate, GL_NV_blend_square, GL_NV_light_max_exponent, 
    GL_NV_texgen_reflection, GL_NV_texture_env_combine4, 
    GL_SUN_multi_draw_arrays, GL_ARB_texture_border_clamp, 
    GL_ARB_texture_compression, GL_EXT_framebuffer_object, 
    GL_EXT_texture_env_combine, GL_EXT_texture_env_dot3, GL_MESA_window_pos, 
    GL_NV_packed_depth_stencil, GL_NV_texture_rectangle, GL_NV_vertex_program, 
    GL_ARB_depth_texture, GL_ARB_occlusion_query, GL_ARB_shadow, 
    GL_ARB_texture_env_combine, GL_ARB_texture_env_crossbar, 
    GL_ARB_texture_env_dot3, GL_ARB_texture_mirrored_repeat, 
    GL_ARB_window_pos, GL_ATI_envmap_bumpmap, GL_EXT_stencil_two_side, 
    GL_EXT_texture_cube_map, GL_NV_depth_clamp, GL_NV_vertex_program1_1, 
    GL_APPLE_packed_pixels, GL_APPLE_vertex_array_object, GL_ARB_draw_buffers, 
    GL_ARB_fragment_program, GL_ARB_fragment_shader, GL_ARB_shader_objects, 
    GL_ARB_vertex_program, GL_ARB_vertex_shader, GL_ATI_draw_buffers, 
    GL_ATI_texture_env_combine3, GL_EXT_shadow_funcs, GL_EXT_stencil_wrap, 
    GL_MESA_pack_invert, GL_MESA_ycbcr_texture, GL_ARB_depth_clamp, 
    GL_ARB_fragment_program_shadow, GL_ARB_half_float_pixel, 
    GL_ARB_point_sprite, GL_ARB_shading_language_100, GL_ARB_sync, 
    GL_ARB_texture_non_power_of_two, GL_ARB_vertex_buffer_object, 
    GL_ATI_blend_equation_separate, GL_EXT_blend_equation_separate, 
    GL_OES_read_format, GL_ARB_color_buffer_float, GL_ARB_pixel_buffer_object, 
    GL_ARB_texture_compression_rgtc, GL_ARB_texture_rectangle, 
    GL_EXT_pixel_buffer_object, GL_EXT_texture_compression_rgtc, 
    GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_ARB_framebuffer_object, 
    GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
    GL_EXT_packed_depth_stencil, GL_APPLE_object_purgeable, 
    GL_ARB_vertex_array_object, GL_ATI_separate_stencil, GL_EXT_draw_buffers2, 
    GL_EXT_gpu_program_parameters, GL_EXT_texture_array, 
    GL_EXT_texture_integer, GL_EXT_texture_sRGB_decode, GL_EXT_timer_query, 
    GL_OES_EGL_image, GL_MESA_texture_array, GL_ARB_copy_buffer, 
    GL_ARB_depth_buffer_float, GL_ARB_half_float_vertex, 
    GL_ARB_map_buffer_range, GL_ARB_texture_rg, GL_ARB_texture_swizzle, 
    GL_ARB_vertex_array_bgra, GL_EXT_separate_shader_objects, 
    GL_EXT_texture_swizzle, GL_EXT_vertex_array_bgra, 
    GL_NV_conditional_render, GL_ARB_ES2_compatibility, 
    GL_ARB_draw_elements_base_vertex, GL_ARB_explicit_attrib_location, 
    GL_ARB_fragment_coord_conventions, GL_ARB_provoking_vertex, 
    GL_ARB_sampler_objects, GL_ARB_seamless_cube_map, 
    GL_ARB_shader_texture_lod, GL_EXT_provoking_vertex, GL_EXT_texture_snorm, 
    GL_MESA_texture_signed_rgba, GL_ARB_robustness, GL_EXT_transform_feedback

32 GLX Visuals
   visual  x  bf lv rg d st colorbuffer ax dp st accumbuffer  ms  cav
 id dep cl sp sz l  ci b ro  r  g  b  a bf th cl  r  g  b  a ns b eat
----------------------------------------------------------------------
0x21 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x22 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0x9d 24 tc  0 24  0 r  .  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0x9e 24 tc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0x9f 24 tc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xa0 24 tc  0 24  0 r  .  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa1 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa2 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa3 24 tc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xa4 24 tc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xa5 24 tc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xa6 24 tc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xa7 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xa8 24 tc  0 24  0 r  y  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xa9 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xaa 24 tc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0xab 24 dc  0 24  0 r  .  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xac 24 dc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xad 24 dc  0 24  0 r  y  .  8  8  8  0  0  0  0  0  0  0  0  0 0 None
0xae 24 dc  0 24  0 r  .  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xaf 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xb0 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xb1 24 dc  0 32  0 r  .  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xb2 24 dc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xb3 24 dc  0 32  0 r  y  .  8  8  8  8  0  0  0  0  0  0  0  0 0 None
0xb4 24 dc  0 32  0 r  .  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xb5 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xb6 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8  0  0  0  0  0 0 None
0xb7 24 dc  0 24  0 r  y  .  8  8  8  0  0 24  8 16 16 16  0  0 0 Slow
0xb8 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None
0xb9 24 dc  0 32  0 r  y  .  8  8  8  8  0 24  8 16 16 16 16  0 0 Slow
0x6c 32 tc  0 32  0 r  y  .  8  8  8  8  0 24  8  0  0  0  0  0 0 None

$ ./glreadtest 

GLreadtest v2.3.1 (Build 20120209)

./glreadtest -h for advanced usage.

Rendering to Pbuffer using GLX on display localhost:0.0
FB Config = 0x73
Drawable size = 701 x 701 pixels
Using 1-byte row alignment

>>>>>>>>>>  PIXEL FORMAT:  LUM  <<<<<<<<<<
glDrawPixels():   3.706 Mpixels/sec
glReadPixels():   558: ERROR: Bogus data read back.

>>>>>>>>>>  PIXEL FORMAT:  RED  <<<<<<<<<<
glDrawPixels():   3.722 Mpixels/sec
glReadPixels():   29.50 Mpixels/sec (min = 29.16, max = 29.52, sdev = 0.04575)
glReadPixels() accounted for 99.99% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  BGRA  <<<<<<<<<<
glDrawPixels():   28.57 Mpixels/sec
glReadPixels():   24.69 Mpixels/sec (min = 24.58, max = 24.73, sdev = 0.02024)
glReadPixels() accounted for 99.99% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  ABGR  <<<<<<<<<<
glDrawPixels():   3.716 Mpixels/sec
glReadPixels():   24.67 Mpixels/sec (min = 24.63, max = 24.70, sdev = 0.01189)
glReadPixels() accounted for 99.99% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  BGR  <<<<<<<<<<
glDrawPixels():   3.696 Mpixels/sec
glReadPixels():   25.37 Mpixels/sec (min = 25.23, max = 25.43, sdev = 0.02423)
glReadPixels() accounted for 99.99% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  RGBA  <<<<<<<<<<
glDrawPixels():   14.72 Mpixels/sec
glReadPixels():   24.58 Mpixels/sec (min = 24.54, max = 24.59, sdev = 0.01085)
glReadPixels() accounted for 99.99% of total readback time

>>>>>>>>>>  PIXEL FORMAT:  RGB  <<<<<<<<<<
glDrawPixels():   14.73 Mpixels/sec
glReadPixels():   25.37 Mpixels/sec (min = 25.29, max = 25.40, sdev = 0.01655)
glReadPixels() accounted for 99.99% of total readback time

$ ./readpixels
glReadPixels(10 x 10, RGBA/ubyte): 18133.9 images/sec, 6.9 Mpixels/sec
glReadPixels(100 x 100, RGBA/ubyte): 2082.4 images/sec, 79.4 Mpixels/sec
glReadPixels(500 x 500, RGBA/ubyte): 99.0 images/sec, 94.4 Mpixels/sec
glReadPixels(1000 x 1000, RGBA/ubyte): 24.8 images/sec, 94.8 Mpixels/sec
glReadPixels(10 x 10, BGRA/ubyte): 18113.9 images/sec, 6.9 Mpixels/sec
glReadPixels(100 x 100, BGRA/ubyte): 2114.6 images/sec, 80.7 Mpixels/sec
glReadPixels(500 x 500, BGRA/ubyte): 99.4 images/sec, 94.8 Mpixels/sec
glReadPixels(1000 x 1000, BGRA/ubyte): 24.9 images/sec, 95.1 Mpixels/sec
glReadPixels(10 x 10, RGB/565): 18044.1 images/sec, 3.4 Mpixels/sec
glReadPixels(100 x 100, RGB/565): 1976.8 images/sec, 37.7 Mpixels/sec
glReadPixels(500 x 500, RGB/565): 91.9 images/sec, 43.8 Mpixels/sec
glReadPixels(1000 x 1000, RGB/565): 22.9 images/sec, 43.8 Mpixels/sec
glReadPixels(10 x 10, L/ubyte): 17828.1 images/sec, 1.7 Mpixels/sec
glReadPixels(100 x 100, L/ubyte): 2048.0 images/sec, 19.5 Mpixels/sec
glReadPixels(500 x 500, L/ubyte): 95.7 images/sec, 22.8 Mpixels/sec
glReadPixels(1000 x 1000, L/ubyte): 24.1 images/sec, 23.0 Mpixels/sec
glReadPixels(10 x 10, Z/uint): 2539.4 images/sec, 1.0 Mpixels/sec
glReadPixels(100 x 100, Z/uint): 372.9 images/sec, 14.2 Mpixels/sec
glReadPixels(500 x 500, Z/uint): 17.5 images/sec, 16.7 Mpixels/sec
glReadPixels(1000 x 1000, Z/uint): 4.4 images/sec, 16.8 Mpixels/sec
glReadPixels(10 x 10, Z+S/uint): 2491.5 images/sec, 1.0 Mpixels/sec
glReadPixels(100 x 100, Z+S/uint): 320.4 images/sec, 12.2 Mpixels/sec
glReadPixels(500 x 500, Z+S/uint): 14.7 images/sec, 14.0 Mpixels/sec
glReadPixels(1000 x 1000, Z+S/uint): 3.7 images/sec, 14.1 Mpixels/sec
$ 


More information about the freebsd-x11 mailing list