-
Notifications
You must be signed in to change notification settings - Fork 1.4k
marching_cubes does not work for cuda tensors #1679
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
Comments
I broke the marching_cubes cuda implementation recently with my commit 6f2212d which was attempting to fix windows' build problems (see #1610). Fixing the type error you are seeing (which is easy) doesn't give the right result. This needs investigating. For the moment, it would be easiest to build from a source checkout, changing marching_cubes.cu to the previous version. |
Thanks, I'll give that a try -- are there any tests in the pytorch3d repo I can run to check correctness? |
Turns out all the test_marching_cubes tests are checking cpu only (where output order is deterministic). That's how this went wrong. Ideally the same tests would check gpu too. |
Turns out all the test_marching_cubes tests are checking cpu only (where output order is deterministic). That's how this went wrong. Ideally the same tests would check gpu too. In fact, fixing the typing in the new code works. |
Summary: Change the data type usage in the code to ensure cross-platform compatibility long -> int64_t <img width="628" alt="image" src="https://github.com/facebookresearch/pytorch3d/assets/6214316/40041f7f-3c09-4571-b9ff-676c625802e9"> Tested under Win 11 and Ubuntu 22.04 with CUDA 12.1.1 torch 2.1.1 Related issues & PR #9 #1679 Pull Request resolved: #1689 Reviewed By: MichaelRamamonjisoa Differential Revision: D51521562 Pulled By: bottler fbshipit-source-id: d8ea81e223c642e0e9fb283f5d7efc9d6ac00d93
hi @bottler, thank you for taking care of this case. Can I ask if you have any updates on this? (I'm using v0.7.5) |
Uh oh!
There was an error while loading. Please reload this page.
🐛 Bugs / Unexpected behaviors
pytorch3d.ops.marching_cubes.marching_cubes()
does not work on v0.7.5 for cuda tensors. It throwsRuntimeError: expected scalar type Int but found Long
.Instructions To Reproduce the Issue:
I am using
torch==2.1.0+cu121
and I installedpytorch3d
via:The following snippet raises the error:
This raises
RuntimeError: expected scalar type Int but found Long
.The text was updated successfully, but these errors were encountered: