fix: disable usm compression on linux

Related-To: NEO-12047

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2024-07-16 13:11:39 +00:00
committed by Compute-Runtime-Automation
parent 09b41d8146
commit b03ac6abd1
6 changed files with 24 additions and 3 deletions

View File

@@ -1162,4 +1162,10 @@ uint64_t MemoryManager::adjustToggleBitFlagForGpuVa(AllocationType inputAllocati
return gpuAddress;
}
bool MemoryManager::usmCompressionSupported(Device *device) {
auto &hwInfo = device->getHardwareInfo();
auto &gfxCoreHelper = device->getGfxCoreHelper();
return gfxCoreHelper.usmCompressionSupported(hwInfo);
}
} // namespace NEO

View File

@@ -307,6 +307,7 @@ class MemoryManager {
virtual bool releaseMediaContext(uint32_t rootDeviceIndex, uint64_t doorbellHandle) { return false; }
virtual bool isCompressionSupportedForShareable(bool isShareable) { return true; }
virtual bool usmCompressionSupported(Device *device);
protected:
bool getAllocationData(AllocationData &allocationData, const AllocationProperties &properties, const void *hostPtr, const StorageInfo &storageInfo);

View File

@@ -826,9 +826,7 @@ AllocationType SVMAllocsManager::getGraphicsAllocationTypeAndCompressionPreferen
allocationType = AllocationType::writeCombined;
} else {
UNRECOVERABLE_IF(nullptr == unifiedMemoryProperties.device);
auto &gfxCoreHelper = unifiedMemoryProperties.device->getGfxCoreHelper();
auto &hwInfo = unifiedMemoryProperties.device->getHardwareInfo();
if (CompressionSelector::allowStatelessCompression() || gfxCoreHelper.usmCompressionSupported(hwInfo)) {
if (CompressionSelector::allowStatelessCompression() || memoryManager->usmCompressionSupported(unifiedMemoryProperties.device)) {
compressionEnabled = true;
}
if (unifiedMemoryProperties.requestedAllocationType != AllocationType::unknown) {

View File

@@ -2745,4 +2745,11 @@ bool DrmMemoryManager::isCompressionSupportedForShareable(bool isShareable) {
return !isShareable;
}
bool DrmMemoryManager::usmCompressionSupported(Device *device) {
if (NEO::debugManager.flags.RenderCompressedBuffersEnabled.get() != -1) {
return !!NEO::debugManager.flags.RenderCompressedBuffersEnabled.get();
}
return false;
}
} // namespace NEO

View File

@@ -105,6 +105,7 @@ class DrmMemoryManager : public MemoryManager {
bool releaseMediaContext(uint32_t rootDeviceIndex, uint64_t doorbellHandle) override;
bool isCompressionSupportedForShareable(bool isShareable) override;
bool usmCompressionSupported(Device *device) override;
protected:
void registerSharedBoHandleAllocation(DrmAllocation *drmAllocation);

View File

@@ -7933,4 +7933,12 @@ TEST_F(DrmMemoryManagerTest, givenDebugVariableToToggleGpuVaBitsWhenAllocatingRe
TEST_F(DrmMemoryManagerTest, givenIsCompressionSupportedForShareableThenReturnCorrectValue) {
EXPECT_FALSE(memoryManager->isCompressionSupportedForShareable(true));
EXPECT_TRUE(memoryManager->isCompressionSupportedForShareable(false));
}
TEST_F(DrmMemoryManagerTest, givenUsmCompressionSupportedThenReturnFalse) {
DebugManagerStateRestore dbgState;
EXPECT_FALSE(memoryManager->usmCompressionSupported(device));
debugManager.flags.RenderCompressedBuffersEnabled.set(1);
EXPECT_TRUE(memoryManager->usmCompressionSupported(device));
}