Solution for update that breaks graphical desktops

I am using the reform debian image, and a recent apt update , apt upgrade , apt autoremove caused some errors when i tried to launch any of the graphical desktop environments (sway, gnome, reform-windowmaker). Below are the errors I got when I launched sway. Gnome wouldn’t even output any errors, it would just fall back to command line.

MESA-LOADER: failed to open imx-dcss: libLLVM-11.so.1: cannot open shared object file: No such file or directory (search paths /usr/local/lib/aarch64-linux-gnu/dri)
failed to load driver: imx-dcss
MESA-LOADER: failed to open kms_swrast: libLLVM-11.so.1: cannot open shared object file: No such file or directory (search paths /usr/local/lib/aarch64-linux-gnu/dri)
failed to load driver: kms_swrast
MESA-LOADER: failed to open swrast: libLLVM-11.so.1: cannot open shared object file: No such file or directory (search paths /usr/local/lib/aarch64-linux-gnu/dri)
failed to load swrast driver
00:00:00.029 [ERROR] [wlr] [backend/drm/renderer.c:28] Failed to create GBM device
00:00:00.029 [ERROR] [wlr] [backend/drm/backend.c:201] Failed to initialize renderer
00:00:00.031 [ERROR] [wlr] [backend/backend.c:174] Failed to create DRM backend
00:00:00.031 [ERROR] [wlr] [backend/backend.c:312] Failed to open any DRM device
00:00:00.147 [ERROR] [sway/server.c:55] Unable to create backend

Looking closely at the apt log in /var/log/apt/history.log, I noticed that the upgrade installed LLVM 13, and autoremove got rid of LLVM 11. After reinstalling the neccessary packages:

apt install llvm-11*

my graphical environments now launch without issue. Hopefully this helps someone else! I was mid-writeup of this problem when I figured it out :slight_smile:

7 Likes

This helped me fix the issue I was working on this week. Thanks for sharing!

This worked for me, but I needed to restart my machine first - I was getting a bare “Illegal Instruction” error before I did.

Do we know specifically why this works? “Reinstalling something Autoremove thinks is safe to remove” suggests that the problem is with a dependency tree in Debian.

Much appreciated. I saw this post before I updated Debian and was able to save myself some trouble.

I believe the problem is owed to the fact that Mesa is built from source. apt thus has no idea about its dependency on the version of LLVM it was built with, so it blithely removes the old version after upgrading to the newest major release. I’d guess that rebuilding Mesa would have also fixed your problem. If not, then maybe “llvm-11*” ought to be added to the “mmdebstrap” command in mkuserland.sh.

Edit: A comment in mkuserland2.sh seems to suggest that the necessary patches should have shipped with Mesa 21.1.3. Debian Sid seems to have Mesa at 21.2.6. Perhaps the source build of Mesa is no longer necessary? Guess I’ll have to try making an image with the Mesa package from Debian instead of the local build to see if it works…

1 Like

+1! Excellent work @sudomax!
Got me going w/ sway again. Reboot was not necessary for me.
Thanks for the heads up.