Vulkan graphics driver and layer enumeration

Vulkan graphics driver and layer enumeration — Get information about the system's Vulkan drivers

Functions

Properties

gchar * api-version Read / Write / Construct Only
GError * error Read / Write / Construct Only
SrtLoadableIssues issues Read / Write / Construct Only
gchar * json-path Read / Write / Construct Only
gchar * library-arch Read / Write / Construct Only
gchar * library-path Read / Write / Construct Only
gboolean portability-driver Read / Write / Construct Only
gchar * resolved-library-path Read
gchar * api-version Read / Write / Construct Only
GStrv component-layers Read / Write / Construct Only
gchar * description Read / Write / Construct Only
GError * error Read / Write / Construct Only
gchar * implementation-version Read / Write / Construct Only
SrtLoadableIssues issues Read / Write / Construct Only
gchar * json-path Read / Write / Construct Only
gchar * library-arch Read / Write / Construct Only
gchar * library-path Read / Write / Construct Only
gchar * name Read / Write / Construct Only
gchar * type Read / Write / Construct Only

Object Hierarchy

    GObject
    ├── SrtVulkanIcd
    ╰── SrtVulkanLayer

Includes

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

Description

SrtVulkanIcd is an opaque object representing the metadata describing a Vulkan ICD. This is a reference-counted object: use g_object_ref() and g_object_unref() to manage its lifecycle.

Functions

srt_vulkan_icd_check_error ()

gboolean
srt_vulkan_icd_check_error (SrtVulkanIcd *self,
                            GError **error);

Check whether we failed to load the JSON describing this Vulkan ICD. Note that this does not actually dlopen() the ICD itself.

Parameters

self

The ICD

 

error

Used to return details if the ICD description could not be loaded

 

Returns

TRUE if the JSON was loaded successfully


srt_vulkan_icd_get_api_version ()

const gchar *
srt_vulkan_icd_get_api_version (SrtVulkanIcd *self);

Return the Vulkan API version of this ICD.

If the JSON description for this ICD could not be loaded, return NULL instead.

Parameters

self

The ICD

 

Returns

The API version as a string.

[type utf8][transfer none][nullable]


srt_vulkan_icd_get_json_path ()

const gchar *
srt_vulkan_icd_get_json_path (SrtVulkanIcd *self);

Return the absolute path to the JSON file representing this ICD.

Parameters

self

The ICD

 

Returns

“json-path”.

[type filename][transfer none]


srt_vulkan_icd_get_library_path ()

const gchar *
srt_vulkan_icd_get_library_path (SrtVulkanIcd *self);

Return the library path for this ICD. It is either an absolute path, a path relative to srt_vulkan_icd_get_json_path() containing at least one directory separator (slash), or a basename to be loaded from the shared library search path.

If the JSON description for this ICD could not be loaded, return NULL instead.

Parameters

self

The ICD

 

Returns

“library-path”.

[type filename][transfer none][nullable]


srt_vulkan_icd_get_library_arch ()

const gchar *
srt_vulkan_icd_get_library_arch (SrtVulkanIcd *self);

Return a string that describes the architecture of this ICD. The values allowed by the Vulkan specification are 32 and 64, indicating the size of a pointer, but the reference Vulkan-Loader accepts any value (and therefore so does steam-runtime-tools).

This is an optional field, so if it was not available in the JSON, or if the ICD could not be loaded, NULL will be returned.

Parameters

self

The ICD

 

Returns

“library-arch”.

[type filename][transfer none][nullable]


srt_vulkan_icd_get_issues ()

SrtLoadableIssues
srt_vulkan_icd_get_issues (SrtVulkanIcd *self);

Return the problems found when parsing and loading self .

Parameters

self

The ICD

 

Returns

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


srt_vulkan_icd_resolve_library_path ()

gchar *
srt_vulkan_icd_resolve_library_path (SrtVulkanIcd *self);

Return the path that can be passed to dlopen() for this ICD.

If srt_vulkan_icd_get_library_path() is a relative path, return the absolute path that is the result of interpreting it relative to srt_vulkan_icd_get_json_path(). Otherwise return a copy of srt_vulkan_icd_get_library_path().

The result is either the basename of a shared library (to be found relative to some directory listed in $LD_LIBRARY_PATH, /etc/ld.so.conf, /etc/ld.so.conf.d or the hard-coded library search path), or an absolute path.

Parameters

self

An ICD

 

Returns

A copy of “resolved-library-path”. Free with g_free().

[transfer full][type filename][nullable]


srt_vulkan_icd_new_replace_library_path ()

SrtVulkanIcd *
srt_vulkan_icd_new_replace_library_path
                               (SrtVulkanIcd *self,
                                const char *path);

Return a copy of self with the srt_vulkan_icd_get_library_path() changed to path . For example, this is useful when setting up a container where the underlying shared object will be made available at a different absolute path.

If self is in an error state, this returns a new reference to self .

Note that self issues are copied to the new SrtVulkanIcd copy, including the eventual SRT_LOADABLE_ISSUES_DUPLICATED.

Parameters

self

An ICD

 

path

A path.

[type filename][transfer none]

Returns

A new reference to a SrtVulkanIcd. Free with g_object_unref().

[transfer full]


srt_vulkan_icd_write_to_file ()

gboolean
srt_vulkan_icd_write_to_file (SrtVulkanIcd *self,
                              const char *path,
                              GError **error);

Serialize self to the given JSON file.

Parameters

self

An ICD

 

path

A filename.

[type filename]

error

Used to describe the error on failure

 

Returns

TRUE on success


srt_vulkan_layer_check_error ()

gboolean
srt_vulkan_layer_check_error (const SrtVulkanLayer *self,
                              GError **error);

Check whether we failed to load the JSON describing this Vulkan layer. Note that this does not actually dlopen() the layer itself.

Parameters

self

The layer

 

error

Used to return details if the layer description could not be loaded

 

Returns

TRUE if the JSON was loaded successfully


srt_vulkan_layer_get_json_path ()

const gchar *
srt_vulkan_layer_get_json_path (SrtVulkanLayer *self);

Return the absolute path to the JSON file representing this layer.

Parameters

self

The Vulkan layer

 

Returns

“json-path”.

[type filename][transfer none][not nullable]


srt_vulkan_layer_get_library_path ()

const gchar *
srt_vulkan_layer_get_library_path (SrtVulkanLayer *self);

Return the library path for this layer. It is either an absolute path, a path relative to srt_vulkan_layer_get_json_path() containing at least one directory separator (slash), or a basename to be loaded from the shared library search path.

If the JSON description for this layer could not be loaded, or if “component_layers” is used, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“library-path”.

[type filename][transfer none][nullable]


srt_vulkan_layer_get_library_arch ()

const gchar *
srt_vulkan_layer_get_library_arch (SrtVulkanLayer *self);

Return a string that describes the architecture of the binary associated with “library-path”. The meaning is the same as for srt_vulkan_icd_get_library_arch().

This is an optional field, so if it was not available in the JSON, or if the layer description could not be loaded, NULL will be returned.

Parameters

self

The Vulkan layer

 

Returns

“library-arch”.

[type filename][transfer none][nullable]


srt_vulkan_layer_get_name ()

const gchar *
srt_vulkan_layer_get_name (SrtVulkanLayer *self);

Return the name that uniquely identify this layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“name”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_description ()

const gchar *
srt_vulkan_layer_get_description (SrtVulkanLayer *self);

Return the description of this layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“description”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_api_version ()

const gchar *
srt_vulkan_layer_get_api_version (SrtVulkanLayer *self);

Return the Vulkan API version of this layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“api_version”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_resolve_library_path ()

gchar *
srt_vulkan_layer_resolve_library_path (SrtVulkanLayer *self);

Return the path that can be passed to dlopen() for this layer.

If srt_vulkan_layer_get_library_path() is a relative path, return the absolute path that is the result of interpreting it relative to srt_vulkan_layer_get_json_path(). Otherwise return a copy of srt_vulkan_layer_get_library_path().

The result is either the basename of a shared library (to be found relative to some directory listed in $LD_LIBRARY_PATH, /etc/ld.so.conf, /etc/ld.so.conf.d or the hard-coded library search path), or an absolute path.

Parameters

self

A Vulkan layer

 

Returns

The basename of a shared library or an absolute path. Free with g_free().

[transfer full][type filename][nullable]


srt_vulkan_layer_get_type_value ()

const gchar *
srt_vulkan_layer_get_type_value (SrtVulkanLayer *self);

Return the type of this layer. The expected values should be either "GLOBAL" or "INSTANCE".

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“type”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_implementation_version ()

const gchar *
srt_vulkan_layer_get_implementation_version
                               (SrtVulkanLayer *self);

Return the version of the implemented layer.

If the JSON description for this layer could not be loaded, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“implementation_version”.

[type utf8][transfer none][nullable]


srt_vulkan_layer_get_component_layers ()

const char * const *
srt_vulkan_layer_get_component_layers (SrtVulkanLayer *self);

Return the component layer names that are part of a meta-layer.

If the JSON description for this layer could not be loaded, or if “library-path” is used, return NULL instead.

Parameters

self

The Vulkan layer

 

Returns

“component_layers”.

[array zero-terminated=1][transfer none][element-type utf8][nullable]


srt_vulkan_layer_get_issues ()

SrtLoadableIssues
srt_vulkan_layer_get_issues (SrtVulkanLayer *self);

Return the problems found when parsing and loading self .

Parameters

self

The Vulkan layer

 

Returns

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


srt_vulkan_layer_new_replace_library_path ()

SrtVulkanLayer *
srt_vulkan_layer_new_replace_library_path
                               (SrtVulkanLayer *self,
                                const char *path);

Return a copy of self with the srt_vulkan_layer_get_library_path() changed to path . For example, this is useful when setting up a container where the underlying shared object will be made available at a different absolute path.

If self does not have “library-path” set, or if it is in an error state, this returns a new reference to self .

Parameters

self

A Vulkan layer

 

path

A path.

[type filename][transfer none]

Returns

A new reference to a SrtVulkanLayer. Free with g_object_unref().

[transfer full]


srt_vulkan_layer_write_to_file ()

gboolean
srt_vulkan_layer_write_to_file (SrtVulkanLayer *self,
                                const char *path,
                                GError **error);

Serialize self to the given JSON file.

Parameters

self

The Vulkan layer

 

path

A filename.

[type filename]

error

Used to describe the error on failure

 

Returns

TRUE on success

Types and Values

Property Details

The “api-version” property

  “api-version”              gchar *

Vulkan API version implemented by this ICD.

Flags: Read / Write / Construct Only

Default value: NULL


The “error” property

  “error”                    GError *

GError describing how this ICD failed to load, or NULL.

Flags: Read / Write / Construct Only


The “issues” property

  “issues”                   SrtLoadableIssues

Problems with this ICD.

Flags: Read / Write / Construct Only


The “json-path” property

  “json-path”                gchar *

Absolute path to JSON file describing this ICD. If examining a sysroot, this path is set as though the sysroot was the root directory. When constructing the object, a relative path can be given: it will be converted to an absolute path.

Flags: Read / Write / Construct Only

Default value: NULL


The “library-arch” property

  “library-arch”             gchar *

Architecture of the library implementing this ICD. The values allowed by the specification are "32" and "64", but other values are possible.

Flags: Read / Write / Construct Only

Default value: NULL


The “library-path” property

  “library-path”             gchar *

Library implementing this ICD, expressed as a basename to be searched for in the default library search path (e.g. libvulkan_myvendor.so), a relative path containing '/' to be resolved relative to #SrtVulkanIcd:json-path (e.g. ./libvulkan_myvendor.so), or an absolute path as though the sysroot (if any) was the root (e.g. /opt/vulkan/libvulkan_myvendor.so).

Flags: Read / Write / Construct Only

Default value: NULL


The “portability-driver” property

  “portability-driver”       gboolean

TRUE if the ICD is for a portability driver.

Flags: Read / Write / Construct Only

Default value: FALSE


The “resolved-library-path” property

  “resolved-library-path”    gchar *

Library implementing this ICD, expressed as a basename to be searched for in the default library search path (e.g. libvulkan_myvendor.so) or an absolute path as though the sysroot, if any, was the root (e.g. /opt/vulkan/libvulkan_myvendor.so).

Flags: Read

Default value: NULL


The “api-version” property

  “api-version”              gchar *

The version number of the Vulkan API that the shared library was built against.

Flags: Read / Write / Construct Only

Default value: NULL


The “component-layers” property

  “component-layers”         GStrv

Component layer names that are part of a meta-layer.

Flags: Read / Write / Construct Only


The “description” property

  “description”              gchar *

Brief description of the layer.

Flags: Read / Write / Construct Only

Default value: NULL


The “error” property

  “error”                    GError *

GError describing how this layer failed to load, or NULL.

Flags: Read / Write / Construct Only


The “implementation-version” property

  “implementation-version”   gchar *

Version of the implemented layer.

Flags: Read / Write / Construct Only

Default value: NULL


The “issues” property

  “issues”                   SrtLoadableIssues

Problems with this layer.

Flags: Read / Write / Construct Only


The “json-path” property

  “json-path”                gchar *

Absolute path to JSON file describing this layer. If examining a sysroot, this path is set as though the sysroot was the root directory. When constructing the object, a relative path can be given: it will be converted to an absolute path.

Flags: Read / Write / Construct Only

Default value: NULL


The “library-arch” property

  “library-arch”             gchar *

Architecture of the library binary that implements this layer. The values allowed by the specification are "32" and "64", but other values are possible.

Flags: Read / Write / Construct Only

Default value: NULL


The “library-path” property

  “library-path”             gchar *

Library implementing this layer, expressed as a basename to be searched for in the default library search path (e.g. vkOverlayLayer.so), a relative path containing '/' to be resolved relative to #SrtVulkanLayer:json-path (e.g. ./vkOverlayLayer.so), or an absolute path as though the sysroot (if any) was the root (e.g. /opt/vulkan/vkOverlayLayer.so).

Flags: Read / Write / Construct Only

Default value: NULL


The “name” property

  “name”                     gchar *

The name that uniquely identify this layer to applications.

Flags: Read / Write / Construct Only

Default value: NULL


The “type” property

  “type”                     gchar *

The type of this layer. It is expected to be either GLOBAL or INSTANCE.

Flags: Read / Write / Construct Only

Default value: NULL