<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jul 4, 2023, 03:55 Michel Dänzer <<a href="mailto:michel.daenzer@mailbox.org">michel.daenzer@mailbox.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 7/4/23 04:34, Marek Olšák wrote:<br>
> On Mon, Jul 3, 2023, 03:12 Michel Dänzer <<a href="mailto:michel.daenzer@mailbox.org" target="_blank" rel="noreferrer">michel.daenzer@mailbox.org</a> <mailto:<a href="mailto:michel.daenzer@mailbox.org" target="_blank" rel="noreferrer">michel.daenzer@mailbox.org</a>>> wrote:<br>
> On 6/30/23 22:32, Marek Olšák wrote:<br>
> > On Fri, Jun 30, 2023 at 11:11 AM Michel Dänzer <<a href="mailto:michel.daenzer@mailbox.org" target="_blank" rel="noreferrer">michel.daenzer@mailbox.org</a> <mailto:<a href="mailto:michel.daenzer@mailbox.org" target="_blank" rel="noreferrer">michel.daenzer@mailbox.org</a>> <mailto:<a href="mailto:michel.daenzer@mailbox.org" target="_blank" rel="noreferrer">michel.daenzer@mailbox.org</a> <mailto:<a href="mailto:michel.daenzer@mailbox.org" target="_blank" rel="noreferrer">michel.daenzer@mailbox.org</a>>>> wrote:<br>
> >> On 6/30/23 16:59, Alex Deucher wrote:<br>
> >>> On Fri, Jun 30, 2023 at 10:49 AM Sebastian Wick<br>
> >>> <<a href="mailto:sebastian.wick@redhat.com" target="_blank" rel="noreferrer">sebastian.wick@redhat.com</a> <mailto:<a href="mailto:sebastian.wick@redhat.com" target="_blank" rel="noreferrer">sebastian.wick@redhat.com</a>> <mailto:<a href="mailto:sebastian.wick@redhat.com" target="_blank" rel="noreferrer">sebastian.wick@redhat.com</a> <mailto:<a href="mailto:sebastian.wick@redhat.com" target="_blank" rel="noreferrer">sebastian.wick@redhat.com</a>>>> wrote:<br>
> >>>> On Tue, Jun 27, 2023 at 3:23 PM André Almeida <<a href="mailto:andrealmeid@igalia.com" target="_blank" rel="noreferrer">andrealmeid@igalia.com</a> <mailto:<a href="mailto:andrealmeid@igalia.com" target="_blank" rel="noreferrer">andrealmeid@igalia.com</a>> <mailto:<a href="mailto:andrealmeid@igalia.com" target="_blank" rel="noreferrer">andrealmeid@igalia.com</a> <mailto:<a href="mailto:andrealmeid@igalia.com" target="_blank" rel="noreferrer">andrealmeid@igalia.com</a>>>> wrote:<br>
> >>>>><br>
> >>>>> +Robustness<br>
> >>>>> +----------<br>
> >>>>> +<br>
> >>>>> +The only way to try to keep an application working after a reset is if it<br>
> >>>>> +complies with the robustness aspects of the graphical API that it is using.<br>
> >>>>> +<br>
> >>>>> +Graphical APIs provide ways to applications to deal with device resets. However,<br>
> >>>>> +there is no guarantee that the app will use such features correctly, and the<br>
> >>>>> +UMD can implement policies to close the app if it is a repeating offender,<br>
> >>>>> +likely in a broken loop. This is done to ensure that it does not keep blocking<br>
> >>>>> +the user interface from being correctly displayed. This should be done even if<br>
> >>>>> +the app is correct but happens to trigger some bug in the hardware/driver.<br>
> >>>><br>
> >>>> I still don't think it's good to let the kernel arbitrarily kill<br>
> >>>> processes that it thinks are not well-behaved based on some heuristics<br>
> >>>> and policy.<br>
> >>>><br>
> >>>> Can't this be outsourced to user space? Expose the information about<br>
> >>>> processes causing a device and let e.g. systemd deal with coming up<br>
> >>>> with a policy and with killing stuff.<br>
> >>><br>
> >>> I don't think it's the kernel doing the killing, it would be the UMD.<br>
> >>> E.g., if the app is guilty and doesn't support robustness the UMD can<br>
> >>> just call exit().<br>
> >><br>
> >> It would be safer to just ignore API calls[0], similarly to what is done until the application destroys the context with robustness. Calling exit() likely results in losing any unsaved work, whereas at least some applications might otherwise allow saving the work by other means.<br>
> ><br>
> > That's a terrible idea. Ignoring API calls would be identical to a freeze. You might as well disable GPU recovery because the result would be the same.<br>
> <br>
> No GPU recovery would affect everything using the GPU, whereas this affects only non-robust applications.<br>
> <br>
> which is currently the majority.<br>
<br>
Not sure where you're going with this. Applications need to use robustness to be able to recover from a GPU hang, and the GPU needs to be reset for that. So disabling GPU reset is not the same as what we're discussing here.<br>
<br>
<br>
> > - non-robust contexts: call exit(1) immediately, which is the best way to recover<br>
> <br>
> That's not the UMD's call to make.<br>
> <br>
> That's absolutely the UMD's call to make because that's mandated by the hw and API design<br>
<br>
Can you point us to a spec which mandates that the process must be killed in this case?<br>
<br>
<br>
> and only driver devs know this, which this thread is a proof of. The default behavior is to skip all command submission if a non-robust context is lost, which looks like a freeze. That's required to prevent infinite hangs from the same context and can be caused by the side effects of the GPU reset itself, not by the cause of the previous hang. The only way out of that is killing the process.<br>
<br>
The UMD killing the process is not the only way out of that, and doing so is overreach on its part. The UMD is but one out of many components in a process, not the main one or a special one. It doesn't get to decide when the process must die, certainly not under circumstances where it must be able to continue while ignoring API calls (that's required for robustness).<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">You're mixing things up. Robust apps don't any special action from a UMD. Only non-robust apps need to be killed for proper recovery with the only other alternative being not updating the window/screen, which is not user-friendly because the user who's never heard of GPU hangs has no fucking idea why it's frozen and what do with it. It doesn't matter that you can debug it because you're not the average user. Also it's already used and required by our customers on Android because killing a process returns the user to the desktop screen and can generate a crash dump instead of keeping the app output frozen, and they agree that this is the best user experience given the circumstances.</div><div dir="auto"><br></div><div dir="auto">Also if the ML ignores html, that's fine.</div><div dir="auto"><br></div><div dir="auto">Marek</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
<br>
> >> [0] Possibly accompanied by a one-time message to stderr along the lines of "GPU reset detected but robustness not enabled in context, ignoring OpenGL API calls".<br>
<br>
<br>
-- <br>
Earthling Michel Dänzer | <a href="https://redhat.com" rel="noreferrer noreferrer" target="_blank">https://redhat.com</a><br>
Libre software enthusiast | Mesa and Xwayland developer<br>
<br>
</blockquote></div></div></div>