Skip to content

Commit

Permalink
nixGLIntel: Add libGL to LD_LIBRARY_PATH
Browse files Browse the repository at this point in the history
We have an Rust application using `imgui` with `glfw` where `nixGLIntel`
doesn't work: the application throws some issue about not being able to
create a window. However, on this same machine, `nixGLIntel <glxgears
from nixpkgs>` worked.

After trying to use `apitrace` and then `strace`, I noticed that it's
trying to open `libGL.so` and then `libGL.so.1` when that eventually
fails. This however does not exist in the nixpkgs mesa package:
NixOS/nixpkgs#40001. There seems to have been
some fixes regarding to the mesa change back in
nix-community#10 but presumably it didn't
address this particular problem.

I am not sure if this is the correct fix for the issue: let me know if
something else is supposed to be done, I'm not too privy as to how all
this graphics stuff works. It seems to work for my use-case however.

I guess `nixVulkanIntel` doesn't need such treatment as it's only about
OpenGL?
  • Loading branch information
Fuuzetsu committed Dec 28, 2021
1 parent c4aa5aa commit 689e274
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nixGL.nix
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ nvidiaVersionFile ? null,
# bit the size of nixGL closure.
enable32bits ? true
, writeTextFile, shellcheck, pcre, runCommand, linuxPackages
, fetchurl, lib, runtimeShell, bumblebee, libglvnd, vulkan-validation-layers
, fetchurl, lib, runtimeShell, bumblebee, libglvnd, vulkan-validation-layers, libGL
, mesa, libvdpau-va-gl, intel-media-driver, vaapiIntel, pkgsi686Linux, driversi686Linux
, zlib, libdrm, xorg, wayland, gcc }:

Expand Down Expand Up @@ -137,7 +137,7 @@ let
#!${runtimeShell}
export LIBGL_DRIVERS_PATH=${lib.makeSearchPathOutput "lib" "lib/dri" mesa-drivers}
export LIBVA_DRIVERS_PATH=${lib.makeSearchPathOutput "out" "lib/dri" intel-driver}
export LD_LIBRARY_PATH=${lib.makeLibraryPath mesa-drivers}:${lib.makeSearchPathOutput "lib" "lib/vdpau" libvdpau}:${glxindirect}/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=${lib.makeLibraryPath mesa-drivers}:${lib.makeSearchPathOutput "lib" "lib/vdpau" libvdpau}:${glxindirect}/lib:${lib.makeLibraryPath [libGL]}:$LD_LIBRARY_PATH
"$@"
'';
};
Expand Down

0 comments on commit 689e274

Please sign in to comment.