kfdtest: Update COMPUTE_PGM_RSRC1 for software trap
If asics don't need software traps within GFX11 domain,
test with COMPUTE_PGM_RSRC1.PRIV = 1 will make system hang.
Change-Id: I00cf8eb6d6b07856885c77bd343ca3c41cc3cad5
Signed-off-by: Ruili Ji <ruiliji2@amd.com>
Signed-off-by: Aaron Liu <aaron.liu@amd.com>
[ROCm/ROCR-Runtime commit: 9bf1cbe4ed]
This commit is contained in:
@@ -45,6 +45,7 @@ Dispatch::Dispatch(const HsaMemoryBuffer& isaBuf, const bool eventAutoReset)
|
||||
hsaKmtCreateEvent(&eventDesc, !eventAutoReset, false, &m_pEop);
|
||||
|
||||
m_FamilyId = g_baseTest->GetFamilyIdFromNodeId(isaBuf.Node());
|
||||
m_NeedCwsrWA = g_baseTest->NeedCwsrWA(isaBuf.Node());
|
||||
}
|
||||
|
||||
Dispatch::~Dispatch() {
|
||||
@@ -138,7 +139,11 @@ void Dispatch::BuildIb() {
|
||||
pgmRsrc2 |= (1 << COMPUTE_PGM_RSRC2__EXCP_EN_MSB__SHIFT)
|
||||
& COMPUTE_PGM_RSRC2__EXCP_EN_MSB_MASK;
|
||||
|
||||
const bool priv = (m_FamilyId == FAMILY_GFX11);
|
||||
/*
|
||||
* For some special asics in the list of DEGFX11_12113
|
||||
* COMPUTE_PGM_RSRC needs priv=1 to prevent hardware traps
|
||||
*/
|
||||
const bool priv = m_NeedCwsrWA;
|
||||
const unsigned int COMPUTE_PGM_RSRC[] = {
|
||||
// PGM_RSRC1 = { VGPRS: 16 SGPRS: 16 PRIORITY: m_SpiPriority FLOAT_MODE: c0
|
||||
// PRIV: 0 (1 for GFX11) DX10_CLAMP: 0 DEBUG_MODE: 0 IEEE_MODE: 0 BULKY: 0 CDBG_USER: 0 }
|
||||
|
||||
@@ -71,6 +71,7 @@ class Dispatch {
|
||||
HSAuint64 m_scratch_base;
|
||||
unsigned int m_SpiPriority;
|
||||
unsigned int m_FamilyId;
|
||||
bool m_NeedCwsrWA;
|
||||
};
|
||||
|
||||
#endif // __KFD_DISPATCH__H__
|
||||
|
||||
@@ -164,6 +164,25 @@ unsigned int KFDBaseComponentTest::GetFamilyIdFromNodeId(unsigned int nodeId)
|
||||
return FamilyIdFromNode(m_NodeInfo.GetNodeProperties(nodeId));
|
||||
}
|
||||
|
||||
/*
|
||||
* Some asics need CWSR workround for DEGFX11_12113
|
||||
*/
|
||||
bool KFDBaseComponentTest::NeedCwsrWA(unsigned int nodeId)
|
||||
{
|
||||
bool needCwsrWA = false;
|
||||
const HsaNodeProperties *props = m_NodeInfo.GetNodeProperties(nodeId);
|
||||
|
||||
needCwsrWA = props->EngineId.ui32.Major == 11 &&
|
||||
props->EngineId.ui32.Minor == 0 &&
|
||||
(props->EngineId.ui32.Stepping == 0 ||
|
||||
props->EngineId.ui32.Stepping == 1 ||
|
||||
props->EngineId.ui32.Stepping == 2 ||
|
||||
props->EngineId.ui32.Stepping == 5 ||
|
||||
(props->EngineId.ui32.Stepping == 3 && props->NumArrays > 1));
|
||||
|
||||
return needCwsrWA;
|
||||
}
|
||||
|
||||
bool KFDBaseComponentTest::NeedNonPagedWptr(unsigned int nodeId)
|
||||
{
|
||||
return GetFamilyIdFromNodeId(nodeId) >= FAMILY_GFX11;
|
||||
|
||||
@@ -58,6 +58,7 @@ class KFDBaseComponentTest : public testing::Test {
|
||||
// @return DRM Render Node if successful or -1 on failure
|
||||
int FindDRMRenderNode(int gpuNode);
|
||||
unsigned int GetFamilyIdFromNodeId(unsigned int nodeId);
|
||||
bool NeedCwsrWA(unsigned int nodeId);
|
||||
bool NeedNonPagedWptr(unsigned int nodeId);
|
||||
unsigned int GetFamilyIdFromDefaultNode(){ return m_FamilyId; }
|
||||
|
||||
|
||||
Referens i nytt ärende
Block a user