Show KFD node memory partition id and size, add helper function
KFD_XCP_MEMORY_SIZE to get kfd node memory size, will be used
later to support memory accounting per partition.
Signed-off-by: Philip Yang <Philip.Yang@amd.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
void amdgpu_amdkfd_unreserve_mem_limit(struct amdgpu_device *adev,
uint64_t size, u32 alloc_flag);
+#define KFD_XCP_MEMORY_SIZE(n) ((n)->adev->gmc.num_mem_partitions ?\
+ (n)->adev->gmc.mem_partitions[(n)->xcp->mem_id].size /\
+ (n)->adev->xcp_mgr->num_xcp_per_mem_partition :\
+ (n)->adev->gmc.real_vram_size)
+
#if IS_ENABLED(CONFIG_HSA_AMD)
void amdgpu_amdkfd_gpuvm_init_mem_limits(void);
void amdgpu_amdkfd_gpuvm_destroy_cb(struct amdgpu_device *adev,
kfd_cwsr_init(kfd);
- /* TODO: Needs to be updated for memory partitioning */
svm_migrate_init(kfd->adev);
amdgpu_amdkfd_get_local_mem_info(kfd->adev, &kfd->local_mem_info);
(1U << NUM_XCC(kfd->adev->gfx.xcc_mask)) - 1;
}
+ if (node->xcp) {
+ dev_info(kfd_device, "KFD node %d partition %d size %lldM\n",
+ node->node_id, node->xcp->mem_id,
+ KFD_XCP_MEMORY_SIZE(node) >> 20);
+ }
+
if (KFD_GC_VERSION(kfd) == IP_VERSION(9, 4, 3) &&
partition_mode == AMDGPU_CPX_PARTITION_MODE &&
kfd->num_nodes != 1) {