Skip to content
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

Running vispy inside docker and not being able to access OpenGL drivers #2567

Open
adeelabbas opened this issue Jan 7, 2024 · 1 comment

Comments

@adeelabbas
Copy link

I am using following Dockerfile to create a very simple setup with Vispy:

FROM ubuntu:18.04
# Dependencies for glvnd and X11.
RUN apt-get update \
  && apt-get install -y -qq --no-install-recommends \
    libglvnd0 \
    libgl1 \
    libglx0 \
    libegl1 \
    libxext6 \
    libx11-6 \
  && rm -rf /var/lib/apt/lists/*
# Env vars for the nvidia-container-runtime.
ENV NVIDIA_VISIBLE_DEVICES all
ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute

RUN apt-get update && apt-get install -y python3 python3-pip
RUN apt-get update && apt-get install -y fontconfig

RUN ln -sf /usr/bin/python3 /usr/local/bin/python

RUN python -m pip install --upgrade setuptools
RUN python -m pip install --upgrade pip

RUN python -m pip install numpy cython PyQt5==5.11.3 vispy

RUN apt-get update   && apt-get install -y -qq glmark2 mesa-utils

ENV QT_QPA_PLATFORM=offscreen

I run following command to create docker image:

docker build --no-cache -t opengl-vispy-issue-ubuntu .

Then, I run following commad that exercises simple vispy command to print system info:

docker run --entrypoint python opengl-vispy-issue-ubuntu -c "import vispy; print(vispy.sys_info())"

The GL version field is empty which suggests that OpenGL driver was not properly initialized. Can someone please help with initializing OpenGL driver in this docker image?

@djhoese
Copy link
Member

djhoese commented Jan 7, 2024

Please look at other issues related to docker or the EGL backend or offscreen rendering. I haven't used docker with vispy myself, but there are others who have and various solutions are spread throughout the issues I think. I'm sorry I don't have time right now to track the answers down myself. That said, I think you'll need to tell docker about your GPU in some way. I don't think a docker container has access to your GPU by default and I'm not sure environment variables (NVIDIA_*) do anything to help that. The other option would be to look at offscreen rendering where you setup a fake display inside docker and render to that. That is usually all CPU rendering though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants