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:


To make changes permanent you can write the lines above to a file script like /etc/profile.d/ 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:


Unknown said...

Thanks mate, I searched for a fix all day, google,IRC , this worked for me and I hope that this will be fixed in an update so other users will not have same issue.

Unknown said...

Thanks mate, I searched for a fix all day, google,IRC , this worked for me and I hope that this will be fixed in an update so other users will not have same issue.

Anonymous said...

Thanks ! Worked for me on RadeonHD 6250 !

Ivan Čukić said...

I read somewhere that 3.11 will have a much better power handling in the free driver.

Lamarque Souza said...

@Ivan Čukić, yeah, I read that too. Unfortunately I do not think that will help me. Current radeon power handling requires some profiles that we can see when running dmesg command. My notebook's card shows just one profile (performance). For the dynamic clock implementation in the kernel to work the kernel should detect at least another profile with the correct clocks for the gpu's processor and memory. By what I have found notebook manufecturers sometimes implement those things differently from what the opensource driver expects and then issues like no powermanagement happens. It would be a big surprise to me if kernel 3.11 solves the issue with my notebook's gpu.

smitty3268 said...

I'm pretty sure the new 3.11 kernel PM code stops using the old BIOS power profiles and instead provides PM code much more close to what the fglrx driver does. It's certainly worth a try, at least - although note that it does require new firmware and a custom kernel parameter to enable the new PM code (DPM=1?) so make sure you've got it enabled correctly if you try it out. Or else just wait a few more months and it should become a more out of the box experience.

Stan aka Xeno said...

Yep, new PM code uses special pm-controller found in R600 and later chips intead of bio tables.
It's awesome, 'tho i exprienced random system freezes (esp. when display dpms off kicks in).
To enable this new pm you need 3.11 kernel and radeon.dpm=1 param at boot.

LeGoek said...

How can I make those settings permanent? When I put those in to konsole it works as long as I don´t close konsole. I´ve found the same solution here:

but putting an executable "desktop_effects" file into ~/.kde/env/ doesn´t do it for me. After a restart it´s still the same. What part am I getting wrong? Thanks for the blogpost. It´s a little reassuring knowing I am not alone.

Stan aka Xeno said...

I guess easiest would be put env variables export in ~/.bash_profile or . bashrc (assuming bash is your default shell)

Lamarque Souza said...

Ok, I will test kernel 3.11-rc5 tomorrow and see if it solves my powermanagement problems.

I will update the post explaining how I made the changes permanent.

LeGoek said...

@ Stan aka Xeno:
Thanks, I tried that (.bahsrc). When I restarted it worked fine. Then I opened Konsole and it seems like it repeated the exported env variables, the screen flickered. Then I closed Konsole and again desktop effects gone, window decoration gone.

@ Lamarque Souza:
That would be great, thanks.

LeGoek said...

Thanks for the update Lamarque, works!

Bad Cameron said...

Hi Lamarque

Thank you for this Blog post. This seems to be the solution for me and I even set up a /etc/profile.d/ script. However the rendering (?) is now super slow.

I note too that I have OpenGL 3.0 listed as well as 1.2 & 2.0. All of them have the same effect with slow compositing (rendering?). ie Wobbly Windows and other effects are no longer smooth like they used to be.

Lamarque Souza said...

I also noticed drawing performance are not ad good as before and there are also some graphical artifacts. However, that is not may area of expertise, you should contact kwin developers about those problems.

Anonymous said...

Hi !

same problem !
same solution !!

big thanks ;)

Anonymous said...

Great it works again! Thanks a lot!