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
X server in docker #98
Comments
I have never tried it, but I know that others in the community have. You may have better luck posting to the VirtualGL-users Google Group. I seem to recall that it requires https://github.com/NVIDIA/nvidia-docker if you’re using an nVidia GPU. |
Well, using the default configs seem to give a segfault: FROM nvidia/opengl:1.0-glvnd-runtime-ubuntu18.04
RUN apt-get update && apt-get install -y locales && rm -rf /var/lib/apt/lists/* \
&& localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
ENV LANG en_US.utf8
WORKDIR /app
COPY ./build/virtualgl_2.6.1_amd64.deb /app/
RUN DEBIAN_FRONTEND=noninteractive dpkg -i /app/virtualgl_2.6.1_amd64.deb
RUN apt-get install -f
RUN apt-get update
COPY ./build/nvidia-xconfig /usr/bin/nvidia-xconfig
COPY ./build/xorg.conf /app/xorg.conf
RUN DEBIAN_FRONTEND=noninteractive apt-get install -y xserver-xorg-video-dummy pkg-config mesa-utils libxv1 libglu1-mesa --no-install-recommends
RUN nvidia-xconfig -a --allow-empty-initial-configuration --use-display-device=None --virtual=1920x1080 --busid 'PCI:1:0:0'
COPY ./test.sh /app/
CMD /app/test.sh and test.sh: #!/bin/sh
Xorg -noreset +extension GLX +extension RANDR +extension RENDER -logfile ./1.log -config ./xorg.conf :1 &
export VGL_DISPLAY=:01
export DISPLAY=:01
/opt/VirtualGL/bin/vglrun /opt/VirtualGL/bin/glxinfo -display :01
Xorg-conf from here and nvidia-xconfig was a binary copied from the host machine, busid was also manually extracted from host machine
gives
On host machine TurboVNC+VirtualGL both works fine |
GitHub issues rarely get read by anyone but me. Post to VirtualGL-users if you want a chance of community engagement. I have no idea how to solve this and no time to look into it right now. I am working on an EGL back end that may at least make this easier. |
The "headless" rendering documentation was a wild goose chase 😑 since my GPU doesn't support that. I won't mind sending in a pull request or something to update the instructions for headless rendering. I think you need to use Xdummy for that. The comments here regarding performance are particularly interesting. |
Your terminology is again confusing. A headless 3D X server does not require Xdummy. It just requires a headless GPU. |
Uh, but don't you need Xdummy to get around the lack of hardware support for headless rendering? Apologies for the poor terminology, I am new to this. Since TurboVNC 2.2.1 has Libglvnd Mesa direct rendering support and Nvidia-docker provides Libglvnd, is there any need for VirtualGL at all when running TurboVNC in an Nvidia-enabled container? Docker already handles the GPU timesharing problem. |
Let me play around and get back to you with a more thorough answer, but a quick & dirty answer:
|
In my dockerfile here I tried to do that but I think I didn't configure things properly due to inexperience. (The display variables were mixed up for one and also the xserver was using the xdummy xorg files instead of the nvidia-generated ones, I have no idea how to merge those two together) |
@dcommander any luck? |
Have had zero time to look into it. Be patient. |
No worries, I just noticed that the issue was re-opened, that's all. |
Don't you have an issue in the name of the displays in your test.sh script ? It reads "01" and the beginning of the glxinfo output mentions it cannot open the display:
Doesn't it work better if you change the display to "1" instead of "01" , the test.sh script reading :
|
Note that setting |
@Immortalin If you just need an X server inside a container without having anything visible and without GPU support, just use You might also be interested in x11docker to provide an X server from host to a container. I once had a VirtualGL setup in x11docker and currently think of including it again. (I am the developer of x11docker.) |
@Immortalin Regarding this issue. I've tried sort of a hack: passed UPDATE.
I also ran the container with |
Have you made success about starting xorg in a docker, I have same problem, I want to use opengl in a Nvidia docker environment. |
@kimown I have some progress. But it's not very big. First of all, I'm trying to make it work with Intel GPU in headless mode in container derived from
Running docker as above without predefined xorg.conf, but with lightdm.conf allows me to run lightdm. I even can see standard ubuntu login screen, but then it just hangs and the only thing I can do is to reboot. The problem at the moment is connected with acquiring the keyboard and mouse. In case I run the container with |
I am no longer working on the project that needed streaming in docker. |
@c4pQ I find a way, opengl need a display, we can use X.org generate virtual display in host machine, then share this display with docker container, does this solve the problem? |
@kimown could you please provide your solution for everyone looking for the answer? |
Just an idea, first we start DISPLAY in host machine, then we share the DISPLAY with docker container. |
As VirtualGL now has experimental support for running without an X server (see #10), it is much easier to run OpenGL inside a docker container using VirtualGL. Please see my early work here and tell me if it works for you and what needs to be improved: |
I was able to make it work with a host-side 3D X server. See #113 (comment) |
https://github.com/dcommander/virtualgl_docker_examples now contains my latest Docker/VirtualGL/TurboVNC examples. |
https://github.com/ehfd/docker-nvidia-egl-desktop MATE Desktop container for NVIDIA GPUs without using an X Server, directly accessing the GPU with EGL to emulate GLX using VirtualGL and TurboVNC. Does not require |
@ehfd Please stop posting duplicate comments. You are creating noise. |
As far as I can tell, the only way to run virtualgl in an unprivileged docker container with a headless host is to use xdummy. Are there any other ways?
This fails with
since tty0 is non-existent
The text was updated successfully, but these errors were encountered: