Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

x.plot crashes with OpenGL2 error (X server in XDMCP mode) #393

Open
jypeter opened this issue Mar 13, 2019 · 5 comments
Open

x.plot crashes with OpenGL2 error (X server in XDMCP mode) #393

jypeter opened this issue Mar 13, 2019 · 5 comments

Comments

@jypeter
Copy link
Member

jypeter commented Mar 13, 2019

@doutriaux1 First test of vcs in 8.1 and I get a crash

My setup

Windows 7 machine, running VcXsrv X server in XDMCP mode

I have unselected "Native opengl" because otherwise my X server crashes if I try to execute "glxgears" (event with LIBGL_ALWAYS_INDIRECT=1)

glxinfo in a terminal on my server (when running VcXsrv+XDMCP) gives me the following output

direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, 
    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_visual_info, GLX_EXT_visual_rating, 
    GLX_MESA_copy_sub_buffer, GLX_OML_swap_method, GLX_SGIS_multisample, 
    GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, GLX_SGIX_visual_select_group, 
    GLX_SGI_make_current_read
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4

Extended renderer info (GLX_MESA_query_renderer):
    Vendor: VMware, Inc. (0xffffffff)
    Device: llvmpipe (LLVM 6.0, 128 bits) (0xffffffff)
    Version: 18.0.5
    Accelerated: no
    Video memory: 48128MB
    Unified memory: no
    Preferred profile: compat (0x2)
    Max core profile version: 0.0
    Max compat profile version: 2.1
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 2.0
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: llvmpipe (LLVM 6.0, 128 bits)
OpenGL version string: 2.1 Mesa 18.0.5
OpenGL shading language version string: 1.30

jypeter@obelix2 - ...jypeter - 40 >glxgears -info
GL_RENDERER   = llvmpipe (LLVM 6.0, 128 bits)
GL_VERSION    = 2.1 Mesa 18.0.5
GL_VENDOR     = VMware, Inc.

My test

Now, I get the following when trying my simple vcs test

(cdatm_py2) jypeter@obelix2 - ...jypeter - 45 >python
Python 2.7.15 | packaged by conda-forge | (default, Feb 28 2019, 04:00:11) 
[GCC 7.3.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as np, vcs
>>> id100 = np.identity(100)
>>> x = vcs.init()
>>> x.plot(id100)
ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 761
vtkXOpenGLRenderWindow (0x558edc7db1d0): Unable to find a valid OpenGL 3.2 or later implementation. Please update your video card driver to the latest version. If you are using Mesa please make sure you have version 11.2 or later and make sure your driver in Mesa supports OpenGL 3.2 such as llvmpipe or openswr. If you are on windows and using Microsoft remote desktop note that it only supports OpenGL 3.2 with nvidia quadro cards. You can use other remoting software such as nomachine to avoid this issue.

ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 446
vtkShaderProgram (0x558edd82cd50): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #endif // GL_ES
7: #define attribute in
8: #define varying out
9: 
10: #define haveColors
11: in vec2 vertexMC;
12: uniform mat4 WCDCMatrix;
13: uniform mat4 MCWCMatrix;
14: #ifdef haveColors
15: in vec4 vertexScalar;
16: out vec4 vertexColor;
17: #endif
18: #ifdef haveTCoords
19: in vec2 tcoordMC;
20: out vec2 tcoord;
21: #endif
22: #ifdef haveLines
23: in vec2 tcoordMC;
24: out float ldistance;
25: #endif
26: void main() {
27: #ifdef haveColors
28: vertexColor = vertexScalar;
29: #endif
30: #ifdef haveTCoords
31: tcoord = tcoordMC;
32: #endif
33: #ifdef haveLines
34: ldistance = tcoordMC.x;
35: #endif
36: vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);
37: gl_Position = vertex*MCWCMatrix*WCDCMatrix; }


ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 447
vtkShaderProgram (0x558edd82cd50): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES


terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Abort (core dumped)

I have the following rpm installed on the server

 >rpm -qa | \grep -i mesa
mesa-dri-drivers-18.0.5-4.el7_6.x86_64
mesa-libGLw-8.0.0-4.el7.x86_64
mesa-libgbm-18.0.5-4.el7_6.x86_64
mesa-libEGL-devel-18.0.5-4.el7_6.x86_64
mesa-libGLU-devel-9.0.0-4.el7.x86_64
mesa-libGLU-9.0.0-4.el7.x86_64
mesa-libGL-18.0.5-4.el7_6.x86_64
mesa-filesystem-18.0.5-4.el7_6.x86_64
mesa-libxatracker-18.0.5-4.el7_6.x86_64
mesa-libEGL-18.0.5-4.el7_6.x86_64
mesa-libGLES-18.0.5-4.el7_6.x86_64
mesa-private-llvm-3.9.1-3.el7.x86_64
mesa-libGLw-devel-8.0.0-4.el7.x86_64
mesa-libglapi-18.0.5-4.el7_6.x86_64
mesa-libGL-devel-18.0.5-4.el7_6.x86_64
@jypeter
Copy link
Member Author

jypeter commented Mar 13, 2019

Now, from the same VcXsrv+XDMCP, if I ssh to a remote server where I have also installed CDAT 8.1, I get a slightly different error

glxinfo gives me the following output

direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.4
server glx extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, GLX_ARB_multisample, 
    GLX_EXT_create_context_es_profile, GLX_EXT_create_context_es2_profile, 
    GLX_EXT_fbconfig_packed_float, GLX_EXT_framebuffer_sRGB, 
    GLX_EXT_import_context, GLX_EXT_visual_info, GLX_EXT_visual_rating, 
    GLX_MESA_copy_sub_buffer, GLX_OML_swap_method, GLX_SGI_make_current_read, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4

GLX version: 1.4
GLX extensions:
    GLX_ARB_create_context, GLX_ARB_create_context_profile, 
    GLX_ARB_fbconfig_float, GLX_ARB_framebuffer_sRGB, 
    GLX_ARB_get_proc_address, GLX_ARB_multisample, GLX_EXT_import_context, 
    GLX_EXT_visual_info, GLX_EXT_visual_rating, GLX_EXT_fbconfig_packed_float, 
    GLX_EXT_framebuffer_sRGB, GLX_EXT_create_context_es2_profile, 
    GLX_MESA_copy_sub_buffer, GLX_MESA_multithread_makecurrent, 
    GLX_MESA_query_renderer, GLX_OML_swap_method, GLX_SGI_make_current_read, 
    GLX_SGIS_multisample, GLX_SGIX_fbconfig, GLX_SGIX_pbuffer, 
    GLX_SGIX_visual_select_group
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.6, 128 bits)
OpenGL version string: 2.1 Mesa 11.0.7
OpenGL shading language version string: 1.30

And when I run the same vcs test as above, I end up with a LOT of error output (I have just pasted part of the end below, anyway I can't scroll to the beginning, there is too much output), and a blank/empty canvas. I'm back at the python prompt, no crash like the previous test

ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 447
vtkShaderProgram (0x55e1261b8a80): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES


ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 2115
vtkXOpenGLRenderWindow (0x55e12507da00): Hardware does not support the number of textures defined.

ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 2115
vtkXOpenGLRenderWindow (0x55e12507da00): Hardware does not support the number of textures defined.

ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 2115
vtkXOpenGLRenderWindow (0x55e12507da00): Hardware does not support the number of textures defined.

ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 446
vtkShaderProgram (0x55e1261b8a80): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #endif // GL_ES
7: #define attribute in
8: #define varying out
9: 
10: #define haveTCoords
11: in vec2 vertexMC;
12: uniform mat4 WCDCMatrix;
13: uniform mat4 MCWCMatrix;
14: #ifdef haveColors
15: in vec4 vertexScalar;
16: out vec4 vertexColor;
17: #endif
18: #ifdef haveTCoords
19: in vec2 tcoordMC;
20: out vec2 tcoord;
21: #endif
22: #ifdef haveLines
23: in vec2 tcoordMC;
24: out float ldistance;
25: #endif
26: void main() {
27: #ifdef haveColors
28: vertexColor = vertexScalar;
29: #endif
30: #ifdef haveTCoords
31: tcoord = tcoordMC;
32: #endif
33: #ifdef haveLines
34: ldistance = tcoordMC.x;
35: #endif
36: vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);
37: gl_Position = vertex*MCWCMatrix*WCDCMatrix; }


ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 447
vtkShaderProgram (0x55e1261b8a80): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES


ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 2115
vtkXOpenGLRenderWindow (0x55e12507da00): Hardware does not support the number of textures defined.

ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 2115
vtkXOpenGLRenderWindow (0x55e12507da00): Hardware does not support the number of textures defined.

ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 2115
vtkXOpenGLRenderWindow (0x55e12507da00): Hardware does not support the number of textures defined.

ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 446
vtkShaderProgram (0x55e1261b8a80): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #endif // GL_ES
7: #define attribute in
8: #define varying out
9: 
10: #define haveTCoords
11: in vec2 vertexMC;
12: uniform mat4 WCDCMatrix;
13: uniform mat4 MCWCMatrix;
14: #ifdef haveColors
15: in vec4 vertexScalar;
16: out vec4 vertexColor;
17: #endif
18: #ifdef haveTCoords
19: in vec2 tcoordMC;
20: out vec2 tcoord;
21: #endif
22: #ifdef haveLines
23: in vec2 tcoordMC;
24: out float ldistance;
25: #endif
26: void main() {
27: #ifdef haveColors
28: vertexColor = vertexScalar;
29: #endif
30: #ifdef haveTCoords
31: tcoord = tcoordMC;
32: #endif
33: #ifdef haveLines
34: ldistance = tcoordMC.x;
35: #endif
36: vec4 vertex = vec4(vertexMC.xy, 0.0, 1.0);
37: gl_Position = vertex*MCWCMatrix*WCDCMatrix; }


ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 447
vtkShaderProgram (0x55e1261b8a80): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES


<vcs.displayplot.Dp object at 0x7f3ec0a36cf8>
>>> 

x.png generates another load of errors and I'm back at the prompt

x.interact() generates other errors, below (especially when I move the cursor over the canvas), but "q" gets me back to the prompt

ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 2115
vtkXOpenGLRenderWindow (0x55e12507da00): Hardware does not support the number of textures defined.

ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 446
vtkShaderProgram (0x55e1262facc0): 1: #version 150
2: #ifndef GL_ES
3: #define highp
4: #define mediump
5: #define lowp
6: #endif // GL_ES
7: #define attribute in
8: #define varying out
9: 
10: 
11: /*=========================================================================
12: 
13:   Program:   Visualization Toolkit
14:   Module:    vtkPolyData2DVS.glsl
15: 
16:   Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen
17:   All rights reserved.
18:   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
19: 
20:      This software is distributed WITHOUT ANY WARRANTY; without even
21:      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
22:      PURPOSE.  See the above copyright notice for more information.
23: 
24: =========================================================================*/
25: 
26: // all variables that represent positions or directions have a suffix
27: // indicating the coordinate system they are in. The possible values are
28: // MC - Model Coordinates
29: // WC - WC world coordinates
30: // VC - View Coordinates
31: // DC - Display Coordinates
32: 
33: in vec4 vertexWC;
34: 
35: // material property values
36: //VTK::Color::Dec
37: 
38: // Texture coordinates
39: in vec2 tcoordMC; out vec2 tcoordVCVSOutput;
40: 
41: // Apple Bug
42: //VTK::PrimID::Dec
43: 
44: uniform mat4 WCVCMatrix;  // World to view matrix
45: 
46: void main()
47: {
48:   // Apple Bug
49:   //VTK::PrimID::Impl
50: 
51:   gl_Position = WCVCMatrix*vertexWC;
52:   tcoordVCVSOutput = tcoordMC;
53:   //VTK::Color::Impl
54: }


ERROR: In ../Rendering/OpenGL2/vtkShaderProgram.cxx, line 447
vtkShaderProgram (0x55e1262facc0): 0:1(10): error: GLSL 1.50 is not supported. Supported versions are: 1.10, 1.20, 1.30, 1.00 ES, and 3.00 ES

The following mesa libs are installed on this server

$ rpm -qa |grep -i mesa
mesa-libOSMesa-11.0.7-4.el6.x86_64
mesa-libGLw-6.5.1-10.el6.x86_64
mesa-dri-drivers-11.0.7-4.el6.x86_64
mesa-libgbm-11.0.7-4.el6.x86_64
mesa-libGLw-devel-6.5.1-10.el6.x86_64
mesa-libGL-11.0.7-4.el6.x86_64
mesa-libGLU-11.0.7-4.el6.x86_64
mesa-dri-filesystem-11.0.7-4.el6.x86_64
mesa-libGL-devel-11.0.7-4.el6.x86_64
mesa-private-llvm-3.6.2-1.el6.x86_64
mesa-libGLU-devel-11.0.7-4.el6.x86_64
mesa-dri1-drivers-7.11-8.el6.x86_64
mesa-libxatracker-11.0.7-4.el6.x86_64
mesa-libEGL-11.0.7-4.el6.x86_64

@doutriaux1
Copy link
Contributor

@scottwittenburg @danlipsa looks like yet another case of older X server. @jypeter I think the switch to OenGL2 essentially made it incompatible with older X server... I think you will have to use the mesalib version here and ask users to first dump to a png. Other options are to upgrade your X server. Is that correct @danlipsa @scottwittenburg

@jypeter
Copy link
Member Author

jypeter commented Mar 13, 2019

I have tried in a remote notebook (on the remote server mentioned just above), and it's not working either, but I have to go

/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
[W 18:51:29.992 NotebookApp] Replacing stale connection: aebc499f-4a49-42e8-beac-f312c378824b:510b591f4f3544188f929d97ec830408
[I 18:51:31.078 NotebookApp] Adapting to protocol v5.1 for kernel aebc499f-4a49-42e8-beac-f312c378824b
[I 18:51:31.085 NotebookApp] Starting buffering for aebc499f-4a49-42e8-beac-f312c378824b:510b591f4f3544188f929d97ec830408
[I 18:51:31.096 NotebookApp] Adapting to protocol v5.1 for kernel aebc499f-4a49-42e8-beac-f312c378824b
[I 18:51:31.097 NotebookApp] Restoring connection for aebc499f-4a49-42e8-beac-f312c378824b:510b591f4f3544188f929d97ec830408
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 761
vtkXOpenGLRenderWindow (0x55edb11f87f0): Unable to find a valid OpenGL 3.2 or later implementation. Please update your video card driver to the latest version. If you are using Mesa please make sure you have version 11.2 or later and make sure your driver in Mesa supports OpenGL 3.2 such as llvmpipe or openswr. If you are on windows and using Microsoft remote desktop note that it only supports OpenGL 3.2 with nvidia quadro cards. You can use other remoting software such as nomachine to avoid this issue.

[I 18:53:07.674 NotebookApp] Saving file at /Notebooks/TP_CliMAF/CMIP6-Analysis-CLIMERI-2018119/Untitled.ipynb
[I 18:53:07.836 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
WARNING:root:kernel aebc499f-4a49-42e8-beac-f312c378824b restarted
/bin/sh: module: line 1: syntax error: unexpected end of file
/bin/sh: error importing function definition for `BASH_FUNC_module'
[I 18:55:07.678 NotebookApp] Saving file at /Notebooks/TP_CliMAF/CMIP6-Analysis-CLIMERI-2018119/Untitled.ipynb

@danlipsa
Copy link
Contributor

The Mesa library seems new enough but for some reason it does not provide OpenGL 3.2 which is needed for this version of VTK. One path to address this kind of problems in the future is to ship our own mesalib even with the on-screen version of vcs and use an option to switch between using the system driver (which in this case does not work) and using the mesa OpenGL that we ship with our software. ParaView already does this. See options at the end of the following blog:

https://blog.kitware.com/messing-with-mesa-for-paraview-5-0vtk-7-0/

@danlipsa
Copy link
Contributor

@doutriaux1 Indeed for now the workaround is to use the offscreen version of vcs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants