Dont create VM IDs if not supported

Signed-off-by: Bartosz Dunajski <bartosz.dunajski@intel.com>
This commit is contained in:
Bartosz Dunajski
2021-04-12 16:55:34 +00:00
committed by Compute-Runtime-Automation
parent 9839b3049d
commit 45b005161a
5 changed files with 23 additions and 8 deletions

View File

@ -1,10 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_DG1)
if(SUPPORT_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
set(L0_SRCS_TOOLS_SYSMAN_MEMORY_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/dg1${BRANCH_DIR_SUFFIX}/os_memory_imp.cpp

View File

@ -1,10 +1,10 @@
#
# Copyright (C) 2020 Intel Corporation
# Copyright (C) 2020-2021 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
if(SUPPORT_DG1)
if(SUPPORT_DG1 AND "${BRANCH_TYPE}" STREQUAL "")
set(L0_TESTS_TOOLS_SYSMAN_MEMORY_LINUX
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
${CMAKE_CURRENT_SOURCE_DIR}/dg1/mock_memory.h

View File

@ -99,10 +99,12 @@ Drm *Drm::create(std::unique_ptr<HwDeviceId> hwDeviceId, RootDeviceEnvironment &
}
if (!drmObject->queryMemoryInfo()) {
drmObject->setPerContextVMRequired(true);
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query memory info\n");
}
if (!drmObject->queryEngineInfo()) {
drmObject->setPerContextVMRequired(true);
printDebugString(DebugManager.flags.PrintDebugMessages.get(), stderr, "%s", "WARNING: Failed to query engine info\n");
}

View File

@ -459,6 +459,10 @@ TEST_F(DrmTests, whenDrmIsCreatedWithMultipleSubDevicesThenCreateMultipleVirtual
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
EXPECT_NE(drm, nullptr);
if (drm->isPerContextVMRequired()) {
GTEST_SKIP();
}
auto numSubDevices = HwHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo());
for (auto id = 0u; id < numSubDevices; id++) {
EXPECT_EQ(id + 1, drm->getVirtualMemoryAddressSpace(id));
@ -499,7 +503,12 @@ TEST_F(DrmTests, givenEnabledDebuggingAndVmBindNotAvailableWhenDrmIsCreatedThenP
auto drm = DrmWrap::createDrm(*rootDeviceEnvironment);
EXPECT_NE(drm, nullptr);
EXPECT_FALSE(drm->isPerContextVMRequired());
if (drm->isPerContextVMRequired()) {
::testing::internal::GetCapturedStdout();
::testing::internal::GetCapturedStderr();
GTEST_SKIP();
}
auto numSubDevices = HwHelper::getSubDevicesCount(rootDeviceEnvironment->getHardwareInfo());
for (auto id = 0u; id < numSubDevices; id++) {
@ -531,7 +540,10 @@ TEST_F(DrmTests, givenDrmIsCreatedWhenCreateVirtualMemoryFailsThenReturnVirtualM
EXPECT_EQ(0u, static_cast<DrmWrap *>(drm.get())->virtualMemoryIds.size());
std::string errStr = ::testing::internal::GetCapturedStderr();
EXPECT_THAT(errStr, ::testing::HasSubstr(std::string("INFO: Device doesn't support GEM Virtual Memory")));
if (!drm->isPerContextVMRequired()) {
EXPECT_THAT(errStr, ::testing::HasSubstr(std::string("INFO: Device doesn't support GEM Virtual Memory")));
}
::testing::internal::GetCapturedStdout();
}

View File

@ -1,5 +1,5 @@
/*
* Copyright (C) 2019-2020 Intel Corporation
* Copyright (C) 2019-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@ -9,7 +9,8 @@
namespace NEO {
struct MemoryInfo {
class MemoryInfo {
public:
MemoryInfo() = default;
virtual ~MemoryInfo() = 0;
};