mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Disable Zebin on pre-Gen12 platforms with debugger active and spirv
Related-To: NEO-7328 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b6c51c6793
commit
1961842601
@@ -110,11 +110,18 @@ if(SUPPORT_GEN9 OR SUPPORT_GEN11 OR SUPPORT_GEN12LP)
|
||||
)
|
||||
endif()
|
||||
|
||||
if(SUPPORT_GEN12LP)
|
||||
list(APPEND L0_RUNTIME_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helpers/l0_hw_helper_tgllp_and_later.inl
|
||||
)
|
||||
endif()
|
||||
|
||||
if(SUPPORT_XEHP_AND_LATER)
|
||||
list(APPEND L0_RUNTIME_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist/cmdlist_hw_xehp_and_later.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdqueue/cmdqueue_xe_hp_core_and_later.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helpers/l0_hw_helper_xehp_and_later.inl
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/hw_helpers/l0_hw_helper_tgllp_and_later.inl
|
||||
)
|
||||
endif()
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "level_zero/core/source/helpers/l0_populate_factory.h"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_base.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_skl_to_tgllp.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_tgllp_and_later.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_tgllp_to_dg2.inl"
|
||||
#include "level_zero/tools/source/debug/eu_thread.h"
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@ enum class EngineGroupType : uint32_t;
|
||||
struct HardwareInfo;
|
||||
struct EngineGroupT;
|
||||
struct RootDeviceEnvironment;
|
||||
class SourceLevelDebugger;
|
||||
} // namespace NEO
|
||||
|
||||
namespace L0 {
|
||||
@@ -56,7 +57,7 @@ class L0GfxCoreHelper {
|
||||
virtual bool platformSupportsFrontEndTracking() const = 0;
|
||||
virtual bool platformSupportsPipelineSelectTracking() const = 0;
|
||||
virtual bool platformSupportsRayTracing() const = 0;
|
||||
|
||||
virtual bool isZebinAllowed(const NEO::SourceLevelDebugger *debugger) const = 0;
|
||||
virtual uint32_t getEventMaxKernelCount(const NEO::HardwareInfo &hwInfo) const = 0;
|
||||
virtual uint32_t getEventBaseMaxPacketCount(const NEO::HardwareInfo &hwInfo) const = 0;
|
||||
|
||||
@@ -88,7 +89,7 @@ class L0GfxCoreHelperHw : public L0GfxCoreHelper {
|
||||
bool platformSupportsFrontEndTracking() const override;
|
||||
bool platformSupportsPipelineSelectTracking() const override;
|
||||
bool platformSupportsRayTracing() const override;
|
||||
|
||||
bool isZebinAllowed(const NEO::SourceLevelDebugger *debugger) const override;
|
||||
uint32_t getEventMaxKernelCount(const NEO::HardwareInfo &hwInfo) const override;
|
||||
uint32_t getEventBaseMaxPacketCount(const NEO::HardwareInfo &hwInfo) const override;
|
||||
};
|
||||
|
||||
@@ -76,4 +76,9 @@ std::vector<EuThread::ThreadId> L0GfxCoreHelperHw<Family>::getThreadsFromAttenti
|
||||
return threads;
|
||||
}
|
||||
|
||||
template <typename Family>
|
||||
bool L0GfxCoreHelperHw<Family>::isZebinAllowed(const NEO::SourceLevelDebugger *debugger) const {
|
||||
return !debugger;
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper.h"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
template <typename Family>
|
||||
bool L0GfxCoreHelperHw<Family>::isZebinAllowed(const NEO::SourceLevelDebugger *debugger) const {
|
||||
return true;
|
||||
}
|
||||
|
||||
} // namespace L0
|
||||
@@ -33,6 +33,7 @@
|
||||
|
||||
#include "level_zero/core/source/device/device.h"
|
||||
#include "level_zero/core/source/driver/driver_handle.h"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper.h"
|
||||
#include "level_zero/core/source/kernel/kernel.h"
|
||||
#include "level_zero/core/source/module/module_build_log.h"
|
||||
|
||||
@@ -243,17 +244,28 @@ ze_result_t ModuleTranslationUnit::buildFromSpirV(const char *input, uint32_t in
|
||||
return ZE_RESULT_ERROR_DEPENDENCY_UNAVAILABLE;
|
||||
}
|
||||
|
||||
std::string internalOptions = this->generateCompilerOptions(buildOptions, internalBuildOptions);
|
||||
|
||||
auto specConstantResult = this->processSpecConstantInfo(compilerInterface, pConstants, input, inputSize);
|
||||
if (!specConstantResult) {
|
||||
return ZE_RESULT_ERROR_MODULE_BUILD_FAILURE;
|
||||
}
|
||||
|
||||
auto &l0GfxCoreHelper = this->device->getNEODevice()->getRootDeviceEnvironment().getHelper<L0GfxCoreHelper>();
|
||||
std::string internalOptions = this->generateCompilerOptions(buildOptions, internalBuildOptions);
|
||||
|
||||
auto isZebinAllowed = l0GfxCoreHelper.isZebinAllowed(this->device->getSourceLevelDebugger());
|
||||
if (isZebinAllowed == false) {
|
||||
auto pos = this->options.find(NEO::CompilerOptions::allowZebin.str());
|
||||
if (pos != std::string::npos) {
|
||||
updateBuildLog("Cannot build zebinary for this device with debugger enabled. Remove \"-ze-intel-allow-zebin\" build flag.");
|
||||
return ZE_RESULT_ERROR_MODULE_BUILD_FAILURE;
|
||||
}
|
||||
internalOptions += " " + NEO::CompilerOptions::disableZebin.str();
|
||||
}
|
||||
|
||||
NEO::TranslationInput inputArgs = {IGC::CodeType::spirV, IGC::CodeType::oclGenBin};
|
||||
|
||||
inputArgs.src = ArrayRef<const char>(input, inputSize);
|
||||
inputArgs.apiOptions = ArrayRef<const char>(options.c_str(), options.length());
|
||||
inputArgs.apiOptions = ArrayRef<const char>(this->options.c_str(), this->options.length());
|
||||
inputArgs.internalOptions = ArrayRef<const char>(internalOptions.c_str(), internalOptions.length());
|
||||
inputArgs.allowCaching = true;
|
||||
return this->compileGenBinary(inputArgs, false);
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "level_zero/core/source/helpers/l0_populate_factory.h"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_base.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_tgllp_and_later.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_tgllp_to_dg2.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_xehp_and_later.inl"
|
||||
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "level_zero/core/source/helpers/l0_populate_factory.h"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_base.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_pvc_and_later.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_tgllp_and_later.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_xehp_and_later.inl"
|
||||
|
||||
namespace L0 {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
|
||||
#include "level_zero/core/source/helpers/l0_populate_factory.h"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_base.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_tgllp_and_later.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_tgllp_to_dg2.inl"
|
||||
#include "level_zero/core/source/hw_helpers/l0_hw_helper_xehp_and_later.inl"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user