KevinSilvester / wezterm-config

My WezTerm Config
MIT License
442 stars 128 forks source link

Fails to launch with this configuration on Wayland with an AMD GPU in Plasma6 #20

Closed Tristor closed 2 months ago

Tristor commented 3 months ago

Description of Issue

I attempted to use this config with a fresh install of WezTerm on my Framework 13 AMD running Arch + Plasma-Desktop. Plasma6 uses the linux-dmabuf Wayland interface but the AMDVLK driver uses wl_drm in Wayland, which is a legacy interface. This is, I think, the cause of this interaction. I plan to test with a different compositor outside of Plasma6 to see if I can get this working. I found the following, I think related issue, https://github.com/GPUOpen-Drivers/pal/issues/96

Error message logged to terminal:

wl_drm#42: error 0: wl_drm.create_prime_buffer is not implemented
16:08:42.081  ERROR  wezterm_gui > running message loop: Error while flushing display: Broken pipe (os error 32); terminating
warning: queue 0x55c98fac8130 destroyed while proxies still attached:
  wl_callback#45 still attached
  xdg_wm_base#22 still attached
  wl_surface#21 still attached
  wl_data_device#18 still attached
  wl_pointer#16 still attached
  zwp_text_input_v3#15 still attached
  wl_keyboard#14 still attached
  zwp_primary_selection_device_v1#13 still attached
  zwp_primary_selection_device_manager_v1#3 still attached
  wl_data_device#12 still attached
  wl_output#11 still attached
  zwp_text_input_manager_v3#10 still attached
  wl_subcompositor#9 still attached
  wl_data_device_manager#8 still attached
  wl_seat#7 still attached
  wl_shm#6 still attached
  zxdg_decoration_manager_v1#5 still attached
  wl_compositor#4 still attached
  wl_registry#2 still attached
KevinSilvester commented 3 months ago

~This is just a guess, I think the issue is in the webgpu_preferred_adapter that was picked in in config/appearance.lua line 11.~

https://github.com/KevinSilvester/wezterm-config/blob/f330fa387db864b808333341c049276c15cc1df5/config/appearance.lua#L9-L11

~Try commenting that line and see if that works.~

KevinSilvester commented 3 months ago

I take back what I said.

I'm still not entirely sure what's happening but from what I understand is that it's an issue caused by Wayland and wgpu's Vulkan support on AMD cards not playing nicely with each other.

If that is the case and the issue is simply limited to Vulkan and Wayland, there might be 2 solutions:

  1. Probably the most straight forward solution. Change the front_end option from WebGpu to OpenGL or simply remove that option (the default is OpenGL). https://github.com/KevinSilvester/wezterm-config/blob/f330fa387db864b808333341c049276c15cc1df5/config/appearance.lua#L8 This will force WezTerm to render the GUI without relying on the wgpu crate using its built-in OpenGL support.

  2. Keep the front_end option as is and force wgpu to render the GUI using its own OpenGl support. To do this, update the webgpu_preferred_adapter option from: gpu_adapters:pick_best() -> gpu_adapters:pick_manual('Gl', 'Other') https://github.com/KevinSilvester/wezterm-config/blob/f330fa387db864b808333341c049276c15cc1df5/config/appearance.lua#L10

I don't really have the means to test either of the solutions out, but I'm fairly confident solution 1 will be your best bet. Hope this helps :)

Tristor commented 3 months ago

Thanks Kevin, I will give this a shot later this week. Thanks

KevinSilvester commented 3 months ago

Hey @Tristor, did you get a chance to try any of the solutions yet?

PACHAKUTlQ commented 2 months ago

Hey @Tristor, did you get a chance to try any of the solutions yet?

Same situation. The second solution works for me. Haven't tried the first, but I suppose it would work too. Thx a lot.

KevinSilvester commented 2 months ago

no worries 😊

KevinSilvester commented 2 months ago

Hey @Tristor, it's been over a month since the issue was opened and I haven't heard a response in a while. Plus one of the solutions I posted seemed to have worked for @PACHAKUTlQ. So, with that, I'm going to close this issue.

If neither of the solutions doesn't work, feel free to re-open the issue, but at that stage, I do think this is beyond just a config tweak and more an upstream issue potentially with Wezterm, Wayland or AMDVLK