Graphics compatibility check

Graphics compatibility check — Get information about system's graphics capabilities

Functions

Properties

gint exit-status Read / Write / Construct Only
GPtrArray * graphics-devices Read / Write / Construct Only
SrtGraphicsIssues issues Read / Write / Construct Only
SrtGraphicsLibraryVendor library-vendor Read / Write / Construct Only
gchar * messages Read / Write / Construct Only
gchar * multiarch-tuple Read / Write / Construct Only
gchar * renderer-string Read / Write / Construct Only
SrtRenderingInterface rendering-interface Read / Write / Construct Only
gint terminating-signal Read / Write / Construct Only
gchar * version-string Read / Write / Construct Only
SrtWindowSystem window-system Read / Write / Construct Only
gchar * api-version Read / Write / Construct Only
gchar * device-id Read / Write / Construct Only
gchar * driver-name Read / Write / Construct Only
gchar * driver-version Read / Write / Construct Only
SrtGraphicsIssues issues Read / Write / Construct Only
gchar * name Read / Write / Construct Only
SrtVkPhysicalDeviceType type Read / Write / Construct Only
gchar * vendor-id Read / Write / Construct Only
guint vulkan-driver-id Read / Write / Construct Only

Types and Values

Object Hierarchy

    GEnum
    ├── SrtGraphicsLibraryVendor
    ├── SrtRenderingInterface
    ├── SrtVkPhysicalDeviceType
    ╰── SrtWindowSystem
    GFlags
    ├── SrtGraphicsIssues
    ╰── SrtLoadableIssues
    GObject
    ├── SrtGraphics
    ╰── SrtGraphicsDevice

Includes

#include <steam-runtime-tools/steam-runtime-tools.h>

Description

SrtGraphics is an opaque object representing a graphics capabilities. This is a reference-counted object: use g_object_ref() and g_object_unref() to manage its lifecycle.

SrtGraphicsDevice is an opaque object representing a single, physical or virtual, GPU. This is a reference-counted object: use g_object_ref() and g_object_unref() to manage its lifecycle.

Functions

SRT_N_WINDOW_SYSTEMS

#define SRT_N_WINDOW_SYSTEMS (SRT_WINDOW_SYSTEM_EGL_X11 + 1)

SRT_N_RENDERING_INTERFACES

#define SRT_N_RENDERING_INTERFACES (SRT_RENDERING_INTERFACE_VAAPI + 1)

srt_graphics_device_get_issues ()

SrtGraphicsIssues
srt_graphics_device_get_issues (SrtGraphicsDevice *self);

Return the problems found when testing self .

Parameters

self

a SrtGraphicsDevice object

 

Returns

A bitfield containing problems, or SRT_GRAPHICS_ISSUES_NONE if no problems were found


srt_graphics_device_get_name ()

const char *
srt_graphics_device_get_name (SrtGraphicsDevice *self);

Return the device name of self , or NULL if it's not known.

Returns (nullable): A string indicating the device name.

Parameters

self

a SrtGraphicsDevice object

 

srt_graphics_device_get_api_version ()

const char *
srt_graphics_device_get_api_version (SrtGraphicsDevice *self);

Return the API version used by self , or NULL if it's not known.

Returns (nullable): A string indicating the API version.

Parameters

self

a SrtGraphicsDevice object

 

srt_graphics_device_get_vulkan_driver_id ()

guint32
srt_graphics_device_get_vulkan_driver_id
                               (SrtGraphicsDevice *self);

Return the VkDriverId of the driver used by self , or 0 if unknown.

Parameters

self

a SrtGraphicsDevice object

 

Returns

An integer numerically equal to a VkDriverId, indicating the driver in use, or 0 if unknown.


srt_graphics_device_get_driver_name ()

const char *
srt_graphics_device_get_driver_name (SrtGraphicsDevice *self);

Return the name of the driver used by self , or NULL if it's not known.

Returns (nullable): A string indicating the driver version.

Parameters

self

a SrtGraphicsDevice object

 

srt_graphics_device_get_driver_version ()

const char *
srt_graphics_device_get_driver_version
                               (SrtGraphicsDevice *self);

Return the driver version used by self , or NULL if it's not known.

Returns (nullable): A string indicating the driver version.

Parameters

self

a SrtGraphicsDevice object

 

srt_graphics_device_get_vendor_id ()

const char *
srt_graphics_device_get_vendor_id (SrtGraphicsDevice *self);

Return the vendor ID of self , or NULL if it's not known.

Returns (nullable): A string indicating the vendor ID.

Parameters

self

a SrtGraphicsDevice object

 

srt_graphics_device_get_device_id ()

const char *
srt_graphics_device_get_device_id (SrtGraphicsDevice *self);

Return the device ID of self , or NULL if it's not known.

Returns (nullable): A string indicating the device ID.

Parameters

self

a SrtGraphicsDevice object

 

srt_graphics_device_get_messages ()

const char *
srt_graphics_device_get_messages (SrtGraphicsDevice *self);

Return the diagnostic messages produced while checking self device drawing capabilities.

Parameters

self

a SrtGraphicsDevice object

 

Returns

A string, which must not be freed, or NULL if there were no diagnostic messages.

[nullable][transfer none]


srt_graphics_device_get_device_type ()

SrtVkPhysicalDeviceType
srt_graphics_device_get_device_type (SrtGraphicsDevice *self);

Return the self device type

Parameters

self

a SrtGraphicsDevice object

 

Returns

An enumeration of SrtVkPhysicalDeviceType indicating the type of this device.


srt_graphics_get_multiarch_tuple ()

const char *
srt_graphics_get_multiarch_tuple (SrtGraphics *self);

Return the multiarch tuple representing the ABI of self .

Parameters

self

a graphics object

 

Returns

A Debian-style multiarch tuple, usually SRT_ABI_I386 or SRT_ABI_X86_64


srt_graphics_get_issues ()

SrtGraphicsIssues
srt_graphics_get_issues (SrtGraphics *self);

Return the problems found when loading self .

Parameters

self

a SrtGraphics object

 

Returns

A bitfield containing problems, or SRT_GRAPHICS_ISSUES_NONE if no problems were found


srt_graphics_library_is_vendor_neutral ()

gboolean
srt_graphics_library_is_vendor_neutral
                               (SrtGraphics *self,
                                SrtGraphicsLibraryVendor *vendor_out);

Return whether the entry-point library for this graphics stack is vendor-neutral or vendor-specific. Vulkan, VDPAU and VA-API are always vendor-neutral, so this function will always return TRUE for them.

Parameters

self

A SrtGraphics object

 

vendor_out

Used to return a SrtGraphicsLibraryVendor object representing whether the entry-point library for this graphics stack is vendor-neutral or vendor-specific, and if vendor-specific, attempt to guess the vendor.

[out][optional]

Returns

TRUE if the graphics library is vendor-neutral, FALSE otherwise.


srt_graphics_get_window_system ()

SrtWindowSystem
srt_graphics_get_window_system (SrtGraphics *self);

Return the window system tested on the given graphics object.

Parameters

self

a graphics object

 

Returns

An enumeration of SrtWindowSystem which window system was tested.


srt_graphics_get_rendering_interface ()

SrtRenderingInterface
srt_graphics_get_rendering_interface (SrtGraphics *self);

Return the rendering interface which was tested on the given graphics object.

Parameters

self

a graphics object

 

Returns

An enumeration of SrtRenderingInterface indicating which rendering interface was tested.


srt_graphics_get_version_string ()

const char *
srt_graphics_get_version_string (SrtGraphics *self);

Return the version string found when testing the given graphics.

Parameters

self

a graphics object

 

Returns

A string indicating the version found when testing graphics.


srt_graphics_get_renderer_string ()

const char *
srt_graphics_get_renderer_string (SrtGraphics *self);

Return the renderer string found when testing the given graphics.

Parameters

self

a graphics object

 

Returns

A string indicating the renderer found when testing graphics.


srt_graphics_get_messages ()

const char *
srt_graphics_get_messages (SrtGraphics *self);

Return the diagnostic messages produced while checking this graphics stack, if any.

Parameters

self

a graphics object

 

Returns

A string, which must not be freed, or NULL if there were no diagnostic messages.

[nullable][transfer none]


srt_graphics_get_devices ()

GList *
srt_graphics_get_devices (SrtGraphics *self);

Return the list of graphics devices that have been found.

Parameters

self

a graphics object

 

Returns

The graphics devices. Free with g_list_free_full (list, g_object_unref).

[transfer full][element-type SrtGraphicsDevice]


srt_graphics_dup_parameters_string ()

gchar *
srt_graphics_dup_parameters_string (SrtGraphics *self);

Return a string indicating which window system and rendering interface were tested, for example "glx/gl" for "desktop" OpenGL on X11 via GLX, or "egl_x11/glesv2" for OpenGLES v2 on X11 via the Khronos Native Platform Graphics Interface (EGL).

Parameters

self

a graphics object

 

Returns

sA string indicating which parameters were tested. Free with g_free().

[transfer full]


srt_graphics_get_exit_status ()

int
srt_graphics_get_exit_status (SrtGraphics *self);

Return the exit status of helpers when testing the given graphics.

Parameters

self

a graphics object

 

Returns

0 on success, positive on unsuccessful exit(), -1 if killed by a signal or not run at all


srt_graphics_get_terminating_signal ()

int
srt_graphics_get_terminating_signal (SrtGraphics *self);

Return the terminating signal used to terminate the helper if any.

Parameters

self

a graphics object

 

Returns

a signal number such as SIGTERM, or 0 if not killed by a signal or not run at all.

Types and Values

SRT_GRAPHICS_ISSUES_INTERNAL_ERROR

#define SRT_GRAPHICS_ISSUES_INTERNAL_ERROR SRT_GRAPHICS_ISSUES_UNKNOWN

enum SrtGraphicsIssues

A bitfield with flags representing problems with the graphics stack, or SRT_GRAPHICS_ISSUES_NONE (which is numerically zero) if no problems were detected.

In general, more bits set means more problems.

Members

SRT_GRAPHICS_ISSUES_NONE

There are no problems

 

SRT_GRAPHICS_ISSUES_UNKNOWN

An internal error occurred while checking graphics, or an unknown issue flag was encountered while reading a report

 

SRT_GRAPHICS_ISSUES_CANNOT_LOAD

Unable to load the necessary libraries and create rendering context

 

SRT_GRAPHICS_ISSUES_SOFTWARE_RENDERING

The graphics renderer is software based

 

SRT_GRAPHICS_ISSUES_TIMEOUT

The check for this graphics stack took too long to run and was terminated. This is likely to indicate that the graphics stack causes the process using it to hang.

 

SRT_GRAPHICS_ISSUES_CANNOT_DRAW

The drawing test failed

 

enum SrtGraphicsLibraryVendor

Members

SRT_GRAPHICS_LIBRARY_VENDOR_UNKNOWN

Unable to check the graphics driver vendor

 

SRT_GRAPHICS_LIBRARY_VENDOR_GLVND

The graphics driver is the vendor-neutral GLVND

 

SRT_GRAPHICS_LIBRARY_VENDOR_UNKNOWN_NON_GLVND

The graphics driver is non-GLVND, but the exact vendor is unknown

 

SRT_GRAPHICS_LIBRARY_VENDOR_MESA

The graphics driver is the mesa non-GLVND

 

SRT_GRAPHICS_LIBRARY_VENDOR_NVIDIA

The graphics driver is the Nvidia non-GLVND

 

SRT_GRAPHICS_LIBRARY_VENDOR_PRIMUS

The graphics driver is the Primus non-GLVND

 

enum SrtLoadableIssues

A bitfield with flags representing problems with the loadables, or SRT_LOADABLE_ISSUES_NONE (which is numerically zero) if no problems were detected.

In general, more bits set means more problems.

Members

SRT_LOADABLE_ISSUES_NONE

There are no problems

 

SRT_LOADABLE_ISSUES_UNKNOWN

An internal error occurred while checking the loadable, or an unknown issue flag was encountered while reading a report

 

SRT_LOADABLE_ISSUES_UNSUPPORTED

The API version of the JSON file is not supported yet

 

SRT_LOADABLE_ISSUES_CANNOT_LOAD

Unable to parse the JSON file describing the loadable or unable to load the library

 

SRT_LOADABLE_ISSUES_DUPLICATED

This loadable, and another one, have a library path that points to the same library, and, if available, also the same name

 

SRT_LOADABLE_ISSUES_API_SUBSET

This driver is not fully compliant with the API spec, for example a Vulkan 1.3 portability driver

 

enum SrtWindowSystem

Members

SRT_WINDOW_SYSTEM_X11

X11 window system, with GL: equivalent to GLX; with GLES: equivalent to EGL_X11; with Vulkan: use X11

 

SRT_WINDOW_SYSTEM_GLX

GLX window system, only possible with GL

 

SRT_WINDOW_SYSTEM_EGL_X11

EGL_X11 window system, only possible with GL/GLES

 

enum SrtRenderingInterface

Members

SRT_RENDERING_INTERFACE_GL

GL rendering interface

 

SRT_RENDERING_INTERFACE_GLESV2

GLESv2 rendering interfaces

 

SRT_RENDERING_INTERFACE_VULKAN

Vulkan rendering interface

 

SRT_RENDERING_INTERFACE_VDPAU

VDPAU rendering interface

 

SRT_RENDERING_INTERFACE_VAAPI

VA-API rendering interface

 

enum SrtVkPhysicalDeviceType

These enums have been taken from the VkPhysicalDeviceType Vulkan specs. Please keep them in sync. https://www.khronos.org/registry/vulkan/specs/1.2-extensions/man/html/VkPhysicalDeviceType.html

Members

SRT_VK_PHYSICAL_DEVICE_TYPE_OTHER

The GPU does not match any other available types

 

SRT_VK_PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU

The GPU is typically one embedded in or tightly coupled with the host

 

SRT_VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU

The GPU is typically a separate processor connected to the host via an interlink.

 

SRT_VK_PHYSICAL_DEVICE_TYPE_VIRTUAL_GPU

The GPU is typically a virtual node in a virtualization environment

 

SRT_VK_PHYSICAL_DEVICE_TYPE_CPU

The GPU is typically running on the same processors as the host (software rendering such as llvmpipe)

 

Property Details

The “exit-status” property

  “exit-status”              gint

Exit status of helper(s) executed. 0 on success, positive on unsuccessful exit(), -1 if killed by a signal or not run at all.

Flags: Read / Write / Construct Only

Allowed values: >= -1

Default value: 0


The “graphics-devices” property

  “graphics-devices”         GPtrArray *

List of #SrtGraphicsDevice, representing the graphical cards.

Flags: Read / Write / Construct Only


The “issues” property

  “issues”                   SrtGraphicsIssues

Problems with the graphics stack.

Flags: Read / Write / Construct Only


The “library-vendor” property

  “library-vendor”           SrtGraphicsLibraryVendor

Which library vendor is currently in use.

Flags: Read / Write / Construct Only

Default value: SRT_GRAPHICS_LIBRARY_VENDOR_UNKNOWN


The “messages” property

  “messages”                 gchar *

Diagnostic messages produced while checking this graphics stack.

Flags: Read / Write / Construct Only

Default value: NULL


The “multiarch-tuple” property

  “multiarch-tuple”          gchar *

Which multiarch tuple we are checking, for example x86_64-linux-gnu.

Flags: Read / Write / Construct Only

Default value: NULL


The “renderer-string” property

  “renderer-string”          gchar *

Which renderer was found by checking.

Flags: Read / Write / Construct Only

Default value: NULL


The “rendering-interface” property

  “rendering-interface”      SrtRenderingInterface

Which rendering interface we are checking.

Flags: Read / Write / Construct Only

Default value: SRT_RENDERING_INTERFACE_GL


The “terminating-signal” property

  “terminating-signal”       gint

Signal used to terminate helper process if any, 0 otherwise.

Flags: Read / Write / Construct Only

Allowed values: >= 0

Default value: 0


The “version-string” property

  “version-string”           gchar *

Which version of graphics renderer was found from check.

Flags: Read / Write / Construct Only

Default value: NULL


The “window-system” property

  “window-system”            SrtWindowSystem

Which window system we are checking.

Flags: Read / Write / Construct Only

Default value: SRT_WINDOW_SYSTEM_GLX


The “api-version” property

  “api-version”              gchar *

Which API version is in use.

Flags: Read / Write / Construct Only

Default value: NULL


The “device-id” property

  “device-id”                gchar *

The device ID of the device.

Flags: Read / Write / Construct Only

Default value: NULL


The “driver-name” property

  “driver-name”              gchar *

Which device driver is in use.

Flags: Read / Write / Construct Only

Default value: NULL


The “driver-version” property

  “driver-version”           gchar *

Which driver version is in use.

Flags: Read / Write / Construct Only

Default value: NULL


The “issues” property

  “issues”                   SrtGraphicsIssues

Problems with the graphics device card.

Flags: Read / Write / Construct Only


The “name” property

  “name”                     gchar *

Which name the device has.

Flags: Read / Write / Construct Only

Default value: NULL


The “type” property

  “type”                     SrtVkPhysicalDeviceType

Which type the device is.

Flags: Read / Write / Construct Only

Default value: SRT_VK_PHYSICAL_DEVICE_TYPE_OTHER


The “vendor-id” property

  “vendor-id”                gchar *

The vendor ID of the device.

Flags: Read / Write / Construct Only

Default value: NULL


The “vulkan-driver-id” property

  “vulkan-driver-id”         guint

Which device driver is in use, numerically equal to a VkDriverId.

Flags: Read / Write / Construct Only

Default value: 0