Firefox snap can't find GPU after updating to Ubuntu 24.10

After upgrading from Ubuntu 24.04 to 24.10 (which also seems to have updated the Nvidia drivers from 550 to 560), the Firefox snap seems to be falling back to software rendering. Non-snap Firefox doesn’t seem to be impacted, so I suspect that this is snap related somehow.

1 Like

In case this is relevant, my Nvidia GPU means that the Ubuntu upgrade also included switching from X11 to Wayland

On closer examination, I see

libEGL warning: egl: failed to create dri2 screen

In the logs, which seems probably related.

I’ve just tried to reproduce this on my noble system. I’ve updated to oracular using do-release-upgrade and … my oracular system hangs/crashes sometime during boot up, when plymouth runs. I have no picture on screen, cannot ping/ssh the system. I’ll debug later today and see what is going on with nvidia 560

So a little while later I managed to get my screen to work with a non-TV display. Having booted up I can run firefox normally with this set of snaps:

zyga@novigrad:~$ nvidia-smi 
Wed Oct 16 16:40:18 2024       
+-----------------------------------------------------------------------------------------+
| NVIDIA-SMI 560.35.03              Driver Version: 560.35.03      CUDA Version: 12.6     |
|-----------------------------------------+------------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id          Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |           Memory-Usage | GPU-Util  Compute M. |
|                                         |                        |               MIG M. |
|=========================================+========================+======================|
|   0  NVIDIA GeForce RTX 4080        Off |   00000000:0C:00.0  On |                  N/A |
|  0%   29C    P8              6W /  320W |     501MiB /  16376MiB |      7%      Default |
|                                         |                        |                  N/A |
+-----------------------------------------+------------------------+----------------------+
                                                                                         
+-----------------------------------------------------------------------------------------+
| Processes:                                                                              |
|  GPU   GI   CI        PID   Type   Process name                              GPU Memory |
|        ID   ID                                                               Usage      |
|=========================================================================================|
|    0   N/A  N/A      5973      G   /usr/bin/gnome-shell                          246MiB |
|    0   N/A  N/A      6930      G   /usr/bin/Xwayland                              46MiB |
|    0   N/A  N/A      7781      G   ...yeDropper --variations-seed-version        135MiB |
+-----------------------------------------------------------------------------------------+
zyga@novigrad:~$ snap list firefox 
Name     Version    Rev   Tracking         Publisher  Notes
firefox  131.0.3-1  5134  latest/stable/…  mozilla✓   -
zyga@novigrad:~$ snap connections firefox
Interface               Plug                             Slot                            Notes
alsa                    firefox:alsa                     -                               -
audio-playback          firefox:audio-playback           :audio-playback                 -
audio-record            firefox:audio-record             :audio-record                   -
avahi-observe           firefox:avahi-observe            :avahi-observe                  -
browser-support         firefox:browser-sandbox          :browser-support                -
camera                  firefox:camera                   :camera                         -
content[gnome-42-2204]  firefox:gnome-42-2204            gnome-42-2204:gnome-42-2204     -
content[gtk-3-themes]   firefox:gtk-3-themes             gtk-common-themes:gtk-3-themes  -
content[icon-themes]    firefox:icon-themes              gtk-common-themes:icon-themes   -
content[sound-themes]   firefox:sound-themes             gtk-common-themes:sound-themes  -
cups-control            firefox:cups-control             :cups-control                   -
cups-control            firefox:cups-control             cups:cups-control               -
dbus                    -                                firefox:dbus-daemon             -
desktop                 firefox:desktop                  :desktop                        -
desktop-legacy          firefox:desktop-legacy           :desktop-legacy                 -
gsettings               firefox:gsettings                :gsettings                      -
hardware-observe        firefox:hardware-observe         :hardware-observe               -
home                    firefox:home                     :home                           -
joystick                firefox:joystick                 :joystick                       -
login-session-observe   firefox:login-session-observe    :login-session-observe          -
mount-control           firefox:host-hunspell            :mount-control                  -
mpris                   -                                firefox:mpris                   -
network                 firefox:network                  :network                        -
network-bind            firefox:network-bind             :network-bind                   -
network-observe         firefox:network-observe          -                               -
opengl                  firefox:opengl                   :opengl                         -
pcscd                   firefox:pcscd                    -                               -
personal-files          firefox:dot-mozilla-firefox      :personal-files                 -
removable-media         firefox:removable-media          :removable-media                -
screen-inhibit-control  firefox:screen-inhibit-control   :screen-inhibit-control         -
system-files            firefox:etc-firefox              :system-files                   -
system-files            firefox:host-usr-share-hunspell  :system-files                   -
system-packages-doc     firefox:system-packages-doc      :system-packages-doc            -
u2f-devices             firefox:u2f-devices              :u2f-devices                    -
unity7                  firefox:unity7                   :unity7                         -
upower-observe          firefox:upower-observe           :upower-observe                 -
wayland                 firefox:wayland                  :wayland                        -
x11                     firefox:x11                      :x11                            -
zyga@novigrad:~$ snap list gtk-common-themes gnome-42-2204
Name               Version          Rev   Tracking         Publisher   Notes
gnome-42-2204      0+git.510a601    176   latest/stable/…  canonical✓  -
gtk-common-themes  0.1-92-g83a94a1  1536  latest/stable/…  canonical✓  -
zyga@novigrad:~$ snap version
snap    2.65.3+24.10
snapd   2.65.3+24.10
series  16
ubuntu  24.10
kernel  6.11.0-8-generic

EDIT: Note that I do see this error:

libEGL warning: egl: failed to create dri2 screen

It just doesn’t seem to prevent me from doing anything in practice.

Also this might be relevant:

zyga@novigrad:~$ echo $XDG_SESSION_TYPE 
wayland

After the upgrade to 24.10 using nvidia no longer requires me to fall back to x11.

To be clear, Firefox starts and runs fine, it’s just very slow because it’s fallen back to software rendering. You can check that it’s done this by looking for WebRender (Software) on about:support

After some additional testing, I’m pretty sure the combination of Nvidia, Snap, and Wayland is what is causing the GPU to not be found, but I haven’t tested it thoroughly enough to 100% confirm.

I am also having this issue. I have a nvidia card on a machine that previously ran Ubuntu 24.04 without problem. But, since upgrading to 24.10, I have noticed that snap-store and firefox fail to recognize the GPU. Firefox defaults to software rendering as aroskuski describes. WebGL websites fail to run in Firefox. For example, https://webglsamples.org/aquarium/aquarium.html does not work and says that it does not appear that my computer supports WebGL.

The snap-store opens a blank window that simply says “Unable to create a GL context”. The window does not even have a close button.

I assume, perhaps incorrectly, that these two problems are related. I haven’t tested other snaps that might expect GPU access.

This reddit post shows someone else having the problem and a comment includes a link to here as well as a launchpad bug report: https://www.reddit.com/r/Ubuntu/comments/1g24kii/unable_to_run_snap_store/

It seems that the snaps do utilize the GPU in a Wayland session, but not a X11 session. I haven’t previously had trouble with X11. With Ubuntu 24.10, I have the new problem snaps have trouble in X11 sessions and the old problem where some other applications I regularly use have trouble in wayland.

Yeah, so I’m now 100% convinced that the issue is that wayland apps can’t seem to find the Nvidia GPU when running under snap confinement for some reason. I tried installing the Godot engine snap, since I know how to swap that between x11 and wayland. If I run it normally (under x11), I see this:

$ snap run gd-godot-engine-snapcraft
Godot Engine v4.3.stable.mono.custom_build.77dcf97d8 (2024-08-14 23:00:16 UTC) - https://godotengine.org
OpenGL API 3.3.0 NVIDIA 560.35.03 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1080 Ti

If I enable the experimental wayland mode, I see this:

$ snap run gd-godot-engine-snapcraft --display-driver wayland
Godot Engine v4.3.stable.mono.custom_build.77dcf97d8 (2024-08-14 23:00:16 UTC) - https://godotengine.org
WARNING: Can't obtain the XDG decoration manager. Libdecor will be used for drawing CSDs, if available.
     at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3713)
libdecor-0.so.0: cannot open shared object file: No such file or directory
libEGL warning: egl: failed to create dri2 screen
libEGL warning: egl: failed to create dri2 screen
OpenGL API 4.5 (Core Profile) Mesa 23.2.1-1ubuntu3.1~22.04.2 - Compatibility - Using Device: Mesa - llvmpipe (LLVM 15.0.7, 256 bits)

And for the sake of comparison, here is what happens if I supply those flags to a separate download of the app not running under snap confinement.

$ ./Godot_v4.3-stable_linux.x86_64 --display-driver wayland
Godot Engine v4.3.stable.official.77dcf97d8 - https://godotengine.org
WARNING: Can't obtain the XDG decoration manager. Libdecor will be used for drawing CSDs, if available.
     at: init (platform/linuxbsd/wayland/wayland_thread.cpp:3713)
OpenGL API 3.3.0 NVIDIA 560.35.03 - Compatibility - Using Device: NVIDIA - NVIDIA GeForce GTX 1080 Ti

This seems to suggest that there’s globally some issue when you try to have snap + nvidia + wayland at the same time.

Hi !

Same issue here on my PC with a RTX 2080 and nvidia driver 560.35.03 from Ubuntu repo, on a fresh Ubuntu 24.10 install.

I filed a bug on Mozilla Bugzilla, if you want to comment or if you have any workaround : https://bugzilla.mozilla.org/show_bug.cgi?id=1928754

Thank you,

Alex

What would be the appropriate venue to file a bug to get this issue fixed in the snap isolation? I found Bug #2037544 “wayland + nvidia: driver not used when running in ...” : Bugs : snapd but that has seemingly been inactive for a year.

Software rendered Firefox is tolerable in small doses, but I’d at least like to know that the appropriate developers are aware of the issue, since it is pretty inconvenient sometimes, and this seems like a pretty critical issue with using Wayland sessions on Nvidia.

The problem is that libegl is broken inside snaps (again).

Firefox has a helper binary called glxtest. This program can be found at /snap/firefox/current/usr/lib/firefox/glxtest. You can run it on the host, and it will run fine, and output something like:

PCI_VENDOR_ID
0x10de
PCI_DEVICE_ID
0x2702
PCI_VENDOR_ID
0x1002
PCI_DEVICE_ID
0x13c0
VENDOR
NVIDIA Corporation
RENDERER
NVIDIA GeForce RTX 4080 SUPER/PCIe/SSE2
VERSION
4.6.0 NVIDIA 560.35.03
TFP
TRUE
DRM_RENDERDEVICE
/dev/dri/renderD128
MESA_VENDOR_ID
0x10de
MESA_DEVICE_ID
0x2702
DDX_DRIVER
NVIDIA-0;AMD Radeon Graphics @ pci:0000:71:00.0;
TEST_TYPE
EGL

But if you run it inside the snap container, by running snap run --shell firefox followed by /snap/firefox/current/usr/lib/firefox/glxtest, it outputs the following:

PCI_VENDOR_ID
0x10de
PCI_DEVICE_ID
0x2702
PCI_VENDOR_ID
0x1002
PCI_DEVICE_ID
0x13c0
WARNING
libEGL initialize failed
ERROR
X error, error_code=2, request_code=152, minor_code=3

At the same time, the following appears on dmesg:

[10981.700394] kauditd_printk_skb: 9 callbacks suppressed
[10981.700399] audit: type=1400 audit(1737224470.011:7852): apparmor="DENIED" operation="unlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:255" pid=31962 comm="glxtest" requested_mask="d" denied_mask="d" fsuid=1000 ouid=0
[10981.701211] audit: type=1400 audit(1737224470.012:7853): apparmor="DENIED" operation="unlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=31962 comm="glxtest" requested_mask="d" denied_mask="d" fsuid=1000 ouid=0
[10981.701218] audit: type=1400 audit(1737224470.012:7854): apparmor="DENIED" operation="unlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=31962 comm="glxtest" requested_mask="d" denied_mask="d" fsuid=1000 ouid=0
[10981.706467] audit: type=1400 audit(1737224470.018:7855): apparmor="DENIED" operation="unlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=31962 comm="glxtest" requested_mask="d" denied_mask="d" fsuid=1000 ouid=0
[10981.708786] audit: type=1400 audit(1737224470.020:7856): apparmor="DENIED" operation="unlink" class="file" profile="snap.firefox.firefox" name="/dev/char/195:0" pid=31962 comm="glxtest" requested_mask="d" denied_mask="d" fsuid=1000 ouid=0
[10981.714158] audit: type=1400 audit(1737224470.025:7857): apparmor="ALLOWED" operation="sendmsg" class="net" profile="Xorg" pid=31962 comm="glxtest" family="unix" sock_type="dgram" protocol=0 requested="receive" denied="receive" addr="@7661722F72756E2F6E76696469612D786472697665722D34653534613830610000000000000000000000000000000000000000000000000000000000000000" peer_addr=none peer="snap.firefox.firefox"
[10981.714213] audit: type=1400 audit(1737224470.025:7858): apparmor="ALLOWED" operation="sendmsg" class="net" profile="Xorg" pid=31962 comm="glxtest" family="unix" sock_type="dgram" protocol=0 requested="receive" denied="receive" addr="@7661722F72756E2F6E76696469612D786472697665722D34653534613830610000000000000000000000000000000000000000000000000000000000000000" peer_addr=none peer="snap.firefox.firefox"
[10981.714226] audit: type=1400 audit(1737224470.025:7859): apparmor="ALLOWED" operation="file_receive" class="net" profile="Xorg" pid=1829 comm="Xorg" family="unix" sock_type="stream" protocol=0 requested="send receive" denied="send receive" addr=none peer_addr=none peer="snap.firefox.firefox"
[10981.714228] audit: type=1400 audit(1737224470.025:7860): apparmor="DENIED" operation="file_receive" class="net" profile="snap.firefox.firefox" pid=1829 comm="Xorg" family="unix" sock_type="stream" protocol=0 requested="send receive" denied="send receive" addr=none peer_addr=none peer="Xorg"
[10981.714242] audit: type=1400 audit(1737224470.025:7861): apparmor="ALLOWED" operation="sendmsg" class="net" profile="Xorg" pid=31962 comm="glxtest" family="unix" sock_type="dgram" protocol=0 requested="receive" denied="receive" addr="@7661722F72756E2F6E76696469612D786472697665722D34653534613830610000000000000000000000000000000000000000000000000000000000000000" peer_addr=none peer="snap.firefox.firefox"

This exact same thing happened previously with the 545 driver: None of my snaps can find my GPU after upgrading to the Nvidia 545 drivers

A user reports that it started working with 545 after a snapd update. The Launchpad bug report for the issue with 545 remains open to this day, as does the Mozilla bug report.

Also note that GPU is not broken in all snaps. It works fine in Blender for example, which is a classic mode snap. This is therefore likely to be an over-confinement issue, like all issues that plague both flatpak and snap.

edit: The bug report mentioned on this thread, https://bugzilla.mozilla.org/show_bug.cgi?id=1928754, does seem to contain a functional workaround involving telling the firefox snap to use core24 as a base instead of the default core22, and the edge channel also apparently works, so this will likely be fixed soon.