GstCuda.CudaContext

g GObject.InitiallyUnowned GObject.InitiallyUnowned Gst.Object Gst.Object GObject.InitiallyUnowned->Gst.Object GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned GstCuda.CudaContext GstCuda.CudaContext Gst.Object->GstCuda.CudaContext

Subclasses:

None

Methods

Inherited:

Gst.Object (27), GObject.Object (37)

Structs:

GObject.ObjectClass (5)

class

new (device_id)

class

new_wrapped (handler, device)

class

pop (cuda_ctx)

can_access_peer (peer)

get_handle ()

get_texture_alignment ()

push ()

Virtual Methods

Inherited:

Gst.Object (1), GObject.Object (7)

Properties

Inherited:

Gst.Object (2)

Name

Type

Flags

Short Description

cuda-device-id

int

r/w/co

Set the GPU device to use for operations

os-handle

bool

r

Whether OS specific handle is supported via virtual memory

virtual-memory

bool

r

Whether virtual memory management is supporte or not

Signals

Inherited:

Gst.Object (1), GObject.Object (1)

Fields

Inherited:

Gst.Object (1), GObject.Object (1)

Name

Type

Access

Description

object

Gst.Object

r

Class Details

class GstCuda.CudaContext(**kwargs)
Bases:

Gst.Object

Abstract:

No

Structure:

GstCuda.CudaContextClass

New in version 1.22.

classmethod new(device_id)
Parameters:

device_id (int) – device-id for creating GstCuda.CudaContext

Returns:

a new GstCuda.CudaContext or None on failure

Return type:

GstCuda.CudaContext or None

Create GstCuda.CudaContext with given device_id

New in version 1.22.

classmethod new_wrapped(handler, device)
Parameters:
Returns:

A newly created GstCuda.CudaContext

Return type:

GstCuda.CudaContext or None

Note: The caller is responsible for ensuring that the CUcontext and CUdevice represented by handle and device stay alive while the returned GstCuda.CudaContext is active.

New in version 1.22.

classmethod pop(cuda_ctx)
Parameters:

cuda_ctx (object) –

Returns:

True if ctx was pushed without error.

Return type:

bool

Pops the current CUDA context from CPU thread

New in version 1.22.

can_access_peer(peer)
Parameters:

peer (GstCuda.CudaContext) – a GstCuda.CudaContext

Returns:

True if self can access peer directly

Return type:

bool

Query whether self can access any memory which belongs to peer directly.

New in version 1.22.

get_handle()
Returns:

the CUcontext of self

Return type:

object or None

Get CUDA device context. Caller must not modify and/or destroy returned device context.

New in version 1.22.

get_texture_alignment()
Returns:

the CUcontext of self

Return type:

int

Get required texture alignment by device

New in version 1.22.

push()
Returns:

True if self was pushed without error.

Return type:

bool

Pushes the given self onto the CPU thread’s stack of current contexts. The specified context becomes the CPU thread’s current context, so all CUDA functions that operate on the current context are affected.

New in version 1.22.

Property Details

GstCuda.CudaContext.props.cuda_device_id
Name:

cuda-device-id

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE, CONSTRUCT_ONLY

Set the GPU device to use for operations

GstCuda.CudaContext.props.os_handle
Name:

os-handle

Type:

bool

Default Value:

False

Flags:

READABLE

OS handle supportability in virtual memory management

New in version 1.24.

GstCuda.CudaContext.props.virtual_memory
Name:

virtual-memory

Type:

bool

Default Value:

False

Flags:

READABLE

Virtual memory management supportability

New in version 1.24.