Jellyfin Forum
[UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - 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: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. (/t-uhd-graphics-605-tone-mapping-with-opencl-inside-a-proxmox-lxc-crashes-transcoding)

Pages: 1 2


[UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - eivarin - 2024-04-22

I'm trying to run hardware transcoding for jellyfin on a proxmox container. Jellyfin was installed with the tteck script (https://tteck.github.io/Proxmox/). I have tried this in both the webclient and the android client and got the sabe result

Transcoding without Tone Maping works. Transcoding an HDR video with VPP Tone Mapping works but its too dark. Transcoding an HDR video with opencl Tone Mapping doesn't work. It tries to start the video but errors out with the following error:
Quote:Playback Error - This client isn't compatible with the media and the server isn't sending a compatible media format.

Here are the logs:
Logs PasteBin

In my debugging research i have also found this debugging command:

Code:
/usr/lib/jellyfin-ffmpeg/ffmpeg -v debug -init_hw_device vaapi=va:,driver=iHD -init_hw_device opencl=ocl@va -filter_hw_device ocl -f lavfi -i nullsrc=s=1920x1080,format=nv12 -vf hwupload,scale_opencl=w=1280:h=720 -t 30 -f null -

Which gives me the following output:
Debug Output PasteBin

Can Anyone Help Me?

My Hardware:
- Intel® Pentium® Silver J5040 Processor (2 cores for the LXC container)
- 16 GB RAM (2 GB RAM for the LXC container)
- UHD Graphics 605
My software:
- Proxmox Version: 8.1.4
- LXC OS: Ubuntu 22.04.4 LTS
- Jellyfin Version: 10.8.13
- intel-opencl-icd: 22.14.22890-1


RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - TheDreadPirate - 2024-04-23

Is your LXC privileged?

https://jellyfin.org/docs/general/administration/hardware-acceleration/intel/#lxc-on-proxmox


RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - eivarin - 2024-04-23

Forgot to mention it...
Yes it is a privileged lxc


RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - TheDreadPirate - 2024-04-23

And you installed all the Intel required drivers on the Proxmox host?

Check out the link from my previous post and double check you completed the steps outlined for Proxmox.


RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - ben94 - 2024-04-24

Hi. I am also having this problem (openCL working on proxmox host but not lxc guest). Transcoding seems to work fine it's just the openCL.
clinfo output on HOST : 
Code:
Number of platforms:                            1
  Platform Profile:                              FULL_PROFILE
  Platform Version:                              OpenCL 2.1 AMD-APP (3614.0)
  Platform Name:                                AMD Accelerated Parallel Processing
  Platform Vendor:                              Advanced Micro Devices, Inc.
  Platform Extensions:                          cl_khr_icd cl_amd_event_callback


  Platform Name:                                AMD Accelerated Parallel Processing
Number of devices:                              1
  Device Type:                                  CL_DEVICE_TYPE_GPU
  Vendor ID:                                    1002h
  Board name:                                    AMD Radeon Graphics
  Device Topology:                              PCI[ B#48, D#0, F#0 ]
  Max compute units:                            7
  Max work items dimensions:                    3
    Max work items[0]:                          1024
    Max work items[1]:                          1024
    Max work items[2]:                          1024
  Max work group size:                          256
  Preferred vector width char:                  4
  Preferred vector width short:                  2
  Preferred vector width int:                    1
  Preferred vector width long:                  1
  Preferred vector width float:                  1
  Preferred vector width double:                1
  Native vector width char:                      4
  Native vector width short:                    2
  Native vector width int:                      1
  Native vector width long:                      1
  Native vector width float:                    1
  Native vector width double:                    1
  Max clock frequency:                          1900Mhz
  Address bits:                                  64
  Max memory allocation:                        3650722200
  Image support:                                Yes
  Max number of images read arguments:          128
  Max number of images write arguments:          8
  Max image 2D width:                            16384
  Max image 2D height:                          16384
  Max image 3D width:                            16384
  Max image 3D height:                          16384
  Max image 3D depth:                            8192
  Max samplers within kernel:                    16
  Max size of kernel argument:                  1024
  Alignment (bits) of base address:              1024
  Minimum alignment (bytes) for any datatype:    128
  Single precision floating point capability
    Denorms:                                    Yes
    Quiet NaNs:                                  Yes
    Round to nearest even:                      Yes
    Round to zero:                              Yes
    Round to +ve and infinity:                  Yes
    IEEE754-2008 fused multiply-add:            Yes
  Cache type:                                    Read/Write
  Cache line size:                              64
  Cache size:                                    16384
  Global memory size:                            4294967296
  Constant buffer size:                          3650722200
  Max number of constant args:                  8
  Local memory type:                            Scratchpad
  Local memory size:                            65536
  Max pipe arguments:                            16
  Max pipe active reservations:                  16
  Max pipe packet size:                          3650722200
  Max global variable size:                      3650722200
  Max global variable preferred total size:      4294967296
  Max read/write image args:                    64
  Max on device events:                          1024
  Queue on device max size:                      8388608
  Max on device queues:                          1
  Queue on device preferred size:                262144
  SVM capabilities:                             
    Coarse grain buffer:                        Yes
    Fine grain buffer:                          Yes
    Fine grain system:                          No
    Atomics:                                    No
  Preferred platform atomic alignment:          0
  Preferred global atomic alignment:            0
  Preferred local atomic alignment:              0
  Kernel Preferred work group size multiple:    64
  Error correction support:                      0
  Unified memory for Host and Device:            0
  Profiling timer resolution:                    1
  Device endianess:                              Little
  Available:                                    Yes
  Compiler available:                            Yes
  Execution capabilities:                               
    Execute OpenCL kernels:                      Yes
    Execute native function:                    No
  Queue on Host properties:                             
    Out-of-Order:                                No
    Profiling :                                  Yes
  Queue on Device properties:                           
    Out-of-Order:                                Yes
    Profiling :                                  Yes
  Platform ID:                                  0x747328e13f90
  Name:                                          gfx90c:xnack-
  Vendor:                                        Advanced Micro Devices, Inc.
  Device OpenCL C version:                      OpenCL C 2.0
  Driver version:                                3614.0 (HSA1.1,LC)
  Profile:                                      FULL_PROFILE
  Version:                                      OpenCL 2.0
  Extensions:                                    cl_khr_fp64 cl_khr_global_int32_base_atomics cl_khr_global_int32_extended_atomics cl_khr_local_int32_base_atomics cl_khr_local_int32_extended_atomics cl_khr_int64_base_atomics cl_khr_int64_extended_atomics cl_khr_3d_image_writes cl_khr_byte_addressable_store cl_khr_fp16 cl_khr_gl_sharing cl_amd_device_attribute_query cl_amd_media_ops cl_amd_media_ops2 cl_khr_image2d_from_buffer cl_khr_subgroups cl_khr_depth_images cl_amd_copy_buffer_p2p cl_amd_assembly_program

clinfo output on GUEST : 
Code:
Number of platforms:                            1
  Platform Profile:                              FULL_PROFILE
  Platform Version:                              OpenCL 2.1 AMD-APP (3614.0)
  Platform Name:                                AMD Accelerated Parallel Processing
  Platform Vendor:                              Advanced Micro Devices, Inc.
  Platform Extensions:                          cl_khr_icd cl_amd_event_callback


  Platform Name:                                AMD Accelerated Parallel Processing
Number of devices:                              0

in /etc/pve/lxc/<container>.conf : 
Code:
lxc.cgroup2.devices.allow: c 226:0 rwm
lxc.cgroup2.devices.allow: c 226:128 rwm
lxc.mount.entry: /dev/dri/renderD128 dev/dri/renderD128 none bind,optional,create=file



RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - TheDreadPirate - 2024-04-24

@ben94 Did you install the ROCM openCL packages on the host?


RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - ben94 - 2024-04-24

(2024-04-24, 08:30 PM)TheDreadPirate Wrote: @ben94  Did you install the ROCM openCL packages on the host?

on both the host and guest i have these packages
Code:
ii  rocm-core                            6.1.0.60100-82~20.04                amd64        Radeon Open Compute (ROCm) Runtime software stack
ii  rocm-language-runtime                6.1.0.60100-82~20.04                amd64        Radeon Open Compute (ROCm) Runtime software stack
ii  rocm-opencl                          2.0.0.60100-82~20.04                amd64        clr built using CMake
ii  rocm-opencl-icd-loader              1.2.60100-82~20.04                  amd64        OpenCL-ICD-Loader built using CMake
ii  rocm-opencl-runtime                  6.1.0.60100-82~20.04                amd64        Radeon Open Compute (ROCm) Runtime software stack

 one thing I noticed, not sure if it matters, is that proxmox seems to keep changing the group of /dev/dri/renderD128 to _chrony
Code:
total 0
drwxr-xr-x 2 root root          80 Apr 23 18:07 by-path
crw-rw---- 1 root video  226,  0 Apr 23 18:07 card0
crw-rw---- 1 root _chrony 226, 128 Apr 23 18:07 renderD128
it seems to be doing this within the same reboot of changing it to render


RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - eivarin - 2024-04-25

(2024-04-23, 09:35 PM)TheDreadPirate Wrote: And you installed all the Intel required drivers on the Proxmox host?

Check out the link from my previous post and double check you completed the steps outlined for Proxmox.

What are the required drivers for my igpu? I have searched and the  results say that the drivers should already be installed with the linux kernel  but i am a bit clueless to whether they are or not installed.
Transcoding without tonemapping works as i said. The problem comes from tone-mapping.


RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - TheDreadPirate - 2024-04-25

(2024-04-25, 08:25 PM)eivarin Wrote:
(2024-04-23, 09:35 PM)TheDreadPirate Wrote: And you installed all the Intel required drivers on the Proxmox host?

Check out the link from my previous post and double check you completed the steps outlined for Proxmox.

What are the required drivers for my igpu? I have searched and the  results say that the drivers should already be installed with the linux kernel  but i am a bit clueless to whether they are or not installed.
Transcoding without tonemapping works as i said. The problem comes from tone-mapping.

When you are inside the container, what is the output of

Code:
sudo /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device opencl@va



RE: [UHD Graphics 605]Tone Mapping with opencl inside a proxmox lxc crashes transcoding. - eivarin - 2024-04-25

(2024-04-25, 09:16 PM)TheDreadPirate Wrote:
(2024-04-25, 08:25 PM)eivarin Wrote:
(2024-04-23, 09:35 PM)TheDreadPirate Wrote: And you installed all the Intel required drivers on the Proxmox host?

Check out the link from my previous post and double check you completed the steps outlined for Proxmox.

What are the required drivers for my igpu? I have searched and the  results say that the drivers should already be installed with the linux kernel  but i am a bit clueless to whether they are or not installed.
Transcoding without tonemapping works as i said. The problem comes from tone-mapping.

When you are inside the container, what is the output of

Code:
sudo /usr/lib/jellyfin-ffmpeg/ffmpeg -v verbose -init_hw_device vaapi=va:/dev/dri/renderD128 -init_hw_device opencl@va


Code:
ffmpeg version 5.1.4-Jellyfin Copyright (c) 2000-2023 the FFmpeg developers
  built with gcc 11 (Ubuntu 11.4.0-1ubuntu1~22.04)
  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-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-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 @ 0x55dcb48914c0] libva: VA-API version 1.20.0
[AVHWDeviceContext @ 0x55dcb48914c0] libva: Trying to open /usr/lib/jellyfin-ffmpeg/lib/dri/iHD_drv_video.so
[AVHWDeviceContext @ 0x55dcb48914c0] libva: Found init function __vaDriverInit_1_20
[AVHWDeviceContext @ 0x55dcb48914c0] libva: va_openDriver() returns 0
[AVHWDeviceContext @ 0x55dcb48914c0] Initialised VAAPI connection: version 1.20
[AVHWDeviceContext @ 0x55dcb48914c0] VAAPI driver: Intel iHD driver for Intel(R) Gen Graphics - 24.1.1 (f5f09c4).
[AVHWDeviceContext @ 0x55dcb48914c0] Driver not found in known nonstandard list, using standard behaviour.
[AVHWDeviceContext @ 0x55dcb48b5fc0] 0.0: Intel(R) OpenCL HD Graphics / Intel(R) UHD Graphics 605 [0x3184]
[AVHWDeviceContext @ 0x55dcb48b5fc0] Intel QSV to OpenCL mapping function found (clCreateFromVA_APIMediaSurfaceINTEL).
[AVHWDeviceContext @ 0x55dcb48b5fc0] Intel QSV in OpenCL acquire function found (clEnqueueAcquireVA_APIMediaSurfacesINTEL).
[AVHWDeviceContext @ 0x55dcb48b5fc0] Intel QSV in OpenCL release function found (clEnqueueReleaseVA_APIMediaSurfacesINTEL).
Hyper fast Audio and Video encoder
usage: ffmpeg [options] [[infile options] -i infile]... {[outfile options] outfile}...

Use -h to get full help or, even better, run 'man ffmpeg