performance: disable blit enqueue on LNL

Resolves: NEO-11471

Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
Lukasz Jobczyk 2024-07-03 13:28:55 +00:00 committed by Compute-Runtime-Automation
parent b40ec06256
commit a96f2ea13a
11 changed files with 35 additions and 13 deletions

View File

@ -1061,7 +1061,8 @@ bool CommandQueue::queueDependenciesClearRequired() const {
}
bool CommandQueue::blitEnqueueAllowed(const CsrSelectionArgs &args) const {
bool blitEnqueueAllowed = ((device->getRootDeviceEnvironment().isWddmOnLinux() || device->getRootDeviceEnvironment().getProductHelper().blitEnqueueAllowed()) && getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) || this->isCopyOnly;
auto isWriteToImageFromBuffer = args.dstResource.image && args.dstResource.image->isImageFromBuffer();
bool blitEnqueueAllowed = ((device->getRootDeviceEnvironment().isWddmOnLinux() || device->getRootDeviceEnvironment().getProductHelper().blitEnqueueAllowed(isWriteToImageFromBuffer)) && getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled()) || this->isCopyOnly;
if (debugManager.flags.EnableBlitterForEnqueueOperations.get() != -1) {
blitEnqueueAllowed = debugManager.flags.EnableBlitterForEnqueueOperations.get();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2022-2023 Intel Corporation
* Copyright (C) 2022-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -33,7 +33,7 @@ struct ImageAubFixture : public AUBCommandStreamFixture {
MockExecutionEnvironment mockExecutionEnvironment{};
auto &productHelper = mockExecutionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHelper<ProductHelper>();
if (!productHelper.isBlitterForImagesSupported() || !productHelper.blitEnqueueAllowed()) {
if (!productHelper.isBlitterForImagesSupported() || !productHelper.blitEnqueueAllowed(false)) {
GTEST_SKIP();
}

View File

@ -1693,7 +1693,7 @@ TEST(CommandQueue, givenCopyOnlyQueueWhenCallingBlitEnqueueAllowedThenReturnTrue
CsrSelectionArgs selectionArgs{CL_COMMAND_READ_BUFFER, &multiAlloc, &multiAlloc, 0u, nullptr};
queue.isCopyOnly = false;
EXPECT_EQ(queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() && context.getDevice(0)->getProductHelper().blitEnqueueAllowed(),
EXPECT_EQ(queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() && context.getDevice(0)->getProductHelper().blitEnqueueAllowed(false),
queue.blitEnqueueAllowed(selectionArgs));
queue.isCopyOnly = true;
@ -1720,7 +1720,7 @@ TEST(CommandQueue, givenSimpleClCommandWhenCallingBlitEnqueueAllowedThenReturnCo
CL_COMMAND_SVM_MEMCPY}) {
CsrSelectionArgs args{cmdType, &multiAlloc, &multiAlloc, 0u, nullptr};
bool expectedValue = queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() && context.getDevice(0)->getProductHelper().blitEnqueueAllowed();
bool expectedValue = queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() && context.getDevice(0)->getProductHelper().blitEnqueueAllowed(false);
if (cmdType == CL_COMMAND_COPY_IMAGE_TO_BUFFER) {
expectedValue = false;
}
@ -1785,6 +1785,25 @@ TEST(CommandQueue, givenImageToBufferClCommandWhenCallingBlitEnqueueAllowedThenR
EXPECT_FALSE(queue.blitEnqueueAllowed(args));
}
TEST(CommandQueue, givenWriteToImageFromBufferWhenCallingBlitEnqueueAllowedThenReturnCorrectValue) {
MockContext context{};
MockCommandQueue queue(&context, context.getDevice(0), 0, false);
if (queue.countBcsEngines() == 0) {
queue.bcsEngines[0] = &context.getDevice(0)->getDefaultEngine();
}
auto buffer = std::unique_ptr<Buffer>(BufferHelper<>::create(&context));
size_t origin[3] = {0, 0, 0};
size_t region[3] = {1, 1, 1};
MockImageBase dstImage{};
dstImage.associatedMemObject = buffer.get();
CsrSelectionArgs args{CL_COMMAND_WRITE_IMAGE, nullptr, &dstImage, 0u, region, nullptr, origin};
bool expectedValue = queue.getGpgpuCommandStreamReceiver().peekTimestampPacketWriteEnabled() && context.getDevice(0)->getProductHelper().blitEnqueueAllowed(true) && context.getDevice(0)->getProductHelper().isBlitterForImagesSupported();
EXPECT_EQ(queue.blitEnqueueAllowed(args), expectedValue);
}
TEST(CommandQueue, givenBufferWhenMultiStorageIsNotSetThenDontRequireMigrations) {
MockDefaultContext context{true};
MockCommandQueue queue(&context, context.getDevice(1), 0, false);

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2023 Intel Corporation
* Copyright (C) 2020-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -173,7 +173,7 @@ HWTEST_F(NoBcsBufferTests, givenProductWithNoFullyBlitterSupportWhenCreatingBuff
}
HWTEST_TEMPLATED_F(BcsBufferTests, givenBcsSupportedWhenEnqueueBufferOperationIsCalledThenUseBcsCsr) {
if (!device->getRootDeviceEnvironment().getProductHelper().blitEnqueueAllowed()) {
if (!device->getRootDeviceEnvironment().getProductHelper().blitEnqueueAllowed(false)) {
GTEST_SKIP();
}

View File

@ -16,6 +16,7 @@
namespace NEO {
struct MockImageBase : public Image {
using Image::associatedMemObject;
using Image::imageDesc;
using Image::imageFormat;
using Image::is3DUAVOrRTV;

View File

@ -37,6 +37,7 @@ struct StateComputeModeProperties;
struct StateComputeModePropertiesSupport;
class ProductHelper;
class ReleaseHelper;
class Image;
class GraphicsAllocation;
class MemoryManager;
struct RootDeviceEnvironment;
@ -166,7 +167,7 @@ class ProductHelper {
virtual uint32_t getL1CachePolicy(bool isDebuggerActive) const = 0;
virtual bool isEvictionIfNecessaryFlagSupported() const = 0;
virtual void adjustNumberOfCcs(HardwareInfo &hwInfo) const = 0;
virtual bool blitEnqueueAllowed() const = 0;
virtual bool blitEnqueueAllowed(bool isWriteToImageFromBuffer) const = 0;
virtual bool isPrefetcherDisablingInDirectSubmissionRequired() const = 0;
virtual bool isStatefulAddressingModeSupported() const = 0;
virtual bool isPlatformQuerySupported() const = 0;

View File

@ -377,7 +377,7 @@ bool ProductHelperHw<gfxProduct>::isPageFaultSupported() const {
}
template <PRODUCT_FAMILY gfxProduct>
bool ProductHelperHw<gfxProduct>::blitEnqueueAllowed() const {
bool ProductHelperHw<gfxProduct>::blitEnqueueAllowed(bool isWriteToImageFromBuffer) const {
return true;
}

View File

@ -70,7 +70,7 @@ class ProductHelperHw : public ProductHelper {
bool isStorageInfoAdjustmentRequired() const override;
bool isBlitterForImagesSupported() const override;
bool isPageFaultSupported() const override;
bool blitEnqueueAllowed() const override;
bool blitEnqueueAllowed(bool isWriteToImageFromBuffer) const override;
bool isKmdMigrationSupported() const override;
bool isDisableScratchPagesSupported() const override;
bool isTile64With3DSurfaceOnBCSSupported(const HardwareInfo &hwInfo) const override;

View File

@ -44,7 +44,7 @@ bool ProductHelperHw<gfxProduct>::isEvictionIfNecessaryFlagSupported() const {
}
template <>
bool ProductHelperHw<gfxProduct>::blitEnqueueAllowed() const {
bool ProductHelperHw<gfxProduct>::blitEnqueueAllowed(bool isWriteToImageFromBuffer) const {
return false;
}

View File

@ -480,7 +480,7 @@ HWTEST2_F(ProductHelperTest, givenProductHelperWhenAskedIfDisableScratchPagesIsS
}
HWTEST_F(ProductHelperTest, givenProductHelperWhenCheckBlitEnqueueAllowedThenReturnTrue) {
EXPECT_TRUE(productHelper->blitEnqueueAllowed());
EXPECT_TRUE(productHelper->blitEnqueueAllowed(false));
}
HWTEST_F(ProductHelperTest, givenProductHelperWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned) {

View File

@ -193,7 +193,7 @@ HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenGettingEvictIfNecessary
}
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCheckBlitEnqueueAllowedThenReturnFalse, IsXeLpg) {
EXPECT_FALSE(productHelper->blitEnqueueAllowed());
EXPECT_FALSE(productHelper->blitEnqueueAllowed(false));
}
HWTEST2_F(XeLpgProductHelperTests, givenProductHelperWhenCallGetInternalHeapsPreallocatedThenReturnCorrectValue, IsXeLpg) {