User avatar
Botspot
Posts: 205
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas

Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Wed Jul 03, 2019 8:03 pm

I tried out Scratch 3 on the latest image of chromebook OS for Raspberry Pi, to see if Scratch 3 would work better than it currently does on Raspbian.
Well, it does! In fact, the graphics performance was equivalent to my $400 windows laptop!

On Raspbian: (slow and laggy)
Image

On Chromebook OS: video link Perfectly smooth, not slow or laggy.

What made the difference? If I understand correctly, Chromebook OS is hardware accelerated, Chromium in Raspbian is not.
Below is a screenshot of chrome://gpu in Raspbian Stretch:
Image

Doesn't look too good.
Now what does chrome://gpu look like on chromebook OS?
Image

Less red, more green. I think WebGL and WebGL2 are make the most difference in terms of Scratch 3.

So we know chromebook OS runs Scratch 3 better than Chromium in Raspbian. And we think that it is due to WebGL being hardware accelerated.
Here is my question: Can we figure out how chromebook OS's hardware acceleration works, and then take that knowledge and apply it to chromium-browser in Raspbian?
My doctor told me my brain is as useful as a Raspberry Pi. Is that a compliment?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Wed Jul 03, 2019 9:37 pm

Has already been done. Minor bug fix to Chromium in the offing and all will work fine.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
Botspot
Posts: 205
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Thu Jul 04, 2019 7:33 pm

jamesh wrote:
Wed Jul 03, 2019 9:37 pm
Has already been done.
Uhh, what has been done?
jamesh wrote:
Wed Jul 03, 2019 9:37 pm
Minor bug fix to Chromium in the offing and all will work fine.
Really? What kind of bug fix? I'm sure many folks in the scratch forum would like to hear about this.
My doctor told me my brain is as useful as a Raspberry Pi. Is that a compliment?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Fri Jul 05, 2019 9:06 am

Scratch 3 on the Pi4 runs very well, we've been testing for some time. Once the GPU acceleration fix is released it will be even quicker.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
Botspot
Posts: 205
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Fri Jul 05, 2019 12:36 pm

jamesh wrote:
Fri Jul 05, 2019 9:06 am
Scratch 3 on the Pi4 runs very well, we've been testing for some time. Once the GPU acceleration fix is released it will be even quicker.
OK, but is there any plan to GPU accelerate WebGL for the Pi3?
My doctor told me my brain is as useful as a Raspberry Pi. Is that a compliment?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Fri Jul 05, 2019 1:19 pm

Botspot wrote:
Fri Jul 05, 2019 12:36 pm
jamesh wrote:
Fri Jul 05, 2019 9:06 am
Scratch 3 on the Pi4 runs very well, we've been testing for some time. Once the GPU acceleration fix is released it will be even quicker.
OK, but is there any plan to GPU accelerate WebGL for the Pi3?
Try turning on the FKMS driver which will turn on WebGL in Chromium on the Pi3 as well as the Ppi4. Obviously, the Pi4 is faster!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

User avatar
Botspot
Posts: 205
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Fri Jul 05, 2019 1:47 pm

jamesh wrote:
Fri Jul 05, 2019 1:19 pm
Botspot wrote:
Fri Jul 05, 2019 12:36 pm
jamesh wrote:
Fri Jul 05, 2019 9:06 am
Scratch 3 on the Pi4 runs very well, we've been testing for some time. Once the GPU acceleration fix is released it will be even quicker.
OK, but is there any plan to GPU accelerate WebGL for the Pi3?
Try turning on the FKMS driver which will turn on WebGL in Chromium on the Pi3 as well as the Ppi4. Obviously, the Pi4 is faster!
Couldn't find much information on the FKMS driver, but I did these two things:
  • enabled "OpenGL desktop driver with full KMS" in raspi-config.
    2019-07-05-082351_1280x1024_scrot.png
    2019-07-05-082351_1280x1024_scrot.png (14.25 KiB) Viewed 3929 times
  • added this line

    Code: Select all

    dtoverlay=vc4-kms-v3d
    to /boot/config.txt
Rebooted and now Scratch 3 runs *almost* as fast as it did on chromebook OS. 8-)
Now, are there any disadvantages to using dtoverlay=vc4-kms-v3d?
My doctor told me my brain is as useful as a Raspberry Pi. Is that a compliment?

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24133
Joined: Sat Jul 30, 2011 7:41 pm

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Fri Jul 05, 2019 1:50 pm

You really need the fake KMS option, that the one where a load of work has been done. However, if something works for you, go for it until it doesn't work for you!
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

sits
Posts: 1
Joined: Mon Jul 15, 2019 11:37 am

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Mon Jul 15, 2019 11:46 am

I tried using the "Fake KMS" (and the full one) on my RPi3 but after a reboot I get this error from chromium. Any ideas? I done an update already.

bootstrap_helper: /usr/lib/chromium-browser/nacl_helper: Cannot open ELF file! errno=2
[1:1:0715/201124.275136:ERROR:nacl_fork_delegate_linux.cc(315)] Bad NaCl helper startup ack (0 bytes)
[2065:2065:0715/201125.233912:ERROR:gl_surface_glx.cc(411)] GLX 1.3 or later is required.
[2065:2065:0715/201125.234092:ERROR:gl_initializer_x11.cc(130)] GLSurfaceGLX::InitializeOneOff failed.
[2065:2065:0715/201125.322335:ERROR:gpu_child_thread.cc(327)] Exiting GPU process due to errors during initialization

User avatar
Botspot
Posts: 205
Joined: Thu Jan 17, 2019 9:47 pm
Location: Texas

Re: Chromebook OS runs Scratch 3 EFFORTLESSLY on Pi 3B. Can we improve chromium?

Mon Jul 15, 2019 12:30 pm

sits wrote:
Mon Jul 15, 2019 11:46 am
I tried using the "Fake KMS" (and the full one) on my RPi3 but after a reboot I get this error from chromium. Any ideas? I done an update already.

bootstrap_helper: /usr/lib/chromium-browser/nacl_helper: Cannot open ELF file! errno=2
[1:1:0715/201124.275136:ERROR:nacl_fork_delegate_linux.cc(315)] Bad NaCl helper startup ack (0 bytes)
[2065:2065:0715/201125.233912:ERROR:gl_surface_glx.cc(411)] GLX 1.3 or later is required.
[2065:2065:0715/201125.234092:ERROR:gl_initializer_x11.cc(130)] GLSurfaceGLX::InitializeOneOff failed.
[2065:2065:0715/201125.322335:ERROR:gpu_child_thread.cc(327)] Exiting GPU process due to errors during initialization
OK so you got some errors from chromium. Does Chromium start?

What version of Raspbian? Buster or Stretch?
Try using fake KMS on a fresh image and see if the result is different or not.
My doctor told me my brain is as useful as a Raspberry Pi. Is that a compliment?

Return to “Scratch”