OSSystems / meta-browser

OpenEmbedded/Yocto BSP layer for Web Browsers
MIT License
185 stars 194 forks source link

Chromium errors with hardware acceleration #774

Open fwitk opened 11 months ago

fwitk commented 11 months ago

I am building chromium-x11 with hardware acceleration on mickledore or nanbield (both result to the same error), and i get following error when running chromium, often result in a segmentation fault:

Warning: vkCreateInstance: Found no drivers!
Warning: 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:458)
    at Initialize (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:344)
    at Create (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:266)
    at operator() (../../third_party/dawn/src/dawn/native/vulkan/BackendVk.cpp:521)

I start chromium with following command line:

/usr/bin/chromium  \
   --incognito \
    --noerrdialogs --no-first-run --no-default-browser-check \
    --disable-features=Translate \
    --window-size=3840,2160 \
    --window-position=0,0 \
    --disable-restore-session-state \
    --enable-features=OverlayScrollbar,OverlayScrollbarFlashAfterAnyScrollUpdate,OverlayScrollbarFlashWhenMouseEnter \
    --allow-insecure-localhost \
    --in-process-gpu \
    http://tibra.de/scroll.html

I have to start chromium with the " --in-process-gpu" flag, otherwise i can't get "GPU Raster" on in the development tools.

As DISTRO_FEATURES i have "x11 opengl vulkan"

In my local.conf i have following PACKAGECONFIG variables set:

PACKAGECONFIG:append:pn-mesa = ' r600'
PACKAGECONFIG:append:pn-mesa = ' gallium-llvm'
PACKAGECONFIG:append:pn-mesa = ' dri3'
PACKAGECONFIG:append:pn-mesa = ' va'
PACKAGECONFIG:append:pn-chromium-x11 = ' proprietary-codecs use-egl use-vaapi'

I am using following graphics chip (from lspci):

VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Raven Ridge [Radeon Vega Series / Radeon Vega Mobile Series] (rev 83)

For Xorg i am using following driver: "xf86-video-amdgpu"

For my kernel i activated following modules for my graphics chip:

CONFIG_HMM_MIRROR=y
CONFIG_DRM_TTM_HELPER=m
CONFIG_DRM_SCHED=m
CONFIG_DRM_RADEON=m
CONFIG_DRM_AMDGPU=m
CONFIG_DRM_AMDGPU_USERPTR=y
CONFIG_DRM_AMD_DC=y
CONFIG_DRM_AMD_DC_DCN=y
CONFIG_HSA_AMD=y

Do i miss something or is this a bug? Let me know if you need some additional informations.

fwitk commented 11 months ago

When chromium doesn't seg fault and runs for some time after an hour or so chromium shows an error page which shows "Errorcode: SIGKILL"

fwitk commented 8 months ago

I solved the issue for me. When chromium is build with the use-egl PACKAGECONFIG variable, it adds the command line argument --use-gl=egl automatically to chromium, and this can lead to an error according to the Archlinux Wiki: https://wiki.archlinux.org/title/Chromium#Hardware_video_acceleration

To use the system GL renderer on Xorg or Wayland, use --use-gl=egl. Setting this option might no longer be needed when using Chrome 112 and may break GPU acceleration when using AMD GPUs.

So i created a chromium-x11_%.bbappend in my custom layer with following content:

CHROMIUM_EXTRA_ARGS = " \
        ${@bb.utils.contains('PACKAGECONFIG', 'kiosk-mode', '--kiosk --no-first-run --incognito', '', d)} \
        ${@bb.utils.contains('PACKAGECONFIG', 'gtk4', '--gtk-version=4', '', d)} \
"

This prevents that --use-gl=egl is added to the wrapper script which starts chromium. I hope other people who stumble about the same issue are finding my solution and are able to fix it in their builds.