I have some software packaged against nixpkgs 21.11, using nix-build
(which is supposed to run anywhere using nix, including Ubuntu, NixOS, and so on). It worked fine on my NixOS 21.11 laptop.
After upgrading the laptop to NixOS 22.05, my app (unmodified) now errors with:
myapp: /nix/store/s5zfi8x1r4h807qwbb2dxqw8jz7ipf20-glibc-2.33-59/lib/libc.so.6: version `GLIBC_2.34' not found (required by /run/opengl-driver/lib/libva.so.2)
It is trying to load my /run/opengl-driver/lib/libva.so.2
, which was built against (and probably uses a function from) the newer glibc 2.34 that comes with NixOS 22.05. But my app is linked against the older glibc.so.6
from my pinned nixpkgs 21.11. So dynamic loading fails.
libva.so
(video accelleration) is loaded because my app uses OpenCV and thus ffmpeg.
On my server that doesn’t have a GPU, myapp
starts perfectly fine, and libva.so
isn’t even loaded because it doesn’t exist, as strace shows:
openat(AT_FDCWD</root "/run/opengl-driver/lib/libva.so.2", O_RDONLY|O_CLOEXEC) = -1 ENOENT (No such file or directory)
It doesn’t exist because of this symlink on the server:
/run/opengl-driver/lib -> /nix/store/ybkk456fa7hwh52l0lirsjg89zsgyihq-mesa-21.2.5-drivers/lib
And that mesa derivation doesn’t ship libva.so
.
But my laptop uses NVIDIA and thus has libva.so
.
I do not wish my app to use native video acceleration. myapp
just uses OpenCV for some things that don’t need this.
Can I, at runtime, convince my nix-built myapp
binary to not load libva.so
, so that it behaves just as on the server without GPU?
Ideally I would be able to use the same binary (given that it works on the GPU-less server) and not need to rebuild an OpenCV that uses no ffmpeg at all.