Skip to content

Commit 0f6b3b6

Browse files
KFilipekmateuszpn
andauthored
[UR][L0v2] Bump Level Zero and use stable graph API (#22489)
This PR bumps the Level Zero to the 1.32.0 and use the stable Level Zero graph API. --------- Co-authored-by: Mateusz P. Nowak <mateusz.p.nowak@intel.com>
1 parent c4544ec commit 0f6b3b6

27 files changed

Lines changed: 314 additions & 1808 deletions

unified-runtime/cmake/FetchLevelZero.cmake

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ find_package(PkgConfig QUIET)
1313
# just try to search for the path.
1414
if(NOT UR_FORCE_FETCH_LEVEL_ZERO)
1515
if(PkgConfig_FOUND)
16-
pkg_check_modules(level-zero level-zero>=1.29.0)
16+
pkg_check_modules(level-zero level-zero>=1.32.0)
1717
if(level-zero_FOUND)
1818
set(LEVEL_ZERO_INCLUDE_DIR "${level-zero_INCLUDEDIR}/level_zero")
1919
set(LEVEL_ZERO_LIBRARY_SRC "${level-zero_LIBDIR}")
@@ -54,7 +54,7 @@ if(NOT LEVEL_ZERO_LIB_NAME AND NOT LEVEL_ZERO_LIBRARY)
5454
set(UR_LEVEL_ZERO_LOADER_REPO "https://github.com/oneapi-src/level-zero.git")
5555
# Remember to update the pkg_check_modules minimum version above when updating the
5656
# clone tag
57-
set(UR_LEVEL_ZERO_LOADER_TAG v1.29.0)
57+
set(UR_LEVEL_ZERO_LOADER_TAG v1.32.0)
5858

5959
# Disable due to a bug https://github.com/oneapi-src/level-zero/issues/104
6060
set(CMAKE_INCLUDE_CURRENT_DIR OFF)

unified-runtime/source/adapters/level_zero/common.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@
88
//===----------------------------------------------------------------------===//
99

1010
#include "common.hpp"
11-
#include "external/driver_experimental/zex_graph.h"
1211
#include "logger/ur_logger.hpp"
1312
#include "usm.hpp"
13+
#include <level_zero/ze_api.h>
1414

1515
ur_result_t ze2urResult(ze_result_t ZeResult) {
1616
if (ZeResult == ZE_RESULT_SUCCESS)
@@ -363,8 +363,8 @@ getZeStructureType<ze_pitched_alloc_2dimage_linear_pitch_exp_info_t>() {
363363
}
364364
template <>
365365
ze_structure_type_ext_t
366-
getZexStructureType<ze_record_replay_graph_exp_properties_t>() {
367-
return ZE_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXP_PROPERTIES;
366+
getZexStructureType<ze_record_replay_graph_ext_properties_t>() {
367+
return ZE_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_PROPERTIES;
368368
}
369369

370370
// Global variables for ZER_EXT_RESULT_ADAPTER_SPECIFIC_ERROR

unified-runtime/source/adapters/level_zero/device.cpp

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1609,17 +1609,26 @@ ur_result_t urDeviceGetInfo(
16091609
return ReturnValue(false);
16101610
}
16111611

1612-
ze_record_replay_graph_exp_properties_t GraphProperties{};
1612+
// The experimental variant of the extension reports its capabilities
1613+
// through a structure with a different type value; an older driver would
1614+
// not recognize the stable one and would leave graphFlags unset. The
1615+
// structure layout (stype, pNext, graphFlags) is identical between the two
1616+
// variants, so the stable type can be reused with the experimental value.
1617+
constexpr ze_structure_type_t ZeStructTypeRecordReplayGraphExpProperties =
1618+
static_cast<ze_structure_type_t>(0x00030029);
1619+
ze_record_replay_graph_ext_properties_t GraphProperties{};
16131620
GraphProperties.stype =
1614-
ZE_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXP_PROPERTIES;
1621+
Device->Platform->ZeGraphExt.UsesLegacyExperimentalApi
1622+
? ZeStructTypeRecordReplayGraphExpProperties
1623+
: ZE_STRUCTURE_TYPE_RECORD_REPLAY_GRAPH_EXT_PROPERTIES;
16151624
GraphProperties.pNext = nullptr;
16161625
ZeStruct<ze_device_properties_t> DeviceProperties;
16171626
DeviceProperties.pNext = &GraphProperties;
16181627
ZE2UR_CALL(zeDeviceGetProperties, (ZeDevice, &DeviceProperties));
16191628

1620-
constexpr ze_record_replay_graph_exp_flags_t GraphModeMask =
1621-
ZE_RECORD_REPLAY_GRAPH_EXP_FLAG_IMMUTABLE_GRAPH |
1622-
ZE_RECORD_REPLAY_GRAPH_EXP_FLAG_MUTABLE_GRAPH;
1629+
constexpr ze_record_replay_graph_ext_flags_t GraphModeMask =
1630+
ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_IMMUTABLE_GRAPH |
1631+
ZE_RECORD_REPLAY_GRAPH_EXT_FLAG_MUTABLE_GRAPH;
16231632
return ReturnValue(static_cast<ur_bool_t>(
16241633
(GraphProperties.graphFlags & GraphModeMask) != 0));
16251634
}

unified-runtime/source/adapters/level_zero/external/README.md

Lines changed: 0 additions & 3 deletions
This file was deleted.

unified-runtime/source/adapters/level_zero/external/driver_experimental/mcl_ext/ze_mutable_command_list_exp.h

Lines changed: 0 additions & 37 deletions
This file was deleted.

unified-runtime/source/adapters/level_zero/external/driver_experimental/mcl_ext/zex_mutable_cmdlist_control_flow_ext.h

Lines changed: 0 additions & 155 deletions
This file was deleted.

unified-runtime/source/adapters/level_zero/external/driver_experimental/mcl_ext/zex_mutable_cmdlist_dispatch_ext.h

Lines changed: 0 additions & 43 deletions
This file was deleted.

unified-runtime/source/adapters/level_zero/external/driver_experimental/mcl_ext/zex_mutable_cmdlist_ext.h

Lines changed: 0 additions & 14 deletions
This file was deleted.

unified-runtime/source/adapters/level_zero/external/driver_experimental/mcl_ext/zex_mutable_cmdlist_serialization_ext.h

Lines changed: 0 additions & 45 deletions
This file was deleted.

0 commit comments

Comments
 (0)