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?
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.
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?
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:
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.
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?
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.