PDA

View Full Version : [ubuntu] [10.04 Lucid Lynx] Xorg + Flash = insane CPU usage



Darac
May 15th, 2010, 11:38 PM
Hi all!

I have a problem on my desktop PC that i'm trying to solve for last 10 hours.

When playing videos on Youtube for example, Xorg process uses all available CPU %. While Firefox usage goes up to 45%. That renders Firefox unresponsive and video is barely played at 10 FPS. Thing is, if i scroll down so that the video played isn't visible, Xorg CPU usage goes back to normal.

This is the configuration of the PC i'm having this problem on:


:~$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : AMD Athlon(tm) XP 1700+
stepping : 1
cpu MHz : 1466.801

:~$ cat /proc/meminfo
MemTotal: 1285324 kB

:~$ lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333]
00:01.0 PCI bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333 AGP]
00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:0b.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 0a)
00:0b.1 Input device controller: Creative Labs SB Live! Game Port (rev 0a)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8233A ISA Bridge
00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:11.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 23)
00:11.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 23)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro]
01:00.1 Display controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro] (Secondary)


:~$ glxinfo
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
GLX version: 1.2
OpenGL vendor string: DRI R300 Project
OpenGL renderer string: Mesa DRI R300 (R350 4E48) 20090101 x86/MMX+/3DNow!+/SSE TCL DRI2
OpenGL version string: 1.5 Mesa 7.7.1

I tried using different Flash players and plugins for Mozilla, but with no improvements.

Currently i'm using:

ii adobe-flashplugin 10.0.45.2-1lucid1 Adobe Flash Player plugin version 10

I've tried disabling Icedtea plugin in Firefox just to be sure it's not causing a conflict.

Tried adding:


"OverrideGPUValidation=1"
to /etc/adobe/mms.cfg but with no luck.

I know this is an old computer, but i have a laptop with similar hardware: 1.4 Celeron and ATI Radeon Xpress 200M chip which uses the same graphic driver; and Xorg never passes 7% CPU and mozilla is around 30% when watching the same video on youtube.

Also i've tried disabling desktop effects, but that didn't help either. Xorg log doesn't show anything out of order.

So after 10 hrs of screwing around with this problem i'm realy out of ideas. Any help would be appreciated.

Darac
May 16th, 2010, 12:43 AM
Hi all!

I have a problem on my desktop PC that i'm trying to solve for last 10 hours.

When playing videos on Youtube for example, Xorg process uses all available CPU %. While Firefox usage goes up to 45%. That renders Firefox unresponsive and video is barely played at 10 FPS. Thing is, if i scroll down so that the video played isn't visible, Xorg CPU usage goes back to normal.

This is the configuration of the PC i'm having this problem on:


:~$ cat /proc/cpuinfo
processor : 0
vendor_id : AuthenticAMD
cpu family : 6
model : 8
model name : AMD Athlon(tm) XP 1700+
stepping : 1
cpu MHz : 1466.801

:~$ cat /proc/meminfo
MemTotal: 1285324 kB

:~$ lspci
00:00.0 Host bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333]
00:01.0 PCI bridge: VIA Technologies, Inc. VT8366/A/7 [Apollo KT266/A/333 AGP]
00:0a.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL-8139/8139C/8139C+ (rev 10)
00:0b.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 0a)
00:0b.1 Input device controller: Creative Labs SB Live! Game Port (rev 0a)
00:11.0 ISA bridge: VIA Technologies, Inc. VT8233A ISA Bridge
00:11.1 IDE interface: VIA Technologies, Inc. VT82C586A/B/VT82C686/A/B/VT823x/A/C PIPC Bus Master IDE (rev 06)
00:11.2 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 23)
00:11.3 USB Controller: VIA Technologies, Inc. VT82xxxxx UHCI USB 1.1 Controller (rev 23)
01:00.0 VGA compatible controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro]
01:00.1 Display controller: ATI Technologies Inc Radeon R350 [Radeon 9800 Pro] (Secondary)


:~$ glxinfo
name of display: :0.0
display: :0 screen: 0
direct rendering: Yes
server glx vendor string: SGI
server glx version string: 1.2
client glx vendor string: Mesa Project and SGI
client glx version string: 1.4
GLX version: 1.2
OpenGL vendor string: DRI R300 Project
OpenGL renderer string: Mesa DRI R300 (R350 4E48) 20090101 x86/MMX+/3DNow!+/SSE TCL DRI2
OpenGL version string: 1.5 Mesa 7.7.1

I tried using different Flash players and plugins for Mozilla, but with no improvements.

Currently i'm using:

ii adobe-flashplugin 10.0.45.2-1lucid1 Adobe Flash Player plugin version 10

I've tried disabling Icedtea plugin in Firefox just to be sure it's not causing a conflict.

Tried adding:


"OverrideGPUValidation=1"
to /etc/adobe/mms.cfg but with no luck.

I know this is an old computer, but i have a laptop with similar hardware: 1.4 Celeron and ATI Radeon Xpress 200M chip which uses the same graphic driver; and Xorg never passes 7% CPU and mozilla is around 30% when watching the same video on youtube.

Also i've tried disabling desktop effects, but that didn't help either. Xorg log doesn't show anything out of order.

So after 10 hrs of screwing around with this problem i'm realy out of ideas. Any help would be appreciated.

dtfinch
May 16th, 2010, 12:56 AM
I don't know if this is still the case, and I don't have an ATI card, but one of the lead developers for Flash on Linux said in 2008 that they disable hardware acceleration if "SGI" appears in the vendor string returned by glxinfo.

http://blogs.adobe.com/penguin.swf/2008/05/flash_uses_the_gpu.html

cariboo
May 16th, 2010, 02:11 AM
Please don't create multiple threads on the same subject, I have merged you two threads.

lovinglinux
May 16th, 2010, 02:12 AM
See the Flash Optimization (http://firefox-tutorials.blogspot.com/2010/05/flash-optimization.html) section of Firefox optimization and troubleshooting thread (http://ubuntuforums.org/showthread.php?t=1193567).


I know this is an old computer, but i have a laptop with similar hardware: 1.4 Celeron and ATI Radeon Xpress 200M chip which uses the same graphic driver; and Xorg never passes 7% CPU and mozilla is around 30% when watching the same video on youtube.

Also i've tried disabling desktop effects, but that didn't help either. Xorg log doesn't show anything out of order.

I had a P4 3.06 GHz. Flash would use 45% too. I could make it work a little better by cleaning up the CPU fan and applying the other tweaks provided by my tutorial. But I was only able to solve the problem by upgrading to a Core2 Duo 2.93 GHz. Flash now uses 30% of the CPU. So I think your are lucky that your Celeron computer uses only 30%.

rifter
May 16th, 2010, 03:34 AM
See the Flash Optimization (http://firefox-tutorials.blogspot.com/2010/05/flash-optimization.html) section of Firefox optimization and troubleshooting thread (http://ubuntuforums.org/showthread.php?t=1193567).



I had a P4 3.06 GHz. Flash would use 45% too. I could make it work a little better by cleaning up the CPU fan and applying the other tweaks provided by my tutorial. But I was only able to solve the problem by upgrading to a Core2 Duo 2.93 GHz. Flash now uses 30% of the CPU. So I think your are lucky that your Celeron computer uses only 30%.

Don't you think it's a little excessive for flash to be using that much resources, especially on your newer dual core system? 30% of a core2duo 2.93Ghz is a lot of horsepower for an applet in ONE window of a browser.

I think Adobe has gone nuts anyway, lately, because it is true that Flash uses a lot of resources. But the latest flash does not use anything like that on my systems running 9.10, even my old AthlonXP 2700+. It still uses too much, especially considering it is supposed to be a lightweight application for web browsers (something Adobe seems to have lost sight of... have you read their system requirements (http://www.adobe.com/products/flashplayer/systemreqs/)?), but it sounds to me like something is wrong here.

lovinglinux
May 16th, 2010, 04:52 AM
Don't you think it's a little excessive for flash to be using that much resources, especially on your newer dual core system? 30% of a core2duo 2.93Ghz is a lot of horsepower for an applet in ONE window of a browser.

I think Adobe has gone nuts anyway, lately, because it is true that Flash uses a lot of resources. But the latest flash does not use anything like that on my systems running 9.10, even my old AthlonXP 2700+. It still uses too much, especially considering it is supposed to be a lightweight application for web browsers (something Adobe seems to have lost sight of... have you read their system requirements (http://www.adobe.com/products/flashplayer/systemreqs/)?), but it sounds to me like something is wrong here.

Sorry, I was actually referring to how much CPU is used overall, while playing flash videos. I did a test and the plugin-container process is using 10-14%. I'm using Firefox 3.6.5pre which has plugin isolation.

Darac
May 16th, 2010, 03:47 PM
Ty for your answers, but they don't rly help. I've tried before mentioned "solutions" with no luck.

I just don't understand how can Flash work on Celeron 1.4 and not on Athlon 1700+ which both give similar horsepower and with virtualy the same GPU chip using the same driver. Does anyone know if Flash uses some of CPU instruction sets that AMD doesn't have and Intel does? I rly can't give any other explanation for this behavior.

Any other ideas? Or just a tip what to look at next?

lovinglinux
May 16th, 2010, 04:00 PM
Ty for your answers, but they don't rly help. I've tried before mentioned "solutions" with no luck.

I just don't understand how can Flash work on Celeron 1.4 and not on Athlon 1700+ which both give similar horsepower and with virtualy the same GPU chip using the same driver. Does anyone know if Flash uses some of CPU instruction sets that AMD doesn't have and Intel does? I rly can't give any other explanation for this behavior.

Any other ideas? Or just a tip what to look at next?

No other ideas from here. I had the reverse experience once. My P4 couldn't play flash videos without stuttering and CPU usage was about 45%. On the other hand I had an AMD low-end notebook that could play flash just fine, although the CPU was used 100%. Go figure.

Darac
May 16th, 2010, 04:15 PM
No other ideas from here. I had the reverse experience once. My P4 couldn't play flash videos without stuttering and CPU usage was about 45%. On the other hand I had an AMD low-end notebook that could play flash just fine, although the CPU was used 100%. Go figure.

This makes me a sad panda. Too bad Flash is all over the Web, it's easy to bypass this problem on Youtube, using totem's built in plugin or minitube, but it's terrible to not be able to watch videos on any other video sites.

Does flash have any log files i could check to see if there are any errors produced there?

lovinglinux
May 16th, 2010, 04:21 PM
This makes me a sad panda. Too bad Flash is all over the Web, it's easy to bypass this problem on Youtube, using totem's built in plugin or minitube, but it's terrible to not be able to watch videos on any other video sites.

That's the reason of all the hype around HTML5.


Does flash have any log files i could check to see if there are any errors produced there?

Start Firefox from terminal and it should output any errors, but I doubt it will produce any. Flash just sucks.

Darac
May 16th, 2010, 04:41 PM
Start Firefox from terminal and it should output any errors, but I doubt it will produce any. Flash just sucks.

As you predicted it didn't produce any errors. I don't have time to wait for HTML 5 go live since it will take a couple of years..

Oh well, Flash and my comp are just not meant to be :-({|=

Darac
May 16th, 2010, 09:31 PM
Hi again, i've had some progress. Just installed Flash 10.1 RC4 from Adobe, and i have 15% lower CPU usage from Xorg, total CPU usage is now 75-80% when watching flash videos. So it's quite a progress.

Here's the tutorial how to install flash rc on Ubuntu: http://www.ubuntugeek.com/how-to-install-adobe-flash-player-10-1-beta-in-ubuntu.html

I won't tag this thread as solved since i'm still having far, far better results on my Celeron. :( But at least i can watch videos without Firefox freezing.

rifter
May 17th, 2010, 04:23 AM
As you predicted it didn't produce any errors. I don't have time to wait for HTML 5 go live since it will take a couple of years..

Oh well, Flash and my comp are just not meant to be :-({|=

At least on Youtube it is live now (http://www.youtube.com/html5). You have to use a webkit browser (like Chrome or Chromium or Safari) but it works.

mister_p_1998
May 17th, 2010, 02:02 PM
is it worth trying a lower screen resolution? just curious..
Steve

Darac
May 19th, 2010, 08:05 PM
is it worth trying a lower screen resolution? just curious..
Steve

No, it doesn't help, the CPU usage stays the same.

I ran some tests with HTML5, and to my surprise the CPU usage of Xorg is the same or sometime spikes even to 60% of total CPU. Firefox CPU usage is lower, but Xorg is equally terrible with HTML5 videos. As a reference i used ogg theora vid from this site, since Firefox can render it. I also disabled Flash plugin in Firefox prior to watching just to be safe Flash isn't used.

http://camendesign.com/code/video_for_everybody/test.html

I tried disabling composite, but the result is the same. So i guess this isn't a problem with Flash plugin from Adobe, but Xorg server and it's rendering of vids inside browser windows.

Btw, i'm rly astonished how many ppl just don't give a f*ck about this problem which is 4 years old. And no one even tried to do some proper debugging or experiments to get to the root cause. All ppl usually write in threads with Xorg high CPU usage when rendering Flash is that it's Adobe's fault, which it clearly isn't in some cases and especially in this case i described above.

I even tried installing newer Xorg.server and newer radeon drivers from Xorg edgers PPA, but that didn't help either. So i'm rly out of ideas by now. Any help or idea would be appreciated.

lovinglinux
May 19th, 2010, 10:27 PM
No, it doesn't help, the CPU usage stays the same.

I ran some tests with HTML5, and to my surprise the CPU usage of Xorg is the same or sometime spikes even to 60% of total CPU. Firefox CPU usage is lower, but Xorg is equally terrible with HTML5 videos. As a reference i used ogg theora vid from this site, since Firefox can render it. I also disabled Flash plugin in Firefox prior to watching just to be safe Flash isn't used.

http://camendesign.com/code/video_for_everybody/test.html

I tried disabling composite, but the result is the same. So i guess this isn't a problem with Flash plugin from Adobe, but Xorg server and it's rendering of vids inside browser windows.

Btw, i'm rly astonished how many ppl just don't give a f*ck about this problem which is 4 years old. And no one even tried to do some proper debugging or experiments to get to the root cause. All ppl usually write in threads with Xorg high CPU usage when rendering Flash is that it's Adobe's fault, which it clearly isn't in some cases and especially in this case i described above.

I even tried installing newer Xorg.server and newer radeon drivers from Xorg edgers PPA, but that didn't help either. So i'm rly out of ideas by now. Any help or idea would be appreciated.

I know is not a solution, but I'm finishing the development of an extension that will allow to replace flash videos with mplayer compatible videos on site. See thread (http://ubuntuforums.org/showthread.php?t=1487327) and the extension web site (http://flvideoreplacer-extension.blogspot.com/).

Darac
May 20th, 2010, 12:22 AM
I know is not a solution, but I'm finishing the development of an extension that will allow to replace flash videos with mplayer compatible videos on site. See thread (http://ubuntuforums.org/showthread.php?t=1487327) and the extension web site (http://flvideoreplacer-extension.blogspot.com/).

Oh yes that's a solution! I rly don't care which way vids will play on sites, just as long they are played without hogging the resources.

Excellent news, now i have something to look forward to. Hope your extension will work well.:)

lovinglinux
May 20th, 2010, 04:03 AM
Oh yes that's a solution! I rly don't care which way vids will play on sites, just as long they are played without hogging the resources.

Excellent news, now i have something to look forward to. Hope your extension will work well.:)

It works well. The only problem is that I need to create a separate code for every web site I want to support.

Linux_User_Simon
June 11th, 2010, 07:26 PM
Hi all, Removing Flash has corrected this problem for me until i open System Monitor and then 100% CPU usage. System Monitor then has a problem shutting down using the close box button, highlighting the process and using end process sorts that. I am thinking with the system shut-down errors and these Ubuntu is in need of some fixes. I use a older machine with Fedora 12 fully loaded with Flash etc and when watching files from you-tube and the like my processor is on 14% and drops to 0 - 1% when idle.

Kurkha
June 12th, 2010, 03:47 PM
IF you are using a Radeon GPU on Lucid, try disabling Kernel Mode Setting (see https://wiki.ubuntu.com/X/KernelModeSetting ). According to bug reports, there are 2D&3D performance problems on (some) Radeon cards with KMS enabled. Personally, disabling KMS solved the problems with Youtube on my P4 2.4 Ghz with Radeon 9600.

Do the following:

Create a module configuration file with the following command:


sudo nano /etc/modprobe.d/radeon-kms.confCopy the following line to the file:


options radeon modeset=0Save the file and restart the computer.

The bug reports referenced:

https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/562293 (See comment #2 and forwards)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583653 (Lucid has backported KMS-related Xorg stuff from kernel 2.6.33, but anyway...)
https://bugzilla.redhat.com/show_bug.cgi?id=557420 (not the same kernel version as in Ubuntu Lucid, but anyway...)

(https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/562293)

jedi-penguin
June 14th, 2010, 06:24 PM
I think this problem maybe relate to the graphic card driver. When I watch a flash video, the CPU usage goes up, but if I hide the browser behind another application windows (e.g. evolution), the CPU usage goes down to almost nothing.

krack3rz
October 10th, 2010, 01:08 AM
dude, i had the same problem, its fixed now.

heres how i did it: reinstalled ubuntu 10.04

you should try this first
1. completely remove flash (apt-get purge? i think and autoremove, autoclean)
2. configurations too
3. reinstall flash

if this fails

reinstall ubuntu 10.04 or now the new 10.10

i think there is/was a leak or somethin that they call it. I dont know the logic behind it, it was a miracle xD

what happens wen you kill/end the process (flash) in system monitor? Because for me it restarted and worked fine for a while.

by any chance, when you first installed ubuntu was it an earlier version and then upgrade? i.e. 8.04 --> 10.04 (cuz maybe u didnt want to burn another disk -> like me :/ )

tell us how it goes if you still have this problem

WhErEeVeR
November 12th, 2010, 02:38 PM
IF you are using a Radeon GPU on Lucid, try disabling Kernel Mode Setting (see https://wiki.ubuntu.com/X/KernelModeSetting ). According to bug reports, there are 2D&3D performance problems on (some) Radeon cards with KMS enabled. Personally, disabling KMS solved the problems with Youtube on my P4 2.4 Ghz with Radeon 9600.

Do the following:

Create a module configuration file with the following command:


sudo nano /etc/modprobe.d/radeon-kms.confCopy the following line to the file:


options radeon modeset=0Save the file and restart the computer.

The bug reports referenced:

https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/562293 (See comment #2 and forwards)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583653 (Lucid has backported KMS-related Xorg stuff from kernel 2.6.33, but anyway...)
https://bugzilla.redhat.com/show_bug.cgi?id=557420 (not the same kernel version as in Ubuntu Lucid, but anyway...)

(https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/562293)

Wow! That made the world of difference! Thank you Kurkha. I am on a Pentium III 500 w/768 megs or ram and an old ATI card running 10.04. I was thinking it was just because of my old hardware... This is GREAT!! Haha!

WhErEeVeR
November 12th, 2010, 02:53 PM
Wow! That made the world of difference! Thank you Kurkha. I am on a Pentium III 500 w/768 megs or ram and an old ATI card running 10.04. I was thinking it was just because of my old hardware... This is GREAT!! Haha!

Well, flash performance has not improved much but system performance has dramatically improved! Flash is a whole other issue I guess. At least now I can move my mouse smoothly across the screen.

lxme
May 14th, 2011, 11:17 AM
IF you are using a Radeon GPU on Lucid, try disabling Kernel Mode Setting (see https://wiki.ubuntu.com/X/KernelModeSetting ). According to bug reports, there are 2D&3D performance problems on (some) Radeon cards with KMS enabled. Personally, disabling KMS solved the problems with Youtube on my P4 2.4 Ghz with Radeon 9600.

Do the following:

Create a module configuration file with the following command:


sudo nano /etc/modprobe.d/radeon-kms.confCopy the following line to the file:


options radeon modeset=0Save the file and restart the computer.

The bug reports referenced:

https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/562293 (See comment #2 and forwards)
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583653 (Lucid has backported KMS-related Xorg stuff from kernel 2.6.33, but anyway...)
https://bugzilla.redhat.com/show_bug.cgi?id=557420 (not the same kernel version as in Ubuntu Lucid, but anyway...)

(https://bugs.launchpad.net/ubuntu/+source/firefox/+bug/562293)

Thank you, this helped me a lot.
Xorg CPU usage was going crazy while browsing some website on my PIV HT 3GHz. This workaround did put everything back to normal.

Strange how some old bugs keep resurfacing updates after updates.