GFX 12.1.0 queues are managed by MES, not by the HWS runlist, so the
127 queue limit does not apply.

The topology advertises 32 CP queues plus 16 SDMA engines with 6 queues
each, so creating every queue needs 128 and the last one fails with
-ENOSPC:

  [ RUN      ] KFDQMTest.AllQueues
  KFDQMTest.cpp:365: Failure
  Value of: (sdmaQueues[j].Create(gpuNode))
    Actual: 1
  Expected: HSAKMT_STATUS_SUCCESS
  [  FAILED  ] KFDQMTest.AllQueues

Signed-off-by: Horatio Zhang <[email protected]>
---
 drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c 
b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
index fb2d8ad9c2c5..a15a826519ad 100644
--- a/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
+++ b/drivers/gpu/drm/amd/amdkfd/kfd_process_queue_manager.c
@@ -339,12 +339,13 @@ int pqm_create_queue(struct process_queue_manager *pqm,
        unsigned int max_queues = 127; /* HWS limit */
 
        /*
-        * On GFX 9.4.3/9.5.0, increase the number of queues that
-        * can be created to 255. No HWS limit on GFX 9.4.3/9.5.0.
+        * On GFX 9.4.3/9.5.0/12.1.0, increase the number of queues that
+        * can be created to 255. No HWS limit on GFX 9.4.3/9.5.0/12.1.0.
         */
        if (KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 3) ||
            KFD_GC_VERSION(dev) == IP_VERSION(9, 4, 4) ||
-           KFD_GC_VERSION(dev) == IP_VERSION(9, 5, 0))
+           KFD_GC_VERSION(dev) == IP_VERSION(9, 5, 0) ||
+           KFD_GC_VERSION(dev) == IP_VERSION(12, 1, 0))
                max_queues = 255;
 
        q = NULL;
-- 
2.43.0

Reply via email to