microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.5k stars 28.65k forks source link

Snap: Hardware acceleration is broken for wayland #105729

Open ninja- opened 4 years ago

ninja- commented 4 years ago

Trying to turn on hardware acceleration with

    "disable-hardware-acceleration": false,

as well as other Chromium command line arguments that override rendering blacklists etc. results in still hardware acceleration being broken.

This seems to work just fine on Flatpak version.

/usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so: undefined symbol: g_date_time_format_iso8601
Failed to load module: /usr/lib/x86_64-linux-gnu/gio/modules/libgvfsdbus.so
[429952:0831/142456.639430:ERROR:gl_surface_glx.cc(88)] glXGetFBConfigs failed.
[429952:0831/142456.639479:ERROR:gl_surface_glx.cc(128)] Failed to get GLXConfig
[429952:0831/142456.639484:ERROR:gl_surface_glx.cc(477)] CreateDummyWindow(gfx::GetXDisplay()) failed
[429952:0831/142456.639489:ERROR:gl_initializer_x11.cc(148)] GLSurfaceGLX::InitializeOneOff failed.
[429952:0831/142456.641273:WARNING:x11_util.cc(1399)] X error received: serial 317, error_code 8 (BadMatch (invalid parameter attributes)), request_code 78, minor_code 0 (X_CreateColormap)
[429952:0831/142456.641338:ERROR:viz_main_impl.cc(176)] Exiting GPU process due to errors during initialization
[429927:0831/142456.644334:WARNING:gpu_process_host.cc(1225)] The GPU process has crashed 1 time(s)
[429927:0831/142456.697892:WARNING:gpu_process_host.cc(995)] Reinitialized the GPU process after a crash. The reported initialization time was 38 ms

Process Argv:     --ignore-gpu-blacklist --no-sandbox
GPU Status:       2d_canvas:                     unavailable_software
                  flash_3d:                      disabled_software
                  flash_stage3d:                 disabled_software
                  flash_stage3d_baseline:        disabled_software
                  gpu_compositing:               disabled_software
                  multiple_raster_threads:       enabled_on
                  oop_rasterization:             disabled_off
                  protected_video_decode:        disabled_off
                  rasterization:                 disabled_software
                  skia_renderer:                 disabled_off_ok
                  video_decode:                  disabled_software
                  viz_display_compositor:        enabled_on
                  viz_hit_test_surface_layer:    disabled_off_ok
                  webgl:                         unavailable_software
                  webgl2:                        unavailable_software

Steps to Reproduce:

  1. Install snap vscode on machine with open source Radeon driver and Gnome Wayland
  2. Set disable-hardware-acceleration preference
  3. Run code --ignore-gpu-blacklist
  4. Check code --status

I am not sure if the above X_CreateColormap crash is a direct cause of that, it's not that obvious.

Does this issue occur when all extensions are disabled?: Yes/No Yes

vscodebot[bot] commented 4 years ago

(Experimental duplicate detection) Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

deepak1556 commented 4 years ago

Can you check gpu support with our insiders version which is based on a newer chromium runtime https://code.visualstudio.com/insiders/ .

Try to check without --ignore-gpu-blacklist flag first, also you don't have to set "disable-hardware-acceleration": false,

ninja- commented 4 years ago

@deepak1556 I wasn't aware there are still deb builds....I think I'll go this route because both flatpak and snap versions currently have annoying bugs...

ninja- commented 4 years ago

Deb insiders version works fine, but as I mentioned the issue is related to snap config somehow.

Process Argv:     --no-sandbox
GPU Status:       2d_canvas:                  enabled
                  flash_3d:                   enabled
                  flash_stage3d:              enabled
                  flash_stage3d_baseline:     enabled
                  gpu_compositing:            enabled
                  multiple_raster_threads:    enabled_on
                  oop_rasterization:          disabled_off
                  opengl:                     enabled_on
                  protected_video_decode:     unavailable_off
                  rasterization:              disabled_software
                  skia_renderer:              enabled_on
                  video_decode:               unavailable_off
                  vulkan:                     disabled_off
                  webgl:                      enabled
                  webgl2:                     enabled
deepak1556 commented 4 years ago

Just to confirm, is hw acceleration not working with insiders snap build ?

ninja- commented 4 years ago

Just checked the snap version. Yes, it doesn't work in code-insiders snap

deepak1556 commented 4 years ago

I cannot confirm this issue on my machine running ubuntu 20.04, with NVIDIA Quadro P620/PCIe/SSE2, OpenGL 4.5 core. Can you install chromium snap and check chrome://gpu to see if hw acceleration is enabled ?

ninja- commented 4 years ago

@deepak1556 are you on wayland?

deepak1556 commented 4 years ago

That would explain the difference, thanks!, wayland is disabled for my gpu by default.

Then the root cause would be same as https://github.com/microsoft/vscode/issues/99419#issuecomment-642923230 , but I will keep this issue open to track the different affected components.

babaliaris commented 5 months ago

As of 2024, I can confirm that hardware acceleration is still broken. Vscode flickers, the menus appear black most of the time and it's really painful to use it in general. Disabling hardware acceleration fixes it but still, vscode does not run smoothly.

I'm running Arch Linux with KDE Plasma 6 (Wayland) and my GPU is the RTX 3070 Ti with the Nvidia driver installed. I have no issue with any other application from Snap or the Arch Package Manager.