Firefox 80 on POWER


Firefox 80 is available, and we're glad it's here considering Mozilla's recent layoffs. I've observed in this blog before that Firefox is particularly critical to free computing, not just because of Google's general hostility to non-mainstream platforms but also the general problem of Google moving the Web more towards Google.

I had no issues building Firefox 79 because I was still on rustc 1.44, but rustc 1.45 asserted while compiling Firefox, as reported by Dan Horák. This was fixed with an llvm update, and with Fedora 32 up to date as of Sunday and using the most current toolchain available, Firefox 80 built out of the box with the usual .mozconfigs.

Since there was a toolchain update, I figured I would try out link-time optimization again since a few releases had elapsed since my last failed attempt (export MOZ_LTO=1 in your .mozconfig). This added about 15 minutes of build-time on the dual-8 Talos II to an optimized build, and part of it was spent with the fans screaming since it seemed to ignore my -j24 to make and just took over all 64 threads. However, it not only builds successfully, I'm typing this post in it, so it's clearly working. A cursory benchmark with Speedometer 2.0 indicated LTO yielded about a 4% improvement over the standard optimized build, which is not dramatic but is certainly noticeable. If this continues to stick, I might try profile-guided optimization for the next release. The toolchain on this F32 system is rustc 1.45.2, LLVM 10.0.1-2, gcc 10.2.1 and GNU ld.bfd 2.34-4; your mileage may vary with other versions.

There's not a lot new in this release, but WebRender is still working great with the Raptor BTO WX7100, and a new feature available in Fx80 (since Wayland is a disaster area without a GPU) is Video Acceleration API (VA-API) support for X11. The setup is a little involved. First, make sure WebRender and GPU acceleration is up and working with these prefs (set or create):

gfx.webrender.enabled true
layers.acceleration.force-enabled true

Restart Firefox and check in about:support that the video card shows up and that the compositor is WebRender, and that the browser works as you expect.

VA-API support requires EGL to be enabled in Firefox. Shut down Firefox again and bring it up with the environment variable MOZ_X11_EGL set to 1 (e.g., for us tcsh dweebs, setenv MOZ_X11_EGL 1 ; firefox &, or for the rest of you plebs using bash and descendants, MOZ_X11_EGL=1 firefox &). Now set (or create):

media.ffmpeg.vaapi-drm-display.enabled true
media.ffmpeg.vaapi.enabled true
media.ffvpx.enabled false

The idea is that VA-API will direct video decoding through ffmpeg and theoretically obtain better performance; this is the case for H.264, and the third setting makes it true for WebM as well. This sounds really great, but there's kind of a problem:

Reversing the last three settings fixed this (the rest of the acceleration seems to work fine). It's not clear whose bug this is (ffmpeg, or something about VA-API on OpenPOWER, or both, though VA-API seems to work just fine with VLC), but either way this isn't quite ready for primetime yet on our platform. No worries since the normal decoder seemed more than adequate even on my no-GPU 4-core "stripper" Blackbird. There are known "endian" issues with ffmpeg, presumably because it isn't fully patched yet for little-endian PowerPC, and I suspect once these are fixed then this should "just work."

In the meantime, the LTO improvement with the updated toolchain is welcome, and WebRender continues to be a win. So let's keep evolving Firefox on our platform and supporting Mozilla in the process, because it's supported us and other less common platforms when the big 1000kg gorilla didn't, and we really ought to return that kindness.

Comments

  1. You seem concerned about "the general problem of Google moving the Web more towards Google". Did you consider that Blogger and blogger.com are owned by Google? There are many free and open-source alternatives to Blogger that do not belong to Google and do not "move the Web towards Google".

    ReplyDelete
    Replies
    1. This is a really good point , and I agree in principle. One of the reasons that many people (and companies) stay with Blogger is that it's already got your historical content on it, and it may be tricky to transfer it to another platform.

      That said, with Google's current reputation, it's probably just a matter of time until Blogger gets EOL'd anyway.

      Delete
    2. Would strongly recommend posting these articles to medium. The good doesn't have to be the enemy of the perfect, you can post to both. Then you have an escape hatch when blogger goes EOL and you'll also be hitting a wider audience. Great article though.

      Delete
  2. Really cool article! Enjoyed the read, didn't know the -j argument could be ignored but then again really not that surprising I suppose. Do you know if there were any WebGL updates as part of this release?

    ReplyDelete
    Replies
    1. Not aware of anything major, but there's this in the developer docs: https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/Using_Extensions

      Delete
  3. I wouldn't bother with turning on layers.acceleration.force-enabled, just turn on webrender

    ReplyDelete
  4. I don't understand what's the big deal of Firefox on POWER is. Shouldn't every program just run on the platform after there is a compiler for the language and the platform?

    And I also don't understand why Firefox is so important. On the WWW it shouldn't matter which client software you use. Also besides Opera AFAIK every browser of today uses a variant of the KDE HTML and CSS rendering engine. I use the current KDE browser which is called Falkon and it works fine. I don't have a POWER system unfortunately.

    ReplyDelete
    Replies
    1. The real world is different from the ideal one, unfortunately. So keeping complex apps like Firefox building and running takes some amount of work.

      Delete

Post a Comment

Comments are subject to moderation. Be nice.