gpu_probe
What GPU a session has here, for whatever brings one up.
A Wayland compositor needs a working GBM/EGL stack on a DRM render node, and
device paths cannot answer whether that stack works -- a node can exist with
nothing usable behind it, and a driver can be installed with no node at all --
so the answer comes from pixelflux running the compositor's own renderer
bring-up. That bring-up also resolves render_dri and the auto_gpu token
exactly as the capture will, so the GPU it reports is the one the session uses.
Prints what it found as KEY=VALUE lines on stdout, for a caller to export and
act on, and one line saying it in words on stderr:
SELKIES_GPU_RENDER_NODE the node the session renders on, empty for none
SELKIES_GPU_DRIVER the driver behind it, empty when no GPU backs it
SELKIES_GPU_PRESENT whether a GPU is here at all
SELKIES_GPU_ACCELERATED whether the compositor's renderer came up on it
SELKIES_GPU_GL_VENDOR the glvnd vendor library whose EGL brings that GPU up
SELKIES_GPU_EGL_X11 the first glvnd vendor whose EGL initializes on an X display
SELKIES_GPU_MESA_DRIVER how Mesa reaches the GPU: `native`, `zink`, or "" for software
SELKIES_GPU_VULKAN_PRESENTS whether the GPU's Vulkan driver gave an X window a swapchain, when Zink is Mesa's pathThe client-side facts come from bringing each vendor's EGL up the way an application would: on the render node through the device platform, and on a throwaway X server for the window paths -- one drawing on the node through glamor and DRI3 where the session's will -- so a driver that renders but cannot present is reported as such rather than guessed from device files.
What to do about that -- which display backend to start, which GL stack the session's applications are given -- is the deployment's own policy, and belongs where the deployment is assembled rather than here.
Exits non-zero without printing anything when no report can be had: a driver that refuses to answer at all.
attributeNVIDIA_DRIVERstr= 'nvidia'attributeEGL_VENDOR_DIRSTuple[str, ...]= ('/etc/glvnd/egl_vendor.d', '/usr/share/glvnd/egl_vendor.d')attributeMESA_VENDORstr= 'mesa'attributeCLIENT_ENVTuple[str, ...]= ('MESA_LOADER_DRIVER_OVERRIDE', 'GALLIUM_DRIVER', 'LIBGL_KOPPER_DRI2', 'LIBGL_ALWAYS_SOFTWARE', 'MESA_VK_DEVICE_SELECT', '__GLX_VENDOR_LIBRARY_NAME', '__EGL_VENDOR_LIBRARY_FILENAMES')attributeZINK_ENVDict[str, str]= {'MESA_LOADER_DRIVER_OVERRIDE': 'zink', 'GALLIUM_DRIVER': 'zink', 'LIBGL_KOPPER_DRI2': '1'}attributePROBE_TIMEOUTfloat= 15.0attributeEGL_PLATFORM_DEVICE_EXT= 12607attributeEGL_DRM_DEVICE_FILE_EXT= 12851attributeEGL_DRM_RENDER_NODE_FILE_EXT= 13175attributeEGL_OPENGL_API= 12450attributeEGL_RENDERABLE_TYPE= 12352attributeEGL_OPENGL_BIT= 8attributeEGL_SURFACE_TYPE= 12339attributeEGL_PBUFFER_BIT= 1attributeEGL_WINDOW_BIT= 4attributeEGL_WIDTH= 12375attributeEGL_HEIGHT= 12374attributeEGL_NONE= 12344attributeGL_RENDERER= 7937attributeVK_STRUCTURE_TYPE_APPLICATION_INFO= 0attributeVK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO= 1attributeVK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO= 2attributeVK_STRUCTURE_TYPE_DEVICE_CREATE_INFO= 3attributeVK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR= 1000001000attributeVK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR= 1000005000attributeVK_SUCCESS= 0attributeVK_PHYSICAL_DEVICE_TYPE_CPU= 4attributeVK_QUEUE_GRAPHICS_BIT= 1attributeVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT= 16attributeVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR= 1attributeVK_PRESENT_MODE_FIFO_KHR= 2