I have to first disclaim that I’m very new to the graphics part, linux and cmake. I’ve been using paraview for some time, both the pvpython (very seldom) and the gui. However, we are now in the process of building a python package that relies solely on vtk (don’t want to include paraview) for use on our HPC.
My problem is that the HPC is very old, and according to the admin not possible to update to OpenGL 3.2.
I’ve installed vtk 8.2 through python wheel available on conda-forge. However, when trying to open a render window it complain about my backend not being compatible. To get the error message below I’m running the python script through TurboVNC with vglrun.
Is there a way to set the backend or force mesa through the python script? Or do I have to build vtk from source? And I imagine I’m not the first, does anyone have a build already which could be installed in a python environment?
I would like to avoid degrading below 8.2, but could potentially use 9 if there is available wheels that should work.
For info: I’ve managed to open render windows properly when running pvpython from Paraview 5.8 with the “…/bin/paraview-mesa pvpython” and then loading the vtk package.
Are you sure it is worth dealing with this old HPC at all? You may get better computational performance from a single desktop computer equipped with a modern GPU.
Building VTK with the old OpenGL backend would be a dead end. It would cut you off from all VTK bugfixes, new features, performance improvements, and from the VTK community, too, as you would use a configuration that nobody could help you with.
My understanding is that you can configure a software renderer in your system, such as Mesa, and you don’t need to make any changes to VTK.
Thank you for the prompt reply.
Ideally, the HPC would be renewed with modern structure with possibility of containerisation quite some time ago, though I don’t rule over the budget. However, we perform quite a lot of CFD simulations where are dependent on the HPC. Transferring output back and forth to a local computer is not feasible as there may also be others in the team wanting access to output or processed results.
Regarding mesa, you are quite right. However, I’m not sure how to use it with python when running a python script with vtk rendering in it.
I found this reference (https://blog.kitware.com/vtk-8-2-0/) which indicates I should be able to use mesa. However, the wheel I have installed is not including this header and the .exe file. Do you know of any wheel for 8.2 or 9 which has been compiled with this on? Or is there another way to force mesa in python?
The official wheels do not support Mesa. You’ll need to build your own wheel with OSMesa support (
-DVTK_OPENGL_HAS_OSMESA=ON) and the wheel in the build docs.