Hi,

I notice inconsistent behaviour between my root and user accounts when
it comes to OpenGL. I'm using the nvidia proprietary driver with GTX 650
but I noticed this in the past with an Intel chip.


If I put a package in my configuration.nix, nixos-rebuild switch and
then try to use this package, it will think that the OpenGL version is 1.4!

[root@lenalee:/home/shana]# glxinfo | grep version
libGL error: dlopen /run/opengl-driver/lib/dri/swrast_dri.so failed
(/run/opengl-driver/lib/dri/swrast_dri.so: cannot open shared object
file: No such file or directory)
libGL error: unable to load driver: swrast_dri.so
libGL error: failed to load driver: swrast
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL version string: 1.4 (2.1.2 NVIDIA 331.79)

Sometimes I can mitigate the problem by setting LD_LIBRARY_PATH

[root@lenalee:/home/shana]# LD_LIBRARY_PATH=/run/opengl-driver/lib
glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
OpenGL core profile version string: 4.3.0 NVIDIA 331.79
OpenGL core profile shading language version string: 4.30 NVIDIA via Cg
compiler
OpenGL version string: 4.4.0 NVIDIA 331.79
OpenGL shading language version string: 4.40 NVIDIA via Cg compiler


But not always. I don't see why I even have to set it myself, it should
be done for me. Any software such as ‘mpv’ that I put in my
configuration.nix will think it's using OpenGL 1.4.

This carries over to the user, where you'll see the similar output.

What I have noticed in the past is that sometimes if I nix-env -i an
existing piece of software on my user account, it will no longer think
it's using OpenGL 1.4 and will behave properly. I had this happen with
‘mpv’ before but I can't currently replicate.

In any case, how do I get my software to properly pick up OpenGL without
having to specify LD_LIBRARY_PATH by hand‽ Surely it's not meant to be
like this. It makes me think my setup is somehow wrong or lacking.

When I specify a bunch of packages in configuration.nix, I expect to be
able to run them out of the box, without having to set LD_LIBRARY_PATH
for every single one of them by hand. I don't imagine packagers are
meant to wrap all their graphical programs in a script setting
LD_LIBRARY_PATH either.

Please don't suggest exporting LD_LIBRARY_PATH in my .bashrc or
whatever: if it's meant to be set like this then why is it not set by
default? I'd like to finally fix this problem once and for all.

Thanks

-- 
Mateusz K.
_______________________________________________
nix-dev mailing list
[email protected]
http://lists.science.uu.nl/mailman/listinfo/nix-dev

Reply via email to