This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Qt 5.x & SGX

Guru 20755 points

Hello,

Is it possible to use both QT 5.x and SGX.

I am not sure accordint to TI's wiki which state that:

1. Qt 5.x does not use qws any more.

2. SGX use qws.

So is it possible to use both ?

we use DM8148 processor

Thanks,

Ran

  • Hi Ran,

    From what I was able to find, it is possible to use Qt5 with SGX, see the below pointers:
    e2e.ti.com/.../179163
    e2e.ti.com/.../239813

    BR
    Pavel
  • Hi Pavel,

    Thank you very much.

    Instruction and patch for QT5.1 can also be found here:
    http://gpupowered.org/node/24

    Regards,
    Ran
  • Hi Pavel,

    I've download QT 5.1.1 and build with arm-aragon-linux

    exactly as described in TI's sgx patch:

    But I get the following errors and then it stops:

    ./configure -prefix /qt5_1_install/ -release -make libs -xplatform linux-arm-gnueabi-ti-g++ -opengl es2 -confirm-license -opensource -icu -no-xcb -no-pch -make examples -verbose

    CFG_ARCH="arm"

    CFG_CPUFEATURES=""

    Determining architecture... ()

    g++ -c -pipe -g -Wall -W -fPIE  -I../../mkspecs/linux-g++ -I. -o arch.o arch.cpp

    g++  -o arch arch.o    

    { test -n "" && DESTDIR="" || DESTDIR=.; } && test $(gdb --version | sed -e 's,[^0-9]\+\([0-9]\)\.\([0-9]\).*,\1\2,;q') -gt 72 && gdb --nx --batch --quiet -ex 'set confirm off' -ex "save gdb-index $DESTDIR" -ex quit 'arch' && test -f arch.gdb-index && objcopy --add-section '.gdb_index=arch.gdb-index' --set-section-flags '.gdb_index=readonly' 'arch' 'arch' && rm -f arch.gdb-index || true

       Found architecture in binary

    CFG_HOST_ARCH="i386"

    CFG_HOST_CPUFEATURES=""

    System architecture: 'arm'

    Host architecture: 'i386'

    C++11 auto-detection... ()

    /home/ubuntu/dvrrdk/DVRRDK_04.01.00.02/ti_tools/cgt_a8/arago/linux-devkit/bin/arm-arago-linux-gnueabi-g++ -c -pipe -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -std=c++0x -Wall -W -fPIE  -I../../../mkspecs/linux-arm-gnueabi-ti-g++ -I. -I/qt5_1_install/usr/include -I/qt5_1_install/usr/include/glib-2.0 -I/qt5_1_install/usr/lib/glib-2.0/include/ -I/qt5_1_install/usr/include/libxml2/ -I/qt5_1_install/usr/include/freetype2 -I/qt5_1_install/usr/include/dbus-1.0 -I/qt5_1_install/usr/include/dbus-1.0/dbus -o c++11.o c++11.cpp

    /home/ubuntu/dvrrdk/DVRRDK_04.01.00.02/ti_tools/cgt_a8/arago/linux-devkit/bin/arm-arago-linux-gnueabi-g++ -Wl,-O1 -o c++11 c++11.o   -L/qt5_1_install/usr/lib/arm-arago-linux-gnueabi -L/qt5_1_install/usr/lib -lxml2 -lz -lts -lasound -lfreetype -lexpat -lfontconfig -lpng -lpthread -Wl,-rpath-link=/qt5_1_install/usr/lib/arm-arago-linux-gnueabi -Wl,-rpath-link=/qt5_1_install/usr/lib

    C++11 enabled.

    floatmath auto-detection... ()

    /home/ubuntu/dvrrdk/DVRRDK_04.01.00.02/ti_tools/cgt_a8/arago/linux-devkit/bin/arm-arago-linux-gnueabi-g++ -c -pipe -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp -Wall -W -fPIE  -I../../../mkspecs/linux-arm-gnueabi-ti-g++ -I. -I/qt5_1_install/usr/include -I/qt5_1_install/usr/include/glib-2.0 -I/qt5_1_install/usr/lib/glib-2.0/include/ -I/qt5_1_install/usr/include/libxml2/ -I/qt5_1_install/usr/include/freetype2 -I/qt5_1_install/usr/include/dbus-1.0 -I/qt5_1_install/usr/include/dbus-1.0/dbus -o floatmath.o floatmath.cpp

    floatmath.cpp:44:5: warning: unused parameter 'argc'

    floatmath.cpp:44:5: warning: unused parameter 'argv'

    /home/ubuntu/dvrrdk/DVRRDK_04.01.00.02/ti_tools/cgt_a8/arago/linux-devkit/bin/arm-arago-linux-gnueabi-g++ -Wl,-O1 -o floatmath floatmath.o   -L/qt5_1_install/usr/lib/arm-arago-linux-gnueabi -L/qt5_1_install/usr/lib -lxml2 -lz -lts -lasound -lfreetype -lexpat -lfontconfig -lpng -lpthread -Wl,-rpath-link=/qt5_1_install/usr/lib/arm-arago-linux-gnueabi -Wl,-rpath-link=/qt5_1_install/usr/lib

    floatmath enabled.

    sse2 auto-detection... ()

    /home/ubuntu/dvrrdk/DVRRDK_04.01.00.02/ti_tools/cgt_a8/arago/linux-devkit/bin/arm-arago-linux-gnueabi-g++ -c -pipe -msse2 -g -Wall -W -fPIE  -I../../../mkspecs/linux-arm-gnueabi-ti-g++ -I. -I/qt5_1_install/usr/include -I/qt5_1_install/usr/include/glib-2.0 -I/qt5_1_install/usr/lib/glib-2.0/include/ -I/qt5_1_install/usr/include/libxml2/ -I/qt5_1_install/usr/include/freetype2 -I/qt5_1_install/usr/include/dbus-1.0 -I/qt5_1_install/usr/include/dbus-1.0/dbus -o sse2.o sse2.cpp

    cc1plus: error: unrecognized command line option "-msse2"

    make: *** [sse2.o] Error 1

    sse2 disabled.

    sse3 auto-detection... ()

    /home/ubuntu/dvrrdk/DVRRDK_04.01.00.02/ti_tools/cgt_a8/arago/linux-devkit/bin/arm-arago-linux-gnueabi-g++ -c -pipe -msse3 -g -Wall -W -fPIE  -I../../../mkspecs/linux-arm-gnueabi-ti-g++ -I. -I/qt5_1_install/usr/include -I/qt5_1_install/usr/include/glib-2.0 -I/qt5_1_install/usr/lib/glib-2.0/include/ -I/qt5_1_install/usr/include/libxml2/ -I/qt5_1_install/usr/include/freetype2 -I/qt5_1_install/usr/include/dbus-1.0 -I/qt5_1_install/usr/include/dbus-1.0/dbus -o sse3.o sse3.cpp

    cc1plus: error: unrecognized command line option "-msse3"

    make: *** [sse3.o] Error 1

    sse3 disabled.

    ssse3 auto-detection... ()

     

    Also tried to apply the patches on qt5.1.1 as described but it fails.

    Thanks,

    Ran

  • Hi,

    If we need OpenGL and QML does it mean Qt must support SGX ?

    Is it OpenGL=3D=SGX ?

    Regards,
    Ran

  • Ran Shalit said:
    I've download QT 5.1.1 and build with arm-aragon-linux

    Ran Shalit said:
    ./configure -prefix /qt5_1_install/ -release -make libs -xplatform linux-arm-gnueabi-ti-g++

    Ran Shalit said:
    /home/ubuntu/dvrrdk/DVRRDK_04.01.00.02/ti_tools/cgt_a8/arago/linux-devkit/bin/arm-arago-linux-gnueabi-g++

    Which toolchain exactly you are using?

    I suspect that more recent toolchain is needed:

    export PATH=<path to recent GCC toolchain>

    TOOLCHAIN_PREFIX=/opt/linaro/gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux/bin/arm-linux-gnueabi

    Can you check if there will be any improvements with the below toolchains:

    1. arago
    -2011.09





    2. Sitara toolchain:




    BR

    Pavel

  • Hi Pavel,

    I don't understand what should be specified in qt mkspec
    see below ROOTFS_PATH.
    1. Should it link to the toolchain ?
    2. Do I need to copy later from that toolchain all required lib/headers to target ?

    Thanks,
    Ran




    #
    # qmake configuration for building with arm-linux-gnueabi-g++
    #

    MAKEFILE_GENERATOR = UNIX
    CONFIG += incremental gdb_dwarf_index
    QMAKE_INCREMENTAL_STYLE = sublib

    include(../common/linux.conf)
    include(../common/gcc-base-unix.conf)
    include(../common/g++-unix.conf)

    ROOTFS_PATH=/home/prabindh/work1/ubuntu-rootfs-dec/media/rootfs
    TOOLCHAIN_PREFIX=/opt/linaro/gcc-linaro-arm-linux-gnueabi-2012.03-20120326_linux/bin/arm-linux-gnueabi

    # Change the required paths here
    QMAKE_INCDIR = $${ROOTFS_PATH}/usr/include $${ROOTFS_PATH}/usr/include/glib-2.0 $${ROOTFS_PATH}/usr/lib/glib-2.0/include/ $${ROOTFS_PATH}/usr/include/libxml2/ $${ROOTFS_PATH}/usr/include/freetype2 $${ROOTFS_PATH}/usr/include/dbus-1.0 $${ROOTFS_PATH}/usr/include/dbus-1.0/dbus

    QMAKE_LIBDIR = $${ROOTFS_PATH}/usr/lib/arm-linux-gnueabi $${ROOTFS_PATH}/usr/lib

    QMAKE_INCDIR_OPENGL_ES2 = $${ROOTFS_PATH}/usr/include/sgx/OGLES2
    QMAKE_LIBDIR_OPENGL_ES2 = $${ROOTFS_PATH}/opt/gfxlibraries/gfx_rel_es8.x
    QMAKE_INCDIR_EGL = $${QMAKE_INCDIR_OPENGL_ES2}
    QMAKE_LIBDIR_EGL = $${QMAKE_LIBDIR_OPENGL_ES2}

    # libs
    QMAKE_LIBS = -lxml2 -lz -lts -lasound -lfreetype -lexpat \
    -lfontconfig -lpng -lpthread -Wl,-rpath-link=$${ROOTFS_PATH}/usr/lib/arm-linux-gnueabi -Wl,-rpath-link=$${ROOTFS_PATH}/usr/lib

    QMAKE_LIBS_OPENGL_ES2= -lEGL -lIMGegl -lsrv_um -lGLESv2 -lGLES_CM -lusc -Wl,-rpath-link=/home/prabindh/work1/ubuntu-rootfs-dec/media/rootfs/opt/gfxlibraries/gfx_rel_es8.x -L/home/prabindh/work1/ubuntu-rootfs-dec/media/rootfs/opt/gfxlibraries/gfx_rel_es8.x -Wl,-rpath-link=/home/prabindh/work1/ubuntu-rootfs-dec/media/rootfs/lib/arm-linux-gnueabi -L/home/prabindh/work1/ubuntu-rootfs-dec/media/rootfs/lib/arm-linux-gnueabi

    QMAKE_LIBS_EGL= $${QMAKE_LIBS_OPENGL_ES2}
    QMAKE_LIBS_THREAD = -lpthread

    QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mfpu=neon -mfloat-abi=softfp

    QMAKE_CXXFLAGS_RELEASE = $$QMAKE_CFLAGS_RELEASE

    QMAKE_CC = $${TOOLCHAIN_PREFIX}-gcc
    QMAKE_CXX = $${TOOLCHAIN_PREFIX}-g++
    QMAKE_LINK = $${QMAKE_CXX}
    QMAKE_LINK_SHLIB = $${QMAKE_CXX}

    QMAKE_AR = $${TOOLCHAIN_PREFIX}-ar cqs
    QMAKE_OBJCOPY = $${TOOLCHAIN_PREFIX}-objcopy
    QMAKE_STRIP = $${TOOLCHAIN_PREFIX}-strip

    load(qt_config)
  • I think this should point to your rootfs, not to the toolchain. See the below link, it might help:

    arago-project.org/.../Crosscompiling_Outside_of_Arago

    stdio.h header file is provided by the toolchain as part of the standard GLIBC install and the run-time code for printf() function is provided by the run-time portion of GLIBC (/lib/libc.so), installed in the Arago filesystem.

    BR
    Pavel
  • Hi Pavel,

    Thank you very much for the help.

    After some struglling with the version patch's provided by prabindh which non could compiled according to instructions, I decided to try my luck with newer qt version. So I tried qt5.3.2, with the build is successful ! Though I still hope that no patch is required for TI's arm.

    Anyway, on trying to run any of the examples in qt I get error:

    " could not find or load the Qt platform plugin "xcb"

    Although I build it with -no-xcb  (also prabindh configure examle for 5.1.1 is with -no-xcb)

    Is there any idea if I can run any non xcb dependent example ?

    Thanks,

    Ran

  • Ran Shalit said:

    If we need OpenGL and QML does it mean Qt must support SGX ?

    Is it OpenGL=3D=SGX ?

    Yes, Qt5 can be used on DM81xx devices.

    SGX is a 3D Graphics accelerator that is programmed via OpenGLES API. Hence, you can say that SGX = 3D = OpenGLES.

    There is no OpenGL support, TI SoCs support only OpenGL ES 1.1/2.0

    Upgrading Qt is done via picking up the right Yocto recipes.

    BR
    Pavel

  • Ran Shalit said:

    Anyway, on trying to run any of the examples in qt I get error:

    " could not find or load the Qt platform plugin "xcb"

    See if the below e2e threads will be in help:

    BR
    Pavel

  • Hi Pavel,

    I've followed the detailed instruction in

    In this link prabindh   , even attached the exact binaries he compiled, so I used that files.

    But on trying to example as he used in the tutorial:

    root@dm814x:/examples/widgets/painting/basicdrawing# /bin/qmlscene /examples/declarative/animation/ -platform eglfs

    QIconvCodec::convertFromUnicode: using Latin-1 for conversion, iconv_open failed

    QML debugging is enabled. Only use this in a safe environment.

    QIconvCodec::convertToUnicode: using Latin-1 for conversion, iconv_open failed

    Failed to load platform plugin "eglfs". Available platforms are:

    Aborted

    It seems as if LD_LIBRARY_PATH does not link to this .co , but trying to add the link to LD_LIBRARY_PATH, I still get the same error.

    Is there any idea what's wrong ?

    Thanks,

    Ran

  • Ran,

    The root file system needs to be rebuilt to upgrade from Qt4 to Qt5. Upgrading Qt is done via picking up the right Yocto recipes.

    Have you re-build the rootfs?

    BR
    Pavel
  • Hi Pavel,

    I am not using yocto but arago from SDK.
    The thing is that these libraries exist in filesystem, so I'm not sure why it stll gives that error which says that it does not find it.

    Thanks,
    Ran
  • Hi Pavel,

    It seems that I am very close to closing this issue , seems this error
    Failed to load platform plugin "eglfs".
    means that it can't find the libraries.
    The thing is that these libraries exist in /lib or /usr/lib

    Any idea?

    Regards,
    Ran
  • Hi Pavel,

    Seems that the qt install path in configure -prefix

    is responsible for this.

    if prefix is -prefix /path/to/qt

    then all libraries everything must be inside

    $/path/to/qt

    On fixing it the issue been resolved...

    I also had to start sgx with “/opt/gfxsdkdemos/38xx-demo”

    Does it all make sense ?

    Thanks,

    Ran