Chromium snap on Jammy system with nvidia-510 does not start
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
In Progress
|
Critical
|
Unassigned |
Bug Description
Launching chromium takes several seconds before it gives me a window that i can interact with.
Debugging information linked below
$ snap version
snap 2.55.2+22.04
snapd 2.55.2+22.04
series 16
ubuntu 22.04
kernel 5.15.0-23-generic
$ snap list chromium
Name Version Rev Tracking Publisher Notes
chromium 101.0.4929.5 1938 latest/edge canonical✓ -
$ snap connections chromium | pastebinit
https:/
$ SNAPD_DEBUG=1 snap run chromium | pastebinit
description: | updated |
description: | updated |
Adam Collard (adam-collard) wrote (last edit ): | #1 |
Adam Collard (adam-collard) wrote : | #2 |
$ sudo dmesg | tail
[160954.022934] audit: type=1400 audit(164932277
[161015.528950] audit: type=1400 audit(164932283
[161015.589108] audit: type=1400 audit(164932283
[161016.174001] audit: type=1326 audit(164932283
[161016.205311] audit: type=1400 audit(164932283
[161016.355907] audit: type=1326 audit(164932283
[161016.357892] audit: type=1326 audit(164932283
[161016.634361] audit: type=1326 audit(164932283
[161018.481594] audit: type=1400 audit(164932284
[161018.535646] audit: type=1400 audit(164932284
Adam Collard (adam-collard) wrote : | #3 |
Tried installing chromium in `--devmode` to eliminate some complexity
https:/
Adam Collard (adam-collard) wrote : | #4 |
@mvo asked me to try this with a build from https:/
Unfortunately i see no change, and still have no usable browser
Here is SNAPD_DEBUG=1 timeout 5 snap run chromium
https:/
$ snap version
snap 2.55.3+
snapd 2.55.3+
series 16
ubuntu 22.04
kernel 5.15.0-25-generic
Michael Vogt (mvo) wrote : | #5 |
There is a new debug log now:
https:/
Michael Vogt (mvo) wrote : | #6 |
So just to summarize the results so far:
1. https:/
(the log indicates the libs get put into the right place)
2. "snap run --strace chromium" shows a bunch of
"openat(
But those seem to be red-herrings because in devmode things still do not work
3. installing the chromium snap in devmode with the "nvidia-510" branch does not help either
Some dmesg message got observed that may give us hints:
- traps: chrome[53956] trap int3 ip:558eaf942804 sp:7ffd447b2b10 error:0 in chrome[
- audit: type=1400 audit(164995345
summary: |
- Painfully slow startup for Chromium snap on Jammy system with NVidia GPU + Chromium snap on Jammy system with nvidia-510 does not start |
Changed in snapd: | |
status: | New → In Progress |
importance: | Undecided → Critical |
Michael Vogt (mvo) wrote : | #7 |
Extra data points:
- firefox snap work for Adam
- glarea-example works fine for Adam
Adam Collard (adam-collard) wrote : | #8 |
Note, glarea-example shows
`libEGL warning: DRI2: failed to create dri screen`
Michael Vogt (mvo) wrote : | #9 |
One (hopefully smaller/easier) reproducer is:
```
acollard@
libEGL warning: DRI2: failed to create dri screen
```
Zygmunt Krynicki (zyga) wrote : | #10 |
I've reproduced this on Ubuntu 22.04 (updated from 20.04) with an RTX 2080 running with 510 nvidia drivers and 5.15 kernel.
There's a few apparmor denials but the key bug, seems to be, that chromium tries to load nvidia_dri.so from a directory where that file is not present.
In my case, at runtime, from snap's POV, in devmode, it failed to load:
/snap/chromium/
The directory had a bunch of files for nouveau, intel and radeon but nothing for nvidia proprietary driver.
Maciej Borzecki (maciek-borzecki) wrote : | #11 |
Maciej Borzecki (maciek-borzecki) wrote : | #12 |
I've attached a strace dump from Zyga. Looking at the dump there's a bunch of loads of nvidia related files, all of which are successful:
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] <... openat resumed>) = 20
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] <... openat resumed>) = 20
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] openat(AT_FDCWD, "/proc/
[pid 3977] openat(AT_FDCWD, "/dev/nvidia0", O_RDWR|O_CLOEXEC) = 21
[pid 3977] openat(AT_FDCWD, "/dev/nvidiactl", O_RDWR <unfinished ...>
[pid 3977] <... openat resumed>) = 25
[pid 3977] openat(AT_FDCWD, "/dev/nvidia-
But lastly, there's this odd piece, where it clearly tries to load Mesa's driver for nvidia and obviously fails (strace seems to be confused about what happens here):
[pid 3977] openat(AT_FDCWD, "/snap/
[pid 3977] --- SIGSYS {si_signo=SIGSYS, si_code=
[pid 3890] openat(AT_FDCWD, "/snap/
[pid 3977] openat(AT_FDCWD, "/snap/
[pid 3977] --- SIGSYS {si_signo=SIGSYS, si_code=
MESA-LOADER: failed to open nvidia-drm: /snap/chromium/
[pid 3890] openat(AT_FDCWD, "/snap/
) = -1 ENOENT (Nie ma takiego pliku ani katalogu)
So the questions are:
1. why nvidia doesn't work despite all libs being loaded, /dev/nvidia0 and /dev/nvidiactl being opened
2. why it even tries to load mesa drivers
Olivier Tilloy (osomon) wrote : | #13 |
Can someone who observes the issue on their system run the application with LIBGL_DEBUG=verbose and share the output here?
LIBGL_
Without any further investigation, it looks like this could be a similar problem to bug #1947180, where the snapcraft desktop extension unconditionally overrides LIBGL_DRIVERS_PATH.
Adam Collard (adam-collard) wrote : | #14 |
$ LIBGL_DEBUG=verbose snap run chromium
Gtk-Message: 15:40:53.159: Failed to load module "canberra-
Gtk-Message: 15:40:53.161: Failed to load module "canberra-
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/acollard/
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /snap/chromium/
failed to load driver: nvidia-drm
MESA-LOADER: failed to open kms_swrast: /snap/chromium/
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /snap/chromium/
failed to load swrast driver
Olivier Tilloy (osomon) wrote : | #15 |
> search paths /snap/chromium/
seems to confirm my suspicions: the snapcraft desktop extension sets the value of LIBGL_DRIVERS_PATH to a single path within the gnome platform snap, thus preventing mesa from locating nvidia-drm_dri.so elsewhere.
Adam Collard (adam-collard) wrote : | #16 |
I note that vanilla chrome binary downloaded from upstream also hits failures to find nvidia-drm and friends (but does give me a usable browser, with video chat etc.)
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /usr/lib/
failed to load driver: nvidia-drm
MESA-LOADER: failed to open kms_swrast: /usr/lib/
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /usr/lib/
failed to load swrast driver
James Henstridge (jamesh) wrote : | #17 |
I think trying to the Mesa errors and "nvidia-drm_dri.so not found" errors are a red herring here. They indicate that Chromium is trying to use the Mesa user space GL driver, when it should be using the Nvidia user space GL driver.
As for why Firefox might work but Chromium fails, one big difference is that Firefox is a Wayland app and Chromium is an X11 app. The GLVND driver multiplexer uses different methods to pick a driver on the different window systems.
My first guess is that it is trying to dlopen() the libGLX_nvidia.so.0. If that fails, it might fall back to libGLX_mesa.so.0 and give us all these other errors. The dlopen() could fail if a library dependency is missing within the sandbox, or a library is too old.
The 510 GL driver package adds a dependency on libdrm2 and libgbm1, so perhaps it relies on something added since 20.04.
I also notice that the new driver drops files in /usr/share/
Maciej Borzecki (maciek-borzecki) wrote : | #18 |
Though in the strace log, there are multiple refernces where libGLX_nvidia is clearly opened:
[pid 3977] openat(AT_FDCWD, "/var/lib/
[pid 3977] openat(AT_FDCWD, "/var/lib/
at least we know that the library is there and is accessible. I could not find a matching close on that fd number, so most likely it remained, so I'm guessing that dlopen(), if it was used, did not fail as I would expect some cleanup to happen.
James Henstridge (jamesh) wrote : | #19 |
I was wrong about it trying to use libGLX_mesa.so. I can see the same "MESA-LOADER:" message strings in libgbm, so that's presumably where they're coming from.
I think there are multiple parts to this problem:
1. If we had a newer libgbm inside the sandbox, it would instead be searching for nvidia-drm_gbm.so.
2. The nvidia-drm_gbm.so file is packaged as https:/
3. A different set of fixes will be necessary for Wayland apps (or Chromium when we stop forcing it to use X11).
For (1), we'd need a newer Mesa in the gnome-3-38-2004 platform snap. At the moment it is just bundling Focal's Mesa, so if there are plans to do an HWE backport at some point, we might be able to benefit from that.
For (2) and (3), it'll likely require some changes to snap-confine to make the new library and data files available (probably in a few new subdirs of /var/lib/
With the Nvidia drivers now making use of some Mesa components, this basically means that there will likely be a minimum Mesa version requirement within the sandbox. It also looks like there are some open source components (e.g. https:/
Adam Collard (adam-collard) wrote : | #20 |
I am no longer hitting this problem
$ snap version
snap 2.55.3+
snapd 2.55.3+
series 16
ubuntu 22.04
kernel 5.15.0-25-generic
$ snap info chromium
name: chromium
summary: Chromium web browser, open-source version of Chrome
publisher: Canonical✓
store-url: https:/
contact: https:/
license: unset
description: |
An open-source browser project that aims to build a safer, faster, and more
stable way for all Internet users to experience the web.
commands:
- chromium.
- chromium
snap-id: XKEcBqPM06H1Z7z
tracking: latest/stable
refresh-date: 15 days ago, at 17:21 BST
channels:
latest/stable: 101.0.4951.41 2022-04-26 (1973) 139MB -
latest/candidate: 101.0.4951.41 2022-04-26 (1973) 139MB -
latest/beta: 101.0.4951.41 2022-04-21 (1973) 139MB -
latest/edge: 102.0.5005.22 2022-04-27 (1977) 138MB -
installed: 100.0.4896.88 (1961) 137MB devmode
zagglez (zagglez) wrote : | #21 |
I am getting the error though - window launches, no content painted at all.
LIBGL_DEBUG=verbose snap run chromium
Gtk-Message: 14:44:58.908: Failed to load module "canberra-
Gtk-Message: 14:44:58.908: Failed to load module "canberra-
libGL: Can't open configuration file /home/mike/
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open nvidia-drm: /snap/chromium/
failed to load driver: nvidia-drm
MESA-LOADER: failed to open kms_swrast: /snap/chromium/
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: /snap/chromium/
failed to load swrast driver
LibGL: Can't open configuration file /home/mike/
actually there is no such file present.
snap 2.57.2
snapd 2.57.2
series 16
ubuntu 22.04
kernel 5.15.0-48-generic
name: chromium
summary: Chromium web browser, open-source version of Chrome
publisher: Canonical✓
store-url: https:/
contact: https:/
license: unset
description: |
An open-source browser project that aims to build a safer, faster, and more
stable way for all Internet users to experience the web.
commands:
- chromium.
- chromium
snap-id: XKEcBqPM06H1Z7z
tracking: latest/stable
refresh-date: 3 days ago, at 13:16 BST
channels:
latest/stable: 106.0.5249.91 2022-10-04 (2117) 150MB -
latest/candidate: 106.0.5249.103 2022-10-06 (2125) 150MB -
latest/beta: 107.0.5304.29 2022-10-07 (2128) 152MB -
latest/edge: 108.0.5327.0 2022-10-03 (2122) 153MB -
installed: 106.0.5249.91 (2117) 150MB -
zagglez (zagglez) wrote : | #22 |
That's under Wayland. Runs fine under X11.
zagglez (zagglez) wrote : | #23 |
Nvidia driver version: 515.65.01
zagglez (zagglez) wrote : | #24 |
solution thanks to https:/
First launch chromium with this command (only needed once) from a terminal
$ chromium --enable-
Then change the ozone-platform-hint setting by typing into the browser location bar:
chrome:
And change the value from "default" to "auto"
BTW on nvidia I get loads of DRI related errors and messages about stopping use of gpu
which not surprisingly disappear if I disable hardware acceleration in the browser settings panel (system, hardware acceleration) - sad not to be able to use the GPU for chromium - sigh.
Once the ozone platform hint has been set, you can just launch chromium as normal, ie without the UseOzonePlatform feature - eg from the terminal using:
$ chromium
zagglez (zagglez) wrote : | #25 |
Though that doesn't fix these messages if GPU acceleration is enabled:
[88044:
libEGL warning: DRI2: failed to create dri screen
[88044:
[88044:
[88160:
libEGL warning: DRI2: failed to create dri screen
[88160:
[88160:
[88104:
[87913:
[88256:
mike@thalia:~$ [91549:
libEGL warning: DRI2: failed to create dri screen
[91549:
[91549:
[91663:
libEGL warning: DRI2: failed to create dri screen
[91663:
[91663:
[91497:
[91758:
This got much worse after enabling proprietary drivers and leaves me with a completely unusable Chromium (no browser chrome painted, let alone content)
$ ubuntu-drivers devices pci0000: 00/0000: 00:01.0/ 0000:01: 00.0 == 00013C2sv000014 62sd00003160bc0 3sc00i00 driver- 510-server - distro non-free driver- 418-server - distro non-free driver- 450-server - distro non-free driver- 470-server - distro non-free xorg-video- nouveau - distro free builtin
== /sys/devices/
modalias : pci:v000010DEd0
vendor : NVIDIA Corporation
model : GM204 [GeForce GTX 970]
driver : nvidia-
driver : nvidia-driver-390 - distro non-free
driver : nvidia-
driver : nvidia-driver-510 - distro non-free recommended
driver : nvidia-
driver : nvidia-driver-470 - distro non-free
driver : nvidia-
driver : xserver-
$ ubuntu-drivers debug | grep 'installed: [^<]' 00013C2sv000014 62sd00003160bc0 3sc00i00 path: /sys/devices/ pci0000: 00/0000: 00:01.0/ 0000:01: 00.0 vendor: NVIDIA Corporation model: GM204 [GeForce GTX 970] support level: PB
nvidia-driver-510: installed: 510.60.02-0ubuntu1 available: 510.60.02-0ubuntu1 (auto-install) [distro] non-free modalias: pci:v000010DEd0
$ snap version
snap 2.55.2+22.04.1
snapd 2.55.2+22.04.1
series 16
ubuntu 22.04
kernel 5.15.0-23-generic
$ snap list chromium
Name Version Rev Tracking Publisher Notes
chromium 100.0.4896.60 1951 latest/stable canonical✓ -
snippet from SNAPD_DEBUG=1 snap run chromium ns.chromium user/1000/ doc:true] run/user/ 1000/doc/ by-app/ snap.chromium" dir:"/run/ user/1000/ doc" type:"none" opts:MS_BIND unparsed:"" (error: <nil>) identity uid:0 (change: no), gid:1000 (change: yes) identity uid:1000 (change: yes), gid:1000 (change: yes) snap/chromium/ 1951 chromium chromium snapd/seccomp/ bpf//snap. chromium. chromium. bin snapd/seccomp/ bpf/global. bin usr/lib/ snapd/snap- exec, /usr/lib/ snapd/snap- exec... ) gtk-module"
DEBUG: requesting changing of apparmor profile on next exec to snap-update-
change.go:566: DEBUG: desiredIDs: map[/run/
change.go:567: DEBUG: reuse: map[]
change.go:320: DEBUG: mount name:"/
DEBUG: snap-update-ns finished successfully
DEBUG: set_effective_
DEBUG: NOT preserving per-user mount namespace
DEBUG: releasing lock 7
DEBUG: sending command 0 to helper process (pid: 1601462)
DEBUG: waiting for response from helper
DEBUG: sanity timeout reset and disabled
DEBUG: helper process received command 0
DEBUG: helper process exiting
DEBUG: waiting for the helper process to exit
DEBUG: helper process exited normally
DEBUG: resetting PATH to values in sync with core snap
DEBUG: set_effective_
DEBUG: creating user data directory: /home/acollard/
DEBUG: requesting changing of apparmor profile on next exec to snap.chromium.
DEBUG: ruid: 1000, euid: 1000, suid: 0
DEBUG: setting capabilities bounding set
DEBUG: regaining SYS_ADMIN
DEBUG: loading bpf program for security tag snap.chromium.
DEBUG: read 6520 bytes from /var/lib/
DEBUG: read 152 bytes from /var/lib/
DEBUG: clearing SYS_ADMIN
DEBUG: execv(/
DEBUG: argv[1] = chromium
DEBUG: umask restored to 02
DEBUG: working directory restored to /home/acollard
Gtk-Message: 16:52:11.032: Failed to load module "canberra-
Gtk-Message: 16:52:11.033: Faile...