If GL context creation fails fall back to the software renderer

Authored by davidedmundson on Mar 26 2018, 5:42 PM.



If we cannot create a GL context, instead of showing an error and
quitting, switch to using the QtQuick software renderer and restart.

If software mode is already set, then show the error as before. This
could happen in the case of the software renderer not being installed.

Test Plan

After doing some driver changing, I ended up with the annoying "plasma can't start"

Without the entry in kdeglobals I now start plasma and it seamlessly comes up

It's almost too seamless, I probably need to add an SNI with a message
but it's blocked on a decision on handling that KCM.

Diff Detail

R120 Plasma Workspace
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.
davidedmundson created this revision.Mar 26 2018, 5:42 PM
Restricted Application added a project: Plasma. · View Herald TranscriptMar 26 2018, 5:42 PM
Restricted Application added a subscriber: plasma-devel. · View Herald Transcript
davidedmundson requested review of this revision.Mar 26 2018, 5:42 PM

I like this change


This looks like too much debug or like a need of qcdebug

I like the direction but I would like

  • something that doesn't permanently lock out the user if something failed once, we either need a KCM like KWin has or a SNI ("we had to switch you back to software rendering" with a sad puppy face)
  • something more generic in KDeclarative like QtQuickRenderSettings so stuff like KRunner, lock screen and so on can do the same, especially the screen locker should fail gracefully

So you will permanently force software rendering even for a single hickup (think of upgrading nvidia driver)?


Add period after fallback



davidedmundson added inline comments.Mar 27 2018, 3:38 PM

Nvidia driver upgrade is how I ended up in my situation :D

Pernament global forcing is what I've gone for. Which is why it sort of already covers the lock screen case.
I could make it not save and do it all through just setting an env when it restarts.

An env variable would not work for things like lock screen as the process starting the lock screen is started before Plasmashell.

Given that I think persistent storage makes more sense. But a way to get back would be cool. Maybe we could create a test app to see whether OpenGL Scene Graph works? Something like mapping a transparent rectangle?

mart added a subscriber: mart.Mar 30 2018, 11:17 AM
mart added inline comments.

it shouldn't be this permanent: maybe write the config and undo this when a clean shutdown happens (but not crash)? so the detection would happen only once per system startup

Kwin's crash detection is this pernament

mart added a comment.Apr 3 2018, 10:02 AM

anyways, +1 rom me.. tough it would probably be needed some ui somewhere for trying to reenable opengl, maybe visible at all only when disabled.
the desktop config dialog may be quite random, tough i don't know where else it could be

This revision was not accepted when it landed; it landed in state Needs Review.May 3 2018, 3:42 PM
This revision was automatically updated to reflect the committed changes.