<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Jul 3, 2023, 03:12 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 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>>> 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>>> 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>>> 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></blockquote></div></div><div dir="auto"><br></div><div dir="auto">which is currently the majority.</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>
> - 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></blockquote></div></div><div dir="auto"><br></div><div dir="auto">That's absolutely the UMD's call to make because that's mandated by the hw and API design 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.</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>