nixified-ai/flake

Towards bundled GPU drivers

max-privatevoid opened this issue · 0 comments

Problem Statement

Right now, we're not bundling userspace GPU driver libraries (Mesa, NVIDIA libraries). Instead, we rely on the correct drivers being available at /run/opengl-driver/lib, as they are on NixOS. This creates a problematic scenario in which the driver libraries are linked against incompatible versions of the same libraries that we're using as well. Chiefly among them, glibc (#34).

In order to be forwards- and backwards-compatible with anything and everything, our only real choice is to bundle those libraries as well. Bundled GPU driver libraries need to be compatible with the kernel they're running on. To my knowledge, this doesn't really matter for Mesa because the kernel APIs for in-tree graphics drivers are fairly stable. Not so much with NVIDIA. We need a way to dynamically detect at runtime which version of the NVIDIA kernel driver is in use and then realise the accompanying userspace driver libraries.

Ideas