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

Mesa: failed to load iris driver due to glibc #216361

Open
ghost opened this issue Feb 14, 2023 · 20 comments
Open

Mesa: failed to load iris driver due to glibc #216361

ghost opened this issue Feb 14, 2023 · 20 comments
Labels
0.kind: bug Something is broken

Comments

@ghost
Copy link

ghost commented Feb 14, 2023

Describe the bug

When running multiple programs like Element, Google Chrome, or trying to play something on Bottles, I get the following:


libEGL warning: MESA-LOADER: failed to open iris: /nix/store/qbgfsaviwqi2p6jr7an1g2754sv3xqhn-gcc-11.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /nix/store/yvcnhajqbwcq35vpnsm1waw557dxcn5v-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)

[182991:0214/140950.926111:ERROR:gl_display.cc(508)] EGL Driver message (Critical) eglInitialize: DRI3: failed to load driver
libEGL warning: MESA-LOADER: failed to open swrast: /nix/store/qbgfsaviwqi2p6jr7an1g2754sv3xqhn-gcc-11.3.0-lib/lib/libstdc++.so.6: version `GLIBCXX_3.4.30' not found (required by /nix/store/yvcnhajqbwcq35vpnsm1waw557dxcn5v-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)

As a result, chrome/ium stuff relies on the cpu for rendering, and games straight up don't work.

Expected behavior

The driver is loaded correctly and all works fine.

Screenshots

If applicable, add screenshots to help explain your problem.

Additional context

Add any other context about the problem here.

Notify maintainers

@primeos @vcunat

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.10-zen1, NixOS, 23.05 (Stoat), 23.05pre454549.545c7a31e5d`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.13.2`
 - channels(root): `"nixos"`
 - channels(m911t): `"home-manager"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@ghost ghost added the 0.kind: bug Something is broken label Feb 14, 2023
@ghost
Copy link
Author

ghost commented Feb 14, 2023

Also, I'm not sure if this also affects Steam, but I think it does because games still use llvmpipe instead of the actual gpu driver.

@vcunat
Copy link
Member

vcunat commented Feb 14, 2023

I believe this usually happens when you mix significantly different nixpkgs versions. For the OS (and thus /run/opengl-driver/) and for the program that you execute.

@ghost
Copy link
Author

ghost commented Feb 14, 2023

root's channel was just nixos-unstable and my user just has home-manager's master. How could this happen? I don't have anything fancy beyond that.

@vcunat
Copy link
Member

vcunat commented Feb 14, 2023

Well, yesterday on nixpkgs master we did a major upgrade of the default gcc (and thus libstdc++), so even a few commits apart can do that.

EDIT: such major changes can't happen when following stable nixpkgs, for example.

@ghost
Copy link
Author

ghost commented Feb 14, 2023

ah, so perhaps I got bit by that. Coincidentally I'm moving back to nixos stable and h-m stable so I can game. I doubt I'll actually need the latest and greatest, so I'll be fine. I guess this can be closed, then?

@primeos
Copy link
Member

primeos commented Feb 14, 2023

Hm, the /nix/store/yvcnhajqbwcq35vpnsm1waw557dxcn5v-llvm-15.0.7-lib/lib/libLLVM-15.so -> /nix/store/qbgfsaviwqi2p6jr7an1g2754sv3xqhn-gcc-11.3.0-lib/lib/libstdc++.so.6 case seems a bit concerning - could potentially be a new/additional issue/regression (I didn't look into it though).
Nvm, seems like we already hit this case (with different versions) in the past: #95806 (comment)

Seems like yet another instance of #95808.

@vcunat
Copy link
Member

vcunat commented Feb 14, 2023

Yes, just libstdc++ instead of glibc. We've had it with some wayland lib, too, IIRC.

@vcunat
Copy link
Member

vcunat commented Feb 15, 2023

You probably built part of the app with one gcc version (and thus libstdc++ version) and part with another one.

@gilice
Copy link
Member

gilice commented Feb 15, 2023

You were right! kind of. I was using an overlay that was based on an older nixpkgs. I had to rebase that on the current master and now it works.

@ghost
Copy link
Author

ghost commented Feb 17, 2023

So I had switched to stable nixos, and today I updated the system (still stable) and I'm getting hit by this

No, something similar, because steam out of nowhere can't open proton games.

@pongo1231
Copy link
Member

pongo1231 commented Feb 19, 2023

Had the same issue but only with Steam games which try to access OpenGL drivers, running OGL games outside Steam worked fine. Tried both stable and unstable, but what fixed it for me was to switch to the "previous" beta branch for the Steam Linux Runtime. Not sure what the culprit was.

@ghost
Copy link
Author

ghost commented Feb 21, 2023

i reinstalled nixos (still using stable) and proton works now.

@anund
Copy link
Contributor

anund commented Feb 28, 2023

Hmm is this the same problem as #218238? The fix there was adding a dependency on gcc.

@evils
Copy link
Member

evils commented Mar 8, 2023

i ran into this on my occasionally used laptop, steam-run prusa-slicer seems like a viable workaround

@sg-qwt
Copy link
Contributor

sg-qwt commented Apr 24, 2023

Hit the same issue running mpv on laptop, steam-run mpv works fine, but what's the proper fix for this?

libEGL warning: MESA-LOADER: failed to open iris: /nix/store/8bmp6r3a0xfha3wj36phlc47clh9w81l-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/5k9x8dnwiq0h5czikpax6rbal547k24z-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)

libEGL warning: MESA-LOADER: failed to open swrast: /nix/store/8bmp6r3a0xfha3wj36phlc47clh9w81l-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/5k9x8dnwiq0h5czikpax6rbal547k24z-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)

libEGL warning: MESA-LOADER: failed to open iris: /nix/store/8bmp6r3a0xfha3wj36phlc47clh9w81l-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/5k9x8dnwiq0h5czikpax6rbal547k24z-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)

libEGL warning: MESA-LOADER: failed to open swrast: /nix/store/8bmp6r3a0xfha3wj36phlc47clh9w81l-glibc-2.35-224/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/5k9x8dnwiq0h5czikpax6rbal547k24z-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)

@vcunat
Copy link
Member

vcunat commented Apr 24, 2023

I think most people are running into this "just" because they're using a (sufficiently) different commit for their NixOS and their steam. (or forgot to pull 32-bit drivers into OS, but I think that causes different message)

A "proper" fix, i.e. making even mismatching version work seems even getting further away. Upstream mesa is going towards more strict version matching than before.

@ppenguin
Copy link
Contributor

ppenguin commented May 11, 2023

Just as an additional "workaround" (for posterity):

When I needed an unstable wlroots lib to solve this issue, I started by just setting hardware.opengl.package = unstable.mesa.drivers and using an unstable kernel with amdgpu (on an otherwise mostly "stable" system).

I thought I had gotten away with any issues after additionally getting alacritty also from unstable, but found additional indirect dependencies of packages not working later.

My (temporary) solution now is overlaying all opengl related deps from nixpkgs-unstable onto nixpkgs (stable), at the (significant!) cost of having to compile a large part of my installation (due to deviations from binary caches) for every nixos-rebuild.

{
	nixpkgs.overlays = [
		(_: _: { # !!! overlay to force full deps on unstable opengl
			mesa = unstable.mesa;
			intel-media-driver = unstable.intel-media-driver;
			vaapiIntel = unstable.vaapiIntel;
			vaapiVdpau = unstable.vaapiVdpau;
			libvdpau-va-gl = unstable.libvdpau-va-gl;
			virglrenderer = unstable.virglrenderer;
			xdg-desktop-portal-wlr = unstable.xdg-desktop-portal-wlr;
			qemu = unstable.qemu;
		})
	];

	hardware.opengl = {
		enable = true;
		# package = mesa.drivers;
		driSupport = true; # for wine with openGL
		driSupport32Bit = true; # for wine with openGL
		extraPackages = with pkgs; [
			intel-media-driver # LIBVA_DRIVER_NAME=iHD
			vaapiIntel         # LIBVA_DRIVER_NAME=i965 (older but works better for Firefox/Chromium)
			vaapiVdpau
			libvdpau-va-gl
		];
	};
}

EDIT

It appears the (time) cost of the compiling is so high (you also need to recompile things like openoffice and wine (the latter seems obvious in hindsight)), that I'd say in most cases it isn't worth it and would warrant accepting either everything unstable or "most" stable (at least keep opengl as the lowest common denominator and avoid using packages that require more recent versions of it)

@hughobrien
Copy link
Contributor

hughobrien commented Jun 5, 2023

For other passers-by, I wanted an older version of a package from nixpkgs, so I had just that overridden. However it conflicted with the system/current mesa also.

libEGL warning: MESA-LOADER: failed to open radeonsi: /nix/store/hsk71z8admvgykn7vzjy11dfnar9f4r1-glibc-2.35-163/lib/libc.so.6: version `GLIBC_2.36' not found (required by /nix/store/jvj19d7vrlxdyfw8vw4ad4h9inwsp1wz-llvm-15.0.7-lib/lib/libLLVM-15.so) (search paths /run/opengl-driver/lib/dri, suffix _dri)

Based on @ppenguin 's suggestion above it was simply a matter of pinning the opengl version to the same source. Likely this will break the current opengl programs but it's easy enough for me to switch back.

...
let oldpkgs = import /data/nixpkgs { };
...
environment.systemPackages = with pkgs; [ oldpkgs.oldthing ];
...
hardware.opengl = {
      package = oldpkgs.mesa.drivers;
...

@vcunat
Copy link
Member

vcunat commented Jun 6, 2023

I suppose that for such use cases it might be better to use approaches like nixGL:
https://github.com/guibou/nixGL

@NightEule5
Copy link

NightEule5 commented Mar 10, 2024

I had a similar issue where my whole system fell back to rendering with llvmpipe, reinstalling didn't fix it for me. I commented out the opengl part of my config, rebuilt, rebooted, and that fixed it. It still works when I then re-enable it.

Maybe some package (Firefox?) implicitly installs another version of the media acceleration drivers, so installing them explicitly leads to the "two different versions installed" error. I'm really not sure why it continues to work when re-enabled, maybe Nix doesn't reinstall them

Edit: the culprit was actually this:

services.xserver.deviceSection = ''
  Option "AccelMethod" "uxa"
  Option "DRI" "iris"
'';

Which I had disabled along with the OpenGL configuration while troubleshooting. I think the first "AccelMethod" is the trigger, which I set because tabbing out of games was causing artifacting and that seemed to fix it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: bug Something is broken
Projects
None yet
Development

No branches or pull requests

10 participants