snapcrafters / alacritty

A community-maintained package to easily install Alacritty on Linux
MIT License
9 stars 12 forks source link

[BUG] Conflict of version for DRI driver #20

Open NicsTr opened 7 months ago

NicsTr commented 7 months ago

Describe the bug

When launching any application using mesa from alacritty, I get the following error message: DRI driver not from this Mesa build ('23.2.1-1ubuntu3.1~22.04.2' vs '24.0.5-1ubuntu1').

When I install alacritty through cargo install alacritty everything works as expected.

To Reproduce

Steps to reproduce the behavior:

  1. Install alacritty from snap (snap install alacritty --classic)
  2. Launch an alacritty terminal
  3. Run glxinfo from this terminal
  4. See error

Expected behavior

No error should occur.

Environment (please complete the following information):

Additional context

Shell output:

$ glxinfo
name of display: :0
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
using driver amdgpu for 4
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
pci id for fd 4: 1002:15bf, driver radeonsi
MESA-LOADER: dlopen(/snap/alacritty/125/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so)
DRI driver not from this Mesa build ('23.2.1-1ubuntu3.1~22.04.2' vs '24.0.5-1ubuntu1')
failed to load driver: radeonsi
using driver amdgpu for 4
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
pci id for fd 4: 1002:15bf, driver radeonsi
MESA-LOADER: dlopen(/snap/alacritty/125/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so)
DRI driver not from this Mesa build ('23.2.1-1ubuntu3.1~22.04.2' vs '24.0.5-1ubuntu1')
failed to load driver: radeonsi
MESA-LOADER: dlopen(/snap/alacritty/125/usr/lib/x86_64-linux-gnu/dri/swrast_dri.so)
did not find extension DRI_Kopper version 1
DRI driver not from this Mesa build ('23.2.1-1ubuntu3.1~22.04.2' vs '24.0.5-1ubuntu1')
X Error of failed request:  BadValue (integer parameter out of range for operation)
  Major opcode of failed request:  152 (GLX)
  Minor opcode of failed request:  24 (X_GLXCreateNewContext)
  Value in failed request:  0x0
  Serial number of failed request:  54
  Current serial number in output stream:  55

LIBGL_DEBUG output (only if you have graphics related issue):

$ LIBGL_DEBUG=verbose alacritty
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
libGL: using driver amdgpu for 21
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
libGL: pci id for fd 21: 1002:15bf, driver radeonsi
libGL: MESA-LOADER: dlopen(/snap/alacritty/125/usr/lib/x86_64-linux-gnu/dri/radeonsi_dri.so)
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
libGL: Can't open configuration file /etc/drirc: No such file or directory.
libGL: Can't open configuration file /home/username/.drirc: No such file or directory.
/usr/share/libdrm/amdgpu.ids version: 1.0.0
libGL: Using DRI3 for screen 0
VasilisManol commented 7 months ago

The same error comes in Ubuntu 23.10 with output: libGL error: DRI driver not from this Mesa build ('23.2.1-1ubuntu3.1~22.04.2' vs '23.2.1-1ubuntu3.1')

georgeyk commented 3 months ago

Also reported in https://github.com/snapcrafters/alacritty/issues/27 I've found by accident that the command would run with sudo, and normally in the "system" terminal. After digging a bit, I found that LIBGL_DRIVERS_PATH and LIBVA_DRIVERS_PATH was set to the "snap" path (/snap/alacritty/ ...), so I just reset it inline when running glxgears (or any app that needs it). I'm largely unfamiliar to snap packaging, but I hope it helps to fix this.

Gooygeek commented 3 months ago

I can confirm these environment variables are to blame. By unsetting them or by setting them to the system installation, gui apps (e.g. glxgears) can be launched.

I've added the following to my .zshrc:

export LIBGL_DRIVERS_PATH="/usr/lib/x86_64-linux-gnu/dri"
export LIBVA_DRIVERS_PATH="/usr/lib/x86_64-linux-gnu/dri"