
Pixelbook and “Nami” Chromebooks the First to Get Linux GPU Acceleration - jmsflknr
https://www.aboutchromebooks.com/news/pixelbook-and-nami-chromebooks-the-first-to-get-linux-gpu-acceleration-in-project-crostini/
======
robert_foss
As a developer of this, it's built using Virgil3D[1], which is rather
interesting tech, that allows virtualized guests to get hardware accelerated
3D graphics.

It works by having the guest run a Mesa3D (Linux Userspace graphics) driver
called virgl in the guest, which takes all of the OpenGL/OpenGL ES commands
and send them through through Linux VirtIO[3] to the guest, where they are
executed by the virglrenderer[1] application as normal OpenGL / OpenGL ES
commands.

This let's you run whichever driver you want on the host, even proprietary
ones. And it allows you you to do transparent OpenGL <-> OpenGL ES
translation.

[1]
[https://gitlab.freedesktop.org/virgl/virglrenderer/](https://gitlab.freedesktop.org/virgl/virglrenderer/)

[2] [https://www.mesa3d.org/](https://www.mesa3d.org/)

[3] [https://lwn.net/Articles/239238/](https://lwn.net/Articles/239238/)

~~~
drcode
Does this mean it won't accelerate 2d graphics? Should I expect acceleration
in gimp/emacs/etc after the Crostini patch is available?

~~~
opencl
It'll accelerate 2D graphics that use OpenGL. GIMP and emacs don't use
hardware acceleration in the first place. Krita uses OpenGL to draw the canvas
so it will get accelerated.

~~~
drcode
> GIMP and emacs don't use hardware acceleration in the first place.

Honest question: On most OSes, don't regular drawing operations in these
programs (Bitblits, font renderings) typically use hardware acceleration
through the OS? On crostini, are these things currently done via pure CPU
operations, or are they already being mapped to hardware-accelerated API
calls, even before the new OpenGL support?

~~~
Jasper_
It's complicated and depends on a lot of things. On a typical Linux system,
bitblt (well, XCopyArea) and font rendering will go through XRender, which may
or may not use the GPU depending on driver support. On xf86-video-intel, it
will use SNA, which will use the 2D blitter on Intel chips. It's unmaintained
at this point and a bit buggy so some distros turn it off. Instead, one might
use glamor, which implements XRender on top of OpenGL, which will use the 3D
graphics hardware on Intel chips. So it depends on your system configuration.

For other operating systems, the words and details change, but the overall
idea of "it's complicated and depends on your driver and OS version and which
apps are running and phase of the moon" still applies.

------
jimmies
I am a hardcore Linux user. I went so far as buying Chromebooks to wipe
ChromeOS and run Linux on them in the last 5 years. As of late, I have decided
to leave ChromeOS alone on my new Pixelbook.

There are two reasons for that decision:

\- I just love having the ability to have a pen to draw when I needed to share
the screen to explain something for my friends when we talk about technical
crap. ChromeOS supports the pen reasonably well with its ability to run
Android apps.

\- The Linux emulation layer on ChromeOS is actually very good. I can run app-
get, gcc, Sublime text, Konsole and most of the apps I want to run.

I figured it is a good tradeoff between convenience and utility. I still have
to do my embedded work on my desktop which has a real distro. I am very glad
they are bringing the upcoming usb redirection support, so I can do embedded
work on my laptop. With GPU acceleration I can play games too, fantastic!

Hardware-wise, the Chromebook Pixel has been a disaster. Every once in a
while, the USB-C port just craps out completely and I had to do the SMC reset
procedure for it to work again. The other day, I left the laptop battery run
dry and when I plugged in to charge and tried to turn it on, the keyboard
would flicker like a discotheque with nothing on the screen for like 20
minutes when it was charging up. The hardware is just inconsistent and feels
flaky as heck.

But all in all, I am actually quite happy with my Pixelbook purchase. If the
hardware/firmware experience could improve a bit, then it would have been a
very, very good purchase despite all the hates from Youtube reviewers.

~~~
devereaux
Don't take it personally, but I think it is just growing older and getting
more busy with work, life etc.

The returns on investment on the time you spend tickering with your laptop are
lower - because you have other uses for your time, and because you have
expectations set in the past while ChomeOs keeps improving.

Now if you take a long sabbatical or go back to school, maybe you'll tinker
again!

~~~
fartcannon
Don't take it personal, but it's hardly a challenge. The process of download
and burn then reboot really taxes you?

~~~
devereaux
No, but the zillion little fixes sap a limited amount of energy

I wouldn't be satisfied unless I compiled an optimized kernel with almost no
module left, etc. This takes more time than I can allot

------
josteink
Does this mean Chromebooks have been running without HW acceleration all these
years?

Or is this about something else?

~~~
jimmies
No, the "real" ChromeOS has had acceleration all along. It is about the
Chromebooks getting HW acceleration for its virtualized Linux environment when
you want to run real Linux apps on it.

~~~
e12e
Thank you, now I understand the other comment here about the implementation
using virtualization - i felt i was missing a kernel/host in that explanation
- Linux running under Chrome os makes more sense :)

------
grondilu
Only slightly related, but I once had a chromebook I was very happy about,
until after a few years it just failed to boot. I've repaired many linux
laptops in my life, usually using an USB key to boot a live system and fix the
disk-drive or something. But with this chromebook, there was absolutely
nothing I could do. No access to something like a DOS or anything, nothing
booted from the USB port. Just a black screen.

I've never bought any chromebook since.

Was I just unlucky and should I git it an other try?

~~~
hawski
I had once an update that broke the system. Here are the instructions I used
to recover:
[https://support.google.com/chromebook/answer/1080595?hl=en](https://support.google.com/chromebook/answer/1080595?hl=en)

In short you need a pendrive and another computer with Chrome to to download a
recovery image and flash the pendrive. Afterwards use a key combo on
Chromebook and it should be fixed.

In my case it helped, but I retained this pendrive with instructions for my
wife if it would happen again (and she managed). I had to skip updates for
some time.

A lesson for me was to not buy an ARM Chromebook again.

------
bubblethink
This is all very cool stuff of course. Somewhat tangentially, I wonder if,
collectively, a lot of recent developments such as WSL and crostini push the
year of the linux desktop even further out. A new generation of people will
experience traditional GNU/linux as we know only in the context of walled
garden setups like windows, chromeos, and android (samsung dex I think has
something similar). Objectively, this is an improvement by most metrics.
However, it also means that this will be good enough for most people. I'm
worried that it may lead to even fewer resources and exposure to full blown
linux desktops. Canonical has also shifted focus away from desktop.

~~~
pjmlp
You are pretty much right, GNU/Linux as mass market desktop has lost its
opportunity.

ChromeOS market share is irrelevant outside North America, just check the
worldwide market share in your favourite source.

Only Android/Linux has really taken off and even there we still don't know
what are Google's plans regarding Fuchsia. It might pretty well be that some
future Android version will get a new kernel, announced at Google IO.

It is now quite common to attend Linux conferences just to watch the
presenters using macOS with a Linux distribution running either on a local or
remote VM.

Assuming WSL keeps improving, it wouldn't surprise me to see similar sessions
being done from a W10 laptop.

~~~
zozbot123
I agree that ChromeOS is largely irrelevant but IME, GNU/Linux is more popular
than ever on the desktop. The other operating systems in common use are all
terrible in their own ways, and users are increasingly aware that Linux may be
a meaningful alternative depending on their needs.

~~~
pjmlp
If by more popular than ever, you mean a bigger market share than on the
beginning of the century, yes that is quite true.

However since we are talking about graphics acceleration, not that much
looking at the Steam community numbers, or the posts from a couple of game
studios a couple of weeks back.

------
fhrow4484
This feature, along with the sound support, is what's gonna finally make the
pixelbook a game changer for Linux desktops. I can't wait for those, and the
pixelbook 2.

~~~
keypress
Sound support? I still have various sound issues on Debian, to the point I
just can't be bothered to sort it out. It kind of works.

~~~
fhrow4484
Sound support on crostini specifically:
[https://www.google.com/amp/s/amp.reddit.com/r/Crostini/comme...](https://www.google.com/amp/s/amp.reddit.com/r/Crostini/comments/95teyu/sound/)

Today Linux apps installed on chrome os don't have sound support yet.

------
pkulak
Wow, this is progressing much faster than I expected. I bought a Pixel on
discount a few months ago with the intention to set up my dev environment
(Docker, Java, Node, IDEs, etc) when hardware acceleration and Docker were
working. Time for me to get cracking!

~~~
puzzle
Hopefully this will allow applications like VS Code (Electron) to use straight
Wayland rather than the slower XWayland as they do now. Of course, it's pretty
amusing to have an embedded Chromium app running in a container inside a
Chromium OS.

~~~
pkulak
Electron doesn't use Wayland?

I just set it all up, got VS Code and IntelliJ running, and of the two, VS
Code looks the best. It's the only app I've seen that integrates the menu bar
items into the ChromeOS menu bar, which saves a lot of space and looks way
better.

~~~
puzzle
It's really an XWayland application, i.e. it uses X, whose protocol is
forwarded to Wayland. That's why in this article you need to pass -X to
Sommelier:

[https://medium.com/@kennethrohde/sharp-looking-vscode-on-
chr...](https://medium.com/@kennethrohde/sharp-looking-vscode-on-chrome-
os-e8edf7c1411d)

That post also highlights how, because it's not a Wayland native app, VSCode
will still look crummy when e.g. you use it on monitors with varying DPI. Real
Wayland apps have multiple, per-screen DPI settings:

[https://wiki.gnome.org/Initiatives/Wayland/XWayland](https://wiki.gnome.org/Initiatives/Wayland/XWayland)

"Multi DPI intends to allow clients to seamlessly move around on a display
with multiple monitors connected, where each monitor may have very different
DPIs, thus different scales, without any sudden size changes or glitches,
while at the same time allowing clients to switch between different scaling
factors."

------
hendry
Bought my dad a Spin 15 for Christmas. I wonder if that will get acceleration?

[https://www.youtube.com/watch?v=PK0dMnrKb_A](https://www.youtube.com/watch?v=PK0dMnrKb_A)

------
equalunique
I'm in as soon as Lenovo/HP/Dell introduces a 4GB+ RAM Chromebook with
TrackPoint/PointStick/TrackStick.

------
bibyte
I wish more Chromebooks would support Project Crostini. It would make a
perfect development environment for me.

------
hiccuphippo
How good is the Virtualized Linux Environmen for developmentt? Can I run stuff
like Docker on it?

~~~
williamstein
Docker mostly works. However, `sudo docker run -it centos bash` fails because
the centos image (as do many others) uses extended attributes, which are not
compatible with the underlying btrfs filesystem. In those cases, I've been
rebuilding the Docker images myself from source, when possible. It's
frustratingly close!

wstein@penguin:~$ sudo docker run -it centos bash

Unable to find image 'centos:latest' locally

latest: Pulling from library/centos

a02a4930cb5d: Extracting 75.17MB/75.17MB

docker: failed to register layer: ApplyLayer exit status 1

stdout: stderr: operation not permitted.

See 'docker run --help'.

~~~
cyphar
btrfs definitely supports extended attributes (and if it didn't you'd get
ENOTSUP not EPERM when trying to use them). It's far more likely this is
because you cannot set certain xattrs within a user namespace (such as some
security.* ones) -- and LXC is being used with user namespaces in ChromeOS.

In fact, I added code to Docker almost 4 years ago to ignore ENOTSUP on xattr
errors specifically because of filesystem support (AUFS was the issue at the
time). So if it was a support issue you wouldn't see it, because the code
already handles it. :P

~~~
williamstein
Thanks for the clarification. I love btrfs by the way.

~~~
zozbot123
I love btrfs, but I love my data even more.

------
pqz
Is there some way I could try ChromeOS on my regular PC? Inside VMware or
natively.

~~~
bubblethink
ChromeOS, no. ChromiumOS, yes. vmware/virtualbox, unlikely without hacking.
Qemu/kvm, yes in theory. Native, yes. Possible options for native: 1)
[https://arnoldthebat.co.uk/wordpress/chromium-
os/](https://arnoldthebat.co.uk/wordpress/chromium-os/) 2)
[https://www.neverware.com/](https://www.neverware.com/)

~~~
pqz
I see the ChromeOS team has their own set of scripts to run ChromeOS on KVM,
but they are Linux-only it seems. Bad luck :P

I also tried the first option for native but it froze while the "ChromiumOS"
logo was shown.

~~~
bubblethink
Try the second option (cloudready). It should have undergone more testing.

