Closed tiramiseb closed 6 years ago
This works for me. Do you have /run/opengl-driver/lib
in your LD_LIBRARY_PATH
?
Yes:
$ echo $LD_LIBRARY_PATH | grep /run/opengl-driver/lib
/nix/store/b68fx6ng2nvrdffkgpk71c7a8412lapr-sane-config/lib/sane:/run/opengl-driver/lib
... but no libGL.so
in this directory...
So, with a little more digging, when looking at the mesa-driver package contents (because /run/opengl-driver/lib is a symlink to /nix/store/[...]-mesa-drivers[...]/lib
), it looks like there is something wrong with what I have in this package on unstable:
ls -1 /nix/store/*mesa-drivers*/lib
/nix/store/2z8y0ww6qrjrg7wlnq8lwlsqd8k18sk7-mesa-drivers+txc-17.3.6/lib:
bellagio
d3d
dri
libEGL.la
libEGL.so
libEGL.so.1
libEGL.so.1.0.0
libgbm.la
libgbm.so
libgbm.so.1
libgbm.so.1.0.0
libglapi.la
libglapi.so
libglapi.so.0
libglapi.so.0.0.0
libGLESv1_CM.la
libGLESv1_CM.so
libGLESv1_CM.so.1
libGLESv1_CM.so.1.1.0
libGLESv2.la
libGLESv2.so
libGLESv2.so.2
libGLESv2.so.2.0.0
libGL.la
libGL.so
libGL.so.1
libGL.so.1.2.0
libtxc_dxtn.la
libtxc_dxtn.so
libtxc_dxtn.so.0
libtxc_dxtn.so.0.0.0
libvulkan_intel.la
libvulkan_intel.so
libvulkan_radeon.la
libvulkan_radeon.so
libwayland-egl.la
libwayland-egl.so
libwayland-egl.so.1
libwayland-egl.so.1.0.0
libxatracker.la
libxatracker.so
libxatracker.so.2
libxatracker.so.2.3.0
libXvMCgallium.so
libXvMCgallium.so.1
libXvMCgallium.so.1.0.0
libXvMCnouveau.so
libXvMCnouveau.so.1
libXvMCnouveau.so.1.0
libXvMCnouveau.so.1.0.0
libXvMCr600.so
libXvMCr600.so.1
libXvMCr600.so.1.0
libXvMCr600.so.1.0.0
pkgconfig
vdpau
/nix/store/zlwfk9riq72lj6d2r57vacvf9adks71r-mesa-drivers+txc-17.3.8/lib:
bellagio
d3d
dri
libEGL_mesa.la
libEGL_mesa.so
libEGL_mesa.so.0
libEGL_mesa.so.0.0.0
libGLX_mesa.la
libGLX_mesa.so
libGLX_mesa.so.0
libGLX_mesa.so.0.0.0
libtxc_dxtn.la
libtxc_dxtn.so
libtxc_dxtn.so.0
libtxc_dxtn.so.0.0.0
libvulkan_intel.la
libvulkan_intel.so
libvulkan_radeon.la
libvulkan_radeon.so
libxatracker.la
libxatracker.so
libxatracker.so.2
libxatracker.so.2.3.0
libXvMCgallium.so
libXvMCgallium.so.1
libXvMCgallium.so.1.0.0
libXvMCnouveau.so
libXvMCnouveau.so.1
libXvMCnouveau.so.1.0
libXvMCnouveau.so.1.0.0
libXvMCr600.so
libXvMCr600.so.1
libXvMCr600.so.1.0
libXvMCr600.so.1.0.0
pkgconfig
vdpau
I see there have been recent changes in https://github.com/NixOS/nixpkgs/commits/master/nixos/modules/hardware/opengl.nix and also in the mesa drivers package. Maybe it is related ?
My 3D hardware is the common Intel laptop chip, no nvidia, no radeon - maybe this information is important here...
By the way, libGL.so
is missing in all new occurrences of /nix/store/*mesa-noglu*/lib
(version 17.3.8, from nixos-unstable), whereas it is present in all occurrences of version 17.3.6, from nixos-18.03.
This seems to work on (at least) darwin: https://github.com/knedlsepp/nixpkgs/tree/fix-pyopengl
I'm unsure what's the rationale behind not handling libGL.so
the same way it is done with libGLU.so
: https://github.com/NixOS/nixpkgs/blob/67ef59fd26c78fc34811c846f770ee855b2f0d0f/pkgs/top-level/python-packages.nix#L11572-L11573 but if we do, as mentioned above, it seems to work for me.
That /run/opengl-driver/lib
no longer contains libGL is an intentional change introduced by #37369. Directly link to the libraries in the libGL
and libGLU
packages instead.
Okay so it is indeed a change in mesa-drivers. It may impact other packages too... I think I was having a similar problem with other packages, but I'm not sure anymore and I prefer taking care of one thing at a time. Once I have the pyopengl stuff working, I'll take a look at the other problems I had...
Now that I see how it is done for pyopengl, I may make a PR to do the same on another package, if needed. Thanks
@Mic92 @tiramiseb Packages Minetest and Openarena are still affected by issue.
I haven't found a better way than to reintroduce libGL.so back to /run/opengl-driver/lib
:
hardware.opengl = {
enable = true;
extraPackages = with pkgs; [
...
libGL
];
setLdLibraryPath = true;
};
I haven't found a better way than to reintroduce libGL.so back to
/run/opengl-driver/lib
:hardware.opengl = { enable = true; extraPackages = with pkgs; [ ... libGL ]; setLdLibraryPath = true; };
Thank you for this, I've spent 3 days trying to make libGL.so availalbe and this finally did it :pray:
Issue description
After upgrading from 18.03 to unstable, curabydagoma (whose package I maintain) does not work anymore, with error "Unable to load OpenGL library". I have easily narrowed it down to the pyopengl package.
But I don't know what I can do to fix this error...
Steps to reproduce
Technical details
"x86_64-linux"
Linux 4.14.38, NixOS, 18.09.git.af55a0c (Jellyfish)
yes
yes
nix-env (Nix) 2.0.1
"nixos-17.09.3047.8bce347f02f"
/home/sebastien/Code/nixpkgs-channels
(this is a copy of the nixos-unstable branch of nixpkgs-channels).