[Bug]: B580 / Battlemage: VAAPI initialization crashes with SIGBUS in iHD_drv_video.so on DRM render node
- Dominant language
- C
- Stars
- 1.2k
- Forks
- 383
- Avg merge
- 8d 18h
- Merged PRs (30d)
- 4
Description
### Which component impacted?
Decode, Not sure
### Is it regression? Good in old configuration?
None
### What happened?
**AI Disclaimer - I'm not a Dev or well versed in Dev work apologies ahead of time**
### Summary
VAAPI initialization crashes with `Bus error (core dumped)` on Intel Battlemage G21 / Arc B580 when using the Intel `iHD` driver on the DRM render node.
This reproduces consistently with both:
```bash
vainfo --display drm --device /dev/dri/renderD128
```
```bash
ffmpeg -hide_banner -init_hw_device vaapi=va:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_device va -f lavfi -i testsrc2=size=128x128:rate=1 -frames:v 1 -f null -
```
### What happens
`libva` successfully:
- selects the DRM display path
- opens `/usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so`
- finds `__vaDriverInit_1_22` or `__vaDriverInit_1_23` depending on userspace stack version
The process then immediately terminates with:
```text
Bus error (core dumped)
```
### Expected result
VAAPI should initialize successfully and return supported profiles / entrypoints, or FFmpeg should complete VAAPI device initialization without crashing.
### What's the usage scenario when you are seeing the problem?
Others
### What impacted?
VAAPI is unusable on this system for Intel hardware acceleration.
Impacted examples:
- `vainfo` cannot enumerate capabilities
- `ffmpeg` cannot initialize a VAAPI device
- any application relying on VAAPI initialization through `iHD` is likely affected
This blocks validation and use of hardware accelerated media decode and encode workflows on this B580 system.
### Debug Information
### Hardware
- GPU: Intel Battlemage G21 / Arc B580
- Kernel driver in use: `xe`
### Reproduction steps
1. Set Intel VA driver:
```bash
export LIBVA_DRIVER_NAME=iHD
```
2. Run:
```bash
vainfo --display drm --device /dev/dri/renderD128
```
3. Also reproduces with:
```bash
ffmpeg -hide_banner -init_hw_device vaapi=va:/dev/dri/renderD128 -hwaccel vaapi -hwaccel_device va -f lavfi -i testsrc2=size=128x128:rate=1 -frames:v 1 -f null -
```
### Example output from `vainfo`
```text
Trying display: drm
libva info: VA-API version 1.24.0
libva info: User environment variable requested driver 'iHD'
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: Found init function __vaDriverInit_1_22
Bus error (core dumped)
```
### Example output from `ffmpeg`
```text
Bus error (core dumped)
```
### Debugging already performed
I ruled out the following local causes:
- incorrect `LIBVA_DRIVERS_PATH` / `LIBVA_DRIVER_NAME`
- Wayland specific display path issues
- stale `/usr/local` Intel media libraries
- bad direct dependency resolution for `libigdgmm`
I had previously found stale locally installed Intel libraries under `/usr/local`, including:
- `libigdgmm.so.12`
- `libigfxcmrt.so`
These were moved out of the runtime path and `ldconfig` was re-run. After cleanup, `ldd /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so` resolved `libigdgmm.so.12` from the packaged system path rather than `/usr/local`. The crash still reproduced afterward.
### Userspace stacks tested
#### Newer stack
- `intel-media-va-driver-non-free 26.1.4`
- `libva 2.23.0`
- `libigdgmm12 22.9.0`
Behavior:
- `vainfo` loads iHD
- finds `__vaDriverInit_1_23`
- crashes with SIGBUS / Bus error
#### Older stack
- `intel-media-va-driver-non-free 25.2.3`
- `libva 2.22.0`
- `libigdgmm12 22.8.1`
Behavior:
- `vainfo` loads iHD
- finds `__vaDriverInit_1_22`
- crashes with SIGBUS / Bus error
So the problem reproduces across both newer and older userspace combinations.
### GDB backtrace summary
The crash occurs inside `iHD_drv_video.so` during driver initialization called from `vaInitialize()`.
Relevant frames:
```text
#11 __vaDriverInit_1_23() from /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
#12 va_openDriver() at ../va/va.c:478
#13 va_new_opendriver() at ../va/va.c:714
#14 vaInitialize() at ../va/va.c:743
```
With the older stack the symbol was `__vaDriverInit_1_22`, but the failure mode was the same.
The stopping point in GDB was:
```text
__memset_avx2_unaligned_erms
```
which suggests the driver may be passing an invalid pointer or size during initialization.
### Additional notes
This reproduces with direct DRM render node access and is not limited to `vainfo`, since `ffmpeg` VAAPI device initialization also crashes.
What’s the usage scenario when you are seeing the problem?
Any workload that initializes VAAPI on Intel Battlemage B580 using the iHD driver. Reproduces with both vainfo and ffmpeg on the DRM render node before actual decode or encode work begins.
### Do you want to contribute a patch to fix the issue?
No.
Contributor guide
Assessment
This issue has not been assessed yet.