qtile: Qtile segfaults when running on Wayland backend
The issue:
Qtile version: 0.22.1
Greetings, I’ve recently been using Qtile and it works amazingly! It’s lighter than i3 and I’m daily driving it nowadays, but recently with the mainstream adoption of Wayland, I wanted to try Qtile’s Wayland backend, but unfortunately, as soon as you attempt to launch Qtile using it’s Wayland backend via your display manager’s login screen, bam, nothing but a black screen. If you force-open the TTY and run it from there, it just shows you a segmentation fault. It seems to have to do with something about XWayland from what I see.
The logs have absolutely nothing that relates to this, in fact, nothing is logged to ~/.local/share/qtile/qtile.log
. This is the entire error.
$ qtile start -b wayland
amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
00:00:00.106 [xwayland/sockets.c:63] Failed to bind socket 0/tmp/.X11-unix/X0: Address already in use
libinput error: failed to load the device quirks from /usr/share/libinput and /etc/libinput/local-overrides.quirks. This will negatively affect device behaviour. See ://wayland.freedesktop.org/libinput/doc/1.16.3/device-quirks.html for details
[1] 3742 segmentation fault (core dumped) qtile start -b wayland
Any help would be appreciated, I have reinstalled XWayland and updated by GPU drivers, but nothing seems to help. I have to stick to X11 Qtile in the meanwhile. Cheers!
Required:
- I have searched past issues to see if this bug has already been reported.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 2
- Comments: 19 (2 by maintainers)
This issue is stale because it has been open 90 days with no activity. Remove the
status: stale
label or comment, or this will be closed in 30 days.I have finally gotten this working after soul searching, deals with deities and my new favorite person @clotodex for giving me the last shove I needed to look into patching the ffi.
Here are the steps I took, they are quite tedious and some may be redundant. I hope this works for other people aswell or atleast pushes them in the right direction.
1. Ensure the wlroots-devel is installed
On fedora:
sudo dnf install wlroots-devel
2. Setup the virtual enviroment
git clone https://github.com/qtile/qtile ./source
cd source
python -m venv .
source ./bin/activate
3. Install qtile dependencies
python -m pip install dbus-next pywlroots pywayland "cairocffi >= 1.6.0" "cffi >= 1.1.0" "xcffib >= 1.4.0" wheel --no-cache-dir --force
4. Install qtile for the first time
python -m pip install .
5. Find FFI Names
The following command lists the names of the system binaries we need copy
ls /usr/lib64 | grep "libxkbcommon\|libinput\|libwlroots"
The following command lists the names of the pywlroots binaries we need to replacels lib/python3.11/site-packages/pywlroots.libs | grep "libinput\|li bxkbcommon\|libwlroots"
6. Patch the pywlroots FFI
Symlink the relevant system binary to the pywlroot binaries. In my case
ln /usr/lib64/libxkbcommon.so.0.0.0 ./lib/python3.11/site-packages/pywlroots.libs/libxkbcommon-de59cad2.so.0.0.0 -fs
ln /usr/lib64/libinput.so.10.13.0 ./lib/python3.11/site-packages/pywlroots.libs/libinput-a3c39512.so.10.13.0 -fs
ln /usr/lib64/libwlroots.so.11 ./lib/python3.11/site-packages/pywlroots.libs/libwlroots-62d802e9.so.11 -fs
7. Build qtile FFI
python libqtile/backend/wayland/cffi/build.py
This next command is super important, we need to build the ffi for the virtual enviroments qtilecd lib/python3.11/site-packages
python libqtile/backend/wayland/cffi/build.py
8. Install qtile for the second and (hopefully) final time
cd ../../../
python -m pip install .
9. Start qtile
./bin/qtile start -b wayland
10. Bask in joy and glory, or curse me because this didn’t work for you
Hey, thanks for the report. As you’ve concluded this lower-level stuff is wlroots’ domain. Those guys are over at https://gitlab.freedesktop.org/wlroots/wlroots but it’s very likely they’re already on it. Also, note that Qtile is currently based on wlroots 0.15.1 which is ~10 months old, and they cut a new release a few weeks ago which we’re in the process of upgrading to. There is still some more work to do to bump pywlroots to wlroots 0.16.x, but perhaps these upgrades will benefit issues like this.
We’re close. However, there are some external factors impacting our team’s ability to work on this at the moment. Our hope is that we can get it merged at some point in June.
I see the same
amdgpu: amdgpu_cs_ctx_create2 failed. (-13)
issue on two machines with AMD cards and the mesa driver. Sway does work, though.This issue persists in the new release as well. Trying to run Qtile Wayland results in a segfault, which does get fixed with the above mentioned solution.
Unlike OP’s error, I don’t have a amdgpu, and get this instead
Running this on latest arch packages, with qtile installed in a venv via
pip install qtile[wayland]
This seems to be a wlroots/libinput issue, but just making sure its clear this bug exists in 0.23 as well (as the version bump was hoped to fix the issue)
Thanks I will definitely try it, as soon as I get the chance…
Just a hunch, but your libraries might not be correctly linked (Python screws up the symlinking on some systems, see #3756 ). Since then, I have a script to install and update my qtile setup https://github.com/clotodex/qtile-install-script. You can try it (builds everything inside a virtualenvironment) or just use the
allpatch.sh
script that patches the libs. Hope that helps (at least to diagnose).Hi Guys, any new Info’s to this Issue? Is there a timeline for the wlroots 0.16 update?