From: "Christian König" <christian.koenig@amd.com>
To: "Friedrich Vock" <friedrich.vock@gmx.de>,
"Felix Kuehling" <felix.kuehling@amd.com>,
"Christian König" <ckoenig.leichtzumerken@gmail.com>,
"Alex Deucher" <alexdeucher@gmail.com>,
"Dommati, Sunil-kumar" <Sunil-kumar.Dommati@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>,
amd-gfx@lists.freedesktop.org, Joshua Ashton <joshua@froggi.es>
Subject: Re: [PATCH 1/2] drm/amdgpu: Reset IH OVERFLOW_CLEAR bit after writing rptr
Date: Mon, 22 Jan 2024 14:35:59 +0100 [thread overview]
Message-ID: <d45b23d1-ab1d-4285-8b18-a0eebaa2d871@amd.com> (raw)
In-Reply-To: <098e975b-2271-4f11-9549-40bc2c444a28@gmx.de>
Am 22.01.24 um 11:45 schrieb Friedrich Vock:
> On 22.01.24 11:21, Friedrich Vock wrote:
>> On 22.01.24 11:10, Christian König wrote:
>>> Am 19.01.24 um 20:18 schrieb Felix Kuehling:
>>>> On 2024-01-18 07:07, Christian König wrote:
>>>>> Am 18.01.24 um 00:44 schrieb Friedrich Vock:
>>>>>> On 18.01.24 00:00, Alex Deucher wrote:
>>>>>> [SNIP]
>>>>>> No, amdgpu.noretry=1 does not change anything.
>>>>>
>>>>> Well the good news first the hw engineer answered rather quickly.
>>>>> The bad news is that the hardware really doesn't work as documented
>>>>> in multiple ways.
>>>>>
>>>>> First of all the CLEAR bit is a level and not a trigger, so the
>>>>> intention to clear it is indeed correct. For now please modify this
>>>>> patch so that the CLEAR bit is set and cleared directly after
>>>>> setting it, this way we should be able to detect further overflows
>>>>> immediately.
>>>>>
>>>>> Then the APU the Steam Deck uses simply doesn't have the filter
>>>>> function for page faults in the hardware, the really bad news is it
>>>>> also doesn't have the extra IH rings where we could re-route the
>>>>> faults to prevent overflows.
>>>>>
>>>>> That full explains the behavior you have been seeing, but doesn't
>>>>> really provide a doable solution to mitigate this problem.
>>>>>
>>>>> I'm going to dig deeper into the hw documentation and specification
>>>>> to see if we can use a different feature to avoid the overflow.
>>>>
>>>> If we're not enabling retry faults, then each wave front should
>>>> generate at most one fault. You should be able to avoid overflows by
>>>> making the IH ring large enough to accommodate one fault per wave
>>>> front.
>>>
>>> That is the exact same argument our HW engineers came up with when we
>>> asked why the APU is missing all those nice IH ring overflow avoidance
>>> features the dGPUs have :)
>>>
>> I can reproduce IH overflows on my RX 6700 XT dGPU as well FWIW.
Interesting data point. We have probably looked to much into the faults
on MI* products and never checked Navi.
Can you try to just setting WPTR_OVERFLOW_ENABLE to 0? At least in
theory that should disable IH overflows altogether on Navi without
causing loss of IVs.
>>
>>> The only problem with this approach is that on Navi when a wave is
>>> blocked by waiting on a fault you can't kill it using soft recovery
>>> any more (at least when my understanding is correct).
>>>
>> Killing page-faulted waves via soft recovery works. From my testing on
>> Deck, it seems to take a bit of time, but if you try for long enough
>> soft recovery eventually succeeds.
Ok that is massively strange. We had tons of discussions about that
shader can't be interrupted while they wait for a fault on Navi.
Maybe killing them is still possible, need to double check that as well.
>
>
> On second thought, could it be that this is the critical flaw in the "at
> most one fault per wave" thinking?
Well completely agree that this. That rational to leave out the new IH
features on APUs is rather weak.
>
> Most work submissions in practice submit more waves than the number of
> wave slots the GPU has.
> As far as I understand soft recovery, the only thing it does is kill all
> active waves. This frees up the CUs so more waves are launched, which
> can fault again, and that leads to potentially lots of faults for a
> single wave slot in the end.
Exactly that, but killing each wave takes a moment since we do that in a
loop with a bit delay in there.
So the interrupt handler should at least in theory have time to catch up.
Regards,
Christian.
>
> Regards,
> Friedrich
next prev parent reply other threads:[~2024-01-22 13:36 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-14 13:00 [PATCH 1/2] drm/amdgpu: Reset IH OVERFLOW_CLEAR bit after writing rptr Friedrich Vock
2024-01-14 13:00 ` [PATCH 2/2] drm/amdgpu: Process fences on IH overflow Friedrich Vock
2024-01-15 10:26 ` Christian König
2024-01-15 11:19 ` Friedrich Vock
2024-01-16 7:17 ` Christian König
[not found] ` <69cec077-4011-4738-bbb0-8fb1e6f52159@gmail.com>
2024-01-15 11:18 ` [PATCH 1/2] drm/amdgpu: Reset IH OVERFLOW_CLEAR bit after writing rptr Friedrich Vock
2024-01-16 7:03 ` Christian König
2024-01-16 10:31 ` Friedrich Vock
2024-01-17 12:27 ` Christian König
2024-01-17 23:00 ` Alex Deucher
2024-01-17 23:44 ` Friedrich Vock
2024-01-18 12:07 ` Christian König
2024-01-19 19:18 ` Felix Kuehling
2024-01-22 10:10 ` Christian König
2024-01-22 10:21 ` Friedrich Vock
2024-01-22 10:45 ` Friedrich Vock
2024-01-22 13:35 ` Christian König [this message]
2024-01-22 22:39 ` Joshua Ashton
2024-01-23 9:36 ` Christian König
2024-01-23 11:35 ` Friedrich Vock
2024-01-23 12:49 ` Christian König
2024-02-02 11:11 ` Joshua Ashton
2024-02-02 13:31 ` Christian König
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=d45b23d1-ab1d-4285-8b18-a0eebaa2d871@amd.com \
--to=christian.koenig@amd.com \
--cc=Sunil-kumar.Dommati@amd.com \
--cc=alexander.deucher@amd.com \
--cc=alexdeucher@gmail.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=ckoenig.leichtzumerken@gmail.com \
--cc=felix.kuehling@amd.com \
--cc=friedrich.vock@gmx.de \
--cc=joshua@froggi.es \
/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