XApp.GpuOffloadHelper

g GObject.Object GObject.Object XApp.GpuOffloadHelper XApp.GpuOffloadHelper GObject.Object->XApp.GpuOffloadHelper

Subclasses:

None

Methods

Inherited:

GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

get ()

class

get_sync ()

get_default_info ()

get_info_by_id (id)

get_n_gpus ()

get_offload_infos ()

is_offload_supported ()

is_ready ()

Virtual Methods

Inherited:

GObject.Object (7)

Properties

None

Signals

Inherited:

GObject.Object (1)

Name

Short Description

ready

This signal is emitted by the helper when it has completed gathering GPU information.

Fields

Inherited:

GObject.Object (1)

Class Details

class XApp.GpuOffloadHelper(**kwargs)
Bases:

GObject.Object

Abstract:

No

Structure:

XApp.GpuOffloadHelperClass

classmethod get()
Returns:

a new XApp.GpuOffloadHelper.

Return type:

XApp.GpuOffloadHelper

Creates a new XApp.GpuOffloadHelper instance.

The XApp.GpuOffloadHelper ::ready signal will be emitted when the helper is initialized (successfully or not).

New in version 2.6.

classmethod get_sync()
Returns:

a new XApp.GpuOffloadHelper, fully initialized.

Return type:

XApp.GpuOffloadHelper

Creates a new XApp.GpuOffloadHelper instance. This performs initialization synchronously, and can potentially block.

Use XApp.GpuOffloadHelper.is_ready() to see if the helper was initialized successfully.

New in version 2.6.

get_default_info()
Returns:

the default XApp.GpuInfo. Do not free

Return type:

XApp.GpuInfo

Returns an XApp.GpuInfo for the default GPU.

New in version 2.6.

get_info_by_id(id)
Parameters:

id (int) – The ID of the info to retrieve.

Returns:

the appropriate XApp.GpuInfo, or None if id was invalid.

Return type:

XApp.GpuInfo

Returns an XApp.GpuInfo with the given ID.

New in version 2.6.

get_n_gpus()
Returns:

the total number of GPUs. A return value larger than 1 implies there are offloadable GPUs available.

Return type:

int

Gets the number of GPUs noticed by Switcheroo.

New in version 2.6.

get_offload_infos()
Returns:

a list of XApp.GpuInfos or None if there is only a single GPU. The elements are owned by self but the container itself should be freed.

Return type:

[XApp.GpuInfo]

Generates a list of XApp.GpuInfos that can be offloaded to, if there are any.

New in version 2.6.

is_offload_supported()
Returns:

True if there is an extra GPU available.

Return type:

bool

Checks if there is a non-default GPU available for offloading.

New in version 2.6.

is_ready()
Returns:

True if the helper has been successfully initialized.

Return type:

bool

Checks if the helper is ready and valid. This does not mean offload support exists.

New in version 2.6.

Signal Details

XApp.GpuOffloadHelper.signals.ready(gpu_offload_helper, success)
Signal Name:

ready

Flags:

RUN_LAST, ACTION

Parameters:
  • gpu_offload_helper (XApp.GpuOffloadHelper) – The object which received the signal

  • success (bool) – Whether or not the helper initialize successfully.

This signal is emitted by the helper when it has completed gathering GPU information. It will only be sent once.