alexbelgium / hassio-addons

My homeassistant addons
MIT License
1.55k stars 222 forks source link

πŸ› [Plex NAS] amdgpu: The CS has been rejected #945

Closed interkelstar closed 1 year ago

interkelstar commented 1 year ago

Description

When I'm trying to enable video transcoding on my AMD GX-215JJ it fails and there are errors in the log supposing that it's something with the addon

Reproduction steps

1. Go to 'Settings - Transcoding'
2. Check Use hardware
3. Try to open HEVC mediafile with converting enabled

Addon Logs

[migrations] started
[migrations] no migrations found
-----------------------------------------------------------
 Add-on: Plex NAS
 Plex organizes video, music and photos from personal media libraries and streams them to smart TVs, streaming boxes and mobile devices
-----------------------------------------------------------
───────────────────────────────────────
      β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— 
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ•‘     β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
      β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β• 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    0
User GID:    0
───────────────────────────────────────
 Add-on version: 1.32.5.7349-8f4248874-ls180
 You are running the latest version of this add-on.
 System: Home Assistant OS 10.4  (amd64 / generic-x86-64)
 Home Assistant Core: 2023.8.3
 Home Assistant Supervisor: 2023.08.1
-----------------------------------------------------------
 Please, share the above information when looking for help
 or support in, e.g., GitHub, forums
-----------------------------------------------------------
 Provided by: https://github.com/alexbelgium/hassio-addons 
-----------------------------------------------------------
 Defining permissions for main user : 
User UID: 0
User GID : 0
-----------------------------------------------------------
Local Disks mounting...
[19:55:13] INFO: Mounting NAS of type 
[19:55:13] INFO: Success! NAS mounted to /mnt/NAS
[19:55:13] INFO: Execute /config/addons_autoscripts/plex-nas.sh if existing
[19:55:13] INFO: ... no script found
Database stored in /share/plex
... creating /symlink
Using existing config
**** Server already claimed ****
**** permissions for /dev/dri/card0 are good ****
**** permissions for /dev/dri/renderD128 are good ****
Docker is used for versioning skip update check
[custom-init] No custom files found, skipping...
Starting Plex Media Server. . . (you can ignore the libusb_init error)
[ls.io-init] done.
/data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm/amdgpu.ids: No such file or directory
/data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm/amdgpu.ids: No such file or directory
amdgpu: The CS has been rejected (-22), but the context isn't robust.
amdgpu: The process will be terminated.
****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /config/Library/Application Support/Plex Media Server/Crash Reports/1.32.5.7349-8f4248874/PLEX MEDIA SERVER/57e6da7d-3498-420b-204ea0bf-0ea0ff8a.dmp
Starting Plex Media Server. . . (you can ignore the libusb_init error)

Architecture

amd64

OS

HAos

alexbelgium commented 1 year ago

Hi, it could be due to the version of the mesa drivers that you have, you could try to create a file named "/config/addons_autoscripts/plex-nas.sh" with the content below and restart

if command -v "apk" &>/dev/null; then
  apk add --no-cache mesa-dri-vc4 mesa-dri-swrast mesa-gbm xf86-video-fbdev >/dev/null
elif command -v "apt" &>/dev/null; then
  apt-get update && apt-get install -yqq -- *mesa* >/dev/null
fi
interkelstar commented 1 year ago

I tried this but still the same error every time I open a video file and enable conversion while HW transcoding is on.

/data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm/amdgpu.ids: No such file or directory
/data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm/amdgpu.ids: No such file or directory
amdgpu: The CS has been rejected (-22), but the context isn't robust.
amdgpu: The process will be terminated.
****** PLEX MEDIA SERVER CRASHED, CRASH REPORT WRITTEN: /config/Library/Application Support/Plex Media Server/Crash Reports/1.32.5.7349-8f4248874/PLEX MEDIA SERVER/dc089b53-1bf0-4c7b-d3d1d28b-a0ec89bf.dmp
Starting Plex Media Server. . . (you can ignore the libusb_init error)
/data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm/amdgpu.ids: No such file or directory
/data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm/amdgpu.ids: No such file or directory
amdgpu: The CS has been rejected (-22), but the context isn't robust.
amdgpu: The process will be terminated.

dc089b53-1bf0-4c7b-d3d1d28b-a0ec89bf.dmp.log

Home Assistant OS in the only OS on my thin client. No special settings for drivers or drivers installations were made.

alexbelgium commented 1 year ago

I'm sorry I don't know but it seems related to related to the container more than the addon which is just a shell. Perhaps you could try posting on the container repo my addon is based : https://github.com/linuxserver/docker-plex/issues

interkelstar commented 1 year ago

I'm sorry I don't know but it seems related to related to the container more than the addon which is just a shell. Perhaps you could try posting on the container repo my addon is based : https://github.com/linuxserver/docker-plex/issues

I've tried and got following https://github.com/linuxserver/docker-plex/issues/372

Actually, I followed the suspiction and set up Plex server on pure docker, using portainer and without this addon. And I can confirm that there were no such error messages in the logs when I tried the same thing (hardware transcoding) on the same machine. So it is somehow an addon issue after all

(clear logs from portainer plex setup)

[migrations] started
[migrations] no migrations found
usermod: no changes
───────────────────────────────────────
      β–ˆβ–ˆβ•—     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— 
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β–ˆβ–ˆβ•—
      β–ˆβ–ˆβ•‘     β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ•‘     β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
      β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•
      β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•β•β•β• 
   Brought to you by linuxserver.io
───────────────────────────────────────
To support LSIO projects visit:
https://www.linuxserver.io/donate/
───────────────────────────────────────
GID/UID
───────────────────────────────────────
User UID:    911
User GID:    911
───────────────────────────────────────
**** Server already claimed ****
#######################################################
# Update routine will not run because you havent set  #
# the VERSION variable or you opted out of updates.   #
#          For more information checkout :-           #
#    https://github.com/linuxserver/docker-plex       #
#######################################################
[custom-init] No custom files found, skipping...
Starting Plex Media Server. . . (you can ignore the libusb_init error)
[ls.io-init] done.
Critical: libusb_init failed
Dolby, Dolby Digital, Dolby Digital Plus, Dolby TrueHD and the double D symbol are trademarks of Dolby Laboratories.
alexbelgium commented 1 year ago

Thanks that’s strange… Alas I don't have an AMD gpu so can't replicate. I tried looking on Google but the only things I read were related to versions of the mesa driver... I'll continue looking when I'll have time thanks!

interkelstar commented 1 year ago

Thanks for lloking into it, let me know if I can be of any help!

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

alexbelgium commented 1 year ago

Not stale, but no idea

interkelstar commented 1 year ago

Mee too, othen then maybe somehow some config from original docker image is missing or it's different in some way. Can confirm that still able to see this log on the most recent add-on version. Maybe investigate differences between add-on docker container and pure plex docker container (for example installed through portainer)?..

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

alexbelgium commented 1 year ago

Not stale, hadn't time

alexbelgium commented 1 year ago

Hi, you could try to paste this code in "/config/addons_autoscripts/plex-nas.sh" and restart

#!/bin/bash

if command -v "apk" &>/dev/null; then
  apk add --no-cache mesa-dri-vc4 mesa-dri-swrast mesa-gbm xf86-video-fbdev >/dev/null
elif command -v "apt" &>/dev/null; then
  apt-get update && apt-get install -yqq -- *mesa* >/dev/null

mkdir -p /data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm

pattern="$(find / -name amdgpu.ids 2>/dev/null)"
files=( $pattern )
cp "${files[0]}" /data/jenkins/conan_build/1112346209/conan/.conan/data/libdrm/2.4.115-1/plex/stable/build/42eba9224a0a19c9b983c233343e5610c7362833/meson-install/share/libdrm/
github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.