Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wayland - Viewport doesn't render #18891

Open
uwumdoescomputershit opened this issue Apr 14, 2024 · 19 comments · Fixed by #19730
Open

Wayland - Viewport doesn't render #18891

uwumdoescomputershit opened this issue Apr 14, 2024 · 19 comments · Fixed by #19730
Labels
Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. Type: Bug The code does not produce the intended behavior.

Comments

@uwumdoescomputershit
Copy link

Cura Version

5.7.0

Operating System

Arch Linux, Hyprland (wayland), nvidia gtx 1060

Printer

Creality Ender 5

Reproduction steps

  1. Launch the cura flatpak in a wayland compositor (in my case hyprland)

Actual results

All UI elements render fine apart from the view port in the center. When running the application under xwayland it works fine.

Expected results

All UI items render fine (like they do on xorg).

Add your .zip and screenshots here ⬇️

2024-04-14-144111_hyprshot

@uwumdoescomputershit uwumdoescomputershit added Status: Triage This ticket requires input from someone of the Cura team Type: Bug The code does not produce the intended behavior. labels Apr 14, 2024
@nallath
Copy link
Member

nallath commented Apr 15, 2024

Does this also happen for the appimage? We don't officially support the flatpack, so there might be subtle differences between the two that cause this issue.

Also, can you provide the log files? It's a bit hard to debug without them

@nallath nallath added the Status: Needs Info Needs more information before action can be taken. label Apr 15, 2024
@FlorianFlatscher
Copy link

Same here. With official AppImage on fedora 39

@robertaramar
Copy link

robertaramar commented Apr 25, 2024

Same here. With official AppImage 5.7.1, with rpm version 5.5.0 and flatpak 5.7.1, both on Fedora 39 and Fedora 40
Only chance to "somewhat" run it is to set QT_QPA_PLATFORM=xcb before running it.

@xubz
Copy link

xubz commented Apr 28, 2024

Arch Linux with Nvidia/KDE Plasma 6/Wayland

Same issue. Works with these arguments -platform xcb -platformtheme gtk3 but it's a flickery mess. I guess, I have to wait for the much hyped "Explicit Sync" patch. Atleast can slice and print!

@Tabisch
Copy link

Tabisch commented Apr 28, 2024

Had the same issue on Fedora 39 and 40 with Flatpak.

Setting QT_QPA_PLATFORM=xcb in Environment in FlatSeal fixed it for me.
For me it runs smooth on Fedora 40 with Gnome 46.1.

@robertaramar
Copy link

It's nowhere near to "smooth". It does run, however, it flickers a lot, and sometimes I have a white window that only refreshes when I rotate or zoom.
In addition, it takes ages until the model gets a first rendering.
I did not experience this when I was running my desktop in an X session. Only after I moved to Wayland.

@sausix
Copy link

sausix commented Apr 29, 2024

Good news everyone! Not a fix but a non flickery workaround.

According to this hint I tried to tweak EGL which raised an error before:
https://wiki.archlinux.org/title/OpenGL#OpenGL_over_Vulkan_(Zink)

At least 5.7.1 seem to run fine in pure Wayland on my Nvidia RTX 4060 and nvidia-dkms.

Running cura with these two environment variables seem to be enough for me:
__EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.json MESA_LOADER_DRIVER_OVERRIDE=zink cura

You'll probably also need QT_QPA_PLATFORM="wayland;xcb" which is set by my global env file which I share for free too:

# /etc/profile.d/wayland.sh 
# Tweaks mostly from: https://wiki.archlinux.org/title/Wayland
export QT_QPA_PLATFORM="wayland;xcb"
export SDL_VIDEODRIVER="wayland,x11"
export CLUTTER_BACKEND=wayland

export GBM_BACKEND=nvidia-drm
export __GLX_VENDOR_LIBRARY_NAME=nvidia

export ELECTRON_OZONE_PLATFORM_HINT=wayland

# GTK to X11
#GDK_BACKEND=x11

# Thunderbird and Firefox
export MOZ_ENABLE_WAYLAND=1

# LibreOffice
# /etc/profile.d/libreoffice-still.sh
export SAL_USE_VCLPLUGIN=qt6

# Java blank screen?
#export _JAVA_AWT_WM_NONREPARENTING=1

Rule of thumb for NVidia and Wayland: No xwayland.

Copy link
Contributor

This issue has been automatically closed because there has been no response to our request for more information from the original author. With only the information that is currently in the issue, we don't have enough information to take action. Please reach out if you have or find the answers we need so that we can investigate further.

@basilverthorn
Copy link

basilverthorn commented Apr 30, 2024

The above seem to fix the flickering at least thank you. I can not use it per say, still no build plate, but it at least is not flickering. What ever build Qidiprint is on it just works in Wayland, Hperland etc.. Its an older version of Cura though thats been reskined.

@nallath nallath reopened this Apr 30, 2024
@nallath nallath removed the Status: Needs Info Needs more information before action can be taken. label Apr 30, 2024
@sausix
Copy link

sausix commented Apr 30, 2024

@basilverthorn
I never had flickering in pure Wayland. The print bed and some UI was missing. Old workaround was using xwayland at the cost of flickering within Cura.

Do you run Cura in a pure Wayland session?
QT_QPA_PLATFORM=wayland cura and add the Vulkan fix variables to get the bed and UI visualized.
Then cura or the Qt backend will truely use Wayland.

@basilverthorn
Copy link

basilverthorn commented Apr 30, 2024

Yes I run in true Wayland or Hyprland. Migrating to Hyprland, but see the same thing in both. I will try this tomorrow if I can, working late today unfortnately. Fixed the flickering, but the build plate is still missing. I have resorted to just running Cura in a Windows VM atm as a work around.

@MariMakes MariMakes added Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. and removed Status: Triage This ticket requires input from someone of the Cura team labels May 1, 2024
@MariMakes MariMakes pinned this issue May 1, 2024
@MariMakes MariMakes changed the title View port doesn't render on wayland Wayland - Viewport doesn't render May 1, 2024
@basilverthorn
Copy link

basilverthorn commented May 2, 2024

So I tried the vulkan fix and QT_QPA and I know recieve: "Could not probe OpenGL. This program requires OpenGL 2.0 or higher. Please check your video card drivers." Trying to start Cura, the appimage runs, but does not have a build plate.

glxinfo shows:

glxinfo | grep "OpenGL version"
OpenGL version string: 4.6.0 NVIDIA 550.76

env __GLX_VENDOR_LIBRARY_NAME=mesa __EGL_VENDOR_LIBRARY_FILENAMES=/usr/share/glvnd/egl_vendor.d/50_mesa.jsonMESA_LOADER_DRIVER_OVERRIDE=zink GALLIUM_DRIVER=zink cura
MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)
libEGL warning: egl: failed to create dri2 screen
MESA: error: ZINK: vkCreateInstance failed (VK_ERROR_INCOMPATIBLE_DRIVER)
libEGL warning: egl: failed to create dri2 screen
qt.qpa.wayland: Failed to initialize EGL display 3001

cura ran by itself starts, just no build plate.

@basilverthorn
Copy link

Still an issue anyone come up with solution? No build plate still.

@sausix
Copy link

sausix commented Jun 19, 2024

Mesa seems to be broken on EGL/OpenGL at Qt level already:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/11316

How did you get mesa 24.1.1 early on May 2th? Even Arch users got that version on June 6th.
Can you downgrade mesa on your distribution to 24.1.0? We didn't find a better fix or workaround yet.

@42Willow
Copy link

42Willow commented Jul 27, 2024

I am also on Hyprland but installed cura via the aur cura-bin package, but I am using intel integrated graphics not NVIDIA. I am not experiencing this issue but (unrelated) I get a segfault when trying to open a file. #16815

@DeBeerBuilds
Copy link

Same here. With official AppImage 5.7.1, with rpm version 5.5.0 and flatpak 5.7.1, both on Fedora 39 and Fedora 40 Only chance to "somewhat" run it is to set QT_QPA_PLATFORM=xcb before running it.

How do you check that?

@HenrikElofsson
Copy link

I have the same issue with AppImage 5.8.1. It's a Gentoo system with Nvidia graphics.

@mentasuave01
Copy link

same issue here

@KyleStilkey
Copy link

Testing @wawanbreton Wayland fix on Bazzite and it's so far working fine here. I can now see it rendering the main image again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Under Investigation The issue has been confirmed or is assumed to be likely to be a real issue. It's pending discussion. Type: Bug The code does not produce the intended behavior.
Projects
None yet
Development

Successfully merging a pull request may close this issue.