autoware icon indicating copy to clipboard operation
autoware copied to clipboard

Fix ARM build of scenario_simulator

Open kenji-miyake opened this issue 3 years ago • 5 comments

libembree-dev can't be installed on ARM. https://github.com/autowarefoundation/autoware/pull/8#issuecomment-1014333684

  • Build embree manually
  • Run rosdep install with --skip-keys=embree

kenji-miyake avatar Jan 17 '22 10:01 kenji-miyake

This pull request has been automatically marked as stale because it has not had recent activity.

stale[bot] avatar Apr 14 '22 11:04 stale[bot]

@kenji-miyake what do you think of having an embree_vendor package and have scenario_simulator depend on it? If libembree-dev is installed on the system, that'll be used, and if not, build it.

esteve avatar May 26 '22 09:05 esteve

@esteve I think it's great! @hakuturu583 What do you think?

kenji-miyake avatar May 26 '22 12:05 kenji-miyake

I arleady developed embree_vendor package, but it takes a lot of time.

https://github.com/OUXT-Polaris/embree_vendor

hakuturu583 avatar May 26 '22 15:05 hakuturu583

And also, I have not tested this vendor package on arm CPU.

hakuturu583 avatar May 26 '22 15:05 hakuturu583

Hi, any updates on this issue ?

@hakuturu583 Can we use embree_vendor package on arm CPU ?

oguzkaganozt avatar Sep 27 '23 10:09 oguzkaganozt

@hakuturu583 Can we use embree_vendor package on arm CPU ?

Yes, I tested on qemu and it works.

hakuturu583 avatar Oct 02 '23 06:10 hakuturu583

Hi @hakuturu583, I've tried with Scenario Simulator master branch and embree_vendor. It uses embree version 4.2.0 and when I try to do: colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --packages-up-to simple_sensor_simulator

I got following error on compilation: error: ‘RTCIntersectContext’ has not been declared

I also checked with the original Embree version 4.0 changelog and it says: RTCIntersectContext is renamed to RTCRayQuery context and most members moved to new RTCIntersectArguments and RTCOccludedArguments structures.

So it appears that embree version 4.x is not fit for Scenario simulator. How should I proceed do you have any suggestions ?

Thanks in advance.

oguzkaganozt avatar Oct 04 '23 16:10 oguzkaganozt

I just checked installed embree apt package in my amd64 platform. It looks like I have version 3.12.2 installed. May be you could try changing this line to v3.12.2.

mitsudome-r avatar Oct 05 '23 13:10 mitsudome-r

I tried building with v3.12.2 and it requires libTBB version 2021.1.1 and is incompatible with 2021.5.0 that we have on Ubuntu22/arm64. Also tried version v3.13.5 and it failed with error: unrecognized command-line option ‘-msse2’ seems like the flag incompatibility with arm64.

oguzkaganozt avatar Oct 05 '23 14:10 oguzkaganozt

I was able to build on arm with the following workaround:

  1. Use Embree 3.13.5 and cherry-pick https://github.com/embree/embree/commit/82ca6b5ccb7abe0403a658a0e079926478f04cb1 as mentioned in this issue. I've created a fork of embree_vendor with the fix so you can use the following:
cd autoware/src/universe/external
git clone -b v3.13.5_arm https://github.com/mitsudome-r/embree_vendor
  1. Modify simple_sensor_simulator's dependency in package.xml to use embree_vendor instead of embree.
  2. Even with the above fix, I still had errors from Eigen in openscenario_visualization package related to this issue. I added this warning as exception in the compile option as a quick fix.

For 2 and 3, you can checkout my fork:

cd autoware/src/simulator/scenario_simulator
git remote add https://github.com/mitsudome-r/scenario_simulator_v2
git fetch mitsudome-r
git checkout arm

mitsudome-r avatar Oct 18 '23 20:10 mitsudome-r

Related Issue: https://github.com/tier4/scenario_simulator_v2/issues/1094

mitsudome-r avatar Oct 19 '23 13:10 mitsudome-r

I was able to build on arm with the following workaround:

  1. Use Embree 3.13.5 and cherry-pick embree/embree@82ca6b5 as mentioned in this issue. I've created a fork of embree_vendor with the fix so you can use the following:
cd autoware/src/universe/external
git clone -b v3.13.5_arm https://github.com/mitsudome-r/embree_vendor
  1. Modify simple_sensor_simulator's dependency in package.xml to use embree_vendor instead of embree.
  2. Even with the above fix, I still had errors from Eigen in openscenario_visualization package related to this issue. I added this warning as exception in the compile option as a quick fix.

For 2 and 3, you can checkout my fork:

cd autoware/src/simulator/scenario_simulator
git remote add https://github.com/mitsudome-r/scenario_simulator_v2
git fetch mitsudome-r
git checkout arm

Thanks @mitsudome-r that solved the issue.

oguzkaganozt avatar Oct 19 '23 16:10 oguzkaganozt