Jump to content

Tips to set up emby on a QNAP NAS using Docker with HW Transcoding


Recommended Posts

Posted (edited)

have less time at the moment to check it in detail. hope the next week i can look about it.

i tried a lot about the drivers. uninstall, reinstall also opened a ticket by qnap to look about it.
they created another container caffee and after this the nvidia-uvm was present. after a reboot the file was not there again and they created a caffe-2 container and then the file was there again. the support do not really care when it is a kind of 3th party app and not a qnap application.
i did not run the command in the cli directly. when it works with it, then i think i have a workaround without a autorun.sh

Edited by paddy75
Posted
On 9/17/2023 at 12:16 AM, paddy75 said:

have less time at the moment to check it in detail. hope the next week i can look about it.

i tried a lot about the drivers. uninstall, reinstall also opened a ticket by qnap to look about it.
they created another container caffee and after this the nvidia-uvm was present. after a reboot the file was not there again and they created a caffe-2 container and then the file was there again. the support do not really care when it is a kind of 3th party app and not a qnap application.
i did not run the command in the cli directly. when it works with it, then i think i have a workaround without a autorun.sh

That would be great, thanks !

Posted

So yeah, the issue is that you need QuTS to call the GPU at least once before the emby container is ran, for some reason depending on how you run your containers that may or may not happen, it's a whole mess. Running that command is just one surefire way of making it appear.  You can then use an autorun.sh or whatever floats your boat.  Hell, there's probably something on QuTS Hero you could run on boot that will make it appear as a workaround.  Also, if you run your containers manually, you don't need to create an autorun, there's tons of ways you could go around it.  The autorun proposed is a solution for people that run their containers on boot and want to have everything heavily automated, it makes sense when you also run your containers using docker compose using a script, but there's plenty of solutions to this same problem.

  • Thanks 1
  • 8 months later...
lswang168
Posted

It seems that Qnap updated there nvidia driver, and not recognized by Emby server now. below docker compose file was working and containers can start and with hw acceleration, but now the hardware acceleraiton device list is gone.

Qnap: Ts-873a, added 1050 graphic card

version of Qnap nvkerneldriver: 5.17; installed latest GPU driver also.

After recent qnap updates, this happed, we didn't rebuild the emby server.

 

Current dock compose file:

version: '3.6'

services:
    emby:
        build: 
            dockerfile: /share/Container/jellyfin8/Dockerfile
            context: /share/CACHEDEV2_DATA/.qpkg/NVIDIA_GPU_DRV/usr
        container_name: emby2
        environment:
            PUID: 1000 
            PGID: 1000 
            GIDLIST: 0
            TZ: Asia/Shanghai
        volumes:
            - /share/Container/jellyfin8/docker/config/emby:/config
            - /share/Cinema:/media
            - /share/PT:/media2
            - type: tmpfs
              target: /scratch
              tmpfs:
                size: 10000000000
            - /share/Container/jellyfin8/media/scratch:/scratch
        ports:
            - '8096:8096' # HTTP port
            - '8920:8920' # HTTPS port
            - '7359:7359'
            - '1900:1900'
        devices:
            - /dev/nvidia0
            - /dev/nvidiactl
            - /dev/nvidia-uvm
        restart: unless-stopped
        image: embyhwtrc
        network_mode: bridge

 

and enter SSH, use: docker compose  up --build -d

 to build up.

 

but, if change to jellyfin, it works and can use hw acceration:

version: '3.6'

services:
    jellyfin:
        build: 
            dockerfile: /share/Container/jellyfin2/Dockerfile
            context: /share/CACHEDEV2_DATA/.qpkg/NVIDIA_GPU_DRV/usr
        container_name: jellyfin2
        environment:
            PUID: 1000 
            PGID: 1000 
            GIDLIST: 0
            TZ: Aisa/Shanghai
        volumes:
            - /share/Container/jellyfin2/config:/config
            - /share/Container/jellyfin2/scratch:/scratch
            - /share/Container/jellyfin2/transcode:/transcode
            - /share/Cinema:/media
            - /share/PT:/media2


            - type: tmpfs
              target: /scratch
              tmpfs:
                size: 10000000000
            - /share/Container/jellyfin2/media/scratch:/scratch

        ports:
            - '8097:8096'
            - '8921:8920'
        devices:
            - /dev/nvidia0
            - /dev/nvidiactl
            - /dev/nvidia-uvm
        restart: unless-stopped
        image: jellyfinhwtrc
        network_mode: bridge

 

so don't know how to solve emby sever hw acceleration problem. 

Wonder anyone facing the similar problem? pls share experience on how to solve it, thank you.

 

lswang168
Posted
3 hours ago, lswang168 said:

It seems that Qnap updated there nvidia driver, and not recognized by Emby server now. below docker compose file was working and containers can start and with hw acceleration, but now the hardware acceleraiton device list is gone.

Qnap: Ts-873a, added 1050 graphic card

version of Qnap nvkerneldriver: 5.17; installed latest GPU driver also.

After recent qnap updates, this happed, we didn't rebuild the emby server.

 

Current dock compose file:

version: '3.6'

services:
    emby:
        build: 
            dockerfile: /share/Container/jellyfin8/Dockerfile
            context: /share/CACHEDEV2_DATA/.qpkg/NVIDIA_GPU_DRV/usr
        container_name: emby2
        environment:
            PUID: 1000 
            PGID: 1000 
            GIDLIST: 0
            TZ: Asia/Shanghai
        volumes:
            - /share/Container/jellyfin8/docker/config/emby:/config
            - /share/Cinema:/media
            - /share/PT:/media2
            - type: tmpfs
              target: /scratch
              tmpfs:
                size: 10000000000
            - /share/Container/jellyfin8/media/scratch:/scratch
        ports:
            - '8096:8096' # HTTP port
            - '8920:8920' # HTTPS port
            - '7359:7359'
            - '1900:1900'
        devices:
            - /dev/nvidia0
            - /dev/nvidiactl
            - /dev/nvidia-uvm
        restart: unless-stopped
        image: embyhwtrc
        network_mode: bridge

 

and enter SSH, use: docker compose  up --build -d

 to build up.

 

but, if change to jellyfin, it works and can use hw acceration:

version: '3.6'

services:
    jellyfin:
        build: 
            dockerfile: /share/Container/jellyfin2/Dockerfile
            context: /share/CACHEDEV2_DATA/.qpkg/NVIDIA_GPU_DRV/usr
        container_name: jellyfin2
        environment:
            PUID: 1000 
            PGID: 1000 
            GIDLIST: 0
            TZ: Aisa/Shanghai
        volumes:
            - /share/Container/jellyfin2/config:/config
            - /share/Container/jellyfin2/scratch:/scratch
            - /share/Container/jellyfin2/transcode:/transcode
            - /share/Cinema:/media
            - /share/PT:/media2


            - type: tmpfs
              target: /scratch
              tmpfs:
                size: 10000000000
            - /share/Container/jellyfin2/media/scratch:/scratch

        ports:
            - '8097:8096'
            - '8921:8920'
        devices:
            - /dev/nvidia0
            - /dev/nvidiactl
            - /dev/nvidia-uvm
        restart: unless-stopped
        image: jellyfinhwtrc
        network_mode: bridge

 

so don't know how to solve emby sever hw acceleration problem. 

Wonder anyone facing the similar problem? pls share experience on how to solve it, thank you.

 

solve it by add permissions:

# chmod 666 /dev/nvidia0
# chmod 666 /dev/nvidiactl
# chmod 666 /dev/nvidia-uvm

Posted
11 hours ago, lswang168 said:

solve it by add permissions:

# chmod 666 /dev/nvidia0
# chmod 666 /dev/nvidiactl
# chmod 666 /dev/nvidia-uvm

Yeah, latest update breaks my solution in the same way QuickSync was broken before, and technically your solution works.  HOWEVER, I'd advise that, if you have properly managed user/groups, to do 

chmod 770 /dev/nvidia0 &&
chmod 770 /dev/nvidiactl &&
chmod 770 /dev/nvidia-uvm 

instead. 

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...