Some graphs don't display on chromium on latimes.com

If none of the more specific forums is the right place to ask

Re: Some graphs don't display on chromium on latimes.com

Postby MagicPoulp » 2020-07-21 06:52

My listing of chromium versions had more results because I have more apt sources (but it takes lots of practice to use those without breaking debian).

Your firefox mentions gpu stuff because all processors usually have integrated graphics. If there is really none, it could be a software emulation of GPU that is built in inside firefox.

Web pages that use WebGL are scarce. If the ppage needs it, then you need to have GPU enabled. SVG is not hardware accelerated and is often a better choice on web pages.
MagicPoulp
 
Posts: 377
Joined: 2018-11-05 21:30

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-21 16:38

It turns out that there's a software solution. Something called Swiftshader that Google has open sourced. It's how snap chromium is showing those graphs. Here's the chromium blog talking about SwiftShader.

https://blog.chromium.org/2016/06/unive ... hader.html

In snap chromium when you look at chrome://gpu when you look under Driver Information and then GL_RENDERER it says Google SwiftShader. And under Graphics Feature Status it says

Code: Select all
WebGL: Software only, hardware acceleration unavailable
WebGL2: Software only, hardware acceleration unavailable


Whereas in Debian chromium it says Disabled (both with hardware acceleration disabled)


Here's a Debian maintainer talking about Swiftshader. He's advocating for including it with chromium-browser.

SwiftShader is a high-performance CPU-based implementation of the
OpenGL ES and Direct3D 9 graphics APIs. Its goal is to provide
hardware independence for advanced 3D graphics.

On GNU/Linux platforms, it will only provide an OpenGL ES
implementation and not Direct3D 9.

It is concretely useful for running OpenGL-based on systems with
decent CPU but without dedicated graphics hardware. For example,
running anbox with the --software-rendering argument.

Note that there is already a copy of SwiftShader in debian, in the
chromium-browser sources at third_party/swiftshader. (another copy
exists in qtwebengin-opensource-src, embedded itself in an embedded
copy of chromium.


https://bugs.debian.org/cgi-bin/bugrepo ... bug=909156

I don't know if it's possible to use these swiftshader sources in Debian that he mentions.

Google has a way to compile swiftshader libraries at the following site.

https://swiftshader.googlesource.com/SwiftShader

I gave this a shot but one of the files (vk-unittests) seems to be missing. You git clone the folder SwiftShader.

Code: Select all
git clone https://swiftshader.googlesource.com/SwiftShader


Then follow the instructions

Code: Select all
cd build
cmake ..
make --jobs=8

./vk-unittests

"build" seems to have to be SwiftShader/build but there is no vk-unittests (once you run make --jobs=8). There's a vk-unittests.dir folder embeded deep in the folder system but that's it.

Then you have to tell chromium where to find the libraries.

On Linux, the LD_LIBRARY_PATH environment variable or -rpath linker option can be used to direct applications to search for shared libraries in the indicated directory first.


It's worth pointing out that if you download the .deb package for Chrome and extract its contents that the directory opt/google/chrome contains the directory swiftshader which itself contains the files libEGL.so and libGLESv2.so. I thought that maybe you could copy that directory swiftshader to /usr/lib/chromium like you do with WidevineCdm but it didn't work.
Last edited by Shamak on 2020-07-21 19:06, edited 9 times in total.
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-21 16:43

MagicPoulp wrote:Your firefox mentions gpu stuff because all processors usually have integrated graphics. If there is really none, it could be a software emulation of GPU that is built in inside firefox.

I think it's Mesa. In about:support under WebGL 1 Driver Version it says 3.1 Mesa 18.3.6. And under WebGL 2 Driver Version it says 3.3 (Core Profile) Mesa 18.3.6.

I also found this. But I have no idea if this is what's going on.

OpenSWR provides a high performance, highly scalable OpenGL-compatible software rasterizer that allows use of unmodified visualization software. This allows working with datasets when GPU hardware isn't available or is limiting. OpenSWR is completely CPU-based, and runs on anything from laptops to workstations to compute nodes in HPC systems.

OpenSWR internally builds on top of LLVM, and fully utilizes modern instruction sets like Intel® Advanced Vector Extensions (AVX, AVX2, and AVX512) to achieve high rendering performance. The charts below illustrate the compelling advantage of OpenSWR over Mesa llvmpipe in a real application scenario.

OpenSWR is now fully integrated into Mesa and provides a SWR renderer that supports much of the OpenGL 3.3 Core and OpenGL 3.0 Compatibility contexts. Standard Mesa environment variables provide the ability to run-time switch between OpenSWR and llvmpipe software renderers.


https://www.openswr.org/
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-21 17:24

I may hack at this Swiftshader thing some more but this is pretty much at the edge of what I can do. :) But it's interesting. I appreciate everyone's input!
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-21 20:45

stevepusser wrote:So the graphs work if you enable hardware acceleration? So...sort of fixed? Maybe someone makes an extension that lets you switch it on an off on the fly, if it doesn't need a restart.

I haven't found anything. Extensions, shortcuts, nothing.
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby stevepusser » 2020-07-22 02:43

If swiftshader is in the debian source, it may be as simple as enabling its build in the debian/rules file. But Chromium is a looong build unless you have a modern machine with lots of cores and speed.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: LibreOffice 7.0.0, QMPlay2 20.07.04, Pale Moon 28.12.0, KeepassXC 2.6.0, Arqiver 0.6.0+git, Foliate 2.4.2
User avatar
stevepusser
 
Posts: 11891
Joined: 2009-10-06 05:53

Re: Some graphs don't display on chromium on latimes.com

Postby MagicPoulp » 2020-07-22 05:36

Even with bugs, an open source chromium is preferable to a proprietary chrome with all the tracking and secret stuff in it.
MagicPoulp
 
Posts: 377
Joined: 2018-11-05 21:30

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-22 20:13

stevepusser wrote:If swiftshader is in the debian source, it may be as simple as enabling its build in the debian/rules file. But Chromium is a looong build unless you have a modern machine with lots of cores and speed.

I was on Arch for a little while and there was one package I needed that required about 13 hours to compile. I could reduce that to about 6 hours by forcing both cores to work simultaneously. So I don't think I'm into this enough to keep going being as I have a way to view these types of graphs in chromium or can switch to firefox.

EDIT: The following two paragraphs are a lot of words for asking if it's even feasible to try to make stock Buster chromium work with swiftshader.

I've seen a couple of posts on stack exchange from 5 years ago claiming that chromium had to be recompiled to make it work with Widevine. Can I assume it's the same with swiftshader? That if chromium hasn't been compiled in such a way to support swiftshader that it simply won't work no matter what I do? I've compiled those libraries I mentioned earlier. I've set the environment variable LD_LIBRARY_PATH. I've tried setting flags like --use-gl=swiftshader --blacklist-accelerated-compositing --blacklist-webgl --disable-gpu --swiftshader --swiftshader-webgl. But none of that matters if the swiftshader build was not enabled in the debian/rules file. Do I have that right?

It seems like swiftshader was not enabled in Buster chromium. There'd be no reason to not include the .so files contained in opt/google/chrome/swiftshader (from the chrome .deb file) with chromium. Swiftshader is open source and the .so files were included with snap chromium. It doesn't make sense to me that it would be enabled in Buster chromium but then leave finishing the work to the user. Does this seem reasonable?
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-23 16:08

Shamak wrote:EDIT: The following two paragraphs are a lot of words for asking if it's even feasible to try to make stock Buster chromium work with swiftshader.

I've seen a couple of posts on stack exchange from 5 years ago claiming that chromium had to be recompiled to make it work with Widevine. Can I assume it's the same with swiftshader? That if chromium hasn't been compiled in such a way to support swiftshader that it simply won't work no matter what I do? I've compiled those libraries I mentioned earlier. I've set the environment variable LD_LIBRARY_PATH. I've tried setting flags like --use-gl=swiftshader --blacklist-accelerated-compositing --blacklist-webgl --disable-gpu --swiftshader --swiftshader-webgl. But none of that matters if the swiftshader build was not enabled in the debian/rules file. Do I have that right?

It seems like swiftshader was not enabled in Buster chromium. There'd be no reason to not include the .so files contained in opt/google/chrome/swiftshader (from the chrome .deb file) with chromium. Swiftshader is open source and the .so files were included with snap chromium. It doesn't make sense to me that it would be enabled in Buster chromium but then leave finishing the work to the user. Does this seem reasonable?

Apparently, this is the case. You can build chromium with either of the rules enable_swiftshader=false or enable_swiftshader=true.

Here's the rules list for chromium-browser 70.0.3538.110-1deb9u1 which has enable_swiftshader=false.

https://tracker.debian.org/media/packag ... 10-1deb9u1

I haven't found the rules for the current build of chromium. I can say that when I extract the .deb package there are no swiftshader libraries (.so files) included as there are in the chrome extracts and in the installation directory (not sure if that's what it's called) of snap chromium.

I did find swiftshader_tests_main.cc listed in the source code of chromium. I don't know if this indicates that swiftshader is part of Buster chromium.

https://sources.debian.org/src/chromium ... s_main.cc/
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-23 20:19

So I don't think swiftshader is enabled in Debian chromium. Let me know if I'm reading this wrong as this is my first exposure to this kind of thing.

It's listed in the sources for chromium under third_party.

https://codesearch.debian.net/search?q= ... &literal=0

Whereas it is not listed in the source code for the Debian package under third_party.

https://sources.debian.org/src/chromium ... ird_party/

Now just to check myself I checked out widevine which I know works in my copy of chromium.

Here are the sources for chromium which list widevine under third_party again.

https://codesearch.debian.net/search?q= ... &literal=0

And here it is listed in the source code for the Debian package also under third_party.

https://sources.debian.org/src/chromium ... ird_party/

So I think I can successfully conclude that chromium does not come bundled with swiftshader on Debian and there's nothing I can do to fix that short of compiling my own copy.
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby stevepusser » 2020-07-24 05:28

Debian removes a huge amount of files from the Chromium "lite" source tarball before recompressing it, or otherwise it would be about 750 MB instead of 300. They are listed in the debian/copyright file. Ungoogled-chromium doesn't do that on the openSUSE Build Service, but I don't think they enable swiftshader either, let me look at their rules file later. But I think for sure that the patch you mentioned needs to be applied, to the swiftshader source, or else it would build its own llvm compiler, which takes about as long as Chromium itself.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: LibreOffice 7.0.0, QMPlay2 20.07.04, Pale Moon 28.12.0, KeepassXC 2.6.0, Arqiver 0.6.0+git, Foliate 2.4.2
User avatar
stevepusser
 
Posts: 11891
Joined: 2009-10-06 05:53

Re: Some graphs don't display on chromium on latimes.com

Postby Shamak » 2020-07-28 22:07

stevepusser wrote:So the graphs work if you enable hardware acceleration? So...sort of fixed? Maybe someone makes an extension that lets you switch it on an off on the fly, if it doesn't need a restart.

What I discovered is I can make a bookmark to the address chrome://settings/system which takes me right to the hardware acceleration toggle. So that's pretty quick.
Shamak
 
Posts: 20
Joined: 2018-04-14 00:33

Re: Some graphs don't display on chromium on latimes.com

Postby stevepusser » 2020-07-29 02:15

The rules file is not in the orig source tarball, it's in the debian.tar.xz file that is generated by the build.

Yeah, two cores would take forever to build Chromium. Even eight threads takes a long long time on the OBS, but at least it's just "upload three source files and check later": https://build.opensuse.org/package/show ... m/chromium

There's a newer Chromium in Debian Experimental now. I'll take a look at it concerning swiftshader.
The MX Linux repositories: Backports galore! If we don't have something, just ask and we'll try--we like challenges. New packages: LibreOffice 7.0.0, QMPlay2 20.07.04, Pale Moon 28.12.0, KeepassXC 2.6.0, Arqiver 0.6.0+git, Foliate 2.4.2
User avatar
stevepusser
 
Posts: 11891
Joined: 2009-10-06 05:53

Previous

Return to General Questions

Who is online

Users browsing this forum: No registered users and 6 guests

fashionable