Why CUDA logging is not supported?
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](https://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](https://www.open3d.org/docs/release/) and the [latest documentation](https://www.open3d.org/docs/latest/) (for `main` branch).
### My Question
Hi, thanks for your excellent work on 3D data processing. In the past few days, I extended TSDF volume integration with semantic info supported but the compile error
```text
/home/admin17/vision3d/projects/open3d/Open3D-0.18.0/cpp/open3d/t/geometry/kernel/VoxelBlockGridImpl.h(207): error: calling a __host__ function("void open3d::utility::Logger::LogInfo_< > (const char *, int, const char *, const char *, T1 &&...)") from a __device__ function("void open3d::t::geometry::kernel::voxel_grid::IntegrateCUDA (const ::open3d::core::Tensor &, const ::open3d::core::Tensor &, const ::open3d::core::Tensor &, const ::open3d::core::Tensor &, ::open3d::t::geometry::TensorMap &, const ::open3d::core::Tensor &, const ::open3d::core::Tensor &, const ::open3d::core::Tensor &, int, float, float, float, float)::[lambda(int) (instance 1)]::operator () const") is not allowed
```
indicates `utility::LogInfo()` implemented in CPU cannot be used in `core::ParallelFor()` if current device is CUDA.
If my judgement is true, I would like to ask why is logging unsupported in CUDA? Is it just unsupported for now and will be implemented in the future or there are some other concerns, like efficiency, making this implementation impractical? I noticed that `printf()` has a CUDA implementation hence used occasionally in the source code, but too much `printf()` is time-consuming hence unacceptable (tested on my local machine).
Since I'm a novice in cuCuda, any suggestions or corrections on my misunderstanding are welcomed.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with cpp/open3d/t/geometry/kernel/VoxelBlockGridImpl.h around the reported call to utility::LogInfo inside IntegrateCUDA, then inspect core::ParallelFor and existing CUDA printf usage. Determine whether CUDA-device logging is intended to be supported and document the constraints or implementation scope needed for a complete solution.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- computer-graphics
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100