mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
Temporarily disabling local memory for DG2 in WSL
Forcing system memory pool for all allocations in WSL for DG2 while local memory support is being implemented Signed-off-by: Kamil Diedrich <kamil.diedrich@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
7fc9b2c3dc
commit
8ec74558ea
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -220,6 +220,13 @@ TEST_F(GmmTests, givenNullptrWhenGmmConstructorIsCalledThenNoGfxMemoryIsProperly
|
||||
EXPECT_EQ(gmm->resourceParams.NoGfxMemory, 1u);
|
||||
}
|
||||
|
||||
HWTEST_F(GmmTests, givenGmmWithForceLocalMemThenNonLocalIsSetToFalse) {
|
||||
void *pSysMem = nullptr;
|
||||
std::unique_ptr<Gmm> gmm(new Gmm(getGmmClientContext(), pSysMem, 4096, 0, false, false, false, {}));
|
||||
|
||||
EXPECT_EQ(gmm->resourceParams.Flags.Info.NonLocalOnly, 0u);
|
||||
}
|
||||
|
||||
TEST_F(GmmTests, givenPtrWhenGmmConstructorIsCalledThenNoGfxMemoryIsProperlySet) {
|
||||
void *pSysMem = reinterpret_cast<void *>(0x1111);
|
||||
std::unique_ptr<Gmm> gmm(new Gmm(getGmmClientContext(), pSysMem, 4096, 0, false));
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "opencl/test/unit_test/os_interface/hw_info_config_tests.h"
|
||||
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
@@ -386,3 +387,11 @@ HWTEST_F(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3DSurfaceOnBCSI
|
||||
const auto &hwInfoConfig = *HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
EXPECT_TRUE(hwInfoConfig.isTile64With3DSurfaceOnBCSSupported(pInHwInfo));
|
||||
}
|
||||
|
||||
HWTEST_F(HwInfoConfigTest, WhenOverrideResourceInfoParamsForWslForDRMandWDDMThenFalseIsReturned) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(pInHwInfo.platform.eProductFamily);
|
||||
bool ret = hwInfoConfig->overrideResourceInfoParamsForWsl(DriverModelType::DRM);
|
||||
EXPECT_FALSE(ret);
|
||||
ret = hwInfoConfig->overrideResourceInfoParamsForWsl(DriverModelType::WDDM);
|
||||
EXPECT_FALSE(ret);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2021 Intel Corporation
|
||||
# Copyright (C) 2021-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -42,3 +42,15 @@ DG2TEST_F(HwInfoConfigTestLinuxDg2, GivenDg2WhenConfigureHardwareCustomThenKmdNo
|
||||
EXPECT_TRUE(pInHwInfo.capabilityTable.kmdNotifyProperties.enableQuickKmdSleepForDirectSubmission);
|
||||
EXPECT_EQ(20ll, pInHwInfo.capabilityTable.kmdNotifyProperties.delayQuickKmdSleepForDirectSubmissionMicroseconds);
|
||||
}
|
||||
|
||||
DG2TEST_F(HwInfoConfigTestLinuxDg2, WhenOverrideResourceInfoParamsForWslAndDriverModelWDDMThenTrueIsReturned) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
bool ret = hwInfoConfig->overrideResourceInfoParamsForWsl(DriverModelType::WDDM);
|
||||
EXPECT_TRUE(ret);
|
||||
}
|
||||
|
||||
DG2TEST_F(HwInfoConfigTestLinuxDg2, WhenOverrideResourceInfoParamsForWslAndDriverModelDRMThenFalseIsReturned) {
|
||||
auto hwInfoConfig = HwInfoConfig::get(productFamily);
|
||||
bool ret = hwInfoConfig->overrideResourceInfoParamsForWsl(DriverModelType::DRM);
|
||||
EXPECT_FALSE(ret);
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -14,3 +14,4 @@ HWTEST_EXCLUDE_PRODUCT(XeHPAndLaterImageTests, givenImageFromBufferWhenSettingSu
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenSamplerStateWhenAdjustSamplerStateThenNothingIsChanged, IGFX_XE_HPG_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfBlitterForImagesIsSupportedThenFalseIsReturned, IGFX_XE_HPG_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, givenHwInfoConfigWhenAskedIfTile64With3DSurfaceOnBCSIsSupportedThenTrueIsReturned, IGFX_XE_HPG_CORE);
|
||||
HWTEST_EXCLUDE_PRODUCT(HwInfoConfigTest, WhenOverrideResourceInfoParamsForWslForDRMandWDDMThenFalseIsReturned, IGFX_XE_HPG_CORE);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -32,6 +32,7 @@ GmmClientContext::GmmClientContext(OSInterface *osInterface, HardwareInfo *hwInf
|
||||
|
||||
if (osInterface && osInterface->getDriverModel()) {
|
||||
osInterface->getDriverModel()->setGmmInputArgs(&inArgs);
|
||||
driverModelType = osInterface->getDriverModel()->getDriverModelType();
|
||||
}
|
||||
|
||||
auto ret = GmmInterface::initialize(&inArgs, &outArgs);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -8,6 +8,7 @@
|
||||
#pragma once
|
||||
#include "shared/source/gmm_helper/client_context/gmm_handle_allocator.h"
|
||||
#include "shared/source/gmm_helper/gmm_lib.h"
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
@@ -35,6 +36,10 @@ class GmmClientContext {
|
||||
return hardwareInfo;
|
||||
}
|
||||
|
||||
DriverModelType getDriverModelType() {
|
||||
return driverModelType;
|
||||
}
|
||||
|
||||
MOCKABLE_VIRTUAL uint8_t getSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format);
|
||||
MOCKABLE_VIRTUAL uint8_t getMediaSurfaceStateCompressionFormat(GMM_RESOURCE_FORMAT format);
|
||||
|
||||
@@ -49,6 +54,7 @@ class GmmClientContext {
|
||||
}
|
||||
|
||||
protected:
|
||||
DriverModelType driverModelType = DriverModelType::UNKNOWN;
|
||||
HardwareInfo *hardwareInfo = nullptr;
|
||||
GMM_CLIENT_CONTEXT *clientContext;
|
||||
std::unique_ptr<GmmHandleAllocator> handleAllocator;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -12,10 +12,12 @@
|
||||
#include "shared/source/gmm_helper/resource_info.h"
|
||||
#include "shared/source/helpers/aligned_memory.h"
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/helpers/ptr_math.h"
|
||||
#include "shared/source/helpers/surface_format_info.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
namespace NEO {
|
||||
Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t alignedSize, size_t alignment, bool uncacheable) : Gmm(clientContext, alignedPtr, alignedSize, alignment, uncacheable, false, true, {}) {}
|
||||
@@ -37,6 +39,7 @@ Gmm::Gmm(GmmClientContext *clientContext, const void *alignedPtr, size_t aligned
|
||||
resourceParams.BaseWidth64 += MemoryConstants::pageSize;
|
||||
}
|
||||
}
|
||||
|
||||
if (!uncacheable) {
|
||||
resourceParams.Usage = GMM_RESOURCE_USAGE_OCL_BUFFER;
|
||||
} else {
|
||||
@@ -377,6 +380,10 @@ void Gmm::applyMemoryFlags(bool systemMemoryPool, StorageInfo &storageInfo) {
|
||||
resourceParams.MultiTileArch.LocalMemEligibilitySet = static_cast<uint8_t>(tileSelected);
|
||||
}
|
||||
}
|
||||
|
||||
if (HwInfoConfig::get(hardwareInfo->platform.eProductFamily)->overrideResourceInfoParamsForWsl(clientContext->getDriverModelType())) {
|
||||
resourceParams.Flags.Info.NonLocalOnly = 1;
|
||||
}
|
||||
}
|
||||
|
||||
void Gmm::applyDebugOverrides() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2019-2021 Intel Corporation
|
||||
# Copyright (C) 2019-2022 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -39,6 +39,7 @@ set(NEO_CORE_HELPERS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/constants.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/debug_helpers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/deferred_deleter_helper.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/driver_model_type.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dirty_state_helpers.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/dirty_state_helpers.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/enable_product.inl
|
||||
|
||||
14
shared/source/helpers/driver_model_type.h
Normal file
14
shared/source/helpers/driver_model_type.h
Normal file
@@ -0,0 +1,14 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace NEO {
|
||||
enum class DriverModelType { UNKNOWN,
|
||||
WDDM,
|
||||
DRM };
|
||||
};
|
||||
@@ -20,6 +20,7 @@ struct StateComputeModeProperties;
|
||||
struct PipelineSelectArgs;
|
||||
class OSInterface;
|
||||
class HwInfoConfig;
|
||||
enum class DriverModelType;
|
||||
|
||||
extern HwInfoConfig *hwInfoConfigFactory[IGFX_MAX_PRODUCT];
|
||||
|
||||
@@ -57,6 +58,7 @@ class HwInfoConfig {
|
||||
virtual void setAdditionalPipelineSelectFields(void *pipelineSelectCmd, const PipelineSelectArgs &pipelineSelectArgs, const HardwareInfo &hwInfo) = 0;
|
||||
virtual bool isDefaultEngineTypeAdjustmentRequired(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool overrideGfxPartitionLayoutForWsl() const = 0;
|
||||
virtual bool overrideResourceInfoParamsForWsl(DriverModelType driverModelType) const = 0;
|
||||
virtual std::string getDeviceMemoryName() const = 0;
|
||||
virtual bool isDisableOverdispatchAvailable(const HardwareInfo &hwInfo) const = 0;
|
||||
virtual bool allowCompression(const HardwareInfo &hwInfo) const = 0;
|
||||
@@ -120,6 +122,7 @@ class HwInfoConfigHw : public HwInfoConfig {
|
||||
bool isBlitterFullySupported(const HardwareInfo &hwInfo) const override;
|
||||
bool isPageTableManagerSupported(const HardwareInfo &hwInfo) const override;
|
||||
bool overrideGfxPartitionLayoutForWsl() const override;
|
||||
bool overrideResourceInfoParamsForWsl(DriverModelType driverModelType) const override;
|
||||
uint32_t getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const override;
|
||||
uint32_t getSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
|
||||
uint32_t getAubStreamSteppingFromHwRevId(const HardwareInfo &hwInfo) const override;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2021 Intel Corporation
|
||||
* Copyright (C) 2020-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/api_specific_config.h"
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
#include "shared/source/helpers/hw_helper.h"
|
||||
#include "shared/source/helpers/preamble.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
@@ -123,6 +124,11 @@ bool HwInfoConfigHw<gfxProduct>::overrideGfxPartitionLayoutForWsl() const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
bool HwInfoConfigHw<gfxProduct>::overrideResourceInfoParamsForWsl(DriverModelType driverModelType) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
template <PRODUCT_FAMILY gfxProduct>
|
||||
uint32_t HwInfoConfigHw<gfxProduct>::getHwRevIdFromStepping(uint32_t stepping, const HardwareInfo &hwInfo) const {
|
||||
return CommonConstants::invalidStepping;
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2021 Intel Corporation
|
||||
* Copyright (C) 2018-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#pragma once
|
||||
#include "shared/source/helpers/debug_helpers.h"
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
#include "shared/source/helpers/non_copyable_or_moveable.h"
|
||||
#include "shared/source/os_interface/driver_info.h"
|
||||
|
||||
@@ -18,9 +19,6 @@
|
||||
namespace NEO {
|
||||
class ExecutionEnvironment;
|
||||
class MemoryManager;
|
||||
enum class DriverModelType { UNKNOWN,
|
||||
WDDM,
|
||||
DRM };
|
||||
|
||||
class HwDeviceId : public NonCopyableClass {
|
||||
public:
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -7,6 +7,7 @@
|
||||
|
||||
#include "shared/source/command_stream/stream_properties.h"
|
||||
#include "shared/source/debug_settings/debug_settings_manager.h"
|
||||
#include "shared/source/helpers/driver_model_type.h"
|
||||
#include "shared/source/helpers/hw_info.h"
|
||||
#include "shared/source/kernel/kernel_properties.h"
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
@@ -36,5 +37,11 @@ int HwInfoConfigHw<gfxProduct>::configureHardwareCustom(HardwareInfo *hwInfo, OS
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<gfxProduct>::overrideResourceInfoParamsForWsl(DriverModelType driverModelType) const {
|
||||
return driverModelType == DriverModelType::WDDM;
|
||||
}
|
||||
|
||||
template class HwInfoConfigHw<gfxProduct>;
|
||||
} // namespace NEO
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -277,4 +277,9 @@ bool HwInfoConfigHw<IGFX_UNKNOWN>::getUuid(Device *device, std::array<uint8_t, H
|
||||
return false;
|
||||
}
|
||||
|
||||
template <>
|
||||
bool HwInfoConfigHw<IGFX_UNKNOWN>::overrideResourceInfoParamsForWsl(DriverModelType driverModelType) const {
|
||||
return false;
|
||||
}
|
||||
|
||||
} //namespace NEO
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2021 Intel Corporation
|
||||
* Copyright (C) 2021-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -235,6 +235,17 @@ struct WddmLinuxTest : public ::testing::Test {
|
||||
std::unique_ptr<NEO::GmmClientContext> mockGmmClientContext;
|
||||
};
|
||||
|
||||
using GmmTestsDG2 = WddmLinuxTest;
|
||||
|
||||
HWTEST_EXCLUDE_PRODUCT(GmmTests, givenGmmWithForceLocalMemThenNonLocalIsSetToFalse, IGFX_XE_HPG_CORE);
|
||||
|
||||
DG2TEST_F(GmmTestsDG2, givenGmmWithForceLocalMemThenNonLocalIsSetToTrue) {
|
||||
void *pSysMem = nullptr;
|
||||
std::unique_ptr<NEO::Gmm> gmm(new NEO::Gmm(mockExecEnv.rootDeviceEnvironments[0]->getGmmClientContext(), pSysMem, 4096, 0, false, false, false, {}));
|
||||
|
||||
EXPECT_EQ(gmm->resourceParams.Flags.Info.NonLocalOnly, 1u);
|
||||
}
|
||||
|
||||
using WddmLinuxConfigureDeviceAddressSpaceTest = WddmLinuxTest;
|
||||
|
||||
TEST_F(WddmLinuxConfigureDeviceAddressSpaceTest, givenSvmAddressSpaceThenReserveGpuVAForUSM) {
|
||||
|
||||
Reference in New Issue
Block a user