Jellyfin Forum
SOLVED: OpenCL tonemapping stopped working - Printable Version

+- Jellyfin Forum (https://forum.jellyfin.org)
+-- Forum: Support (https://forum.jellyfin.org/f-support)
+--- Forum: Troubleshooting (https://forum.jellyfin.org/f-troubleshooting)
+--- Thread: SOLVED: OpenCL tonemapping stopped working (/t-solved-opencl-tonemapping-stopped-working)



OpenCL tonemapping stopped working - caius - 2024-10-03

I have a jellyfin server which used to do opencl tonemapping OK. I've noticed now that it gives an error when trying to transcode a file which requires tone mapping and playback does not start.

The server is a Celeron J4105 with UHD 600 graphics. Quicksync hardware acceleration works OK, as does VPP tone mapping. It's running on Ubuntu 24.04 LTS directly (ie not in docker).

Jellyfin version is 10.9.11.

Code:
uname -a:

Linux odyssey 6.8.0-44-generic #44-Ubuntu SMP PREEMPT_DYNAMIC Tue Aug 13 13:35:26 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux

Code:
/usr/lib/jellyfin-ffmpeg/vainfo

Trying display: drm
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.22 (libva 2.22.0)
vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 24.2.5 (12561f6)
vainfo: Supported profile and entrypoints
      VAProfileNone                  : VAEntrypointVideoProc
      VAProfileNone                  : VAEntrypointStats

etc.

Code:
apt policy intel-opencl-icd

intel-opencl-icd:
  Installed: 23.43.27642.40-1ubuntu3
  Candidate: 23.43.27642.40-1ubuntu3

Code:
sudo /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device opencl@va
ffmpeg version 6.0.1-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 13 (Ubuntu 13.2.0-23ubuntu4)
  configuration: --prefix=/usr/lib/jellyfin-ffmpeg --target-os=linux --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-opencl --enable-libdrm --enable-libxml2 --enable-libass --enable-libfreetype --enable-libfribidi --enable-libfontconfig --enable-libbluray --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libopenmpt --enable-libdav1d --enable-libsvtav1 --enable-libwebp --enable-libvpx --enable-libx264 --enable-libx265 --enable-libzvbi --enable-libzimg --enable-libfdk-aac --arch=amd64 --enable-libshaderc --enable-libplacebo --enable-vulkan --enable-vaapi --enable-amf --enable-libvpl --enable-ffnvcodec --enable-cuda --enable-cuda-llvm --enable-cuvid --enable-nvdec --enable-nvenc
  libavutil      58.  2.100 / 58.  2.100
  libavcodec    60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter    9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample  4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[AVHWDeviceContext @ 0x5607007e6300] libva: VA-API version 1.22.0
[AVHWDeviceContext @ 0x5607007e6300] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x5607007e6300] libva: Found init function __vaDriverInit_1_22
[AVHWDeviceContext @ 0x5607007e6300] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x5607007e6300] Initialised VAAPI connection: version 1.22
[AVHWDeviceContext @ 0x5607007e6300] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.2.5 (12561f6).
[AVHWDeviceContext @ 0x5607007e6300] Driver not found in known nonstandard list, using standard behaviour.
Abort was called at 40 line in file:
./shared/source/built_ins/built_ins.cpp
Aborted

It looks like some problem with the opencl driver but I'm not sure how to troubleshoot it. If I run clinfo that also crashes with the same error message. I'm not sure if this is a configuration error somewhere or if there's an issue with the driver itself. I'd be grateful if anyone has any ideas.


RE: OpenCL tonemapping stopped working - TheDreadPirate - 2024-10-03

vainfo requires additional parameters

Code:
sudo /usr/lib/jellyfin-ffmpeg/vainfo --display drm --device /dev/dri/renderD128

But to the actual problem, try just reinstalling the opencl package.

Code:
sudo apt purge intel-opencl-icd
sudo apt install intel-opencl-icd



RE: OpenCL tonemapping stopped working - caius - 2024-10-03

I tried removing the package and running clinfo gives the expected response without crashing:

Code:
Number of platforms                              0

ICD loader properties
  ICD loader Name                                OpenCL ICD Loader
  ICD loader Vendor                              OCL Icd free software
  ICD loader Version                              2.3.2
  ICD loader Profile                              OpenCL 3.0


After reinstalling it, the crash returns.


RE: OpenCL tonemapping stopped working - TheDreadPirate - 2024-10-03

What is the output of this command?

Code:
sudo apt list --installed | egrep -i "igc|intel|opencl"



RE: OpenCL tonemapping stopped working - caius - 2024-10-04

It seems to have been a problem either with the specific package ubuntu was installing or some dependency. I went to the Intel compute runtime github and installed the latest packages from there after purging the ubuntu version.

Transcoding with ffmpeg now works correctly and clinfo no longer crashes.
Ubuntu was installing version 23.43.27642.40-1ubuntu3 and the latest intel release is 24.35.30872.22.

Link for reference if anyone else comes across this issue: https://github.com/intel/compute-runtime/releases


Quote:What is the output of this command?

This was run after I'd installed the intel packages, so not really needed but I'll put it for reference anyway:

Code:
intel-gmmlib/now 20.3.2 amd64 [installed,local]
intel-gpu-tools/noble,noble,noble,noble,now 1.28-1ubuntu2 amd64 [installed]
intel-igc-core/now 1.0.17537.20 amd64 [installed,local]
intel-igc-opencl/now 1.0.17537.20 amd64 [installed,local]
intel-level-zero-gpu-legacy1/now 1.3.30872.22 amd64 [installed,local]
intel-level-zero-gpu/now 1.3.30872.22 amd64 [installed,local]
intel-media-va-driver-non-free/noble,noble,noble,noble,now 24.1.0+ds1-1 amd64 [installed]
intel-microcode/noble-updates,noble-security,now 3.20240910.0ubuntu0.24.04.1 amd64 [installed,automatic]
intel-opencl-icd-legacy1/now 24.35.30872.22 amd64 [installed,local]
intel-opencl-icd/now 24.35.30872.22 amd64 [installed,local]
libdrm-intel1/noble,noble,noble,noble,now 2.4.120-2build1 amd64 [installed,automatic]
libigc1/noble,noble,noble,noble,now 1.0.15468.25-2build1 amd64 [installed,auto-removable]
libopencl-clang14/noble,noble,noble,noble,now 14.0.0-4build2 amd64 [installed,auto-removable]
ocl-icd-libopencl1/noble,noble,noble,noble,now 2.3.2-1build1 amd64 [installed]
ocl-icd-opencl-dev/noble,noble,noble,noble,now 2.3.2-1build1 amd64 [installed]
opencl-c-headers/noble,noble,noble,noble,now 3.0~2023.12.14-1 all [installed,automatic]
opencl-clhpp-headers/noble,noble,noble,noble,now 3.0~2023.12.14-1ubuntu1 all [installed,automatic]
opencl-headers/noble,noble,noble,noble,now 3.0~2023.12.14-1 all [installed]

Thanks for your help.