facebookresearch/pytorch3d

test_opengl_utils.py doesn't appear to release lock.

Closed this issue ยท 2 comments

๐Ÿ› Bugs / Unexpected behaviors

Running pytest tests/test_opengl_utils.py test/test_rasterizer.py will hang on test_rasterizer.py. Neither hangs when running them as separate processes, but test/test_rasterizer.py is not unique in hanging (egl context seem to be the common denominator).

Modifying https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/renderer/opengl/opengl_utils.py#L187 to use threading.RLock instead yields errors instead of hanging (you might also want to replace https://github.com/facebookresearch/pytorch3d/blob/main/pytorch3d/renderer/opengl/opengl_utils.py#L227-L235 with a with self.lock: context for simplicity).

Doesn't seem to be a critical issue but, hard to tell as you'd expect tests to not fail (there was a smattering of other failures as well, might report them separately).

I knew that some sort of problem like this was around. Thank you very much for the report.

The OpenGL renderer is a bit stuck at the moment: internally the dependencies are not working and it is not in use. Its tests are not working.

The attached commit makes both changes.