From: axie Subject: Re: [PATCH 1/3] drm/amdgpu: fix mec queue policy on single MEC asics Date: Wed, 7 Jun 2017 13:23:36 -0400 Message-ID: <0c79a29e-4a87-617a-e5b2-469d0a48bfc3@amd.com> References: <1496848229-12761-1-git-send-email-alexander.deucher@amd.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0535204402==" Return-path: In-Reply-To: Content-Language: en-US List-Id: Discussion list for AMD gfx List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org Sender: "amd-gfx" To: "Deucher, Alexander" , "Xie, AlexBin" , Alex Deucher , "amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org" This is a multi-part message in MIME format. --===============0535204402== Content-Type: multipart/alternative; boundary="------------C42AD35D3BA5B2EC7E103A16" Content-Language: en-US This is a multi-part message in MIME format. --------------C42AD35D3BA5B2EC7E103A16 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Hi Alex, In Catalyst driver source code, Stoney is listed as supported, I don't know how well it is supported though. I think at least people have run some graphic operations. What kind of hangs happens in Stoney? Is it a graphic operation hang? Or OpenCL? Or something else? How easily it is reproduced? Stoney is similar to Carizzo. People has tried computes on Carrizo till Fiji in fglrx. At least, we need to limit this change for Stoney only unless it is reported in other ASICs too. This change can affect compute performance a lot. People are evaluating even the AMDGPU PRO OpenCL on FIJI, as far as I know. Thanks, Alex Bin On 2017-06-07 12:32 PM, Deucher, Alexander wrote: > > -----Original Message----- > > From: Xie, AlexBin > > Sent: Wednesday, June 07, 2017 12:31 PM > > To: Alex Deucher; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > > Cc: Deucher, Alexander > > Subject: Re: [PATCH 1/3] drm/amdgpu: fix mec queue policy on single MEC > > asics > > > > Hi Alex, > > > > In closed source driver, we assign compute queues to all 4 pipes always. > > There is no hangs. > > > > May I know which ASIC? > > It was reported on Stoney. > > Alex > > > > > Assign all queues in first pipe first mec can slow things down. > > > > Thanks, > > > > Alex Bin Xie > > > > > > > > On 2017-06-07 11:10 AM, Alex Deucher wrote: > > > Fixes hangs on single MEC asics. > > > > > > Fixes: 2ed286fb434 (drm/amdgpu: new queue policy, take first 2 > queues of > > each pipe v2) > > > Signed-off-by: Alex Deucher > > > --- > > > drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 12 +++++++++--- > > > drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 12 +++++++++--- > > > drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++++++++--- > > > 3 files changed, 27 insertions(+), 9 deletions(-) > > > > > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > > b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > > > index 4c04e9d..862bc72 100644 > > > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > > > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c > > > @@ -2825,9 +2825,15 @@ static void > > gfx_v7_0_compute_queue_acquire(struct amdgpu_device *adev) > > > if (mec >= adev->gfx.mec.num_mec) > > > break; > > > > > > - /* policy: amdgpu owns the first two queues of the > first MEC > > */ > > > - if (mec == 0 && queue < 2) > > > - set_bit(i, adev->gfx.mec.queue_bitmap); > > > + if (adev->gfx.mec.num_mec > 1) { > > > + /* policy: amdgpu owns the first two queues of the > > first MEC */ > > > + if (mec == 0 && queue < 2) > > > + set_bit(i, adev->gfx.mec.queue_bitmap); > > > + } else { > > > + /* policy: amdgpu owns all queues in the first > pipe */ > > > + if (mec == 0 && pipe == 0) > > > + set_bit(i, adev->gfx.mec.queue_bitmap); > > > + } > > > } > > > > > > /* update the number of active compute rings */ > > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > > b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > > > index ad2e0bb..1370b39 100644 > > > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > > > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c > > > @@ -1464,9 +1464,15 @@ static void > > gfx_v8_0_compute_queue_acquire(struct amdgpu_device *adev) > > > if (mec >= adev->gfx.mec.num_mec) > > > break; > > > > > > - /* policy: amdgpu owns the first two queues of the > first MEC > > */ > > > - if (mec == 0 && queue < 2) > > > - set_bit(i, adev->gfx.mec.queue_bitmap); > > > + if (adev->gfx.mec.num_mec > 1) { > > > + /* policy: amdgpu owns the first two queues of the > > first MEC */ > > > + if (mec == 0 && queue < 2) > > > + set_bit(i, adev->gfx.mec.queue_bitmap); > > > + } else { > > > + /* policy: amdgpu owns all queues in the first > pipe */ > > > + if (mec == 0 && pipe == 0) > > > + set_bit(i, adev->gfx.mec.queue_bitmap); > > > + } > > > } > > > > > > /* update the number of active compute rings */ > > > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > > b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > > > index cf15a350..9d675b3 100644 > > > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > > > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c > > > @@ -873,9 +873,15 @@ static void > > gfx_v9_0_compute_queue_acquire(struct amdgpu_device *adev) > > > if (mec >= adev->gfx.mec.num_mec) > > > break; > > > > > > - /* policy: amdgpu owns the first two queues of the > first MEC > > */ > > > - if (mec == 0 && queue < 2) > > > - set_bit(i, adev->gfx.mec.queue_bitmap); > > > + if (adev->gfx.mec.num_mec > 1) { > > > + /* policy: amdgpu owns the first two queues of the > > first MEC */ > > > + if (mec == 0 && queue < 2) > > > + set_bit(i, adev->gfx.mec.queue_bitmap); > > > + } else { > > > + /* policy: amdgpu owns all queues in the first > pipe */ > > > + if (mec == 0 && pipe == 0) > > > + set_bit(i, adev->gfx.mec.queue_bitmap); > > > + } > > > } > > > > > > /* update the number of active compute rings */ > --------------C42AD35D3BA5B2EC7E103A16 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 8bit

Hi Alex,

In Catalyst driver source code, Stoney is listed as supported, I don't know how well it is supported though. I think at least people have run some graphic operations.

What kind of hangs happens in Stoney? Is it a graphic operation hang? Or OpenCL? Or something else? How easily it is reproduced?

Stoney is similar to Carizzo. People has tried computes on Carrizo till Fiji in fglrx.

At least, we need to limit this change for Stoney only unless it is reported in other ASICs too.

This change can affect compute performance a lot. People are evaluating even the AMDGPU PRO OpenCL on FIJI, as far as I know.

Thanks,

Alex Bin


On 2017-06-07 12:32 PM, Deucher, Alexander wrote:
> -----Original Message-----
> From: Xie, AlexBin
> Sent: Wednesday, June 07, 2017 12:31 PM
> To: Alex Deucher; amd-gfx-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
> Cc: Deucher, Alexander
> Subject: Re: [PATCH 1/3] drm/amdgpu: fix mec queue policy on single MEC
> asics
>
> Hi Alex,
>
> In closed source driver, we assign compute queues to all 4 pipes always.
> There is no hangs.
>
> May I know which ASIC?

It was reported on Stoney.

Alex

>
> Assign all queues in first pipe first mec can slow things down.
>
> Thanks,
>
> Alex Bin Xie
>
>
>
> On 2017-06-07 11:10 AM, Alex Deucher wrote:
> > Fixes hangs on single MEC asics.
> >
> > Fixes: 2ed286fb434 (drm/amdgpu: new queue policy, take first 2 queues of
> each pipe v2)
> > Signed-off-by: Alex Deucher <alexander.deucher-5C7GfCeVMHo@public.gmane.org>
> > ---
> >   drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 12 +++++++++---
> >   drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 12 +++++++++---
> >   drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 12 +++++++++---
> >   3 files changed, 27 insertions(+), 9 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> > index 4c04e9d..862bc72 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
> > @@ -2825,9 +2825,15 @@ static void
> gfx_v7_0_compute_queue_acquire(struct amdgpu_device *adev)
> >              if (mec >= adev->gfx.mec.num_mec)
> >                      break;
> >
> > -           /* policy: amdgpu owns the first two queues of the first MEC
> */
> > -           if (mec == 0 && queue < 2)
> > -                   set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           if (adev->gfx.mec.num_mec > 1) {
> > +                   /* policy: amdgpu owns the first two queues of the
> first MEC */
> > +                   if (mec == 0 && queue < 2)
> > +                           set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           } else {
> > +                   /* policy: amdgpu owns all queues in the first pipe */
> > +                   if (mec == 0 && pipe == 0)
> > +                           set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           }
> >      }
> >
> >      /* update the number of active compute rings */
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > index ad2e0bb..1370b39 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
> > @@ -1464,9 +1464,15 @@ static void
> gfx_v8_0_compute_queue_acquire(struct amdgpu_device *adev)
> >              if (mec >= adev->gfx.mec.num_mec)
> >                      break;
> >
> > -           /* policy: amdgpu owns the first two queues of the first MEC
> */
> > -           if (mec == 0 && queue < 2)
> > -                   set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           if (adev->gfx.mec.num_mec > 1) {
> > +                   /* policy: amdgpu owns the first two queues of the
> first MEC */
> > +                   if (mec == 0 && queue < 2)
> > +                           set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           } else {
> > +                   /* policy: amdgpu owns all queues in the first pipe */
> > +                   if (mec == 0 && pipe == 0)
> > +                           set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           }
> >      }
> >
> >      /* update the number of active compute rings */
> > diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > index cf15a350..9d675b3 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
> > @@ -873,9 +873,15 @@ static void
> gfx_v9_0_compute_queue_acquire(struct amdgpu_device *adev)
> >              if (mec >= adev->gfx.mec.num_mec)
> >                      break;
> >
> > -           /* policy: amdgpu owns the first two queues of the first MEC
> */
> > -           if (mec == 0 && queue < 2)
> > -                   set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           if (adev->gfx.mec.num_mec > 1) {
> > +                   /* policy: amdgpu owns the first two queues of the
> first MEC */
> > +                   if (mec == 0 && queue < 2)
> > +                           set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           } else {
> > +                   /* policy: amdgpu owns all queues in the first pipe */
> > +                   if (mec == 0 && pipe == 0)
> > +                           set_bit(i, adev->gfx.mec.queue_bitmap);
> > +           }
> >      }
> >
> >      /* update the number of active compute rings */


--------------C42AD35D3BA5B2EC7E103A16-- --===============0535204402== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: base64 Content-Disposition: inline X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KYW1kLWdmeCBt YWlsaW5nIGxpc3QKYW1kLWdmeEBsaXN0cy5mcmVlZGVza3RvcC5vcmcKaHR0cHM6Ly9saXN0cy5m cmVlZGVza3RvcC5vcmcvbWFpbG1hbi9saXN0aW5mby9hbWQtZ2Z4Cg== --===============0535204402==--