[Bug]: VAAPI in Container with WSL2 Windows not working
- Dominant language
- C
- Stars
- 1.2k
- Forks
- 383
- Avg merge
- 8d 18h
- Merged PRs (30d)
- 4
Description
### Which component impacted?
Not sure
### Is it regression? Good in old configuration?
No, this issue exist a long time
### What happened?

docker-compose.yml
services:
frigate:
container_name: frigate
privileged: true # this may not be necessary for all setups
restart: unless-stopped
image: ghcr.io/blakeblackshear/frigate:stable
shm_size: "80mb" # update for your cameras based on calculation above
devices:
#- /dev/bus/usb:/dev/bus/usb # Passes the USB Coral, needs to be modified for other versions
#- /dev/apex_0:/dev/apex_0 # Passes a PCIe Coral, follow driver instructions here https://coral.ai/docs/m2/get-started/#2a-on-linux
#- /dev/video11:/dev/video11 # For Raspberry Pi 4B
- /dev/dri/renderD128:/dev/dri/renderD128 # For intel hwaccel, needs to be updated for your hardware
- /dev/dri/card0:/dev/dri/card0
- /dev/dri/:/dev/dri/
- /dev/dxg/:/dev/dxg
volumes:
- /etc/localtime:/etc/localtime:ro
- ./config:/config
- ./media:/media/frigate
- type: tmpfs # Optional: 1GB of memory, reduces SSD/SD Card wear
target: /tmp/cache
tmpfs:
size: 1000000000
ports:
- "5000:5000"
- "8554:8554" # RTSP feeds
- "8555:8555/tcp" # WebRTC over tcp
- "8555:8555/udp" # WebRTC over udp
environment:
- TZ=Europe/Berlin
- LIBVA_DRIVER_NAME=d3d12
- LD_LIBRARY_PATH=/usr/lib/wsl/lib
#- FRIGATE_RTSP_PASSWORD: "password"
### What's the usage scenario when you are seeing the problem?
Others
### What impacted?
_No response_
### Debug Information
# vainfo
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
error: can't connect to X server!
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/vgem_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
# apt list mesa-va-drivers -a
Listing... Done
mesa-va-drivers/now 22.3.6-1+deb12u1 amd64 [installed,local]
mesa-va-drivers/oldstable 20.3.5-1 amd64
# vainfo --display drm --device /dev/dri/card0
libva info: VA-API version 1.17.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/vgem_drv_video.so
libva info: va_openDriver() returns -1
vaInitialize failed with error code -1 (unknown libva error),exit
# ^C
# ls /dev/dri
card0 renderD128
# ^C
# lspci -nn |grep -Ei 'VGA|DISPLAY'
/bin/sh: 12: lspci: not found
#
### Do you want to contribute a patch to fix the issue?
None
Contributor guide
Assessment
This issue has not been assessed yet.