do not load FCL in Level Zero runtime

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
This commit is contained in:
Artur Harasimiuk
2022-08-30 16:12:04 +00:00
committed by Compute-Runtime-Automation
parent 5d4aca361f
commit 6118e41741
4 changed files with 36 additions and 21 deletions

View File

@@ -52,6 +52,27 @@ extern HwHelper *hwHelperFactory[IGFX_MAX_CORE];
namespace L0 {
namespace ult {
TEST(L0DeviceTest, givenNonExistingFclWhenCreatingDeviceThenCompilerInterfaceIsCreated) {
NEO::MockCompilerEnableGuard mock(true);
VariableBackup<const char *> frontEndDllName(&Os::frontEndDllName);
Os::frontEndDllName = "_fake_fcl1_so";
ze_result_t returnValue = ZE_RESULT_SUCCESS;
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
auto neoDevice = std::unique_ptr<NEO::Device>(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
ASSERT_NE(nullptr, neoDevice);
auto device = std::unique_ptr<L0::Device>(Device::create(driverHandle.get(), neoDevice.release(), false, &returnValue));
ASSERT_NE(nullptr, device);
EXPECT_EQ(returnValue, ZE_RESULT_SUCCESS);
auto compilerInterface = device->getNEODevice()->getCompilerInterface();
ASSERT_NE(nullptr, compilerInterface);
}
TEST(L0DeviceTest, GivenCreatedDeviceHandleWhenCallingdeviceReinitThenNewDeviceHandleIsNotCreated) {
ze_result_t returnValue = ZE_RESULT_SUCCESS;
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
@@ -212,24 +233,6 @@ TEST(L0DeviceTest, givenDisabledPreemptionWhenCreatingDeviceThenSipKernelIsNotIn
EXPECT_FALSE(NEO::MockSipData::called);
}
TEST(L0DeviceTest, givenDeviceWithoutFCLCompilerLibraryThenInvalidDependencyReturned) {
ze_result_t returnValue = ZE_RESULT_SUCCESS;
std::unique_ptr<DriverHandleImp> driverHandle(new DriverHandleImp);
auto hwInfo = *NEO::defaultHwInfo;
auto neoDevice = std::unique_ptr<NEO::Device>(NEO::MockDevice::createWithNewExecutionEnvironment<NEO::MockDevice>(&hwInfo, 0));
auto oldFclDllName = Os::frontEndDllName;
Os::frontEndDllName = "_invalidFCL";
auto device = std::unique_ptr<L0::Device>(Device::create(driverHandle.get(), neoDevice.release(), false, &returnValue));
ASSERT_NE(nullptr, device);
EXPECT_EQ(returnValue, ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE);
Os::frontEndDllName = oldFclDllName;
}
TEST(L0DeviceTest, givenDeviceWithoutIGCCompilerLibraryThenInvalidDependencyReturned) {
ze_result_t returnValue = ZE_RESULT_SUCCESS;

View File

@@ -10,6 +10,7 @@
#include "shared/source/helpers/hw_helper.h"
#include "shared/source/indirect_heap/indirect_heap.h"
#include "shared/source/os_interface/os_context.h"
#include "shared/source/os_interface/os_inc_base.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/engine_descriptor_helper.h"
#include "shared/test/common/helpers/raii_hw_helper.h"
@@ -269,6 +270,17 @@ TEST(DeviceCleanup, givenDeviceWhenItIsDestroyedThenFlushBatchedSubmissionsIsCal
EXPECT_EQ(1, flushedBatchedSubmissionsCalledCount);
}
TEST(DeviceCreation, GiveNonExistingFclWhenCreatingDeviceThenCompilerInterfaceIsNotCreated) {
VariableBackup<const char *> frontEndDllName(&Os::frontEndDllName);
Os::frontEndDllName = "_fake_fcl1_so";
auto mockDevice = std::unique_ptr<Device>(MockDevice::createWithNewExecutionEnvironment<Device>(nullptr));
ASSERT_NE(nullptr, mockDevice);
auto compilerInterface = mockDevice->getCompilerInterface();
ASSERT_EQ(nullptr, compilerInterface);
}
TEST(DeviceCreation, givenSelectedAubCsrInDebugVarsWhenDeviceIsCreatedThenIsSimulationReturnsTrue) {
DebugManagerStateRestore dbgRestorer;
DebugManager.flags.SetCommandStreamReceiver.set(CommandStreamReceiverType::CSR_AUB);

View File

@@ -8,7 +8,6 @@ Build-Depends: debhelper (>= 11),
level-zero-devel,
intel-igc-opencl-devel,
libigdgmm-dev,
# libva-dev,
pkg-config
Standards-Version: 4.3.0
Homepage: https://github.com/oneapi-src/level-zero
@@ -18,7 +17,7 @@ Architecture: amd64
Depends:
${shlibs:Depends},
${misc:Depends},
intel-igc-opencl,
intel-igc-core,
libigdgmm12
Description: Intel(R) Graphics Compute Runtime for oneAPI Level Zero.
Level Zero is the primary low-level interface for language and runtime

View File

@@ -17,6 +17,7 @@
#include "shared/source/execution_environment/execution_environment.h"
#include "shared/source/gmm_helper/gmm_helper.h"
#include "shared/source/gmm_helper/page_table_mngr.h"
#include "shared/source/helpers/api_specific_config.h"
#include "shared/source/helpers/hw_info.h"
#include "shared/source/memory_manager/memory_manager.h"
#include "shared/source/memory_manager/memory_operations_handler.h"
@@ -132,7 +133,7 @@ CompilerInterface *RootDeviceEnvironment::getCompilerInterface() {
std::lock_guard<std::mutex> autolock(this->mtx);
if (this->compilerInterface.get() == nullptr) {
auto cache = std::make_unique<CompilerCache>(getDefaultCompilerCacheConfig());
this->compilerInterface.reset(CompilerInterface::createInstance(std::move(cache), true));
this->compilerInterface.reset(CompilerInterface::createInstance(std::move(cache), ApiSpecificConfig::getApiType() == ApiSpecificConfig::ApiType::OCL));
}
}
return this->compilerInterface.get();