2018-11-11 05:25:48 +08:00
|
|
|
/*
|
2024-03-05 23:43:36 +08:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2018-11-11 05:25:48 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2020-10-16 18:10:52 +08:00
|
|
|
#include "shared/source/aub/aub_center.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-10-16 18:10:52 +08:00
|
|
|
#include "shared/source/aub/aub_helper.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/debug_settings/debug_settings_manager.h"
|
2022-11-25 21:44:55 +08:00
|
|
|
#include "shared/source/execution_environment/root_device_environment.h"
|
2023-02-02 00:23:01 +08:00
|
|
|
#include "shared/source/helpers/gfx_core_helper.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2023-03-10 20:28:11 +08:00
|
|
|
#include "shared/source/os_interface/product_helper.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2022-11-23 17:14:27 +08:00
|
|
|
#include "aubstream/aub_manager.h"
|
|
|
|
#include "aubstream/aubstream.h"
|
|
|
|
#include "aubstream/product_family.h"
|
2018-11-11 05:25:48 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2022-11-16 19:03:40 +08:00
|
|
|
extern aub_stream::AubManager *createAubManager(const aub_stream::AubManagerOptions &options);
|
2019-01-19 04:44:23 +08:00
|
|
|
|
2022-11-25 15:58:15 +08:00
|
|
|
AubCenter::AubCenter(const RootDeviceEnvironment &rootDeviceEnvironment, bool localMemoryEnabled, const std::string &aubFileName, CommandStreamReceiverType csrType) {
|
2023-11-30 16:32:25 +08:00
|
|
|
if (debugManager.flags.UseAubStream.get()) {
|
2022-11-25 21:44:55 +08:00
|
|
|
auto hwInfo = rootDeviceEnvironment.getHardwareInfo();
|
2023-10-26 21:04:39 +08:00
|
|
|
auto devicesCount = GfxCoreHelper::getSubDevicesCount(hwInfo);
|
2024-03-05 23:43:36 +08:00
|
|
|
auto releaseHelper = rootDeviceEnvironment.getReleaseHelper();
|
|
|
|
auto memoryBankSize = AubHelper::getPerTileLocalMemorySize(hwInfo, releaseHelper);
|
2024-04-09 20:43:12 +08:00
|
|
|
CommandStreamReceiverType type = obtainCsrTypeFromIntegerValue(debugManager.flags.SetCommandStreamReceiver.get(), csrType);
|
2019-02-19 15:55:11 +08:00
|
|
|
|
2019-02-08 22:08:35 +08:00
|
|
|
aubStreamMode = getAubStreamMode(aubFileName, type);
|
2019-02-05 21:16:37 +08:00
|
|
|
|
2022-12-08 20:22:35 +08:00
|
|
|
auto &gfxCoreHelper = rootDeviceEnvironment.getHelper<GfxCoreHelper>();
|
2022-11-25 21:44:55 +08:00
|
|
|
const auto &productHelper = rootDeviceEnvironment.getHelper<ProductHelper>();
|
2022-11-16 19:03:40 +08:00
|
|
|
|
2022-11-25 15:58:15 +08:00
|
|
|
auto aubStreamProductFamily = productHelper.getAubStreamProductFamily();
|
2022-11-16 19:03:40 +08:00
|
|
|
|
2022-11-25 15:58:15 +08:00
|
|
|
stepping = productHelper.getAubStreamSteppingFromHwRevId(*hwInfo);
|
2021-02-08 19:46:03 +08:00
|
|
|
|
2022-11-25 21:44:55 +08:00
|
|
|
auto gmmHelper = rootDeviceEnvironment.getGmmHelper();
|
2022-12-08 20:22:35 +08:00
|
|
|
aub_stream::MMIOList extraMmioList = gfxCoreHelper.getExtraMmioList(*hwInfo, *gmmHelper);
|
2021-02-08 19:46:03 +08:00
|
|
|
aub_stream::MMIOList debugMmioList = AubHelper::getAdditionalMmioList();
|
|
|
|
|
|
|
|
extraMmioList.insert(extraMmioList.end(), debugMmioList.begin(), debugMmioList.end());
|
|
|
|
|
2024-05-15 00:26:05 +08:00
|
|
|
aub_stream::injectMMIOListLegacy(extraMmioList);
|
2020-08-22 20:12:46 +08:00
|
|
|
|
|
|
|
AubHelper::setTbxConfiguration();
|
2023-10-18 21:25:40 +08:00
|
|
|
aub_stream::setAubStreamCaller(aub_stream::caller::neo);
|
2019-01-14 17:31:06 +08:00
|
|
|
|
2022-11-16 19:03:40 +08:00
|
|
|
aub_stream::AubManagerOptions options{};
|
|
|
|
options.version = 1u;
|
|
|
|
options.productFamily = static_cast<uint32_t>(aubStreamProductFamily.value_or(aub_stream::ProductFamily::MaxProduct));
|
|
|
|
options.devicesCount = devicesCount;
|
|
|
|
options.memoryBankSize = memoryBankSize;
|
|
|
|
options.stepping = stepping;
|
|
|
|
options.localMemorySupported = localMemoryEnabled;
|
|
|
|
options.mode = aubStreamMode;
|
2022-11-25 15:58:15 +08:00
|
|
|
options.gpuAddressSpace = hwInfo->capabilityTable.gpuAddressSpace;
|
2022-11-16 19:03:40 +08:00
|
|
|
|
|
|
|
aubManager.reset(createAubManager(options));
|
2018-11-11 05:25:48 +08:00
|
|
|
}
|
|
|
|
addressMapper = std::make_unique<AddressMapper>();
|
|
|
|
streamProvider = std::make_unique<AubFileStreamProvider>();
|
2019-06-03 15:57:27 +08:00
|
|
|
subCaptureCommon = std::make_unique<AubSubCaptureCommon>();
|
2023-11-30 16:32:25 +08:00
|
|
|
if (debugManager.flags.AUBDumpSubCaptureMode.get()) {
|
|
|
|
this->subCaptureCommon->subCaptureMode = static_cast<AubSubCaptureCommon::SubCaptureMode>(debugManager.flags.AUBDumpSubCaptureMode.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpKernelStartIdx = static_cast<uint32_t>(debugManager.flags.AUBDumpFilterKernelStartIdx.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpKernelEndIdx = static_cast<uint32_t>(debugManager.flags.AUBDumpFilterKernelEndIdx.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpNamedKernelStartIdx = static_cast<uint32_t>(debugManager.flags.AUBDumpFilterNamedKernelStartIdx.get());
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpNamedKernelEndIdx = static_cast<uint32_t>(debugManager.flags.AUBDumpFilterNamedKernelEndIdx.get());
|
|
|
|
if (debugManager.flags.AUBDumpFilterKernelName.get() != "unk") {
|
|
|
|
this->subCaptureCommon->subCaptureFilter.dumpKernelName = debugManager.flags.AUBDumpFilterKernelName.get();
|
2019-02-20 05:50:52 +08:00
|
|
|
}
|
|
|
|
}
|
2018-11-11 05:25:48 +08:00
|
|
|
}
|
2018-12-11 00:12:32 +08:00
|
|
|
|
|
|
|
AubCenter::AubCenter() {
|
|
|
|
addressMapper = std::make_unique<AddressMapper>();
|
|
|
|
streamProvider = std::make_unique<AubFileStreamProvider>();
|
2019-06-03 15:57:27 +08:00
|
|
|
subCaptureCommon = std::make_unique<AubSubCaptureCommon>();
|
2018-12-11 00:12:32 +08:00
|
|
|
}
|
2019-02-05 21:16:37 +08:00
|
|
|
|
2024-04-09 20:43:12 +08:00
|
|
|
uint32_t AubCenter::getAubStreamMode(const std::string &aubFileName, CommandStreamReceiverType csrType) {
|
2019-02-05 21:16:37 +08:00
|
|
|
uint32_t mode = aub_stream::mode::aubFile;
|
|
|
|
|
2019-02-08 22:08:35 +08:00
|
|
|
switch (csrType) {
|
2024-04-09 20:43:12 +08:00
|
|
|
case CommandStreamReceiverType::hardwareWithAub:
|
|
|
|
case CommandStreamReceiverType::aub:
|
2019-02-08 22:08:35 +08:00
|
|
|
mode = aub_stream::mode::aubFile;
|
|
|
|
break;
|
2024-04-09 20:43:12 +08:00
|
|
|
case CommandStreamReceiverType::tbx:
|
2019-02-08 22:08:35 +08:00
|
|
|
mode = aub_stream::mode::tbx;
|
|
|
|
break;
|
2024-04-09 20:43:12 +08:00
|
|
|
case CommandStreamReceiverType::tbxWithAub:
|
2019-02-08 22:08:35 +08:00
|
|
|
mode = aub_stream::mode::aubFileAndTbx;
|
|
|
|
break;
|
2024-04-09 20:43:12 +08:00
|
|
|
case CommandStreamReceiverType::nullAub:
|
|
|
|
mode = aub_stream::mode::null;
|
|
|
|
break;
|
2019-02-08 22:08:35 +08:00
|
|
|
default:
|
|
|
|
break;
|
2019-02-05 21:16:37 +08:00
|
|
|
}
|
2019-02-08 22:08:35 +08:00
|
|
|
|
2019-02-05 21:16:37 +08:00
|
|
|
return mode;
|
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|