libhsakmt: add NumCpQueues and NumSdmaQueuesPerEngine data field (v3)
NumCpQueues and NumSdmaQueuesPerEngine should be got by kfd driver not hardcode.
So add two data fields in HsaNodeProperties then thunk is able to get it from sysfs
that exposed by kfd.
v2: change NumCpQueues/NumSdmaQueuesPerEngine to one byte.
v3: merge two commits as one to avoid ABI update two times.
Change-Id: Ie386e4685f13493e22db6e207a399db6a4c5b9dc
Signed-off-by: Huang Rui <ray.huang@amd.com>
[ROCm/ROCR-Runtime commit: 06464b917d]
Этот коммит содержится в:
коммит произвёл
Ray Huang
родитель
22b5e2b003
Коммит
cc2162d8e9
@@ -301,7 +301,12 @@ typedef struct _HsaNodeProperties
|
||||
// number hash created by the PSP
|
||||
HSAuint32 NumSdmaEngines; // number of PCIe optimized SDMA engines
|
||||
HSAuint32 NumSdmaXgmiEngines;// number of XGMI optimized SDMA engines
|
||||
HSAuint32 NumGws; // number of GWS barriers
|
||||
|
||||
HSAuint8 NumSdmaQueuesPerEngine;// number of SDMA queue per one engine
|
||||
HSAuint8 NumCpQueues; // number of Compute queues
|
||||
HSAuint8 NumGws; // number of GWS barriers
|
||||
HSAuint8 Reserved2;
|
||||
|
||||
HSAuint32 Domain; // PCI domain of the GPU
|
||||
HSAuint8 Reserved[28];
|
||||
} HsaNodeProperties;
|
||||
|
||||
@@ -1026,6 +1026,10 @@ HSAKMT_STATUS topology_sysfs_get_node_props(uint32_t node_id,
|
||||
props->NumSdmaXgmiEngines = prop_val;
|
||||
else if (strcmp(prop_name, "num_gws") == 0)
|
||||
props->NumGws = prop_val;
|
||||
else if (strcmp(prop_name, "num_sdma_queues_per_engine") == 0)
|
||||
props->NumSdmaQueuesPerEngine = prop_val;
|
||||
else if (strcmp(prop_name, "num_cp_queues") == 0)
|
||||
props->NumCpQueues = prop_val;
|
||||
}
|
||||
|
||||
hsa_gfxip = find_hsa_gfxip_device(props->DeviceId);
|
||||
|
||||
@@ -145,16 +145,6 @@ void GetHwQueueInfo(const HsaNodeProperties *props,
|
||||
unsigned int *p_num_sdma_engines,
|
||||
unsigned int *p_num_sdma_xgmi_engines,
|
||||
unsigned int *p_num_sdma_queues_per_engine) {
|
||||
int num_cp_queues = 24;
|
||||
int num_sdma_queues_per_engine = 2;
|
||||
|
||||
if (props->EngineId.ui32.Major == 9) {
|
||||
if (props->EngineId.ui32.Stepping == 6) // VEGA20
|
||||
num_sdma_queues_per_engine = 8;
|
||||
} else if (props->EngineId.ui32.Major == 10) { // NAVI
|
||||
num_sdma_queues_per_engine = 8;
|
||||
}
|
||||
|
||||
if (p_num_sdma_engines)
|
||||
*p_num_sdma_engines = props->NumSdmaEngines;
|
||||
|
||||
@@ -162,10 +152,10 @@ void GetHwQueueInfo(const HsaNodeProperties *props,
|
||||
*p_num_sdma_xgmi_engines = props->NumSdmaXgmiEngines;
|
||||
|
||||
if (p_num_sdma_queues_per_engine)
|
||||
*p_num_sdma_queues_per_engine = num_sdma_queues_per_engine;
|
||||
*p_num_sdma_queues_per_engine = props->NumSdmaQueuesPerEngine;
|
||||
|
||||
if (p_num_cp_queues)
|
||||
*p_num_cp_queues = num_cp_queues;
|
||||
*p_num_cp_queues = props->NumCpQueues;
|
||||
}
|
||||
|
||||
bool isTonga(const HsaNodeProperties *props) {
|
||||
|
||||
Ссылка в новой задаче
Block a user