Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 831947 - www-client/google-chrome: Accelerated compositing nonfunctional unless seccomp sandbox is disabled
Summary: www-client/google-chrome: Accelerated compositing nonfunctional unless seccom...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Chromium Project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-01-24 03:16 UTC by Andrew Athalye
Modified: 2022-02-09 08:05 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Athalye 2022-01-24 03:16:43 UTC
On an NVIDIA RTX 2070S running Sway with Nvidia-GBM, Google Chrome fails to initialise hardware-acceleration unless the seccomp bpf sandbox is disabled. Using a trunk build of Chromium, the failure message contains the characteristic keywords: "MESA-LOADER: failed to open ...: Unable to open shared object file: Permission denied." This seemed similar to selinux / flatpak sandbox-violation errors I had seen before on other systems, so I tried disabling the bpf sandbox, which caused the errors to disappear and acceleration to work as it does under X11 (correctly). On Google Chrome, the MESA error is not displayed, but the results are identical and the same resolution can be applied.

I am unsure if this bug should be submitted directly to the Chromium bug tracker, since I have no experience running NVIDIA + Wayland on distros other than Gentoo.

Reproducible: Always

Steps to Reproduce:
1. Run Google Chrome with the arguments "--ozone-platform=wayland"
2. Check the console and chrome://gpu
3. Observe the message "Hardware accelerated but at reduced performance" next to WebGL(2), and the Problem Detected "Gpu compositing has been disabled..."
Actual Results:  
The browser has reverted to software rendering and the above error message is displayed in chrome://gpu. There are also several errors in the console related to MESA-LOADER and CreateCommandBuffer if using Chromium instead of Google Chrome.

Expected Results:  
GPU Acceleration should work, provided that the NVIDIA Driver is installed with a version suitable for GBM / Mesa support.

On systems with XWayland, this can be avoided by using the X11 version of Chrome, however the Wayland version is functional with the workaround (disabling sandbox).

Firefox running in background,
Stable amd64 5.15 gentoo-sources with namespaces and BPF enabled,
NVIDIA RTX 2070S, Intel Xeon 2176G, 64GB RAM, Locale set to ru-RU

emerge --info
Portage 3.0.28 (python 3.9.9-final-0, default/linux/amd64/17.1/no-multilib/systemd, gcc-11.2.0, glibc-2.33-r7, 5.15.16-gentoo x86_64)
=================================================================
System uname: Linux-5.15.16-gentoo-x86_64-Intel-R-_Xeon-R-_E-2176G_CPU_@_3.70GHz-with-glibc2.33
KiB Mem:    65754876 total,  45512668 free
KiB Swap:   67108860 total,  67108860 free
Timestamp of repository gentoo: Sun, 23 Jan 2022 18:07:08 +0000
Head commit of repository gentoo: dc430f117f808c0b44a480efa72775494e28ac2e

Timestamp of repository guru: Sun, 23 Jan 2022 09:52:56 +0000
Head commit of repository guru: 5355ecc6ecfed682a1f24edc53e8024188ae7a07

sh bash 5.1_p8
ld GNU ld (Gentoo 2.37_p1 p0) 2.37
app-misc/pax-utils:        1.3.3::gentoo
app-shells/bash:           5.1_p8::gentoo
dev-lang/perl:             5.34.0-r6::gentoo
dev-lang/python:           3.9.9-r1::gentoo, 3.10.0_p1-r1::gentoo
dev-lang/rust:             1.58.1::gentoo
dev-util/cmake:            3.21.4::gentoo
dev-util/meson:            0.60.3::gentoo
sys-apps/baselayout:       2.7-r3::gentoo
sys-apps/sandbox:          2.25::gentoo
sys-apps/systemd:          249.9::gentoo
sys-devel/autoconf:        2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:        1.16.4::gentoo
sys-devel/binutils:        2.37_p1::gentoo
sys-devel/binutils-config: 5.4::gentoo
sys-devel/clang:           13.0.0::gentoo
sys-devel/gcc:             11.2.0::gentoo
sys-devel/gcc-config:      2.5-r1::gentoo
sys-devel/libtool:         2.4.6-r6::gentoo
sys-devel/lld:             13.0.0::gentoo
sys-devel/llvm:            13.0.0::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.33-r7::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

local
    location: /var/db/repos/local
    masters: gentoo

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE @BINARY-REDISTRIBUTABLE Canon-UFR-II google-chrome MSttfEULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O2 -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O2 -pipe"
GENTOO_MIRRORS="https://www.mirrorservice.org/sites/distfiles.gentoo.org/ rsync://rsync.mirrorservice.org/distfiles.gentoo.org/ rsync://rsync.gtlib.gatech.edu/gentoo https://gentoo.osuosl.org/ https://mirrors.rit.edu/gentoo/ rsync://mirrors.rit.edu/gentoo/"
LANG="ru_RU.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=mold"
MAKEOPTS="-j12"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
SHELL="/bin/fish"
USE="X a52 acl alsa amd64 bluetooth branding bzip2 cairo cdda cli crypt cups dbus dri dts dvd egl flac fortran gdbm gif gles2 gnome-keyring gpm gtk iconv icu ipv6 jpeg kms lcms libglvnd libnotify libtirpc mad mng mp3 mpeg ncurses nls nptl nvenc nvidia ogg opengl openmp pam pcre pdf pipewire png policykit pulseaudio readline sdl seccomp spell split-usr ssl svg systemd text tiff truetype udev udisks unicode usb v4l vaapi vdpau vorbis vulkan wayland x264 xattr xml xvid xvmc zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2020" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="mmx mmxext sse sse2" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="efi-64" INPUT_DEVICES="wacom" KERNEL="linux" L10N="ru ru-RU fr fr-FR en en-US" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26 ruby27" USERLAND="GNU" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LEX, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Stephan Hartmann (RETIRED) gentoo-dev 2022-01-24 11:53:10 UTC
Maybe https://crbug.com/1256824 ? The reporter claims that it works with current google-chrome-beta (M98).
Comment 2 Andrew Athalye 2022-01-24 22:44:37 UTC
I was able to reproduce it with Chromium from the appspot download site (basically the trunk build), however I'll check Google Chrome Beta to see if maybe they have some build flags enabled that make it work there.
Comment 3 Andrew Athalye 2022-01-24 22:47:23 UTC
(In reply to Andrew Athalye from comment #2)
> I was able to reproduce it with Chromium from the appspot download site
> (basically the trunk build), however I'll check Google Chrome Beta to see if
> maybe they have some build flags enabled that make it work there.

After a very brief check using www-client/google-chrome-beta, I was able to reproduce the same behaviour where Hardware compositing is only functional if the bpf sandbox is disabled. When I have some free time I'll look into the chromium source to see if a modification to the sandbox to exempt the syscall for loading the NVIDIA shared object files would work.
Comment 4 Andrew Athalye 2022-01-24 22:49:28 UTC
Just one final comment: in the Beta build I tried, Canvas was listed as hardware accelerated under Wayland in chrome://gpu, but Compositing was still software-only. This may be the change that the crbug was alluding to, as in the Chromium trunk build this was also the case. No hardware acceleration at all works by default in the stable build.
Comment 5 onkobu 2022-02-09 07:54:29 UTC
Have the same on an AMDGPU with google-chrome-98.0.4758.80 on X11. Works with google-chrome-beta-99.0.4844.17. 

Interestingly starts on a machine with nvidia-drivers-510.47.03. But freezes X11 then which has always been the case on that particular machine/ setup also with previous versions.
Comment 6 onkobu 2022-02-09 08:05:07 UTC
Forget about my comment #5, context totally wrong.