I’m the author of nixGL which is a wrapper which installs OpenGL / Vulkan drivers compatible with your nix packages.
What is nixGL ?
This is mandatory to get working OpenGL in two situations:
- You use nix on a non NixOS system, such as ubuntu or arch linux.
- Even on nixos, if the nix package you install does not comes from the same nixpkgs clone than your system.
The testing problem
I won’t got in the details and the reasons why this is needed with nix, just keep in mind that OpenGL depends on your hardware configuration, which is by definition not reproducible. Hence it is a pain to test because you need the hardware.
I developed nixGL when I was working in the graphic industry, so I had access to a bunch of hardware configurations and especially, I was working with OpenGL everyday, I had users which were working with OpenGL everyday, so testing changes was easy.
But my life changed, I’m now doing something totally different. I’m now having only a laptop with NixOS and a simple Intel integrated GPU. I’m unable to test on many hardware.
What is currently tested
The current situation is:
- Mesa (Intel): OpenGL / Vulkan: I can test easily on my current working laptop.
- Nvidia Hybrid GPU: I can test OpenGL, but not vulkan, and it is a pain because it is on an old laptop which should have died 2 years ago but survives.
Everything else is not tested. I mean, I have no idea about the support for Mesa drivers other than Intel. I don’t know how Nvidia cards are working. I don’t know about the vulkan support for all of that either.
I know that it does not work with proprietary ATI cards. There is a pull request opened since 2 years with an attempt, but I had never found anyone to test it.
Recent nixGL changes
This week-end I’ve done a lot of changes to nixGL:
- It is now far easier to install and integrate in your own project:
nixGL = pkgs.callPackage "${builtins.fetchTarball {
url = https://github.com/guibou/nixGL/archive/17c1ec63b969472555514533569004e5f31a921f.tar.gz;
sha256 = "0yh8zq746djazjvlspgyy1hvppaynbqrdqpgk447iygkpkp3f5qr";
}}/nixGL.nix" {};
- I have added small tests in the CI. At least it tries to build all the supported wrappers and check that they are not making references to non existing files.
- I have set up a test bench that you can run on your machine. It tests Mesa, Nvidia, Nvidia Hybrid for OpenGL and Vulkan 32 and 64bits. However tests won’t only work if you have the associated hardware. It even allows testing on NixOS and will tell you if your NixOS is too compatible for the test to be useless.
- Installing is now simpler, the workflow have been uniformized between Nvidia and Mesa and the installation process is able to detect your current nvidia driver version automatically in a robust manner. Said otherwise, nixGL is a one command installation now.
All of that is really great, I’m really happy about that. But I’m not sure any of these works on the configuration I have not tested.
I need you!
If you care about OpenGL / Vulkan support, I’d like you to clone nixGL, run the tests (just run ./Tests.hs
in the main directory) and return any issue you have related to your config. Install nixGL, run OpenGL application. If anything is not fine for you, please, open a bug rapport. This will give you a “silver” contributor badge!
What I’d really like to do is to build a list of github users able to test different configurations, so I can ping them during pull request for review. You don’t need any knowledge / understanding of the technical details, as long as you know how to git clone
the repository and have an OpenGL application you want to run, you can contribute. This is the “gold” contributor badge!
For the platinum, well, I’d love to find a way to test all of that on CI automatically. If you know a service which can provides free testing machines with different OpenGL hardware, this will be awesome. If you have an hardware configuration which is not yet working with nixGL and are motivated to setup me a remote access to this hardware so I can fix the problem, I’ll be delighted!
Thank you!