@@ -79,7 +79,8 @@ ur_result_t getZesDeviceHandle(ur_adapter_handle_t_ *adapter,
79
79
return UR_RESULT_ERROR_INVALID_ARGUMENT;
80
80
}
81
81
82
- ur_result_t checkDeviceIntelGPUIpVersionOrNewer (uint32_t ipVersion) {
82
+ ur_result_t checkDeviceAnyIntelGPUPropertyMatch (
83
+ std::function<bool (ze_device_properties_t &)> predicate) {
83
84
uint32_t ZeDriverCount = 0 ;
84
85
ZE2UR_CALL (zeDriverGet, (&ZeDriverCount, nullptr ));
85
86
if (ZeDriverCount == 0 ) {
@@ -106,12 +107,9 @@ ur_result_t checkDeviceIntelGPUIpVersionOrNewer(uint32_t ipVersion) {
106
107
for (uint32_t D = 0 ; D < ZeDeviceCount; ++D) {
107
108
ZE2UR_CALL (zeDeviceGetProperties, (ZeDevices[D], &device_properties));
108
109
if (device_properties.type == ZE_DEVICE_TYPE_GPU &&
109
- device_properties.vendorId == 0x8086 ) {
110
- ze_device_ip_version_ext_t *ipVersionExt =
111
- (ze_device_ip_version_ext_t *)device_properties.pNext ;
112
- if (ipVersionExt->ipVersion >= ipVersion) {
113
- return UR_RESULT_SUCCESS;
114
- }
110
+ device_properties.vendorId == 0x8086 &&
111
+ predicate (device_properties)) {
112
+ return UR_RESULT_SUCCESS;
115
113
}
116
114
}
117
115
}
@@ -261,11 +259,25 @@ ur_result_t adapterStateInit() {
261
259
return UR_RESULT_SUCCESS;
262
260
}
263
261
264
- static bool isBMGorNewer () {
265
- auto urResult = checkDeviceIntelGPUIpVersionOrNewer (0x05004000 );
262
+ static bool isBMGorNewer (bool excludeIntegrated = false ) {
263
+ auto checkBMGorNewer =
264
+ [&excludeIntegrated](ze_device_properties_t &device_properties) {
265
+ ze_device_ip_version_ext_t *ipVersionExt =
266
+ (ze_device_ip_version_ext_t *)device_properties.pNext ;
267
+
268
+ auto isIntegrated =
269
+ device_properties.flags && ZE_DEVICE_PROPERTY_FLAG_INTEGRATED;
270
+ if (excludeIntegrated && isIntegrated) {
271
+ return false ;
272
+ }
273
+
274
+ return ipVersionExt->ipVersion >= 0x05004000 ;
275
+ };
276
+
277
+ auto urResult = checkDeviceAnyIntelGPUPropertyMatch (checkBMGorNewer);
266
278
if (urResult != UR_RESULT_SUCCESS &&
267
279
urResult != UR_RESULT_ERROR_UNSUPPORTED_VERSION) {
268
- UR_LOG (ERR, " Intel GPU IP Version check failed: {}\n " , urResult);
280
+ UR_LOG (ERR, " Intel GPU device property check failed: {}\n " , urResult);
269
281
throw urResult;
270
282
}
271
283
@@ -297,8 +309,8 @@ static std::pair<bool, std::string> shouldUseV1Adapter() {
297
309
return {true , reason};
298
310
}
299
311
300
- // default: only enable for devices older than BMG
301
- return {!isBMGorNewer (), reason};
312
+ // default: enable for devices older than BMG and integrated devices
313
+ return {!isBMGorNewer (/* excludeIntegrated */ true ), reason};
302
314
}
303
315
304
316
[[maybe_unused]] static std::pair<bool , std::string> shouldUseV2Adapter () {
@@ -532,8 +544,7 @@ ur_adapter_handle_t_::ur_adapter_handle_t_()
532
544
bool ZesInitNeeded = UrSysmanZesinitEnable && !UrSysManEnvInitEnabled;
533
545
// Unless the user has forced the SysMan init, we will check the device
534
546
// version to see if the zesInit is needed.
535
- if (UserForcedSysManInit == 0 &&
536
- checkDeviceIntelGPUIpVersionOrNewer (0x05004000 ) == UR_RESULT_SUCCESS) {
547
+ if (UserForcedSysManInit == 0 && isBMGorNewer ()) {
537
548
if (UrSysManEnvInitEnabled) {
538
549
setEnvVar (" ZES_ENABLE_SYSMAN" , " 0" );
539
550
}
0 commit comments