xpra icon
Bug tracker and wiki

Opened 7 years ago

Closed 6 years ago

Last modified 5 years ago

#226 closed task (fixed)

opengl rendering on osx

Reported by: Antoine Martin Owned by: alas
Priority: minor Milestone: 0.10
Component: client Version: trunk
Keywords: opengl osx Cc:

Description (last modified by Antoine Martin)

split from #147

I thought that buiding (py)gtkgl on osx would be a good stepping stone for eventually getting it to work/build on win32...

All these instructions are from within a gtk-osx jhbuild shell (tested with xcode 3.2 on osx 10.5):


gtkglext

  • we use the git version to get osx support (no public releases for over 5 years - yikes!):
    git clone git://git.gnome.org/gtkglext
    cd gtkglext
    
  • then we ignore the documentation which is out of date, wrong and completely missing when it comes to building on osx, and we configure the build with the totally undocumented (but supported) quartz gdk backend, but only after defining the magic compiler variables that prevent libtool from barfing at us with:
    libtool: compile: unable to infer tagged configuration
    libtool: compile: specify a tag with `--tag'
    make[4]: *** [gdkglquery-quartz.lo] Error 1
    make[3]: *** [all-recursive] Error 1
    make[2]: *** [all] Error 2
    make[1]: *** [all-recursive] Error 1
    

Some good info on libtool issues can be found here.

So then end up with:

export CXX=/usr/bin/c++-4.2
export CC=/usr/bin/gcc-4.2 
export OBJC=/usr/bin/gcc-4.2 
gtkdocize
autoreconf -is
./configure --prefix ${JHBUILD_PREFIX} \
            --libdir ${JHBUILD_PREFIX}/lib \
            --with-gdktarget=quartz \
            --build=i386-darwin
make
make install

(may sound simple but this was anything but)



pygtkglext
The real problems start with pygtkglext.
There are two ways of building it: distutils and autotools based, none of which work.
Again, we use the more up to date version from git (not that the 1.1 makes any difference..):

git clone git://git.gnome.org/pygtkglext
cd pygtkglext

pygtkglext distutils

  • python ./setup.py install --prefix=$JHBUILD_PREFIX fails with:
    TypeError: pkgc_version_check() takes exactly 2 arguments (3 given)
    

we remove the broken pkgconfig check by commenting out the two lines:

if not pkgc_version_check('pygtk-2.0', 'PyGTK', PYGTK_REQUIRED_VERSION):
    raise SystemExit, "Aborting"

(you should really check that you do have pygtk-2.0 correctly installed at this point and that you have the pkgconfig file it would normally check against, ie: $JHBUILD_PREFIX/lib/pkgconfig/pygtk-2.0.pc)

  • then we get this other error:
    Traceback (most recent call last):
      File "./setup.py", line 117, in <module>
        override='gtk/gdkgl/gdkglext.override')
      File "./gtk/inst/lib/python2.7/site-packages/gtk-2.0/dsextras.py", line 495, in __init__
        py_ssize_t_clean))
      File "./gtk/inst/lib/python2.7/site-packages/gtk-2.0/dsextras.py", line 399, in __new__
        codegen_error_message))
    NameError: 'Template' is not defined
    

Which means that it doesn't find codegen... (really not obvious). So we tell it where to find it:

PYTHONPATH=$JHBUILD_PREFIX/share/pygobject/2.0/:$PYTHONPATH python2.7 ./setup.py install \
        --prefix=$JHBUILD_PREFIX
  • then we get this error:
    gtk/gdkgl/gdkglmodule.c: In function 'init_gdkgl':
    gtk/gdkgl/gdkglmodule.c:86: error: 'gdkglext_major_version' undeclared (first use in this function)
    gtk/gdkgl/gdkglmodule.c:86: error: (Each undeclared identifier is reported only once
    gtk/gdkgl/gdkglmodule.c:86: error: for each function it appears in.)
    gtk/gdkgl/gdkglmodule.c:87: error: 'gdkglext_minor_version' undeclared (first use in this function)
    gtk/gdkgl/gdkglmodule.c:88: error: 'gdkglext_micro_version' undeclared (first use in this function)
    error: command '/usr/bin/gcc-4.2' failed with exit status 1
    

And those values only get mentioned in the gdkglversion section of gtkglext/docs/reference/gtkglext/gtkglext-sections.txt, and in gtkglext/gdk/gdkglversion.c we can find functions that look like they would almost match: gdk_gl_get_major_version, gdk_gl_get_minor_version and gdk_gl_get_micro_version.
So we replace the code in gtk/gdkgl/gdkglmodule.c like so:

    tuple = Py_BuildValue("(iii)",
                          gdk_gl_get_major_version(),   /* gdkglext_major_version */
                          gdk_gl_get_minor_version(),   /* gdkglext_minor_version */
                          gdk_gl_get_micro_version());  /* gdkglext_micro_version */
  • then we get this new build error:
    In file included from ./gtk/inst/include/gtk-2.0/gtk/gtk.h:234,
                     from ./gtk/inst/include/pygtk-2.0/pygtk/pygtk.h:8,
                     from gtk/gdkgl/gdkglext.override:26:
    ./gtk/inst/include/gtk-2.0/gtk/gtkitemfactory.h:47: warning: function declaration isn't a prototype
    gtk/gdkgl/gdkglext.override:36:19: error: GL/gl.h: No such file or directory
    (...)
    

Which can be fixed by adding /usr/X11/include to the include path in setup.py:

GLOBAL_INC.append("/usr/X11/include")
  • but then we get another error:
    gtk/gdkgl/gdkglext.override: In function '_wrap_gdk_gl_config_new':
    gtk/gdkgl/gdkglext.override:130: error: 'GDK_TYPE_GL_CONFIG_MODE' undeclared (first use in this function)
    gtk/gdkgl/gdkglext.override:130: error: (Each undeclared identifier is reported only once
    gtk/gdkgl/gdkglext.override:130: error: for each function it appears in.)
    

I give up...

pygtkglext autotools
It's a mess - don't go there.
Missing macros, out of date docs, etc.

Attachments (10)

gdkglext.defs (11.5 KB) - added by Antoine Martin 6 years ago.
fixed gdkglext definition file for building on osx
gdkglext-types.defs (1.9 KB) - added by Antoine Martin 6 years ago.
fixed gdkglext-types definition file for building on osx
gdkglext.override (8.6 KB) - added by Antoine Martin 6 years ago.
fixed gdkglext override file for building on osx
gdkgl-constants.diff (474 bytes) - added by Antoine Martin 6 years ago.
our hacked build is missing all the constants - this hardcodes them
osx_GLExtensions-unavailable.rtf (5.7 KB) - added by alas 6 years ago.
starting osx session with rgb encoding- GL Extensions unavailable
pygtkglext-osx-v2.patch (17.8 KB) - added by Antoine Martin 5 years ago.
updated patch which allows us to build from git source with latest jhbuild
gtkglext-osx.patch (643 bytes) - added by Antoine Martin 5 years ago.
minimal patch for gtkglext
pygtkglext-osx-v3.patch (18.7 KB) - added by Antoine Martin 5 years ago.
correct patch, which allows gtkgl to load on all machines and not just the one I build on
gtkglext-osx-quartztagfix.diff (936 bytes) - added by Antoine Martin 5 years ago.
somehow this got missed because the file isn't tracked by git, ugly way of fixing things
pygtkglext-osx-v4.patch (18.7 KB) - added by Antoine Martin 5 years ago.
updated patch for building against current git for both gtkglext and pygtkglext

Download all attachments as: .zip

Change History (29)

comment:1 Changed 7 years ago by Antoine Martin

Description: modified (diff)
Status: newaccepted

comment:2 Changed 7 years ago by Antoine Martin

Description: modified (diff)

comment:3 Changed 7 years ago by Antoine Martin

Description: modified (diff)

comment:4 Changed 7 years ago by Antoine Martin

Resolution: wontfix
Status: acceptedclosed

OSX is really unpleasant to deal with, GL should be the last of our worries. Not going to bother.

comment:5 Changed 6 years ago by Antoine Martin

Another attempt using autotools:
gtkglext:

  • fix gtkglext's configure.ac to avoid this error:
    configure.ac:58: error: 'AM_CONFIG_HEADER': this macro is obsolete.
        You should use the 'AC_CONFIG_HEADERS' macro instead.
    

by doing this:

sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac
  • generate build config:
    autoreconf -fiv
    ./configure --prefix=${JHBUILD_PREFIX} 
    
  • fix gdk/quartz/Makefile (or tell configure using --with-tags=CC ?):
    sed -i -e 's+/libtool$+/libtool --tag=CC+g' gdk/quartz/Makefile
    
  • build:
    make
    

And ignore errors in examples (missing pangoft2) - or remove "examples" from top-level Makefile

  • then we can finally install:
    make install
    

Notes: on 10.6.x, we were getting these errors:

Undefined symbols:
  "_objc_msgSend", referenced from:
    (... lots of places ...)

This was solved by adding:

  • "-framework Foundation -framework OpenGL" on 10.5
  • "-framework Cocoa -framework OpenGL -framework Carbon" on 10.6

to GL_LIBS in the gdk/quartz/Makefile (there probably is a better/more correct way, but this worked).
(note: you may need to make clean && make)


pygtkglext from git:

  • fix pygtkglext's configure.ac:
    sed -i -e 's/AM_CONFIG_HEADER/AC_CONFIG_HEADERS/g' configure.ac
    
  • fix tuple as per distutils instructions
  • fix GL include path by patching it in the Makefile..
  • then remove lots of things that don't build..
  • then you install and find you can't load it:
    $ python
    >>> from ctypes import *
    >>> x=cdll.LoadLibrary("/Users/MacAdmin/gtk/inst/lib/python2.7/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.so")
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
      File "/Users/MacAdmin/gtk/inst/lib/python2.7/ctypes/__init__.py", line 443, in LoadLibrary
        return self._dlltype(name)
      File "/Users/MacAdmin/gtk/inst/lib/python2.7/ctypes/__init__.py", line 365, in __init__
        self._handle = _dlopen(self._name, mode)
    OSError: dlopen(/Users/MacAdmin/gtk/inst/lib/python2.7/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.so, 6): Symbol not found: __gdk_gl_context_destroy
      Referenced from: /Users/MacAdmin/gtk/inst/lib/python2.7/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.so
      Expected in: dynamic lookup
    

Which is very odd because this symbol exists:

$ nm /Users/MacAdmin/gtk/inst/lib/libgdkglext-quartz-1.0.0.dylib | grep __gdk_gl_context_destroy
000478ca t __gdk_gl_context_destroy

And our _gdkgk.so references this library:

$ otool  -L /Users/MacAdmin/gtk/inst/lib/python2.7/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.so | grep gl
/Users/MacAdmin/gtk/inst/lib/python2.7/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.so:
	/Users/MacAdmin/gtk/inst/lib/libgtkglext-quartz-1.0.0.dylib (compatibility version 201.0.0, current version 201.0.0)
	/Users/MacAdmin/gtk/inst/lib/libgdkglext-quartz-1.0.0.dylib (compatibility version 201.0.0, current version 201.0.0)
	/Users/MacAdmin/gtk/inst/lib/libglib-2.0.0.dylib (compatibility version 3401.0.0, current version 3401.3.0)
Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:6 Changed 6 years ago by Antoine Martin

If at first you don't succeed, try again.. and again, and again.

Eventually, got it to build and load, use the attached files to replace the ones shipped with pygtkglext (in gtk/gdkgl). We remove lots of stuff that does not build (either because pygtkglext has not kept up with gtkglext or because they are missing from the quartz backend).

The resulting shared object loads, though we are missing a bunch of constants so we still have to patch a few places to get it to run..

Here is the result:

$ python xpra//client/gl/gl_check.py 
2013-07-07 14:57:25,510 pygdkglext version=(1, 1, 0)
2013-07-07 14:57:25,510 pygdkglext OpenGL version=(1, 0)
2013-07-07 14:57:25,552 using display mode: []
2013-07-07 14:57:25,678 OpenGL_accelerate module loaded
2013-07-07 14:57:26,295 OpenGL Version: 2.1 APPLE
2013-07-07 14:57:26,442 GL Extension GL_ARB_shader_objects available
2013-07-07 14:57:26,500 GL Extension GL_ARB_vertex_array_object unavailable
2013-07-07 14:57:26,513 GL Extension GL_ARB_texture_buffer_object unavailable
2013-07-07 14:57:26,524 GL Extension GL_ARB_framebuffer_object unavailable
2013-07-07 14:57:26,535 GL Extension GL_ARB_map_buffer_range unavailable
2013-07-07 14:57:26,539 GL Extension GL_ARB_copy_buffer unavailable
2013-07-07 14:57:26,541 GL Extension GL_ARB_uniform_buffer_object unavailable
2013-07-07 14:57:26,545 GL Extension GL_ARB_draw_elements_base_vertex unavailable
2013-07-07 14:57:26,547 GL Extension GL_ARB_provoking_vertex unavailable
2013-07-07 14:57:26,550 GL Extension GL_ARB_sync unavailable
2013-07-07 14:57:26,552 GL Extension GL_ARB_texture_multisample unavailable
2013-07-07 14:57:26,557 GL Extension GL_ARB_blend_func_extended unavailable
2013-07-07 14:57:26,559 GL Extension GL_ARB_sampler_objects unavailable
2013-07-07 14:57:26,567 GL Extension GL_ARB_timer_query unavailable
2013-07-07 14:57:26,570 GL Extension GL_ARB_vertex_type_2_10_10_10_rev unavailable
2013-07-07 14:57:26,577 GL Extension GL_ARB_draw_indirect unavailable
2013-07-07 14:57:26,581 GL Extension GL_ARB_gpu_shader_fp64 unavailable
2013-07-07 14:57:26,584 GL Extension GL_ARB_shader_subroutine unavailable
2013-07-07 14:57:26,586 GL Extension GL_ARB_tessellation_shader unavailable
2013-07-07 14:57:26,593 GL Extension GL_ARB_transform_feedback2 unavailable
2013-07-07 14:57:26,595 GL Extension GL_ARB_transform_feedback3 unavailable
2013-07-07 14:57:26,599 GL Extension GL_ARB_ES2_compatibility unavailable
2013-07-07 14:57:26,601 GL Extension GL_ARB_get_program_binary unavailable
2013-07-07 14:57:26,603 GL Extension GL_ARB_separate_shader_objects unavailable
2013-07-07 14:57:26,610 GL Extension GL_ARB_vertex_attrib_64bit unavailable
2013-07-07 14:57:26,613 GL Extension GL_ARB_viewport_array unavailable
2013-07-07 14:57:26,616 GL Extension GL_ARB_base_instance unavailable
2013-07-07 14:57:26,620 GL Extension GL_ARB_transform_feedback_instanced unavailable
2013-07-07 14:57:26,626 GL Extension GL_ARB_internalformat_query unavailable
2013-07-07 14:57:26,629 GL Extension GL_ARB_shader_atomic_counters unavailable
2013-07-07 14:57:26,632 GL Extension GL_ARB_shader_image_load_store unavailable
2013-07-07 14:57:26,635 GL Extension GL_ARB_texture_storage unavailable
2013-07-07 14:57:26,642 GL Extension GL_ARB_clear_buffer_object unavailable
2013-07-07 14:57:26,644 GL Extension GL_ARB_compute_shader unavailable
2013-07-07 14:57:26,646 GL Extension GL_ARB_copy_image unavailable
2013-07-07 14:57:26,661 GL Extension GL_KHR_debug unavailable
2013-07-07 14:57:26,677 GL Extension GL_ARB_framebuffer_no_attachments unavailable
2013-07-07 14:57:26,680 GL Extension GL_ARB_internalformat_query2 unavailable
2013-07-07 14:57:26,681 GL Extension GL_ARB_invalidate_subdata unavailable
2013-07-07 14:57:26,683 GL Extension GL_ARB_multi_draw_indirect unavailable
2013-07-07 14:57:26,686 GL Extension GL_ARB_program_interface_query unavailable
2013-07-07 14:57:26,689 GL Extension GL_ARB_shader_storage_buffer_object unavailable
2013-07-07 14:57:26,692 GL Extension GL_ARB_texture_buffer_range unavailable
2013-07-07 14:57:26,696 GL Extension GL_ARB_texture_storage_multisample unavailable
2013-07-07 14:57:26,698 GL Extension GL_ARB_texture_view unavailable
2013-07-07 14:57:26,699 GL Extension GL_ARB_vertex_attrib_binding unavailable
2013-07-07 14:57:26,701 found valid OpenGL version: 2.1
2013-07-07 14:57:26,701 OpenGL extensions found: GL_ARB_transpose_matrix, GL_ARB_vertex_program, GL_ARB_vertex_blend, \
 GL_ARB_window_pos, GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_shading_language_100, GL_EXT_multi_draw_arrays, \
 GL_EXT_clip_volume_hint, GL_EXT_rescale_normal, GL_EXT_draw_range_elements, GL_EXT_fog_coord,  \
 GL_EXT_gpu_program_parameters, GL_EXT_geometry_shader4, GL_EXT_transform_feedback, GL_APPLE_client_storage, \
 GL_APPLE_specular_vector, GL_APPLE_transform_hint, GL_APPLE_packed_pixels, GL_APPLE_fence, \
 GL_APPLE_vertex_array_object, GL_APPLE_vertex_program_evaluators, GL_APPLE_element_array, GL_APPLE_flush_render, \
 GL_APPLE_aux_depth_stencil, GL_NV_texgen_reflection, GL_NV_light_max_exponent, GL_IBM_rasterpos_clip, \
 GL_SGIS_generate_mipmap, GL_ARB_imaging, GL_ARB_point_parameters, GL_ARB_texture_env_crossbar, \
 GL_ARB_texture_border_clamp, GL_ARB_multitexture, GL_ARB_texture_env_add, GL_ARB_texture_cube_map, \
 GL_ARB_texture_env_dot3, GL_ARB_multisample, GL_ARB_texture_env_combine, GL_ARB_texture_compression, \
 GL_ARB_texture_mirrored_repeat, GL_ARB_shadow, GL_ARB_depth_texture, GL_ARB_shadow_ambient, GL_ARB_fragment_program, \
 GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_occlusion_query, GL_ARB_point_sprite, \
 GL_ARB_texture_non_power_of_two, GL_ARB_vertex_buffer_object, GL_ARB_pixel_buffer_object, GL_ARB_draw_buffers, \
 GL_ARB_shader_texture_lod, GL_EXT_framebuffer_object, GL_EXT_texture_rectangle, GL_ARB_texture_rectangle, \
 GL_EXT_texture_env_add, GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_lod_bias, \
 GL_EXT_abgr, GL_EXT_bgra, GL_EXT_stencil_wrap, GL_EXT_secondary_color, GL_EXT_blend_func_separate, GL_EXT_shadow_funcs, \
 GL_EXT_stencil_two_side, GL_EXT_texture_compression_s3tc, GL_EXT_texture_compression_dxt1, GL_EXT_texture_sRGB, \
 GL_EXT_blend_equation_separate, GL_EXT_texture_mirror_clamp, GL_EXT_bindable_uniform, GL_EXT_texture_integer, \
 GL_EXT_gpu_shader4, GL_EXT_draw_buffers2, GL_APPLE_flush_buffer_range, GL_APPLE_ycbcr_422, GL_APPLE_float_pixels, \
 GL_ATI_texture_float, GL_ARB_texture_float, GL_ARB_half_float_pixel, GL_APPLE_pixel_buffer, GL_NV_blend_square, \
 GL_ATI_texture_mirror_once, GL_ATI_texture_env_combine3, GL_ATI_separate_stencil, GL_SGIS_texture_edge_clamp, \
 GL_SGIS_texture_lod, 
2013-07-07 14:57:26,702 shading language version: 1.20
2013-07-07 14:57:26,702 vendor: Apple Computer, Inc.
2013-07-07 14:57:26,702 renderer: Apple Software Renderer
2013-07-07 14:57:26,764 GLU extensions: 
2013-07-07 14:57:26,764 GLU version: 1.3 MacOSX
2013-07-07 14:57:26,765 All the required OpenGL functions are available: glActiveTexture, glTexSubImage2D, glTexCoord2i,  \
 glViewport, glMatrixMode, glLoadIdentity, glOrtho, glEnableClientState, glGenTextures, glDisable, glBindTexture, \
 glPixelStorei, glEnable, glBegin, glFlush, glTexParameteri, glTexImage2D, glMultiTexCoord2i, glVertex2i, glEnd
2013-07-07 14:57:26,765 ERROR: some required OpenGL functions are not available: glGenFramebuffers, glBindFramebuffer, glFramebufferTexture2D
2013-07-07 14:57:26,765 Extension GL_ARB_texture_rectangle is present
2013-07-07 14:57:26,765 Extension GL_ARB_vertex_program is present
2013-07-07 14:57:26,767 GL Extension GL_ARB_fragment_program available
2013-07-07 14:57:26,767 glInitFragmentProgramARB works
2013-07-07 14:57:26,769 GL Extension GL_ARB_texture_rectangle available
2013-07-07 14:57:26,769 glInitTextureRectangleARB works
2013-07-07 14:57:26,772 GL Extension GL_ARB_vertex_program available
2013-07-07 14:57:26,791 All the required OpenGL functions are available: glGenProgramsARB, glDeleteProgramsARB, glBindProgramARB, glProgramStringARB 
2013-07-07 14:57:26,791 Texture size GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB=16384
Last edited 6 years ago by Antoine Martin (previous) (diff)

Changed 6 years ago by Antoine Martin

Attachment: gdkglext.defs added

fixed gdkglext definition file for building on osx

Changed 6 years ago by Antoine Martin

Attachment: gdkglext-types.defs added

fixed gdkglext-types definition file for building on osx

Changed 6 years ago by Antoine Martin

Attachment: gdkglext.override added

fixed gdkglext override file for building on osx

Changed 6 years ago by Antoine Martin

Attachment: gdkgl-constants.diff added

our hacked build is missing all the constants - this hardcodes them

comment:7 Changed 6 years ago by Antoine Martin

Keywords: opengl osx added
Milestone: 0.80.10
Resolution: wontfix
Status: closedreopened

comment:8 Changed 6 years ago by Antoine Martin

Owner: changed from Antoine Martin to Smo
Status: reopenednew

Please let me know if:

  • it builds ok for you
  • it runs ok with acceleration (on my VM I get: ERROR: some required OpenGL functions are not available: glGenFramebuffers, glBindFramebuffer, glFramebufferTexture2D)

comment:9 Changed 6 years ago by Antoine Martin

From a mac client running with gl (originally recorded in #249):

OpenGL setup failure:
	Traceback (most recent call last):
	  File "xpra/client/gtk2/client.pyc", line 365, in init_opengl
	  File "xpra/client/gl/gl_check.pyc", line 201, in check_support
	  File "gtk/gtkgl/__init__.pyc", line 22, in <module>
	  File "gtk/gtkgl/widget.pyc", line 25, in <module>
	  File "gtk/gtkgl/widget.pyc", line 33, in Widget
	AttributeError: 'module' object has no attribute 'RGBA_TYPE'

comment:10 Changed 6 years ago by Antoine Martin

(hack): rather than hardcoding each value that is missing when we hit a problem, this hacks all the values from gdkgltokens directly into the python code:

grep "  GDK_GL" ~/gtkglext/gdk/gdkgltokens.h  | \
    sed 's+  GDK_GL_++g' | sed 's+,.*++g' | sed 's+\/\*.*++g' \
    >> ~/pygtkglext/gtk/gdkgl/__init__.py
Last edited 6 years ago by Antoine Martin (previous) (diff)

Changed 6 years ago by alas

starting osx session with rgb encoding- GL Extensions unavailable

comment:11 Changed 6 years ago by alas

It looks like the osx client logs GL extensions as unavailable. Attached client logs from starting a session.

comment:12 Changed 6 years ago by Antoine Martin

Owner: changed from Smo to alas

What makes you think it is not available?
Looks ok from what I am seeing, no warnings and no errors.

With r3832, we now include all the accelerator functions (optional but useful), so these warnings should now be all gone:

Unable to load ArrayDatatype accelerator from OpenGL_accelerate
Unable to load converters accelerators (wrapper, arraydatatype) from OpenGL_accelerate
Unable to load arrayhelpers accelerator from OpenGL_accelerate
Unable to load nones_formathandler accelerator from OpenGL_accelerate
Unable to load numpy_formathandler accelerator from OpenGL_accelerate

If they are still present in newer builds, please post the output of:

Xpra.app/Contents/Helpers/Python -c \
   "from OpenGL_accelerate.arraydatatype import AsArrayTypedSizeChecked;
from OpenGL_accelerate.wrapper import returnPyArgumentIndex;
from OpenGL_accelerate.arraydatatype import (AsArrayOfType,AsArrayTyped,AsArrayTypedSize)"

(should be empty)


(btw, please don't use RTF unless absolutely necessary, text/plain is better as it is machine parseable, grepable, etc)

Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:13 Changed 6 years ago by alas

Sorry, I thought the unavailable extensions was NOT expected.

With osx 0.10 r3830 I am still getting a lot of GL Extension GL_blahBlah unavailable messages on start, but I am not getting any of the Unable to load blahBlah from OpenGL_accelerate ... and just to be sure I ran the command you suggested and did indeed get no output.

(and my Mac's TextEdit, for some idiotic reason, doesn't give .txt as a save format option, at least not a readily available option... didn't realize it was a hassle, a spot of extra work and I can make .txt in future)

Last edited 6 years ago by Antoine Martin (previous) (diff)

comment:14 Changed 6 years ago by Antoine Martin

So, was GL enabled or not?
What does session-info show? Any GL windows? GL renderer info?

FYI: you can create plain text files without trouble with just "cat > file.txt" when pasting log samples.

comment:15 Changed 6 years ago by alas

Without a tray, I'm not aware of a way to get the session info, so I'm not sure how else to check for GL enabling- except from those logs that show when the client is started from the command line.

Many of the extensions show as unavailable, but there does seem to be an OpenGL module available, namely: 2013-07-11 19:31:26,972 OpenGL Version: 2.1 APPLE

From that RTF file:

2013-07-11 19:31:25,685 OpenGL_accelerate module loaded
2013-07-11 19:31:25,803 Unable to load ArrayDatatype accelerator from OpenGL_accelerate
2013-07-11 19:31:25,825 Unable to load converters accelerators (wrapper, arraydatatype) from OpenGL_accelerate
2013-07-11 19:31:25,829 Unable to load arrayhelpers accelerator from OpenGL_accelerate
2013-07-11 19:31:25,840 Unable to load nones_formathandler accelerator from OpenGL_accelerate
2013-07-11 19:31:26,773 Unable to load numpy_formathandler accelerator from OpenGL_accelerate
2013-07-11 19:31:26,972 OpenGL Version: 2.1 APPLE
2013-07-11 19:31:27,089 GL Extension GL_ARB_shader_objects available
2013-07-11 19:31:27,109 GL Extension GL_ARB_vertex_array_object unavailable
2013-07-11 19:31:27,112 GL Extension GL_ARB_texture_buffer_object unavailable
2013-07-11 19:31:27,115 GL Extension GL_ARB_framebuffer_object available
2013-07-11 19:31:27,122 GL Extension GL_ARB_map_buffer_range unavailable
2013-07-11 19:31:27,126 GL Extension GL_ARB_copy_buffer unavailable
2013-07-11 19:31:27,128 GL Extension GL_ARB_uniform_buffer_object unavailable
2013-07-11 19:31:27,132 GL Extension GL_ARB_draw_elements_base_vertex unavailable
2013-07-11 19:31:27,134 GL Extension GL_ARB_provoking_vertex unavailable
2013-07-11 19:31:27,137 GL Extension GL_ARB_sync unavailable
2013-07-11 19:31:27,140 GL Extension GL_ARB_texture_multisample unavailable
2013-07-11 19:31:27,144 GL Extension GL_ARB_blend_func_extended unavailable
2013-07-11 19:31:27,146 GL Extension GL_ARB_sampler_objects unavailable
2013-07-11 19:31:27,158 GL Extension GL_ARB_timer_query unavailable
2013-07-11 19:31:27,160 GL Extension GL_ARB_vertex_type_2_10_10_10_rev unavailable
2013-07-11 19:31:27,168 GL Extension GL_ARB_draw_indirect unavailable
2013-07-11 19:31:27,173 GL Extension GL_ARB_gpu_shader_fp64 unavailable
2013-07-11 19:31:27,176 GL Extension GL_ARB_shader_subroutine unavailable
2013-07-11 19:31:27,180 GL Extension GL_ARB_tessellation_shader unavailable
2013-07-11 19:31:27,187 GL Extension GL_ARB_transform_feedback2 unavailable
2013-07-11 19:31:27,190 GL Extension GL_ARB_transform_feedback3 unavailable
2013-07-11 19:31:27,194 GL Extension GL_ARB_ES2_compatibility unavailable
2013-07-11 19:31:27,196 GL Extension GL_ARB_get_program_binary unavailable
2013-07-11 19:31:27,199 GL Extension GL_ARB_separate_shader_objects unavailable
2013-07-11 19:31:27,206 GL Extension GL_ARB_vertex_attrib_64bit unavailable
2013-07-11 19:31:27,210 GL Extension GL_ARB_viewport_array unavailable
2013-07-11 19:31:27,213 GL Extension GL_ARB_base_instance unavailable
2013-07-11 19:31:27,217 GL Extension GL_ARB_transform_feedback_instanced unavailable
2013-07-11 19:31:27,222 GL Extension GL_ARB_internalformat_query unavailable
2013-07-11 19:31:27,227 GL Extension GL_ARB_shader_atomic_counters unavailable
2013-07-11 19:31:27,230 GL Extension GL_ARB_shader_image_load_store unavailable
2013-07-11 19:31:27,234 GL Extension GL_ARB_texture_storage unavailable
2013-07-11 19:31:27,243 GL Extension GL_ARB_clear_buffer_object unavailable
2013-07-11 19:31:27,245 GL Extension GL_ARB_compute_shader unavailable
2013-07-11 19:31:27,248 GL Extension GL_ARB_copy_image unavailable
2013-07-11 19:31:27,331 GL Extension GL_KHR_debug unavailable
2013-07-11 19:31:27,338 GL Extension GL_ARB_framebuffer_no_attachments unavailable
2013-07-11 19:31:27,343 GL Extension GL_ARB_internalformat_query2 unavailable
2013-07-11 19:31:27,345 GL Extension GL_ARB_invalidate_subdata unavailable
2013-07-11 19:31:27,347 GL Extension GL_ARB_multi_draw_indirect unavailable
2013-07-11 19:31:27,350 GL Extension GL_ARB_program_interface_query unavailable
2013-07-11 19:31:27,354 GL Extension GL_ARB_shader_storage_buffer_object unavailable
2013-07-11 19:31:27,358 GL Extension GL_ARB_texture_buffer_range unavailable
2013-07-11 19:31:27,362 GL Extension GL_ARB_texture_storage_multisample unavailable
2013-07-11 19:31:27,365 GL Extension GL_ARB_texture_view unavailable
2013-07-11 19:31:27,366 GL Extension GL_ARB_vertex_attrib_binding unavailable
2013-07-11 19:31:27,410 GL Extension GL_ARB_fragment_program available
2013-07-11 19:31:27,412 GL Extension GL_ARB_texture_rectangle available
2013-07-11 19:31:27,416 GL Extension GL_ARB_vertex_program available
2013-07-11 19:31:28,069 Attached to tcp:10.0.32.196:1201 (press Control-C to detach)

From the x264 encoding client logs posted in #379:
2013-07-15 12:33:40,460 All the required OpenGL functions are available: glGenProgramsARB, glDeleteProgramsARB, glBindProgramARB, glProgramStringARB

So yes, looks like required OpenGL functions are available.

Complete loading logs:

** Message: pygobject_register_sinkfunc is deprecated (GstObject)
xpra client version 0.10.0
2013-07-15 12:33:39,855 found rencode version 1.0.2
2013-07-15 12:33:39,868 importing ('Keyboard',) from xpra.platform.darwin.keyboard (required=True)
2013-07-15 12:33:39,869 Keyboard=<class 'xpra.platform.darwin.keyboard.Keyboard'>
2013-07-15 12:33:39,876 importing ('do_init', 'make_tray_menu', 'make_native_tray', 'system_bell') from xpra.platform.darwin.gui (required=False)
2013-07-15 12:33:39,888 do_init=<function do_init at 0x3fb07b0>
2013-07-15 12:33:39,888 make_tray_menu=<function make_tray_menu at 0x3fb07f0>
2013-07-15 12:33:39,888 make_native_tray=<function make_native_tray at 0x3fb0830>
2013-07-15 12:33:39,888 system_bell=<function system_bell at 0x3fb0870>
2013-07-15 12:33:39,891 cyxor loaded
2013-07-15 12:33:39,904 get_core_encodings() encs=((True, ['vpx']), (True, ['x264']), (True, ['webp']), (True, ['png', 'png/L', 'png/P', 'jpeg']))
2013-07-15 12:33:39,905 get_core_encodings() encs=((True, ['vpx']), (True, ['x264']), (True, ['webp']), (True, ['png', 'png/L', 'png/P', 'jpeg']))
2013-07-15 12:33:39,907 setup_connection(SocketConnection(('10.0.11.78', 52851) - ('10.0.32.196', 1200)))

** (Xpra:2188): WARNING **: Trying to register gtype '(null)' as flags when in fact it is of type '(null)'

** (Xpra:2188): WARNING **: Trying to register gtype 'glong' as enum when in fact it is of type 'glong'

** (Xpra:2188): WARNING **: Trying to register gtype '(null)' as flags when in fact it is of type '(null)'

** (Xpra:2188): WARNING **: Trying to register gtype '(null)' as enum when in fact it is of type '(null)'
2013-07-15 12:33:39,914 pygdkglext version=(1, 1, 0)
2013-07-15 12:33:39,914 pygdkglext OpenGL version=(1, 0)
2013-07-15 12:33:39,920 using display mode: ['SINGLE']
2013-07-15 12:33:39,951 OpenGL_accelerate module loaded
2013-07-15 12:33:39,956 Using accelerated ArrayDatatype
2013-07-15 12:33:40,212 OpenGL Version: 2.1 APPLE
2013-07-15 12:33:40,300 GL Extension GL_ARB_shader_objects available
2013-07-15 12:33:40,314 GL Extension GL_ARB_vertex_array_object unavailable
2013-07-15 12:33:40,316 GL Extension GL_ARB_texture_buffer_object unavailable
2013-07-15 12:33:40,318 GL Extension GL_ARB_framebuffer_object available
2013-07-15 12:33:40,323 GL Extension GL_ARB_map_buffer_range unavailable
2013-07-15 12:33:40,326 GL Extension GL_ARB_copy_buffer unavailable
2013-07-15 12:33:40,327 GL Extension GL_ARB_uniform_buffer_object unavailable
2013-07-15 12:33:40,330 GL Extension GL_ARB_draw_elements_base_vertex unavailable
2013-07-15 12:33:40,331 GL Extension GL_ARB_provoking_vertex unavailable
2013-07-15 12:33:40,332 GL Extension GL_ARB_sync unavailable
2013-07-15 12:33:40,334 GL Extension GL_ARB_texture_multisample unavailable
2013-07-15 12:33:40,336 GL Extension GL_ARB_blend_func_extended unavailable
2013-07-15 12:33:40,337 GL Extension GL_ARB_sampler_objects unavailable
2013-07-15 12:33:40,342 GL Extension GL_ARB_timer_query unavailable
2013-07-15 12:33:40,343 GL Extension GL_ARB_vertex_type_2_10_10_10_rev unavailable
2013-07-15 12:33:40,349 GL Extension GL_ARB_draw_indirect unavailable
2013-07-15 12:33:40,350 GL Extension GL_ARB_gpu_shader_fp64 unavailable
2013-07-15 12:33:40,353 GL Extension GL_ARB_shader_subroutine unavailable
2013-07-15 12:33:40,355 GL Extension GL_ARB_tessellation_shader unavailable
2013-07-15 12:33:40,358 GL Extension GL_ARB_transform_feedback2 unavailable
2013-07-15 12:33:40,360 GL Extension GL_ARB_transform_feedback3 unavailable
2013-07-15 12:33:40,361 GL Extension GL_ARB_ES2_compatibility unavailable
2013-07-15 12:33:40,363 GL Extension GL_ARB_get_program_binary unavailable
2013-07-15 12:33:40,364 GL Extension GL_ARB_separate_shader_objects unavailable
2013-07-15 12:33:40,371 GL Extension GL_ARB_vertex_attrib_64bit unavailable
2013-07-15 12:33:40,372 GL Extension GL_ARB_viewport_array unavailable
2013-07-15 12:33:40,374 GL Extension GL_ARB_base_instance unavailable
2013-07-15 12:33:40,376 GL Extension GL_ARB_transform_feedback_instanced unavailable
2013-07-15 12:33:40,378 GL Extension GL_ARB_internalformat_query unavailable
2013-07-15 12:33:40,380 GL Extension GL_ARB_shader_atomic_counters unavailable
2013-07-15 12:33:40,382 GL Extension GL_ARB_shader_image_load_store unavailable
2013-07-15 12:33:40,384 GL Extension GL_ARB_texture_storage unavailable
2013-07-15 12:33:40,388 GL Extension GL_ARB_clear_buffer_object unavailable
2013-07-15 12:33:40,389 GL Extension GL_ARB_compute_shader unavailable
2013-07-15 12:33:40,390 GL Extension GL_ARB_copy_image unavailable
2013-07-15 12:33:40,393 GL Extension GL_KHR_debug unavailable
2013-07-15 12:33:40,396 GL Extension GL_ARB_framebuffer_no_attachments unavailable
2013-07-15 12:33:40,398 GL Extension GL_ARB_internalformat_query2 unavailable
2013-07-15 12:33:40,399 GL Extension GL_ARB_invalidate_subdata unavailable
2013-07-15 12:33:40,400 GL Extension GL_ARB_multi_draw_indirect unavailable
2013-07-15 12:33:40,402 GL Extension GL_ARB_program_interface_query unavailable
2013-07-15 12:33:40,404 GL Extension GL_ARB_shader_storage_buffer_object unavailable
2013-07-15 12:33:40,406 GL Extension GL_ARB_texture_buffer_range unavailable
2013-07-15 12:33:40,407 GL Extension GL_ARB_texture_storage_multisample unavailable
2013-07-15 12:33:40,409 GL Extension GL_ARB_texture_view unavailable
2013-07-15 12:33:40,410 GL Extension GL_ARB_vertex_attrib_binding unavailable
2013-07-15 12:33:40,411 found valid OpenGL version: 2.1
2013-07-15 12:33:40,411 OpenGL extensions found: GL_ARB_transpose_matrix, GL_ARB_vertex_program, GL_ARB_vertex_blend, GL_ARB_window_pos, GL_ARB_shader_objects, GL_ARB_vertex_shader, GL_ARB_shading_language_100, GL_EXT_multi_draw_arrays, GL_EXT_clip_volume_hint, GL_EXT_rescale_normal, GL_EXT_draw_range_elements, GL_EXT_fog_coord, GL_EXT_gpu_program_parameters, GL_EXT_geometry_shader4, GL_EXT_transform_feedback, GL_APPLE_client_storage, GL_APPLE_specular_vector, GL_APPLE_transform_hint, GL_APPLE_packed_pixels, GL_APPLE_fence, GL_APPLE_vertex_array_object, GL_APPLE_vertex_program_evaluators, GL_APPLE_element_array, GL_APPLE_flush_render, GL_APPLE_aux_depth_stencil, GL_NV_texgen_reflection, GL_NV_light_max_exponent, GL_IBM_rasterpos_clip, GL_SGIS_generate_mipmap, GL_ARB_imaging, GL_ARB_point_parameters, GL_ARB_texture_env_crossbar, GL_ARB_texture_border_clamp, GL_ARB_multitexture, GL_ARB_texture_env_add, GL_ARB_texture_cube_map, GL_ARB_texture_env_dot3, GL_ARB_multisample, GL_ARB_texture_env_combine, GL_ARB_texture_compression, GL_ARB_texture_mirrored_repeat, GL_ARB_shadow, GL_ARB_depth_texture, GL_ARB_shadow_ambient, GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, GL_ARB_fragment_shader, GL_ARB_occlusion_query, GL_ARB_point_sprite, GL_ARB_texture_non_power_of_two, GL_ARB_vertex_buffer_object, GL_ARB_pixel_buffer_object, GL_ARB_draw_buffers, GL_ARB_shader_texture_lod, GL_ARB_color_buffer_float, GL_ARB_half_float_vertex, GL_ARB_texture_rg, GL_ARB_texture_compression_rgtc, GL_ARB_framebuffer_object, GL_EXT_draw_buffers2, GL_EXT_framebuffer_object, GL_EXT_framebuffer_blit, GL_EXT_texture_rectangle, GL_ARB_texture_rectangle, GL_EXT_texture_env_add, GL_EXT_blend_color, GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_texture_lod_bias, GL_EXT_abgr, GL_EXT_bgra, GL_EXT_stencil_wrap, GL_EXT_texture_filter_anisotropic, GL_EXT_separate_specular_color, GL_EXT_secondary_color, GL_EXT_blend_func_separate, GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_texture_compression_s3tc, GL_EXT_texture_compression_dxt1, GL_EXT_texture_sRGB, GL_EXT_blend_equation_separate, GL_EXT_texture_mirror_clamp, GL_EXT_bindable_uniform, GL_EXT_texture_integer, GL_EXT_gpu_shader4, GL_EXT_framebuffer_sRGB, GL_EXT_provoking_vertex, GL_APPLE_flush_buffer_range, GL_APPLE_ycbcr_422, GL_APPLE_rgb_422, GL_APPLE_float_pixels, GL_ATI_texture_float, GL_ARB_texture_float, GL_ARB_half_float_pixel, GL_APPLE_pixel_buffer, GL_NV_blend_square, GL_NV_fog_distance, GL_NV_conditional_render, GL_ATI_texture_mirror_once, GL_ATI_texture_env_combine3, GL_ATI_separate_stencil, GL_ATI_texture_compression_3dc, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod, GL_EXT_texture_array, GL_EXT_vertex_array_bgra, GL_ARB_instanced_arrays, GL_EXT_packed_float, GL_EXT_texture_shared_exponent, 
2013-07-15 12:33:40,412 vendor: Apple Computer, Inc.
2013-07-15 12:33:40,412 renderer: Apple Software Renderer
2013-07-15 12:33:40,412 shading language version: 1.20
2013-07-15 12:33:40,442 GLU extensions: 
2013-07-15 12:33:40,442 GLU version: 1.3 MacOSX
2013-07-15 12:33:40,442 All the required OpenGL functions are available: glActiveTexture, glTexSubImage2D, glTexCoord2i, glViewport, glMatrixMode, glLoadIdentity, glOrtho, glEnableClientState, glGenTextures, glDisable, glBindTexture, glPixelStorei, glEnable, glBegin, glFlush, glTexParameteri, glTexImage2D, glMultiTexCoord2i, glVertex2i, glEnd 
2013-07-15 12:33:40,442 All the required OpenGL functions are available: GL_FRAMEBUFFER (36160), GL_COLOR_ATTACHMENT0 (36064), glGenFramebuffers, glBindFramebuffer, glFramebufferTexture2D 
2013-07-15 12:33:40,442 Extension GL_ARB_texture_rectangle is present
2013-07-15 12:33:40,442 Extension GL_ARB_vertex_program is present
2013-07-15 12:33:40,443 GL Extension GL_ARB_fragment_program available
2013-07-15 12:33:40,444 glInitFragmentProgramARB works
2013-07-15 12:33:40,444 GL Extension GL_ARB_texture_rectangle available
2013-07-15 12:33:40,445 glInitTextureRectangleARB works
2013-07-15 12:33:40,447 GL Extension GL_ARB_vertex_program available
2013-07-15 12:33:40,460 All the required OpenGL functions are available: glGenProgramsARB, glDeleteProgramsARB, glBindProgramARB, glProgramStringARB 

comment:16 Changed 6 years ago by Antoine Martin

Hah, yes, until I restore the tray here are 2 ways:

  • looking in the client log:
    grep make_new_backing client-debug.log
    
  • using xpra info (gl has more limited csc):
    xpra info | grep -i csc
    

Which should look like this with OpenGL:

client.encoding.csc_modes=('YUV420P', 'YUV422P', 'YUV444P', 'BGRA', 'BGRX')
window[1].client.csc_modes=('YUV420P', 'YUV422P', 'YUV444P')

Whereas a regular window backing will also support BGR modes.

comment:17 Changed 6 years ago by Antoine Martin

Resolution: fixed
Status: newclosed

I see from the client logs in #379 that opengl is enabled on a real mac and works ok:

pygdkglext version=(1, 1, 0)
pygdkglext OpenGL version=(1, 0)
using display mode: ['SINGLE']
OpenGL_accelerate module loaded
Using accelerated ArrayDatatype
OpenGL Version: 2.1 APPLE
(...)
vendor: Apple Computer, Inc.
renderer: Apple Software Renderer
shading language version: 1.20
GLU extensions: 
GLU version: 1.3 MacOSX
(...)
Texture size GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB=16384
(...)

Then for each window:

GL Pixmap backing size: 499 x 316, drawable=\
    <gtk.gdk.GLWindowImplQuartz object at 0x17596328 (GdkGLWindowImplQuartz at 0xa13c80)>
(...)
present_fbo() drawable=\
    <gtk.gdk.GLWindowImplQuartz object at 0x17596490 (GdkGLWindowImplQuartz at 0xa13c80)>

comment:18 Changed 6 years ago by Antoine Martin

For building on 10.6... (hang on to your seats, it's even uglier than above - yes it's possible)

How I ended up doing it:

  • Note the small changes specific to 10.6 in comment:5 (changes to -framework list)
  • use the distutils route to get the shared object files to be linked properly (otherwise all the symbols got missing when using autoconf ..)
  • when the install step fails because of the really old version requirements... use rsync to install "by hand":
    rsync -rpvlgto \
       build/lib.macosx-10.6-i386-2.7/gtk/* \
       ~/gtk/inst/lib/python2.7/site-packages/gtk-2.0/gtk/
    

And then we get a runtime crash:

(gdb) bt
#0  0x00487f57 in g_type_name () from /Users/spikesdev/gtk/inst/lib/libgobject-2.0.0.dylib
#1  0x006d942d in pyg_flags_add () from /Users/spikesdev/gtk/inst/lib/python2.7/site-packages/gobject/_gobject.so
#2  0x01fd7080 in pygdkglext_add_constants () from /Users/spikesdev/gtk/inst/lib/python2.7/site-packages/gtk-2.0/gtk/gdkgl/_gdkgl.so
#3  0x01fd5829 in init_gdkgl () at gtk/gdkgl/gdkglmodule.c:109
#4  0x000e154e in _PyImport_LoadDynamicModule (name=0x2814600 "gtk.gdkgl._gdkgl", 

Ugly, ugly.
We can comment out the call to add_constants and re-add the constants to the module using the hack from comment:10
Build again, install again.

Then it seems to work in as much as the module loads without crashing.

comment:19 Changed 5 years ago by Antoine Martin

Update: this is being moved to #533, which now includes all-in-one patches for both packages. See also ticket:563#comment:14

Last edited 5 years ago by Antoine Martin (previous) (diff)

Changed 5 years ago by Antoine Martin

Attachment: pygtkglext-osx-v2.patch added

updated patch which allows us to build from git source with latest jhbuild

Changed 5 years ago by Antoine Martin

Attachment: gtkglext-osx.patch added

minimal patch for gtkglext

Changed 5 years ago by Antoine Martin

Attachment: pygtkglext-osx-v3.patch added

correct patch, which allows gtkgl to load on all machines and not just the one I build on

Changed 5 years ago by Antoine Martin

somehow this got missed because the file isn't tracked by git, ugly way of fixing things

Changed 5 years ago by Antoine Martin

Attachment: pygtkglext-osx-v4.patch added

updated patch for building against current git for both gtkglext and pygtkglext

Note: See TracTickets for help on using tickets.