isl-org / isl-org/Open3D

Segmentation fault when importing first PyTorch 2.2.2 and then Open3D 0.18.0

Open
#6,757 5 comments 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](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).

### Describe the issue

Importing torch and then open3d in that order causes a segmentation fault.

### Steps to reproduce the bug

First install packages:
```python
$ pip install open3d torch
```

To reproduce the bug, first import torch and then open3d:
```sh
$ python -c "import torch;import open3d;print('ok')"
OMP: Error #179: Function pthread_mutex_init failed:
OMP: System error #22: Invalid argument
zsh: segmentation fault python -c "import torch;import open3d;print('ok')"
```

This however doesn't reproduce in the opposite order:
```sh
$ python -c "import open3d;import torch;print('ok')"
ok
```

### Error message

```
OMP: Error #179: Function pthread_mutex_init failed:
OMP: System error #22: Invalid argument
zsh: segmentation fault python -c "import torch;import open3d;print('ok')"
```

### Expected behavior

The order of imports should not matter and it should not throw a segfault.

### Open3D, Python and System information

```markdown
- Operating system: macOS Sonoma 14.0
- Python version: Python 3.10.12
- Open3D version: 0.18.0
- System architecture: apple-silicon (m1 pro)
- Is this a remote workstation?: no
- How did you install Open3D?: pip
- Compiler version (if built from source): Not relevant
```

### Additional information

I tried to install the latest development wheel but I get HTTP error 404.

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.