Board: ROCK pi 3A
System: Ubuntu 20.04
Does RK3568 have OpenGL or Vulkan dirvers available?
I saw this is-vulkan-api-available-on-radxa-zero, but it seems only for Android.
I am new to Arm linux. I use the Qt as the OpenCV backend, when I use the cv::imshow with HDMI monitor. This function takes a long time to run and increases a lot of CPU usage.
I am wondering if this phenomenon will be improved if OpenGL or Vulkan is enabled when compiling OpenCV or Qt.
I don’t use Qt but in my case, cv::imshow takes a lot of CPU usage. i don’t know how to tell OpenCV to use hardware acceleration, but hardware acceleration is done with OpenGL ES and mali (legacy kernel) or panfrost (modern kernel). In my experiments i use SDL2 for hardware acceleration, reducing CPU usage from 300% to 80% (FHD). Maybe you need to tell (or build) Qt to use OpenGLES (if not already) and then OpenCV will output with hw accel.
Yes, Qt can build with the OpenGL ES.
This is my first to use cross-compilation toolchain. Because I thought I needed to find an OpenGL ES driver first to enable OpenGL ES. I just want to show the result of image processing with cv::imshow.
So, you mean these released images already supported the OpenGL ES? Theoretically, I only need to set the path of the OpenGL ES library(.so and .h files ) in rock 3A when cross-compiling Qt?
No, i just wanted to tell you that you need to set up OpenGL ES, with mali or panfrost. not sure if the referred images have that support. You should search for dpkg -l|grep mali or dmesg|grep panfrost
I have my custom image and i don’t usually cross-compile, ahh, ok, sometimes the kernel
My Rock pi 3A was sent for repair, so I can’t confirm whether image already supported OpenGL ES.
If not supported, Could you give me some advice on how to set it up? Shoule I also follow the steps in you reply?
I saw this Rock3A_8GB - Enabled hardware acceleration in Chrome!, it seems enable the OpenGL ES, unfortunately no documentation/info there.
I got my board back. And try the dpkg -l|grep mali or dmesg|grep panfrost, but seems no mali lib.
rock@rock-3a:~$ dpkg -l|grep mali
ii gpg 2.2.19-3ubuntu2.2 arm64 GNU Privacy Guard -- minimalist public key operations
ii libmnl0:arm64 1.0.4-2 arm64 minimalistic Netlink communication library
ii libmoo-perl 2.003006-1 all Minimalist Object Orientation library (with Moose compatibility)
ii librole-tiny-perl 2.001004-1 all Perl module for minimalist role composition
ii libtry-tiny-perl 0.30-1 all module providing minimalistic try/catch
rock@rock-3a:~$ dmesg|grep panfrost
rock@rock-3a:~$
Then I searched some forums, and ready to try the following two ways:
Buildroot, as you said, I can find libs such as libmali there, then I will study how to use the buildroot to make embeded linux with opengl supported.
Panfrost, panfrost seems need to the kernel version > 5.x, but the current radxa’s kernel version is 4.19. So I still need to build the kernel. By the way, I did find a image with panfrost https://github.com/qxhome/rk3568-kernel5.10-alldrivers/releases , but still need to figure out how to change the rootfs partition size on emmc(I don’t have a tool to read emmc directly). Maybe rebuild the source code to change the default rootfs size will work.
It looks like the two ways both need to rebuild the kernel. There’s still a lot to learn.
Is there anything wrong with my ways?
I suggest you try Manjaro and/or Armbian, but since you will be using Qt, you better start with a CLI image and build everything from scratch. Note that with the mainline kernel you don’t need the mali blobs but i think you will need to build the latest Mesa. Maybe you find some Images ready to build Qt.
You can ask these people for the best Image to start with for your case instead of building everything that takes a lot of times: @amazingfate@igorp@spikerguy@mara
Oh, I was wrong about RKDevTool_Release_v2.84.
For the first time, I clicked on the dev partition button out of curiosity, and then I clicked run button and get “download boot failed”. I tried to disconnect and reconnect to the PC, and then click run button and the download is successful. I thought it was a GPT image issue. So sorry.
Maybe it’s a problem with the g++ version. The cross toolchain I used at the beginning was 9.4.0 in ubuntu20.04. There were variety errors when compiling Qt, because the versions in the armbian image were g++ 11.2.0 and ubuntu22. So I changed to aarch64-linux-gnu 11.2.2 and Ubuntu22.04 on my x86 PC, but there are still some errors when -sysroot is set. I tried to compile it all on rock3a, finally, this time there was no error, but it took nearly 5 hours to compile Qt, and no error was reported when compiling opencv, but at the end of compiling my own app, the following error appeared.
qt.qpa.plugin: Could not find the Qt platform plugin "xcb" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: eglfs, linuxfb, minimal, minimalegl, offscreen, vnc, webgl.
I use locate libqxcb.so to find the lib ane got /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so,
There are some libraries of Qt5 in the amrbian image. Then I set the export QT_QPA_PLATFORM_PLUGIN_PATH=/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/
and export QT_DEBUG_PLUGINS=1
there are part of output:
Cannot load library /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so: (/lib/aarch64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZN23QPlatformVulkanInstance22presentAboutToBeQueuedEP7QWindow, version Qt_5_PRIVATE_API)
QLibraryPrivate::loadPlugin failed on "/usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so" : "Cannot load library /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so: (/lib/aarch64-linux-gnu/libQt5XcbQpa.so.5: undefined symbol: _ZN23QPlatformVulkanInstance22presentAboutToBeQueuedEP7QWindow, version Qt_5_PRIVATE_API)"
libqt5gui5 provides file /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so. I guess the official qt5 package from ubuntu is not build with vulkan enabled.
I did not choose vulkan when using Qt ./configure.
Does this mean that f I want to use the /usr/lib/aarch64-linux-gnu/qt5/plugins/platforms/libqxcb.so , I have to compile Qt with vulkan. Otherwise, I have to compile the libqxcb.so with opengl.
By the way, here is config.summary:
EGL .................................... yes
OpenVG ................................. no
OpenGL:
Desktop OpenGL ....................... no
OpenGL ES 2.0 ........................ yes
OpenGL ES 3.0 ........................ yes
OpenGL ES 3.1 ........................ yes
OpenGL ES 3.2 ........................ yes
Vulkan ................................. no
Session Management ..................... yes
Features used by QPA backends:
evdev .................................. yes
libinput ............................... no
INTEGRITY HID .......................... no
mtdev .................................. no
tslib .................................. no
xkbcommon .............................. yes
X11 specific:
XLib ................................. yes
XCB Xlib ............................. yes
EGL on X11 ........................... no
xkbcommon-x11 ........................ yes
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 ...................... no
EGLFS GBM ............................ no
EGLFS VSP2 ........................... no
EGLFS Mali ........................... no
EGLFS Raspberry Pi ................... no
EGLFS X11 ............................ no
LinuxFB ................................ yes
VNC .................................... yes
XCB:
Using system-provided xcb-xinput ..... no
Native painting (experimental) ....... no
GL integrations:
GLX Plugin ......................... no
EGL-X11 Plugin ..................... no