Minimal Docker Vulkan offscreen setup

Hi,
I am trying to set up a minimal Docker environment for a Vulkan-based offscreen rendering application. (I am on driver 525.85.05 with RTX 4090.)
The very minimal setup I have figured out is the following Dockerfile.

FROM ubuntu:22.04

RUN apt update && apt install -y libegl1 libxext6      # why???
COPY 10_nvidia.json /usr/share/glvnd/egl_vendor.d/10_nvidia.json    # why???
COPY nvidia_icd.json /usr/share/vulkan/icd.d/nvidia_icd.json

ENV NVIDIA_DRIVER_CAPABILITIES graphics,utility,compute

I can render successfully with docker run --gpus all docker_image command.

I wonder why egl, xext, and glvnd are required to run offscreen Vulkan (without them, even vulkaninfo would fail). These libraries seem to be GL and X11 related, which Vulkan does not seem to rely on. (I was assuming
libGLX_nvidia.so would be all I need.)

Is there a deep connection between these libraries and Vulkan, or is there an even simpler setup I can use for my Vulkan application?

Thank you!

Hello @fxiang, welcome to the NVIDIA developer forums!

For any kind of rendering, even headless or off-screen rendering, you will need to have a render context, which is provided for example by EGL, not GLX. GLX are just GL extensions to be able to use X11 at all.

As for GLVND you can check the github, it is simply a helper library needed for interoperability between GL and X11 or Vulkan.

So I don’t think you can get around this setup.

Thanks!