Skip to content

Guide Passthrough iGPU Intel vers LXC

Configuration complète du passthrough du GPU Intel HD 2000 vers conteneur LXC pour transcoding Jellyfin.

Prérequis

Vérifications préalables :

# 1. iGPU détecté sur host
lspci | grep VGA

# 2. Devices DRM présents
ls -la /dev/dri/

# 3. Module i915 chargé
lsmod | grep i915

# 4. Groupes devices
stat -c "%g" /dev/dri/card0
stat -c "%g" /dev/dri/renderD128

Résultats attendus : - card0 : groupe video (GID 44) - renderD128 : groupe render (GID 104 ou 105)

Configuration Host Proxmox

Étape 1 : Éditer Configuration LXC

Backup configuration existante :

cp /etc/pve/lxc/100.conf /root/100.conf.backup

Éditer fichier config :

nano /etc/pve/lxc/100.conf

Ajouter les lignes suivantes :

# GPU Intel HD 2000 passthrough pour transcoding Jellyfin
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/card0 dev/dri/card0 none bind,optional,create=file
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file

Explication paramètres : - c 226:0 : Device caractère majeur 226, mineur 0 (card0) - c 226:128 : Device caractère majeur 226, mineur 128 (renderD128) - rwm : Read + Write + Mknod permissions - bind,optional,create=file : Mount bind, créer si absent, ne pas fail si manquant

Étape 2 : Appliquer Configuration

# Redémarrer conteneur
pct reboot 100

# OU arrêt/démarrage complet
pct stop 100
sleep 5
pct start 100

# Vérifier devices montés
pct exec 100 -- ls -la /dev/dri/

Résultat attendu :

crw-rw---- 1 root video  226,   0 card0
crw-rw---- 1 root render 226, 128 renderD128

Configuration Conteneur LXC

Étape 3 : Installer Drivers VA-API

Entrer dans conteneur :

pct enter 100

Installer paquets nécessaires :

apt update
apt install -y \
  intel-media-va-driver \
  i965-va-driver \
  vainfo \
  mesa-utils \
  mesa-va-drivers

# Optionnel : paquets additionnels
apt install -y \
  intel-media-va-driver-non-free \
  intel-gpu-tools

Étape 4 : Vérifier VA-API

# Test détection driver
vainfo --display drm --device /dev/dri/renderD128

Sortie attendue :

libva info: VA-API version 1.18.0
vainfo: Driver version: Intel i965 driver for Intel(R) Sandy Bridge
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            : VAEntrypointVLD
      VAProfileMPEG2Main              : VAEntrypointVLD
      VAProfileH264ConstrainedBaseline: VAEntrypointVLD
      VAProfileH264Main               : VAEntrypointVLD
      VAProfileH264High               : VAEntrypointVLD
      VAProfileVC1Simple              : VAEntrypointVLD
      VAProfileVC1Main                : VAEntrypointVLD
      VAProfileVC1Advanced            : VAEntrypointVLD

Si erreur : Voir Troubleshooting iGPU

Configuration Docker Jellyfin

Étape 5 : Modifier docker-compose.yml

Éditer fichier :

cd /opt/docker
nano docker-compose.yml

Ajouter section devices au service Jellyfin :

services:
  jellyfin:
    image: jellyfin/jellyfin:latest
    container_name: jellyfin
    user: 1000:1000
    network_mode: host
    environment:
      - TZ=Europe/Paris
    volumes:
      - /opt/docker/jellyfin/config:/config
      - /opt/docker/jellyfin/cache:/cache
      - /mnt/storage/media:/media:ro
      - /mnt/bulk/media:/media-bulk:ro

    # AJOUTER CES LIGNES
    devices:
      - /dev/dri/renderD128:/dev/dri/renderD128
      - /dev/dri/card0:/dev/dri/card0
    group_add:
      - "104"  # GID groupe render (à vérifier)

    restart: unless-stopped

Vérifier GID render correct :

# Dans LXC 100
stat -c "%g" /dev/dri/renderD128

# Si différent de 104, utiliser valeur retournée

Étape 6 : Redémarrer Jellyfin

cd /opt/docker

# Recréer conteneur avec nouvelle config
docker compose up -d --force-recreate jellyfin

# Vérifier devices montés
docker exec jellyfin ls -la /dev/dri/

Résultat attendu :

crw-rw---- 1 root render 226, 128 renderD128
crw-rw---- 1 root video  226,   0 card0

Vérifier groupes user Jellyfin :

docker exec jellyfin groups jellyfin
# Doit inclure groupe render

Configuration Jellyfin WebUI

Étape 7 : Activer Hardware Acceleration

  1. Ouvrir Jellyfin : http://192.168.1.100:8096
  2. Dashboard → Playback
  3. Section Hardware acceleration

Paramètres recommandés :

Paramètre Valeur Raison
Hardware acceleration Video Acceleration API (VA-API) Driver Intel i965
VA-API Device /dev/dri/renderD128 Device rendering headless
Enable hardware decoding ✅ H.264, MPEG-2, VC-1 Codecs supportés iGPU
Enable hardware encoding ✅ H.264 Codec supporté iGPU
Hardware encoding options H.264: Low latency Réduit délai
Allow encoding in HEVC ❌ Désactivé HD2000 incompatible
Enable Tone mapping ❌ Désactivé Pas OpenCL sur iGPU
Throttle transcodes ✅ Activé Éviter surcharge

Paramètres avancés :

Encoder preset: veryfast
H.264 encoding CRF: 23
Max simultaneous transcodes: 2
Transcode throttle: 120 seconds

Validation et Tests

Test 1 : Détection GPU

Dans Jellyfin Dashboard → Playback : - Doit afficher : "Intel i965 driver" détecté - Device : /dev/dri/renderD128 - Supported codecs : H.264, MPEG-2, VC-1

Test 2 : Transcoding Hardware

Lancer lecture vidéo :

  1. Choisir vidéo 1080p H.264
  2. Forcer transcodage (limiter qualité client)
  3. Dashboard → Activity
  4. Vérifier "(hw)" après codec

Exemple Activity :

Movie.mkv
Video: H.264 1080p → H.264 720p (hw)
Audio: AC3 5.1 → AAC Stereo
Transcode Speed: 3.2x

Test 3 : Monitoring Performances

Sur host Proxmox :

# Charge CPU (doit rester <30%)
top -bn1 | grep Cpu

# Utilisation GPU (si intel-gpu-tools installé)
intel_gpu_top

Dans LXC 100 :

# Logs transcoding
docker logs -f jellyfin | grep -E "transcode|hwaccel"

# Charge conteneur
docker stats jellyfin --no-stream

Performances attendues : - Transcoding speed : 3-4x temps réel - Charge CPU : 20-30% (vs 80-95% software) - Charge GPU : 60-80% - Latence démarrage : ~3-5 secondes

Test 4 : Multiple Streams

# Lancer 2-3 transcodings simultanés
# Dashboard → Activity : tous doivent indiquer (hw)
# CPU doit rester <50%

Rollback

En cas de problème :

# 1. Restaurer config LXC
cp /root/100.conf.backup /etc/pve/lxc/100.conf
pct reboot 100

# 2. Retirer devices Docker
cd /opt/docker
nano docker-compose.yml
# Supprimer sections devices et group_add
docker compose up -d jellyfin

# 3. Désactiver dans Jellyfin WebUI
# Dashboard → Playback → Hardware acceleration: None

Monitoring Production

Script vérification santé :

cat > /usr/local/bin/check-igpu << 'EOF'
#!/bin/bash
if ! pct exec 100 -- test -e /dev/dri/renderD128; then
  echo "ALERT: iGPU missing in LXC 100!" >&2
  exit 1
fi
if ! pct exec 100 -- docker exec jellyfin test -e /dev/dri/renderD128; then
  echo "ALERT: iGPU missing in Jellyfin!" >&2
  exit 1
fi
echo "OK: iGPU accessible"
EOF

chmod +x /usr/local/bin/check-igpu

# Cron (toutes les heures)
echo "0 * * * * /usr/local/bin/check-igpu || logger -t igpu 'Check failed'" | crontab -

Troubleshooting

Voir guide complet : Problèmes iGPU courants

Problèmes fréquents :

  1. Devices DRI absents dans LXC → Vérifier syntaxe config, redémarrer
  2. VA-API driver non trouvé → Installer tous drivers Intel
  3. Jellyfin ne détecte pas iGPU → Vérifier group_add, recréer conteneur
  4. Transcoding retombe sur CPU → Codec non supporté ou config incorrecte
  5. Performance dégradée → Vérifier throttling thermique, I/O disque

Ressources


Durée installation : 20-30 minutes
Difficulté : Facile (4 lignes config LXC + Docker)
Dernière mise à jour : 27 janvier 2026