[PATCH] drm/amdgpu: disable GFXOFF and PG during compute for GFX9
Alex Deucher
alexdeucher at gmail.com
Thu Oct 12 15:19:06 UTC 2023
On Wed, Oct 11, 2023 at 9:49 PM Zhang, Jesse(Jie) <Jesse.Zhang at amd.com> wrote:
>
> [AMD Official Use Only - General]
>
> -----Original Message-----
> From: Alex Deucher <alexdeucher at gmail.com>
> Sent: Wednesday, October 11, 2023 10:20 PM
> To: Zhang, Jesse(Jie) <Jesse.Zhang at amd.com>
> Cc: amd-gfx at lists.freedesktop.org; Deucher, Alexander <Alexander.Deucher at amd.com>; Yang, Philip <Philip.Yang at amd.com>; Kuehling, Felix <Felix.Kuehling at amd.com>; Zhang, Yifan <Yifan1.Zhang at amd.com>
> Subject: Re: [PATCH] drm/amdgpu: disable GFXOFF and PG during compute for GFX9
>
> On Wed, Oct 11, 2023 at 3:52 AM Jesse Zhang <jesse.zhang at amd.com> wrote:
> >
> > Temporary workaround to fix issues observed in some compute
> > applications when GFXOFF is enabled on GFX9.
> >
> > Signed-off-by: Jesse Zhang <Jesse.Zhang at amd.com>
> > ---
> > drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 4 ++++
> > 1 file changed, 4 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> > b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> > index d3805dbbbb6f..fef93d4edcbc 100644
> > --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> > +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c
> > @@ -683,12 +683,16 @@ int amdgpu_amdkfd_submit_ib(struct amdgpu_device
> > *adev,
> >
> > void amdgpu_amdkfd_set_compute_idle(struct amdgpu_device *adev, bool
> > idle) {
> > + enum amd_powergating_state state = idle ? AMD_PG_STATE_GATE :
> > + AMD_PG_STATE_UNGATE;
> > /* Temporary workaround to fix issues observed in some
> > * compute applications when GFXOFF is enabled on GFX11.
> > */
> > if (IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 11) {
> > pr_debug("GFXOFF is %s\n", idle ? "enabled" : "disabled");
> > amdgpu_gfx_off_ctrl(adev, idle);
> > + } else if ((IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 9) &&
> > + (adev->flags & AMD_IS_APU)) {
> > +
> > + adev->ip_blocks[AMD_IP_BLOCK_TYPE_GFX].version->funcs->set_powergati
> > + ng_state((void *)adev, state);
>
> Why not use amdgpu_gfx_off_ctrl(adev, idle); for consistency?
> [Zhang, Jesse(Jie)] Hi Alex,
> amdgpu_gfx_off_ctrl only disable gfxoff. It also need to disable gfx9's powergating to workaround.
> So use the set_powergating_state to disable gfxoff and PG.
Thanks for clarifying. Maybe add a comment to that effect. With that fixed:
Acked-by: Alex Deucher <alexander.deucher at amd.com>
Alex
>
> Jesse
> Alex
>
> > }
> > amdgpu_dpm_switch_power_profile(adev,
> > PP_SMC_POWER_PROFILE_COMPUTE,
> > --
> > 2.25.1
> >
More information about the amd-gfx
mailing list