vtkOpenGLRenderWindow failed with pyinstaller

I have a Python VTK app working on Linux. I am trying to use pyinstaller to package the app for distribution. Once the app is packaged, I got this error:

2025-12-31 08:42:19.054 (   2.472s) [    70800EFF9080]vtkXOpenGLRenderWindow.:284    ERR| vtkXOpenGLRenderWindow (0x40ac1f00): Could not find a decent config

2025-12-31 08:42:19.054 (   2.472s) [    70800EFF9080]vtkXOpenGLRenderWindow.:540   WARN| vtkXOpenGLRenderWindow (0x40ac1f00): Could not find a decent visual

2025-12-31 08:42:19.062 (   2.480s) [    70800EFF9080] vtkEGLRenderWindow.cxx:391   WARN| vtkEGLRenderWindow (0x40a4eb20): Setting an EGL display to device index: -1 require EGL_EXT_device_base EGL_EXT_platform_device EGL_EXT_platform_base extensions
2025-12-31 08:42:19.062 (   2.480s) [    70800EFF9080] vtkEGLRenderWindow.cxx:396   WARN| vtkEGLRenderWindow (0x40a4eb20): Attempting to use EGL_DEFAULT_DISPLAY…
2025-12-31 08:42:19.062 (   2.480s) [    70800EFF9080] vtkEGLRenderWindow.cxx:401   WARN| vtkEGLRenderWindow (0x40a4eb20): Could not initialize a device. Exiting…
2025-12-31 08:42:19.062 (   2.480s) [    70800EFF9080]vtkOpenGLRenderWindow.c:920   WARN| vtkEGLRenderWindow (0x40a4eb20): Failed to initialize OpenGL functions!
2025-12-31 08:42:19.062 (   2.480s) [    70800EFF9080]vtkOpenGLRenderWindow.c:939   WARN| vtkEGLRenderWindow (0x40a4eb20): 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.
2025-12-31 08:42:19.063 (   2.481s) [    70800EFF9080]vtkOSOpenGLRenderWindow:152   WARN| libOSMesa not found. It appears that OSMesa is not installed in your system. Please install the OSMesa library from your distribution’s package manager.

After testing on several laptops (all under Ubuntu 24.04), here is the information I know:

  • Executing the python vtk app directly works.
  • Executing the pyinstaller exe works on some laptops but not all. I do not find the relation between the ones that are ok and the ones that are not.
  • I tried to package the pyinstaller app with and without libx11.so but it has no impact on the result.

Do you have an idea of what is happening or another test to run?

1 Like

This sounds like it succeded in finding an X display, but failed to get GLX framebuffer config.

Can you collect and share the output of glxinfo on the machines that it did not work?

Is it possible to get a ls output of the libraries inside the package?

I did more tests:

  • If I run the pyinstaller packaging on an Ubuntu 24.04 and then run the package it works on all the machines (maybe because they all are on Ubuntu 24.04…)
  • But if I package on something else than Ubuntu 24.04 (like 22.04, or debian bullseye), the package fails to execute.

Here is a glxinfo on a machine where the pyinstaller package does not work. As a reminder, the python source package does works on every machines, only the pyinstaller does not.

glx.log (103.3 KB)

Here the content of the generated pyinstaller package, extracted using pyinstxtractor.py

aiohttp libvtkCommonCore.so libvtkImagingMath.so libvtkIOTecplotTable.so libvtktiff.so
app.pyc libvtkCommonDataModel.so libvtkImagingMorphological.so libvtkIOTRUCHAS.so libvtktoken.so
attrs-25.4.0.dist-info libvtkCommonExecutionModel.so libvtkImagingOpenGL2.so libvtkIOVeraOut.so libvtkverdict.so
base_library.zip libvtkCommonMath.so libvtkImagingSources.so libvtkIOVideo.so libvtkViewsContext2D.so
frozenlist libvtkCommonMisc.so libvtkImagingStatistics.so libvtkIOVPIC.so libvtkViewsCore.so
greenlet libvtkCommonPython.so libvtkImagingStencil.so libvtkIOXdmf2.so libvtkViewsInfovis.so
libavif-01e67780.so.16.3.0 libvtkCommonSystem.so libvtkInfovisCore.so libvtkIOXMLParser.so libvtkvpic.so
libbsd.so.0 libvtkCommonTransforms.so libvtkInfovisLayout.so libvtkIOXML.so libvtkWebCore.so
libbz2.so.1.0 libvtkDICOMParser.so libvtkInteractionImage.so libvtkjpeg.so libvtkWebGLExporter.so
libcrypto.so.1.1 libvtkDomainsChemistryOpenGL2.so libvtkInteractionStyle.so libvtkjsoncpp.so libvtkWrappingPythonCore3.12.so
libffi.so.7 libvtkDomainsChemistry.so libvtkInteractionWidgets.so libvtkkissfft.so libvtkxdmf2.so
libgcc_s.so.1 libvtkdoubleconversion.so libvtkIOAMR.so libvtklibharu.so libvtkzlib.so
libgfortran-040039e1-0352e75f.so.5.0.0 libvtkexodusII.so libvtkIOAsynchronous.so libvtklibproj.so libwebp-d8b9687f.so.7.2.0
libjpeg-a41b0190.so.62.4.0 libvtkexpat.so libvtkIOAvmesh.so libvtklibxml2.so libwebpdemux-747f2b49.so.2.0.17
liblcms2-cc10e42f.so.2.0.17 libvtkFiltersAMR.so libvtkIOCellGrid.so libvtkloguru.so libwebpmux-7f11e5ce.so.3.1.2
liblzma-64b7ab39.so.5.8.1 libvtkFiltersCellGrid.so libvtkIOCesium3DTiles.so libvtklz4.so libX11.so.6
liblzma.so.5 libvtkFiltersCore.so libvtkIOCGNSReader.so libvtklzma.so libXau-154567c4.so.6.0.0
libmd.so.0 libvtkFiltersExtraction.so libvtkIOChemistry.so libvtkmetaio.so libXau.so.6
libopenjp2-94e588ba.so.2.5.4 libvtkFiltersFlowPaths.so libvtkIOCityGML.so libvtknetcdf.so libxcb-64009ff3.so.1.1.0
libpython3.12.so.1.0 libvtkFiltersGeneral.so libvtkIOCONVERGECFD.so libvtkogg.so libXcursor-1a09904e.so.1.0.2
libquadmath-96973f99-934c22de.so.0.0.0 libvtkFiltersGeneric.so libvtkIOCore.so libvtkParallelCore.so libXdmcp.so.6
libreadline.so.8 libvtkFiltersGeometryPreview.so libvtkIOEngys.so libvtkParallelDIY.so libXfixes-d274cb03.so.3.1.0
libscipy_openblas64_-fdde5778.so libvtkFiltersGeometry.so libvtkIOEnSight.so libvtkpng.so libXrender.so.1
libsharpyuv-95d8a097.so.0.1.2 libvtkFiltersHybrid.so libvtkIOERF.so libvtkpugixml.so libz.so.1
libsqlite3.so.0 libvtkFiltersHyperTree.so libvtkIOExodus.so libvtkPythonContext2D.so libzstd-761a17b6.so.1.5.7
libssl.so.1.1 libvtkFiltersImaging.so libvtkIOExportGL2PS.so libvtkRenderingAnnotation.so marshmallow-3.26.2.dist-info
libstdc++.so.6 libvtkFiltersModeling.so libvtkIOExportPDF.so libvtkRenderingCellGrid.so multidict
libtiff-295fd75c.so.6.2.0 libvtkFiltersParallelDIY2.so libvtkIOExport.so libvtkRenderingContext2D.so numpy
libtinfo.so.6 libvtkFiltersParallelImaging.so libvtkIOFDS.so libvtkRenderingContextOpenGL2.so numpy-2.4.0.dist-info
libuuid.so.1 libvtkFiltersParallel.so libvtkIOFLUENTCFF.so libvtkRenderingCore.so numpy.libs
libviskores_cont-1.0.so libvtkFiltersParallelStatistics.so libvtkIOGeoJSON.so libvtkRenderingExternal.so opengeodeweb_viewer
libviskores_cont_testing-1.0.so libvtkFiltersPoints.so libvtkIOGeometry.so libvtkRenderingFreeType.so PIL
libviskoresdiympi_nompi.so libvtkFiltersProgrammable.so libvtkIOH5part.so libvtkRenderingGL2PSOpenGL2.so pillow.libs
libviskores_filter_clean_grid-1.0.so libvtkFiltersPython.so libvtkIOH5Rage.so libvtkRenderingGridAxes.so propcache
libviskores_filter_connected_components-1.0.so libvtkFiltersReduction.so libvtkIOHDF.so libvtkRenderingHyperTreeGrid.so pyiboot01_bootstrap.pyc
libviskores_filter_contour-1.0.so libvtkFiltersSelection.so libvtkIOImage.so libvtkRenderingImage.so pyimod01_archive.pyc
libviskores_filter_core-1.0.so libvtkFiltersSMP.so libvtkIOImport.so libvtkRenderingLabel.so pyimod02_importers.pyc
libviskores_filter_density_estimate-1.0.so libvtkFiltersSources.so libvtkIOInfovis.so libvtkRenderingLICOpenGL2.so pyimod03_ctypes.pyc
libviskores_filter_entity_extraction-1.0.so libvtkFiltersStatistics.so libvtkIOIOSS.so libvtkRenderingLOD.so pyi_rth_inspect.pyc
libviskores_filter_field_conversion-1.0.so libvtkFiltersTemporal.so libvtkIOLANLX3D.so libvtkRenderingMatplotlib.so pyi_rth_multiprocessing.pyc
libviskores_filter_field_transform-1.0.so libvtkFiltersTensor.so libvtkIOLegacy.so libvtkRenderingOpenGL2.so pyi_rth_pkgutil.pyc
libviskores_filter_flow-1.0.so libvtkFiltersTexture.so libvtkIOLSDyna.so libvtkRenderingParallel.so pyi_rth_setuptools.pyc
libviskores_filter_geometry_refinement-1.0.so libvtkFiltersTopology.so libvtkIOMINC.so libvtkRenderingSceneGraph.so python3.12
libviskores_filter_image_processing-1.0.so libvtkFiltersVerdict.so libvtkIOMotionFX.so libvtkRenderingUI.so PYZ.pyz
libviskores_filter_mesh_info-1.0.so libvtkfmt.so libvtkIOMovie.so libvtkRenderingVolumeAMR.so PYZ.pyz_extracted
libviskores_filter_multi_block-1.0.so libvtkfreetype.so libvtkIONetCDF.so libvtkRenderingVolumeOpenGL2.so setuptools
libviskores_filter_resampling-1.0.so libvtkGeovisCore.so libvtkIOOggTheora.so libvtkRenderingVolume.so sqlalchemy
libviskores_filter_vector_analysis-1.0.so libvtkgl2ps.so libvtkIOOMF.so libvtkRenderingVRModels.so struct.pyc
libviskores_filter_zfp-1.0.so libvtkglad.so libvtkIOParallelExodus.so libvtkRenderingVR.so vease_viewer
libviskores_worklet-1.0.so libvtkh5part.so libvtkIOParallelLSDyna.so libvtkRenderingVtkJS.so vease_viewer-0.0.0.dist-info
libvtkAcceleratorsVTKmCore.so libvtkhdf5_hl.so libvtkIOParallel.so libvtkSerializationManager.so vtk-9.5.2.dist-info
libvtkAcceleratorsVTKmDataModel.so libvtkhdf5.so libvtkIOParallelXML.so libvtksqlite.so vtk.libs
libvtkAcceleratorsVTKmFilters.so libvtkImagingColor.so libvtkIOPIO.so libvtksys.so vtkmodules
libvtkcgns.so libvtkImagingCore.so libvtkIOPLY.so libvtkTestingCore.so yarl
libvtkChartsCore.so libvtkImagingFourier.so libvtkIOSegY.so libvtkTestingRendering.so
libvtkCommonColor.so libvtkImagingGeneral.so libvtkIOSQL.so libvtkTestingSerialization.so
libvtkCommonComputationalGeometry.so libvtkImagingHybrid.so libvtkioss.so libvtktheora.so

Okay. I can see there are ~650 FB configs from the output of glxinfo. Not sure why it failed to pick atleast one.

maybe something is wrong with pyinstaller, or the libx11.so.6 on bullseye. if 24.04 worked, then use that instead.

Indeed, current workaround is to use Ubuntu 24.04. However, I would like to deploy also on Ubuntu 22.04, so packaging on 24.04 is not a long term solution.

From your response, you seem to say the issue might be on pyinstaller side?

yeah. if possible try the same version of pyinstaller that you use on 24.04?