I’m using electron-builder 19.49.2 with electron 1.8.1 and this is my snap config:
"snap": {
"confinement": "devmode",
"summary": "Powerful and easy-to-use photo editor.",
"grade": "devel",
"stagePackages": [
"default",
"libcanberra-gtk-module",
"unity-gtk-module-common",
"libvips42"
],
"plugs": [
"home",
"x11",
"unity7",
"browser-support",
"network",
"gsettings",
"pulseaudio",
"opengl"
]
}
I’ve tried setting
const { app, BrowserWindow, ipcMain, autoUpdater } = require('electron')
app.commandLine.appendSwitch('ignore-gpu-blacklist', 'true')
to get around any GPU blacklisting in my main.js file, but webgl still doesn’t work. The app works on the system I built it on in devmode, but when I run it in a VM, canvas.createContext('webGL')
always fails.
If I assign window.location="chrome://gpu/"
in the web console, I get
I checked the security log (https://docs.snapcraft.io/build-snaps/debugging) and received
$ sudo /snap/bin/snappy-debug.security scanlog polarr
INFO: following '/var/log/syslog'. If have dropped messages, use:
INFO: $ sudo journalctl --output=short --follow --all | sudo snappy-debug.security scanlog
kernel.printk_ratelimit = 0
= AppArmor =
Time: Dec 17 22:34:40
Log: apparmor="DENIED" operation="dbus_method_call" bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="GetManagedObjects" mask="send" name="org.bluez" pid=26725 label="snap.polarr.polarr" peer_pid=1194 peer_label="unconfined"
DBus access
= AppArmor =
Time: Dec 17 22:34:40
Log: apparmor="DENIED" operation="file_mmap" profile="snap.polarr.polarr" name="/dev/nvidiactl" pid=26914 comm="polarr" requested_mask="m" denied_mask="m" fsuid=1000 ouid=0
File: /dev/nvidiactl (mmap)
Suggestion:
* verify program isn't using an executable stack: https://forum.snapcraft.io/t/snap-and-executable-stacks/1812
= AppArmor =
Time: Dec 17 22:47:57
Log: apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/org/bluez/hci0/dev_A8_5C_2C_95_4C_E8" interface="org.freedesktop.DBus.Properties" member="PropertiesChanged" name=":1.18" mask="receive" pid=4215 label="snap.polarr.polarr" peer_pid=1194 peer_label="unconfined"
DBus access
Suggestion:
* try adding 'bluez' to 'plugs'
= AppArmor =
Time: Dec 17 22:47:57
Log: apparmor="ALLOWED" operation="dbus_signal" bus="system" path="/" interface="org.freedesktop.DBus.ObjectManager" member="InterfacesAdded" name=":1.18" mask="receive" pid=4215 label="snap.polarr.polarr" peer_pid=1194 peer_label="unconfined"
DBus access
I’m not really sure why my electron is messing with bluez, but I see the same logs from @popey in Chromium snap doesn't work with the nvidia proprietary driver. I’m just guessing, but I think what’s really killing the webgl context is the deny on /dev/nvidiactl
.
I see that there’s some ongoing work with nvidia in snaps:
- Chromium snap doesn't work with the nvidia proprietary driver
- Call for testing: chromium snap
- https://github.com/snapcore/snapd/blob/master/cmd/snap-confine/snap-confine.apparmor.in
Is all I can do at this point just wait for snaps to support NVIDIA? If that’s the case, how long will I have to wait and how will I know that this has been taken care of so that I can move forward with packaging my app for Ubuntu?