-
Notifications
You must be signed in to change notification settings - Fork 2.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Headless OpenGL rendering #17
Comments
Yes. |
As we discussed today, glfw 3.3 is not available yet. So we need to find the detour.
but got the error.
Basically |
Recently I have the needs for glfw rendering on headless server and have gain some success. In short, Alexey's email is absolute correct. First, you need to setup Xorg correctly. Then, if you don't want to specify a GPU, you can just setup the environment variable
You should see something like:
If your server has multiple GPUs, you will be able to see multiple copies of the above information. If you have passed this test, setup the
There is a risk that you will have this error
This is an error of version 3.2 and older. They don't support headless rendering. Since 3.3 (current master) it is supported. In addition, if you want to specify GPU, you can use VirtualGL and TurboVNC to mock a display. This is done with the following steps. First, install VirtualGL and TurboVNC, something like:
Then launch vnc server to run glfw.
|
Another option is to mimic libigl's tcpviewer. Lower priority. Close for now. |
This is pretty important. Do we have to close this issue? Can we release
Open3D while this is open? I'm guessing we can. But I don't want this to
fall through the cracks, I want this clearly on the list of issues that
need to be addressed soon. (Perhaps not prior to release, but soon after.)
Vladlen
…On Mon, Dec 4, 2017 at 11:18 AM, Qianyi Zhou ***@***.***> wrote:
Another option is to mimic libigl's tcpviewer.
See this for reference:
https://github.com/libigl/libigl/blob/master/python/tcpviewer.py
Lower priority. Close for now.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#17 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AJra2imGPNUwSeKsdH4b2VLZU35rtm_mks5s9EWcgaJpZM4NXPQW>
.
|
Reopen per request. |
Other than VNC there is also xpra https://xpra.org/trac/wiki/Usage/OpenGL |
As another user, this would be an excellent feature! 👍 |
Working on this. I am using glfw3.3_dev to avoid hassles. |
Another approach is to use Docker to create a headless environment for Open3D. If we need access to the host GPU (NVIDIA) there are already good solutions to get that: NVIDIA-docker and NVIDIA docker images with CUDA and cuDNN. I've also been looking into using Alpine as the base if the image size is a concern. The Ubuntu image with xvfb and x1vnc gets to about 450MB while the Alpine image to just about 70MB. |
The purpose is to make Open3D rendering part running on cloud (AWS/GCloud). @syncle can you help test the solution on GCloud? |
Sure. I can use a fresh Ubuntu machine running on GCloud. @takanokage, can you elaborate your steps for me? That will be used for documents too. |
I will post more once I have it working. |
I got Open3D built and working inside a Docker container. $ cd ~/Open3D/build/lib/Tutorial/Basic
|
From @qianyizh's post
It might be good to try Open3D + GLFW3.3_dev solution via
|
Jaesik, I just tried your branch with glfw 3.3 inside my docker container. |
Yes. Try it with
Edit: |
Thanks! Did you install a special package for this? |
I have headless rendering working inside docker with the master branch of Open3D. |
Bind mounts (#254) |
…inal without the need to vnc into the docker container.
…rn to enable file transfers and code sharing between the container and the host.
I got headless working together with bind mounting. |
Usage notes:
Notes:
|
Addressed in #273. |
* issues #17. first draft of docker files. * added simpler ways to stop or bash into the container. * test the push process with 2-factor auth. * test 2-way auth with credentials cache. * ratpoison back. clone Open3D. * install Open3D dependencies and build. * simple way of deleting the image. won't force the delete if there are child containers running. * added more dependencies for the python side of things. python3-tk seems to be necessary but wasn't mentioned before in the docs. * issue #17. builds the headleass_rendering branch by Jaesik. * added new line at the end of each script. makes it easy to read with cat. * no upgrade. proper apt-get install pattern. no locales - use defaults. no cd - use WORKDIR. it.sh is just an interactive run. * stop after 0s. default 10s. * moved the CMD specifics to entrypoint.sh. * successfully start both xvfb and ratpoison. attach.sh will attach to a running container. test.sh is used to investigate the segmentation fault when running OpenGL apps inside the container. .xinitrc starts ratpoison. xvfb is started by x11vnc. I can start xvfb and have x11vnc reuse that display and screen however ratpoison doesn't start automatically anymore... Dockerfile example of using an NVIDIA docker image with driver, CUDA toolkit and cuDNN. run.sh example of running a container using nvidia-docker. * cleanup. test.sh can be run without python3. attach.sh will run the container first. bash.sh will run the container first. bash.sh and attach.sh are the identical. build.sh will first stop a running container. run.sh will first stop a running container. * debug. Open3D builds and runs (as much as before) with fewer dependencies. * cleaned up nvidia. cleaned up test.py - no more debug prints. added faulthandler to test.py to display the error line. installed debug tools gdb and python3.5-dbg. * debug build. clone the original repo. turns out a lot more things are working than when using the headless_rendering branch. Tutorial/Advanced/test.py is looking for a display. what if it finds a display, will it just work from a docker terminal? * cleanup. removed the code for headless_rendering branch approach. * included debug dependencies in the main install section. replaced ratpoison with lxde. works fine with exceptions: lxterminal doesn't start, display size smaller than Open3D tutorial windows, etc. * deleted because it's identical to attach.sh. * remove unused containers/images. * move setup files to Open3D/docker/setup. * moved docker utilities under Open3D/docker/ubuntu-xvfb/tools. * fix building by specifying the path to the Dockerfile. * moved docker inside new folder utilities. * #17. these changes allow running headless inside the host terminal without the need to vnc into the docker container. * renamed test.sh/py to headless_sample.sh/py. * stop before perfoming most actions. * headless rendering works with preinstalled dependencies. * #17. #254. Successfully applied the bind mounting pattern to enable file transfers and code sharing between the container and the host. * added back the ubuntu dependencies. install only python3 dependencies. * removed proxy settings. * renamed utilities/ -> util/. * removed '5.' * #17. #251. First draft of headless rendering documentation. * polished the sections called: - Docker installation - Optional steps * it.sh is basically run.sh but with '-it' instead of '-d'. '-d' will detach the container from the host terminal. '-it' will keep the container attached to the host terminal and will display the stdout of the container. * added 'Usage notes'. needs polishing. * refine various sections of the documentation. * more polishing * renamed ubuntu-xvfb to open3d-xvfb. * container name changed to open3d-xvfb. the name can be specified only once in name.sh. set the container hostname to be the same as the container name. * removed custom proxy settings. these settings to be modified as needed. * renamed 'headless_rendering.rst' to 'docker.rst' in order to make room for the glfw3.3 based headless merge. * renamed docs entries to 'docker' from 'headless_rendering'. * removed the build command as it won't work after 'run -it'. build manually after remoting into the container. * polished the documentation. build the Open3D code using the code from External rather than the native dependencies. * reduced Docker image in half by using the '--no-install-recommends' flag. * docker image size was reduced to ~1GB. * use the warning tag to highlight security recommendation. * remove duplicate. one copy already committed to Tutorial/Advanced. * renamed headless_sample.sh to docker_sample.sh. * removed duplicate headless_sample.py. copy the docker_sample.sh. * removing some spaces. * removed references to headless. * removed unnecessary file.
This can be useful in scenarios where users want to render a (long) video.
It can also be useful when Open3D is deployed in a remote server and window creation is a problem.
Some information regarding GLFW: glfw/glfw#648
The text was updated successfully, but these errors were encountered: