[Wayland][VA-API] Wrong device used for decoding in multi-GPU setup
Categories
(Core :: Audio/Video: Playback, defect, P5)
Tracking
()
Tracking | Status | |
---|---|---|
firefox-esr68 | --- | unaffected |
firefox73 | --- | unaffected |
firefox74 | --- | unaffected |
firefox75 | --- | disabled |
firefox76 | --- | disabled |
People
(Reporter: jan, Unassigned)
References
(Blocks 1 open bug)
Details
(Keywords: nightly-community)
Attachments
(3 files)
KDE, Debian Testing (Desktop Computer)
VAAPI uses integrated Intel graphics instead of my Radeon RX480 which leads to broken appearance. Disabling "Integrated Video" in BIOS fixes it.
Both devices are present before disabling "Integrated Video":
$ ls /dev/dri
by-path card0 card1 renderD128 renderD129
$ vainfo --display drm --device /dev/dri/renderD128
libva info: VA-API version 1.6.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_5
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.6 (libva 2.6.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Kaby Lake - 2.4.0
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Simple : VAEntrypointEncSlice
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264ConstrainedBaseline: VAEntrypointEncSliceLP
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointEncSliceLP
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointEncSliceLP
VAProfileH264MultiviewHigh : VAEntrypointVLD
VAProfileH264MultiviewHigh : VAEntrypointEncSlice
VAProfileH264StereoHigh : VAEntrypointVLD
VAProfileH264StereoHigh : VAEntrypointEncSlice
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointEncPicture
VAProfileVP8Version0_3 : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
$ vainfo --display drm --device /dev/dri/renderD129
libva info: VA-API version 1.6.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_6
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.6 (libva 2.6.0)
vainfo: Driver version: Mesa Gallium driver 19.3.3 for AMD Radeon (TM) RX 480 Graphics (POLARIS10, DRM 3.35.0, 5.4.0-4-amd64, LLVM 9.0.1)
vainfo: Supported profile and entrypoints
VAProfileMPEG2Simple : VAEntrypointVLD
VAProfileMPEG2Main : VAEntrypointVLD
VAProfileVC1Simple : VAEntrypointVLD
VAProfileVC1Main : VAEntrypointVLD
VAProfileVC1Advanced : VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
Reporter | ||
Comment 1•5 years ago
|
||
Reporter | ||
Comment 2•5 years ago
|
||
Reporter | ||
Comment 3•5 years ago
•
|
||
Device can't be enforced/overwritten by env var: https://github.com/intel/libva/issues/221
Comment 4•5 years ago
|
||
Okay, looks like we need to implement better vaDisplay management. I have it in my WIP patches.
Comment 6•5 years ago
|
||
When Bug 1630754 lands you may be able to use MOZ_WAYLAND_DRM_DEVICE to set requested DRM device for dmabuf/vaapi. I don't know if there's any better mechanism how to select a drm device for an application on linux.
Comment 7•5 years ago
|
||
Jan, can you check it again with latest nightly?
Thanks.
Comment 11•4 years ago
|
||
it's happening for me too on EGL (xorg) with intel+amd config.
I could fix it in bios, but it's not possible for everyone.
I am on firefox stable last version.
I have been like 1 hour trying to make it works, researching and anything helped.
I knew that vaapi was not working because of the output of :
cat /sys/kernel/debug/dri/1/amdgpu_pm_info
Comment 12•4 years ago
|
||
(In reply to albertogomezmarin from comment #11)
it's happening for me too on EGL (xorg) with intel+amd config.
I could fix it in bios, but it's not possible for everyone.
I am on firefox stable last version.I have been like 1 hour trying to make it works, researching and anything helped.
I knew that vaapi was not working because of the output of :
cat /sys/kernel/debug/dri/1/amdgpu_pm_info
Have you tried using MOZ_WAYLAND_DRM_DEVICE=/dev/dri/by-path/"add something here" ? It works for me with AMD+AMD.
Comment 13•4 years ago
|
||
Jan, can you please try to enable both gfx cards, run Firefox with Wayland/WebRender on your AMD card and attach content of about:support?
Thanks.
Reporter | ||
Comment 14•4 years ago
|
||
This was not related to Wayland, but due to renderD128 being hardcoded.
- /dev/dri/renderD128 was the Intel APU (no monitor plugged into the mainboard)
- /dev/dri/renderD129 was the AMD GPU (1 monitor plugged into the Radeon) -> This was the only GPU shown on about:support. bug 1676883 will detect multiple GPUs on Linux.
VAAPI and DMABUF WebGL tried to use hardcoded renderD128 - and not the Radeon Firefox ran on.
- I assume DMABUF WebGL falls back to readback
- VAAPI looked like comment 0 (decoding on hardcoded/wrong renderD128, WebRender on renderD129)
Since Wayland VAAPI switched to DRM, I assume it is affected again.
Previous vaGetDisplayWl (comment 6) had the required DRM detection inside (bug 1588904 comment 7).
Comment 15•4 years ago
|
||
(In reply to Darkspirit from comment #14)
This was not related to Wayland, but due to renderD128 being hardcoded.
- /dev/dri/renderD128 was the Intel APU (no monitor plugged into the mainboard)
- /dev/dri/renderD129 was the AMD GPU (1 monitor plugged into the Radeon) -> This was the only GPU shown on about:support. bug 1676883 will detect multiple GPUs on Linux.
VAAPI and DMABUF WebGL tried to use hardcoded renderD128 - and not the Radeon Firefox ran on.
- I assume DMABUF WebGL falls back to readback
- VAAPI looked like comment 0 (decoding on hardcoded/wrong renderD128, WebRender on renderD129)
Since Wayland VAAPI switched to DRM, I assume it is affected again.
Previous vaGetDisplayWl (comment 6) had the required DRM detection inside (bug 1588904 comment 7).
Yes, but I need to see your about:support page to see how the GFX cards are detected by Firefox.
Comment 16•4 years ago
|
||
btw. If Firefox is already running on a correct device we just need to use the same for dmabuf. That's that I want to see at about:support, how is the used card identified there.
Description
•