feature: Adding debug key for custom igc lib name

This commit adds new debug key which can be used
to override loaded igc libary name.

E.g. IgcLibraryName=my_custom_igc.so

Related-To: NEO-14579

Signed-off-by: Chodor, Jaroslaw <jaroslaw.chodor@intel.com>
This commit is contained in:
Chodor, Jaroslaw
2025-05-22 11:59:28 +00:00
committed by Compute-Runtime-Automation
parent bd938166e6
commit 2c10dc2f53
4 changed files with 13 additions and 0 deletions

View File

@@ -675,6 +675,7 @@ DECLARE_DEBUG_VARIABLE(int64_t, ReadOnlyAllocationsTypeMask, 0, "0: default, >0
DECLARE_DEBUG_VARIABLE(bool, IgnoreZebinUnknownAttributes, false, "enable to treat unknown zebin attributes as warning instead of error") DECLARE_DEBUG_VARIABLE(bool, IgnoreZebinUnknownAttributes, false, "enable to treat unknown zebin attributes as warning instead of error")
DECLARE_DEBUG_VARIABLE(std::string, FinalizerInputType, std::string("unk"), "unk: default (N/A), input type for finalizer") DECLARE_DEBUG_VARIABLE(std::string, FinalizerInputType, std::string("unk"), "unk: default (N/A), input type for finalizer")
DECLARE_DEBUG_VARIABLE(std::string, FinalizerLibraryName, std::string("unk"), "Library name for finalizer") DECLARE_DEBUG_VARIABLE(std::string, FinalizerLibraryName, std::string("unk"), "Library name for finalizer")
DECLARE_DEBUG_VARIABLE(std::string, IgcLibraryName, std::string("unk"), "Library name for igc")
DECLARE_DEBUG_SCOPED_V(int32_t, UseIgcAsFcl, 0, S_RT | S_OCLOC, "0: platform default, 1: force use IGC, 2: force use FCL") DECLARE_DEBUG_SCOPED_V(int32_t, UseIgcAsFcl, 0, S_RT | S_OCLOC, "0: platform default, 1: force use IGC, 2: force use FCL")
DECLARE_DEBUG_VARIABLE(int32_t, EnableGlobalTimestampViaSubmission, -1, "-1: OS Interface, 0: OS Interface, 1: Submission. This flag sets the type of method to get timestamp for getGlobalTimestamps"); DECLARE_DEBUG_VARIABLE(int32_t, EnableGlobalTimestampViaSubmission, -1, "-1: OS Interface, 0: OS Interface, 1: Submission. This flag sets the type of method to get timestamp for getGlobalTimestamps");

View File

@@ -316,6 +316,9 @@ bool CompilerProductHelperHw<gfxProduct>::isForceBindlessRequired(const Hardware
template <PRODUCT_FAMILY gfxProduct> template <PRODUCT_FAMILY gfxProduct>
const char *CompilerProductHelperHw<gfxProduct>::getCustomIgcLibraryName() const { const char *CompilerProductHelperHw<gfxProduct>::getCustomIgcLibraryName() const {
if (debugManager.flags.IgcLibraryName.get() != "unk") {
return debugManager.flags.IgcLibraryName.getRef().c_str();
}
return nullptr; return nullptr;
} }

View File

@@ -667,4 +667,5 @@ ExposeSingleDevice=-1
OverrideCopyOffloadMode = -1 OverrideCopyOffloadMode = -1
UseSingleListForTemporaryAllocations = -1 UseSingleListForTemporaryAllocations = -1
OverrideMaxMemAllocSizeMb = -1 OverrideMaxMemAllocSizeMb = -1
IgcLibraryName = unk
# Please don't edit below this line # Please don't edit below this line

View File

@@ -29,6 +29,14 @@ HWTEST_F(CompilerProductHelperFixture, WhenIsMidThreadPreemptionIsSupportedIsCal
EXPECT_TRUE(compilerProductHelper.isMidThreadPreemptionSupported(hwInfo)); EXPECT_TRUE(compilerProductHelper.isMidThreadPreemptionSupported(hwInfo));
} }
TEST(CompilerProductHelperTest, GivenIgcLibraryNameDebugKeyWhenQueryingForCustomIgcLibraryNameThenDebugKeyValueisReturned) {
DebugManagerStateRestore restorer;
debugManager.flags.IgcLibraryName.set("my_custom_igc.so");
auto compilerProductHelper = CompilerProductHelper::create(defaultHwInfo->platform.eProductFamily);
EXPECT_STREQ("my_custom_igc.so", compilerProductHelper->getCustomIgcLibraryName());
}
TEST(CompilerProductHelperTest, WhenCompilerProductHelperCreateIsCalledWithUnknownProductThenNullptrIsReturned) { TEST(CompilerProductHelperTest, WhenCompilerProductHelperCreateIsCalledWithUnknownProductThenNullptrIsReturned) {
EXPECT_EQ(nullptr, CompilerProductHelper::create(IGFX_UNKNOWN)); EXPECT_EQ(nullptr, CompilerProductHelper::create(IGFX_UNKNOWN));
} }