isl-org / isl-org/Open3D

compute_fpfh_feature hanging if excecuted inside a multiprocessing.Process

Open
#6,096 1 comment 0 reactions 0 assignees View on GitHub
bug
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](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).

### Describe the issue

If the function `o3d.pipelines.registration.compute_fpfh_feature` is excecuted inside a Process that is not the main one, it never exits the function. It works fine with Threads though.

[input]
```
from multiprocessing import Process
import open3d as o3d
o3d.utility.set_verbosity_level(o3d.utility.VerbosityLevel.Debug)

path = "any/pointcloud/file.pcd"
pcd = o3d.io.read_point_cloud(path)

def compute_fpfh(pcd):
print("start")
pcd_fpfh = o3d.pipelines.registration.compute_fpfh_feature(
pcd,
o3d.geometry.KDTreeSearchParamHybrid(radius=1, max_nn=100)
)
print("end")
return pcd_fpfh
```
[input]
```
compute_fpfh(pcd)
```
[output]
```
start
end

Feature class with dimension = 33 and num = 1000
Access its data via data member.
```
[input]
```
process = Process(
target=compute_fpfh,
args=(pcd,)
)
process.start()
process.join()
```
[output]
```
start
```

### Steps to reproduce the bug

```python
from multiprocessing import Process
import open3d as o3d
o3d.utility.set_verbosity_level(o3d.utility.VerbosityLevel.Debug)

path = "any/pointcloud/file.pcd"
pcd = o3d.io.read_point_cloud(path)

def compute_fpfh(pcd):
print("start")
pcd_fpfh = o3d.pipelines.registration.compute_fpfh_feature(
pcd,
o3d.geometry.KDTreeSearchParamHybrid(radius=1, max_nn=100)
)
print("end")
return pcd_fpfh

compute_fpfh(pcd)
process = Process(
target=compute_fpfh,
args=(pcd,)
)
process.start()
process.join()
```

### Error message

_No response_

### Expected behavior

_No response_

### Open3D, Python and System information

```markdown
- Operating system: Ubuntu 20.04 (WSL)
- Python version: Python 3.8
- Open3D version: 0.16.1+1c84344a
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): ?
```

### Additional information

_No response_

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.