ROS RViz OpenGL Problem on Ubuntu 20.04

AlexanderK26

Bit poster
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! :-)
 
The same problem here on mac m1. I can get away with Rviz by disabling the 3D acceleration option but it would be nice if Rviz worked with this feature.
Please fix that Parallels.
 
Hi everyone, it seems I found a solution to fix it! But I'm not sure it's due to I just upgraded to Mac OS 12.2 public beta since I recall I tried this command before. Anyway, enable the 3d acceleration before booting up your linux VM, then use the command
export LIBGL_ALWAYS_SOFTWARE=1
I then can successfully use Gazebo and Rviz with 3D acceleration enabled. I can see the fps in the application are higher than disabling the 3d acceleration and GPU utilization is also higher from mac task monitor.
But it's a bit confusing to me since that variable should enforce all libgl rending to be software.
 
Hi everyone, it seems I found a solution to fix it! But I'm not sure it's due to I just upgraded to Mac OS 12.2 public beta since I recall I tried this command before. Anyway, enable the 3d acceleration before booting up your linux VM, then use the command
export LIBGL_ALWAYS_SOFTWARE=1
I then can successfully use Gazebo and Rviz with 3D acceleration enabled. I can see the fps in the application are higher than disabling the 3d acceleration and GPU utilization is also higher from mac task monitor.
But it's a bit confusing to me since that variable should enforce all libgl rending to be software.
Thank you! that is a first step, but I still get around 12-15 fps for widdow garage on gazebo (I use it to compare to my windows laptop) The power I have with an M1Pro should EASILY get me around 60 fps.. but I'm happy I can keep 3d acceleration enabled and still use gazebo and Rviz :)
 
Thank you! that is a first step, but I still get around 12-15 fps for widdow garage on gazebo (I use it to compare to my windows laptop) The power I have with an M1Pro should EASILY get me around 60 fps.. but I'm happy I can keep 3d acceleration enabled and still use gazebo and Rviz :)
I also really hope that could be resolved in the lastest version. By enabling that variable, it's essentially just enforcing software rendering for any program opened in that terminal. From kernel message(dmesg), it's clearly a kernel conflict with the new graphic virgl used by parallel team.
[drm:virtio_gpu_dequeue_ctrl_func [virtio_gpu]] *ERROR* response 0x1200 (command 0x207)​
They haven't updated the software for around 2 months and hopefully, they could come up with a solution.
 
Hi everyone, it seems I found a solution to fix it! But I'm not sure it's due to I just upgraded to Mac OS 12.2 public beta since I recall I tried this command before. Anyway, enable the 3d acceleration before booting up your linux VM, then use the command
export LIBGL_ALWAYS_SOFTWARE=1
I then can successfully use Gazebo and Rviz with 3D acceleration enabled. I can see the fps in the application are higher than disabling the 3d acceleration and GPU utilization is also higher from mac task monitor.
But it's a bit confusing to me since that variable should enforce all libgl rending to be software.
That worded for me too! Thanks for that! I wish this was somehow internally fixed by Parallels guys.
 
Hi everyone,
I finally managed to solve this issue without using the LIBGL_ALWAY_SOFTWARE which sacrifices the wonderful graphic power from M1 Pro/Max chips.
Firstly, if you've already exported the LIBGL_ALWAY_SOFTWARE variable to 1 in the terminal or in the .bashrc file, please comment it out or set it back to 0 or unset it.
Then either set the OGRE_RTT_MODE manually as below or put it in the .bashrc file.
export OGRE_RTT_MODE=Copy
It permanently solves everything, I can get pretty good fps in very complicated Gazebo simulation, stably 60fps, as compared to only 8fps with software rendering enforced.
Cheers, and enjoy it!
PS: I really can't believe how bad does Parallel team handles this. I raised 2 tickets about this issue to the support team but they didn't reach back to me until after 2 weeks. The reply is like nothing helpful, one of which let me re-install the Parallel tools but with the link for the Windows machine. I stated so clearly it happened on Linux Guest OS and also the kernel error message.. Really nothing to say about it.
 
Hi everyone,
I finally managed to solve this issue without using the LIBGL_ALWAY_SOFTWARE which sacrifices the wonderful graphic power from M1 Pro/Max chips.
Firstly, if you've already exported the LIBGL_ALWAY_SOFTWARE variable to 1 in the terminal or in the .bashrc file, please comment it out or set it back to 0 or unset it.
Then either set the OGRE_RTT_MODE manually as below or put it in the .bashrc file.
export OGRE_RTT_MODE=Copy
It permanently solves everything, I can get pretty good fps in very complicated Gazebo simulation, stably 60fps, as compared to only 8fps with software rendering enforced.
Cheers, and enjoy it!
PS: I really can't believe how bad does Parallel team handles this. I raised 2 tickets about this issue to the support team but they didn't reach back to me until after 2 weeks. The reply is like nothing helpful, one of which let me re-install the Parallel tools but with the link for the Windows machine. I stated so clearly it happened on Linux Guest OS and also the kernel error message.. Really nothing to say about it.
That works for me too. Thanks!
 
Black screen in ROS/rviz on ARM is fixed in Parallels Desktop 17.1.2, software renderer workaround should not be required any more.
Unfortunately, this does not work anymore. I tested RVIZ recently and displaying anything stops after a couple of secs. I had to resort to `export LIBGL_ALWAYS_SOFTWARE=1`.

Could you Parallels guys fix that, please?
 
Unfortunately, this does not work anymore. I tested RVIZ recently and displaying anything stops after a couple of secs. I had to resort to `export LIBGL_ALWAYS_SOFTWARE=1`.

Could you Parallels guys fix that, please?
More specifically, displaying works well when I do not hover a mouse over the RVIZ display. However, once I move the pointer onto the display, then the display stops working immediately.
 
Back
Top