You are not logged in.

#26 2023-12-22 00:45:19

tekstryder
Member
Registered: 2013-02-14
Posts: 132

Re: Chrome 120 Vulkan+nVidia+Wayland

wavefront wrote:

If you run Chrome stable in a Wayland session with Ozone platform Wayland, your "GL implementation parts" should default to " gl=egl-angle,angle=opengl".

Correct. But... that's also the laggy, unusable UI with all the Vulkan errors which was the impetus of the thread.

I just tooled around with a few switches, and this combo yields error-free, fairly performant (albeit with no GPU acceleration), perfectly usable Chrome/Chromium browser:

$ /usr/bin/google-chrome-stable --use-gl=angle --use-angle=swiftshader --disable-vulkan-surface

I ran a few of the popular browser benchmarks and it performs fairly well:

• Jetstream 377
• Motionmark 1487.50
• Speedometer 416

To reiterate, this is a pure Wayland shell with no Xwayland.

Aside from Preferred Ozone platform set to Wayland in chrome://flags, no other setting is modified from default.

$ /usr/bin/google-chrome-stable --use-gl=angle --use-angle=swiftshader --disable-vulkan-surface
*** no console errors!!! ***

Graphics Feature Status
=======================
*   Canvas: Hardware accelerated
*   Canvas out-of-process rasterization: Enabled
*   Direct Rendering Display Compositor: Disabled
*   Compositing: Software only. Hardware acceleration disabled
*   Multiple Raster Threads: Enabled
*   OpenGL: Enabled
*   Rasterization: Hardware accelerated
*   Raw Draw: Disabled
*   Skia Graphite: Disabled
*   Video Decode: Software only. Hardware acceleration disabled
*   Video Encode: Software only. Hardware acceleration disabled
*   Vulkan: Enabled
*   WebGL: Hardware accelerated but at reduced performance
*   WebGL2: Hardware accelerated but at reduced performance
*   WebGPU: Disabled

GL implementation parts         : (gl=egl-angle,angle=swiftshader)
Display type                    : ANGLE_SWIFTSHADER
GL_RENDERER                     : ANGLE (Google, Vulkan 1.3.0 (SwiftShader Device (Subzero) (0x0000C0DE)), SwiftShader driver-5.0.0)
GL_VERSION                      : OpenGL ES 2.0.0 (ANGLE 2.1.22152 git hash: 4ae5f681dfe6)

Last edited by tekstryder (2023-12-22 16:26:52)

Offline

#27 2023-12-22 08:44:12

seth
Member
Registered: 2012-09-03
Posts: 51,649

Re: Chrome 120 Vulkan+nVidia+Wayland

swiftshader is googles software vulkan implementation, ie. akin to lavapipe, https://wiki.archlinux.org/title/Vulkan … _rendering
It's most likely not actually HW acclerated (you could check nvidia-smi on how much the chromium processes use what parts of the GPU)

Offline

#28 2023-12-22 16:16:03

tekstryder
Member
Registered: 2013-02-14
Posts: 132

Re: Chrome 120 Vulkan+nVidia+Wayland

seth wrote:

swiftshader is googles software vulkan implementation, ie. akin to lavapipe, https://wiki.archlinux.org/title/Vulkan … _rendering

Yes, I saw that wiki. I went off the rather well-documented source code, and a list of Chromium switch descriptions.

seth wrote:

It's most likely not actually HW acclerated (you could check nvidia-smi on how much the chromium processes use what parts of the GPU)

Correct, I left nvtop running while testing various switch combos.

To be fair, the new default GL Implementation, while it's an unusable mess, does get Chrome using the GPU under Wayland. First I've seen.

tekstryder wrote:

fairly performant (albeit no hardware video decoding)

I should have been more concise to say no GPU acceleration. Edited above.

Last edited by tekstryder (2023-12-22 16:27:07)

Offline

#29 2023-12-24 16:50:16

tekstryder
Member
Registered: 2013-02-14
Posts: 132

Re: Chrome 120 Vulkan+nVidia+Wayland

tekstryder wrote:

To be fair, the new default GL Implementation, while it's an unusable mess, does get Chrome using the GPU under Wayland. First I've seen.

Another notch in the plus column for this new default... while the UI is nigh unusable, the GPU acceleration is legit.

With 4K/60fps YT video, Chrome GPU memory usage varies between 400-700MiB, and produces essentially zero dropped frames.

Vulkan on native Wayland is looking promising.

Offline

#30 2024-01-28 16:44:40

tekstryder
Member
Registered: 2013-02-14
Posts: 132

Re: Chrome 120 Vulkan+nVidia+Wayland

With Chrome 121.0.6167.85, the default application launching with Vulkan errors and UI lag has not changed from the Chrome 120.x stable series.

This is the same using either nVidia 545.29.06 or nVidia beta 550.40.07.

However, there is indeed progress overall re: Chrome + Wayland + nVidia. GPU acceleration is now  functional.

$ /usr/bin/google-chrome-stable --enable-features=VaapiVideoDecodeLinuxGL --use-gl=angle --use-angle=gl
*   Canvas: Hardware accelerated
*   Canvas out-of-process rasterization: Enabled
*   Direct Rendering Display Compositor: Disabled
*   Compositing: Hardware accelerated
*   Multiple Raster Threads: Enabled
*   OpenGL: Enabled
*   Rasterization: Hardware accelerated
*   Raw Draw: Disabled
*   Skia Graphite: Disabled
*   Video Decode: Hardware accelerated
*   Video Encode: Software only. Hardware acceleration disabled
*   Vulkan: Disabled
*   WebGL: Hardware accelerated
*   WebGL2: Hardware accelerated
*   WebGPU: Disabled
GL_RENDERER: ANGLE (NVIDIA Corporation, NVIDIA GeForce GTX 1050 Ti/PCIe/SSE2, OpenGL ES 3.2 NVIDIA 550.40.07)
    PID DEV     TYPE  GPU        GPU MEM    CPU  HOST MEM Command                                                                          
   1451   0  Graphic   0%    857MiB  21%     9%   1168MiB /usr/bin/gnome-shell --no-x11                                                    
  69040   0  Graphic   0%    532MiB  13%     0%   1393MiB /usr/lib/firefox/firefox
  87902   0  Graphic  22%    434MiB  11%    25%    480MiB /opt/google/chrome/chrome --type=gpu-process --ozone-platform=wayland --use-angle
   2053   0  Graphic   0%    290MiB   7%     0%    241MiB /usr/bin/nautilus --gapplication-service
  68906   0  Graphic   0%      1MiB   0%     0%    323MiB /usr/bin/evolution

This thread is regarding the Vulkan default on Wayland+nVidia though, so I'll be back here again when the Chrome 122 series goes stable.

Last edited by tekstryder (2024-01-28 18:14:45)

Offline

#31 2024-02-01 21:13:45

tekstryder
Member
Registered: 2013-02-14
Posts: 132

Re: Chrome 120 Vulkan+nVidia+Wayland

Mesa 23.3.5 resolves one of the two original issues which were the impetus for this thread.

While the Vulkan-related errors at launch still occur, the UI is no longer unusably laggy.

Glancing over the release notes or the overall changeset, it's not immediately clear to me which commit was the relevant fix, though I've not looked into the details of each.

I reinstalled the old 120.x series Chrome and verified it fixes the same there too.

Proper Vulkan support under Wayland is the last remaining piece here.

EDIT: No flags/switches are required any longer, simply using the defaults. OpenGL GPU acceleration out of the box now.

Last edited by tekstryder (2024-02-01 21:25:16)

Offline

#32 2024-02-02 03:27:52

gattis
Member
Registered: 2024-02-02
Posts: 2

Re: Chrome 120 Vulkan+nVidia+Wayland

I too would like to get chromium vulkan working over wayland with nvidia, because vulkan is the only WebGPU platform available on linux.

One piece I figured out is the errors opening libnvidia-glvkspirv.so.545.29.06 have to do with the chromium sandbox filesystem access permissions, because when I start the browser with --no-sandbox, the error disappears.  However, I still get:

[8299:8299:0201/222248.258719:ERROR:gl_angle_util_vulkan.cc(189)] : Failed to retrieve vkGetInstanceProcAddr
[8299:8299:0201/222248.258759:ERROR:vulkan_instance.cc(91)] : Failed to get vkGetInstanceProcAddr pointer from ANGLE.

And vulkan remains disabled, despite the fact that chrome://gpu is able to enumerate the dawn vulkan backend for my driver:

<Discrete GPU>  Vulkan backend - NVIDIA GeForce RTX 3090
--------------------------------------------------------
[WebGPU Status]
---------------
*   Available

and requesting a webgpu adapter with javascript in this state just returns null.


Another thing to add is that the nvidia driver docs say to change the library path in /usr/share/vulkan/icd.d/nvidia_icd.json from "libGLX_nvidia.so.0" to "libEGL_nvidia.so.0" when using wayland.  I tried this, but still can't get past the vkGetInstanceProcAddr part.

Last edited by gattis (2024-02-02 03:34:47)

Offline

#33 2024-02-02 15:32:23

tekstryder
Member
Registered: 2013-02-14
Posts: 132

Re: Chrome 120 Vulkan+nVidia+Wayland

gattis wrote:

One piece I figured out is the errors opening libnvidia-glvkspirv.so.545.29.06 have to do with the chromium sandbox filesystem access permissions, because when I start the browser with --no-sandbox, the error disappears.

Nice, agreed. Looks like I neglected to mention that.

gattis wrote:

Another thing to add is that the nvidia driver docs say to change the library path in /usr/share/vulkan/icd.d/nvidia_icd.json from "libGLX_nvidia.so.0" to "libEGL_nvidia.so.0" when using wayland.  I tried this, but still can't get past the vkGetInstanceProcAddr part.

Thanks, I'd not RTFM'ed apparently. When creating the /etc/vulkan/icd.d/nvidia_icd.json file with libEGL_nvidia.so.0, it does throw an additional error, so at least it's recognized haha.

Warning: terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD libEGL_nvidia.so.0. Skipping this driver.

Another thing I've noted is that when forcing Vulkan enabled, it's a whole other pile of errors and I get a browser instance launched without a visible window.

$ google-chrome-stable --enable-features=Vulkan
[80530:80530:0202/095425.480562:ERROR:gbm_wrapper.cc(75)] Failed to get fd for plane.: No such file or directory (2)
[80530:80530:0202/095425.480659:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[80530:80530:0202/095425.480678:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[80530:80530:0202/095425.480717:ERROR:gbm_wrapper.cc(75)] Failed to get fd for plane.: No such file or directory (2)
[80530:80530:0202/095425.480731:ERROR:gbm_wrapper.cc(258)] Failed to export buffer to dma_buf: No such file or directory (2)
[80530:80530:0202/095425.480744:ERROR:gbm_pixmap_wayland.cc(82)] Cannot create bo with format= RGBA_8888 and usage=GPU_READ
[80530:80530:0202/095425.480760:ERROR:shared_image_factory.cc(971)] CreateSharedImage: could not create backing.
[80530:80530:0202/095425.480773:ERROR:shared_image_stub.cc(347)] SharedImageStub: Unable to create shared image
[80695:1:0202/095425.481582:ERROR:command_buffer_proxy_impl.cc(323)] GPU state invalid after WaitForGetOffsetInRange.

There's no lack of bug reports filed about several of these.

Offline

#34 2024-02-03 06:01:39

gattis
Member
Registered: 2024-02-02
Posts: 2

Re: Chrome 120 Vulkan+nVidia+Wayland

I got a little further.  Vulkan can be enabled on wayland by building the chromium 121 Arch package with "skia_use_dawn=true" as an added flag, and then passing these switches on the command line (tested with everything else default, and nvidia.json pointing to libEGL_nvidia.so):

    --ozone-platform=wayland \
    --no-sandbox \
    --enable-skia-graphite \
    --enable-features=SkiaGraphite,Vulkan \
    --enable-unsafe-webgpu \
    --enable-webgpu-developer-features

WebGPU vulkan nvidia compute even works, and it "draws" without any errors, just nothing shows up on the canvas sad.  WebGL seems to work fine, and higher fps than before somehow.  ANGLE is still using the opengl backend for surface, but I think the rendering is all done with Vulkan now thanks to Skia Graphite.

I think Arch package maintainers should add that skia_use_dawn=true build arg anyway, it seems pretty harmless given the hoops you need to go through to turn it on.

Last edited by gattis (2024-02-03 06:06:59)

Offline

#35 2024-03-27 20:17:02

tekstryder
Member
Registered: 2013-02-14
Posts: 132

Re: Chrome 120 Vulkan+nVidia+Wayland

gattis wrote:

I got a little further...

Very cool! Progress is progress.

No notable changes with Chrome 122.x or 123.x series.
Current stack is:

- Arch Linux | Kernel 6.7.11
- Gnome-shell | Mutter 46.0
- Wayland (meson_options: xwayland=false)
- Gtk4 4.14.1
- Mesa 24.0.3
- nVidia 550.67
- Google Chrome Stable 123.0.6312.86

• GPU accelerated compositing functioning since v121.
• Hardware video decoding (--enable-features=VaapiVideoDecodeLinuxGL) still not functioning yet.

Same old Vulkan errors when launching defaults tho:

$ google-chrome-stable 
[167925:167925:0327/155849.199995:ERROR:object_proxy.cc(576)] Failed to call method: org.freedesktop.ScreenSaver.GetActive: object_path= /org/freedesktop/ScreenSaver: org.freedesktop.DBus.Error.NotSupported: This method is not part of the idle inhibition specification: https://specifications.freedesktop.org/idle-inhibit-spec/latest/
INFO: Created TensorFlow Lite XNNPACK delegate for CPU.
The NVIDIA driver was unable to open 'libnvidia-glvkspirv.so.550.67'.  This library is required at run time.

Warning: terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD libEGL_nvidia.so.0. Skipping this driver.
The NVIDIA driver was unable to open 'libnvidia-glvkspirv.so.550.67'.  This library is required at run time.

Warning: terminator_CreateInstance: Received return code -3 from call to vkCreateInstance in ICD libGLX_nvidia.so.0. Skipping this driver.
Warning: terminator_CreateInstance: Found no drivers!
Warning: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
    at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:101)

I'll be back here @124 stable release. EDIT: kernel 6.7.11

Last edited by tekstryder (2024-03-29 23:35:38)

Offline

#36 2024-04-13 14:47:41

darkbasic
Member
Registered: 2015-06-22
Posts: 33

Re: Chrome 120 Vulkan+nVidia+Wayland

gattis wrote:

I got a little further.  Vulkan can be enabled on wayland by building the chromium 121 Arch package with "skia_use_dawn=true" as an added flag, and then passing these switches on the command line (tested with everything else default, and nvidia.json pointing to libEGL_nvidia.so):

    --ozone-platform=wayland \
    --no-sandbox \
    --enable-skia-graphite \
    --enable-features=SkiaGraphite,Vulkan \
    --enable-unsafe-webgpu \
    --enable-webgpu-developer-features

WebGPU vulkan nvidia compute even works, and it "draws" without any errors, just nothing shows up on the canvas sad.  WebGL seems to work fine, and higher fps than before somehow.  ANGLE is still using the opengl backend for surface, but I think the rendering is all done with Vulkan now thanks to Skia Graphite.

I think Arch package maintainers should add that skia_use_dawn=true build arg anyway, it seems pretty harmless given the hoops you need to go through to turn it on.

I've tried with Chromium 124 (the package shipped by Arch Linux without "skia_use_dawn=true") and unfortunately enabling Graphite still disables Vulkan. AMD Phonenix APU.

Offline

Board footer

Powered by FluxBB