Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - 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: Couldn't Enable Hardware Acceleration with VAAPI on WSL2 (/t-couldn-t-enable-hardware-acceleration-with-vaapi-on-wsl2) |
Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - SessionID - 2024-01-02 Hi, I discovered Jellyfin recently and loved it. But I've encountered with a problem that makes the software unusable for me so I would really appreciate if we can find a way to solve it. I use Windows 11 Pro 23H2 with WSL2 and I have an AMD Ryzen 9 CPU with integrated graphics. If I just use the installer for Windows and enable the hardware acceleration, it will work without any problem. But I want to install Jellyfin as a Docker container inside WSL2. It really seems doable since WSL2 supports D3D12 GPU video acceleration. But I couldn't manage to work it. I followed this guide from Microsoft to enable hardware acceleration: https://devblogs.microsoft.com/commandline/d3d12-gpu-video-acceleration-in-the-windows-subsystem-for-linux-now-available/ Here is the vainfo output at WSL2 terminal, everything seems perfect until now: Code: $ vainfo --display drm --device /dev/dri/card0 So I thought I could just map the device to Docker container and make it work. Here is my Docker Compose file: Code: version: '3.5' With this configuration, Jellyfish runs perfect. I can use it with software encoding, it functions great. But things get really confusing when I enable VAAPI. My playback settings after I enable VAAPI: When I try to play a video with these settings, I get "This client isn't compatible with the media and the server isn't sending a compatible media format" error. I can see some details when I check ffmpeg logs. It is not so useful but I guess better than nothing: Code: /usr/lib/jellyfin-ffmpeg/ffmpeg -analyzeduration 200M -init_hw_device vaapi=va:/dev/dri/card0 -filter_hw_device va -hwaccel vaapi -hwaccel_output_format vaapi -autorotate 0 -i file:"sample.mkv" -autoscale 0 -map_metadata -1 -map_chapters -1 -threads 0 -map 0:0 -map 0:1 -map -0:s -codec:v:0 h264_vaapi -rc_mode VBR -b:v 3722355 -maxrate 3722355 -bufsize 7444710 -force_key_frames:0 "expr:gte(t,0+n_forced*3)" -vf "setparams=color_primaries=bt709:color_trc=bt709:colorspace=bt709,scale_vaapi=format=nv12:extra_hw_frames=24" -codec:a:0 libfdk_aac -ac 2 -ab 71958 -ar 48000 -copyts -avoid_negative_ts disabled -max_muxing_queue_size 2048 -f hls -max_delay 5000000 -hls_time 3 -hls_segment_type mpegts -start_number 0 -hls_segment_filename "/config/data/transcodes/c22dfb1580de3e13a974967922d10a39%d.ts" -hls_playlist_type vod -hls_list_size 0 -y "/config/data/transcodes/c22dfb1580de3e13a974967922d10a39.m3u8" My vainfo output in the container is as follows: Code: $ docker exec -it -e PUID=1000 -e PGID=1000 jellyfin /bin/sh At this point, I am not quite sure what I am doing wrong. I have a feeling like maybe d3d12 driver is not supported with Jellyfin, since the driver is not available under /usr/lib/jellyfin-ffmpeg/lib/dri and it falls back to /usr/lib/x86_64-linux-gnu/dri. How can we solve this issue? My real intention is using Jellyfin with CasaOS under WSL2. I guess it would help lots of people who is in the same situation with me. Thanks. RE: Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - Serge K - 2024-01-02 try non docker Jellyfin server For me, I don't like the Docker version because it has very little room for experimentation. The feeling of hands being tied)))) RE: Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - SessionID - 2024-01-02 (2024-01-02, 02:50 PM)Serge K Wrote: try non docker Jellyfin server It is definitely a great solution for vanilla Jellyfin users, and I would go this way if only I don't use CasaOS. But CasaOS seems kinda dependent to Docker instances, which leaves me with no option other than making it work RE: Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - Serge K - 2024-01-02 read this may be help https://github.com/pdulvp/jellyfin-qnap RE: Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - chlorophycae - 2024-01-25 services: jellyfin: privileged: true RE: Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - dzmbbs - 2024-10-08 Hi, I turned on Hardware Acceleration with VAAPI on WSL2 Docker and can convert hevc to h264. Device: Windows11 + Docker in WSL2 + Jellyfin. First modify docker-compose.yml. 1. Add /usr/lib/wsl to volumes. 2. Add /dev/dxg to devices. 3. Add environment.
Then install dependencies in the jellyfin container.
Finally restart the container.
Refer to: https://github.com/microsoft/wslg/blob/main/samples/container/Containers.md#containerized-applications-access-to-vgpu-accelerated-video and https://jellyfin.org/docs/general/administration/hardware-acceleration/amd/#configure-with-linux-virtualization RE: Couldn't Enable Hardware Acceleration with VAAPI on WSL2 - nyanmisaka - 2024-10-08 Run hardware acceleration natively on Windows, instead of using WSL2. HWA on WSL2 is not supported by us, nor is it officially supported by Intel (QuickSync) or AMD (AMF). NVIDIA does claim full CUDA + NV{ENC/DEC} support for WSL2, but you're on your own. |