Selkies
Developer Reference

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 path

The 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.0
attributeEGL_PLATFORM_DEVICE_EXT
= 12607
attributeEGL_DRM_DEVICE_FILE_EXT
= 12851
attributeEGL_DRM_RENDER_NODE_FILE_EXT
= 13175
attributeEGL_OPENGL_API
= 12450
attributeEGL_RENDERABLE_TYPE
= 12352
attributeEGL_OPENGL_BIT
= 8
attributeEGL_SURFACE_TYPE
= 12339
attributeEGL_PBUFFER_BIT
= 1
attributeEGL_WINDOW_BIT
= 4
attributeEGL_WIDTH
= 12375
attributeEGL_HEIGHT
= 12374
attributeEGL_NONE
= 12344
attributeGL_RENDERER
= 7937
attributeVK_STRUCTURE_TYPE_APPLICATION_INFO
= 0
attributeVK_STRUCTURE_TYPE_INSTANCE_CREATE_INFO
= 1
attributeVK_STRUCTURE_TYPE_DEVICE_QUEUE_CREATE_INFO
= 2
attributeVK_STRUCTURE_TYPE_DEVICE_CREATE_INFO
= 3
attributeVK_STRUCTURE_TYPE_SWAPCHAIN_CREATE_INFO_KHR
= 1000001000
attributeVK_STRUCTURE_TYPE_XCB_SURFACE_CREATE_INFO_KHR
= 1000005000
attributeVK_SUCCESS
= 0
attributeVK_PHYSICAL_DEVICE_TYPE_CPU
= 4
attributeVK_QUEUE_GRAPHICS_BIT
= 1
attributeVK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT
= 16
attributeVK_COMPOSITE_ALPHA_OPAQUE_BIT_KHR
= 1
attributeVK_PRESENT_MODE_FIFO_KHR
= 2

On this page

No Headings
Edit on GitHub