NVlabs / nvdiffrast

Nvdiffrast - Modular Primitives for High-Performance Differentiable Rendering
Other
1.31k stars 139 forks source link

VirtualGL crash #54

Closed wpalfi closed 2 years ago

wpalfi commented 2 years ago

We would like to use VirtualGL for remote visualization but it crashes with nvdiffrast. Minimal example:

#test_nvdiffrast.py
import nvdiffrast.torch as dr
dr.RasterizeGLContext()
$ /opt/VirtualGL/bin/vglrun python test_nvdiffrast.py
Failed to establish dbus connectionSegmentation fault (core dumped)

Loading the plugin seems to work. The crash happens in RasterizeGLStateWrapper(): https://github.com/NVlabs/nvdiffrast/blob/main/nvdiffrast/torch/ops.py#L160

(I get Failed to establish dbus connection also without vglrun, so I guess it is not related to the VirtualGL problem.)

nvdiffrast version: https://github.com/NVlabs/nvdiffrast/commit/e44c9a29867addc8b98982deeec1f66c4a7d8b54 OpenGL 4.6.0 NVIDIA 495.29.05 Ubuntu 20.04.3 LTS Cuda 11.3.1 Pytorch 1.10.0 python 3.8.12 gcc 9.3.0

s-laine commented 2 years ago

According to this issue, at least still in June 2021 EGL was only available in the dev branch of VirtualGL. Perhaps that explains the crash? We don't use VirtualGL so I really don't know what works and what doesn't work under it. If the EGL support in VirtualGL is still experimental enough to not be included in the mainline, I don't know if this kind of setup with headless EGL and OpenGL/Cuda interop can even theoretically work with VirtualGL at the moment.

wpalfi commented 2 years ago

Thanks for the quick response. Then we will stick to software rendering for the moment. Would be happy to hear if someone gets VirtualGL+nvdiffrast running (or any similar solution).