diff --git a/source/adapters/level_zero/command_buffer.cpp b/source/adapters/level_zero/command_buffer.cpp index eccdc5e4d2..4a8688628f 100644 --- a/source/adapters/level_zero/command_buffer.cpp +++ b/source/adapters/level_zero/command_buffer.cpp @@ -598,10 +598,13 @@ ur_result_t createMainCommandList(ur_context_handle_t Context, */ bool canBeInOrder(ur_context_handle_t Context, const ur_exp_command_buffer_desc_t *CommandBufferDesc) { + const char *UrRet = std::getenv("UR_L0_USE_DRIVER_INORDER_LISTS"); // In-order command-lists are not available in old driver version. + bool DriverInOrderRequested = UrRet ? std::atoi(UrRet) != 0 : false; bool CompatibleDriver = Context->getPlatform()->isDriverVersionNewerOrSimilar( 1, 3, L0_DRIVER_INORDER_MIN_VERSION); - return CompatibleDriver + bool CanUseDriverInOrderLists = CompatibleDriver && DriverInOrderRequested; + return CanUseDriverInOrderLists ? (CommandBufferDesc ? CommandBufferDesc->isInOrder : false) : false; } diff --git a/source/adapters/level_zero/device.cpp b/source/adapters/level_zero/device.cpp index 99bb20d31a..9bc15671bd 100644 --- a/source/adapters/level_zero/device.cpp +++ b/source/adapters/level_zero/device.cpp @@ -1518,10 +1518,10 @@ bool ur_device_handle_t_::useDriverInOrderLists() { static const bool UseDriverInOrderLists = [&] { const char *UrRet = std::getenv("UR_L0_USE_DRIVER_INORDER_LISTS"); - bool CompatibleDriver = this->Platform->isDriverVersionNewerOrSimilar( - 1, 3, L0_DRIVER_INORDER_MIN_VERSION); + // bool CompatibleDriver = this->Platform->isDriverVersionNewerOrSimilar( + // 1, 3, L0_DRIVER_INORDER_MIN_VERSION); if (!UrRet) - return CompatibleDriver; + return false; return std::atoi(UrRet) != 0; }();