Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
static const char* const kOrtEpDevice_EpMetadataKey_Version = "version";

// Key for the execution provider OS driver version.
// Value should be a 4-part dot-separated version string in the format "a.b.c.d" (e.g., "31.0.101.4502").
// This maps to the Windows DXCore adapter property DXCoreAdapterProperty::DriverVersion
// (https://learn.microsoft.com/en-us/windows/win32/api/dxcore_interface/ne-dxcore_interface-dxcoreadapterproperty).
// On non-Windows platforms, the EP should provide an equivalent OS-level driver version if available.
static const char* const kOrtEpDevice_EpMetadataKey_OSDriverVersion = "os_driver_version";

// Prefix for execution provider compatibility information stored in model metadata.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
#include "ep_data_transfer.h"
#include "ep_stream_support.h"

#include "core/session/onnxruntime_ep_device_ep_metadata_keys.h"
#include "core/session/onnxruntime_session_options_config_keys.h"

ExampleEpFactory::ExampleEpFactory(const char* ep_name, ApiPtrs apis, const OrtLogger& default_logger)
Expand Down Expand Up @@ -141,6 +142,9 @@ OrtStatus* ORT_API_CALL ExampleEpFactory::GetSupportedDevicesImpl(OrtEpFactory*

// random example using made up values
factory->ort_api.AddKeyValuePair(ep_metadata, "supported_devices", "CrackGriffin 7+");
// Example os_driver_version. A real EP would read the OS driver version from the device.
// The format is a 4-part dot-separated version matching the DXCore DriverVersion property.
factory->ort_api.AddKeyValuePair(ep_metadata, kOrtEpDevice_EpMetadataKey_OSDriverVersion, "31.0.101.1000");
factory->ort_api.AddKeyValuePair(ep_options, "run_really_fast", "true");

// OrtEpDevice copies ep_metadata and ep_options.
Expand Down Expand Up @@ -171,6 +175,7 @@ OrtStatus* ORT_API_CALL ExampleEpFactory::GetSupportedDevicesImpl(OrtEpFactory*
// Ort::KeyValuePairs ep_metadata;
// Ort::KeyValuePairs ep_options;
// ep_metadata.Add("supported_devices", "CrackGriffin 7+");
// ep_metadata.Add(kOrtEpDevice_EpMetadataKey_OSDriverVersion, "31.0.101.1000");
// ep_options.Add("run_really_fast", "true");
// Ort::EpDevice ep_device{*this_ptr, device, ep_metadata.GetConst(), ep_options.GetConst()};
// ep_devices[num_ep_devices++] = ep_device.release();
Expand Down
2 changes: 2 additions & 0 deletions onnxruntime/test/autoep/test_registration.cc
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ TEST(OrtEpLibrary, LoadUnloadPluginLibraryCxxApi) {
auto metadata = test_ep_device->EpMetadata();
ASSERT_STREQ(metadata.GetValue(kOrtEpDevice_EpMetadataKey_Version), "0.1.0");
ASSERT_STREQ(metadata.GetValue("supported_devices"), "CrackGriffin 7+");
// Verify the example plugin's expected os_driver_version value.
ASSERT_STREQ(metadata.GetValue(kOrtEpDevice_EpMetadataKey_OSDriverVersion), "31.0.101.1000");

auto options = test_ep_device->EpOptions();
ASSERT_STREQ(options.GetValue("run_really_fast"), "true");
Expand Down
Loading