Jetson Nano and Qt5

Hello!
I decided to move from RPI3 + to Jetson Nano, the jump seems huge in terms of performance.
I installed L4T and then thought that I would be able to run the QT installer like on an ordinary pc through the .run installer but my expectations were wrong. When running the QTx64 and x84 installer, I received an error. Can not execute binary file, exec format error. My guess is that this is related to linux architecture.
Can I ask for advice on how to build a QT for jetson nano? I know how to build a cross version for PC and RPI, but when I tried to build with nano, I got an error from the compiler. I tried to install from the command apt-get install qt-default and install qtcreator. The installation was successful, but after running qtcreator I did not have QSerialBus modules, which I could not install manually. Any advice will be at a premium!

Hi sqwer6545,

Yes, that is the linux arch issue because jetson Nano is using arm64.

I tried to build qt5 last year on my TX2. The steps should be similar. Please note that this is not cross compile case.
For cross compile, I think you could refer to qt official website.
https://doc.qt.io/QtForDeviceCreation/qtee-preparing-hardware-jetsontx1.html

Download the backend from public source 
wget http://master.qt.io/archive/qt/5.9/5.9.2/single/qt-everywhere-opensource-src-5.9.2.tar.xz

#Some users suggest to install below libraries before configure.
 https://wiki.qt.io/Building_Qt_5_from_Git 
 untar qt tarbell
tar -xpf qt-everywhere-opensource-src-5.9.2.tar.xz
cd qt-everywhere-opensource-src-5.9.2
./configure
Choose "o" when the prompt asks which version of Qt you want to install. 
Check if EGL and EGLFS is enabled 
EGL .................................... yes
OpenVG ................................. no

QPA backends:
DirectFB ............................... no
EGLFS .................................. yes
EGLFS details:
EGLFS i.Mx6 .......................... no
EGLFS i.Mx6 Wayland .................. no
EGLFS EGLDevice ...................... yes
EGLFS GBM ............................ no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGL on X11 ........................... yes

 make -j4 
sudo make install
#  Download a sample and build
https://github.com/alpqr/quickmwtest
#If you don't configure the installation path, you need to create a link.
sudo ln -sf /usr/local/Qt-5.9.2/bin/qmake /usr/lib/aarch64-linux-gnu/qt5/bin/qmake
# Use "qmake" under sample folder and then "make" 
# If you hit qmake error  →     export QT_SELECT=qt5

#Before running the sample
sudo service lightdm stop (because we are demo DRM usecase)
unset DISPLAY
export QT_QPA_PLATFORM=eglfs
export QT_QPA_EGLFS_INTEGRATION=eglfs_kms_egldevice
./quickmwtest
2 Likes

WayneWWW,
If I could, I would carry you on my hands !!
I’ve installed QT successfully, amazing!
I have one more question, I would like to create my own linux distribution based on the yocto project. I can not see the META layer for jetson nano. Will the use of a layer with TX2 be a good solution?

Sorry that I am not familiar with Yocto meta layer but I saw there is a page.

hello ,i met this error, how can i do next, Thank you !
Makefile:48: recipe for target ‘sub-src-make_first’ failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory ‘/home/percipio/qt-everywhere-opensource-src-5.9.2/qtbase’
Makefile:82: recipe for target ‘module-qtbase-make_first’ failed
make: *** [module-qtbase-make_first] Error 2

Hello,

I also tried to build qt5, but still ran into error
"
g++ -c -include .pch/Qt5Location -pipe -O3 -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -D_REENTRANT -fPIC -DQT_NO_LINK …5.14.0/qtbase/include/QtCore -I.moc -isystem /usr/include/libdrm -I/home/chang/works/qt-everywhere-src-5.14.0/qtbase/mkspecs/linux-g++ -o .obj/qgeomaneuver.o maps/qgeomaneuver.cpp

g++: internal compiler error: Segmentation fault (program cc1plus)
Please submit a full bug report,
with preprocessed source if appropriate.
See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.
Makefile:26567: recipe for target ‘.obj/qgeomaneuver.o’ failed

how did you install qt5 on your nano? Her is my environment,
$ g++ --version
g++ (Ubuntu/Linaro 7.4.0-1ubuntu1~18.04.1) 7.4.0

I am trying to build qt5.14.0.

thanks!

Chang

For me

sudo apt-get install qt4-default

and

sudo apt-get install qt5-default

worked on Jetson Nano. I am not sure if something has been fixed since the discussion started.

3 Likes

I really want to make QT5 work on Jetson XAVIER NX. Is there any way to achieve that?

Hello,

If I follow this, Can I install Qt(opensource ver.) on jetson NANO?

Thank you.

Yes. I did in following commands successfully:
sudo apt install qtcreator
sudo apt install gdb
sudo apt install qtdeclarative5-dev

Hello,
i could build Qt5 on TX2 by following the steps given by WayneWWW. But while running the code from Git, i could see the logs but no UI(rectangle/text) on screen. I checked that a config.json should be given, but not sure what should be the ‘device’. Any help appreciated!

I could see the UI, after disabling gdm service on a virtual terminal

On Jetson Nano 4GB, following Wayne’s post step by step ( qt-everywhere-opensource-src-5.9.2.tar.xz),

jetson@jetson-desktop:~/qt-everywhere-opensource-src-5.9.2$ make -j4

returns following error:

Makefile:24739: recipe for target ‘.obj/qsslcertificate_openssl.o’ failed
make[3]: *** [.obj/qsslcertificate_openssl.o] Error 1
make[3]: Leaving directory ‘/home/jetson/qt-everywhere-opensource-src-5.9.2/qtbase/src/network’
Makefile:245: recipe for target ‘sub-network-make_first’ failed
make[2]: *** [sub-network-make_first] Error 2
make[2]: Leaving directory ‘/home/jetson/qt-everywhere-opensource-src-5.9.2/qtbase/src’
Makefile:48: recipe for target ‘sub-src-make_first’ failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory ‘/home/jetson/qt-everywhere-opensource-src-5.9.2/qtbase’
Makefile:82: recipe for target ‘module-qtbase-make_first’ failed
make: *** [module-qtbase-make_first] Error 2

In the end what worked for me (Jetson Nano 4GB) was:

(Source: PySide2 (Qt for python) installation on Jetson Xavier)

  1. Download Qt source:
    if you need the whole Qt5 (~900MB):

    wget http://master.qt.io/archive/qt/5.15/5.15.2/single/qt-everywhere-src-5.15.2.tar.xz

    or
    qtbase (basic module such as QtCore, QtGui and QtWidget)(~90MB):

    wget http://master.qt.io/archive/qt/5.15/5.15.2/submodules/qtbase-everywhere-src-5.15.2.tar.xz

  2. configure and install Qt5 (here I used qtbase):

    tar -xpf qtbase-everywhere-src-5.15.2.tar.xz
    cd qtbase-everywhere-src-5.15.2/
    ./configure -xcb

(must enable xcb here manually)
Choose “o” to install Qt open source version.

make -j4
sudo make install

  1. Now we have Qt5 under /usr/local/Qt-5.15.2

Also

#If you don't configure the installation path, you need to create a link.
sudo ln -sf /usr/local/Qt-5.15.2/bin/qmake /usr/lib/aarch64-linux-gnu/qt5/bin/qmake