openglpycharmvncmayavimne-python

Using Mayavi mlab over VNC Throws OpenGL error


I'm having some difficulty using Mayavi mlab in python with PyCharm IDE from the MNE-Python environment. I access the Conda environment with Mayavi and VTK over a VNC session using a xvnc server from my local MacOS to a Linux cluster machine.

The error I get when opening a mlab window is:

ERROR: In ../Rendering/OpenGL2/vtkOpenGLRenderWindow.cxx, line 754 
vtkXOpenGLRenderWindow (0x556e13b32670): 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.

It seems that using VirtualGL to intercept PyCharm for VTK's call of OpenGL is one possible solution. Have anyone successfully overcome this issue of using Mayavi mlab over VNC session? What are your solutions?


Solution

  • I am unable to reproduce. Have you made sure that the machine you are accessing has available and loaded up-to-date graphics drivers and/or Mesa software? As an example, I am using TurboVNC to access a remote Ubuntu 18.04 machine, and I am able to produce the Spherical Harmonics Gallery Example both through the regular and envisage Mayavi backends. However, using the default settings of TurboVNC, the rendered scene has artefacts and saving the scene as png yields a black image, which I guess is a consequence of Mesa being used (llvmpipe). If I either start TurboVNC with -extension GLX or if I simply prepend vglrun to the python3 command, which calls VirtualGL, then OpenGL is used and the rendered scene is flawless. I attach the screenshot and saved figures below.

    enter image description here enter image description here enter image description here