# vtkOpenGLRenderWindow failed with pyinstaller

**URL:** https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204
**Category:** Support
**Tags:** python
**Created:** [December 31, 2025, 8:11am UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204 "2025-12-31T08:11:14Z")
**Posts on this page:** 12
**Page:** 1

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [December 31, 2025, 8:11am UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/1 "2025-12-31T08:11:14Z")

</div>

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:

```auto
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?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [December 31, 2025, 3:31pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/2 "2025-12-31T15:31:02Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [December 31, 2025, 3:45pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/3 "2025-12-31T15:45:03Z")

</div>

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](https://discourse.vtk.org/uploads/short-url/uKgvNyzrD8wdc36htBsjwub9r6C.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

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [December 31, 2025, 4:11pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/4 "2025-12-31T16:11:46Z")

</div>

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.

---

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [December 31, 2025, 4:33pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/5 "2025-12-31T16:33:45Z")

</div>

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?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [December 31, 2025, 4:40pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/6 "2025-12-31T16:40:33Z")

</div>

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

---

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [January 2, 2026, 2:20pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/7 "2026-01-02T14:20:15Z")

</div>

Pyinstaller is in the same version for both OS.

One question that I have is that pyinstaller does package X11, XRender but not GL. You seem to point out there is no issue with the X display but with GLX. So I tried to force pyinstaller to also package all libGL libraries and also the dri folder using:

> –add-binary=“/usr/lib/x86\_64-linux-gnu/libGL\*:.” --add-binary=“/usr/lib/x86\_64-linux-gnu/dri:dri”

Here is the new error log. Does it help you? It looks like adding the GL libraries did something but now the dri folder seems ignored.

> libGL error: did not find extension DRI\_IMAGE\_DRIVER version 1  
> libGL error: did not find extension DRI\_Mesa version 1  
> libGL error: failed to load driver: iris  
> libGL error: did not find extension DRI\_Mesa version 1  
> libGL error: failed to load driver: swrast  
> libGL error: did not find extension DRI\_IMAGE\_DRIVER version 1  
> libGL error: did not find extension DRI\_Mesa version 1  
> libGL error: failed to load driver: iris  
> libGL error: did not find extension DRI\_Mesa version 1  
> libGL error: failed to load driver: swrast  
> 2026-01-02 15:14:10.955 ( 1.334s) [7FD064EC5080]vtkXOpenGLRenderWindow.:730 WARN| vtkXOpenGLRenderWindow (0x366d8f90): Cannot create GLX context.  
> 2026-01-02 15:14:10.955 ( 1.334s) [7FD064EC5080]vtkOpenGLRenderWindow.c:920 WARN| vtkXOpenGLRenderWindow (0x366d8f90): Failed to initialize OpenGL functions!  
> 2026-01-02 15:14:10.955 ( 1.334s) [7FD064EC5080]vtkOpenGLRenderWindow.c:939 WARN| vtkXOpenGLRenderWindow (0x366d8f90): 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.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [January 2, 2026, 2:31pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/8 "2026-01-02T14:31:12Z")

</div>

libGLX should not really go into the package because stuff like glx/egl are provided by the graphics driver vendors (nvidia/amd/mesa)

The real question is what caused same version of pyinstaller to produce a working package on 24.04 but failed on 22.04.

---

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [January 2, 2026, 2:45pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/9 "2026-01-02T14:45:15Z")

</div>

Adding the LIBGL\_DRIVERS\_PATH allows to setup the location of the drivers. Now, it works for all OS.

What driver do you recommand or use at Kitware? I understand your concerns about packaging GLX but the issue looks like an (ABI?) incompatibility between packaged X11/Xrender libraries and GLX provided by the machine. Do you have another idea or way of solving this issue?

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [January 12, 2026, 2:04pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/10 "2026-01-12T14:04:41Z")

</div>

I just use whatever is provided by the distro.

> the issue looks like an (ABI?) incompatibility between packaged X11/Xrender libraries and GLX provided by the machine

I see. Does it help if you remove the X libs from the package and allow VTK to use the X library from the system lib dirs?

---

<div class="post-metadata">

### Author: ![BotellaA](https://discourse.vtk.org/user_avatar/discourse.vtk.org/botellaa/32/1243_2.png) [@BotellaA](https://discourse.vtk.org/u/BotellaA)
#### Post date: [January 12, 2026, 6:11pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/11 "2026-01-12T18:11:22Z")

</div>

I tried but I can’t. Vtk seems to have linked to a weird XRender library with the version suffix that cannot be found on an user computer. The name is not generic enough.

Do you specify something about that during the c++ or wheel build? If it is not on your side, might be something strange on the machine where pyinstaller run.

---

<div class="post-metadata">

### Author: ![jaswantp](https://discourse.vtk.org/user_avatar/discourse.vtk.org/jaswantp/32/10046_2.png) [@jaswantp](https://discourse.vtk.org/u/jaswantp)
#### Post date: [January 12, 2026, 7:21pm UTC](https://discourse.vtk.org/t/vtkopenglrenderwindow-failed-with-pyinstaller/16204/12 "2026-01-12T19:21:05Z")

</div>

I am not aware of VTK locking down to a specific X library version suffix.
