DRM Kernel Error For Chromium Based Apps On Wayland

Every time I try to open a chromium based app on wayland I get errors and most of the time it crashes. In journald I have a bunch of these entries.

[drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x00000000c54d9462

I cant seem to figure it out. The only way I can get chromium apps to open as I expect them to is if I do e.g.WAYLAND_DISPLAY= google-chrome, but that is also flakey. (echo WAYLAND_DISPLAYwayland-1). When I don’t do it that way for chrome, half the time it crashes, half the time it takes a few minutes then it opens with all acceleration turned off. For vscode it immediately crashes and even with changing the flag I have not been able to get it to work.

Here is my system info and logs.

Thu Dec 21 14:10:16 2023       
+---------------------------------------------------------------------------------------+
| NVIDIA-SMI 545.29.06              Driver Version: 545.29.06    CUDA Version: 12.3     |
|-----------------------------------------+----------------------+----------------------+
| GPU  Name                 Persistence-M | Bus-Id        Disp.A | Volatile Uncorr. ECC |
| Fan  Temp   Perf          Pwr:Usage/Cap |         Memory-Usage | GPU-Util  Compute M. |
|                                         |                      |               MIG M. |
|=========================================+======================+======================|
|   0  NVIDIA GeForce RTX 4050 ...    Off | 00000000:01:00.0 Off |                  N/A |
| N/A   47C    P0              19W / 115W |     16MiB /  6141MiB |      0%      Default |
|                                         |                      |                  N/A |
+-----------------------------------------+----------------------+----------------------+
                                                                                         
+---------------------------------------------------------------------------------------+
| Processes:                                                                            |
|  GPU   GI   CI        PID   Type   Process name                            GPU Memory |
|        ID   ID                                                             Usage      |
|=======================================================================================|
|    0   N/A  N/A      2165      G   /run/current-system/sw/bin/Hyprland           1MiB |
|    0   N/A  N/A      2328      G   /home/henry/.nix-profile/bin/kitty            8MiB |
+---------------------------------------------------------------------------------------+

Env

    NIXOS_OZONE_WL = "1";

    XDG_CURRENT_DESKTOP="Hyprland";
    XDG_SESSION_TYPE="wayland";
    XDG_SESSION_DESKTOP="Hyprland";
    
    LIBVA_DRIVER_NAME = "nvidia";
    GBM_BACKEND = "nvidia-drm";
    __GL_VRR_ALLOWED="0";

__NV_PRIME_RENDER_OFFLOAD="1";
__NV_PRIME_RENDER_OFFLOAD_PROVIDER="NVIDIA-G0";
__GLX_VENDOR_LIBRARY_NAME="nvidia";
__VK_LAYER_NV_optimus="NVIDIA_only";

I’ve tried variations of removing the above, including all the prime variables.

My journald log:
log.txt (21.8 MB)

Chrome report:
about-gpu-2023-12-21T19-02-29-962Z.txt (84.8 KB)

glxinfo | grep ‘OpenGL’

OpenGL vendor string: NVIDIA Corporation
OpenGL renderer string: NVIDIA GeForce RTX 4050 Laptop GPU/PCIe/SSE2
OpenGL core profile version string: 4.6.0 NVIDIA 545.29.06
OpenGL core profile shading language version string: 4.60 NVIDIA
OpenGL core profile context flags: (none)
OpenGL core profile profile mask: core profile
OpenGL core profile extensions:
OpenGL version string: 4.6.0 NVIDIA 545.29.06
OpenGL shading language version string: 4.60 NVIDIA
OpenGL context flags: (none)
OpenGL profile mask: (none)
OpenGL extensions:
OpenGL ES profile version string: OpenGL ES 3.2 NVIDIA 545.29.06
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20
OpenGL ES profile extensions:

vulkaninfo --summary

WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 5.  Skipping ICD.
WARNING: [Loader Message] Code 0 : terminator_CreateInstance: Failed to CreateInstance in ICD 6.  Skipping ICD.
==========
VULKANINFO
==========

Vulkan Instance Version: 1.3.268


Instance Extensions: count = 23
-------------------------------
VK_EXT_acquire_drm_display             : extension revision 1
VK_EXT_acquire_xlib_display            : extension revision 1
VK_EXT_debug_report                    : extension revision 10
VK_EXT_debug_utils                     : extension revision 2
VK_EXT_direct_mode_display             : extension revision 1
VK_EXT_display_surface_counter         : extension revision 1
VK_EXT_surface_maintenance1            : extension revision 1
VK_EXT_swapchain_colorspace            : extension revision 4
VK_KHR_device_group_creation           : extension revision 1
VK_KHR_display                         : extension revision 23
VK_KHR_external_fence_capabilities     : extension revision 1
VK_KHR_external_memory_capabilities    : extension revision 1
VK_KHR_external_semaphore_capabilities : extension revision 1
VK_KHR_get_display_properties2         : extension revision 1
VK_KHR_get_physical_device_properties2 : extension revision 2
VK_KHR_get_surface_capabilities2       : extension revision 1
VK_KHR_portability_enumeration         : extension revision 1
VK_KHR_surface                         : extension revision 25
VK_KHR_surface_protected_capabilities  : extension revision 1
VK_KHR_wayland_surface                 : extension revision 6
VK_KHR_xcb_surface                     : extension revision 6
VK_KHR_xlib_surface                    : extension revision 6
VK_LUNARG_direct_driver_loading        : extension revision 1

Instance Layers: count = 4
--------------------------
VK_LAYER_INTEL_nullhw       INTEL NULL HW                1.1.73   version 1
VK_LAYER_MESA_device_select Linux device selection layer 1.3.211  version 1
VK_LAYER_MESA_overlay       Mesa Overlay layer           1.3.211  version 1
VK_LAYER_NV_optimus         NVIDIA Optimus layer         1.3.260  version 1

Devices:
========
GPU0:
	apiVersion         = 1.3.260
	driverVersion      = 545.29.6.0
	vendorID           = 0x10de
	deviceID           = 0x28a1
	deviceType         = PHYSICAL_DEVICE_TYPE_DISCRETE_GPU
	deviceName         = NVIDIA GeForce RTX 4050 Laptop GPU
	driverID           = DRIVER_ID_NVIDIA_PROPRIETARY
	driverName         = NVIDIA
	driverInfo         = 545.29.06
	conformanceVersion = 1.3.6.0
	deviceUUID         = 031867de-0393-522e-8a42-c0a8119bb85b
	driverUUID         = 468717c2-5245-5d6d-9401-72b8a4ff98e5
GPU1:
	apiVersion         = 1.3.246
	driverVersion      = 23.1.9
	vendorID           = 0x8086
	deviceID           = 0xa788
	deviceType         = PHYSICAL_DEVICE_TYPE_INTEGRATED_GPU
	deviceName         = Intel(R) Graphics (RPL-S)
	driverID           = DRIVER_ID_INTEL_OPEN_SOURCE_MESA
	driverName         = Intel open-source Mesa driver
	driverInfo         = Mesa 23.1.9
	conformanceVersion = 1.3.0.0
	deviceUUID         = 868088a7-0400-0000-0002-000000000000
	driverUUID         = 01719c4b-7fa1-4393-001d-4932c8f3b424
GPU2:
	apiVersion         = 1.3.246
	driverVersion      = 0.0.1
	vendorID           = 0x10005
	deviceID           = 0x0000
	deviceType         = PHYSICAL_DEVICE_TYPE_CPU
	deviceName         = llvmpipe (LLVM 16.0.6, 256 bits)
	driverID           = DRIVER_ID_MESA_LLVMPIPE
	driverName         = llvmpipe
	driverInfo         = Mesa 23.1.9 (LLVM 16.0.6)
	conformanceVersion = 1.3.1.1
	deviceUUID         = 6d657361-3233-2e31-2e39-000000000000
	driverUUID         = 6c6c766d-7069-7065-5555-494400000000

Modesetting is also enabled through nixos config.

I am having the same issue, also with NixOS/Hyprland (I am also encountering this issue with sway).

PS: with WAYLAND_DISPLAY set to nothing, chrome uses xwayland, which is probably why it works.

Hello! I’m also experiencing the issue on my Archlinux/GNOME Wayland setup.
While trying various methods I found out that appending --use-angle=vulkan to the chromium flags resolves the issue on my end (journalctl shows no spamming and chromium launches in wayland mode)

That flag didn’t have an effect for me. I have vulkan drivers setup and working too. What does chrome://gpu look like for you in google chrome? How did you pass the flags? Any noteworthy logs?

Currently I haven’t set up hardware acceleration on my system yet. Checking chrome://gpu shows that most of hardware acceleration is disabled or software only. Vulkan is also disabled. (On x11 some of them are enabled, fully or partially)

I did it by calling chromium in the terminal with the flag or by adding it in ~/.config/chromium-flags.conf. It does eliminate the kernel log spam and launches chromium. But that’s it.

I’ll come back later with more results after I get hardware accel fully set up

After launching Chromium with various settings I found out that hardware video decoding is always disabled in wayland AND/OR with vulkan enabled. For some reason I can’t enable vulkan in ozone wayland. Vaapi decoding is disabled on either wayland or vulkan, but works fine on x11 (without vulkan)

I can launch chromium --ozone-platform=wayland with --use-angle=vulkan, --use-angle=opengl or even just --use-angle= with no kernel spamming or crashing.

Here’s what chrome://gpu shows when launching with --ozone-platform=wayland --use-angle=vulkan
about-gpu-vulkan.txt (57.2 KB)

With --ozone-platform=wayland --use-angle=
about-gpu-nothing.txt (51.0 KB)

Here’s some info about my system (contains vainfo, glxinfo | grep OpenGL, vulkaninfo --summary and env | sort):
system-info.txt (9.2 KB)

I seem to experience the same issue on my NixOs system. I have a TUDEDO InfinityBook Pro 16 Gen 7, with following stats:

 ❮onyr ★ nixos❯ ❮~❯❯ neofetch --off
onyr@nixos 
---------- 
OS: NixOS 24.05.20240210.d934204 (Uakari) x86_64 
Host: NB02 PH6AG01_PH6AQ71_PH6AQI1 
Kernel: 6.7.4 
Uptime: 1 day, 21 hours, 18 mins 
Packages: 1346 (nix-system), 716 (nix-user) 
Shell: bash 5.2.26 
Resolution: 2560x1600 
DE: none+i3 
WM: i3 
Theme: Breeze [GTK2/3] 
Terminal: kitty 
Terminal Font: JetBrainsMono Nerd Font 17.0 
CPU: 12th Gen Intel i7-12700H (20) @ 4.600GHz 
GPU: Intel Alder Lake-P GT2 [Iris Xe Graphics] 
GPU: NVIDIA Geforce RTX 3070 Ti Laptop GPU 
Memory: 9270MiB / 64055MiB

My Journalctl gets flooded with the following error:

 ❮onyr ★ nixos❯ ❮~❯❯ journalctl | head -n 1
févr. 12 19:09:15 nixos kernel: [drm:__nv_drm_gem_nvkms_memory_prime_get_sg_table [nvidia_drm]] *ERROR* [nvidia-drm] [GPU ID 0x00000100] Cannot create sg_table for NvKmsKapiMemory 0x0000000085d6a272

Also, from time to time, apps like Firefox and Discord freeze and seems to disappear from my i3wm workspace… I have been unable to find a fix for the problem.