Search This Blog

Thursday, August 15, 2013

kwin and catalyst drivers

Today I have upgraded my notebook to 4.11.0. Almost everything worked out of the box, the only exception was kwin's compositing support.

Just for clarify I use the catalyst drivers (AKA fglrx, AKA ATI/AMD's proprietary graphical drivers) because only catalyst can control my notebook's fan. I have tried the opensource driver but my notebook's bios does not provide the gpu profiles required to make the dynamic clock support in the opensource driver to work, so I am stuck with catalyst.

Looking at ~/.xsession-errors I could see those messages:

OpenGL vendor string:                   ATI Technologies Inc.
OpenGL renderer string:                 ATI Mobility Radeon HD 4500/5100 Series
OpenGL version string:                  2.1 (3.3.11672 Compatibility Profile Context)
OpenGL shading language version string: 
Driver:                                 Catalyst
Driver version:                         2.1
GPU class:                              R700
OpenGL version:                         2.1
GLSL version:                           0.0
X server version:                       1.12.4
Linux kernel version:                   3.10.6
Direct rendering:                       no
Requires strict binding:                yes
GLSL shaders:                           yes
Texture NPOT support:                   yes
Virtual Machine:                        no
kwin(17322) KWin::checkGLError: GL error ( Init ):  "GL_INVALID_ENUM" 
kwin(17322): OpenGL 1 compositing setup failed 
QObject::connect: Cannot connect (null)::resetCompositing() to KWin::Compositor::restart()
kwin(17322): Failed to initialize compositing, compositing disabled

For some reason kwin does not detect that my notebook's setup is direct rendering capable. After some research I have found out that setting those two environment variables make kwin work with direct rendering:

export KWIN_DIRECT_GL=1
export KWIN_COMPOSE=O2

To make changes permanent you can write the lines above to a file script like /etc/profile.d/env.sh. That works for bash, if you use another shell then you need to figure out how to set environment variables for it. Then you can logout and login and kwin should work. If you do not want to logout you can just run those two lines above and then the command below:

kwin --replace &

KWIN_COMPOSE=O2 means to use OpenGL2 according to kwin's wiki page and by the message above kwin was trying to use OpenGL1. Well, for anybody with the same problem that is a workaround for it :-)

Update: bug entry about this issue: https://bugs.kde.org/show_bug.cgi?id=323553