You are not logged in.

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

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

Re: [SOLVED] Chrome+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: 60,780

Re: [SOLVED] Chrome+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: 187

Re: [SOLVED] Chrome+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: 187

Re: [SOLVED] Chrome+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: 187

Re: [SOLVED] Chrome+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: 187

Re: [SOLVED] Chrome+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: [SOLVED] Chrome+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: 187

Re: [SOLVED] Chrome+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: [SOLVED] Chrome+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: 187

Re: [SOLVED] Chrome+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: 45

Re: [SOLVED] Chrome+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

#37 2024-05-18 17:15:56

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

Re: [SOLVED] Chrome+Vulkan+nVidia+Wayland

Revisiting this little curiosity on a rainy afternoon.

No notable changes with Chrome 124.0.6367.207 or 125.0.6422.60.

Current stack is:

- Arch Linux | Kernel 6.8.10
- Gnome-shell | Mutter 46.1
- Wayland (meson_options: xwayland=false)
- Mesa 24.0.7
- nVidia 550.78
- Google Chrome Stable 125.0.6422.60

• GPU accelerated compositing functioning since v121.
• Same old Vulkan errors when launching with defaults
• Aside (OT): Hardware video decoding (--enable-features=VaapiVideoDecodeLinuxGL) also not functioning yet.

This is the 6th major Chrome/chromium version release since they switched to Vulkan default, and it's still no-go.

Perhaps Mesa 24.1 and/or the nVidia 555.x series will bring the missing functionality to the table.

Offline

#38 2024-10-21 20:18:35

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

Re: [SOLVED] Chrome+Vulkan+nVidia+Wayland

I suppose it's time to slap a [SOLVED] tag on this badboy.

The original issues (laggy UI, Vulkan errors) described in my OP can be worked around now.

With the re-enablement of (gl=egl-angle,angle=vulkan) merge landed in Chrome Stable 129.x series, a flag can now enable the Vulkan Angle layer backend:

--ozone-platform-hint=auto
--use-angle=vulkan

While I still rarely use this browser, boredom led me to throw some various common benchmarks at it out of curiosity.

How valid any of these really are in real-world scenarios is not my concern, just wanted to see if any apples-to-apples differences were noted.

Nothing much beyond margin of error, though slightly crestfallen regarding my beloved FF. I was a pre-alpha bug wrangler for them back in the Phoenix (2001) days and have never yet strayed.

https://web.basemark.com/
https://browserbench.org/Speedometer3.0
https://browserbench.org/JetStream/
https://www.wirple.com/bmark/
https://browserbench.org/MotionMark1.3.1/

Google Chrome   130.0.6723.58
Firefox         131.0.3

                    Chrome (vulkan)     Chrome (opengl)     Firefox
Basemark Web 3.0    2100                2090                1869
Speedometer 3.0     28.6                28.7                25.3
Jetstream 2.2       368                 363                 249
BMark               12091               11928               10740
MotionMark 1.3.1    5271                5062                1737

Why 'Graphics Feature Status' lists Vulkan as disabled I'm not eager to research, but feel free to enlighten me if you know the differentiation here.

I'd guess there's a "fuller" Vulkan API usage model beyond just the Angle backend.

Graphics Feature Status
=======================
*   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
*   WebNN: Disabled
GL implementation parts         : (gl=egl-angle,angle=vulkan)
Display type                    : ANGLE_VULKAN
GL_VENDOR                       : Google Inc. (NVIDIA)
GL_RENDERER                     : ANGLE (NVIDIA, Vulkan 1.3.280 (NVIDIA NVIDIA GeForce GTX 1050 Ti (0x00001C82)), NVIDIA-560.35.3.0)

The current stack where Vulkan Angle is functional...

* Kernel 6.10.14
* Gnome-shell | Mutter 47.1
* Wayland (meson_options: xwayland=false)
* Vulkan ICD Loader 1.3.295
* Mesa 24.2.5
* nVidia 560.35.03

...to wrap this thread up. Cheers!

Offline

#39 2024-10-22 00:36:51

Bzzz_56
Member
Registered: 2021-05-14
Posts: 37

Re: [SOLVED] Chrome+Vulkan+nVidia+Wayland

tekstryder wrote:

Why 'Graphics Feature Status' lists Vulkan as disabled I'm not eager to research, but feel free to enlighten me if you know the differentiation here.

I'd guess there's a "fuller" Vulkan API usage model beyond just the Angle backend.

You may need some more flags in the --enable-features section, like the following

--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan

without this, vulkan infos won't be shown in the about:gpu page on my amdgpu either..

By the way, I've seen reports from users of nvidia-vaapi-driver say that vaapi is working now on nvidia with chromium wayland, while I've not seen anyone uses the vulkan backend reports vaapi is working..

Offline

#40 2024-10-22 01:52:54

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

Re: [SOLVED] Chrome+Vulkan+nVidia+Wayland

Bzzz_56 wrote:

You may need some more flags in the --enable-features section, like the following

--enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan

without this, vulkan infos won't be shown in the about:gpu page on my amdgpu either..

Guess I should have mentioned I went down that road.

Chrome is not able to even render its window with that or similar combos of Vulkan-related flags.

Bzzz_56 wrote:

By the way, I've seen reports from users of nvidia-vaapi-driver say that vaapi is working now on nvidia with chromium wayland, while I've not seen anyone uses the vulkan backend reports vaapi is working..

Sounds promising. I wish them well. Noted a few times upthread, the current GPU-accelerated compositing with gl (and now vulkan) is more than enough were I ever to need to use this browser daily.

4K YT video drops zero frames. So, whatever vaapi decoding adds to the picture (pun)... seems superfluous to my needs.

EDIT: I marked this SOLVED in #38 as the thread issues are solved.
Further discussion about this topic (Chrome+Vulkan+nVidia+Wayland) are welcome.
But, for any unrelated VAAPI discussion.... there's a long-running thread specific to that topic:
https://bbs.archlinux.org/viewtopic.php?id=244031

Last edited by tekstryder (2024-10-22 22:32:20)

Offline

#41 2024-10-22 02:26:09

Bzzz_56
Member
Registered: 2021-05-14
Posts: 37

Re: [SOLVED] Chrome+Vulkan+nVidia+Wayland

tekstryder wrote:

4K YT video drops zero frames. So, whatever vaapi decoding adds to the picture (pun)... seems superfluous to my needs.

Most cases u are right, but hevc decoding is only available with hardware decoding, and is necessary on twitter to get high video quality, while there's still some issue with hevc main 10 profile decoding which is just broken on my amdgpu..

Last edited by Bzzz_56 (2024-10-22 02:28:31)

Offline

Board footer

Powered by FluxBB