Bug 170085 - selfcheck fails
Summary: selfcheck fails
Status: RESOLVED FIXED
Alias: None
Product: kwin
Classification: Plasma
Component: compositing (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
: 170346 (view as bug list)
Depends on:
Blocks:
 
Reported: 2008-08-30 17:29 UTC by Unai Garro
Modified: 2010-07-19 16:20 UTC (History)
10 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
kwin patch (1007 bytes, patch)
2008-09-01 09:25 UTC, Lubos Lunak
Details
kwin patch (1.18 KB, patch)
2008-09-01 09:27 UTC, Lubos Lunak
Details
kwin xsession errors (4.87 KB, text/plain)
2008-09-08 00:33 UTC, tlayton_at_work
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Unai Garro 2008-08-30 17:29:08 UTC
Version:           svn trunk head (using Devel)
Compiler:          gcc 4.2.3  gcc (GCC) 4.2.3 (Ubuntu 4.2.3-2ubuntu7)
OS:                Linux
Installed from:    Compiled sources

kwin effects stopped working at revision 854546

( http://websvn.kde.org/?view=rev&revision=854546 )

Reverting just kwin to revision 854545 fixes it.

Effects only work when using xrender rather than OpenGL, and if I try tweaking any of the OpenGL settings, the machine hard freezes.

I'm on kubuntu linux 64bit, KDE4 svn trunk head from a few minutes ago,nVidia GeForce 8500 GT gfx card, and in case it helps, Intel Q6600 cpu.
Comment 1 miki 2008-08-30 18:32:37 UTC
same here
Comment 2 Lubos Lunak 2008-08-30 23:45:54 UTC
That commit should be harmless, I don't see how it could cause such trouble. Are you sure it is really that specific commit? Which driver is that? Is the machine really so frozen that not even Ctrl+Alt+F1 works?
Comment 3 Unai Garro 2008-08-30 23:53:24 UTC
Well, I think it has to be that commit. I'm 99% sure it was the latest revision in kwin back then. And reverting to the -1 one fixes it. I will try again though for reassuring.

Yes, when I say hard freeze, I mean not even Ctrl+Alt+F1 worked. Sometimes (not always) after 15-30s of pressing ctrl+alt+f1, it'd switch to terminal mode, but a couple or three times I had to do full reboot of the box.


I'm using nvidia's NVIDIA-Linux-x86_64-177.67-pkg2.run. It's their latest beta. I missed that when I reported the bug. I'll revert to the stable version and test it again.
Comment 4 Médéric Boquien 2008-08-30 23:56:28 UTC
Actually there is a more recent beta driver, 177.70, you may want to test with it too.
Comment 5 Unai Garro 2008-09-01 00:19:10 UTC
Just so that you don't waste time looking at that revision number, it seems I either copied it wrong or something. That revision worked fine. Please accept my apologizes.

Right now I'm svn up'ing to each revision number, and I've located the problem in between r854546 and 854692, since the first one works fine, and second one doesn't. I'll post the conflicting revision no. once I locate it. Sorry
Comment 6 Unai Garro 2008-09-01 00:31:34 UTC
Ok, I located it finally. It seems I copied the number wrong, off by one digit:
it's revision r854556 that broke for me. The previous revision to it is 854549, and that one works fine. 

In the command line I can see kwin outputting:
kwin(16975): Compositing self-check failed, disabling compositing.

I will do further tests with other nvidia drivers and see if I can enlighten more on the issue
Comment 7 Unai Garro 2008-09-01 00:35:25 UTC
Médéric, I don't see that nvidia beta. I just checked in nvidia's site and I only find "Linux 64-bit Display Driver Version 177.67 BETA August 19, 2008"
Comment 8 Unai Garro 2008-09-01 01:09:13 UTC
I did some further tests.
Reverting to the latest stable nvidia driver (173.14.12), still doesn't make effects work, but at least it doesn't seem to be prone to freezing. If I enable/disable direct rendering for example, it may look like freezing for a few seconds (3?), but it will immediately recover.

With the nvidia beta driver, I've seen it freeze while entering the desktop or when enabling direct rendering option and pressing okay, and I had to reboot the machine completely.

I did these test with current svn trunk (latest revision I checked, 855506)
Comment 9 Lubos Lunak 2008-09-01 09:21:53 UTC
I don't care about problems with beta drivers or freezes, they're not KDE's fault. The only valid part here is comment #6, reclassifying.
Does the attached patch help?
If not, please rebuild with the second patch and check visually that each of your screens has a group of 5 pixels (red, green, blue, white, black) in topleft and bottomright corner.
Comment 10 Lubos Lunak 2008-09-01 09:25:23 UTC
Created attachment 27160 [details]
kwin patch

Possible fix.
Comment 11 Lubos Lunak 2008-09-01 09:27:04 UTC
Created attachment 27161 [details]
kwin patch

Patch for visual checking.
Comment 12 Christoph Feck 2008-09-02 02:20:09 UTC
I use intel driver on 855 chipset, and openGL mode never worked, so I am using XRender mode. With the 854549 version, I can no longer enable XRender mode, because it says that selfcheck fails.
Comment 13 tlayton_at_work 2008-09-02 04:28:16 UTC
I have applied the patches on Revision: 856028, and compositing/effects with OpenGL is now working again. Thanks for the fix.

Using Intel 945GM on latest Ubuntu Intrepid alpha.
Comment 14 Unai Garro 2008-09-02 05:04:13 UTC
Sorry for the delay with testing, the patch at comment #10 fixed it for me, thanks!
Comment 15 tlayton_at_work 2008-09-02 06:16:41 UTC
Still doing business as usual on my laptop (firefox, pidgin, and pan), nothing too exciting or intensive.

But since the patch above, X is using on average 24% CPU and 30% MEM (and MEM keeps growing), and kwin is using on average 11% CPU, and 1.5% MEM, according to top (after 2 hours). And the fan has been on continuously, plus the delays switching between windows.

I've only changed one setting (Dim for Administrative Login) to test the effects.

Any configs/logs I can attach to help on this one?
Comment 16 Shawn Starr 2008-09-02 06:41:18 UTC
Yes I can confirm this is broken as of Sept 1 trunk build:

kwin(5627) KWin::Workspace::allowClientActivation: Activation: No client active, allowing                            
kwin(5627): Compositing self-check failed, disabling compositing. 

This is with the Free radeon Xorg driver... I will try patch
Comment 17 Lubos Lunak 2008-09-02 10:31:01 UTC
For whoever where patch from comment#10 fixes it: Can you please try which of the three changes in the patch is the one that helps? And, if it is the last one, does just "glXWaitGL();" instead of "glFinish();" work too?
Comment 18 prasadae 2008-09-04 04:21:54 UTC
Upgraded to KDE 4.1.1 today, and the effects did stop working. I get the same message: 
kwin(7176): Compositing self-check failed, disabling compositing.

Distro: OpenSuSE 11.0
Graphics Card: ATI Radeon Xpress 200M
Driver: fglrx (8.522 -- Latest as of today)
Comment 19 Lubos Lunak 2008-09-04 08:12:52 UTC
*** Bug 170346 has been marked as a duplicate of this bug. ***
Comment 20 Tuomas Nurmi 2008-09-04 18:38:30 UTC
I encountered this too (173.14.12 and GF FX 5700)
I can confirm that adding a glXWaitGL(); (comment #17) fixes the issue for me...
Comment 21 tlayton_at_work 2008-09-08 00:33:11 UTC
Created attachment 27301 [details]
kwin xsession errors
Comment 22 tlayton_at_work 2008-09-08 00:34:33 UTC
Oops, comments didn't get attached to Comment #21.

I've updated to the latest scene_opengl.cpp. Still getting the compositing self check failed.  I've attached the kwin lines from .xsession-errors, in case that helps.

BTW, if commented out lines 678-679 in selfCheckFinish(). Still received the message in .xsession-errors, but compositing indeed works.
Comment 23 Lubos Lunak 2008-09-11 18:39:59 UTC
Can somebody still reproduce the problem with r859960?
Comment 24 prasadae 2008-09-11 19:04:38 UTC
I no longer face this problem, but I do not use the svn. After one of the suse upgrades, the effects started working again and I no longer find the message in .xsession-errors. So, it is fixed at least for me! Anyone else share this? So this bug can be happily closed. 
Comment 25 Lubos Lunak 2008-09-11 20:20:37 UTC
The problem was only worked around in SUSE packages. If you use only the binary packages and don't build from SVN, please use http://bugzilla.novell.com/422532 , here I need feedback from people who use SVN.
Comment 26 Christoph Feck 2008-09-11 21:31:22 UTC
Lubos, I still get the error message "failed to activate desktop effects...", when trying to enable effects with XRender mode with r859996.

When starting KDE 4 with a clean .kde, I cannot enable effects with XRender mode. I always get the error message. It seems to first check OpenGL mode even when trying to activate XRender mode. It falls back to non compositing desktop then.

However, manually setting "Backend=XRender" in kwinrc from root, then login into KDE 4, works; I get XRender shadows etc. When I then go into system settings again, and try to enable OpenGL mode, I get the error message again, but kwin hangs, only killing helps.

XRender mode is the only mode that I got working at all. OpenGL mode never worked for me. Driver is "intel" from openSUSE 11.0 update repo on 855 chipset.

BTW, I still get broken rendering (missing updates), white flashing, and wired shadow behaviour with r859996. Not fun to use at the moment :(
Comment 27 Tuomas Nurmi 2008-09-11 21:52:53 UTC
with revision 860019, 173.14.12 and GF FX 5700 self-check passes (I also get the missing updates issue as mentioned in comment 26, but is it actually related to this bug? O_o)
Comment 28 Lubos Lunak 2008-09-12 09:47:36 UTC
Please create separate bugreports about unrelated issues. This bugreport is about the failing self-check.
Comment 29 Lubos Lunak 2008-09-18 17:58:18 UTC
Closing, unless somebody can still reproduce the self-check failing on an otherwise usable system.
Comment 30 Christoph Feck 2008-09-27 20:20:55 UTC
Sorry for the delay, I just compiled r865392 and I still get the following behaviour, I will try to explain (always starting with a cleaned .kde, except when noted below):

* Trying to enable "XRender" compositing: fails with an error message, and the dialog resets the combobox to "OpenGL"

* Trying to disable selfcheck and enable "XRender": fails with an error message, and the dialog resets the combobox to "OpenGL", and the selfcheck checkbox to "off"

* Setting "DisableChecks=true" in settings file will make the dialog appear with that checkbox set. Trying to enable "XRender" compositing: fails again, and dialog resets the combobox to "OpenGL", but leaves the selfcheck checkbox to "on"

* Setting "Backend=XRender", "Enabled=false" in settings file allows me to enable compositing without error message, regardless of the "DisableChecks" setting in the settings file or the dialog

SUMMARY:

It looks like as if it first does the selfcheck with the render mode from the previous value of the ComboBox (which is OpenGL on a clean .kde), then applies the changes from the dialog (composite mode combobox, selfcheck checkbox).

Since OpenGL fails on my system (or was very slow when it worked with earlier KDE 4.0/4.1 versions) I cannot enable XRender without manually adding it to the settings file.
Comment 31 Stephan Menzel 2008-10-15 10:09:53 UTC
I can confirm that. Currently working with 4.1.2 Factory on OpenSuSE 11 x64.

I can not set rendering to XRender and none of the kwin effects are working, even though I don't get an error message. kwin does:

sm@mybox:~/> kwin --replace
kwin: X Error (error: BadMatch [8], request: X_SetInputFocus[42], resource: 0x2c59286)
kwin: X Error (error: BadMatch [8], request: X_SetInputFocus[42], resource: 0x2c59286)


mybox:~ # grep GLX /var/log/Xorg.0.log
(**) Option "AIGLX" "true"
(II) NVIDIA GLX Module  173.14.12  Thu Jul 17 18:36:30 PDT 2008
(II) Loading extension GLX
(**) NVIDIA(0): Option "AllowGLXWithComposite" "True"
(**) NVIDIA(0): Option "AddARGBGLXVisuals" "True"
(II) NVIDIA(0): Support for GLX with the Damage and Composite X extensions is
(**) NVIDIA(0): Enabling 32-bit ARGB GLX visuals.
(II) Loading extension NV-GLX
(II) Initializing extension GLX


Will your fix work for this as well?

hth,

Stephan
Comment 32 Lubos Lunak 2009-01-15 15:37:17 UTC
As already said, this bugreport is about the selfcheck preventing compositing from activating on a system where it works when checks are disabled. See comment #28.

Comment 33 Daimonion 2010-07-19 16:20:32 UTC
I had the same issue, but the problem was mesa stack compiled from git. Using mesa stack from sources up until this commit:
http://cgit.freedesktop.org/mesa/mesa/commit/?id=3eb557778376bcbbc6f25da88ffbaa269607254c
and no problem with the kwin desktop effects. If I compile mesa using sources including and the mentioned commit (and newer) - no kwin desktop effects.

I know this isn't directly related to the topic, but it might help figuring out what is going on.