Skip to content

Commit 024a0f2

Browse files
committed
[L0] Fix device query of bindless image support
Bindless image support is only supported on intel DG2 or newer GPU. In addition, it also requires basic image support queried from ZeDeviceImageProperties.
1 parent b766009 commit 024a0f2

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

source/adapters/level_zero/device.cpp

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -964,20 +964,28 @@ UR_APIEXPORT ur_result_t UR_APICALL urDeviceGetInfo(
964964
Device->Platform->ZeMutableCmdListExt.Supported);
965965
}
966966
case UR_DEVICE_INFO_BINDLESS_IMAGES_SUPPORT_EXP: {
967-
// On L0 bindless images are supported.
968-
return ReturnValue(true);
967+
bool DeviceIsDG2OrNewer =
968+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
969+
return ReturnValue(DeviceIsDG2OrNewer &&
970+
Device->ZeDeviceImageProperties->maxImageDims1D > 0 &&
971+
Device->ZeDeviceImageProperties->maxImageDims2D > 0 &&
972+
Device->ZeDeviceImageProperties->maxImageDims3D > 0);
969973
}
970974
case UR_DEVICE_INFO_BINDLESS_IMAGES_SHARED_USM_SUPPORT_EXP: {
971975
// On L0 bindless images can not be backed by shared (managed) USM.
972976
return ReturnValue(false);
973977
}
974978
case UR_DEVICE_INFO_BINDLESS_IMAGES_1D_USM_SUPPORT_EXP: {
975-
// On L0 1D bindless image USM are supported.
976-
return ReturnValue(true);
979+
bool DeviceIsDG2OrNewer =
980+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
981+
return ReturnValue(DeviceIsDG2OrNewer &&
982+
Device->ZeDeviceImageProperties->maxImageDims1D > 0);
977983
}
978984
case UR_DEVICE_INFO_BINDLESS_IMAGES_2D_USM_SUPPORT_EXP: {
979-
// On L0 2D bindless image USM are supported.
980-
return ReturnValue(true);
985+
bool DeviceIsDG2OrNewer =
986+
Device->ZeDeviceIpVersionExt->ipVersion >= 0x030dc000;
987+
return ReturnValue(DeviceIsDG2OrNewer &&
988+
Device->ZeDeviceImageProperties->maxImageDims2D > 0);
981989
}
982990
case UR_DEVICE_INFO_IMAGE_PITCH_ALIGN_EXP:
983991
case UR_DEVICE_INFO_MAX_IMAGE_LINEAR_WIDTH_EXP:

0 commit comments

Comments
 (0)