Clarify meaning of ForceDeviceId debug flag

this flag can be used only to override device id in AUB/TBX mode

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
This commit is contained in:
Mateusz Jablonski
2022-09-19 12:31:20 +00:00
committed by Compute-Runtime-Automation
parent eea582355d
commit 99d63facb5
7 changed files with 2 additions and 79 deletions

View File

@@ -79,7 +79,7 @@ DECLARE_DEBUG_VARIABLE(bool, DisableForceToStateless, false, "If platform requir
DECLARE_DEBUG_VARIABLE(bool, DebuggerDisableSingleAddressSbaTracking, false, "Disable SBA Tracking command programming in single address space mode")
DECLARE_DEBUG_VARIABLE(bool, ForceTheoreticalMaxWorkGroupCount, false, "Do not apply any limitation to max cooperative/concurrent work-group count queries")
DECLARE_DEBUG_VARIABLE(bool, DisableScratchPages, false, "Disable scratch pages during VM creations")
DECLARE_DEBUG_VARIABLE(std::string, ForceDeviceId, std::string("unk"), "DeviceId selected for testing")
DECLARE_DEBUG_VARIABLE(std::string, ForceDeviceId, std::string("unk"), "Override device id in AUB/TBX mode")
DECLARE_DEBUG_VARIABLE(std::string, FilterDeviceId, std::string("unk"), "Device id filter, adapter matching device id will be opened. Ignored when unk.")
DECLARE_DEBUG_VARIABLE(std::string, FilterBdfPath, std::string("unk"), "Linux-only, BDF path filter, only matching paths will be opened. Ignored when unk.")
DECLARE_DEBUG_VARIABLE(std::string, LoadBinarySipFromFile, std::string("unk"), "Select binary file to load SIP kernel raw binary. When file named *_header.* exists, it is used as header")

View File

@@ -526,11 +526,6 @@ std::vector<std::unique_ptr<HwDeviceId>> Drm::discoverDevices(ExecutionEnvironme
continue;
}
}
if (DebugManager.flags.ForceDeviceId.get() != "unk") {
if (devicePathView.find(DebugManager.flags.ForceDeviceId.get().c_str()) == std::string::npos) {
continue;
}
}
int fileDescriptor = SysCalls::open(file->c_str(), O_RDWR);
appendHwDeviceId(hwDeviceIds, fileDescriptor, pciPath.c_str());
if (!hwDeviceIds.empty() && hwDeviceIds.size() == numRootDevices) {

View File

@@ -25,8 +25,7 @@ bool canUseAdapterBasedOnDriverDesc(const char *driverDescription) {
}
bool isAllowedDeviceId(uint32_t deviceId) {
return DeviceFactory::isAllowedDeviceId(deviceId, DebugManager.flags.FilterDeviceId.get()) &&
DeviceFactory::isAllowedDeviceId(deviceId, DebugManager.flags.ForceDeviceId.get());
return DeviceFactory::isAllowedDeviceId(deviceId, DebugManager.flags.FilterDeviceId.get());
}
} // namespace NEO

View File

@@ -130,28 +130,6 @@ TEST(IsAllowedDeviceId, whenDebugKeyNotSetThenReturnTrue) {
EXPECT_TRUE(NEO::isAllowedDeviceId(0xdeadbeef));
}
TEST(IsAllowedDeviceId, whenForceDeviceIdDebugKeySetThenExpectSpecificValue) {
DebugManagerStateRestore rest;
DebugManager.flags.ForceDeviceId.set("167");
EXPECT_FALSE(NEO::isAllowedDeviceId(0xdeadbeef));
DebugManager.flags.ForceDeviceId.set("1678");
EXPECT_FALSE(NEO::isAllowedDeviceId(0x167));
DebugManager.flags.ForceDeviceId.set("167");
EXPECT_TRUE(NEO::isAllowedDeviceId(0x167));
}
TEST(IsAllowedDeviceId, whenForceDeviceIdDebugKeySetThenTreatAsHex) {
DebugManagerStateRestore rest;
DebugManager.flags.ForceDeviceId.set("167");
EXPECT_FALSE(NEO::isAllowedDeviceId(167));
DebugManager.flags.ForceDeviceId.set("167");
EXPECT_TRUE(NEO::isAllowedDeviceId(0x167));
}
TEST(IsAllowedDeviceId, whenFilterDeviceIdDebugKeySetThenExpectSpecificValue) {
DebugManagerStateRestore rest;
DebugManager.flags.FilterDeviceId.set("167");