AUG
30
2010

KDE and NVidia (updated)

The above combination was never a painless experience, still at some point in past it seemed to be better to have a NVidia card on Linux then anything else, so I continued to buy them whenever my system was upgraded. Lately although it started to make me rather bad. I have two computers, one that is a 4 core Intel CPU with 8GB of memory, the other is a Core2Duo with 3GB. The latter is a Lenovo laptop. Both have NVidia, nothing high end (Qudaro NVS something and 9300GE, both used with dual monitor setup), but they should be more than enough for desktop usage. Are they?
Well, something goes wrong there. Is that KDE, is that XOrg, is that the driver? I suspect the latter. From time to time (read: often), I ended up with 100% CPU usage for XOrg. Even though I had 3 cores doing nothing the desktop was unusable. Slow scroll, scroll mouse movements, things typed appearing with a delay, things like that. Like I'd have an XT. I tried several driver version, as I didn't always have this issues, but with newer kernel you cannot go back to (too) old drivers. I googled, and found others having similar experience, with no real solution. A suspicion is font rendering for some (non-aliased) fonts, eg. Monospace. Switching fonts sometimes seemed to make a difference, but in the end, the bug returned. Others said GTK apps under Qt cause the problem, and indeed closing Firefox sometimes helped. But it wasn't a solution. Or there was a suggestion to turn the "UseEvents" option on. This really seemed to help, but broke suspend to disk. :( Turning off the second display and turning on again seemed to help...for a while. Turning off the composite manager did not change the situation.
Finally I tried the latest driver that appeared not so long ago, 256.44. And although the CPU usage of XOrg is still visible, with pikes going up to 20-40%, I gain back the control over the desktop. Am I happy with it? Well, not....
As this was only my desktop computer. I quickly updated the driver on the laptop as well, and went on the road. Just to see 100% CPU usage there. :( Did all the tricks again, but nothing helped. Until I had the crazy idea to change my widget theme from the default Oxygen to Plastique. And hurray, the problem went away! It is not perfect, with dual monitor enabled sometimes maximizing a konsole window takes seconds, but still in general the desktop is now usable. And of course this should also make me have more uptime on battery.
Do I blame Oxygen? No, not directly. Although might make sense to investigate what causes there the NVidia driver going crazy and report to NVidia.

So in case you have similar problems, try to switch to 256.44 and if it doesn't help chose a different widget style.

Now, don't say me to use nouveau or nv. Nouveau gave me graphic artifacts and it (or KDE?) didn't remember the dual card setup. Nv failed the suspend to disk test with my machine and doesn't provide 3D acceleration needed eg. for Google Earth.

UPDATE: I upgraded my laptop to 4.5.1 (from openSUSE packages).Well, this broke composition completely, I got only black windows. I saw a new driver is available (256.53), let's try it. So far, so good, even with Oxygen. Let's see on the long run how it behaves, I didn't test it in deep.

Comments

I, too, have problems with NVidia and indeed, switching to plastique was the solution : my desktop is much, much more responsive now. Shame that's it's ugly. But fast > beautiful.


By gaboo at Mon, 08/30/2010 - 08:51

I have problems too. I "solve" it by disabling all possible animations in the oxygen widget style and oxygen windeco.

Since these animations generally perform much better with my weak Intel gfx card on my laptop than on my workstation with the nvidia blob, the problem cannot be KDE's/Oxygen's fault alone. Nevertheless I think the oxygen developers or maybe the distros should be a bit more conservative with the animations. Even though these issues are fairly easy to workaround, they do a lot of harm to KDE, and unfortunately I don't think KDE has enough muscle to make Nvidia care very much.


By cb400f at Tue, 08/31/2010 - 09:19

It would be interesting which low-level calls that Oxygen is using are problematic with the NVidia drivers. I suspect that Oxygen is using painting ops that aren't properly accelerated by the NVidia driver. If we can identify which those are, we can pass that information to the NVidia driver developers, who are usually very helpful when given accurate information. Someone with NVidia hardware into profiling this? :)


By sebas at Mon, 08/30/2010 - 14:53

I would be eager to profile it if someone were to tell me how. Getting better performance on my Nvidia laptop would be extremely useful.


By toddrme2178 at Mon, 08/30/2010 - 15:18

I have the hardware (showing the bug), I even have programming knowledge, but here I would be lost. How to start profiling it? Running XOrg in cachegrind doesn't sound a good idea.


By amantia at Mon, 08/30/2010 - 17:55

Seriously, he'll know :=)


By sebas at Mon, 08/30/2010 - 21:19

Yes, I'll give it a try to profile it.

But it'll take a couple of days because I don't have a KDE development environment set up at the moment. I need to create that first.

I'll use systemtap and profile the time it takes (and cpu cycles) to execute functions and statements to see which one takes the most time. Maybe this will give a clearer picture where the bottleneck is.


By Tim Beaulen at Wed, 09/01/2010 - 04:25

If you use KDE 4.3, this might be a plasma issue.

To reproduce on KDE 4.3:
- open the system-tray settings dialog
- disable all "Icons" notifications: Application status, Communications, System services and Hardware control

Now, after some time, plasma / Xorg have always at least 30%-40% CPU usage... If you enable all icons notifications again, it's fixed.
See bug: https://bugs.kde.org/show_bug.cgi?id=245209

Of course, it could be the driver or anything else as well ;)


By Dominik at Mon, 08/30/2010 - 19:17

I'm a hardcore trunk user. :) Saw the problem with pre and post-KDE 4.5 as well.


By amantia at Tue, 08/31/2010 - 08:03

KDE 3.5X and Nvidia 7150 with MCP67 controller in a HP dv2840se using the newest Nvidia driver with newest XOrg AMD Turion TL-60 dual core works quite well. So unfortunately I believe the KDE Plasma 4.4 is pretty much the culprit. I have used Plasma and KDE 4.4 with openSuSE and was not very pleased with the speed. This machine is set up to have a KDE3.5, KDE4.4 or Gnome Session and the KDE3.5 is very fast. I cannot say there is anything in KDE 4.4 desktop I need since on openSuSE KDE3.5 is still being maintained and KDE4.4 apps run alongside KDE3.5 and Gnome app's.

Naturally I wait for the KDE 4 release that feels right but agree the pretty is not necessarily fast.


By embedded at Mon, 08/30/2010 - 20:48

Pages