Bug 375730 - Starting Kwin with NVidia Proprietary drivers / libraries throws: "Plasma is unable to start as it could not correctly use OpenGL 2."
Summary: Starting Kwin with NVidia Proprietary drivers / libraries throws: "Plasma is ...
Status: CLOSED NOT A BUG
Alias: None
Product: plasmashell
Classification: Plasma
Component: general (show other bugs)
Version: master
Platform: Gentoo Packages Linux
: NOR critical
Target Milestone: 1.0
Assignee: David Edmundson
URL:
Keywords:
: 375679 (view as bug list)
Depends on:
Blocks:
 
Reported: 2017-01-29 22:04 UTC by Christian
Modified: 2017-09-25 22:31 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christian 2017-01-29 22:04:40 UTC
+++ This bug was initially created as a clone of Bug #375679 +++

This happens every time and it's NOT an issue with opencl/opengl libraries, NVidia's proprietary driver or underlying hardware capabilities, it's a BUG in the check which is done prior to launching Kwin.
The same configuration and libraries are working great when running other Desktop Environments while using the same libraries and drivers. 
i.e. I can run World of Warcraft flawlessly with wine with opengl-3.1 from LxQT.

You can see more complaints here:
https://forums.gentoo.org/viewtopic-t-1048616-start-0.html
Comment 1 Christian 2017-01-29 22:11:30 UTC
I've built the entire plasma5 from sources to confirm and the problem is still happening here, so it happens in master and also 5.8.5 as reported originally.
Disabling the check that throws ShellCorona::showOpenGLNotCompatibleWarning() would probably fix it.
There are several very suspicious TODOS and comments throughout the file:

plasma-workspace/shell/shellcorona.cpp 
" //TODO: does a similar check make sense?
  ...
  &ShellCorona::showOpenGLNotCompatibleWarning);
"
Comment 2 David Edmundson 2017-01-30 10:46:01 UTC
*** Bug 375679 has been marked as a duplicate of this bug. ***
Comment 3 David Edmundson 2017-01-30 10:49:58 UTC
>Disabling the check that throws ShellCorona::showOpenGLNotCompatibleWarning() would probably fix it.

You've compiled it from master you can tell me. Does it fix it?
 
It's connected to &QQuickWindow::sceneGraphError

So if you see this error, you're probably not going to see much else. I don't see anything that points to it being a bug in this check.
Comment 4 David Edmundson 2017-01-30 10:57:56 UTC
Another simpler useful test would be to save this to a file https://paste.kde.org/pqppwyvuy

 and then run qmlscene that_file.qml


where that_file is the saved version of that paste. If that renders something, great, if not we have a problem with either:

your personal setup
nvidia's driver
Qt
Comment 5 Christian 2017-01-30 13:08:19 UTC
If the check is correct and this is indeed connected to sceneGraphError, then some other module is interpreting this sceneGraphError INCORRECTLY as reason to prevent everything else from loading and then THAT'S the problem.
I can run other DEs with this exact same setting and there are no problems, even run World of Warcraft with wine.
Also:
(1) This is a 'catastrophic' failure, i.e. I cannot run Plasma 5 at all because of this error.
(2) As I mentioned before, it affects several other users.
From (1) + (2) there's no justification to modify the severity of this issue.
Comment 6 David Edmundson 2017-01-30 14:07:53 UTC
Can you still provide the information I requested please.
Comment 7 Christian 2017-01-30 15:03:29 UTC
(In reply to David Edmundson from comment #6)
> Can you still provide the information I requested please.

Yes. This is the result:

burger ~ # /usr/local/bin/qmlscene ./test.qml 
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Unrecognized OpenGL version
Unrecognized OpenGL version


from journalctl -xe:

~ # /usr/local/bin/qmlscene ./test.qml 
libGL error: No matching fbConfigs or visuals found
libGL error: failed to load driver: swrast
Unrecognized OpenGL version
Unrecognized OpenGL version
Comment 8 Christian 2017-01-30 15:16:09 UTC
(In reply to Christian from comment #7)
> (In reply to David Edmundson from comment #6)
> > Can you still provide the information I requested please.
> 
> Yes. This is the result:
> 
> burger ~ # /usr/local/bin/qmlscene ./test.qml 
> libGL error: No matching fbConfigs or visuals found
> libGL error: failed to load driver: swrast
> Unrecognized OpenGL version
> Unrecognized OpenGL version
> 
> 
> from journalctl -xe:
Jan 30 13:00:42 burger konsole[15959]: Reusing existing ksycoca
Jan 30 13:00:42 burger konsole[15959]: Recreating ksycoca file ("/home/chris/.cache/ksycoca5_en_LHtACk4Ee1xwTl37EAPO8JVWtKk=", version 303)
Jan 30 13:00:46 burger konsole[15959]: Still in the time dict (i.e. deleted files) ("apps")
Jan 30 13:00:46 burger konsole[15959]: kf5.kservice.sycoca: Parse error in  "/home/chris/.config/menus/applications-merged/xdg-desktop-menu-dummy.menu" , line  1 , col  1 :  "unexpected end of file"
Jan 30 13:00:46 burger konsole[15959]: modified: "/usr/share/applications/qtconfig-qtgui-4.desktop"
Jan 30 13:00:46 burger konsole[15959]: kf5.kservice.sycoca: The menu spec file contains a Layout or DefaultLayout tag without the mandatory Merge tag inside. Please fix your file.
Jan 30 13:00:46 burger konsole[15959]: Saving
Comment 9 Christian 2017-01-30 15:23:02 UTC
I forgot to mention: it's not rendering anything.
Comment 10 Christian 2017-01-30 19:24:33 UTC
Correction:
Ok, so I had to fix a few inconsistencies and those were causing trouble with qmlscene, but it is now working with no problems, showing the Hello World message  with no messages in the terminal or journalctl:

/usr/local/bin/qmlscene ./test.qml ./test.qml
<A widget pops up with "Hello World">

The output from glxinfo:burger ~ # glxinfo | grep -i opengl
OpenGL vendor string: VMware, Inc.
OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)
OpenGL core profile version string: 3.3 (Core Profile) Mesa 17.0.0-rc2
OpenGL core profile shading language version string: 3.30
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 3.0 Mesa 17.0.0-rc2
OpenGL shading language version string: 1.30
OpenGL context flags: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.0 Mesa 17.0.0-rc2
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.00
Comment 11 David Edmundson 2017-01-30 20:05:37 UTC
I've got confused.

The title says it's on NVidia drivers. 

This says:
>OpenGL vendor string: VMware, Inc.
>OpenGL renderer string: Gallium 0.4 on llvmpipe (LLVM 3.9, 128 bits)

Can you explain your setup. Are you running on real hardware or in virtualbox?

What were the inconsistencies you fixed? Does that make a difference to Plasma too?
Comment 12 Christian 2017-01-30 20:09:22 UTC
Hello David,
I'm running on real hardware, no virtualization.
It's confusing, I also noticed the vmware from glxinfo and I have no idea why.
I've built now a new kernel and a new qt from dev branch in git, reemerged the nvidia drivers and will post more info after I try everything again.
Comment 13 Christian 2017-01-31 12:59:49 UTC
ok, so after rebuilding everything from scratch the problem was fixed, I don't know what was causing it.
Running this is from my LxQT environment after building qt and plasma from source:
/usr/local/bin/qmlscene ./test.qml

Will pop the Hello World message in the screen with no problems, no errors.

glxinfo | grep -i opengl
OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: GeForce GT 640/PCIe/SSE2
OpenGL core profile version string: 4.5.0 NVIDIA 378.09
OpenGL core profile shading language version string: 4.50 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.5.0 NVIDIA 378.09
OpenGL shading language version string: 4.50 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 378.09
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
Comment 14 David Edmundson 2017-01-31 14:56:57 UTC
Sounds like you compiled Qt without GL.

In any case, I'm glad it's fixed and that the warning worked.
Comment 15 Christian 2017-01-31 15:45:24 UTC
Hello David,
I didn't explain correctly.
The issue is still there, the problem that was resolved was with my glxinfo.
Comment 16 David Edmundson 2017-01-31 17:03:29 UTC
So where we're at currently:

 - qmlscene works
 - plasma still gives that error

and I am still waiting to here what happens when you run disable the warning and if Plasma works
Comment 17 Christian 2017-01-31 17:24:16 UTC
(1) yes: - qmlscene works
    yes: - plasma still gives that error

I'm working on:
(2) disable the warning and see if Plasma works.

This will take some time though.
Thanks for your help.
Comment 18 Christian 2017-02-04 17:51:59 UTC
(In reply to Christian from comment #17)
> (1) yes: - qmlscene works
>     yes: - plasma still gives that error
> 
> I'm working on:
> (2) disable the warning and see if Plasma works.
> 
> This will take some time though.
> Thanks for your help.

Ok, so this is an update:

I had to rebuild everything in my system from ground up and it's now running plasma with nvidia and I have no issues.
I cannot reproduce what was happening before, so I can't add to the information that is already here.

The fix in my case was to enable the "egl" flag and rebuild mesa, then all qt libraries and then plasma from scratch.

This means the checks are indeed completely flawed and should be revised in:
plasma-workspace/shell/shellcorona.cpp
Comment 19 Christian 2017-02-04 17:56:35 UTC
Please check and fix the code in: plasma-workspace/shell/shellcorona.cpp
Comment 20 David Edmundson 2017-02-06 15:20:02 UTC
>I had to rebuild everything in my system from ground up and it's now running plasma with nvidia and I have no issues.

With the checks in place?


If so, what do you think is wrong with the checks? It sounds like they worked perfectly.
Comment 21 Christian 2017-02-06 19:40:04 UTC
(In reply to David Edmundson from comment #20)
> >I had to rebuild everything in my system from ground up and it's now running plasma with nvidia and I have no issues.
> 
> With the checks in place?
> 
> 
> If so, what do you think is wrong with the checks? It sounds like they
> worked perfectly.

It has the checks enabled, but I have rebuilt everything with EGL and all features that I might have missed in my libraries before.
I know these features aren't needed because I could start other DEs with the same settings and everything worked with no problems, so this is what I think:

possibility 1:
The checks are too restrictive, they are looking for features that aren't needed to start the environment and they completely block moving forward.

possibility 2:
The checks are ok, but there's a step above, calling these checks, which isn't interpreting results or reconfiguring the environment accordingly and so block everything.
Comment 22 David Edmundson 2017-02-06 20:56:50 UTC
You had a broken setup. The checks worked exactly as intended.
Comment 23 David Edmundson 2017-02-06 20:57:13 UTC
You had a broken setup. The checks worked exactly as intended.
Comment 24 Christian 2017-02-06 20:59:01 UTC
(In reply to David Edmundson from comment #23)
> You had a broken setup. The checks worked exactly as intended.

Nope.
The setup was ok, I was using the exact same QT libraries when I was running LxQt and there was NO problem at all.
Comment 25 David Edmundson 2017-02-06 22:00:11 UTC
Lxqt doesn't use an opengl backend. This does.
Comment 26 Christian 2017-02-06 22:09:16 UTC
(In reply to David Edmundson from comment #25)
> Lxqt doesn't use an opengl backend. This does.

So you're saying you want to make plasma unavailable to anyone that doesn't have QT libraries compiled with opengl and all EGL support in it?
That's utterly absurd and lazy...