1
$\begingroup$

I installed ubuntu 24.04 and installed ros2 jazzy

when I type "rviz2" at the terminal, it does not work

  • ubuntu version: 24.04
  • ros2 version: jazzy
  • hardware: intel nuc & raspberry pi 5 (I tried both hardwares and they crashed with the same error)

error code:

abc@abc-desktop:~$ rviz2
QSocketNotifier: Can only be used with threads started with QThread
[INFO] [1716564885.402155305] [rviz2]: Stereo is NOT SUPPORTED
[INFO] [1716564885.402365477] [rviz2]: OpenGl version: 3.1 (GLSL 1.4)
[ERROR] [1716564885.487098451] [rviz2]: rviz::RenderSystem: error creating render window: RenderingAPIException: Invalid parentWindowHandle (wrong server or screen) in GLXWindow::create at ./.obj-aarch64-linux-gnu/ogre_vendor-prefix/src/ogre_vendor/RenderSystems/GLSupport/src/GLX/OgreGLXWindow.cpp (line 246)
[ERROR] [1716564885.487502091] [rviz2]: rviz::RenderSystem: error creating render window: RenderingAPIException: Invalid parentWindowHandle (wrong server or screen) in GLXWindow::create at ./.obj-aarch64-linux-gnu/ogre_vendor-prefix/src/ogre_vendor/RenderSystems/GLSupport/src/GLX/OgreGLXWindow.cpp (line 246)

... (same error code) ...

[ERROR] [1716564885.503710931] [rviz2]: rviz::RenderSystem: error creating render window: RenderingAPIException: Invalid parentWindowHandle (wrong server or screen) in GLXWindow::create at ./.obj-aarch64-linux-gnu/ogre_vendor-prefix/src/ogre_vendor/RenderSystems/GLSupport/src/GLX/OgreGLXWindow.cpp (line 246)
[ERROR] [1716564885.503799340] [rviz2]: rviz::RenderSystem: error creating render window: RenderingAPIException: Invalid parentWindowHandle (wrong server or screen) in GLXWindow::create at ./.obj-aarch64-linux-gnu/ogre_vendor-prefix/src/ogre_vendor/RenderSystems/GLSupport/src/GLX/OgreGLXWindow.cpp (line 246)
[ERROR] [1716564885.503824193] [rviz2]: Unable to create the rendering window after 100 tries
terminate called after throwing an instance of 'std::runtime_error'
  what():  Unable to create the rendering window after 100 tries
Aborted (core dumped)
$\endgroup$
1
  • $\begingroup$ confirmed, exact same setup on the raspberry pi5. $\endgroup$
    – calocedrus
    Commented Jul 12 at 4:23

2 Answers 2

2
$\begingroup$

Recent updates to wayland GUI don't support this.

Run:

echo $XDG_SESSION_TYPE

If the output is wayland, then install X11 using:

sudo apt-get install xorg openbox

Then change the xdg session type and reboot:

sudo nano /etc/gdm3/custom.conf

You should see something like enablewayland=true, and a commented line right above it explaining; something like

#Uncomment the line below to force the login screen to use Xorg

then save, close and restart your system. you can confirm it's been changed by running the first command again.

$\endgroup$
1
$\begingroup$

I have this same issue. a workaround seems to be using the command: QT_QPA_PLATFORM=xcb rviz2 source

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.