-
Notifications
You must be signed in to change notification settings - Fork 268
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Instant crash on start (ARM64 Ubuntu 22.04 Virtual Machine) #1841
Comments
Interesting, this seems similar to #920 (comment) . |
I am using Parallels 18 on an M1 Pro macbook. That workaround worked although a bit inconvenient long term. I will experiment a bit using it inside docker. I can also confirm the same happens for Fortress |
@bertaveira I've tried various VMs (UTM, Parallels, VMware Fusion, Virtual Box) on macOS (Intel and M1) and none of them have good enough support for OpenGL 4.3+ to run accelerated graphics for Gazebo Sim after the upgrade of ogre2 to 2.2. Same outcome for docker. The most promising candidate so far is VMware Fusion 13 which claims to have support for OpenGL 4.3 (https://docs.vmware.com/en/VMware-Fusion/13.0/rn/vmware-fusion-130-release-notes/index.html). I have installed Gazebo Garden from source on Ubuntu Jammy (upgraded to 22.10 to get the latest mesa drivers). Unfortunately the hardware acceleration is still not there. The mesa drivers appear to support a suitable version of OpenGL: glxinfo |grep -i opengl
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: SVGA3D; build: RELEASE; LLVM;
OpenGL core profile version string: 4.3 (Core Profile) Mesa 22.2.1
OpenGL core profile shading language version string: 4.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.3 (Compatibility Profile) Mesa 22.2.1
OpenGL shading language version string: 4.30
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.1 Mesa 22.2.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.10
OpenGL ES profile extensions: However the rendering window on If you're on mac, M1 or Intel, the Metal rendering for Edit Disabling DRI3 gets the LIBGL_DRI3_DISABLE=1 ./simple_demo ogre2 LIBGL_DRI3_DISABLE=1 ./ogre2_demo ogre2 The latter is encouraging as it uses PBS in the render. No luck yet with the main application. Edit2 Progress: I pulled the latest source for the Garden branches, rebuilt and ran a marine project which is very demanding on graphics: LIBGL_DRI3_DISABLE=1 gz sim -v4 waves.sdf Gazebo Garden running with acceleration on this system: System: macOS Monterey 12.6 |
@bertaveira can you confirm if what @srmainwaring suggested works (setting Since this seems like a limitation of the virtual machine, I'll close this issue. Feel free to reopen if the issue can be addressed in Gazebo. |
I don't think this will work on @bertaveira's Parallels environment - AFAIK there isn't driver support for OpenGL 4.3+ in that hypervisor. There isn't a supported nightly build for Ubuntu 22.10 (Kinetic?) - I tried installing from the nightlys but they are not targeting this version yet - so it's a case of rolling your own environment - but for the first time in about 2y there is now a way of virtualising Gazebo on macOS! |
This works on MAC Mini M1 Ventura 13.1 with Parallels Desktop 18, LIBGL_ALWAYS_SOFTWARE=1 in /etc/environment |
How did you get this to work? I am trying to run the sim but still getting errors. |
Which errors? |
Correcting my previous post, on Ubuntu 22.04 and Lubuntu 22.04, ~/gz sim works with the line "LIBGL_ALWAYS_SOFTWARE=1" in ~/.bashrc file, remembering to "$ source .bashrc" . In my case this environment variable does not appear in /etc/environment, though it is displayed in $ printenv|grep ALWAYS. |
Another option for users looking to run WSL2 now has support for GUI acceleration, so a standard binary install of gazebo-garden on an Ubuntu 22.04 WSL2 machine will run in VMWare Fusion 13 without any need to set mesa environment variables. It won't win any performance awards but does use hardware acceleration and will most likely be faster than using software rendering ( |
Interesting @srmainwaring, are you sure that you are actually using hardware acceleration (i.e. via the |
@traversaro you're right - got ahead of myself there. WSL is defaulting to llvmpipe for rendering on the Win11 VM - I wonder if I can force it to use the hardware acceleration via the Win11 VM? Will keep investigating. |
To clarify, my requirement is to run gz-sim on a Ubuntu 22.04 configured with ROS2 Desktop machine that I used for robotics development which is a Parallels VM on. MAC M1 Silicon arm64. The M1 has its own acceleration which I do not know if supported in any way. With the LIBGL environment value, Gazebo gz-garden does run though I’m having issues with some of the ros-gz tutorial demos that open and run but are not fully operational in rviz. |
@ARLunan - may not be relevant, but you can run ROS2 Humble and gz sim natively on macOS (Intel and M1). It's a bit of a slog to set up the ROS2 side (gz sim is a brew install), but once configured runs very well. Rviz is fully supported, rqt requires some patches to the Qt python packages. Running gz sim virtualised with hardware acceleration requires quite advanced OpenGL support in the hypervisor because of the requirements of the underlying ogre2 render engine. You could run gz sim with the ogre render engine, but may find a number of the models and sensors are not supported. Happy to help with gz sim / ROS Humble on macOS if you decide to go that route (prob should move discussion elsewhere though). |
@srmainwaring I would love to see how you set up the gzsim on macOS I have been struggling with getting it up and running |
which one method gives a somewhat working gazebo build on apple silicon /arm64? if possible at all as development for arm64 will take time to catch up. today i tested , ubunut arm64 jammy on UTM via virtualization , ign-fortress seems to be hit or mis , i tried few examples might need some environment variable changes or more cpu/ram . |
Build from source definitely works for Gazebo Garden and Harmonic (see the from source install testing for the Harmonic release which was all done on a MacBook Pro M1). The brew binary distro should also work for Garden and Harmonic, however I have not independently verified this recently. Software rendering works on various VMs running Ubuntu, no hardware acceleration is currently supported on VMs AFAIK. |
well i tried but some issues |
@devashishraj Please take a look at the build commands used in gazebosim/gazebo_test_cases#804. M1 (ARM) machines are not fully supported yet, so we don't have any official documentaiton. |
https://gist.github.com/devashishRaj/83627f1d729ddb6d31bb80ea6cb687d6 |
@devashishRaj did you unlink brew unlink qt This is to prevent a conflict - |
i did not , i followed this guide : https://gazebosim.org/docs/harmonic/install_osx_src |
The unlinking qt (=qt@6) is an extra step. You still need to follow the instructions to install qt@5. My oversight as I should request to have the instructions updated to include the unlink step if a conflict is observed. |
i'll try source install again on weekend , also i tried brew install again after watching recent commits and gz-harmonic seems to working with some minor ui bugs on m2 pro and it's just way faster. |
Hello @ARLunan , could you please tell how to install Humble and gz sim natively? You can point some sources as well if possible. Thanks a lot, |
Hi, As an exclusive ros2 user, I do not use Humble and gz-sim natively, using instead Parallels 19 VM configured with Ubuntu 22.04 & ROS 2 Humble Desktop Full. I usually disable Graphics Acceleration in Desktop Control and rviz and ign gazebo run ok. Parallels seems to have made some changes in this ver 19 that works better. I should add that I cannot install the new gz harmony or iron in the UB22 VM as arm64 binary install packages are not yet release and the compile from source don’t work. |
Thank you for the information @ARLunan , let me ask you a quick detail then: I am also trying to use Parallels 19 with Ubuntu 22.04 and ROS Humble. I see that some people are very happy with the performance, but they have M1 Pro or Max chips I suppose, but I have a Macbook Pro M1 model from 2020. In the Parallels forum, some users say that they enable 3D Acceleration with a trick (by setting OGRE_RTT_MODE=Copy, you can check here: https://forum.parallels.com/threads/black-screen-with-3d-acceleration-enabled-for-gazebo-and-rviz-robotic.355825/ ), but when I do that Gazebo never responds, I get a black screen and it shuts down; when I disable 3D acceleration, performance is only acceptable for rather simple cases as far as I tried. I thought, maybe I couldn't install the right Gazebo version, especially since you mention ignition Gazebo as well. I installed the ros humble desktop full, then installed gazebo garden using binary, from this link: https://gazebosim.org/docs/garden/install_ubuntu . Are you using this version as well? I didn't specifically install an ignition Gazebo version, but found this link: https://gazebosim.org/api/gazebo/6.1/install.html . Do you suggest me to install it? I am fairly new to ROS2, and I hope more developers release arm64 versions for their packages. I am afraid it will take years though... |
@srmainwaring could you please elaborate on this topic, it would be great to run ROS and Gazebo on Mac natively (I have a MacBook Pro M1 from 2020 and performance of Gazebo -I tried Garden and Fortress- is barely acceptable). Any source or explanation will be great. Thanks, |
@Kakcalu13 Can you comment on what steps you took to install gazebo on your M2? Is it just |
Hi @azeey, No, unfortunately, it's not just one step. What I did was perform these steps: ulimit -n unlimited
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
brew tap osrf/simulation
brew install gz-harmonic In my case (using @scpeters's theory, since it is most likely the case), I had to reboot my Mac after encountering an error like this:
My Mac is an M2 mini Mac Pro with 16 CPU cores and Ventura 13.4 for those who wonder what kind of Mac I'm using.
On a side note, I skimmed all the way from top to bottom. I can only speak for M2. I'm exclusively a Linux user, which has been treating me well so far. M2 is my new place to experience. I still haven't had any luck with Windows 8, as it's my primary computer. I'd suggest people use arm64 as a VM if they want to install Gazebo on a VM inside a Mac. Macs don't work well with amd64. The issue above sounds so familiar, which is linked to #1362 (comment). M1 and M2 should be exactly the same, as I'm a developer for Docker. (I haven't tried parallel). Anyone is welcome to tag me on M2/M1 issues. On personal side, Since you, gazebo developers, are reading this...is there any difference between Harmonic and Fortress/Citadel/Garden in SDF programming? O:-) |
I Use Mac Mini M1 and Parallels 19.1 VM Ubuntu 22.04/ROS 2 Humble. Successfully run rviz and ign gazebo. I note that there is no CPU & Memory "Enable Acceleration" setting, instead is "Advanced Hypervisor" checkbox. ign gazebo (ver 6) and rviz run ok enabled or not. Enable I get this message" libEGL warning: Not allowed to force software rendering when API explicitly selects a hardware device.' Doesn't seem to affect performance. Then installed gz harmonic from Binary and gz sim shapes.sdf loads ok. ros-gz is already installed. |
Thank you @ARLunan . In Parallels there is an option called "Enable 3D Accelerations" , and you disable it, right? Where is the "Advanced Hypervisor" checkbox by the way? I allow 3D Acceleration in Parallels, and in Ubuntu .bashrc, I write export LIBGL_ALWAYS_SOFTWARE=1, if I don't write that Gazebo automatically quits; but since I wrote that it doesn't quit. Nevertheless, in the quadcopter world for instance, I get a super slow response, there is immense lag. Similarly, in Prius world, the response is slow. Only using Nao robot (very simple world with just one robot), for instance, the performance is okay. Is that similar in your case? Can you run complex worlds fluently? Note that, I choose those worlds from the GUI of Gazebo, I write "ign gazebo" without specifying any worlds, and then choose the ones I mentioned. If you can run fluently those in Parallels, I will try to follow your steps. |
Hello @Kakcalu13 , thank you for the information! I see that you put a lot of effort for making Gazebo work natively in M1, congratulations. I also saw that you run (or spin maybe) your robot ( #1362 (comment) ). Did you try the complex worlds in Gazebo? Like, quadcopter teleop or Prius on a highway . Right now, I use Parallels VM with arm64 Ubuntu 22.04 and ROS Humble, with Gazebo Fortress (also tried Garden, performance is similar). when I run these complex worlds, the performance fluctuates between 20% and 100% (as written at the bottom right of the Gazebo GUI), but I can tell that it is unacceptable, a lat of lag is present. Can you run those environments smoothly? I've never used Docker but if it works smoothly I will also try that way. Of course, we have to keep in mind that you have an M2 Pro whereas I have a regular M1, still I remember many people mention RoboStack which is related with Docker. Some links: https://www.linkedin.com/feed/update/urn:li:activity:6865851557758533632/ |
Hi @staycoolish! I've tried out multiple complicated worlds. You can see it in action in Gazebo's tools from 0:04 to 0:23. (Big shoutout to this OP! #855 for the camera!!) https://www.youtube.com/watch?v=h-yra2-bHZE. I've used a Blender environment, multiple sensors, and various types of robots. Oh boy!! I had to dust off my old Dockerfile and run it on my M2. Everything felt so old, and it's only been a year! The current setup is ten times better than before! Anyway... Take a look at this link: https://github.com/gazebosim/gz-sim/assets/65916520/014e4b94-a242-4e99-b80d-678a09fde022. I was able to use quadcopter, Prius, and some other features on Docker. The thing is that my team and I are currently focused on other projects and haven't touched Gazebo in a while. We will resume with Gazebo later. I use Gazebo in my free time now. Anyway.... I must emphasize that this is Citadel on Docker. Regarding your comment about performance, that's exactly why I chose Citadel. If you use Fortress, Garden, or Harmonic, it will be much more resource-intensive than Citadel. Fortress, Garden, or Harmonic are much larger and more complex than Citadel. Citadel was kind of new at the time, so it was able to work with Docker due to lower rendering requirements (I'm not entirely sure if I'm using the terminology correctly). Honestly, Gazebo performs better with a local/native setup rather than in a virtual machine. If you still want to use a VM, go for 20.04, as I believe it's currently only supported on that Citadel. Citadel is now EOL, I believe. I personally need smooth graphics too, and so far, native/local setups are the only ones I've used. You can use Docker, but you'll need to allocate more CPU cores, maybe up to 10 or the maximum available which is what you see in the second video. Harmonic on the M2 Mac was my very first time on a Mac. If it worked on M2, it should work with M1 as well. I have a regular M1 at my office. I'm not familiar with robotstack, sorry :( but thanks for the information! Could you give this a try on your M1? Open a terminal and run:
Alternatively, you can try running |
[staycoolish]:On my Parallels Ver 19.1.0, Ubuntu 22.04 Desktop/ROS 2 Humble Full. I Enable 3D Acceleration, which is under Configuration> Graphics>Advanced. I enable Adaptive Hypervisor under Configuration > Graphics > Advanced. |
Thank you @ARLunan , on MacBook Pro M1 the Adaptive Hypervisor option is not visible, I suppose due to the hardware difference. In that case, my setup is as good as it can be. Most probably I'll not keep using Parallels or any other VM. |
Thanks a lot @Kakcalu13 for the detailed information! The project you and your team work on seem very very interesting, actually I will check it further. Also, the visuals you created look great! I already tried most of the VMs (Multipass, UTM, Parallels), Parallels was by far the most stable and the fastest one, UTM is said to have GPU Acceleration but after the installation all I had was a black screen, and I tried a couple of times. I think they are not good enough yet for simulating robots. I will definitely try Citadel very soon. On M1 chip, there are 8 cpu cores; and for VMs it is recommended to use 4 of them. I believe performance would be at least on par with the VM Gazebo. I think the code you provided is for installing Gazebo only, I will also check how or whether I can install ROS2 on M1 as well. Thanks a lot, again, for making time for all these explanations! Perhaps this can be helpful for you too: We consider different simulation alternatives these days and found Coppeliasim also worth trying. I am not sure about their different capabilities, but it seems well established as well, and they even have a native Apple silicon version. |
@staycoolish Are you not able to use gz-harmonic natively on the M1? I guess I'm not sure why you're using a VM. |
Hi @staycoolish, I'd strongly encourage you to install natively. I was able to install it on M2, so you should be able to as well. Also, if I may humbly suggest, let's try to keep the conversation focused on Gazebo-related topics since this whole GitHub repository is dedicated to Gazebo. I don't think the Gazebo team can provide much assistance with ROS2 here, even if they are part of the same company as ROS. Regarding your mention of Coppeliasim, thanks! I'll definitely check it out. I'm currently using Gazebo for gaming-related purposes in my free time, haha. I hope Citadel worked out for you! @azeey's question has piqued my curiosity as well. I'm curious as to why you have to use a VM. For me and my team, we wanted to use a VM to deploy and allow all platforms to use Gazebo on VM. Is this the case for you as well? This is why I wanted to see if it's possible to export Gazebo projects like this: #1336. You know how Unity, Godot, or some other programs allow you to export projects and deploy them on various platforms? I was hoping that Gazebo could do the same thing which is why I requested the feature! |
Hello @azeey , @Kakcalu13 , Regarding using VM; I actually never tried because so far I've used ROS 1 in Ubuntu with Gazebo, and I thought it would be safer to stay in the familiar Ubuntu environment, plus I could've used both ROS 1 and ROS 2. That was my main motivation, but recently I noticed that not all companies have published/updated their packages for ROS 2. Most probably I'll mainly keep using my old Windows/Ubuntu PC with ROS installed in that case :D My case is totally academic work actually, with minimal development requirements like yours. I was very happy with portability & quietness of my Macbook, I didn't want to carry a second computer (and test M1's capabilities in a way). I understand the functionality you are looking for (similar to Unity, etc.), but since I've used Gazebo only for visualization, I couldn't get what can be a project to be exported in Gazebo sense (or how to use it for gaming :D). I guess it is somehow like a plugin for the Gazebo? Your team seems very ambitious and I hope you can get the needed functionality. Thanks for all the help and insight! |
I ran |
what worked for me was: |
This worked for me as well. I have a 2021 M1 Macbook Pro with Parallels/Ubuntu 22.04. The approach was to force software rendering through llvmpipe which emulates OpenGL software rasterizing.
|
Environment
Description
Literally installed Gazebo Garden on a brand new Ubuntu virtual machine. Was trying to test the new gazebo since I only used the classic version before.
Did the command to start the demo:
gz gazebo shapes.sdf
And got the error on the terminal:
Also tried opening the gazebo from the app selector. It loads, and I click on one of the environments such as the empty one and it loads and crashes a few seconds later.
The text was updated successfully, but these errors were encountered: