ROS RViz OpenGL Problem on Ubuntu 20.04

Discussion in 'Linux Virtual Machine' started by AlexanderK26, Nov 26, 2020.

  1. AlexanderK26

    AlexanderK26 Bit poster

    Messages:
    3
    Hello,
    I am running Ubuntu 20.04 through Parallels on my 16 inch MacBook Pro with a "AMD Radeon Pro 5300M 4 GB" graphics card. I have set 3D acceleration to "On" and also ticked "Always use high performance graphics" in the VM config. I use ROS on Ubuntu and run into the following problem when I try to start RViz (a 3D visualization tool for ROS).

    username@mbp-parallels:~$ rosrun rviz rviz
    [ INFO] [1606388951.361636963]: rviz version 1.14.1
    [ INFO] [1606388951.361718611]: compiled against Qt version 5.12.8
    [ INFO] [1606388951.361728787]: compiled against OGRE version 1.9.0 (Ghadamon)
    [ INFO] [1606388951.369020644]: Forcing OpenGl version 0.
    libGL error: No matching fbConfigs or visuals found
    libGL error: failed to load driver: swrast
    libGL error: No matching fbConfigs or visuals found
    libGL error: failed to load driver: swrast
    rviz: /build/ogre-1.9-kiU5_5/ogre-1.9-1.9.0+dfsg1/RenderSystems/GL/src/OgreGLSupport.cpp:56: virtual void Ogre::GLSupport::initialiseExtensions(): Assertion `pcVer && "Problems getting GL version string using glGetString"' failed.
    Aborted (core dumped)

    The error "Problems getting GL version string using glGetString" seems to be common as this troubleshooting page suggests: (http://wiki.ros.org/rviz/Troubleshooting). The website says the error "means you don't have OpenGL support available. Running through a virtualization environment that does not support hardware accelerated 3D is a common cause of this, as is not having the correct drivers installed under Linux.". How do I go about this and solve the problem?

    Weirdly enough Gazebo (a robot simulation platform with 3D rendering) works perfectly, also really fast, so I guess the hardware acceleration works. If I disable 3D acceleration in the config before starting the VM the problem disappears and RViz opens (Gazebo is much slower without 3D acceleration, but also works). It's important to note that the problem with RViz occurred only after I installed Parallels Tools, before it worked normal.

    All the best and thanks in advance! :)
     
  2. RuiB2

    RuiB2 Bit poster

    Messages:
    1
    Hi, I have the same problem. The 3D acceleration is very useful to Gazebo, but the rviz not work.
     
    Sharjeela likes this.
  3. ToddK3

    ToddK3 Bit poster

    Messages:
    1
    I have the exact same problem as well.
     
  4. AlexanderK26

    AlexanderK26 Bit poster

    Messages:
    3
    Mh, what should we do about this then? Doesn't seem to get much attention here. Should we file a bug with Parallels?
     
    Sharjeela likes this.
  5. ArcherY

    ArcherY Bit poster

    Messages:
    1
    Same problem here. Hope this problem can be fixed asap.
     
  6. MatthewM20

    MatthewM20 Bit poster

    Messages:
    1
    I have also come across this error - and for anyone still struggling/arriving in the future, have managed to narrow it down to this change to rviz, which would have been introduced in versions after 1.14.0.

    If you can use an older version, or build rviz yourself and include the `set(OpenGL_GL_PREFERENCE LEGACY)` in `CMakeLists.txt` then rviz will function correctly under Parallels.
     
  7. ZahiK

    ZahiK Bit poster

    Messages:
    3
    I'm having this issue as well. The issue only seems to appear when Parallel tools is installed. Is there a way to maybe replace the drivers with the old ones before parallel tools replaced them?
     
  8. BradP6

    BradP6 Bit poster

    Messages:
    1
    I had this same issue and finally got a response from support that seems to have resolved the issue. It looks like hardware acceleration is working and rviz functions with VM hardware acceleration enabled. However, I'm not entirely sure how it fixed the issue.

    These are the two commands I ran to switch out the libOpenGL library on the VM:
    Code:
    sudo mv /usr/lib/x86_64-linux-gnu/libOpenGL.so.0.0.0 /usr/lib/x86_64-linux-gnu/libOpenGL.so.0.0.0.orig # Back up original libOpenGL.so.0.0.0
    sudo ln -s /usr/lib/x86_64-linux-gnu/libGL.so.1 /usr/lib/x86_64-linux-gnu/libOpenGL.so.0.0.0 # Replace with libGL.so.1
    
     
    MoZ likes this.
  9. james jack

    james jack Bit poster

    Messages:
    2
    Thank you so much! I don't believe I have any nonstandard libs. It might be worth noting that I recently built another package on this VM (using cmake, not catkin) that has an older version of yaml-cpp as a dependency. Could that cause a problem?

    I cloned the rviz repository in a new catkin_ws/src folder and added set(CMAKE_BUILD_TYPE Debug) to CMakeLists.txt. Then I ran catkin_make, and I got this error:

    /home/aerial-robotics/catkin_ws/src/rviz/src/rviz/default_plugin/interactive_marker_display.cpp: In member function 'virtual void rviz::InteractiveMarkerDisplay::eek:nInitialize()':
    /home/aerial-robotics/catkin_ws/src/rviz/src/rviz/default_plugin/interactive_marker_display.cpp:122 error: no matching function for call to 'interactive_markers::InteractiveMarkerClient::InteractiveMarkerClient(tf::Transformer&, std::string)'
    122 | kers::InteractiveMarkerClient(*tf, fixed_frame_.toStdString()));
     
  10. ZahiK

    ZahiK Bit poster

    Messages:
    3
    Hey BradP6 thanks for the workaround, but it didn't seem to work. Did they say we needed to link to a different library?
     
    Sharjeela likes this.
  11. ZahiK

    ZahiK Bit poster

    Messages:
    3
    Just checked by installing a new Ubuntu 20.04.2 (using the parallels provided one) VM using Parallels 17 and it still does not work. Parallels really needs to fix their OpenGL drivers since VMWare seems to handle this just fine.
     
  12. MichaelW77

    MichaelW77 Bit poster

    Messages:
    1
    For rviz2 and ubuntu 20.04.3, after shutting down the VM, I used Actions/Configure.../Graphics/Advanced and turned off 3D acceleration and rviz2/foxy now works
     
  13. MoZ

    MoZ Bit poster

    Messages:
    1
    Yeah your solution also solved my problem!!! Thank you!
     
  14. YuryZ

    YuryZ Bit poster

    Messages:
    6
    Maybe the following workaround I got from support for JCEF problem will help you as well to keep 3D acceletation on:
    1. Turn on 3D acceleration in Ubuntu
    2. Make sure that the virtual machine is shut down (Actions > Shut Down). If it is in a suspended state, please run it and then shut down (Actions > Shut Down)
    3. Go to the virtual machine configuration and click "Hardware > Boot Order > Advanced Settings > Boot flags"
    4. Paste the following text in the "Boot flags" field: video.gl3=2
    5. Run the virtual machine and see if the issue reoccurs.
     
  15. YuryZ

    YuryZ Bit poster

    Messages:
    6
    Chrome is now working with 3D acceleration in Ubuntu on Parallels 17.1 and the `video.gl3=2` is not needed anymore, yay! Maybe the update will fix your problem as well.
     
    Sharjeela likes this.
  16. GuangY1

    GuangY1 Bit poster

    Messages:
    3
    I have the similar issue. However, I have the M1 MacBook Pro and my Gazebo shows black screen when I have 3d acceleration enabled. Everything works fine without the 3d acceleration.
     
  17. forgetlight

    forgetlight Bit poster

    Messages:
    6
    I also have similar problem on my 2021 M1 Pro MacBook Pro. Tried:
    1. using boot flag aforementioned by others.
    2. relink the gl library mentioned before.
    3. Disable 3D acceleration.
    Only disabling 3d acceleration works but reduce the graphic power to 1/4. Really hope parallel would come up patch for their OpenGL interface otherwise it's a big boomer for me to use the VM...
     
  18. Jean-MichelL

    Jean-MichelL Bit poster

    Messages:
    3
    Same here but specifically with Gazebo. Does someone tried MatthewM20 solution? I'll try that tomorrow
     
  19. Jean-MichelL

    Jean-MichelL Bit poster

    Messages:
    3
    I tried this and when I make catkin_make, I got this ERROR:
    CMake Error at CMakeLists.txt:26 (find_package):
    By not providing "Findurdfdom_headers.cmake" in CMAKE_MODULE_PATH this
    project has asked CMake to find a package configuration file provided by
    "urdfdom_headers", but CMake did not find one.

    This probably doesn't concern the add of : `set(OpenGL_GL_PREFERENCE LEGACY)`
    I would like to know how did you build rviz from sources without any problems.
    Also, note I add the set line just there: [see picture]

    I would highly appreciate it if you can answer it, I must have debug this for like 20 hours. I think I have a lack of knowledge about VMs and CMakeLists scripts. Don't know from where to start to learn about it.
     

    Attached Files:

  20. forgetlight

    forgetlight Bit poster

    Messages:
    6
    I'm able to compile the latest Rviz source code without any issue. I used catkin build instead of caktin_make. However, even with that flag, my Rviz still can't run with 3D acceleration. For now, I just run it by disabling the 3D acceleration. But I really hope Parallel can solve this issue otherwise I won't recommend any of my colleagues to use it.
     

Share This Page