QtOpenGLWidget issue

Hi:

I want to use QtOpenGLWidget to render some 3D points on my Jetson AGX Xavier. I use the Qt5.9.5 installed by apt-get. I tried the following repo:

This repo can be succefully compiled with the following cmakefile.

cmake_minimum_required(VERSION 2.8)
project(test)

#SET(CMAKE_BUILD_TYPE "Debug")
SET(CMAKE_BUILD_TYPE "Release")
MESSAGE("Build type: " ${CMAKE_BUILD_TYPE})

SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O3 -std=c++17 -march=native -Wno-deprecated-declarations -Wno-deprecated")

set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTOUIC ON)

if (POLICY CMP0072)
  set(OpenGL_GL_PREFERENCE GLVND)
endif()

find_package(Qt5Core REQUIRED)
find_package(Qt5Widgets REQUIRED)
find_package(Qt5OpenGL REQUIRED)
find_package(Qt5Gui REQUIRED)
find_package(OpenGL REQUIRED)

include_directories(
${PROJECT_SOURCE_DIR}
/usr/include/aarch64-linux-gnu/qt5/)

add_executable(test 
main.cpp 
ItemDrawFunc.cpp 
mainwindow.cpp 
myopenglwidget1.cpp 
myopenglwidget2.cpp
openglframe1.cpp
openglframe2.cpp
openglframe3.cpp)

target_link_libraries(test 
Qt5::Core
Qt5::Widgets
Qt5::OpenGL
Qt5::Gui
${OPENGL_LIBRARIES})

I compiled this repo on my laptop and agx xavier using the same version of Qt5.9.5. For the opengl, my laptop has:

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 450.102.04
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

my xavier has:

OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 32.4.4
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

The issue is this repo works well on my laptop, it can render triangle and rectangle.
But on my xavier, it cannot render anything, only has a blank window.

I tried many QtOpenGLWidget examples but all has the same issue.
Any help or suggestions? Thanks.

Hi,
There are several posts about running QT on Jetson platforms:

Please check if it helps.

1 Like

I recompiled the Qt5 with -xcb flag and the issue was solved. Thanks!

1 Like