Revert "fix: Override timestamp width from KMD"

This reverts commit 7f2b806413.

Signed-off-by: Szymon Morek <szymon.morek@intel.com>
This commit is contained in:
Szymon Morek
2025-06-30 14:05:38 +00:00
committed by Compute-Runtime-Automation
parent 4010ff6908
commit af6ac59a40
13 changed files with 1 additions and 97 deletions

View File

@@ -304,7 +304,6 @@ DECLARE_DEBUG_VARIABLE(int32_t, EnableTimestampPoolAllocator, -1, "-1: default,
DECLARE_DEBUG_VARIABLE(int32_t, ForceComputeWalkerPostSyncFlushWithWrite, -1, "-1: ignore. >=0: Force PostSync cache flush and override postSync immediate write address to given value")
DECLARE_DEBUG_VARIABLE(int32_t, DeferStateInitSubmissionToFirstRegularUsage, -1, "-1: ignore, 0: disabled, 1: enabled. If set, instead of initializing at Device creation, submit initial state during first usage (eg. kernel submission)")
DECLARE_DEBUG_VARIABLE(int32_t, ForceNonWalkerSplitMemoryCopy, -1, "-1: default, 0: disabled, 1: enabled. If set, memory copy will be executed as single byte copy Walker without performance optimizations")
DECLARE_DEBUG_VARIABLE(int32_t, OverrideTimestampWidth, -1, "-1: default from KMD, > 0: Override timestamp width used for profiling. Requires XeKMD kernel.")
DECLARE_DEBUG_VARIABLE(int32_t, DebugUmdFifoPollInterval, -1, "-1: default , > 0: Fifo will be polled based on input in milliseconds.")
DECLARE_DEBUG_VARIABLE(int32_t, SetMaxBVHLevels, -1, "-1: default , > 0: Set maxBVHLevel in RTDispatchGlobal.")
DECLARE_DEBUG_VARIABLE(int32_t, DebugUmdInterruptTimeout, -1, "-1: default , > 0: interruptTimeout based on input in milliseconds. Default is 2000 milliseconds")

View File

@@ -139,7 +139,6 @@ void RootDeviceEnvironment::initOsTime() {
if (!osTime) {
osTime = OSTime::create(osInterface.get());
osTime->setDeviceTimerResolution();
osTime->setDeviceTimestampWidth(gfxCoreHelper->getDeviceTimestampWidth());
}
}

View File

@@ -209,7 +209,6 @@ class GfxCoreHelper {
virtual bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const = 0;
virtual uint32_t getDeviceTimestampWidth() const = 0;
virtual void alignThreadGroupCountToDssSize(uint32_t &threadCount, uint32_t dssCount, uint32_t threadsPerDss, uint32_t threadGroupSize) const = 0;
virtual bool getSipBinaryFromExternalLib() const = 0;
virtual uint32_t getImplicitArgsVersion() const = 0;
@@ -470,7 +469,6 @@ class GfxCoreHelperHw : public GfxCoreHelper {
bool usmCompressionSupported(const NEO::HardwareInfo &hwInfo) const override;
uint32_t getDeviceTimestampWidth() const override;
uint32_t getImplicitArgsVersion() const override;
bool getSipBinaryFromExternalLib() const override;

View File

@@ -892,14 +892,6 @@ void GfxCoreHelperHw<GfxFamily>::alignThreadGroupCountToDssSize(uint32_t &thread
threadCount = std::min(threadCount, availableTreadCount);
}
template <typename GfxFamily>
uint32_t GfxCoreHelperHw<GfxFamily>::getDeviceTimestampWidth() const {
if (debugManager.flags.OverrideTimestampWidth.get() != -1) {
return debugManager.flags.OverrideTimestampWidth.get();
}
return 0u;
}
template <typename Family>
uint32_t GfxCoreHelperHw<Family>::getInternalCopyEngineIndex(const HardwareInfo &hwInfo) const {
if (debugManager.flags.ForceBCSForInternalCopyEngine.get() != -1) {

View File

@@ -504,9 +504,6 @@ bool IoctlHelperXe::setGpuCpuTimes(TimeStampData *pGpuCpuTime, OSTime *osTime) {
ret = IoctlHelper::ioctl(DrmIoctl::query, &deviceQuery);
auto nValidBits = queryEngineCycles->width;
if (osTime->getDeviceTimestampWidth() != 0) {
nValidBits = osTime->getDeviceTimestampWidth();
}
auto gpuTimestampValidBits = maxNBitValue(nValidBits);
auto gpuCycles = queryEngineCycles->engine_cycles & gpuTimestampValidBits;

View File

@@ -94,14 +94,6 @@ class OSTime {
deviceTime->setDeviceTimerResolution();
}
void setDeviceTimestampWidth(uint32_t timestampWidth) {
this->timestampWidth = timestampWidth;
}
uint32_t getDeviceTimestampWidth() const {
return this->timestampWidth;
}
void setRefreshTimestampsFlag() const {
deviceTime->setRefreshTimestampsFlag();
}
@@ -115,6 +107,5 @@ class OSTime {
OSInterface *osInterface = nullptr;
std::unique_ptr<DeviceTime> deviceTime;
uint64_t maxGpuTimeStamp = 0;
uint32_t timestampWidth = 0;
};
} // namespace NEO

View File

@@ -283,14 +283,6 @@ uint32_t GfxCoreHelperHw<Family>::getMetricsLibraryGenId() const {
return static_cast<uint32_t>(MetricsLibraryApi::ClientGen::Xe2HPG);
}
template <>
uint32_t GfxCoreHelperHw<Family>::getDeviceTimestampWidth() const {
if (debugManager.flags.OverrideTimestampWidth.get() != -1) {
return debugManager.flags.OverrideTimestampWidth.get();
}
return 64u;
};
template <>
void MemorySynchronizationCommands<Family>::setStallingBarrier(void *commandsBuffer, PipeControlArgs &args) {
using RESOURCE_BARRIER = typename Family::RESOURCE_BARRIER;

View File

@@ -631,7 +631,6 @@ FinalizerLibraryName = unk
EnableGlobalTimestampViaSubmission = -1
DirectSubmissionSwitchSemaphoreMode = -1
DisableProgrammableMetricsSupport = 0
OverrideTimestampWidth = -1
IgnoreZebinUnknownAttributes = 0
DebugUmdFifoPollInterval = -1
MaxSubSlicesSupportedOverride = -1

View File

@@ -1894,16 +1894,6 @@ HWTEST2_F(GfxCoreHelperTest, GivenModifiedGtSystemInfoWhenCallingCalculateAvaila
}
}
HWTEST_F(GfxCoreHelperTest, givenGetDeviceTimestampWidthCalledThenReturnCorrectValue) {
DebugManagerStateRestore restore;
auto &helper = getHelper<GfxCoreHelper>();
EXPECT_EQ(0u, helper.getDeviceTimestampWidth());
debugManager.flags.OverrideTimestampWidth.set(64);
EXPECT_EQ(64u, helper.getDeviceTimestampWidth());
}
HWTEST_F(GfxCoreHelperTest, givenHwHelperWhenAligningThreadGroupCountToDssSizeThenThreadGroupCountChanged) {
auto &helper = getHelper<GfxCoreHelper>();
uint32_t threadGroupCountBefore = 4096;

View File

@@ -2003,36 +2003,6 @@ TEST_F(IoctlHelperXeTest, givenIoctlFailureWhenSetGpuCpuTimesIsCalledThenProperV
EXPECT_EQ(pGpuCpuTime.cpuTimeinNS, expectedTimestamp);
}
TEST_F(IoctlHelperXeTest, whenDeviceTimestampWidthSetThenProperValuesAreSet) {
DebugManagerStateRestore restorer;
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>();
auto &rootDeviceEnvironment = *executionEnvironment->rootDeviceEnvironments[0];
rootDeviceEnvironment.osInterface = std::make_unique<OSInterface>();
rootDeviceEnvironment.osInterface->setDriverModel(std::make_unique<DrmMockTime>(mockFd, rootDeviceEnvironment));
auto drm = DrmMockXe::create(rootDeviceEnvironment);
auto xeIoctlHelper = static_cast<MockIoctlHelperXe *>(drm->getIoctlHelper());
xeIoctlHelper->initialize();
auto engineInfo = xeIoctlHelper->createEngineInfo(false);
ASSERT_NE(nullptr, engineInfo);
uint64_t expectedCycles = maxNBitValue(64);
auto xeQueryEngineCycles = reinterpret_cast<drm_xe_query_engine_cycles *>(drm->queryEngineCycles);
xeQueryEngineCycles->width = 32;
xeQueryEngineCycles->engine_cycles = expectedCycles;
xeQueryEngineCycles->cpu_timestamp = 100;
TimeStampData pGpuCpuTime{};
std::unique_ptr<MockOSTimeLinux> osTime = MockOSTimeLinux::create(*rootDeviceEnvironment.osInterface);
auto ret = xeIoctlHelper->setGpuCpuTimes(&pGpuCpuTime, osTime.get());
EXPECT_EQ(true, ret);
EXPECT_EQ(pGpuCpuTime.gpuTimeStamp, expectedCycles & maxNBitValue(32));
osTime->setDeviceTimestampWidth(64);
ret = xeIoctlHelper->setGpuCpuTimes(&pGpuCpuTime, osTime.get());
EXPECT_EQ(true, ret);
EXPECT_EQ(pGpuCpuTime.gpuTimeStamp, expectedCycles);
}
TEST_F(IoctlHelperXeTest, whenSetDefaultEngineIsCalledThenProperEngineIsSet) {
NEO::HardwareInfo hwInfo = *NEO::defaultHwInfo.get();
auto executionEnvironment = std::make_unique<MockExecutionEnvironment>(&hwInfo);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2024 Intel Corporation
* Copyright (C) 2024-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -44,14 +44,3 @@ BMGTEST_F(GfxCoreHelperTestsBmg, WhenAskingForDcFlushThenReturnFalse) {
setUpImpl();
EXPECT_FALSE(MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, pDevice->getRootDeviceEnvironment()));
}
BMGTEST_F(GfxCoreHelperTestsBmg, givenGetDeviceTimestampWidthCalledThenReturnCorrectValue) {
setUpImpl();
DebugManagerStateRestore restore;
auto &helper = this->pDevice->getGfxCoreHelper();
EXPECT_EQ(64u, helper.getDeviceTimestampWidth());
debugManager.flags.OverrideTimestampWidth.set(36);
EXPECT_EQ(36u, helper.getDeviceTimestampWidth());
}

View File

@@ -35,4 +35,3 @@ HWTEST_EXCLUDE_PRODUCT(GmmCompressionTests, givenEnabledAndPreferredE2ECWhenAppl
HWTEST_EXCLUDE_PRODUCT(CommandEncodeSemaphore, givenIndirectModeSetWhenProgrammingSemaphoreThenSetIndirectBit_IsAtLeastXeCore, IGFX_XE2_HPG_CORE);
HWTEST_EXCLUDE_PRODUCT(ProductHelperTest, givenBooleanUncachedWhenCallOverridePatIndexThenProperPatIndexIsReturned, IGFX_XE2_HPG_CORE);
HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, whenEncodeAdditionalTimestampOffsetsThenNothingEncoded, IGFX_XE2_HPG_CORE);
HWTEST_EXCLUDE_PRODUCT(GfxCoreHelperTest, givenGetDeviceTimestampWidthCalledThenReturnCorrectValue, IGFX_XE2_HPG_CORE);

View File

@@ -9,7 +9,6 @@
#include "shared/source/os_interface/product_helper.h"
#include "shared/source/xe2_hpg_core/hw_cmds_lnl.h"
#include "shared/source/xe2_hpg_core/hw_info_lnl.h"
#include "shared/test/common/helpers/debug_manager_state_restore.h"
#include "shared/test/common/helpers/default_hw_info.h"
#include "shared/test/common/helpers/gfx_core_helper_tests.h"
#include "shared/test/common/mocks/mock_device.h"
@@ -28,13 +27,3 @@ LNLTEST_F(GfxCoreHelperTestsLnl, givenCommandBufferAllocationTypeWhenGetAllocati
EXPECT_TRUE(allocData.flags.useSystemMemory);
}
LNLTEST_F(GfxCoreHelperTestsLnl, givenGetDeviceTimestampWidthCalledThenReturnCorrectValue) {
DebugManagerStateRestore restore;
auto &helper = this->pDevice->getGfxCoreHelper();
EXPECT_EQ(64u, helper.getDeviceTimestampWidth());
debugManager.flags.OverrideTimestampWidth.set(36);
EXPECT_EQ(36u, helper.getDeviceTimestampWidth());
}