From df2c776aab238b1a8b941fae522a56233114dd08 Mon Sep 17 00:00:00 2001 From: Lukasz Jobczyk Date: Thu, 8 May 2025 15:04:31 +0000 Subject: [PATCH] refactor: Remove unused cmdq round robin engine assign Signed-off-by: Lukasz Jobczyk --- opencl/source/command_queue/command_queue.cpp | 28 +- opencl/source/command_queue/command_queue.h | 1 - opencl/source/dll/command_queue_dll.cpp | 4 - .../command_queue/enqueue_kernel_mt_tests.cpp | 3 +- .../unit_test/device/sub_device_tests.cpp | 242 ------------------ .../unit_test/libult/command_queue_ult.cpp | 4 - .../test/unit_test/linux/main_linux_dll.cpp | 4 - .../debug_settings/debug_variables_base.inl | 6 - shared/source/device/device.cpp | 41 --- shared/source/device/device.h | 2 - shared/source/helpers/engine_node_helper.cpp | 47 +--- shared/source/os_interface/product_helper.h | 1 - shared/source/os_interface/product_helper.inl | 5 - .../source/os_interface/product_helper_hw.h | 1 - shared/test/common/test_files/igdrcl.config | 6 - ...ngine_node_helper_tests_xehp_and_later.cpp | 198 +------------- .../os_interface/product_helper_tests.cpp | 4 - 17 files changed, 8 insertions(+), 589 deletions(-) diff --git a/opencl/source/command_queue/command_queue.cpp b/opencl/source/command_queue/command_queue.cpp index 3112fc76a6..aa0e5d8b0f 100644 --- a/opencl/source/command_queue/command_queue.cpp +++ b/opencl/source/command_queue/command_queue.cpp @@ -187,35 +187,17 @@ void CommandQueue::initializeGpgpu() const { static std::mutex mutex; std::lock_guard lock(mutex); if (gpgpuEngine == nullptr) { - auto &productHelper = device->getProductHelper(); - auto engineRoundRobinAvailable = productHelper.isAssignEngineRoundRobinSupported() && - this->isAssignEngineRoundRobinEnabled(); - - if (debugManager.flags.EnableCmdQRoundRobindEngineAssign.get() != -1) { - engineRoundRobinAvailable = debugManager.flags.EnableCmdQRoundRobindEngineAssign.get(); - } - - auto assignEngineRoundRobin = - !this->isSpecialCommandQueue && - !this->queueFamilySelected && - !(getCmdQueueProperties(propertiesVector.data(), CL_QUEUE_PRIORITY_KHR) & static_cast(CL_QUEUE_PRIORITY_LOW_KHR)) && - engineRoundRobinAvailable; - auto defaultEngineType = device->getDefaultEngine().getEngineType(); const GfxCoreHelper &gfxCoreHelper = getDevice().getGfxCoreHelper(); bool secondaryContextsEnabled = gfxCoreHelper.areSecondaryContextsSupported(); - if (assignEngineRoundRobin) { - this->gpgpuEngine = &device->getDevice().getNextEngineForCommandQueue(); - } else { - if (secondaryContextsEnabled && EngineHelpers::isCcs(defaultEngineType)) { - tryAssignSecondaryEngine(device->getDevice(), gpgpuEngine, {defaultEngineType, EngineUsage::regular}); - } + if (secondaryContextsEnabled && EngineHelpers::isCcs(defaultEngineType)) { + tryAssignSecondaryEngine(device->getDevice(), gpgpuEngine, {defaultEngineType, EngineUsage::regular}); + } - if (gpgpuEngine == nullptr) { - this->gpgpuEngine = &device->getDefaultEngine(); - } + if (gpgpuEngine == nullptr) { + this->gpgpuEngine = &device->getDefaultEngine(); } this->initializeGpgpuInternals(); diff --git a/opencl/source/command_queue/command_queue.h b/opencl/source/command_queue/command_queue.h index 8e5177e46b..d513d51c34 100644 --- a/opencl/source/command_queue/command_queue.h +++ b/opencl/source/command_queue/command_queue.h @@ -274,7 +274,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> { void allocateHeapMemory(IndirectHeapType heapType, size_t minRequiredSize, IndirectHeap *&indirectHeap); - static bool isAssignEngineRoundRobinEnabled(); static bool isTimestampWaitEnabled(); MOCKABLE_VIRTUAL void releaseIndirectHeap(IndirectHeapType heapType); diff --git a/opencl/source/dll/command_queue_dll.cpp b/opencl/source/dll/command_queue_dll.cpp index 07099c625d..82dd5f7db6 100644 --- a/opencl/source/dll/command_queue_dll.cpp +++ b/opencl/source/dll/command_queue_dll.cpp @@ -9,10 +9,6 @@ namespace NEO { -bool CommandQueue::isAssignEngineRoundRobinEnabled() { - return true; -} - bool CommandQueue::isTimestampWaitEnabled() { return true; } diff --git a/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp b/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp index 8dd2d14624..8ee961e723 100644 --- a/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp +++ b/opencl/test/unit_test/command_queue/enqueue_kernel_mt_tests.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2018-2024 Intel Corporation + * Copyright (C) 2018-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -326,7 +326,6 @@ HWTEST_F(EnqueueKernelTest, givenBcsEnabledWhenThread1EnqueueWriteBufferAndThrea HWTEST_F(EnqueueKernelTest, givenBcsEnabledAndQueuePerThreadWhenEnqueueWriteBufferAndEnqueueNDRangeKernelInLoopThenIsNoRace) { DebugManagerStateRestore debugRestorer; debugManager.flags.ForceCsrLockInBcsEnqueueOnlyForGpgpuSubmission.set(1); - debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(0); HardwareInfo hwInfo = *pDevice->executionEnvironment->rootDeviceEnvironments[0]->getMutableHardwareInfo(); hwInfo.capabilityTable.blitterOperationsSupported = true; REQUIRE_FULL_BLITTER_OR_SKIP(*pDevice->executionEnvironment->rootDeviceEnvironments[0]); diff --git a/opencl/test/unit_test/device/sub_device_tests.cpp b/opencl/test/unit_test/device/sub_device_tests.cpp index e61925d99e..e8a5f49a38 100644 --- a/opencl/test/unit_test/device/sub_device_tests.cpp +++ b/opencl/test/unit_test/device/sub_device_tests.cpp @@ -575,248 +575,6 @@ TEST_F(DeviceTests, givenAffinityMaskWhenCreatingClSubDevicesThenSkipDisabledDev EXPECT_EQ(0b100u, clRootDevice->getSubDevice(1)->getDeviceBitfield().to_ulong()); } -struct SingleSliceDispatchSupportMatcher { - template - static constexpr bool isMatched() { - using GfxProduct = typename HwMapper::GfxProduct; - return GfxProduct::FrontEndStateSupport::singleSliceDispatchCcsMode; - } -}; - -HWTEST_F(DeviceTests, whenCreateMultipleCommandQueuesThenEnginesAreAssignedUsingRoundRobin) { - constexpr uint32_t genericDevicesCount = 1; - constexpr uint32_t ccsCount = 4; - - DebugManagerStateRestore restorer; - debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1); - - if (!createDevices(genericDevicesCount, ccsCount)) { - GTEST_SKIP(); - } - - auto &hwInfo = rootDevice->getHardwareInfo(); - const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper(); - const auto &productHelper = rootDevice->getProductHelper(); - - if (!productHelper.isAssignEngineRoundRobinSupported()) { - GTEST_SKIP(); - } - - EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled); - - auto clRootDevice = std::make_unique(*rootDevice, nullptr); - cl_device_id deviceIds[] = {clRootDevice.get()}; - ClDeviceVector deviceVector{deviceIds, 1}; - MockContext context(deviceVector); - - std::array>, 24> cmdQs; - for (auto &cmdQ : cmdQs) { - cmdQ = std::make_unique>(&context, clRootDevice.get(), nullptr); - } - - const auto &defaultEngine = clRootDevice->getDefaultEngine(); - const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo); - - auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType); - auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines; - - for (size_t i = 0; i < cmdQs.size(); i++) { - auto engineIndex = i % engines.size(); - auto expectedCsr = engines[engineIndex].commandStreamReceiver; - auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver(); - - EXPECT_EQ(csr, expectedCsr); - } -} - -HWTEST_F(DeviceTests, givenCmdQRoundRobindEngineAssignBitfieldwWenCreateMultipleCommandQueuesThenEnginesAreAssignedUsingRoundRobinSkippingNotAvailableEngines) { - constexpr uint32_t genericDevicesCount = 1; - constexpr uint32_t ccsCount = 4; - - DebugManagerStateRestore restorer; - debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1); - debugManager.flags.CmdQRoundRobindEngineAssignBitfield.set(0b1101); - - if (!createDevices(genericDevicesCount, ccsCount)) { - GTEST_SKIP(); - } - - auto &hwInfo = rootDevice->getHardwareInfo(); - const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper(); - const auto &productHelper = rootDevice->getProductHelper(); - - if (!productHelper.isAssignEngineRoundRobinSupported()) { - GTEST_SKIP(); - } - - EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled); - - auto clRootDevice = std::make_unique(*rootDevice, nullptr); - cl_device_id deviceIds[] = {clRootDevice.get()}; - ClDeviceVector deviceVector{deviceIds, 1}; - MockContext context(deviceVector); - - std::array>, 24> cmdQs; - for (auto &cmdQ : cmdQs) { - cmdQ = std::make_unique>(&context, clRootDevice.get(), nullptr); - } - - const auto &defaultEngine = clRootDevice->getDefaultEngine(); - const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo); - - auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType); - auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines; - - for (size_t i = 0, j = 0; i < cmdQs.size(); i++, j++) { - if ((j % engines.size()) == 1) { - j++; - } - auto engineIndex = j % engines.size(); - auto expectedCsr = engines[engineIndex].commandStreamReceiver; - auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver(); - - EXPECT_EQ(csr, expectedCsr); - } -} - -HWTEST_F(DeviceTests, givenCmdQRoundRobindEngineAssignNTo1wWenCreateMultipleCommandQueuesThenEnginesAreAssignedUsingRoundRobinAndNQueuesShareSameCsr) { - constexpr uint32_t genericDevicesCount = 1; - constexpr uint32_t ccsCount = 4; - - DebugManagerStateRestore restorer; - debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1); - debugManager.flags.CmdQRoundRobindEngineAssignNTo1.set(3); - - if (!createDevices(genericDevicesCount, ccsCount)) { - GTEST_SKIP(); - } - - auto &hwInfo = rootDevice->getHardwareInfo(); - const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper(); - const auto &productHelper = rootDevice->getProductHelper(); - - if (!productHelper.isAssignEngineRoundRobinSupported()) { - GTEST_SKIP(); - } - - EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled); - - auto clRootDevice = std::make_unique(*rootDevice, nullptr); - cl_device_id deviceIds[] = {clRootDevice.get()}; - ClDeviceVector deviceVector{deviceIds, 1}; - MockContext context(deviceVector); - - std::array>, 24> cmdQs; - for (auto &cmdQ : cmdQs) { - cmdQ = std::make_unique>(&context, clRootDevice.get(), nullptr); - } - - const auto &defaultEngine = clRootDevice->getDefaultEngine(); - const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo); - - auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType); - auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines; - - for (size_t i = 0, j = 0; i < cmdQs.size(); i++, j++) { - auto engineIndex = (j / 3) % engines.size(); - auto expectedCsr = engines[engineIndex].commandStreamReceiver; - auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver(); - - EXPECT_EQ(csr, expectedCsr); - } -} - -HWTEST_F(DeviceTests, givenCmdQRoundRobindEngineAssignNTo1AndCmdQRoundRobindEngineAssignBitfieldwWenCreateMultipleCommandQueuesThenEnginesAreAssignedProperlyUsingRoundRobin) { - constexpr uint32_t genericDevicesCount = 1; - constexpr uint32_t ccsCount = 4; - - DebugManagerStateRestore restorer; - debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(1); - debugManager.flags.CmdQRoundRobindEngineAssignNTo1.set(3); - debugManager.flags.CmdQRoundRobindEngineAssignBitfield.set(0b1101); - - if (!createDevices(genericDevicesCount, ccsCount)) { - GTEST_SKIP(); - } - - auto &hwInfo = rootDevice->getHardwareInfo(); - const auto &gfxCoreHelper = rootDevice->getGfxCoreHelper(); - const auto &productHelper = rootDevice->getProductHelper(); - - if (!productHelper.isAssignEngineRoundRobinSupported()) { - GTEST_SKIP(); - } - - EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled); - - auto clRootDevice = std::make_unique(*rootDevice, nullptr); - cl_device_id deviceIds[] = {clRootDevice.get()}; - ClDeviceVector deviceVector{deviceIds, 1}; - MockContext context(deviceVector); - - std::array>, 24> cmdQs; - for (auto &cmdQ : cmdQs) { - cmdQ = std::make_unique>(&context, clRootDevice.get(), nullptr); - } - - const auto &defaultEngine = clRootDevice->getDefaultEngine(); - const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hwInfo); - - auto defaultEngineGroupIndex = clRootDevice->getDevice().getEngineGroupIndexFromEngineGroupType(engineGroupType); - auto engines = clRootDevice->getDevice().getRegularEngineGroups()[defaultEngineGroupIndex].engines; - - for (size_t i = 0, j = 0; i < cmdQs.size(); i++, j++) { - while (((j / 3) % engines.size()) == 1) { - j++; - } - auto engineIndex = (j / 3) % engines.size(); - auto expectedCsr = engines[engineIndex].commandStreamReceiver; - auto csr = &cmdQs[i]->getGpgpuCommandStreamReceiver(); - - EXPECT_EQ(csr, expectedCsr); - } -} - -HWTEST_F(DeviceTests, givenEnableCmdQRoundRobindEngineAssignDisabledWenCreateMultipleCommandQueuesThenDefaultEngineAssigned) { - constexpr uint32_t genericDevicesCount = 1; - constexpr uint32_t ccsCount = 4; - - DebugManagerStateRestore restorer; - debugManager.flags.EnableCmdQRoundRobindEngineAssign.set(0); - - if (!createDevices(genericDevicesCount, ccsCount)) { - GTEST_SKIP(); - } - - auto &hwInfo = rootDevice->getHardwareInfo(); - const auto &productHelper = rootDevice->getProductHelper(); - - if (!productHelper.isAssignEngineRoundRobinSupported()) { - GTEST_SKIP(); - } - - EXPECT_EQ(ccsCount, hwInfo.gtSystemInfo.CCSInfo.NumberOfCCSEnabled); - - auto clRootDevice = std::make_unique(*rootDevice, nullptr); - cl_device_id deviceIds[] = {clRootDevice.get()}; - ClDeviceVector deviceVector{deviceIds, 1}; - MockContext context(deviceVector); - - std::array>, 24> cmdQs; - for (auto &cmdQ : cmdQs) { - cmdQ = std::make_unique>(&context, clRootDevice.get(), nullptr); - } - - const auto &defaultEngine = clRootDevice->getDefaultEngine(); - - for (auto &cmdQ : cmdQs) { - auto expectedCsr = defaultEngine.commandStreamReceiver; - auto csr = &cmdQ->getGpgpuCommandStreamReceiver(); - - EXPECT_EQ(csr, expectedCsr); - } -} - TEST(SubDevicesTest, whenInitializeRootCsrThenDirectSubmissionIsNotInitialized) { auto device = std::make_unique(); device->initializeRootCommandStreamReceiver(); diff --git a/opencl/test/unit_test/libult/command_queue_ult.cpp b/opencl/test/unit_test/libult/command_queue_ult.cpp index 1f08494dfb..15920e0caa 100644 --- a/opencl/test/unit_test/libult/command_queue_ult.cpp +++ b/opencl/test/unit_test/libult/command_queue_ult.cpp @@ -11,10 +11,6 @@ namespace NEO { -bool CommandQueue::isAssignEngineRoundRobinEnabled() { - return false; -} - bool CommandQueue::isTimestampWaitEnabled() { return ultHwConfig.useWaitForTimestamps; } diff --git a/opencl/test/unit_test/linux/main_linux_dll.cpp b/opencl/test/unit_test/linux/main_linux_dll.cpp index ce8995cfcc..ac0e894076 100644 --- a/opencl/test/unit_test/linux/main_linux_dll.cpp +++ b/opencl/test/unit_test/linux/main_linux_dll.cpp @@ -891,10 +891,6 @@ TEST(DirectSubmissionControllerTest, whenCheckDirectSubmissionControllerSupportT EXPECT_TRUE(DirectSubmissionController::isSupported()); } -TEST(CommandQueueTest, whenCheckEngineRoundRobinAssignThenReturnsTrue) { - EXPECT_TRUE(CommandQueue::isAssignEngineRoundRobinEnabled()); -} - TEST(CommandQueueTest, whenCheckEngineTimestampWaitEnabledThenReturnsTrue) { EXPECT_TRUE(CommandQueue::isTimestampWaitEnabled()); } diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index 4125054f38..f5179f4e76 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -536,13 +536,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, EnableUserFenceForCompletionWait, -1, "-1: defau DECLARE_DEBUG_VARIABLE(int32_t, OverrideUserFenceStartValue, -1, "-1: default (disabled), >1: Instead of starting from 0, use different start value.") DECLARE_DEBUG_VARIABLE(int32_t, SetKmdWaitTimeout, -1, "-1: default (infinity), >0: amount of time units for wait function timeout") DECLARE_DEBUG_VARIABLE(int32_t, OverrideNotifyEnableForTagUpdatePostSync, -1, "-1: default (usage determined by user fence wait call), 0: disable use of NotifyEnable flag, 1: enable use NotifyEnable flag") -DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindEngineAssign, -1, "-1: default, 0: disable, 1: enable") -DECLARE_DEBUG_VARIABLE(int32_t, CmdQRoundRobindEngineAssignBitfield, -1, "-1: default, >0: bitfield with supported engines") -DECLARE_DEBUG_VARIABLE(int32_t, CmdQRoundRobindEngineAssignNTo1, -1, "-1: default, >0: assign same engine to N queues") DECLARE_DEBUG_VARIABLE(int32_t, EnableCopyEngineSelector, -1, "Do not choose only main copy engine, -1: default, 0: disable, 1: enable") -DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssign, -1, "-1: default, 0: disable, 1: enable") -DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssignLimit, -1, "-1: default, >=0: round robin limit") -DECLARE_DEBUG_VARIABLE(int32_t, EnableCmdQRoundRobindBcsEngineAssignStartingValue, -1, "-1: default, >=0: round robin starting point") DECLARE_DEBUG_VARIABLE(int32_t, ForceBCSForInternalCopyEngine, -1, "-1: default, do not force, 0: main copy engine, 1: copy engine index") DECLARE_DEBUG_VARIABLE(int32_t, Force32BitDriverSupport, -1, "-1: default, 0: disable, 1: enable, Forces the driver to support 32 bit.") DECLARE_DEBUG_VARIABLE(int32_t, OverrideSystolicPipelineSelect, -1, "set SYSTOLIC MODE ENABLE in PIPELINE_SELECT cmd, -1:default, 0:disable, 1:enable") diff --git a/shared/source/device/device.cpp b/shared/source/device/device.cpp index 8ffc14a19a..292c2a2cea 100644 --- a/shared/source/device/device.cpp +++ b/shared/source/device/device.cpp @@ -878,25 +878,6 @@ EngineControl &Device::getInternalEngine() { return this->getNearestGenericSubDevice(0)->getEngine(engineType, EngineUsage::internal); } -EngineControl &Device::getNextEngineForCommandQueue() { - this->initializeEngineRoundRobinControls(); - - const auto &defaultEngine = this->getDefaultEngine(); - - const auto &hardwareInfo = this->getHardwareInfo(); - const auto &gfxCoreHelper = getGfxCoreHelper(); - const auto engineGroupType = gfxCoreHelper.getEngineGroupType(defaultEngine.getEngineType(), defaultEngine.getEngineUsage(), hardwareInfo); - - const auto defaultEngineGroupIndex = this->getEngineGroupIndexFromEngineGroupType(engineGroupType); - auto &engineGroup = this->getRegularEngineGroups()[defaultEngineGroupIndex]; - - auto engineIndex = 0u; - do { - engineIndex = (this->regularCommandQueuesCreatedWithinDeviceCount++ / this->queuesPerEngineCount) % engineGroup.engines.size(); - } while (!this->availableEnginesForCommandQueueusRoundRobin.test(engineIndex)); - return engineGroup.engines[engineIndex]; -} - EngineControl *Device::getInternalCopyEngine() { if (!getHardwareInfo().capabilityTable.blitterOperationsSupported) { return nullptr; @@ -989,28 +970,6 @@ void Device::finalizeRayTracing() { } } -void Device::initializeEngineRoundRobinControls() { - if (this->availableEnginesForCommandQueueusRoundRobin.any()) { - return; - } - - uint32_t queuesPerEngine = 1u; - - if (debugManager.flags.CmdQRoundRobindEngineAssignNTo1.get() != -1) { - queuesPerEngine = debugManager.flags.CmdQRoundRobindEngineAssignNTo1.get(); - } - - this->queuesPerEngineCount = queuesPerEngine; - - std::bitset<8> availableEngines = std::numeric_limits::max(); - - if (debugManager.flags.CmdQRoundRobindEngineAssignBitfield.get() != -1) { - availableEngines = debugManager.flags.CmdQRoundRobindEngineAssignBitfield.get(); - } - - this->availableEnginesForCommandQueueusRoundRobin = availableEngines; -} - OSTime *Device::getOSTime() const { return getRootDeviceEnvironment().osTime.get(); }; bool Device::getUuid(std::array &uuid) { diff --git a/shared/source/device/device.h b/shared/source/device/device.h index 0b7c3b293e..fc2cc40c39 100644 --- a/shared/source/device/device.h +++ b/shared/source/device/device.h @@ -121,7 +121,6 @@ class Device : public ReferenceTrackedObject, NEO::NonCopyableAndNonMova size_t getEngineGroupIndexFromEngineGroupType(EngineGroupType engineGroupType) const; EngineControl &getEngine(uint32_t index); EngineControl &getDefaultEngine(); - EngineControl &getNextEngineForCommandQueue(); EngineControl &getInternalEngine(); EngineControl *getInternalCopyEngine(); EngineControl *getHpCopyEngine(); @@ -319,7 +318,6 @@ class Device : public ReferenceTrackedObject, NEO::NonCopyableAndNonMova std::atomic_uint32_t regularCommandQueuesCreatedWithinDeviceCount{0}; std::bitset<8> availableEnginesForCommandQueueusRoundRobin = 0; uint32_t queuesPerEngineCount = 1; - void initializeEngineRoundRobinControls(); bool hasGenericSubDevices = false; bool rootCsrCreated = false; const uint32_t rootDeviceIndex; diff --git a/shared/source/helpers/engine_node_helper.cpp b/shared/source/helpers/engine_node_helper.cpp index 887f54de51..aa20507689 100644 --- a/shared/source/helpers/engine_node_helper.cpp +++ b/shared/source/helpers/engine_node_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2019-2024 Intel Corporation + * Copyright (C) 2019-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -205,51 +205,6 @@ aub_stream::EngineType selectLinkCopyEngine(const RootDeviceEnvironment &rootDev auto &gfxCoreHelper = rootDeviceEnvironment.getHelper(); auto &productHelper = rootDeviceEnvironment.getProductHelper(); auto &hwInfo = *rootDeviceEnvironment.getHardwareInfo(); - auto enableCmdQRoundRobindBcsEngineAssign = false; - - if (debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.get() != -1) { - enableCmdQRoundRobindBcsEngineAssign = debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.get(); - } - - if (enableCmdQRoundRobindBcsEngineAssign) { - aub_stream::EngineType engineType; - - auto bcsRoundRobinLimit = EngineHelpers::numLinkedCopyEngines; - auto engineOffset = 0u; - auto mainCE = false; - - if (debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.get() != -1) { - engineOffset = debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.get(); - mainCE = engineOffset == 0; - } - - if (mainCE) { - bcsRoundRobinLimit++; - } - - if (debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.get() != -1) { - bcsRoundRobinLimit = debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.get(); - } - - do { - auto selectEngineValue = (selectorCopyEngine.fetch_add(1u) % bcsRoundRobinLimit) + engineOffset; - - if (mainCE) { - if (selectEngineValue == 0u) { - engineType = aub_stream::EngineType::ENGINE_BCS; - } else { - engineType = static_cast(aub_stream::EngineType::ENGINE_BCS1 + selectEngineValue - 1); - } - } else { - engineType = static_cast(aub_stream::EngineType::ENGINE_BCS1 + selectEngineValue); - } - - } while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, engineType) || !hwInfo.featureTable.ftrBcsInfo.test(engineType == aub_stream::EngineType::ENGINE_BCS - ? 0 - : engineType - aub_stream::EngineType::ENGINE_BCS1 + 1)); - - return engineType; - } const aub_stream::EngineType engine1 = gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, aub_stream::ENGINE_BCS1) && aub_stream::ENGINE_BCS1 != productHelper.getDefaultCopyEngine() ? aub_stream::ENGINE_BCS1 diff --git a/shared/source/os_interface/product_helper.h b/shared/source/os_interface/product_helper.h index 15330a5f43..766263629c 100644 --- a/shared/source/os_interface/product_helper.h +++ b/shared/source/os_interface/product_helper.h @@ -163,7 +163,6 @@ class ProductHelper { virtual bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const = 0; virtual bool isUnlockingLockedPtrNecessary(const HardwareInfo &hwInfo) const = 0; virtual bool isAdjustWalkOrderAvailable(const ReleaseHelper *releaseHelper) const = 0; - virtual bool isAssignEngineRoundRobinSupported() const = 0; virtual uint32_t getL1CachePolicy(bool isDebuggerActive) const = 0; virtual bool isEvictionIfNecessaryFlagSupported() const = 0; virtual void adjustNumberOfCcs(HardwareInfo &hwInfo) const = 0; diff --git a/shared/source/os_interface/product_helper.inl b/shared/source/os_interface/product_helper.inl index 7203a35c5e..b6e7c97fe7 100644 --- a/shared/source/os_interface/product_helper.inl +++ b/shared/source/os_interface/product_helper.inl @@ -323,11 +323,6 @@ LocalMemoryAccessMode ProductHelperHw::getLocalMemoryAccessMode(cons return getDefaultLocalMemoryAccessMode(hwInfo); } -template -bool ProductHelperHw::isAssignEngineRoundRobinSupported() const { - return false; -} - template std::pair ProductHelperHw::isPipeControlPriorToNonPipelinedStateCommandsWARequired(const HardwareInfo &hwInfo, bool isRcs, const ReleaseHelper *releaseHelper) const { auto isBasicWARequired = false; diff --git a/shared/source/os_interface/product_helper_hw.h b/shared/source/os_interface/product_helper_hw.h index 363c2ffac8..97d4c65d0e 100644 --- a/shared/source/os_interface/product_helper_hw.h +++ b/shared/source/os_interface/product_helper_hw.h @@ -105,7 +105,6 @@ class ProductHelperHw : public ProductHelper { bool isCpuCopyNecessary(const void *ptr, MemoryManager *memoryManager) const override; bool isUnlockingLockedPtrNecessary(const HardwareInfo &hwInfo) const override; bool isAdjustWalkOrderAvailable(const ReleaseHelper *releaseHelper) const override; - bool isAssignEngineRoundRobinSupported() const override; uint32_t getL1CachePolicy(bool isDebuggerActive) const override; bool isEvictionIfNecessaryFlagSupported() const override; void adjustNumberOfCcs(HardwareInfo &hwInfo) const override; diff --git a/shared/test/common/test_files/igdrcl.config b/shared/test/common/test_files/igdrcl.config index 0d6bbeb78a..0b6ff882c5 100644 --- a/shared/test/common/test_files/igdrcl.config +++ b/shared/test/common/test_files/igdrcl.config @@ -355,12 +355,6 @@ OverrideUseKmdWaitFunction = -1 EnableCacheFlushAfterWalkerForAllQueues = -1 Force32BitDriverSupport = -1 EnableCopyEngineSelector = -1 -EnableCmdQRoundRobindEngineAssign = -1 -CmdQRoundRobindEngineAssignBitfield = -1 -CmdQRoundRobindEngineAssignNTo1 = -1 -EnableCmdQRoundRobindBcsEngineAssign = -1 -EnableCmdQRoundRobindBcsEngineAssignLimit = -1 -EnableCmdQRoundRobindBcsEngineAssignStartingValue = -1 ForceBCSForInternalCopyEngine = -1 OverrideCmdQueueSynchronousMode = -1 OverrideImmediateCmdListSynchronousMode = -1 diff --git a/shared/test/unit_test/helpers/engine_node_helper_tests_xehp_and_later.cpp b/shared/test/unit_test/helpers/engine_node_helper_tests_xehp_and_later.cpp index db7076b5b8..a2c4ab9ec8 100644 --- a/shared/test/unit_test/helpers/engine_node_helper_tests_xehp_and_later.cpp +++ b/shared/test/unit_test/helpers/engine_node_helper_tests_xehp_and_later.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2021-2024 Intel Corporation + * Copyright (C) 2021-2025 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -126,202 +126,6 @@ HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenLessThanFourCopyEnginesWhenGet } } -HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEngines, IsAtLeastXeHpCore) { - DebugManagerStateRestore restore; - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u); - DeviceBitfield deviceBitfield = 0b10; - - auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); - auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); - hwInfo.featureTable.ftrBcsInfo.set(7); - auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine(); - - int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); - for (int32_t i = 0; i <= 20; i++) { - while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) { - expectedEngineType++; - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } - } - - auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector); - EXPECT_EQ(engineType, static_cast(expectedEngineType)); - - expectedEngineType++; - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } - } -} - -HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndMainCopyEngineIncludedWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEnginesAndMainCopyEngine, IsAtLeastXeHpCore) { - DebugManagerStateRestore restore; - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u); - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.set(0); - DeviceBitfield deviceBitfield = 0b10; - - auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); - auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); - hwInfo.featureTable.ftrBcsInfo = 0x17f; - auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine(); - - int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS; - auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); - for (int32_t i = 0; i <= 20; i++) { - while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS - ? 0 - : expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) { - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS; - } - } - - auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector); - EXPECT_EQ(engineType, static_cast(expectedEngineType)); - - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS8) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS; - } - } -} - -HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndMainCopyEngineIncludedAndLimitSetWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEnginesAndMainCopyEngine, IsAtLeastXeHpCore) { - DebugManagerStateRestore restore; - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u); - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.set(0); - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.set(6); - DeviceBitfield deviceBitfield = 0b10; - - auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); - auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); - hwInfo.featureTable.ftrBcsInfo = 0x17f; - auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine(); - - int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS; - auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); - for (int32_t i = 0; i <= 20; i++) { - while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS - ? 0 - : expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) { - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS5) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS; - } - } - - auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector); - EXPECT_EQ(engineType, static_cast(expectedEngineType)); - - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS5) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS; - } - } -} - -HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndLimitSetWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEnginesAndMainCopyEngine, IsAtLeastXeHpCore) { - DebugManagerStateRestore restore; - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u); - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.set(6); - DeviceBitfield deviceBitfield = 0b10; - - auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); - auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); - hwInfo.featureTable.ftrBcsInfo = 0x17f; - auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine(); - - int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); - for (int32_t i = 0; i <= 20; i++) { - while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS - ? 0 - : expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) { - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS6) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } - } - - auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector); - EXPECT_EQ(engineType, static_cast(expectedEngineType)); - - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS6) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } - } -} - -HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenEnableCmdQRoundRobindBcsEngineAssignAndStartOffsetIncludedWhenSelectLinkCopyEngineThenRoundRobinOverAllAvailableLinkedCopyEngines, IsAtLeastXeHpCore) { - DebugManagerStateRestore restore; - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssign.set(1u); - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignStartingValue.set(2); - debugManager.flags.EnableCmdQRoundRobindBcsEngineAssignLimit.set(5); - DeviceBitfield deviceBitfield = 0b10; - - auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); - auto &hwInfo = *rootDeviceEnvironment.getMutableHardwareInfo(); - hwInfo.featureTable.ftrBcsInfo = 0x17f; - auto &selectorCopyEngine = pDevice->getNearestGenericSubDevice(0)->getSelectorCopyEngine(); - - int32_t expectedEngineType = aub_stream::EngineType::ENGINE_BCS3; - auto &gfxCoreHelper = pDevice->getGfxCoreHelper(); - for (int32_t i = 0; i <= 20; i++) { - while (!gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, deviceBitfield, static_cast(expectedEngineType)) || !hwInfo.featureTable.ftrBcsInfo.test(expectedEngineType == aub_stream::EngineType::ENGINE_BCS - ? 0 - : expectedEngineType - aub_stream::EngineType::ENGINE_BCS1 + 1)) { - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS7) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS3; - } - } - - auto engineType = EngineHelpers::selectLinkCopyEngine(pDevice->getRootDeviceEnvironment(), deviceBitfield, selectorCopyEngine.selector); - EXPECT_EQ(engineType, static_cast(expectedEngineType)); - - if (expectedEngineType == aub_stream::EngineType::ENGINE_BCS) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS1; - } else { - expectedEngineType++; - } - if (static_cast(expectedEngineType) > aub_stream::EngineType::ENGINE_BCS7) { - expectedEngineType = aub_stream::EngineType::ENGINE_BCS3; - } - } -} - HWTEST2_F(EngineNodeHelperTestsXeHPAndLater, givenHpCopyEngineWhenSelectLinkCopyEngineThenHpEngineIsNotSelected, IsAtLeastXeHpCore) { DebugManagerStateRestore restore; debugManager.flags.ContextGroupSize.set(8); diff --git a/shared/test/unit_test/os_interface/product_helper_tests.cpp b/shared/test/unit_test/os_interface/product_helper_tests.cpp index c957006dec..a7812d2bfb 100644 --- a/shared/test/unit_test/os_interface/product_helper_tests.cpp +++ b/shared/test/unit_test/os_interface/product_helper_tests.cpp @@ -343,10 +343,6 @@ HWTEST_F(ProductHelperTest, givenVariousDebugKeyValuesWhenGettingLocalMemoryAcce EXPECT_EQ(LocalMemoryAccessMode::cpuAccessDisallowed, productHelper->getLocalMemoryAccessMode(pInHwInfo)); } -HWTEST_F(ProductHelperTest, WhenCheckAssignEngineRoundRobinSupportedThenReturnFalse) { - EXPECT_FALSE(productHelper->isAssignEngineRoundRobinSupported()); -} - HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfPipeControlPriorToNonPipelinedStateCommandsWARequiredThenFalseIsReturned, IsNotXeHpgOrXeHpcCore) { auto isRcs = false;