Using Qt5 on Apalis TK1 with EGLFS without X11?

I have an Apalis TK1 and I want to use Qt5 with EGLFS support / without X11 using the proprietary Nvidia drivers from Linux For Tegra R21.5 | NVIDIA Developer.

Is this possible?

No, this is not possible.

Thanks for the clarification Marcel. What’s the recommended way to run Qt5 apps then?

Suppose I have the X server running and Qt5 installed, how do I start qmlscene for example?

I tried the following:

systemctl stop display-manager.service /usr/bin/X -s 0 :0 vt07 -nolisten tcp -novtswitch &
export DISPLAY=:0.0

But nothing shows up. I’m using an HDMI monitor and I’m booting using this cmdline:

lp0_vec=2064@0xf46ff000 core_edp_mv=1150 core_edp_ma=4000 usb_port_owner_info=2 lane_owner_info=6 emc_max_dvfs=0 ip=dhcp root=/dev/nfs rw nfsroot=myshare,tcp,nolock rootwait igb_mac=00:14:2d:x:x:x consoleblank=0 no_console_suspend=1 console=tty1 console=ttyS0,115200n8 debug_uartport=lsport,0 video=tegrafb0:640x480-16@60 fbcon=map:1

I guess you may start your application as per the following article on our developer website.

Not answering your specific question, but I managed to build a yocto image for the TK1 (with a lot of pain and suffering) including Qt5 with EGLFS and Mesa linked against the nouveau/tegra drivers and WITHOUT X11 or Wayland. I’d consider it a bug that the tegra124m tag from apalis-tk1-mainline machine adds options like, for example, vulkan and glx to the DISTRO_FEATURES and Qt without checking DISTRO_FEATURES for x11.

The main tool I used to work my way through was bitbake [recipe] -e > someFileThatICouldGrep.txt and used cat/grep/vim to look for PACKAGECONFIG updates and, in the case of qt, EXTRA_OECONF. Similar variables may help you track down what you’re looking for. I usually did a facepalm when I came across the addition to variables from some .bbappend that came with _tegra124m.

With all this said, I’m not sure it’s actually worth it to do this, but it’s possible. It may even be possible to get OpenCL working against the nouveau/tegra OSS drivers on mainline kernel. OpenCV seems to build okay. I’d like to do a performance test but didn’t get around to it as one of our developers has a requirement for CUDA and I had to go back to the apalis-tk1 machine anyway :_(

It’s a crying shame NVidia doesn’t support the 32-bit tegra platforms any more. So much potential. <end_rant/>

The image config had most of the qt stuff copied from a toradex example but without much use of gstreamer etc. I tried to keep the extraneous packages down.

I used a custom distro with this (not all verified as necessary or useful but the removals for sure):
DISTRO_FEATURES_remove = "x11 wayland vulkan xcb"

DISTRO_FEATURES_append = " directfb eglfs drm gbm egl opengl_es2"

I had the following flags in local.conf:
MACHINE ?= "apalis-tk1-mainline"

# Remove things like desktop OpenGL requirement from Qt base build

# Unfortunately I just couldn't get the tests to complete even though they should have completed with the right combination of exclusions. It's possible they work and I just forgot to re-test with the correct config.

PACKAGECONFIG_remove_pn-qtbase = "xcb gl tests"

PACKAGECONFIG_append_pn-qtbase = " directfb kms gbm eglfs"

# The toradex bsp layer for tegra124m (mainline) adds stuff to Mesa that add X11 dependencies without accounting for it as an option.

# Here, we remove from Mesa the dri3 drivers and glx options (which require X) brought in by Toradex' mainline tegra bbappends.

PACKAGECONFIG_remove_pn-mesa = "dri3"

EXTRA_OECONF_remove_pn-mesa = "--without-dri-drivers --enable-glx --enable-osmesa"