Jump to content

Hardware acceleration - Emby inside LXC(Debian/Ubuntu) container using Intel iGPU


appoli

Recommended Posts

@Glenn apologies for not getting back sooner, things have been a bit crazy on my end (and usually Emby forum alerts aren’t from people asking me questions!). 
 

To make sure that I understand where you’re at, this is how I interpreted your current situation:

- you have an LXC container 

- inside said container you have the docket host/engine running

- you’re trying to pass through the igpu dri device to the lxc container so that docker containers can access it

- sounds like you installed vaapi on the main proxmox host?

 

I am not too sure about getting the docker part working as I don’t use it anymore & never have passed through the igpu dri when I did. But if I understand correctly you’ll need to pass through the igpu device to the LXC container (and probably will want to install the vaapi stuff in the LXC too? I’m not sure if that’s needed or not with a docker container... maybe just the container needs to have it installed?). 
 

For passing the dri device over to an LXC container (assuming the docker host is running inside an LXC container):

- within the pve LXC config file I have added (one of the first two lines probably isn’t needed & might actually be the graphics device from the motherboard chipset/bcmu):

*** note: these paths are for the graphics hardware on my machine & may be slightly different on yours. I would log into the proxmox host itself and go to the /dev/dri directory to see what the names are on your machine ***

lxc.cgroup.devices.allow: c 226:0 rwm 

lxc.cgroup.devices.allow: c 226:1 rwm

lxc.cgroup.devices.allow: c 226:128 rwm

lxc.cgroup.devices.allow: c 29:0 rwm

lxc.autodev: 1

lxc.hook.autodev: /var/lib/lxc/102/mount_hook.sh

(102 is the number for the container in question. this points to a script that is used to mount up the dri device)

and I would think you probably would want to make sure that the config also has:

features: mount=1,nesting=1

 

The mount_hook.sh file contains the following (relates to the devices mentioned in the config file):

mkdir -p ${LXC_ROOTFS_MOUNT}/dev/dri

mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/dri/card0 c 226 0

mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/dri/card0 c 226 1

mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/dri/renderD128 c 226 128

mknod -m 666 ${LXC_ROOTFS_MOUNT}/dev/fb0 c 29 0

 

If I’m missing any instructions you should be able to Google some of the above and get an answer. 
 

As for installing the VA-API bits using make there are some instructions on the VA-API website (might have to do some other googling to fully understand how everything works, but it will get you started). It’s kind of annoying to find:

https://01.org/linuxmedia/quickstart/linux-vaapi-videostack-environment
 

I’m currently using my phone so I’m not sure if it’s this exact location, but when I was looking through this recently (just got a Dell XPS 13 & was looking through the VA-API & Intel driver documentation to see if they had made changes to support the new iGPU), but there was a menu on the left that let you choose the type of installation you were doing (ie vaapi free/open drivers, using the Intel media kit drivers, etc). Selecting the appropriate one would yield instructions for that software stack. 
 

I am far from an expert with building/making software installs, but I suppose one key thing to note is that when building the install file it’s normal to make a ‘build’ folder within the folder containing the downloaded files. And when you run the make command you will need to reference the directory with the make files (which in these cases is the one above) thus the reference to variables for source directory and root install directory. 
 

hope this helps 

Edited by appoli
  • Like 1
Link to comment
Share on other sites

To add:

I have had Emby running on the original Ubuntu container that I made when I installed Proxmox a while back; as such it had always been Ubuntu 18.04. 
Recently however I have been having issues with some hardware transcoding crashing my machine (generally when people are watching or recording live tv, but with some downloaded media as well). 
 

I had added an apt source that contains the latest versions of the Intel vaapi software to try and keep things more up to date (should be able to find it with a quick google), but I had noticed that there was a igpu/vaapi update that wasn’t installing on 18.04. So I upgraded to 20.04 (and I believe the upgrade went away, maybe it was updated by the install?) - I didn’t think it would change too much as it uses the host’s kernel, but it seems to have smoothed things out with the machine running much more smoothly. 

Edited by appoli
Link to comment
Share on other sites

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...