vaapi: Skip 'nvidia-drm' to block `nvidia_drv_video` on NVIDIA GPUs [chromium/src : main]

966 views
Skip to first unread message

Jianhui J Dai (Gerrit)

unread,
Oct 12, 2023, 4:41:26 AM10/12/23
to chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Quang Minh Phan

Jianhui J Dai has uploaded this change for review.

View Change

vaapi: Skip 'nvidia-drm' to block `nvidia_drv_video` on NVIDIA GPUs

This CL skips 'nvidia-drm' to block `nvidia_drv_video` on NVIDIA GPUs
[1], because it does not support Chromium [2] and can crash in
`vaInitialize()`.

[1] https://github.com/intel/libva/blob/b4870fdfe2d41b579036dae280dfc7a5e732127f/va/drm/va_drm_utils.c#L67
[2] https://github.com/elFarto/nvidia-vaapi-driver/tree/v0.0.10#chrome

Bug: 1478925
Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
---
M media/gpu/vaapi/vaapi_wrapper.cc
1 file changed, 8 insertions(+), 54 deletions(-)


To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>

Andres Calderon Jaramillo (Gerrit)

unread,
Oct 13, 2023, 2:34:11 PM10/13/23
to Jianhui J Dai, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Jianhui J Dai.

View Change

1 comment:

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Comment-Date: Fri, 13 Oct 2023 18:34:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Miguel Casas (Gerrit)

unread,
Oct 13, 2023, 5:51:00 PM10/13/23
to Jianhui J Dai, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Andres Calderon Jaramillo, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Jianhui J Dai.

View Change

1 comment:

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Comment-Date: Fri, 13 Oct 2023 21:50:51 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No

Jianhui J Dai (Gerrit)

unread,
Oct 15, 2023, 9:38:24 PM10/15/23
to chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Miguel Casas, Andres Calderon Jaramillo, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Andres Calderon Jaramillo, Miguel Casas, Quang Minh Phan.

View Change

2 comments:

  • Patchset:

    • Patch Set #1:

      Q: is this still needed after https://bugs.chromium. […]

      Thanks for reviewing.

      This CL is less prioritized now that the PartitionAlloc CL has fixed the crash.

      However, I will continue working on it to clean up the hard code, and use --disable-gpu-driver-bug-workarounds to block VA on NVIDIA GPUs.

  • File media/gpu/vaapi/vaapi_wrapper.cc:

    • I like this solution better than ToT because it's simpler, […]

      Right.

      We should use --disable-gpu-driver-bug-workarounds to disable certain drivers instead of hard-coding the workaround.

      I will submit a new patchset for this change.

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-Attention: Miguel Casas <mca...@google.com>
Gerrit-Comment-Date: Mon, 16 Oct 2023 01:38:15 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Andres Calderon Jaramillo <andr...@chromium.org>
Comment-In-Reply-To: Miguel Casas <mca...@google.com>

Jianhui J Dai (Gerrit)

unread,
Oct 17, 2023, 4:11:10 AM10/17/23
to chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Miguel Casas, Andres Calderon Jaramillo, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Andres Calderon Jaramillo, Miguel Casas, Quang Minh Phan.

View Change

1 comment:

  • File media/gpu/vaapi/vaapi_wrapper.cc:

    • Right. […]

      Just realized that `gpu::GpuDriverBugWorkarounds` is not available in `VaapiWrapper`.

      It's not trivial to pass `gpu::GpuDriverBugWorkarounds`, especially for Utility Process, see the POC CL [1].

      Should we just use media_switches instead, or continue refine and implement the CL [1]?


      [1] [POC] Pass `gpu::GpuDriverBugWorkarounds` to `VaapiWrapper` (4945770) · Gerrit Code Review
      https://chromium-review.googlesource.com/c/chromium/src/+/4945770

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-Attention: Miguel Casas <mca...@google.com>
Gerrit-Comment-Date: Tue, 17 Oct 2023 08:10:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Miguel Casas <mca...@google.com>
Comment-In-Reply-To: Jianhui J Dai <jianhu...@intel.com>

Miguel Casas-Sanchez (Gerrit)

unread,
Oct 18, 2023, 11:50:14 AM10/18/23
to Jianhui J Dai, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Miguel Casas, Andres Calderon Jaramillo, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Andres Calderon Jaramillo, Jianhui J Dai, Miguel Casas, Quang Minh Phan.

View Change

1 comment:

  • File media/gpu/vaapi/vaapi_wrapper.cc:

    • Just realized that `gpu::GpuDriverBugWorkarounds` is not available in `VaapiWrapper`. […]

      Reading "This CL is less prioritized now that the PartitionAlloc
      CL has fixed the crash." - I understand that now we don't need
      to avoid touching the nVidia backend, only avoid using it
      for de/encoding, correct? IOW ToT has to use the function
      IsBrokenNvidiaVaapiDriverPresent() to prevent trying to enumerate
      supported profiles because that crashes, correct? But after the
      PartitionAlloc fix, it shouldn't crash anymore, correct?

      If yes and the crash is fixed, then we can just remove all the
      IsBrokenNvidiaVaapiDriverPresent() and associated code, let
      Chromium use the nVidia backend, and enumerate supported profiles,
      and use the gpu-driver-bug-workaround to disable all encode and
      decode profiles (something similar to [1]). Again, this will
      prevent the normal user from using nVidia backends, will make
      such situation evident in chrome:gpu, and will allow developers
      to keep developing by running any Chrome build with
      --disable-gpu-driver-bug-workarounds.

      WDYT?

      [1] https://source.chromium.org/chromium/chromium/src/+/main:gpu/config/gpu_driver_bug_list.json;l=3722-3739

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-Attention: Miguel Casas <mca...@google.com>
Gerrit-Attention: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Comment-Date: Wed, 18 Oct 2023 15:50:06 +0000

Quang Minh Phan (Gerrit)

unread,
Oct 18, 2023, 11:56:33 AM10/18/23
to Jianhui J Dai, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Miguel Casas-Sanchez, Miguel Casas, Andres Calderon Jaramillo, Chromium LUCI CQ, chromium...@chromium.org

Attention is currently required from: Andres Calderon Jaramillo, Jianhui J Dai, Miguel Casas, Miguel Casas-Sanchez.

View Change

1 comment:

  • File media/gpu/vaapi/vaapi_wrapper.cc:

    • IOW ToT has to use the function


    • IsBrokenNvidiaVaapiDriverPresent() to prevent trying to enumerate
      supported profiles because that crashes, correct? But after the
      PartitionAlloc fix, it shouldn't crash anymore, correct?

    • If yes and the crash is fixed, then we can just remove all the
      IsBrokenNvidiaVaapiDriverPresent() and associated code, let
      Chromium use the nVidia backend, and enumerate supported profiles,
      and use the gpu-driver-bug-workaround to disable all encode and
      decode profiles (something similar to [1]).

    • There are actually two known different NVIDIA VA-API drivers in existence. The first one is `vdpau-va-driver` which has been unmaintained for over 10 years now and will always crash with or without the PartitionAlloc fix (and is what's being detected by `IsBrokenNvidiaVaapiDriverPresent`). The second one, `nvidia-vaapi-driver` does not work with Chromium right now but it does not have any crashing bugs either - it just so happens to trigger a PartitionAlloc bug in component builds.

      CL that added `IsBrokenNvidiaVaapiDriverPresent`: CL:4790147

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-Attention: Miguel Casas <mca...@google.com>
Gerrit-Attention: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Comment-Date: Wed, 18 Oct 2023 15:56:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Miguel Casas-Sanchez <mca...@chromium.org>

Jianhui J Dai (Gerrit)

unread,
Oct 19, 2023, 3:37:17 AM10/19/23
to chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Miguel Casas-Sanchez, Miguel Casas, Andres Calderon Jaramillo, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Andres Calderon Jaramillo, Miguel Casas, Miguel Casas-Sanchez, Quang Minh Phan.

View Change

1 comment:

  • File media/gpu/vaapi/vaapi_wrapper.cc:

    • > IOW ToT has to use the function […]

      As @phanquangminh217 said, there are two VA-API drivers on NVIDIA GPUs:

      • nvidia-vaapi-driver: This driver does not work with Chromium right now, but it does not have any crashing bugs either. No actions are required after CL:4930940.
      • vdpau-va-driver: This driver crashes in vaInitialize at the PreSandbox stage. IsBrokenNvidiaVaapiDriverPresent is used to block it (CL:4790147). And Chromium does not have a change to know its supported profiles.

      I agree that Chromium should not block any VA-API drivers by hard code. It should leave some flags for developers to continue improving the VA-API driver, even if that driver is unmaintained for years.

      I am thinking of using a new feature flag `disable_vaapi_on_nvidia_gpus` in gpu-driver-bug-workaround to implement the same logic as in CL:4790147.

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-Attention: Miguel Casas <mca...@google.com>
Gerrit-Comment-Date: Thu, 19 Oct 2023 07:37:08 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Quang Minh Phan <phanquan...@gmail.com>

Miguel Casas-Sanchez (Gerrit)

unread,
Oct 20, 2023, 7:02:10 PM10/20/23
to Jianhui J Dai, chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Miguel Casas, Andres Calderon Jaramillo, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Andres Calderon Jaramillo, Jianhui J Dai, Miguel Casas, Quang Minh Phan.

View Change

1 comment:

  • File media/gpu/vaapi/vaapi_wrapper.cc:

    • As @phanquangminh217 said, there are two VA-API drivers on NVIDIA GPUs: […]

      Thanks for the explanation folks, it wasn't fully clear to me that
      both drivers failed in such different ways. Some ideas:

      • For nvidia-vaapi-driver, since it's OK to use for enumeration
      • but it fails to actually work, I'd vote for the route of disabling
      • via gpu/config/gpu_driver_bug_list.json because it's very evident
      • why it's disabled and is straightforward for developers to bypass
      • it (via --disable-gpu-driver-bug-workarounds, again).
      • For vdpau-va-driver (which is crashy and we don't want to
      • touch), could we avoid calling VaapiWrapper::PreSandboxInitialization()
      • entirely, by using gpu_prefs.disable_accelerated_video_decode [1] ?
      • I'm not sure if that route would be possible, we might need to wire
      • gpu_info_.active_gpu() into those lines. Basically I'd rather rely
      • on existing gpu/ ways to work, because developers are familiar with
      • those. WDYT?

      [1] https://source.chromium.org/chromium/chromium/src/+/main:content/gpu/gpu_main.cc;l=159-160;drc=66b2fa5ba509acd4bf4568c41b56e3b96207360b


      Could I ask for either of you to add a summary of the two kinds
      of drivers and their respective state in the doc
      https://chromium.googlesource.com/chromium/src/+/main/docs/gpu/vaapi.md#vaapi-on-linux ? (In another CL would be fine) Thanks heaps.

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-Attention: Miguel Casas <mca...@google.com>
Gerrit-Attention: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Comment-Date: Fri, 20 Oct 2023 23:02:02 +0000

Jianhui J Dai (Gerrit)

unread,
Oct 23, 2023, 9:31:47 PM10/23/23
to chromeos-gfx-...@google.com, feature-me...@chromium.org, media-cro...@chromium.org, poscia...@chromium.org, vaapi-...@chromium.org, Miguel Casas-Sanchez, Miguel Casas, Andres Calderon Jaramillo, Chromium LUCI CQ, Quang Minh Phan, chromium...@chromium.org

Attention is currently required from: Andres Calderon Jaramillo, Miguel Casas, Miguel Casas-Sanchez, Quang Minh Phan.

View Change

1 comment:

  • File media/gpu/vaapi/vaapi_wrapper.cc:

    • Thanks for the explanation folks, it wasn't fully clear to me that […]

      Sure.
      We will use gpu_prefs/gpu_driver_bug_list to block the drivers, and then update the vaapi.md#vaapi-on-linux.

To view, visit change 4933644. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: Id64db9bc6cf4642e8e3466eb8e44c3a1564f49d9
Gerrit-Change-Number: 4933644
Gerrit-PatchSet: 1
Gerrit-Owner: Jianhui J Dai <jianhu...@intel.com>
Gerrit-Reviewer: Jianhui J Dai <jianhu...@intel.com>
Gerrit-CC: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-CC: Miguel Casas <mca...@google.com>
Gerrit-CC: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-CC: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Quang Minh Phan <phanquan...@gmail.com>
Gerrit-Attention: Andres Calderon Jaramillo <andr...@chromium.org>
Gerrit-Attention: Miguel Casas-Sanchez <mca...@chromium.org>
Gerrit-Attention: Miguel Casas <mca...@google.com>
Gerrit-Comment-Date: Tue, 24 Oct 2023 01:31:35 +0000
Reply all
Reply to author
Forward
0 new messages