ros-visualization / rviz

ROS 3D Robot Visualizer
BSD 3-Clause "New" or "Revised" License
826 stars 463 forks source link

rviz segfaults on pointclou2 with new opengl #1584

Closed koniarik closed 3 years ago

koniarik commented 3 years ago

Got segfault with pointcloud2 view from realsense camera. Everytime I try to enable the plugin for it and receive data (works in case it has no topic), rviz immediatly segfaults.

Everything works just OK with '--opengl 210'.

Your environment

rhaschke commented 3 years ago

This seems similar to #1508, but in your case an AMD GPU is affected. Can you provide the output of glxinfo | grep OpenGL please?

koniarik commented 3 years ago

sure:

➜ glxinfo | grep OpenGL
OpenGL vendor string: AMD OpenGL renderer string: AMD RAVEN (DRM 3.38.0, 5.8.0-41-generic, LLVM 11.0.1) OpenGL core profile version string: 4.6 (Core Profile) Mesa 20.3.4 - kisak-mesa PPA OpenGL core profile shading language version string: 4.60 OpenGL core profile context flags: (none) OpenGL core profile profile mask: core profile OpenGL core profile extensions: OpenGL version string: 4.6 (Compatibility Profile) Mesa 20.3.4 - kisak-mesa PPA OpenGL shading language version string: 4.60 OpenGL context flags: (none) OpenGL profile mask: compatibility profile OpenGL extensions: OpenGL ES profile version string: OpenGL ES 3.2 Mesa 20.3.4 - kisak-mesa PPA OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20 OpenGL ES profile extensions:

rhaschke commented 3 years ago

I have pushed a new commit to melodic-devel to have rviz report the employ rendering device during startup. Could you please build the latest melodic-devel branch please from source and report this new information? I'm surprised, that rviz doesn't automatically downgrade to an older OpenGL version, because we know that the Mesa libs have issues rendering rviz' more modern material scripts.

koniarik commented 3 years ago

I tried to just compile it localy in workspace, btu got an error:

/home/veverak/Projects/Schpin/repos/thirdparty/rviz/src/rviz/default_plugin/interactive_marker_display.cpp:122:100: error: no matching function for call to ‘interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient(tf::Transformer&, std::string)’

using everything as packages from repository, any tips how to make this?

rhaschke commented 3 years ago

This looks like a mismatch between Melodic and Noetic. Which system are you compiling on? Which branch did you checkout?

koniarik commented 3 years ago

My mistake, I am no noetic, completely forgot about that

koniarik commented 3 years ago

SO, I applied the patch on noetic version which I am using (again, sorrt for that):

[ INFO] [1613002034.041585762]: rviz version 1.14.4 [ INFO] [1613002034.041681030]: compiled against Qt version 5.12.8 [ INFO] [1613002034.041716486]: compiled against OGRE version 1.9.0 (Ghadamon) [ INFO] [1613002034.062530782]: Forcing OpenGl version 0. [ INFO] [1613002034.436060548]: Stereo is NOT SUPPORTED [ INFO] [1613002034.436311486]: OpenGL device: AMD RAVEN (DRM 3.38.0, 5.8.0-43-generic, LLVM 11.0.1) [ INFO] [1613002034.436391325]: OpenGl version: 4,6 (GLSL 4,6).

rhaschke commented 3 years ago

Thanks for the feedback. Could you please insert the following line of code:

std::cerr << glGetString(GL_VENDOR) << " - " << glGetString(GL_RENDERER) << " - " << glGetString(GL_VERSION) << std::endl;

into the function RenderSystem::detectGlVersion such that this info is printed on startup as well? https://github.com/ros-visualization/rviz/blob/c36e265d9954a3a7d4a40f1db0821e5ce1a10c15/src/rviz/ogre_helpers/render_system.cpp#L170

koniarik commented 3 years ago

AMD - AMD RAVEN (DRM 3.38.0, 5.8.0-43-generic, LLVM 11.0.1) - 4.6 (Compatibility Profile) Mesa 20.3.4 - kisak-mesa PPA

rhaschke commented 3 years ago

Everything works just OK with '--opengl 210'.

@SquirrelCZE, could you please check whether '--opengl 310' resolves the segfault as well?

rhaschke commented 3 years ago

Dear @SquirrelCZE, could you please confirm whether you face https://github.com/ros-visualization/rviz/issues/1508#issuecomment-801084689l as well on your AMD hardware? I filed an issue on Mesa for that and they are wondering which type of hardware is affected.