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

Extremely slow in initialisation of cuBVH #18

Open
YZsZY opened this issue Aug 5, 2024 · 5 comments
Open

Extremely slow in initialisation of cuBVH #18

YZsZY opened this issue Aug 5, 2024 · 5 comments

Comments

@YZsZY
Copy link

YZsZY commented Aug 5, 2024

Hello author~ Recently I've been testing cuBVH in RTX 3070, torch 2.1.0, cuda 11.8, ubuntu 20 and I found that when initializing the mesh is extremely slow and takes half an hour, however, the same mesh using raytracing initialises in just 10 seconds or so, I'd like to ask you if you've encountered this problem!

import cubvh
import raytracing
import trimesh

mesh_file = "XXX.obj"
scene_mesh = trimesh.load(mesh_file)
scene_tracer = cubvh.cuBVH(scene_mesh.vertices,scene_mesh.faces)  # raytracing.RayTracer(scene_mesh.vertices, scene_mesh.faces)
@YZsZY
Copy link
Author

YZsZY commented Aug 5, 2024

I install cuBVH in RTX 4070, torch-1.13.0-cu117, initializing the same mesh file is very fast, but in RTX 3070,torch-2.1.0-cu118 is very slow T-T

@ashawkey
Copy link
Owner

ashawkey commented Aug 6, 2024

@YZsZY Hi, it sounds strange as the raytracing package almost uses the same code as cubvh. Have you tried running several times and average the time? The first run's time maybe inaccurate.

@YZsZY
Copy link
Author

YZsZY commented Aug 7, 2024

@ashawkey Hi, thanks for the reply~ I tested it on two different sizes of mesh, the speed is similar on a very simple mesh, but on a very complex mesh (scannet++) the difference is huge, I encountered this on 3060, 3070, and A100 with cuda11.8+torch2.1.0,it's really strange T-T.

With a complex mesh:
lX4HqbsnRA
ScreenCapture_2024-08-07-11-19-31

With a simple mesh:
lHQS0duvZs
ScreenCapture_2024-08-07-11-21-01

@HarukiZhang
Copy link

HarukiZhang commented Aug 20, 2024

Hello, guys, I have also encountered this slow initialization.

In my case,

  • ubuntu 20.04,
  • RTX 4090 D, driver 550.67
  • CUDA 11.8,
  • pytorch 2.0.0,
  • cubvh 0.1.0,
  • libstdc++.so.6.0.29 is used in my environment;

When I tried to initialize cubvh with a scene that contains 3773056 vertices and 7155510 faces, it takes 323 seconds for initialization and 0.001568 sec for .ray_tracing() for 2^20 rays;

I wonder whether this initiliazation time comsumption is normal?

@ashawkey
Copy link
Owner

@HarukiZhang I guess at this level of vertices and triangles, it's normal.

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

3 participants