Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,8 @@ typedef struct _HsaNodeProperties
HSAuint32 SGPRSizePerCU; // SGPR size in bytes per CU

HSAuint32 NumXcc; // Number of XCC
HSAuint32 CwsrSize; // Size of the CWSR
HSAuint32 CtlStackSize; // Size of the control stack
HSAuint32 KFDGpuID; // GPU Hash ID generated by KFD

HSAuint32 FamilyID; // GPU family id
Expand Down
9 changes: 7 additions & 2 deletions projects/rocr-runtime/libhsakmt/src/queues.c
Original file line number Diff line number Diff line change
Expand Up @@ -342,8 +342,13 @@ static bool update_ctx_save_restore_size(HsaKFDContext *ctx, uint32_t nodeid, st
q->debug_memory_size =
ALIGN_UP(wave_num * DEBUGGER_BYTES_PER_WAVE, DEBUGGER_BYTES_ALIGN);

q->ctx_save_restore_size = q->ctl_stack_size
+ PAGE_ALIGN_UP(wg_data_size);
/* Keep calculating it in case we are using an older kernel, but if we have
* the CtlStackSize and CwsrSize from KFD, use that as the definitive value
*/
q->ctx_save_restore_size = node.CwsrSize > 0 ? node.CwsrSize :
q->ctl_stack_size + PAGE_ALIGN_UP(wg_data_size);
q->ctl_stack_size = node.CtlStackSize > 0 ? node.CtlStackSize : q->ctl_stack_size;

return true;
}
return false;
Expand Down
11 changes: 11 additions & 0 deletions projects/rocr-runtime/libhsakmt/src/topology.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,6 +1212,10 @@ static HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,
props->NumSdmaQueuesPerEngine = prop_val;
else if (strcmp(prop_name, "num_cp_queues") == 0)
props->NumCpQueues = prop_val;
else if (strcmp(prop_name, "cwsr_size") == 0)
props->CwsrSize = prop_val;
else if (strcmp(prop_name, "ctl_stack_size") == 0)
props->CtlStackSize = prop_val;
else if (strcmp(prop_name, "num_xcc") == 0)
props->NumXcc = prop_val;
else if (strcmp(prop_name, "family_id") == 0)
Expand Down Expand Up @@ -2221,6 +2225,13 @@ HSAKMT_STATUS HSAKMTAPI hsaKmtAcquireSystemPropertiesCtx(HsaKFDContext *ctx,

*SystemProperties = *g_system;

for (int node = 0; node < g_system->NumNodes; node++) {
if (hsakmt_get_gfxv_by_node_id(node) == GFX_VERSION_GFX1151 &&
hsakmt_kfd_version_info.KernelInterfaceMajorVersion == 1 &&
hsakmt_kfd_version_info.KernelInterfaceMinorVersion < 20)
pr_err_once("WARNING: KFD ABI 1.20+ is recommended for gfx1151. Current KFD ABI is %i.%i. This may result in faults, crashes and other application instability\n", hsakmt_kfd_version_info.KernelInterfaceMajorVersion, hsakmt_kfd_version_info.KernelInterfaceMinorVersion);
}

goto out;

init_doorbells_failed:
Expand Down