jellyfin: HW acceleration

This commit is contained in:
bain 2023-04-09 13:07:36 +02:00
parent 40278cffc5
commit f05125f313
3 changed files with 22 additions and 30 deletions

14
DOCS
View file

@ -3,6 +3,7 @@ Additional documentation for my homelab setup
Table of Contents
1. DNS
2. Jellyfin HW acceleration
1. DNS
@ -16,3 +17,16 @@ Both resolvers use 1.1.1.1 and 8.8.8.8 as upstream servers.
Note: Apple TV seems to not care at all what I set as the resolver, so I need to
have an internal address published on a public DNS server.
2. Jellyfin HW acceleration
The physical server has Intel integrated graphics. To make PCI passthrough work
properly I had to enable it and Intel's vGT technology to make vGPUs out of the
single chip. Here is a guide that had worked:
https://cetteup.com/216/how-to-use-an-intel-vgpu-for-plexs-hardware-accelerated-streaming-in-a-proxmox-vm/
Basically it is just enabling IOMMU, and the vGT feature in the i915 kernel
driver. (IOMMU needs to be enabled in the BIOS as well)

View file

@ -2,7 +2,6 @@ version: '3.5'
services:
jellyfin:
image: jellyfin/jellyfin
container_name: jellyfin
ports:
- 127.0.0.1:8096:8096
- 7359:7359/udp
@ -16,11 +15,7 @@ services:
# Optional - alternative address used for autodiscovery
environment:
- JELLYFIN_PublishedServerUrl=https://film.$domain
# Optional - may be necessary for docker healthcheck to pass if running in host network mode
extra_hosts:
- "host.docker.internal:host-gateway"
deploy:
resources:
reservations:
devices:
- capabilities: [gpu]
# Intel VGT HW acceleration
devices:
- /dev/dri/renderD128:/dev/dri/renderD128
- /dev/dri/card0:/dev/dri/card0

View file

@ -5,38 +5,21 @@ source "$HL_LIB"
_assert_vars HL_DOMAIN;
_ch_001-install_nvidia_drivers() {
sudo apt-get install -y nvidia-driver-515-server
echo "_ch_001-install_nvidia_drivers" >> run.checkpoints
_err "installed nvidia drivers; please reboot"
}
_ch_002-install_nvidia_containers() {
distribution=$(. /etc/os-release;echo $ID$VERSION_ID) \
&& curl -fsSL https://nvidia.github.io/libnvidia-container/gpgkey | sudo gpg --dearmor -o /usr/share/keyrings/nvidia-container-toolkit-keyring.gpg \
&& curl -s -L https://nvidia.github.io/libnvidia-container/$distribution/libnvidia-container.list | \
sed 's#deb https://#deb [signed-by=/usr/share/keyrings/nvidia-container-toolkit-keyring.gpg] https://#g' | \
sudo tee /etc/apt/sources.list.d/nvidia-container-toolkit.list
sudo apt-get update
sudo apt-get install -y nvidia-docker2
sudo systemctl restart docker
}
_ch_003-make_dirs() {
_ch_001-make_dirs() {
mkdir -p ~/jellyfin /data/jellyfin;
}
_ch_004-copy_compose() {
_ch_002-copy_compose() {
cp $(_fill docker-compose.yml.templ) ~/jellyfin/docker-compose.yml;
}
_ch_005-update_caddy() {
_ch_003-update_caddy() {
cp $(_fill Caddyfile.templ) /etc/caddy/conf.d/jellyfin.Caddyfile;
chmod a+r /etc/caddy/conf.d/jellyfin.Caddyfile;
sudo systemctl reload caddy.service;
}
_ch_006-run-service() {
_ch_004-run-service() {
cd ~/jellyfin;
docker-compose up -d;
}