Jellyfin Forum
eGPU for jellyfin transcoding in Linux container - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: General Questions (https://forum.jellyfin.org/f-general-questions)
+--- Thread: eGPU for jellyfin transcoding in Linux container (/t-egpu-for-jellyfin-transcoding-in-linux-container)



eGPU for jellyfin transcoding in Linux container - milk_dud_nipples - 2024-10-21

Hi all,

I'm running an Intel NUC with Proxmox, and I've got Jellyfin set up inside an LXC. I'm looking to offload transcoding from the CPU to a dedicated GPU. I don't need anything super high-end since I’m not doing 4K video, but I do want to handle a few simultaneous streams reliably.

I'd love some recommendations from folks who've done something similar. Jellyfin is currently running inside a privileged LXC (in Docker, but it doesn’t have to stay that way). The eGPU's sole task will be transcoding, and I'll be passing it through to the LXC.

I’m hoping to keep the cost below $500, and my primary concern is solid Linux support.

Thanks in advance!


RE: eGPU for jellyfin transcoding in Linux container - TheDreadPirate - 2024-10-21

What model NUC do you have? If it is relatively recent, the iGPU should be pretty capable as is.


RE: eGPU for jellyfin transcoding in Linux container - milk_dud_nipples - 2024-10-22

(2024-10-21, 11:39 PM)TheDreadPirate Wrote: What model NUC do you have?  If it is relatively recent, the iGPU should be pretty capable as is.

It's a NUC11PAHi7. Here's a link: https://a.co/d/8t0RSzj

Trying it out right now. Here's what I did.

Passing the device into the container.

Code:
demo@pve:~$ ls -l /dev/dri
total 0
drwxr-xr-x 2 root root        80 Oct 20 09:37 by-path
crw-rw---- 1 root video  226,  0 Oct 20 09:37 card0
crw-rw---- 1 root render 226, 128 Oct 20 09:37 renderD128
demo@pve:~$ getent group video
video:x:44:
demo@pve:~$ getent group render
render:x:104:

I added the following to my LXC conf and restarted it.

Code:
dev0: /dev/dri/card0,gid=44,uid=0
dev1: /dev/dri/renderD128,gid=105,uid=0

I see the device inside the LXC now.

Code:
demo@jellyfin:~$ ls /dev
console  dri  full      initctl  mqueue  ptmx  random  stderr  stdout  tty1  urandom
core    fd  hugepages  log      null    pts  shm    stdin  tty    tty2  zero
demo@jellyfin:~$ ls /dev/dri
card0  renderD128

Added this to the compose file for Jellyfin.

Code:
services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    network_mode: "host"
    devices:
      - '/dev/dri:/dev/dri'

Verified the container can see the device.

Code:
demo@jellyfin:~/jellyfin$ sudo docker exec -it jellyfin /bin/bash
root@jellyfin:/# ls /dev
core  dri  fd  full  mqueue  null  ptmx  pts  random  shm  stderr  stdin  stdout  tty  urandom  zero
root@jellyfin:/#

Now, I went into the Jellyfin settings in the UI and enabled QSV under Playback > Transcoding (default settings). I can see it using the iGPU.

[Image: QnR0hOD.png]

It still seems like the LXC is using an inordinate amount of CPU, though. It's sitting at roughly 70% with 4 vCPUs allocated to the container.

[Image: RqsNMJs.png]

Did I do something wrong or is this normal behavior?


RE: eGPU for jellyfin transcoding in Linux container - milk_dud_nipples - 2024-10-22

I messed with the settings some and think I have it working well now. Thanks.


RE: eGPU for jellyfin transcoding in Linux container - TheDreadPirate - 2024-10-22

Good to hear. The CPU usage may be from other factors. Subtitle burn in and audio transcoding will always occur on the CPU.