AMD GPU hardware acceleration - Failed to open the given device!

I have Radeon 6600 XT AMD GPU inside my TrueNAS server and I’m trying to get hardware acceleration in my containers but it doesn’t work.

In case it’s relevant, I run Dockge as TrueNAS app and I run my containers inside it.
I also tried just starting the container from the terminal.

I tested this with Immich, Plex and some other containers but it didn’t work anywhere.
Here is the example of Plex container:

services:
  plex:
    image: lscr.io/linuxserver/plex:latest
    container_name: plex
    network_mode: host
    environment:
      - PUID=568
      - PGID=568
      - TZ=Etc/UTC
      - VERSION=docker
    group_add:
      - video
      - render
    volumes:
      - /mnt/ssd-pool/configs/plex:/config
      - /mnt/big-boy/media:/data
    devices:
      - /dev/dri:/dev/dri
    tmpfs:
      - /transcode
    restart: unless-stopped
networks: {}

To test this, I would enter the container and install vainfo package and test with:

vainfo --display drm --device /dev/dri/renderD128
Failed to open the given device!

Inside container:

root@truenas:/# id
uid=0(root) gid=0(root) groups=0(root),44(video),995(render)

root@truenas:/# ls -alh /dev/dri
total 0
drwxr-xr-x 2 root root            80 Jan 29 10:50 .
drwxr-xr-x 6 root root           360 Jan 29 10:50 ..
crw-rw---- 1 root video     226,   0 Jan 29 10:50 card0
crw-rw---- 1 root group0pwm 226, 128 Jan 29 10:50 renderD128

On host:

root@truenas[/home/truenas_admin]# ls -alh /dev/dri
total 0
drwxr-xr-x  3 root root        100 Jan 29 10:48 .
drwxr-xr-x 19 root root       4.1K Jan 29 10:49 ..
drwxr-xr-x  2 root root         80 Jan 29 10:49 by-path
crw-rw----  1 root video  226,   0 Jan 29 10:49 card0
crw-rw----  1 root render 226, 128 Jan 29 10:48 renderD128

It is worth noting that Plex recognizes the GPU but it fails to transcode since it can’t access /dev/dri/renderD128 so it fallbacks to CPU.

I have a very different (software and hardware) setup, but mine renderD128 has 666 permissions. I’m not very familiar with linux permissions, though (just followed the guide).

Also, your “inside container” output looks a bit suspicious – your container name is plex, not truenas.

Additional rw for any user doesn’t play a role here since the container already runs with added groups with the same permissions.

Why the hostname of the container is “truenas”, I’m not sure but it is for sure plex container. All plex data is inside it.

Still worth trying IMO. But you do you.

I did try it before replying, it didn’t help. My conclusion was that it doesn’t matter since the passed group already has same permissions.

1 Like

It seems changing permission to 770, adding execute, did make work at least for Immich container.

OCR still doesn’t work but that it for other reason.
As for Plex, it doesn’t work anymore since they downgraded the version which included ffmpeg version 6 which included some fixes for AMD.

1 Like