Skip to content
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

Signed distance - How to increase performance ? #1715

Closed
MagicFeeling opened this issue Oct 12, 2022 · 5 comments
Closed

Signed distance - How to increase performance ? #1715

MagicFeeling opened this issue Oct 12, 2022 · 5 comments

Comments

@MagicFeeling
Copy link

Hello,
thank you for this amazing library. Its really amazing. Currently I am using the signed distance function a lot and I was wondering if there is a way of how to increase performance. I need to test chunks of between 1000 and 2000 coordinates which take quite some time. Is there any hardware suggestion I could get in order to increase the speed? (Faster RAM or faster CPU) or is there any GPU support ?
Thank you in advance

@mikedh
Copy link
Owner

mikedh commented Oct 12, 2022

Hey, glad it's useful! Contains tests are probably using trimesh's tragically slow but accurate numpy based ray check, one of the wishlist items in #1557 is speed-ups for the native ray checks.

You could also install embree (which does have some precision issues like #242) but is ~50x faster. If you're on linux you can probably install it with this bash script.

Speedup PR's for the native raytracer also super welcome! Check out the contributing guide, running your script under pyinstrument and embedding at hotspots is probably a good way to start looking into it.

@MagicFeeling
Copy link
Author

Thank you for your response. I tried to use embree but it seems not working for me. I am using a conda environment and installed it with conda - embree. Is embree processor dependent or is there anything else I need to install. I also installed trimesh with Anaconda. The statement if ray.has_embree and use_embree: in the file base.py seems to fail. I set use_embree to true.

@mikedh
Copy link
Owner

mikedh commented Oct 13, 2022

You'd probably also need to install pyembree: https://anaconda.org/conda-forge/pyembree

@mikedh
Copy link
Owner

mikedh commented Oct 13, 2022

You could also try running in the trimesh/trimesh:latest docker images which include embree.

@MagicFeeling
Copy link
Author

Your suggestions perfectly work, thank you. I had to downgrade from python 3.9.7 to 3.8.8. tho. But that wasn't a problem. Thanks a lot.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants