AMD-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Christian König" <christian.koenig@amd.com>
To: SRINIVASAN SHANMUGAM <srinivasan.shanmugam@amd.com>,
	Alex Deucher <alexdeucher@gmail.com>
Cc: Alex Deucher <alexander.deucher@amd.com>, amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amdgpu: Fix Manual Execution of Cleaner Shader in Gang Submissions
Date: Thu, 27 Mar 2025 14:50:15 +0100	[thread overview]
Message-ID: <6e0ab036-59fd-4f1c-8b3b-386ef450dadb@amd.com> (raw)
In-Reply-To: <5a04ac1b-6b83-40c4-b9f1-ca42bd53763c@amd.com>

[-- Attachment #1: Type: text/plain, Size: 2642 bytes --]

Am 27.03.25 um 10:37 schrieb SRINIVASAN SHANMUGAM:
> On 3/27/2025 2:54 PM, Christian König wrote:
>>>>> Over all this change doesn't seem to make much sense to me.
>>>>> Why exactly is isolation->spearhead not pointing to the dummy kernel job we submit?
>>>> Does the owner check or gang_submit check in
>>>> amdgpu_device_enforce_isolation() fail to set up the spearhead?
>>> I'm currently debugging exactly that.
>>>
>>> Good news is that I can reproduce the problem.
>>
>> I have to take that back. I've tested the cleaner shader functionality a bit this morning and as far as I can see this works exactly as intended.
>>
>> Srini, what exactly is your use case which doesn't work?
>
> Hi Christian, Good Morning!
>
> The usecase is to trigger the cleaner shader, using sysfs "run_cleaner_shader" independent of  enabling "enforce_isolation", so that cleaner shader packet gets submitted to COMP_1.0.0 ring by default, without prior enabling any enforce_isolation via sysfs,
>

I've tested exactly that and it seems to work perfectly fine:
   kworker/u96:1-209     [020] .....    86.655999: amdgpu_isolation: prev=0000000000000000, next=ffffffffffffffff
   kworker/u96:1-209     [020] .....    86.656190: amdgpu_cleaner_shader: ring=gfx_0.0.0, seqno=2
           <...>-11      [022] .....   150.607688: amdgpu_isolation: prev=ffffffffffffffff, next=0000000000000000
   kworker/u96:0-11      [022] .....   150.608228: amdgpu_cleaner_shader: ring=comp_1.0.0, seqno=2
   kworker/u96:0-11      [022] .....   150.620597: amdgpu_isolation: prev=0000000000000000, next=ffffffffffffffff
   kworker/u96:0-11      [022] .....   150.620624: amdgpu_cleaner_shader: ring=gfx_0.0.0, seqno=1527


The only thing which might be confusing is that when you issue the cleaner shader multiple times when the GPU is idle it would only run once.

But that should be easy to change if necessary.

Regards,
Christian.

> AFAIK, this "isolation->spearhead" initialization is not being takencare in this *path **"amdgpu_gfx_run_cleaner_shader -> amdgpu_gfx_run_cleaner_shader_job" (ie., when we trigger *cleaner shader, using sysfs "run_cleaner_shader"), and this check "*&job->base.s_fence->scheduled == isolation->spearhead;" * is having the problem ie., "*&job->base.s_fence->scheduled" address are is not matching with**"**isolation->spearhead" address, which results into zero & thus fails to emit cleaner shader, when running using "run_cleaner_shader" sysfs entry, **in "amdgpu_vm_flush()" function
> *
>
> Best regards,
>
> Srini
>
>>
>> Regards,
>> Christian.
>>
>>> Regards,
>>> Christian.

[-- Attachment #2: Type: text/html, Size: 4943 bytes --]

  parent reply	other threads:[~2025-03-27 13:50 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-25 15:24 [PATCH] drm/amdgpu: Fix Manual Execution of Cleaner Shader in Gang Submissions Srinivasan Shanmugam
2025-03-26  8:02 ` Christian König
2025-03-26 13:55   ` Alex Deucher
2025-03-26 13:58     ` Christian König
2025-03-27  9:24       ` Christian König
2025-03-27  9:37         ` SRINIVASAN SHANMUGAM
2025-03-27 13:21           ` Alex Deucher
2025-03-27 13:50           ` Christian König [this message]
2025-03-28 14:58             ` Alex Deucher
2025-03-28 15:26               ` SRINIVASAN SHANMUGAM

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e0ab036-59fd-4f1c-8b3b-386ef450dadb@amd.com \
    --to=christian.koenig@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=alexdeucher@gmail.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=srinivasan.shanmugam@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox