2024-03-25, 02:26 PM
Hi everyone,
I'm having a very strange issue with nixos that I can't seem to generate on another linux OS such as ubuntu or arch.
I have an intel N100 pc with a alder lake GPU with quicksync. I run jellyfin in a docker container on nixos. When I enable OpenCL tone mapping in the docker container, none of my media can play. I see in the jellyfin logs that it doesn't seem to find an OpenCL device:
Nixos config. I've tried both with only adding in the onevpl-intel-gpu package, not adding that in, adding that in and removing intel-media-driver package, all same issues.
Docker compose, i pass the intel gpu through by passing through /dev/dri. This docker compose has been used on a ubuntu server system as well for months with no issues.
On ubuntu or arch running the same docker compose setup, jellyfin docker does recognize an OpenCL device. Jellyfin docker logs on ubuntu server
So weird that the underlying OS can have an influence on a passed through GPU in a docker container ... Anybody having the same issue?
I'm having a very strange issue with nixos that I can't seem to generate on another linux OS such as ubuntu or arch.
I have an intel N100 pc with a alder lake GPU with quicksync. I run jellyfin in a docker container on nixos. When I enable OpenCL tone mapping in the docker container, none of my media can play. I see in the jellyfin logs that it doesn't seem to find an OpenCL device:
Code:
root@jelly:/# /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device opencl@va
ffmpeg version 5.1.4-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
built with gcc 10 (Debian 10.2.1-6)
configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --extra-libs=-lfftw3f --extra-version=Jellyfin --disable-doc --disable-ffplay --disable-ptx-compression --disable-static --disable-libxcb --disable-sdl2 --disable-xlib --enable-lto --enable-gpl --enable-version3 --enable-shared --enable-gmp --enable-gnutls --enable-chromaprint --enable-libdrm --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libsvtav1 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-opencl --enable-vaapi --enable-amf --enable-libmfx --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
libavutil 57. 28.100 / 57. 28.100
libavcodec 59. 37.100 / 59. 37.100
libavformat 59. 27.100 / 59. 27.100
libavdevice 59. 7.100 / 59. 7.100
libavfilter 8. 44.100 / 8. 44.100
libswscale 6. 7.100 / 6. 7.100
libswresample 4. 7.100 / 4. 7.100
libpostproc 56. 6.100 / 56. 6.100
[AVHWDeviceContext @ 0x564f45c27cc0] libva: VA-API version 1.20.0
[AVHWDeviceContext @ 0x564f45c27cc0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x564f45c27cc0] libva: Found init function __vaDriverInit_1_20
[AVHWDeviceContext @ 0x564f45c27cc0] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x564f45c27cc0] Initialised VAAPI connection: version 1.20
[AVHWDeviceContext @ 0x564f45c27cc0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.4.0 (05e4d0d).
[AVHWDeviceContext @ 0x564f45c27cc0] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x564f45c57940] Failed to get number of OpenCL platforms: -1001.
Device creation failed: -19.
Failed to set value 'opencl@va' for option 'init_hw_device': No such device
Error parsing global options: No such device
Nixos config. I've tried both with only adding in the onevpl-intel-gpu package, not adding that in, adding that in and removing intel-media-driver package, all same issues.
Code:
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
intel-media-driver
intel-compute-runtime
vaapiVdpau
libvdpau-va-gl
vaapiIntel
intel-ocl
# Intel Video Processing Library (VPL) API runtime implementation
# replace with`onevpl-intel-gpu` after https://github.com/NixOS/nixpkgs/pull/264621
(pkgs.callPackage ./onevpl-intel-gpu.nix { })
];
};
Docker compose, i pass the intel gpu through by passing through /dev/dri. This docker compose has been used on a ubuntu server system as well for months with no issues.
Code:
jellyfin:
container_name: jellyfin
image: jellyfin/jellyfin
restart: always
network_mode: service:tailscale-jellyfin
environment:
- TZ=Europe/Brussels
volumes:
- jellyfin:/config
- /tmp:/cache
- movies:/movies
- tvshows:/tv
- /dev/shm:/dev/shm
devices:
- /dev/dri:/dev/dri
On ubuntu or arch running the same docker compose setup, jellyfin docker does recognize an OpenCL device. Jellyfin docker logs on ubuntu server
Code:
[AVHWDeviceContext @ 0x5615fea0e100] libva: VA-API version 1.20.0
[AVHWDeviceContext @ 0x5615fea0e100] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x5615fea0e100] libva: Found init function __vaDriverInit_1_20
[AVHWDeviceContext @ 0x5615fea0e100] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x5615fea0e100] Initialised VAAPI connection: version 1.20
[AVHWDeviceContext @ 0x5615fea0e100] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 23.4.0 (05e4d0d).
[AVHWDeviceContext @ 0x5615fea0e100] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x5615fea3dc40] 0.0: Intel(R) OpenCL Graphics / Intel(R) UHD Graphics
[AVHWDeviceContext @ 0x5615fea3dc40] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
[AVHWDeviceContext @ 0x5615fea3dc40] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
[AVHWDeviceContext @ 0x5615fea3dc40] Intel QSV in OpenCL release function found (clEnqueueReleaseVA_APIMediaSurfacesINTEL).
So weird that the underlying OS can have an influence on a passed through GPU in a docker container ... Anybody having the same issue?