ONNX Runtime
Loading...
Searching...
No Matches
OrtGraphicsInteropConfig Struct Reference

Configuration for initializing graphics interop on an EP factory. More...

#include <onnxruntime_c_api.h>

Public Attributes

uint32_t version
 
OrtGraphicsApi graphics_api
 
void * command_queue
 Command queue/submission queue for graphics workloads (optional).
 
const OrtKeyValuePairsadditional_options
 Additional API-specific options (optional).
 

Detailed Description

Configuration for initializing graphics interop on an EP factory.

This structure contains all parameters needed to set up graphics interop between ONNX Runtime and an external graphics API (D3D12, Vulkan). The factory stores this configuration and uses it when creating synchronization streams.

Design rationale:

  • Single init function with all required params to avoid multiple init signatures
  • Factory stores the context and uses it in stream creation
  • Supports extensibility via additional_options for future requirements

Example usage for D3D12:

const OrtInteropApi* interop_api = ort_api->GetInteropApi();
config.command_queue = my_d3d12_command_queue; // ID3D12CommandQueue*
status = interop_api->InitGraphicsInteropForEpDevice(ep_device, &config);
#define ORT_API_VERSION
The API version defined in this header.
Definition onnxruntime_c_api.h:41
@ ORT_GRAPHICS_API_D3D12
Definition onnxruntime_c_api.h:1114
Configuration for initializing graphics interop on an EP factory.
Definition onnxruntime_c_api.h:1144
OrtGraphicsApi graphics_api
Definition onnxruntime_c_api.h:1146
uint32_t version
Definition onnxruntime_c_api.h:1145
void * command_queue
Command queue/submission queue for graphics workloads (optional).
Definition onnxruntime_c_api.h:1157
The OrtInteropApi struct provides functions for external resource interop with execution providers.
Definition onnxruntime_c_api.h:8289
OrtStatus * InitGraphicsInteropForEpDevice(const OrtEpDevice *ep_device, const OrtGraphicsInteropConfig *config)
Initialize graphics interop for an execution provider device.
Note
The version field must be set to ORT_API_VERSION. This ensures forward compatibility as fields may be added in future versions.
Since
Version 1.25.

Member Data Documentation

◆ additional_options

const OrtKeyValuePairs* OrtGraphicsInteropConfig::additional_options

Additional API-specific options (optional).

Can be used for future extensibility without changing the struct layout. For example, D3D12 fence sharing flags or provider-specific options like onnxruntime::nv::provider_option_names::kExternalComputeQueueDataParamNV_data for Vulkan interop for the NvTensorRTRTX provider.

◆ command_queue

void* OrtGraphicsInteropConfig::command_queue

Command queue/submission queue for graphics workloads (optional).

Optional. When provided, the factory may use it for efficient GPU-side synchronization with inference streams (performance optimization). When null, the Interop API still works; streams use the default context.

For D3D12: ID3D12CommandQueue* For Vulkan: pass NULL

◆ graphics_api

OrtGraphicsApi OrtGraphicsInteropConfig::graphics_api

The graphics API to use for interop

◆ version

uint32_t OrtGraphicsInteropConfig::version

Must be ORT_API_VERSION