Re: [PATCH v2 1/2] drm/amdgpu: kfd vmid should start after vmid for gfx userqueues end

2026-05-11 Thread Khatri, Sunil



On 11-05-2026 07:14 pm, Alex Deucher wrote:

On Mon, May 11, 2026 at 7:49 AM Christian König
 wrote:

On 5/11/26 11:13, Sunil Khatri wrote:

For GMC11, when KGD userqueues are enabled we should have vmid for
kfd queues start after KGD userqueues VMID ends.

Use the variable gfx.disable_uq instead of gfx_disable_kq to check
if userqueues are enabled or not. For mode 1 even when kernel queue
submission is enabled but userqueues is also enabled at same time.

Of hand that doesn't looks correct to me.

On GFX11 adev->vm_manager.first_kfd_vmid is the first VMID the MES will use and 
that should 8 when kq are enabled independent of the graphics userq feature.


Right.  When kernel queues are disabled, all of the vmids (except 0)
are available to the MES for userqs (KGD or KFD).

Alex

Got it. Thanks Alex and Christian.

Actually we are getting KFD SQ interrupts while we are only using the 
KGD userqueues, probably some other issue here.


Regards
Sunil Khatri




Regards,
Christian.


Signed-off-by: Sunil Khatri 
---
  drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c 
b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
index 16388e3caea3..354cf1c1b93c 100644
--- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
@@ -846,7 +846,7 @@ static int gmc_v11_0_sw_init(struct amdgpu_ip_block 
*ip_block)
* amdgpu graphics/compute will use VMIDs 1-7
* amdkfd will use VMIDs 8-15
*/
- adev->vm_manager.first_kfd_vmid = adev->gfx.disable_kq ? 1 : 8;
+ adev->vm_manager.first_kfd_vmid = adev->gfx.disable_uq ? 1 : 8;

   amdgpu_vm_manager_init(adev);



Re: [PATCH v2 1/2] drm/amdgpu: kfd vmid should start after vmid for gfx userqueues end

2026-05-11 Thread Alex Deucher
On Mon, May 11, 2026 at 7:49 AM Christian König
 wrote:
>
> On 5/11/26 11:13, Sunil Khatri wrote:
> > For GMC11, when KGD userqueues are enabled we should have vmid for
> > kfd queues start after KGD userqueues VMID ends.
> >
> > Use the variable gfx.disable_uq instead of gfx_disable_kq to check
> > if userqueues are enabled or not. For mode 1 even when kernel queue
> > submission is enabled but userqueues is also enabled at same time.
>
> Of hand that doesn't looks correct to me.
>
> On GFX11 adev->vm_manager.first_kfd_vmid is the first VMID the MES will use 
> and that should 8 when kq are enabled independent of the graphics userq 
> feature.
>

Right.  When kernel queues are disabled, all of the vmids (except 0)
are available to the MES for userqs (KGD or KFD).

Alex

> Regards,
> Christian.
>
> >
> > Signed-off-by: Sunil Khatri 
> > ---
> >  drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c 
> > b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
> > index 16388e3caea3..354cf1c1b93c 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
> > @@ -846,7 +846,7 @@ static int gmc_v11_0_sw_init(struct amdgpu_ip_block 
> > *ip_block)
> >* amdgpu graphics/compute will use VMIDs 1-7
> >* amdkfd will use VMIDs 8-15
> >*/
> > - adev->vm_manager.first_kfd_vmid = adev->gfx.disable_kq ? 1 : 8;
> > + adev->vm_manager.first_kfd_vmid = adev->gfx.disable_uq ? 1 : 8;
> >
> >   amdgpu_vm_manager_init(adev);
> >
>


Re: [PATCH v2 1/2] drm/amdgpu: kfd vmid should start after vmid for gfx userqueues end

2026-05-11 Thread Christian König
On 5/11/26 11:13, Sunil Khatri wrote:
> For GMC11, when KGD userqueues are enabled we should have vmid for
> kfd queues start after KGD userqueues VMID ends.
> 
> Use the variable gfx.disable_uq instead of gfx_disable_kq to check
> if userqueues are enabled or not. For mode 1 even when kernel queue
> submission is enabled but userqueues is also enabled at same time.

Of hand that doesn't looks correct to me.

On GFX11 adev->vm_manager.first_kfd_vmid is the first VMID the MES will use and 
that should 8 when kq are enabled independent of the graphics userq feature.

Regards,
Christian.

> 
> Signed-off-by: Sunil Khatri 
> ---
>  drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c 
> b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
> index 16388e3caea3..354cf1c1b93c 100644
> --- a/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
> +++ b/drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c
> @@ -846,7 +846,7 @@ static int gmc_v11_0_sw_init(struct amdgpu_ip_block 
> *ip_block)
>* amdgpu graphics/compute will use VMIDs 1-7
>* amdkfd will use VMIDs 8-15
>*/
> - adev->vm_manager.first_kfd_vmid = adev->gfx.disable_kq ? 1 : 8;
> + adev->vm_manager.first_kfd_vmid = adev->gfx.disable_uq ? 1 : 8;
>  
>   amdgpu_vm_manager_init(adev);
>