@@ -94,7 +94,25 @@ namespace loader
94
94
{
95
95
for ( uint32_t i = 0 ; i < library_driver_handle_count; ++i ) {
96
96
uint32_t driver_index = total_driver_handle_count + i;
97
- if (!drv.driverSupportsDDIHandles ) {
97
+ if (drv.driverDDIHandleSupportQueried == false ) {
98
+ drv.properties = {};
99
+ drv.properties .stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES;
100
+ drv.properties .pNext = nullptr ;
101
+ ze_driver_properties_t driverProperties = {};
102
+ driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES;
103
+ driverProperties.pNext = nullptr ;
104
+ driverProperties.pNext = &drv.properties ;
105
+ ze_result_t res = drv.dditable .ze .Driver .pfnGetProperties (phDrivers[ driver_index ], &driverProperties);
106
+ if (res != ZE_RESULT_SUCCESS) {
107
+ if (loader::context->debugTraceEnabled ) {
108
+ std::string message = drv.name + " failed zeDriverGetProperties query, returned " ;
109
+ loader::context->debug_trace_message (message, loader::to_string (res));
110
+ }
111
+ return res;
112
+ }
113
+ drv.driverDDIHandleSupportQueried = true ;
114
+ }
115
+ if (!(drv.properties .flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED)) {
98
116
phDrivers[ driver_index ] = reinterpret_cast <ze_driver_handle_t >(
99
117
context->ze_driver_factory .getInstance ( phDrivers[ driver_index ], &drv.dditable ) );
100
118
}
@@ -180,7 +198,25 @@ namespace loader
180
198
{
181
199
for ( uint32_t i = 0 ; i < library_driver_handle_count; ++i ) {
182
200
uint32_t driver_index = total_driver_handle_count + i;
183
- if (!drv.driverSupportsDDIHandles ) {
201
+ if (drv.driverDDIHandleSupportQueried == false ) {
202
+ drv.properties = {};
203
+ drv.properties .stype = ZE_STRUCTURE_TYPE_DRIVER_DDI_HANDLES_EXT_PROPERTIES;
204
+ drv.properties .pNext = nullptr ;
205
+ ze_driver_properties_t driverProperties = {};
206
+ driverProperties.stype = ZE_STRUCTURE_TYPE_DRIVER_PROPERTIES;
207
+ driverProperties.pNext = nullptr ;
208
+ driverProperties.pNext = &drv.properties ;
209
+ ze_result_t res = drv.dditable .ze .Driver .pfnGetProperties (phDrivers[ driver_index ], &driverProperties);
210
+ if (res != ZE_RESULT_SUCCESS) {
211
+ if (loader::context->debugTraceEnabled ) {
212
+ std::string message = drv.name + " failed zeDriverGetProperties query, returned " ;
213
+ loader::context->debug_trace_message (message, loader::to_string (res));
214
+ }
215
+ return res;
216
+ }
217
+ drv.driverDDIHandleSupportQueried = true ;
218
+ }
219
+ if (!(drv.properties .flags & ZE_DRIVER_DDI_HANDLE_EXT_FLAG_DDI_HANDLE_EXT_SUPPORTED)) {
184
220
phDrivers[ driver_index ] = reinterpret_cast <ze_driver_handle_t >(
185
221
context->ze_driver_factory .getInstance ( phDrivers[ driver_index ], &drv.dditable ) );
186
222
}
0 commit comments