More > JRiver Media Center 29 for Linux
Docker Images for MC29
max096:
--- Quote from: cncb on June 15, 2022, 06:39:54 pm ---It looks like the packages install fine with the script but MC fails to start with lines repeated in the logs (see attached screenshot). It is not giving me much to go on. I am using the following command line docker creation (... means a bunch of media volumes not shown):
--- Code: ---sudo docker run --restart always -d --name JRMC29_Accel -v /volume1/docker/MC/config:/config -v /volume1/docker/MC/10-setup-intel-gpu.sh:/etc/cont-init.d/10-setup-intel-gpu.sh ... --device=/dev/dri/renderD128 --device=/dev/dri/card0 -e TZ=America/New_York --net=host --privileged shiomax/jrivermc29:latest
--- End code ---
--- End quote ---
My bad adding the group names does not work those should be the IDs from the host.
Try this script. It adds all the group IDs from devices from /dev/dri. If for some reason it does not detect that you have an intel processor you can add "-e INSTALL_INTEL_GPU_DRIVER=1" and it should install it anyways. By default it tries to figure out if you have an intel CPU and based (if the devices can be found) it will install the driver. It's a bit more along the lines of what I'd be putting into the image (if it works).
--- Code: ---#!/usr/bin/with-contenv sh
set -e # Exit immediately if a command exits with a non-zero status.
set -u # Treat unset variables as an error.
log() {
echo "[cont-init.d] $(basename $0): $*"
}
add_device_groups() {
# Add Groups for devices in /dev/dri/
# NOTE: The devices can only be added if they belong to a group that is not the root user on the host.
find /dev/dri/ -type c | while read DRI_DEV
do
DRI_GROUP="$(stat -c "%g" "$DRI_DEV")"
[ "$DRI_GROUP" = "0" ] && { log "Device $DRI_DEV cannot be added, as it's owned by root."; continue; }
log "Adding group $DRI_GROUP for device $DRI_DEV."
if [ -f /var/run/s6/container_environment/SUP_GROUP_IDS ]; then
echo -n "," >> /var/run/s6/container_environment/SUP_GROUP_IDS
fi
echo -n "$DRI_GROUP" >> /var/run/s6/container_environment/SUP_GROUP_IDS
done
}
[ "$INSTALL_INTEL_GPU_DRIVER" = "0" ] && { log "Intel GPU setup is blocked by INSTALL_INTEL_GPU_DRIVER env variable."; exit 0; }
PROCESSOR_NAME=$(cat /proc/cpuinfo | grep "model name" | head -n 1 | cut -d':' -f2 | awk '{$1=$1};1')
if echo "$PROCESSOR_NAME" | grep -qiw "INTEL" || [ "$INSTALL_INTEL_GPU_DRIVER" = "1" ]; then
log "Setting up Intel GPU driver. Detected processor: $PROCESSOR_NAME"
[ ! -d "/dev/dri" ] && { log "Directory '/dev/dri' not exposed to container. Cannot setup intel gpu."; exit 0; }
[ ! -e "/dev/dri/renderD128" ] && { log "Device '/dev/dri/renderD128' not exposed to container. Cannot setup intel gpu."; exit 0; }
if [ $(dpkg-query -W -f='${Status}' intel-media-va-driver 2>/dev/null | grep -c "ok installed") -eq 0 ]; then
# Install intel driver
log "Installing intel-media-va-driver..."
apt-get update
apt-get install -y intel-media-va-driver
else
log "intel-media-va-driver is already installed."
fi
add_device_groups
fi
--- End code ---
cncb:
It started up alright after I added the INSTALL_INTEL_GPU_DRIVER=1, but I have some odd permissions issues now on some of my main media directories? Do I need to run the docker creation command from a system account or something? I cannot see any differences in permissions with directories that are accessible.
max096:
--- Quote from: cncb on June 16, 2022, 07:54:14 pm ---It started up alright after I added the INSTALL_INTEL_GPU_DRIVER=1, but I have some odd permissions issues now on some of my main media directories? Do I need to run the docker creation command from a system account or something? I cannot see any differences in permissions with directories that are accessible.
--- End quote ---
Did you put USER_ID and GROUP_ID environment variables? You probably already had a docker container before or not? The script should not make any difference in that regard. You can find out which IDs you need to use by running "ls -la" on your host against the directories and then "id <username>" to find out the numeric id. Only USER_ID is usually sufficient if you have all the files owned by the same user. There is no way I can automatically figure that out. The default is 1000 as thats the first user that you end up with if you install >insert any linux distro< pretty much.
The user you run the docker command as really does not matter as the docker deamon runs as root and that's what ultimately creates the container the CLI just talks to that thing.
Because you had to set INSTALL_INTEL_GPU_DRIVER to 1. What did it print as processor name on startup?
Also does it ever print something along these lines "Device $DRI_DEV cannot be added, as it's owned by root." ever?
cncb:
--- Quote from: max096 on June 16, 2022, 08:30:13 pm ---Also does it ever print something along these lines "Device $DRI_DEV cannot be added, as it's owned by root." ever?
--- End quote ---
I got the permissions sorted by using the user id and group from the working container.
But I get these lines in the log:
[cont-init.d] new-intel-setup.sh: Adding group 937 for device /dev/dri/renderD128.
[cont-init.d] new-intel-setup.sh: Device /dev/dri/card0 cannot be added, as it's owned by root.
bob:
--- Quote from: cncb on June 16, 2022, 09:37:54 pm ---I got the permissions sorted by using the user id and group from the working container.
But I get these lines in the log:
[cont-init.d] new-intel-setup.sh: Adding group 937 for device /dev/dri/renderD128.
[cont-init.d] new-intel-setup.sh: Device /dev/dri/card0 cannot be added, as it's owned by root.
--- End quote ---
Your user probably needs to be added to the video and render groups.
--- Code: ---ls -l /dev/dri*
total 0
drwxr-xr-x 2 root root 80 May 12 20:00 by-path
crw-rw---- 1 root video 226, 0 Jun 15 09:34 card0
crw-rw---- 1 root render 226, 128 May 12 20:00 renderD128
--- End code ---
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version