mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +08:00
fix: disable usm compression on linux
Related-To: NEO-12047 Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
09b41d8146
commit
b03ac6abd1
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
Reference in New Issue
Block a user