Pyside6 on embedded linux
-
wrote on 14 Oct 2024, 15:11 last edited by
I'm having some trouble using PySide6 on an embedded linux application. I'm getting the following error:
qt.qpa.egldeviceintegration: Failed to load EGL device integration "eglfs_kms" Could not initialize egl display Aborted
And this is the minimal example of what I'm trying to run:
from PySide6 import QtCore, QtGui, QtWidgets from PySide6.QtWidgets import QApplication, QMainWindow import os, sys from ui_main_window import Ui_MainWindow class MainWindow(QMainWindow, Ui_MainWindow): def __init__(self): super().__init__() self.setupUi(self) def start_main_window(): os.environ["QT_QPA_PLATFORM"] = "eglfs" os.environ["QT_QPA_EGLFS_HIDECURSOR"] = "1" app = QtWidgets.QApplication(sys.argv) window = MainWindow() window.show() app.exec_() if __name__ == '__main__': start_main_window()
The failure is on 'app = QtWidgets.QApplication(sys.argv)'. If I change the imports to PySide2, everything seems to work. For that, I followed some directions from https://github.com/lbt/python-gui, which had me install:
sudo apt install python3-pyside2.qtcore python3-pyside2.qtgui python3-pyside2.qtnetwork python3-pyside2.qtqml python3-pyside2.qtquick python3-pyside2.qttest python3-pyside2.qtwidgets
But with PySide6, it's installed with
pip install PySide6
inside the venv. So, I'm guessing I'm missing some components somewhere for PySide6 that were installed with PySide2? Or maybe there's something available at the system level that the venv doesn't see? My user is in the 'video' group (as is /dev/fb0) and 'render' group, and running things as root doesn't help. I've seen some instructions around for how to explicitly build Qt with eglfs_kms support, but hopefully I can make this work with the 'pip install' version. Thoughts?
-
wrote on 23 Apr 2025, 08:21 last edited by
Hello,
I’m running into the exact same problem on a Raspberry Pi with the latest Debian and a fresh PySide6 6.9.0 install—there simply isn’t any eglfs_kms support. If I switch to the eglfs_linuxfb backend, everything works perfectly, so I suspect the KMS integration might be deliberately omitted in the pip-distributed Qt for PySide6.
For now I’m sticking with linuxfb, but I’d like to understand what limitations this entails compared to KMS (I don’t need multi-screen setups, 3D acceleration or video playback).
I even managed to build a custom Qt from source with KMS support, but haven’t been able to persuade PySide6 to use that build instead of its bundled Qt. I also tried building PySide6 from source with qt_path pointed at my custom Qt, but that didn’t work either.
Any insights into why eglfs_kms isn’t included, or how to make PySide6 pick up my KMS-enabled Qt, would be greatly appreciated.
-
wrote 5 days ago last edited by
Hi,
Any news about that?
I’m trying to use a Pyside6 app without desktop with KMS. It works with linuxfb but I need to rotate the screen and it’s not possible on that platform.