Offloading Chromium to nVidia on Wayland

Hello! Questions about Chromium seem to be pretty common, and I do not frequently see successes, but I try to post this question anyway.

I have a Intel machine with a nVidia Quadro running Manjaro Linux on Wayland (Plasma) with nVidia driver 530.41.03. I sometimes try to run Chromium on nVidia with:

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia chromium

to see if something is working. Apparently, it now seems to be working properly. This is what I see in the terminal:

[66180:66180:0409/010048.943959:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open i915: /usr/lib/dri/i915_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
Warning: remove_all_non_valid_override_layers: Failed to get executable path and name
Warning: loader_scanned_icd_add: Could not get 'vkCreateInstance' via 'vk_icdGetInstanceProcAddr' for ICD libGLX_nvidia.so.0
Warning: vkCreateInstance: Found no drivers!
Error: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
    at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
    at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:416)
    at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:302)
    at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:232)
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:491)

Error: eglChooseConfig returned zero configs
    at Create (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:53)

and this is what Chromium reports:

### Graphics Feature Status

* Canvas: Hardware accelerated
* Canvas out-of-process rasterization: Disabled
* Direct Rendering Display Compositor: Disabled
* Compositing: Hardware accelerated
* Multiple Raster Threads: Enabled
* OpenGL: Enabled
* Rasterization: Hardware accelerated
* Raw Draw: Disabled
* Video Decode: Hardware accelerated
* Video Encode: Software only. Hardware acceleration disabled
* Vulkan: Disabled
* WebGL: Hardware accelerated
* WebGL2: Hardware accelerated
* WebGPU: Disabled

Seems good. Performance is good, however some glitches are visible, maybe because it is running with XWayland. I therefore tried to run it as a Wayland native client:

[70160:70160:0409/010328.399960:ERROR:chrome_browser_cloud_management_controller.cc(162)] Cloud management controller initialization aborted as CBCM is not enabled.
MESA-LOADER: failed to retrieve device information
MESA-LOADER: failed to open i915: /usr/lib/dri/i915_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open zink: /usr/lib/dri/zink_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open kms_swrast: /usr/lib/dri/kms_swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
MESA-LOADER: failed to open swrast: /usr/lib/dri/swrast_dri.so: cannot open shared object file: Permission denied (search paths /usr/lib/dri, suffix _dri)
Warning: remove_all_non_valid_override_layers: Failed to get executable path and name
The NVIDIA driver was unable to open 'libnvidia-glvkspirv.so.530.41.03'.  This library is required at run time.

Warning: terminator_CreateInstance: Failed to CreateInstance in ICD 0.  Skipping ICD.
Warning: terminator_CreateInstance: Found no drivers!
Error: vkCreateInstance failed with VK_ERROR_INCOMPATIBLE_DRIVER
    at CheckVkSuccessImpl (../../third_party/dawn/src/dawn/native/vulkan/VulkanError.cpp:88)
    at CreateVkInstance (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:416)
    at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:302)
    at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:232)
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:491)

Error: eglChooseConfig returned zero configs
    at Create (../../third_party/dawn/src/dawn/native/opengl/ContextEGL.cpp:53)

[70207:70207:0409/010334.671114:ERROR:gl_display.cc(504)] EGL Driver message (Error) eglMakeCurrent: 'dpy' not a valid EGLDisplay handle

and this is the result as seen by Chromium:

### Graphics Feature Status

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

Performance is not good, but it runs.

Any idea why compositing is not accelerated? Any way to make it run a bit better? Is this a Chromium issue or a nVidia driver issue? Everything runs perfectly on the Intel GPU, both for X11 and Wayland. And it has been running perfectly for years and years. I’m just trying to experiment and see if I can make some use of this nVidia GPU.
Thanks!

I get the same error when I run the native Wayland version. When I run a Chromium-based browser with XWayland, everything works fine at first. But after a while the gpu crashes and everything is rendered by software rendering.

If you’re not sticked to wayland, see this: Offloading && Chrome? - #8 by tramchamploo