From 7d506e3608e64e69a0bf339c87738e6744b31cb0 Mon Sep 17 00:00:00 2001 From: Zbigniew Zdanowicz Date: Fri, 11 Sep 2020 15:44:09 +0200 Subject: [PATCH] Add debug flag to enable compression in L0 USM allocations Related-To: NEO-5069 Change-Id: Icbfeb8d72cd764bb3c90d5c699998455f81dd3ee Signed-off-by: Zbigniew Zdanowicz --- level_zero/core/source/CMakeLists.txt | 1 + .../compression_selector_l0.cpp | 23 ++++++ .../sources/memory_manager/CMakeLists.txt | 11 +++ .../compression_selector_l0_tests.cpp | 77 +++++++++++++++++++ opencl/source/memory_manager/CMakeLists.txt | 1 + .../compression_selector_ocl.cpp | 15 ++++ .../unit_test/helpers/hw_helper_tests.cpp | 32 -------- .../test/unit_test/mem_obj/buffer_tests.cpp | 4 - .../test/unit_test/test_files/igdrcl.config | 3 +- .../command_container/command_encoder.inl | 4 +- .../debug_settings/debug_variables_base.inl | 1 + shared/source/helpers/hw_helper_base.inl | 3 +- shared/source/memory_manager/CMakeLists.txt | 1 + .../memory_manager/allocation_properties.h | 3 +- .../memory_manager/compression_selector.h | 18 +++++ .../source/memory_manager/memory_manager.cpp | 3 +- .../memory_manager/unified_memory_manager.cpp | 1 + ...ry_manager_allocate_in_device_pool_dg1.cpp | 10 ++- 18 files changed, 165 insertions(+), 46 deletions(-) create mode 100644 level_zero/core/source/memory_manager/compression_selector_l0.cpp create mode 100644 level_zero/core/test/unit_tests/sources/memory_manager/CMakeLists.txt create mode 100644 level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp create mode 100644 opencl/source/memory_manager/compression_selector_ocl.cpp create mode 100644 shared/source/memory_manager/compression_selector.h diff --git a/level_zero/core/source/CMakeLists.txt b/level_zero/core/source/CMakeLists.txt index d90ea5f645..da7acbfe03 100644 --- a/level_zero/core/source/CMakeLists.txt +++ b/level_zero/core/source/CMakeLists.txt @@ -64,6 +64,7 @@ set(L0_RUNTIME_SOURCES ${CMAKE_CURRENT_SOURCE_DIR}/memory/memory.cpp ${CMAKE_CURRENT_SOURCE_DIR}/memory/memory_operations_helper.h ${CMAKE_CURRENT_SOURCE_DIR}/memory/cpu_page_fault_memory_manager.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/memory_manager/compression_selector_l0.cpp ${CMAKE_CURRENT_SOURCE_DIR}/module/module.h ${CMAKE_CURRENT_SOURCE_DIR}/module/module_build_log.cpp ${CMAKE_CURRENT_SOURCE_DIR}/module/module_build_log.h diff --git a/level_zero/core/source/memory_manager/compression_selector_l0.cpp b/level_zero/core/source/memory_manager/compression_selector_l0.cpp new file mode 100644 index 0000000000..f07ae7aa70 --- /dev/null +++ b/level_zero/core/source/memory_manager/compression_selector_l0.cpp @@ -0,0 +1,23 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debug_settings/debug_settings_manager.h" +#include "shared/source/memory_manager/compression_selector.h" + +namespace NEO { +bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties) { + bool preferredCompression = false; + int32_t compressionEnabled = DebugManager.flags.EnableUsmCompression.get(); + if (compressionEnabled == 1) { + if ((properties.allocationType == GraphicsAllocation::AllocationType::SVM_GPU) || + (properties.flags.isUSMDeviceAllocation)) { + preferredCompression = true; + } + } + return preferredCompression; +} +} // namespace NEO diff --git a/level_zero/core/test/unit_tests/sources/memory_manager/CMakeLists.txt b/level_zero/core/test/unit_tests/sources/memory_manager/CMakeLists.txt new file mode 100644 index 0000000000..8696ca8aad --- /dev/null +++ b/level_zero/core/test/unit_tests/sources/memory_manager/CMakeLists.txt @@ -0,0 +1,11 @@ +# +# Copyright (C) 2020 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +target_sources(${TARGET_NAME} PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/compression_selector_l0_tests.cpp +) +add_subdirectories() diff --git a/level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp b/level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp new file mode 100644 index 0000000000..fc10cb4584 --- /dev/null +++ b/level_zero/core/test/unit_tests/sources/memory_manager/compression_selector_l0_tests.cpp @@ -0,0 +1,77 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/memory_manager/compression_selector.h" +#include "shared/test/unit_test/helpers/debug_manager_state_restore.h" + +#include "test.h" + +namespace L0 { +namespace ult { + +TEST(CompressionSelectorL0Tests, GivenDefaultDebugFlagWhenProvidingUsmAllocationThenExpectCompressionDisabled) { + DeviceBitfield deviceBitfield{0x0}; + AllocationProperties properties(0, MemoryConstants::pageSize, + GraphicsAllocation::AllocationType::BUFFER, + deviceBitfield); + properties.flags.isUSMDeviceAllocation = 1u; + + EXPECT_FALSE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties)); +} + +TEST(CompressionSelectorL0Tests, GivenDisabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionDisabled) { + DebugManagerStateRestore dbgRestorer; + DebugManager.flags.EnableUsmCompression.set(0); + + DeviceBitfield deviceBitfield{0x0}; + AllocationProperties properties(0, MemoryConstants::pageSize, + GraphicsAllocation::AllocationType::BUFFER, + deviceBitfield); + properties.flags.isUSMDeviceAllocation = 1u; + + EXPECT_FALSE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties)); +} + +TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingUsmAllocationThenExpectCompressionEnabled) { + DebugManagerStateRestore dbgRestorer; + DebugManager.flags.EnableUsmCompression.set(1); + + DeviceBitfield deviceBitfield{0x0}; + AllocationProperties properties(0, MemoryConstants::pageSize, + GraphicsAllocation::AllocationType::BUFFER, + deviceBitfield); + properties.flags.isUSMDeviceAllocation = 1u; + + EXPECT_TRUE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties)); +} + +TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingSvmGpuAllocationThenExpectCompressionEnabled) { + DebugManagerStateRestore dbgRestorer; + DebugManager.flags.EnableUsmCompression.set(1); + + DeviceBitfield deviceBitfield{0x0}; + AllocationProperties properties(0, MemoryConstants::pageSize, + GraphicsAllocation::AllocationType::SVM_GPU, + deviceBitfield); + + EXPECT_TRUE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties)); +} + +TEST(CompressionSelectorL0Tests, GivenEnabledDebugFlagWhenProvidingOtherAllocationThenExpectCompressionDisabled) { + DebugManagerStateRestore dbgRestorer; + DebugManager.flags.EnableUsmCompression.set(1); + + DeviceBitfield deviceBitfield{0x0}; + AllocationProperties properties(0, MemoryConstants::pageSize, + GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY, + deviceBitfield); + + EXPECT_FALSE(NEO::CompressionSelector::preferRenderCompressedBuffer(properties)); +} + +} // namespace ult +} // namespace L0 diff --git a/opencl/source/memory_manager/CMakeLists.txt b/opencl/source/memory_manager/CMakeLists.txt index f8e8ec2c79..6a36f6915e 100644 --- a/opencl/source/memory_manager/CMakeLists.txt +++ b/opencl/source/memory_manager/CMakeLists.txt @@ -8,6 +8,7 @@ set(RUNTIME_SRCS_MEMORY_MANAGER ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/address_mapper.cpp ${CMAKE_CURRENT_SOURCE_DIR}/address_mapper.h + ${CMAKE_CURRENT_SOURCE_DIR}/compression_selector_ocl.cpp ${CMAKE_CURRENT_SOURCE_DIR}/cpu_page_fault_manager_memory_sync.cpp ${CMAKE_CURRENT_SOURCE_DIR}/mem_obj_surface.h ${CMAKE_CURRENT_SOURCE_DIR}/memory_banks.h diff --git a/opencl/source/memory_manager/compression_selector_ocl.cpp b/opencl/source/memory_manager/compression_selector_ocl.cpp new file mode 100644 index 0000000000..eccc8ebd5a --- /dev/null +++ b/opencl/source/memory_manager/compression_selector_ocl.cpp @@ -0,0 +1,15 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/memory_manager/compression_selector.h" + +namespace NEO { +bool CompressionSelector::preferRenderCompressedBuffer(const AllocationProperties &properties) { + return GraphicsAllocation::AllocationType::BUFFER_COMPRESSED == properties.allocationType; +} + +} // namespace NEO diff --git a/opencl/test/unit_test/helpers/hw_helper_tests.cpp b/opencl/test/unit_test/helpers/hw_helper_tests.cpp index 38650a914c..6e4c6f7f60 100644 --- a/opencl/test/unit_test/helpers/hw_helper_tests.cpp +++ b/opencl/test/unit_test/helpers/hw_helper_tests.cpp @@ -460,38 +460,6 @@ HWTEST_F(HwHelperTest, givenCreatedSurfaceStateBufferWhenGmmAndAllocationCompres alignedFree(stateBuffer); } -HWTEST_F(HwHelperTest, givenCreatedSurfaceStateBufferWhenGmmCompressionEnabledAndAllocationDisabledAnNonAuxDisabledThenSetCoherencyToIaAndAuxModeToNone) { - using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; - using SURFACE_TYPE = typename RENDER_SURFACE_STATE::SURFACE_TYPE; - using AUXILIARY_SURFACE_MODE = typename RENDER_SURFACE_STATE::AUXILIARY_SURFACE_MODE; - - auto &rootDeviceEnvironment = pDevice->getRootDeviceEnvironment(); - void *stateBuffer = alignedMalloc(sizeof(RENDER_SURFACE_STATE), sizeof(RENDER_SURFACE_STATE)); - ASSERT_NE(nullptr, stateBuffer); - RENDER_SURFACE_STATE *state = reinterpret_cast(stateBuffer); - - memset(stateBuffer, 0, sizeof(RENDER_SURFACE_STATE)); - auto &helper = HwHelper::get(renderCoreFamily); - - size_t size = 0x1000; - uint64_t addr = 0x2000; - uint32_t pitch = 0; - - void *cpuAddr = reinterpret_cast(0x4000); - uint64_t gpuAddr = 0x4000u; - size_t allocSize = size; - GraphicsAllocation allocation(0, GraphicsAllocation::AllocationType::UNKNOWN, cpuAddr, gpuAddr, 0u, allocSize, MemoryPool::MemoryNull, 1); - allocation.setDefaultGmm(new Gmm(rootDeviceEnvironment.getGmmClientContext(), allocation.getUnderlyingBuffer(), allocation.getUnderlyingBufferSize(), false)); - allocation.getDefaultGmm()->isRenderCompressed = true; - SURFACE_TYPE type = RENDER_SURFACE_STATE::SURFACE_TYPE_SURFTYPE_BUFFER; - helper.setRenderSurfaceStateForBuffer(rootDeviceEnvironment, stateBuffer, size, addr, 0, pitch, &allocation, false, type, false, false); - EXPECT_EQ(RENDER_SURFACE_STATE::COHERENCY_TYPE_IA_COHERENT, state->getCoherencyType()); - EXPECT_EQ(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE, state->getAuxiliarySurfaceMode()); - - delete allocation.getDefaultGmm(); - alignedFree(stateBuffer); -} - HWTEST_F(HwHelperTest, givenCreatedSurfaceStateBufferWhenGmmCompressionDisabledAndAllocationEnabledAnNonAuxDisabledThenSetCoherencyToIaAndAuxModeToNone) { using RENDER_SURFACE_STATE = typename FamilyType::RENDER_SURFACE_STATE; using SURFACE_TYPE = typename RENDER_SURFACE_STATE::SURFACE_TYPE; diff --git a/opencl/test/unit_test/mem_obj/buffer_tests.cpp b/opencl/test/unit_test/mem_obj/buffer_tests.cpp index 78d6e96c81..aa710cdd5e 100644 --- a/opencl/test/unit_test/mem_obj/buffer_tests.cpp +++ b/opencl/test/unit_test/mem_obj/buffer_tests.cpp @@ -1551,10 +1551,6 @@ HWTEST_F(BufferSetSurfaceTests, givenRenderCompressedGmmResourceWhenSurfaceState EXPECT_EQ(0u, surfaceState.getAuxiliarySurfaceBaseAddress()); EXPECT_TRUE(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E == surfaceState.getAuxiliarySurfaceMode()); EXPECT_TRUE(RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT == surfaceState.getCoherencyType()); - - graphicsAllocation->setAllocationType(GraphicsAllocation::AllocationType::BUFFER); - buffer->setArgStateful(&surfaceState, false, false, false, false, context.getDevice(0)->getDevice()); - EXPECT_TRUE(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE == surfaceState.getAuxiliarySurfaceMode()); } HWTEST_F(BufferSetSurfaceTests, givenNonRenderCompressedGmmResourceWhenSurfaceStateIsProgrammedThenDontSetAuxParams) { diff --git a/opencl/test/unit_test/test_files/igdrcl.config b/opencl/test/unit_test/test_files/igdrcl.config index 412ec52355..598decd8ed 100644 --- a/opencl/test/unit_test/test_files/igdrcl.config +++ b/opencl/test/unit_test/test_files/igdrcl.config @@ -188,4 +188,5 @@ ForceUserptrAlignment = -1 UseExternalAllocatorForSshAndDsh = 0 DirectSubmissionOverrideBlitterSupport = -1 DirectSubmissionOverrideRenderSupport = -1 -DirectSubmissionOverrideComputeSupport = -1 \ No newline at end of file +DirectSubmissionOverrideComputeSupport = -1 +EnableUsmCompression = -1 \ No newline at end of file diff --git a/shared/source/command_container/command_encoder.inl b/shared/source/command_container/command_encoder.inl index 377c2554bb..80b20e3b7b 100644 --- a/shared/source/command_container/command_encoder.inl +++ b/shared/source/command_container/command_encoder.inl @@ -294,6 +294,7 @@ void EncodeSurfaceState::encodeBuffer(void *dst, uint64_t address, size_ : R_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT); ss->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE); } + template void EncodeSurfaceState::encodeExtraBufferParams(GraphicsAllocation *allocation, GmmHelper *gmmHelper, void *memory, bool forceNonAuxMode, bool isReadOnlyArgument) { using RENDER_SURFACE_STATE = typename Family::RENDER_SURFACE_STATE; @@ -302,8 +303,7 @@ void EncodeSurfaceState::encodeExtraBufferParams(GraphicsAllocation *all auto surfaceState = reinterpret_cast(memory); Gmm *gmm = allocation ? allocation->getDefaultGmm() : nullptr; - if (gmm && gmm->isRenderCompressed && !forceNonAuxMode && - GraphicsAllocation::AllocationType::BUFFER_COMPRESSED == allocation->getAllocationType()) { + if (gmm && gmm->isRenderCompressed && !forceNonAuxMode) { // Its expected to not program pitch/qpitch/baseAddress for Aux surface in CCS scenarios surfaceState->setCoherencyType(RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT); surfaceState->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E); diff --git a/shared/source/debug_settings/debug_variables_base.inl b/shared/source/debug_settings/debug_variables_base.inl index aa46c3ba59..8c8ba1a415 100644 --- a/shared/source/debug_settings/debug_variables_base.inl +++ b/shared/source/debug_settings/debug_variables_base.inl @@ -77,6 +77,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, OverrideLeastOccupiedBank, -1, "-1: default, >= DECLARE_DEBUG_VARIABLE(int32_t, OverrideRevision, -1, "-1: default, >=0: Revision id") DECLARE_DEBUG_VARIABLE(int32_t, ForceCacheFlushForBcs, -1, "Force cache flush from gpgpu engine before dispatching BCS copy. -1: default, 1: enabled, 0: disabled") DECLARE_DEBUG_VARIABLE(int32_t, ForceGpgpuSubmissionForBcsEnqueue, -1, "-1: Default, 1: Submit gpgpu command buffer with cache flushing and completion synchronization, 0: Do nothing, if possible") +DECLARE_DEBUG_VARIABLE(int32_t, EnableUsmCompression, -1, "enable compression support for L0 USM Device and Shared Device side: -1 default, 0: disable, 1: enable") /*LOGGING FLAGS*/ DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level") diff --git a/shared/source/helpers/hw_helper_base.inl b/shared/source/helpers/hw_helper_base.inl index 226e3b7a20..86797c3a72 100644 --- a/shared/source/helpers/hw_helper_base.inl +++ b/shared/source/helpers/hw_helper_base.inl @@ -151,8 +151,7 @@ void HwHelperHw::setRenderSurfaceStateForBuffer(const RootDeviceEnvironm state.setSurfaceBaseAddress(bufferStateAddress); Gmm *gmm = gfxAlloc ? gfxAlloc->getDefaultGmm() : nullptr; - if (gmm && gmm->isRenderCompressed && !forceNonAuxMode && - GraphicsAllocation::AllocationType::BUFFER_COMPRESSED == gfxAlloc->getAllocationType()) { + if (gmm && gmm->isRenderCompressed && !forceNonAuxMode) { // Its expected to not program pitch/qpitch/baseAddress for Aux surface in CCS scenarios state.setCoherencyType(RENDER_SURFACE_STATE::COHERENCY_TYPE_GPU_COHERENT); state.setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_CCS_E); diff --git a/shared/source/memory_manager/CMakeLists.txt b/shared/source/memory_manager/CMakeLists.txt index a0bf9d5ebe..ba45d22f09 100644 --- a/shared/source/memory_manager/CMakeLists.txt +++ b/shared/source/memory_manager/CMakeLists.txt @@ -8,6 +8,7 @@ set(NEO_CORE_MEMORY_MANAGER ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt ${CMAKE_CURRENT_SOURCE_DIR}/allocations_list.h ${CMAKE_CURRENT_SOURCE_DIR}/allocation_properties.h + ${CMAKE_CURRENT_SOURCE_DIR}/compression_selector.h ${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.h ${CMAKE_CURRENT_SOURCE_DIR}/deferrable_allocation_deletion.cpp ${CMAKE_CURRENT_SOURCE_DIR}/deferrable_deletion.h diff --git a/shared/source/memory_manager/allocation_properties.h b/shared/source/memory_manager/allocation_properties.h index 9dd035ee63..3d4b10f2ea 100644 --- a/shared/source/memory_manager/allocation_properties.h +++ b/shared/source/memory_manager/allocation_properties.h @@ -24,7 +24,8 @@ struct AllocationProperties { uint32_t shareable : 1; uint32_t resource48Bit : 1; uint32_t isUSMHostAllocation : 1; - uint32_t reserved : 22; + uint32_t isUSMDeviceAllocation : 1; + uint32_t reserved : 21; } flags; uint32_t allFlags = 0; }; diff --git a/shared/source/memory_manager/compression_selector.h b/shared/source/memory_manager/compression_selector.h new file mode 100644 index 0000000000..9b8ed606e1 --- /dev/null +++ b/shared/source/memory_manager/compression_selector.h @@ -0,0 +1,18 @@ +/* + * Copyright (C) 2020 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#pragma once +#include "shared/source/memory_manager/allocation_properties.h" +#include "shared/source/memory_manager/graphics_allocation.h" + +namespace NEO { +class CompressionSelector { + public: + static bool preferRenderCompressedBuffer(const AllocationProperties &properties); +}; + +} // namespace NEO diff --git a/shared/source/memory_manager/memory_manager.cpp b/shared/source/memory_manager/memory_manager.cpp index 0cef50da1f..c1bf8edc95 100644 --- a/shared/source/memory_manager/memory_manager.cpp +++ b/shared/source/memory_manager/memory_manager.cpp @@ -21,6 +21,7 @@ #include "shared/source/helpers/hw_info.h" #include "shared/source/helpers/string.h" #include "shared/source/helpers/surface_format_info.h" +#include "shared/source/memory_manager/compression_selector.h" #include "shared/source/memory_manager/deferrable_allocation_deletion.h" #include "shared/source/memory_manager/deferred_deleter.h" #include "shared/source/memory_manager/host_ptr_manager.h" @@ -369,7 +370,7 @@ bool MemoryManager::getAllocationData(AllocationData &allocationData, const Allo allocationData.flags.uncacheable = properties.flags.uncacheable; allocationData.flags.flushL3 = (mayRequireL3Flush ? properties.flags.flushL3RequiredForRead | properties.flags.flushL3RequiredForWrite : 0u); - allocationData.flags.preferRenderCompressed = GraphicsAllocation::AllocationType::BUFFER_COMPRESSED == properties.allocationType; + allocationData.flags.preferRenderCompressed = CompressionSelector::preferRenderCompressedBuffer(properties); allocationData.flags.multiOsContextCapable = properties.flags.multiOsContextCapable; allocationData.hostPtr = hostPtr; diff --git a/shared/source/memory_manager/unified_memory_manager.cpp b/shared/source/memory_manager/unified_memory_manager.cpp index 0d84d8c2ee..7e944ceb49 100644 --- a/shared/source/memory_manager/unified_memory_manager.cpp +++ b/shared/source/memory_manager/unified_memory_manager.cpp @@ -180,6 +180,7 @@ void *SVMAllocsManager::createUnifiedMemoryAllocation(uint32_t rootDeviceIndex, memoryProperties.subdeviceBitfield.count() > 1, memoryProperties.subdeviceBitfield}; unifiedMemoryProperties.flags.shareable = memoryProperties.allocationFlags.flags.shareable; + unifiedMemoryProperties.flags.isUSMDeviceAllocation = true; GraphicsAllocation *unifiedMemoryAllocation = memoryManager->allocateGraphicsMemoryWithProperties(unifiedMemoryProperties); if (!unifiedMemoryAllocation) { diff --git a/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp b/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp index 60e78761ae..0c26242802 100644 --- a/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp +++ b/shared/source/os_interface/linux/drm_memory_manager_allocate_in_device_pool_dg1.cpp @@ -133,14 +133,18 @@ GraphicsAllocation *DrmMemoryManager::allocateGraphicsMemoryInDevicePool(const A gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), *allocationData.imgInfo, allocationData.storageInfo); sizeAligned = alignUp(allocationData.imgInfo->size, MemoryConstants::pageSize64k); } else { - bool preferRenderCompressed = (allocationData.type == GraphicsAllocation::AllocationType::BUFFER_COMPRESSED); if (allocationData.type == GraphicsAllocation::AllocationType::WRITE_COMBINED) { sizeAligned = alignUp(allocationData.size + MemoryConstants::pageSize64k, 2 * MemoryConstants::megaByte) + 2 * MemoryConstants::megaByte; } else { sizeAligned = alignUp(allocationData.size, MemoryConstants::pageSize64k); } - gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), nullptr, sizeAligned, allocationData.flags.uncacheable, - preferRenderCompressed, false, allocationData.storageInfo); + gmm = std::make_unique(executionEnvironment.rootDeviceEnvironments[allocationData.rootDeviceIndex]->getGmmClientContext(), + nullptr, + sizeAligned, + allocationData.flags.uncacheable, + allocationData.flags.preferRenderCompressed, + false, + allocationData.storageInfo); } auto sizeAllocated = sizeAligned;