Skip to content

Commit b7dfbd2

Browse files
Tushar Patelalexdeucher
authored andcommitted
drm/amdkfd: Fix Incorrect VMIDs passed to HWS
Compute-only GPUs have more than 8 VMIDs allocated to KFD. Fix this by passing correct number of VMIDs to HWS v2: squash in warning fix (Alex) Signed-off-by: Tushar Patel <tushar.patel@amd.com> Reviewed-by: Felix Kuehling <felix.kuehling@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent a572f70 commit b7dfbd2

2 files changed

Lines changed: 4 additions & 9 deletions

File tree

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,7 @@ MODULE_PARM_DESC(sched_policy,
680680
* Maximum number of processes that HWS can schedule concurrently. The maximum is the
681681
* number of VMIDs assigned to the HWS, which is also the default.
682682
*/
683-
int hws_max_conc_proc = 8;
683+
int hws_max_conc_proc = -1;
684684
module_param(hws_max_conc_proc, int, 0444);
685685
MODULE_PARM_DESC(hws_max_conc_proc,
686686
"Max # processes HWS can execute concurrently when sched_policy=0 (0 = no concurrency, #VMIDs for KFD = Maximum(default))");

drivers/gpu/drm/amd/amdkfd/kfd_device.c

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -483,15 +483,10 @@ bool kgd2kfd_device_init(struct kfd_dev *kfd,
483483
}
484484

485485
/* Verify module parameters regarding mapped process number*/
486-
if ((hws_max_conc_proc < 0)
487-
|| (hws_max_conc_proc > kfd->vm_info.vmid_num_kfd)) {
488-
dev_err(kfd_device,
489-
"hws_max_conc_proc %d must be between 0 and %d, use %d instead\n",
490-
hws_max_conc_proc, kfd->vm_info.vmid_num_kfd,
491-
kfd->vm_info.vmid_num_kfd);
486+
if (hws_max_conc_proc >= 0)
487+
kfd->max_proc_per_quantum = min((u32)hws_max_conc_proc, kfd->vm_info.vmid_num_kfd);
488+
else
492489
kfd->max_proc_per_quantum = kfd->vm_info.vmid_num_kfd;
493-
} else
494-
kfd->max_proc_per_quantum = hws_max_conc_proc;
495490

496491
/* calculate max size of mqds needed for queues */
497492
size = max_num_of_queues_per_device *

0 commit comments

Comments
 (0)