Ajax problem in Firefox 3 on Ubuntu

Surely you have experienced slow browser, and slow load times, but the fact is on some pages Firefox is extremely slow and unresponsive. It can get even to some system lockups, music stalling and similar issues. This system lockups and stalls lead me to believe there is something more than pure browser hick ups. Hoping for upgrades to resolve issues left me with this problem almost 2-3 months.

As I started to search for solution I stumbled on bug #223238 describing this issue. What seams to be the problem is Firefox’s 3 new features that are directly calling some bugy Nvida functions thus resulting in system lockups, and degraded performance. To test if you do have a problem you can simply browse to this link: http://www.craftymind.com/factory/guimark/GUIMark_HTML4.html if you get very low and unresponsive framerate you are effected and should read on how to fix it.

Note: this ain’t going to be one of those ultimate copy paste guides that will work for all systems, it will probably require some of your interaction, and corrections for your system. Although steps are not data intrusive and they shouldn’t brake your system, please if your have no slightest idea what your doing, backup any data you’re not prepared to lose.

I’m running Ubuntu 8.04 on my Dell XPS 1530, with fully updated system including Firefox 3.0.4. and Nvidia 169.12 drivers, initial tests on link provided above returned average of 0.2-0.6 fps. To overcome this problem we have to update our drivers since current ones don’t support additional options required in step2.

Step 1 – Updating drivers

First and initial thing you should do is install newer drivers, at minimum 177.xx, you can do this either via envyng or manuall driver download and installation.

Note: on Ubuntu 8.10 you can install nvidia drivers 177.xx trough restricted drivers manager, I strongly recommend you do so and skip to step 2.

By default you can install envyng in hardy simply by typing:

sudo apt-get install envyng-gtk

Then you should run it by typing

envyng -g

and following the instructions on screen. If for any reason you have troubles with default installation of envy, you can try to add this line to your sources list:

sudo pico /etc/apt/sources.list

add:

deb http://ppa.launchpad.net/envyng-hardy/ubuntu hardy main

Then run:

sudo apt-get update

sudo apt-get upgrade

This will get you newest envyng version out there, for any additional info about envy visit envy hompage.

The alternate method is to install nvidia drivers manually, there is a guide on http://www.nvnews.net/vbulletin/showthread.php?t=72490

Make sure to remove any currently installed nvidia drivers and to disable them in /etc/default/linux-restricted-modules or /etc/default/linux-restricted-modules-common otherwise newly installed drivers won’t work.

Step 2 – Adding the modifications

As announced by Nvidia this modifications will only work for 177+ drivers, and they will be automatically included in 180. version.

Add this options to your /etc/X11/xorg.conf file under screen section:

Option "PixmapCacheSize" "1000000"
Option "AllowSHMPixmaps" "0"

Also after X server startup you should execute following command

nvidia-settings -a InitialPixmapPlacement=2 -a GlyphCache=1

I found it fits perfectly in ~/.gnomerc for automatic execution

This will initiate pixmap placement in your graphics card memory thus allowing greater performance of any X application relying on pixmap allocation (including our Firefox rendering ajax powered pages). For full description of setting mentioned above I advise visiting this page.

Step 3 – Verify

Well now all we need to do is to verify all went well. Not to mention that you will have to reboot your system to get your new nvidia drvier and new additional settings into account. But after you do just that, try to visit this page again http://www.craftymind.com/factory/guimark/GUIMark_HTML4.html. Now I get about 35-40 fps, visiting heavy povered ajax pages no longer lock up my system.

Step 4 – Notebook users

Special note to notebook users, there seams to be some powermizer issue using this workaround. It manifests it self when ncurses try to update console screen. If you are using gnome terminal, you will notice screen in terminal ain’t refreshing when using top, mc, even ls if screen is already filled. You will have to either enter additional command to redraw the screen or do a mouse click. Of course, there is a workaround for workaround, you can try to disable powermizer by adding:

options nvidia NVreg_Mobile=1 NVreg_RegistryDwords="PerfLevelSrc=0x2222"

to your /etc/modprobe.d/nvidia-kernel-nkc

Be noted I tested this only with manually installed driver, not backported ones from repository. You can find full explanation of this tweak in this thread.

Related posts:

  1. Ubuntu Intrepid on Dell XPS M1530
  2. Vodafone mobile and Ubuntu

  1. Very very useful link.. Thank you.. I’ve a Dell XPS M1330 with a nVidia GeForce 8400M GS.. See you.

    • Artem
    • December 11th, 2008

    I tried to accumulate all power saving, performance and PowerMizer related info in one place – http://tutanhamon.com.ua/technovodstvo/NVIDIA-UNIX-driver/

  2. Tnx. very useful info, but enabling any povermizer features on my laptop while using pixmap cache still results in corrupt refreshing of ncurses powered programs in gnome-terminal. There is another workaround by patching compiz, I found this http://www.nvnews.net/vbulletin/showthread.php?t=120829#13 but really haven’t had the time to test it out.

    • Ross
    • January 10th, 2009

    Thank you very much for your blog entry. I can’t tell you how much I’ve struggled with Firefox under Ubuntu.

    • Patrick Metz
    • March 29th, 2009

    Thanks a lot for this extremely helpful post!!!
    Yesterday i decided to make the transition from Vista to Ubuntu. And everything was great, except for the very poor firefox performance… So i googled and googled and finally found your blog-entry… whew… saved :-)

  1. No trackbacks yet.