VLC snap crashes on start, apt version OK

I am having problems with more than one snap, but I’ll start with VLC. I am running Ubuntu 20.10, with a Radeon Pro WX5100 GPU. My install is fairly normal, apart from the fact I have had to manually install OpenCL (using this method), but something is causing problems for snap, where apt installed software or using appimages are fine.

❯ snap version
snap    2.49.2
snapd   2.49.2
series  16
ubuntu  20.10
kernel  5.8.0-49-lowlatency
❯ snap info vlc
name:      vlc
summary:   The ultimate media player
publisher: VideoLAN✓
store-url: https://snapcraft.io/vlc
contact:   https://www.videolan.org/support/
license:   unset
description: |
  VLC is the VideoLAN project's media player.
  
  Completely open source and privacy-friendly, it plays every multimedia file and streams.
  
  It notably plays MKV, MP4, MPEG, MPEG-2, MPEG-4, DivX, MOV, WMV, QuickTime, WebM, FLAC, MP3,
  Ogg/Vorbis files, BluRays, DVDs, VCDs, podcasts, and multimedia streams from various network
  sources. It supports subtitles, closed captions and is translated in numerous languages.
commands:
  - vlc
snap-id:      RT9mcUhVsRYrDLG8qnvGiy26NKvv6Qkd
tracking:     latest/stable
refresh-date: 5 days ago, at 15:05 CST
channels:
  latest/stable:    3.0.12.1                    2021-01-23 (2103) 309MB -
  latest/candidate: 3.0.12.1                    2021-01-05 (2103) 309MB -
  latest/beta:      3.0.12.1-161-g8fe0049935    2021-04-03 (2284) 309MB -
  latest/edge:      4.0.0-dev-15110-g55456d7c1e 2021-04-04 (2285) 361MB -
installed:          3.0.12.1                               (2103) 309MB -

Error:

❯ snap run vlc
/usr/share/libdrm/amdgpu.ids: No such file or directory
VLC media player 3.0.12.1 Vetinari (revision 3.0.12.1-0-g170157402b)
[00005628e17eeb10] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Qt: Session management error: Could not open network socket
Fontconfig warning: FcPattern object weight does not accept value [0 205)
zsh: segmentation fault (core dumped)  snap run vlc

The file is present though:

❯ ls -al /usr/share/libdrm/
total 24
drwxr-xr-x   2 root root  4096 Apr  9 15:38 .
drwxr-xr-x 305 root root 12288 Apr 14 11:03 ..
-rw-r--r--   1 root root  7547 May 27  2020 amdgpu.ids

Running apt VLC:

❯ /usr/bin/vlc
VLC media player 3.0.11.1 Vetinari (revision 3.0.11.1-0-g52483f3ca2)
[0000556c5ca5e670] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
[0000556c5cafda20] main playlist: playlist is empty

Trying with Flatpak on the same system, and it also works fine:

❯ flatpak run org.videolan.VLC
VLC media player 3.0.12 Vetinari (revision 3.0.12-1-0-gd147bb5e7e)
[000055b956a90180] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
QStandardPaths: wrong permissions on runtime directory /run/user/1000, 0755 instead of 0700
QStandardPaths: wrong permissions on runtime directory /run/user/1000, 0755 instead of 0700
Gtk-Message: 17:58:31.124: Failed to load module "canberra-gtk-module"
Gtk-Message: 17:58:31.124: Failed to load module "canberra-gtk-module"
QStandardPaths: wrong permissions on runtime directory /run/user/1000, 0755 instead of 0700
Qt: Session management error: None of the authentication protocols specified are supported
[000055b956b20140] main playlist: playlist is empty

I also get crashes when trying to start Gimp and Audacity, in these cases they both have font problems (text is represented as squares before the crash), and these apps also work when installed by other means. Something is seriously amiss with this snap setup…

Updated to 21.04, hoping some dependency would shake itself out. But still VLC cannot run as a snap (and still Flatpak and APT are OK):

❯ /snap/bin/vlc
/usr/share/libdrm/amdgpu.ids: No such file or directory
VLC media player 3.0.12.1 Vetinari (revision 3.0.12.1-0-g170157402b)
[000055970e4f4b10] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
Qt: Session management error: Could not open network socket
Fontconfig warning: FcPattern object weight does not accept value [0 205)
zsh: segmentation fault (core dumped)  /snap/bin/vlc

What is the best next step to try to resolve this?

this looks like your graphics driver is installed in some non standard path that snapd can not see …

Thanks for taking time to reply @ogra. I am using the standard MESA drivers and e.g. that file is available:

❯ ls -al /usr/share/libdrm/
total 28
drwxr-xr-x   2 root root  4096 Apr 23 16:38 .
drwxr-xr-x 310 root root 12288 Apr 23 16:45 ..
-rw-r--r--   1 root root 10082 Jan 12 02:15 amdgpu.ids

As I mentioned above, I have added OpenCL via the proprietary drivers (but nothing else), and at least for all other software on my workstation this setup works fine (clinfo reports correct version, glxgears etc. works, appimage Blender can use OpenCL, everything else (e.g. MATLAB) uses OpenGL via MESA without issue). I’ve tried X and Wayland with the same results.

well, do they live properly in /usr/lib ?

Thank you, to be honest I do not know where the “proper” place is, the script installer for OpenCL does move the OpenCL files to \usr\lib\ (the script is here: https://gist.github.com/tuxutku/79daa2edca131c1525a136b650cdbe0a). The rest of the AMD driver is the untouched standard MESA one, so I assume it is in the proper place. The error message does not indicate that OpenCL is a problem, it is only my guess as to what may be “non-standard” on my workstation.

Here are the installed files in /usr/lib:

lrwxrwxrwx 1 root root   22 Apr 25 10:18 libdrm_amdgpo.so.1 -> libdrm_amdgpo.so.1.0.0
-rw-r--r-- 1 root root  51K Apr 25 10:18 libdrm_amdgpo.so.1.0.0
-rw-r--r-- 1 root root  85M Apr 25 10:18 libamdocl-orca64.so
-rw-r--r-- 1 root root  37M Apr 25 10:18 libamdocl12cl64.so
lrwxrwxrwx 1 root root   21 Apr 25 10:18 libamd_comgr.so -> libamd_comgr.so.2.0.0
-rw-r--r-- 1 root root 116M Apr 25 10:18 libamd_comgr.so.2.0.0
lrwxrwxrwx 1 root root   16 Apr 25 10:18 libamdhip64.so -> libamdhip64.so.4
lrwxrwxrwx 1 root root   25 Apr 25 10:18 libamdhip64.so.4 -> libamdhip64.so.4.0.21154-
-rw-r--r-- 1 root root 2.6M Apr 25 10:18 libamdhip64.so.4.0.21154-
lrwxrwxrwx 1 root root   18 Apr 25 10:18 libhsakmt.so.1 -> libhsakmt.so.1.0.6
-rw-r--r-- 1 root root 174K Apr 25 10:18 libhsakmt.so.1.0.6
lrwxrwxrwx 1 root root   25 Apr 25 10:18 libhsa-runtime64.so.1 -> libhsa-runtime64.so.1.3.0
-rw-r--r-- 1 root root 2.3M Apr 25 10:18 libhsa-runtime64.so.1.3.0
-rw-r--r-- 1 root root 1.4M Apr 25 10:18 libamdocl64.so

i was talking about the driver itself, not the CUDA libs … i.e. it might be instaling somewhere in /opt …

As I understand it, the MESA driver is untouched, and resides in /usr/lib/x86_64-linux-gnu, and the DRI files are in /usr/lib/x86_64-linux-gnu/dri:

❯ ls /usr/lib/x86_64-linux-gnu/libGL*
libGLdispatch.so.0      libGLESv2.so.2.1.0  libGL.so.1      libGLU.so.1.3.1       libGLX_mesa.so.0.0.0
libGLdispatch.so.0.0.0  libGLEW.so.2.1      libGL.so.1.7.0  libGLX_indirect.so.0  libGLX.so.0
libGLESv2.so.2          libGLEW.so.2.1.0    libGLU.so.1     libGLX_mesa.so.0      libGLX.so.0.0.0
❯ ls /usr/lib/x86_64-linux-gnu/dri
d3d12_dri.so       iris_dri.so           r200_dri.so        radeonsi_dri.so        zink_dri.so
i915_dri.so        kms_swrast_dri.so     r300_dri.so        radeonsi_drv_video.so
i965_dri.so        nouveau_dri.so        r600_dri.so        swrast_dri.so
i965_drv_video.so  nouveau_drv_video.so  r600_drv_video.so  virtio_gpu_dri.so
iHD_drv_video.so   nouveau_vieux_dri.so  radeon_dri.so      vmwgfx_dri.so

In /opt/ the OpenCL installation does place a single symlink to the amdgpus.ids list, could this be confusing snapd?

❯ ll /opt/amdgpu/share/libdrm/amdgpu.ids
lrwxrwxrwx 1 root root 28 Apr 25 10:18 /opt/amdgpu/share/libdrm/amdgpu.ids -> /usr/share/libdrm/amdgpu.ids

The rest of the /opt/amdgpu/ is empty. There is also an opt/amdgpu-pro folder with some files that come from the OpenCL stuff:

❯ ll /opt/amdgpu-pro
total 16K
drwxr-xr-x 3 root root 4.0K Apr 25 10:18 amdgcn/
drwxr-xr-x 2 root root 4.0K Apr 25 10:18 bin/
drwxr-xr-x 4 root root 4.0K Apr 25 10:18 lib/
drwxr-xr-x 3 root root 4.0K Apr 25 10:18 share/
❯ ls /opt/amdgpu-pro/bin
ca              hipcc_cmake_linker_helper  hipdemangleatp      hipify-cmakefile  roc-obj-extract
findcode.sh     hipconfig                  hip_embed_pch.sh    hipify-perl       roc-obj-ls
finduncodep.sh  hipconvertinplace-perl.sh  hipexamine-perl.sh  hipvars.pm
hipcc           hipconvertinplace.sh       hipexamine.sh       lpl
❯ ls /opt/amdgpu-pro/lib/x86_64-linux-gnu
libcltrace.so

this is a dup report. After upgrade to 21.04 from 20.10 where no such issues existed. AMD graphics.
I don’t have any special OpenCL installed, it’s just a standard Ubuntu install as far as I know. There is no /opt/amdgpu-pro

    vlc
    /usr/share/libdrm/amdgpu.ids: No such file or directory
    VLC media player 3.0.12.1 Vetinari (revision 3.0.12.1-0-g170157402b)
    [000056025c3bca00] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
    Qt: Session management error: Could not open network socket
    Fontconfig warning: FcPattern object weight does not accept value [50 200)
    Segmentation fault (core dumped)

Thanks @timattrn , that suggests this is independent of any OpenCL driver additions. What is your MESA version (glxinfo -B). Do you have any problems with other snaps?

tim@indigo:~/Downloads$ glxinfo -B
name of display: :0
display: :0  screen: 0
direct rendering: Yes
Extended renderer info (GLX_MESA_query_renderer):
    Vendor: AMD (0x1002)
    Device: Radeon RX 570 Series (POLARIS10, DRM 3.40.0, 5.11.0-16-generic, LLVM 11.0.1) (0x67df)
    Version: 21.0.1
    Accelerated: yes
    Video memory: 8192MB
    Unified memory: no
    Preferred profile: core (0x1)
    Max core profile version: 4.6
    Max compat profile version: 4.6
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
Memory info (GL_ATI_meminfo):
    VBO free memory - total: 6899 MB, largest block: 6899 MB
    VBO free aux. memory - total: 7769 MB, largest block: 7769 MB
    Texture free memory - total: 6899 MB, largest block: 6899 MB
    Texture free aux. memory - total: 7769 MB, largest block: 7769 MB
    Renderbuffer free memory - total: 6899 MB, largest block: 6899 MB
    Renderbuffer free aux. memory - total: 7769 MB, largest block: 7769 MB
Memory info (GL_NVX_gpu_memory_info):
    Dedicated video memory: 8192 MB
    Total available memory: 16384 MB
    Currently available dedicated video memory: 6899 MB
OpenGL vendor string: AMD
OpenGL renderer string: Radeon RX 570 Series (POLARIS10, DRM 3.40.0, 5.11.0-16-generic, LLVM 11.0.1)
OpenGL core profile version string: 4.6 (Core Profile) Mesa 21.0.1
OpenGL core profile shading language version string: 4.60
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile

OpenGL version string: 4.6 (Compatibility Profile) Mesa 21.0.1
OpenGL shading language version string: 4.60
OpenGL context flags: (none)
OpenGL profile mask: compatibility profile

OpenGL ES profile version string: OpenGL ES 3.2 Mesa 21.0.1
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

As to other snaps, I have not seen problems in other snaps, e.g. bitwarden, remmina and pycharm work fine.

Are there any in particular I could try in order to give more information?

I am using the xorg session of ubuntu 21.04 on this desktop.

The other snaps I had issues with were GIMP and Audacity, but perhaps that is unrelated, as those were font problems, not GPU related (I assume)…