Closed Bug 1622132 Opened 5 years ago Closed 4 years ago

[Wayland][VA-API] Wrong device used for decoding in multi-GPU setup

Categories

(Core :: Audio/Video: Playback, defect, P5)

x86_64
Linux
defect

Tracking

()

RESOLVED DUPLICATE of bug 1588904
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
Attached file log.txt

Device can't be enforced/overwritten by env var: https://github.com/intel/libva/issues/221

Okay, looks like we need to implement better vaDisplay management. I have it in my WIP patches.

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.

Jan, can you check it again with latest nightly?
Thanks.

Flags: needinfo?(jan)

Bug 1630754 does not have any effect here.

Flags: needinfo?(jan)
See Also: → 1667537
See Also: 1667537

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

(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.

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.

Flags: needinfo?(jan)

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).

Status: NEW → RESOLVED
Closed: 4 years ago
Flags: needinfo?(jan)
Resolution: --- → DUPLICATE

(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.

Flags: needinfo?(jan)

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.

Okay, no need for the about:support.

Flags: needinfo?(jan)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: