Collectives™ on Stack Overflow
Find centralized, trusted content and collaborate around the technologies you use most.
Learn more about Collectives
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
Learn more about Teams
I am trying to run one of the example apps from QT 5.12 without having XServer installed. I am using Ubuntu Linux. When I start it using
linuxfb
backend, it works fine, but then mapboxgl plugin does not work (probably because of lack of native opengl)
but when I start it with EGLFS backend
./qml_location_mapviewer -platform eglfs
it fails with "Could not initialize egl display"
I tried weston/wayland compositor and -platform wayland
everything works as well. Why QT EGLFS does not see my Intel Haswell Open GL device, but everyone else can?
as @derhass suggested it was required to recompile QT with all necessary OpenGL libraries installed first.
# essentials
sudo apt-get install build-essential libssl-dev python
# bluez stack (optional)
sudo apt-get install libbluetooth-dev bluetooth blueman bluez libusb-dev libdbus-1-dev bluez-hcidump bluez-tools
# OpenGL EGL support
sudo apt-get install mesa-utils libegl1-mesa libegl1-mesa-dev libgbm-dev libgbm1 libgl1-mesa-dev libgl1-mesa-dri libgl1-mesa-glx libglu1-mesa libglu1-mesa-dev
# assuming QT is downloaded and extracted before
cd ~/qt-everywhere-src-5.12.6
./configure -confirm-license -opensource -nomake tests -nomake examples -openssl-linked
Ensure you get EGLFS section similar to this:
QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS OpenWFD ........................ no
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS RCAR ........................... no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ yes
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGLFS X11 ............................ yes
LinuxFB ................................ yes
VNC .................................... yes
Mir client ............................. no
Then compile and install the whole thing
sudo make install
Compile your project and run it.
cd mapviewer
/usr/local/Qt-5.12.6/qmake
./qml_location_mapviewer -platform eglfs
Please have a look here:
https://doc.qt.io/qt-5/embedded-linux.html
In particular, try to set the following environment variable before running your application:
export QT_QPA_EGLFS_INTEGRATION=eglfs_kms
If that doesn't work, do an strace
and check for failed open
calls to check if any libraries are missing:
strace ./qml_location_mapviewer -platform eglfs 2>&1 | tee log.txt
Of particular importance are the following libraries/plugins in /usr/lib
:
libQt5EglFSDeviceIntegration.so.5
libQt5EglFsKmsSupport.so.5
qt5/plugins/platforms/libqeglfs.so
qt5/plugins/egldeviceintegrations/libqeglfs-kms-integration.so
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.