scrcpy: Unable to use scrcpy with AMD graphics in Linux

Environment

  • OS: Ubuntu 20.04
  • scrcpy version: 1.18
  • installation method: snap
  • device model: S21
  • Android version: 11

Describe the bug

when launching scrcpy from bash I get the following error message. There are similar reports for other projects citing amdgpu.ids not accessible from snap packages due to Apparmor restrictions. Perhaps that’s the same thing here. Note: I have a notebook with Ryzen 7 CPU 4750U with AMD GPU obviously:

x@x:~$ scrcpy

INFO: scrcpy 1.18 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed. 1.2 MB/s (37330 bytes in 0.030s)
[server] INFO: Device: samsung SM-G998B (Android 11)
/usr/share/libdrm/amdgpu.ids: No such file or directory
si_init_perfcounters: max_sh_per_se = 2 not supported (inaccurate performance counters)
X Error:  BadAlloc
  Request Major code 149 ()
  Request Minor code 2
  Error Serial #109
  Current Serial #110

About this issue

Commits related to this issue

Most upvoted comments

Currently using the stable channel doesn’t still work, and throws up the same error. @sisco311 please look if the fix has been properly applied. The edge channel runs perfectly though. scrcpy version 1.24

@sisco311 Wow, yes, it works again now! Cool, thanks!

Try a non-snap version.

@heurekus, thanks for the suggestion. Added a bind to libdrm.

Please install the snap from the edge channel and see if this solves the issue.

Thanks.