From b00e11ed4a8c55eb3ff323752b0e5cb3ab1cbc9e Mon Sep 17 00:00:00 2001 From: aptalca Date: Thu, 23 Dec 2021 11:29:09 -0500 Subject: [PATCH 1/3] install intel drivers after plex to fix tonemap --- Dockerfile | 19 ++++++++++--------- README.md | 1 + readme-vars.yml | 1 + 3 files changed, 12 insertions(+), 9 deletions(-) diff --git a/Dockerfile b/Dockerfile index 5e32433..ba4ee12 100644 --- a/Dockerfile +++ b/Dockerfile @@ -31,6 +31,16 @@ RUN \ udev \ unrar \ wget && \ + echo "**** install plex ****" && \ + if [ -z ${PLEX_RELEASE+x} ]; then \ + PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \ + | jq -r '.computer.Linux.version'); \ + fi && \ + curl -o \ + /tmp/plexmediaserver.deb -L \ + "${PLEX_DOWNLOAD}/${PLEX_RELEASE}/debian/plexmediaserver_${PLEX_RELEASE}_${PLEX_ARCH}.deb" && \ + dpkg -i /tmp/plexmediaserver.deb && \ + echo "**** Install the latest Intel drivers ****" && \ COMP_RT_RELEASE=$(curl -sX GET "https://api.github.com/repos/intel/compute-runtime/releases/latest" | jq -r '.tag_name') && \ COMP_RT_URLS=$(curl -sX GET "https://api.github.com/repos/intel/compute-runtime/releases/tags/${COMP_RT_RELEASE}" | jq -r '.body' | grep wget | sed 's|wget ||g') && \ mkdir -p /opencl-intel && \ @@ -42,15 +52,6 @@ RUN \ done && \ dpkg -i /opencl-intel/*.deb && \ rm -rf /opencl-intel && \ - echo "**** install plex ****" && \ - if [ -z ${PLEX_RELEASE+x} ]; then \ - PLEX_RELEASE=$(curl -sX GET 'https://plex.tv/api/downloads/5.json' \ - | jq -r '.computer.Linux.version'); \ - fi && \ - curl -o \ - /tmp/plexmediaserver.deb -L \ - "${PLEX_DOWNLOAD}/${PLEX_RELEASE}/debian/plexmediaserver_${PLEX_RELEASE}_${PLEX_ARCH}.deb" && \ - dpkg -i /tmp/plexmediaserver.deb && \ echo "**** ensure abc user's home folder is /app ****" && \ usermod -d /app abc && \ echo "**** cleanup ****" && \ diff --git a/README.md b/README.md index ba85c1f..63091a6 100644 --- a/README.md +++ b/README.md @@ -299,6 +299,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions +* **23.12.21:** - Install Intel drivers _after_ Plex to fix broken tone mapping on comet lake. * **20.01.21:** - Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information. * **10.12.20:** - Add latest Intel Compute packages from github repo for opencl support on latest gen igpu. * **23.11.20:** - Add Bionic branch make Focal default. diff --git a/readme-vars.yml b/readme-vars.yml index 5092cf2..31d5bd3 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -107,6 +107,7 @@ app_setup_block: | # changelog changelogs: + - { date: "23.12.21:", desc: "Install Intel drivers _after_ Plex to fix broken tone mapping on comet lake." } - { date: "20.01.21:", desc: "Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information." } - { date: "10.12.20:", desc: "Add latest Intel Compute packages from github repo for opencl support on latest gen igpu." } - { date: "23.11.20:", desc: "Add Bionic branch make Focal default." } From 2f08980441f26b55db4d95db8ee42c958882cc36 Mon Sep 17 00:00:00 2001 From: aptalca Date: Fri, 24 Dec 2021 14:45:59 -0500 Subject: [PATCH 2/3] use intel repo --- Dockerfile | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/Dockerfile b/Dockerfile index ba4ee12..4892a22 100644 --- a/Dockerfile +++ b/Dockerfile @@ -22,12 +22,14 @@ PLEX_MEDIA_SERVER_INFO_VENDOR="Docker" \ PLEX_MEDIA_SERVER_INFO_DEVICE="Docker Container (LinuxServer.io)" RUN \ + echo "**** add Intel repo ****" && \ + curl -sL https://repositories.intel.com/graphics/intel-graphics.key | apt-key add - && \ + echo 'deb [arch=amd64] https://repositories.intel.com/graphics/ubuntu focal main' > /etc/apt/sources.list.d/intel.list && \ echo "**** install runtime packages ****" && \ apt-get update && \ apt-get install -y \ - beignet-opencl-icd \ jq \ - ocl-icd-libopencl1 \ + intel-opencl-icd \ udev \ unrar \ wget && \ @@ -40,18 +42,6 @@ RUN \ /tmp/plexmediaserver.deb -L \ "${PLEX_DOWNLOAD}/${PLEX_RELEASE}/debian/plexmediaserver_${PLEX_RELEASE}_${PLEX_ARCH}.deb" && \ dpkg -i /tmp/plexmediaserver.deb && \ - echo "**** Install the latest Intel drivers ****" && \ - COMP_RT_RELEASE=$(curl -sX GET "https://api.github.com/repos/intel/compute-runtime/releases/latest" | jq -r '.tag_name') && \ - COMP_RT_URLS=$(curl -sX GET "https://api.github.com/repos/intel/compute-runtime/releases/tags/${COMP_RT_RELEASE}" | jq -r '.body' | grep wget | sed 's|wget ||g') && \ - mkdir -p /opencl-intel && \ - for i in ${COMP_RT_URLS}; do \ - i=$(echo ${i} | tr -d '\r'); \ - echo "**** downloading ${i} ****"; \ - curl -o "/opencl-intel/$(basename ${i})" \ - -L "${i}"; \ - done && \ - dpkg -i /opencl-intel/*.deb && \ - rm -rf /opencl-intel && \ echo "**** ensure abc user's home folder is /app ****" && \ usermod -d /app abc && \ echo "**** cleanup ****" && \ From 9a093c24042631c263fd06fd5ee3c11136d06155 Mon Sep 17 00:00:00 2001 From: aptalca Date: Sat, 25 Dec 2021 14:24:10 -0500 Subject: [PATCH 3/3] update readme, improve gid-video verbosity --- README.md | 2 +- readme-vars.yml | 2 +- root/etc/cont-init.d/50-gid-video | 32 +++++++++++++------------------ 3 files changed, 15 insertions(+), 21 deletions(-) diff --git a/README.md b/README.md index 63091a6..cf35fa9 100644 --- a/README.md +++ b/README.md @@ -299,7 +299,7 @@ Once registered you can define the dockerfile to use with `-f Dockerfile.aarch64 ## Versions -* **23.12.21:** - Install Intel drivers _after_ Plex to fix broken tone mapping on comet lake. +* **25.12.21:** - Install Intel drivers from the official repo. * **20.01.21:** - Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information. * **10.12.20:** - Add latest Intel Compute packages from github repo for opencl support on latest gen igpu. * **23.11.20:** - Add Bionic branch make Focal default. diff --git a/readme-vars.yml b/readme-vars.yml index 31d5bd3..13867d0 100644 --- a/readme-vars.yml +++ b/readme-vars.yml @@ -107,7 +107,7 @@ app_setup_block: | # changelog changelogs: - - { date: "23.12.21:", desc: "Install Intel drivers _after_ Plex to fix broken tone mapping on comet lake." } + - { date: "25.12.21:", desc: "Install Intel drivers from the official repo." } - { date: "20.01.21:", desc: "Deprecate `UMASK_SET` in favor of UMASK in baseimage, see above for more information." } - { date: "10.12.20:", desc: "Add latest Intel Compute packages from github repo for opencl support on latest gen igpu." } - { date: "23.11.20:", desc: "Add Bionic branch make Focal default." } diff --git a/root/etc/cont-init.d/50-gid-video b/root/etc/cont-init.d/50-gid-video index 8e0dec3..9766c76 100755 --- a/root/etc/cont-init.d/50-gid-video +++ b/root/etc/cont-init.d/50-gid-video @@ -4,23 +4,17 @@ FILES=$(find /dev/dri /dev/dvb -type c -print 2>/dev/null) for i in $FILES do - VIDEO_GID=$(stat -c '%g' "$i") - if id -G abc | grep -qw "$VIDEO_GID"; then - touch /groupadd - else - if [ ! "${VIDEO_GID}" == '0' ]; then - VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}') - if [ -z "${VIDEO_NAME}" ]; then - VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)" - groupadd "$VIDEO_NAME" - groupmod -g "$VIDEO_GID" "$VIDEO_NAME" - fi - usermod -a -G "$VIDEO_NAME" abc - touch /groupadd - fi - fi + VIDEO_GID=$(stat -c '%g' "$i") + if ! id -G abc | grep -qw "$VIDEO_GID"; then + VIDEO_NAME=$(getent group "${VIDEO_GID}" | awk -F: '{print $1}') + if [ -z "${VIDEO_NAME}" ]; then + VIDEO_NAME="video$(head /dev/urandom | tr -dc 'a-zA-Z0-9' | head -c8)" + groupadd "$VIDEO_NAME" + groupmod -g "$VIDEO_GID" "$VIDEO_NAME" + fi + usermod -a -G "$VIDEO_NAME" abc + if [ $(stat -c '%A' "${i}" | cut -b 5,6) != "rw" ]; then + echo -e "**** The device ${i} does not have group read/write permissions, which might prevent hardware transcode from functioning correctly. To fix it, you can run the following on your docker host: ****\nsudo chmod g+rw ${i}\n" + fi + fi done - -if [ -n "${FILES}" ] && [ ! -f "/groupadd" ]; then - usermod -a -G root abc -fi