Bug #1209

Produce isolated test cases for opengl (with and without various version of qt)

Added by Joel Palmius about 1 year ago. Updated about 1 year ago.

Status:NewStart date:10/24/2017
Priority:NormalDue date:
Assignee:Joel Palmius% Done:

0%

Category:OpenGL
Target version:MakeHuman 1.1.2

Description

I can't get my head around what exactly is the problem in regards to the opengl mess. It seems to me that we're varying to many variables at once, such as:

  • Operating system
  • Hardware
  • Graphics drivers
  • Opengl version
  • Python version
  • Qt version

Combined with the complexity of the makehuman code, this makes it difficult to pin-point the exact cause of the errors.

It would be beneficial if there was a bare minimum of code that could reliably result in a stack trace.

To this end I have created a new repo for opengl test cases at https://github.com/makehumancommunity/gl-test-cases

Everyone who have commit access to the other makehumancommunity repos should also have commit access to this one.


Related issues

Related to MakeHuman - Bug #1061: Debug opengl failure Fix exists, needs testing 09/15/2016

History

#1 Updated by Joel Palmius about 1 year ago

  • Related to Bug #1061: Debug opengl failure added

#2 Updated by Joel Palmius about 1 year ago

The first test case starts opengl and displays a basic cube. Does this crash under the same circumstances that MH crashes on the relevant platforms?

#3 Updated by Aranuvir # about 1 year ago

Good idea...
Here is the result from my system (Windows 7_64, Intel 4800MQ with HD4600, AMD 8900M, Python3.6.3_64, PyQT 5.9, PyOpenGl 3.1.0):

"C:\Program Files\Python36\python.exe" C:/Users/%USERNAME%/PycharmProjects/gl-test-cases/00_does_pyopengl_work_at_all.py
Traceback (most recent call last):
  File "C:/Users/%USERNAME%/PycharmProjects/gl-test-cases/00_does_pyopengl_work_at_all.py", line 157, in <module>
    main()
  File "C:/Users/%USERNAME%/PycharmProjects/gl-test-cases/00_does_pyopengl_work_at_all.py", line 123, in main
    GLUT.glutInit(sys.argv)
  File "C:\Program Files\Python36\lib\site-packages\OpenGL\GLUT\special.py", line 333, in glutInit
    _base_glutInit( ctypes.byref(count), holder )
  File "C:\Program Files\Python36\lib\site-packages\OpenGL\platform\baseplatform.py", line 407, in __call__
    self.__name__, self.__name__,
OpenGL.error.NullFunctionError: Attempt to call an undefined function glutInit, check for bool(glutInit) before calling

Process finished with exit code 1


Obviously one has to download a .dll from some WTF.TDL. That's a showstopper...

#4 Updated by Joel Palmius about 1 year ago

Seeming as we're not using GLUT, I guess the problem is not all that relevant (Regarding GLUT, this is informative https://stackoverflow.com/questions/879035/initializing-opengl-without-glut)

I had hoped to build a test case for opengl that didn't involve Qt, but I guess such tests would need to be written per platform.

I have instead added a new testcase for GL via Qt4. Maybe you can test that? (Assuming you can still get pyqt4 on your platform)

#5 Updated by Joel Palmius about 1 year ago

Copied the pyqt4 test case to make another one for pyside too.

Both these work with py2 and py3 on linux for me. I haven't tested on windows yet.

#6 Updated by Aranuvir # about 1 year ago

OK, I tried your Qt5 test case, which I also haded ported myself before. Both versions work on my system (Windows and Linux!).

#7 Updated by Joel Palmius about 1 year ago

This probably means that we're doing something strange somewhere that is not necessarily pyqt5's fault. Nor the fault of pyopengl.

But this very simple test doesn't really test stuff regarding shaders etc. I'm a bit too noob on all that to formulate more elaborate test cases though.

#8 Updated by Rob Baer about 1 year ago

Tested on MacOSX High Sierra

Test suite 01 failed as follows (python 3; qt4):

python 01_does_opengl_with_pyqt4_work.py

(python34) robs-mbp:gl-test-cases Rob$ python -V
Python 3.4.5 :: Continuum Analytics, Inc.

(python34) robs-mbp:gl-test-cases Rob$ python 01_does_opengl_with_pyqt4_work.py 
Traceback (most recent call last):
  File "01_does_opengl_with_pyqt4_work.py", line 30, in paintGL
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
  File "/Applications/anaconda/envs/python34/lib/python3.4/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
    return self( *args, **named )
  File "errorchecker.pyx", line 53, in OpenGL_accelerate.errorchecker._ErrorChecker.glCheckError (src/errorchecker.c:1218)
OpenGL.error.GLError: GLError(
    err = 1286,
    description = b'invalid framebuffer operation',
    baseOperation = glClear,
    cArguments = (16640,)
)

The environment list


robs-mbp:gl-test-cases Rob$ source activate python34
(python34) robs-mbp:gl-test-cases Rob$ conda list
# packages in environment at /Applications/anaconda/envs/python34:
#
freetype                  2.5.5                         2  
libpng                    1.6.27                        0  
mkl                       2017.0.3                      0  
numpy                     1.11.3                   py34_0  
openssl                   1.0.2l                        0  
pip                       9.0.1                    py34_1  
pyopengl                  3.1.1a1             np111py34_0  
pyopengl-accelerate       3.1.1a1             np111py34_0  
pyqt                      4.11.4                   py34_4  
python                    3.4.5                         0  
qt                        4.8.7                         4  
readline                  6.2                           2  
setuptools                27.2.0                   py34_0  
sip                       4.18                     py34_0  
sqlite                    3.13.0                        0  
tk                        8.5.18                        0  
wheel                     0.29.0                   py34_0  
xz                        5.2.2                         1  
zlib                      1.2.8                         3  

For the record, here is the graphics detail for the tests reported on this Macintosh . in comments 8 (this one) and 9 and 10 below)


(python34) robs-mbp:gl-test-cases Rob$ glxinfo | grep -i "vendor\|rendering" 
direct rendering: Yes
server glx vendor string: SGI
client glx vendor string: Mesa Project and SGI
OpenGL vendor string: NVIDIA Corporation
(python34) robs-mbp:gl-test-cases Rob$ glxinfo
name of display: /private/tmp/com.apple.launchd.HGw9fmf6mp/org.macosforge.xquartz:0
display: /private/tmp/com.apple.launchd.HGw9fmf6mp/org.macosforge.xquartz: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_visual_info, 
    GLX_EXT_visual_rating, GLX_OML_swap_method, GLX_SGIS_multisample, 
    GLX_SGIX_fbconfig
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_create_context_robustness, GLX_ARB_fbconfig_float, 
    GLX_ARB_framebuffer_sRGB, GLX_ARB_get_proc_address, GLX_ARB_multisample, 
    GLX_EXT_buffer_age, GLX_EXT_create_context_es2_profile, 
    GLX_EXT_create_context_es_profile, GLX_EXT_fbconfig_packed_float, 
    GLX_EXT_framebuffer_sRGB, GLX_EXT_import_context, 
    GLX_EXT_texture_from_pixmap, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
    GLX_INTEL_swap_event, GLX_MESA_copy_sub_buffer, 
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_swap_control, GLX_OML_swap_method, GLX_OML_sync_control, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group, GLX_SGI_make_current_read, 
    GLX_SGI_swap_control, GLX_SGI_video_sync
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_multithread_makecurrent, GLX_OML_swap_method, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce GT 650M OpenGL Engine
OpenGL version string: 2.1 NVIDIA-10.24.28 355.11.10.10.10.160
OpenGL shading language version string: 1.20
OpenGL extensions:
    GL_APPLE_aux_depth_stencil, GL_APPLE_client_storage, 
    GL_APPLE_element_array, GL_APPLE_fence, GL_APPLE_float_pixels, 
    GL_APPLE_flush_buffer_range, GL_APPLE_flush_render, 
    GL_APPLE_object_purgeable, GL_APPLE_packed_pixels, GL_APPLE_pixel_buffer, 
    GL_APPLE_rgb_422, GL_APPLE_row_bytes, GL_APPLE_specular_vector, 
    GL_APPLE_texture_range, GL_APPLE_transform_hint, 
    GL_APPLE_vertex_array_object, GL_APPLE_vertex_array_range, 
    GL_APPLE_vertex_point_size, GL_APPLE_vertex_program_evaluators, 
    GL_APPLE_ycbcr_422, GL_ARB_color_buffer_float, GL_ARB_depth_buffer_float, 
    GL_ARB_depth_clamp, GL_ARB_depth_texture, GL_ARB_draw_buffers, 
    GL_ARB_draw_elements_base_vertex, GL_ARB_draw_instanced, 
    GL_ARB_fragment_program, GL_ARB_fragment_program_shadow, 
    GL_ARB_fragment_shader, GL_ARB_framebuffer_object, 
    GL_ARB_framebuffer_sRGB, GL_ARB_half_float_pixel, 
    GL_ARB_half_float_vertex, GL_ARB_imaging, GL_ARB_instanced_arrays, 
    GL_ARB_multisample, GL_ARB_multitexture, GL_ARB_occlusion_query, 
    GL_ARB_pixel_buffer_object, GL_ARB_point_parameters, GL_ARB_point_sprite, 
    GL_ARB_provoking_vertex, GL_ARB_seamless_cube_map, GL_ARB_shader_objects, 
    GL_ARB_shader_texture_lod, GL_ARB_shading_language_100, GL_ARB_shadow, 
    GL_ARB_sync, GL_ARB_texture_border_clamp, GL_ARB_texture_compression, 
    GL_ARB_texture_compression_rgtc, GL_ARB_texture_cube_map, 
    GL_ARB_texture_env_add, GL_ARB_texture_env_combine, 
    GL_ARB_texture_env_crossbar, GL_ARB_texture_env_dot3, 
    GL_ARB_texture_float, GL_ARB_texture_mirrored_repeat, 
    GL_ARB_texture_non_power_of_two, GL_ARB_texture_rectangle, 
    GL_ARB_texture_rg, GL_ARB_transpose_matrix, GL_ARB_vertex_array_bgra, 
    GL_ARB_vertex_blend, GL_ARB_vertex_buffer_object, GL_ARB_vertex_program, 
    GL_ARB_vertex_shader, GL_ARB_window_pos, GL_ATI_separate_stencil, 
    GL_ATI_texture_env_combine3, GL_ATI_texture_float, 
    GL_ATI_texture_mirror_once, GL_EXT_abgr, GL_EXT_bgra, 
    GL_EXT_bindable_uniform, GL_EXT_blend_color, 
    GL_EXT_blend_equation_separate, GL_EXT_blend_func_separate, 
    GL_EXT_blend_minmax, GL_EXT_blend_subtract, GL_EXT_clip_volume_hint, 
    GL_EXT_debug_label, GL_EXT_debug_marker, GL_EXT_depth_bounds_test, 
    GL_EXT_draw_buffers2, GL_EXT_draw_range_elements, GL_EXT_fog_coord, 
    GL_EXT_framebuffer_blit, GL_EXT_framebuffer_multisample, 
    GL_EXT_framebuffer_multisample_blit_scaled, GL_EXT_framebuffer_object, 
    GL_EXT_framebuffer_sRGB, GL_EXT_geometry_shader4, 
    GL_EXT_gpu_program_parameters, GL_EXT_gpu_shader4, 
    GL_EXT_multi_draw_arrays, GL_EXT_packed_depth_stencil, 
    GL_EXT_packed_float, GL_EXT_provoking_vertex, GL_EXT_rescale_normal, 
    GL_EXT_secondary_color, GL_EXT_separate_specular_color, 
    GL_EXT_shadow_funcs, GL_EXT_stencil_two_side, GL_EXT_stencil_wrap, 
    GL_EXT_texture_array, GL_EXT_texture_compression_dxt1, 
    GL_EXT_texture_compression_s3tc, GL_EXT_texture_env_add, 
    GL_EXT_texture_filter_anisotropic, GL_EXT_texture_integer, 
    GL_EXT_texture_lod_bias, GL_EXT_texture_mirror_clamp, 
    GL_EXT_texture_rectangle, GL_EXT_texture_sRGB, GL_EXT_texture_sRGB_decode, 
    GL_EXT_texture_shared_exponent, GL_EXT_timer_query, 
    GL_EXT_transform_feedback, GL_EXT_vertex_array_bgra, 
    GL_IBM_rasterpos_clip, GL_NV_blend_square, GL_NV_conditional_render, 
    GL_NV_depth_clamp, GL_NV_fog_distance, GL_NV_fragment_program2, 
    GL_NV_fragment_program_option, GL_NV_light_max_exponent, 
    GL_NV_multisample_filter_hint, GL_NV_point_sprite, 
    GL_NV_texgen_reflection, GL_NV_texture_barrier, 
    GL_NV_vertex_program2_option, GL_NV_vertex_program3, 
    GL_SGIS_generate_mipmap, GL_SGIS_texture_edge_clamp, GL_SGIS_texture_lod

#9 Updated by Rob Baer about 1 year ago

Tested MacOS High Sierra -- graphic card details comment 8

Python 2.7 with pyside - somehow, the pytside I have seems to be incomplete. pyside fail !!!

TEST: python 02_does_opengl_with_pyside_work.py

The relevant error:
ImportError: dlopen(/Applications/anaconda/envs/python27/lib/python2.7/site-packages/PySide/QtGui.so, 2): Library not loaded: @loader_path/../../../libpyside-python2.7.1.1.dylib
Referenced from: /Applications/anaconda/envs/python27/lib/python2.7/site-packages/PySide/QtGui.so
Reason: image not found

(python27) robs-mbp:gl-test-cases Rob$ python 02_does_opengl_with_pyside_work.py
Traceback (most recent call last):
  File "02_does_opengl_with_pyside_work.py", line 5, in <module>
    from PySide import QtGui
ImportError: dlopen(/Applications/anaconda/envs/python27/lib/python2.7/site-packages/PySide/QtGui.so, 2): Library not loaded: @loader_path/../../../libpyside-python2.7.1.1.dylib
  Referenced from: /Applications/anaconda/envs/python27/lib/python2.7/site-packages/PySide/QtGui.so
  Reason: image not found

Here is the environment:

(python27) robs-mbp:gl-test-cases Rob$ conda list
# packages in environment at /Applications/anaconda/envs/python27:
#
ca-certificates           2017.08.26           ha1e5d58_0  
certifi                   2017.7.27.1      py27h482ffc0_0  
dbus                      1.10.22              h50d9ad6_0  
expat                     2.2.4                h8f26bf8_1  
gettext                   0.19.8.1             hb0f4f8b_2  
glib                      2.53.6               ha08cb78_1  
icu                       58.2                 hea21ae5_0  
intel-openmp              2018.0.0             h68bdfb3_7  
jpeg                      9b                   haccd157_1  
libcxx                    4.0.1                h579ed51_0  
libcxxabi                 4.0.1                hebd6815_0  
libedit                   3.1                  hb4e282d_0  
libffi                    3.2.1                hd939716_3  
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.15                 h99df5da_5  
libpng                    1.6.32               hce72d48_2  
mkl                       2018.0.0             h5ef208c_6  
ncurses                   6.0                  ha932d30_1  
numpy                     1.13.3           py27h62f9060_0  
openssl                   1.0.2l               h492a243_5  
pcre                      8.41                 h29eefc5_0  
pip                       9.0.1            py27h1567d89_4  
pyopengl                  3.1.1a1             np113py27_0  
pyqt                      5.6.0            py27hf21fe59_6  
pyside                    1.1.1                    py27_0  
python                    2.7.14              ha6acbcf_22  
qt                        5.6.2               h9975529_14  
readline                  7.0                  h81b24a6_3  
setuptools                36.5.0           py27h2a45cec_0  
sip                       4.18.1           py27h6300f65_2  
sqlite                    3.20.1               h900c3b0_1  
tk                        8.6.7                hcdce994_1  
wheel                     0.29.0           py27h84bd1c0_1  
zlib                      1.2.11               h60db283_1

#10 Updated by Rob Baer about 1 year ago

MacOSX High Sierra . python 2.7; qt4 . -- graphic card details comment 8

python 01_does_opengl_with_pyqt4_work.py

Notice the similarity to the failure with python 3. It seems the openGL error is reproducible with QT4 in both pythons.


(python27) robs-mbp:gl-test-cases Rob$ python 01_does_opengl_with_pyqt4_work.py 
Traceback (most recent call last):
  File "01_does_opengl_with_pyqt4_work.py", line 30, in paintGL
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT)
  File "/Applications/anaconda/envs/python27/lib/python2.7/site-packages/OpenGL/platform/baseplatform.py", line 402, in __call__
    return self( *args, **named )
  File "/Applications/anaconda/envs/python27/lib/python2.7/site-packages/OpenGL/error.py", line 232, in glCheckError
    baseOperation = baseOperation,
OpenGL.error.GLError: GLError(
    err = 1286,
    description = 'invalid framebuffer operation',
    baseOperation = glClear,
    cArguments = (16640,)
)

For completeness, here is the environment list

(python27) robs-mbp:gl-test-cases Rob$ conda list
# packages in environment at /Applications/anaconda/envs/python27:
#
ca-certificates           2017.08.26           ha1e5d58_0  
certifi                   2017.7.27.1      py27h482ffc0_0  
dbus                      1.10.22              h50d9ad6_0  
expat                     2.2.4                h8f26bf8_1  
freetype                  2.8                  h143eb01_0  
gettext                   0.19.8.1             hb0f4f8b_2  
glib                      2.53.6               ha08cb78_1  
icu                       58.2                 hea21ae5_0  
intel-openmp              2018.0.0             h68bdfb3_7  
jpeg                      9b                   haccd157_1  
libcxx                    4.0.1                h579ed51_0  
libcxxabi                 4.0.1                hebd6815_0  
libedit                   3.1                  hb4e282d_0  
libffi                    3.2.1                hd939716_3  
libgfortran               3.0.1                h93005f0_2  
libiconv                  1.15                 h99df5da_5  
libpng                    1.6.32               hce72d48_2  
mkl                       2018.0.0             h5ef208c_6  
ncurses                   6.0                  ha932d30_1  
numpy                     1.13.3           py27h62f9060_0  
openssl                   1.0.2l               h492a243_5  
pcre                      8.41                 h29eefc5_0  
pip                       9.0.1            py27h1567d89_4  
pyopengl                  3.1.1a1             np113py27_0  
pyqt                      4.11.4                   py27_4  
pyside                    1.1.1                    py27_0  
python                    2.7.14              ha6acbcf_22  
qt                        4.8.7                         4  
readline                  7.0                  h81b24a6_3  
setuptools                36.5.0           py27h2a45cec_0  
sip                       4.18                     py27_0  
sqlite                    3.20.1               h900c3b0_1  
tk                        8.6.7                hcdce994_1  
wheel                     0.29.0           py27h84bd1c0_1  
zlib                      1.2.11               h60db283_1  
(python27) robs-mbp:gl-test-cases Rob$ 

#11 Updated by Rob Baer about 1 year ago

mac OSX . High Sierra - graphics card as in comment 8

python 00_does_pyopengl_work_at_all.py

works with python 2.7, python 3.4, and python 3.6 as expected

python 03_does_opengl_with_pyqt5_work.py

This command produces a nice yellow triangle with python 3.4 AND python 3.6 as well as python 2.7. A real WIN for pyQt5 !

Given Joel's commentary above, I did not notice any "segfault" or other problem on exit. Exit was CLEAN!

ALSO:
The exit button makes this test much nicer than the other !!!! :) . I'm a newb, but I'm having to force quit python for the other tests. Am I missing something?

#12 Updated by Joel Palmius about 1 year ago

Rob Baer wrote:

ALSO:
The exit button makes this test much nicer than the other !!!! :) . I'm a newb, but I'm having to force quit python for the other tests. Am I missing something?

Probably not, no. The tests are very crude and would probably benefit from proper shut down code.

Anyway, for all tests made: please go to https://github.com/makehumancommunity/gl-test-cases and edit the "XX_results" for each test and enter info about what platform you tested on, and what the results were. This way it will be easier to keep track of exactly what was tested and not. You should be able to edit the results.md file directly via the web, but if you want to edit locally and commit, then that works too.

Also available in: Atom