iced-rs / iced

A cross-platform GUI library for Rust, inspired by Elm
https://iced.rs
MIT License
24.35k stars 1.13k forks source link

svg example initially displays black rectangle on Ubuntu #1774

Closed sowbug closed 7 months ago

sowbug commented 1 year ago

Is there an existing issue for this?

Is this issue related to iced?

What happened?

This is my Framework laptop:

OS: Ubuntu Cinnamon 22.04.2 LTS x86_64 
Host: Laptop A6 
Kernel: 5.19.0-38-generic 
Uptime: 3 mins 
Packages: 2692 (dpkg), 13 (snap) 
Shell: bash 5.1.16 
Resolution: 3006x2004 
DE: Cinnamon 5.2.7 
WM: Mutter (Muffin) 
WM Theme: (Default) 
Theme: Adwaita [GTK2/3] 
Icons: gnome [GTK2/3] 
Terminal: gnome-terminal 
CPU: 11th Gen Intel i7-1165G7 (8) @ 4.700GHz 
GPU: Intel TigerLake-LP GT2 [Iris Xe Graphics] 
Memory: 2471MiB / 31889MiB 
  1. cargo run --package svg
  2. Note that console says vulkan: No DRI3 support detected - required for presentation Note: you can probably enable DRI3 in your Xorg config
  3. See app launch with black rectangle instead of tiger.
  4. Either resize the window, or toggle the color-filter checkbox.
  5. See expected tiger.
  6. Per advice on web, nano /etc/X11/xorg.conf.d/20-intel.conf, add Option "DRI" "3", and reboot.
  7. Repeat steps. Tiger displays on first try, as expected.

FWIW, it seems to work fine on my main machine, a Beelink SER4 on Ubuntu 20.04. That's a Ryzen 4700U. And I discovered the issue because my own Iced app, which displays SVGs, exhibits the same behavior (except the images are fixed size, so I can't poke them the way I can with the svg example app).

Screenshot from 2023-03-30 19-08-54

Screenshot from 2023-03-30 19-09-46

What is the expected behavior?

see above

Version

master

Operative System

Linux

Do you have any log output?

No response

kprasadvnsi commented 1 year ago

I am having a similar issue. In my case, there is no error on the console. I am running it on a Arch linux Gnome aarch64 machine. The same example is working fine on my AMD 5900X ubuntu desktop.

Giesch commented 1 year ago

I encountered this issue on a system 76 machine, and was able to fix it for me by using the environment variable described here (under 'hybrid'): https://support.system76.com/articles/graphics-switch-pop

Perhaps there's a more general way for iced to request GPU rendering that applies here?

tkuestner commented 1 year ago

I met this issue on a fresh installation of Endeavour OS (Cassini Nova 03 2023 R1), an Arch based distro, with an AMD Radeon RX 580 graphics card. The reason was a missing Vulkan driver. I fixed it by installing vulkan-radeon as described in the Arch wiki. It solved the problem immediately without requiring a restart. Also note that installing vulkan-icd-loader was not necessary.

GyulyVGC commented 1 year ago

Now that we have renderer fallback at runtime, it'd be really nice if there was a way for Iced to notice this problem and to pick tiny-skia even in this case.