Snap can't access libdrm directory/file

I’ve seen many mentions of this issue on github but couldn’t find a clear solution

/usr/share/libdrm/amdgpu.ids: No such file or directory

I’m using core22 and the gnome extension

Perhpaps this example may help?

Is that layout entry all that’s needed?

Not sure that’s 100% of your problems solved, but that’s certainly part of it. It might be worth looking at one of the newer snaps I’ve packaged like ROTA for a complete and compact example. Note that this is packaging a game made with Godot 3.x. I don’t know what you’re packaging, but maybe this helps?

I’ve also had this issue with libdrm mounting (the same questions were here Core22 gnome extension: mount binding - #3 by yvs and there Apps from snap cannot access /usr/share/libdrm/amdgpu.ids)
It’s not resolved probably because of this still opened bug Bug #2034056 “gnome-boxes/darktable bind mount issue” : Bugs : snapd

on ffmpeg way of mounting:

Perhpaps https://github.com/snapcrafters/ffmpeg/blob/2fa32101cfed656dcf8f61456c91feddf5be5105/snap/snapcraft.yaml#L27 example may help?

that solution isn’t compatible with gnome extension which mounts libdrm too:

layout:
    ...
    /usr/share/libdrm:
      bind: $SNAP/gnome-platform/usr/share/libdrm

resulted in (for the following mount): “Cannot pack snap: error: cannot validate snap: layout “/usr/share/libdrm/amdgpu.ids” underneath prior layout item “/usr/share/libdrm”
Failed to execute pack in instance.”

p.s. only way to get rid of that message (me known) is to disconnect opengl from a corresponding snap. It’s okay if opengl isn’t used there, otherwise not.

The next example of ROTA uses the GNOME extension. Maybe try that?

I cannot spot out the use of gnome extension there at runtime. Looks like that use is for build-stage only. It needs some time to rebuild in that way, I’ll try it too.

update: gnome is there (my fault not spotting it),
but anyway there’s the same “/usr/share/libdrm/amdgpu.ids: No such file or directory”

I.e. it appears that it hasn’t helped either