trimesh icon indicating copy to clipboard operation
trimesh copied to clipboard

[help-wanted] use ray_pyembree in Apple Silicon M1

Open YuanWenqing opened this issue 3 years ago • 5 comments

I installed pyembree in MBP M1 according to https://github.com/mikedh/trimesh/blob/main/docker/builds/embree.bash , but importing failed:

python -c 'import trimesh.ray.ray_pyembree'

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "../python3.8/site-packages/trimesh/ray/ray_pyembree.py", line 10, in <module>
    from pyembree import rtcore_scene
ImportError: dlopen(../python3.8/site-packages/pyembree/rtcore_scene.cpython-38-darwin.so, 0x0002): symbol not found in flat namespace '_rtcCommit'

I guess the reason is that embree-2.17.7.x86_64.macosx.tar.gz was compiled in x86_64. Running embree in Rosetta in some way may work, but I've no idea how.

Could anyone help?

YuanWenqing avatar Jun 07 '22 09:06 YuanWenqing

It seems [email protected] under arm64 not works but [email protected] under x86_64 works

YuanWenqing avatar Jun 07 '22 10:06 YuanWenqing

Hey, embree is intel's raytracer that they designed to show off the fancy features of their x86_64 processors (they only release for x86_64), I think embree is extremely unlikely to ever build on an ARM of any kind.

I think a better bet would be adding another ray-query backend (PR's welcome!), ideally one that was a little simpler and written in C/C++, maybe something sort of like pyoctree, although that hasn't had any commits in the last 5 years.

mikedh avatar Jun 07 '22 16:06 mikedh

Embree added support for Apple M1 CPUs since 3.13.0 . I see #1108 using embree3 and python-embree but now closed. Would it go further?

YuanWenqing avatar Jun 08 '22 01:06 YuanWenqing

Oh nice that’s surprising! Yeah then this would be dependent on getting some variant of the embree3 support as described in #1557 merged (and maybe also a pr to get arm wheels building in the embree3 binding).

On Tue, Jun 7, 2022 at 9:41 PM 方武卓 @.***> wrote:

Embree added support for Apple M1 CPUs since 3.13.0 . I see #1108 https://github.com/mikedh/trimesh/pull/1108 using embree3 and python-embree but now closed. Would it go further?

— Reply to this email directly, view it on GitHub https://github.com/mikedh/trimesh/issues/1601#issuecomment-1149355182, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAKWRQTGBQTA5ZHJWQ43GNLVN724XANCNFSM5YCILJUQ . You are receiving this because you commented.Message ID: @.***>

mikedh avatar Jun 08 '22 01:06 mikedh

Thanks for responses. Looking forward to that.

YuanWenqing avatar Jun 08 '22 02:06 YuanWenqing

I'd consider using ncollpyde. It's fast (wraps Rust) and has universal wheels (i.e. installs easily on all platforms).

schlegelp avatar Oct 16 '22 15:10 schlegelp