robotology / idyntree

Multibody Dynamics Library designed for Free Floating Robots
BSD 3-Clause "New" or "Revised" License
155 stars 65 forks source link

Failed to run the Irrlicht visualizer on Linux #1116

Closed S-Dafarra closed 9 months ago

S-Dafarra commented 9 months ago

Whenever I try to launch a iDynTree::Visualizer instance on Ubuntu 20.04, I get the following error:

X Error of failed request:  BadMatch (invalid parameter attributes)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  31 (X_GLXCreateWindow)
  Serial number of failed request:  27
  Current serial number in output stream:  28
Irrlicht Engine version 1.8.4
Linux 5.15.0-84-generic #93~20.04.1-Ubuntu SMP Wed Sep 6 16:15:40 UTC 2023 x86_64

Getting into it, I noticed that the error occurs when initializing irrlicht in https://github.com/robotology/idyntree/blob/c453ba094a707ab6399eeda740922bdc9cf94a84/src/visualization/src/Visualizer.cpp#L511 and not when creating the window, which is done earlier in https://github.com/robotology/idyntree/blob/c453ba094a707ab6399eeda740922bdc9cf94a84/src/visualization/src/Visualizer.cpp#L455

Currently, I am using the nvidia-driver-525

S-Dafarra commented 9 months ago

I noticed that if I comment the lines https://github.com/robotology/idyntree/blob/c453ba094a707ab6399eeda740922bdc9cf94a84/src/visualization/src/Visualizer.cpp#L486-L487 it works.

I am planning to open a PR to use the classical window creation in Linux, while keeping the use of SDL for Windows and Mac

traversaro commented 9 months ago

Do you think this was a regression of https://github.com/robotology/idyntree/pull/1071 ?

traversaro commented 9 months ago

I am planning to open a PR to use the classical window creation in Linux, while keeping the use of SDL for Windows and Mac

SDL or glfw?

S-Dafarra commented 9 months ago

I think so, although I am not sure why it is happening now. I did test it on Linux back in time. As a mater of fact, I developed it in the very same machine.

I am planning to open a PR to use the classical window creation in Linux, while keeping the use of SDL for Windows and Mac

SDL or glfw?

glfw to create the window and SDL on the irrlicht side. Since on Ubuntu with irrlicht from apt we cannot use SDL, maybe we can still let irrlicht create the window on Ubuntu, since there are no resize issues

S-Dafarra commented 9 months ago

Relevant commit: https://github.com/S-Dafarra/idyntree/commit/6c51ff82e5f5083a77d9f62891110b3c00b75a05

I will test it on Windows too

S-Dafarra commented 9 months ago

Relevant commit: S-Dafarra@6c51ff8

I will test it on Windows too

Tested and working (actually on the Windows and Mac side, nothing should have changed). Corresponding PR: https://github.com/robotology/idyntree/pull/1119