Potentially unnecessary CUDA dependency
In point_to_mesh_distance, a call to torch.cuda.synchronize causes a fatal crash on systems without NVIDIA GPUs installed.
This synchronize call seems redundant since the _unbatched_naive_point_to_mesh_distance only gets called if the inputs are not on a CUDA device.
We encountered this when trying to use the CPU wheel at https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.8.0_cpu.html in a CI pipeline on a machine without a GPU.
Hi @a-gardner1 , good catch! I can't recall why this torch.cuda.synchronize() is here, but I'll try to run CI after removing it.
Thanks!
I will take this issue. Please assign it to me.
The torch.cuda.synchronize call in point_to_mesh_distance appears unnecessary. It is reached even when inputs are not on a CUDA device, which causes a crash on non-GPU systems. I would first inspect the logic around line 91 to confirm the conditions under which the function is called. Then, I would remove or guard the synchronize call to ensure it only executes when a CUDA device is present. I will test the change on both CPU and GPU setups to verify the fix.
I am looking into this now. I will check the logic and test the changes on both CPU and GPU setups. Let me know if there are any specific tests you want me to run.
Stale issue, please reopen if still relevant