isl-org / isl-org/Open3D

Jupyter Lab Python Kernel crashes when I try to close the visualization window

Open
#5,945 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

[###](url) 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

In Jupyter lab, I try to render an STL file using the open3d.visualization.draw_geometries() method. When I run the program, I get an error: "Cocoa: Failed to find service port for display", however a window pops up as expected, showing my successfully rendered geometry. The name of the process underwriting this window is "Python" (according to the Activity Monitor). Looking good so far.

The problem arises when I try to close the window containing the rendering. The window doesn't close; instead the process stops responding and I'm hit with the rainbow spinning wheel, causing me to force quit the application from the Activity Monitor. This happens every time I run the program on Jupyter lab.

However, it's worth noting that this problem is absent when I run the same lines of code with Visual Studio Code, which I'm taking to mean there's something funky with Open3D's integration with Jupyter. In VSCode, I still get the "Cocoa: Failed to find service port for display" error, but I am able to close the render window no problem.

### Steps to reproduce the bug

```python
import numpy as np
import open3d as o3d
temp = o3d.io.read_triangle_mesh('test_sphere.stl')
print(temp)
o3d.visualization.draw_geometries([temp])
```

### Error message

[Open3D WARNING] GLFW Error: Cocoa: Failed to find service port for display

### Expected behavior

- Render window closes

### Open3D, Python and System information

```markdown
- Operating system: MacOS 13.1 (22C65)
- Python version: Python 3.9.1
- Open3D version: 0.16.1
- Jupyter lab version: 3.2.2
- System architecture: apple-silicon
- Is this a remote workstation?: no
- How did you install Open3D?: pip
- Compiler version (if built from source): N/A
```
[test_sphere.stl.zip](https://github.com/isl-org/Open3D/files/10810417/test_sphere.stl.zip)

### Additional information

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.