-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Tracking] Agree on a name for hardware.graphics #323675
Comments
hardware.userSpaceDrivers (too long, but relatively unambiguous) |
My argument for I also like |
We can fix that on non-NixOS too, if we just load the drivers from normal locations like /usr. I don't like |
H'm, this has far-going consequences. To clarify, you're suggesting that we selectively let loaders like |
We let loaders can /usr, yes. |
The NixOS options API change can happen independently from the loader implementation. We don't need to have all the functionality which the new API could provide us with from the get-go. Mapping the existing functionality onto it would be a perfectly reasonable first step IMHO.
I actually tried this a while back and this is not trivially possible as you still get glibc mismatches. |
Now onto the hardest problem in all computer science: Naming. Before we discuss different names, I think it's good to first define how to measure their merit. I believe that the term "drivers" to be perfectly understandable by non-technical people and even the mainstream to a degree. Hardware drivers is not a new concept or term that we'd need to teach to the current "target audience" of NixOS. I don't like the term "accelerators" or "acceleration [APIs]". To know this term or connect it with configuring your GPU, you must have a bit of experience in the field of accelerated computing. As a recent CS graduate myself, this isn't something I'd expect my fellow graduates to know. While they will have at least made contact with accelerated compute and likely heard of OpenGL and/or CUDA, most will likely not connect this term with it. There are two saving graces here however:
I also simply do not think there is a better term. I concur with @K900's opinion on the One could do away with the term "driver" entirely here by calling userspace drivers acceleration API implementations instead. This way we wouldn't cause any confusion around whether we're talking about whether the "driver" is a kernel driver or userspace library. |
Random thoughts:
|
Smirking: "A non-technical user will be confused by "drivers" much less than a technical one" |
Since this was brought up, I'll mention #273389: here the goal was to allow one library ( |
Yeah we can't have it perfectly working, but we can at least have it usually-mostly-working, as long as your nixpkgs libc is ~newer than your drivers. |
Unlesss maybe we mess around with the dynamic loader. I'm still comprehending the implications of #248547 (comment). Is there a separate issue to track |
I didn't comment on the previous two on-topic proposals though.
Opinion: a path longer than As a matter of fact, I'd be happy with As a thought experiment concerning the package set options: do you feel like
But there is one. As K900 had pointed out months ago, ROCm links a runtime driver but one with a stable uapi which "just works" regardless of versioning. I agree this is probably not worth bringing to the users' attention.
The option will be discoverable via
All that you said plus more global coherence and consistency. As I mentioned, I'd like the Nixpkgs' internals like the hooks and their APIs, the package set options, the NixOS options, the interfaces of wrappers (NixGL, nixglhost, etc; note: might be relevant even after the loader changes proposed by K900), and possibly the paths like |
Issue description
The
hardware.opengl.enable
option, as well as the relatedaddOpenGLRunpath
hook and the/run/opengl-driver
path, have been historically very confusing (e.g. it's not obvious one has to "enable opengl" in order to use cuda). #141803 introduced an arguably better name for the hook,addDriverRunpath
: although it's not obvious what a "driver" is until you read the documentation, the new name isn't misleading anymore. It's also less ambiguous as to which characters could be upper-case. The/run/opengl-driver/lib
is so far kept for compatibility purposes, which is fine because it's mostly invisible to the users. #320228 shattered the status quo concerning the nixos option name, introducinghardware.graphics.enable
. However, this might not yet be the permanent solution.The hook and the option should have consistent names:
addDriverRunpath
doesn't trivially map intohardware.graphics.enable
.A number of alternative names had been suggested123. More notably, an alternative and more fine-grained configuration scheme was proposed by @Atemu4.
Common concerns that have been raised:
hardware.{gp,}gpu
,hardware.graphics
,hardware.opengl
, etc aren't actually just about GPUs, graphics, or OpenGL; these options will concern a variety of external devices (e.g. TPUs) and integrated processors' features, and a variety of software stacks (e.g. Vulkan, OpenCL).hardware.{impure-,}drivers
,hardware.accelerators
, even if technically correct, are non-suggestive; they're likely to confuse the user on the first encounter.A related note is that Nixpkgs (
pkgs
) also has options, and some of them concern "accelerators" and "devices":config.cudaSupport
,config.cudaCapabilities
,config.rocmSupport
; @NixOS/cuda-maintainers (CC @NixOS/rocm-maintainers) have been considering to aggregate this kind of options into a hierarchy: e.g.config.accelerators.{cuda,rocm}.enable
instead of{cuda,rocm}Support
,config.accelerators.cuda.gencodes
instead ofcudaCapabilities
, etc. We have also been considering adding similar global configuration options for OpenCL, MKL, etc - which would also fit reasonably well underconfig.accelerators
. Whatever the name, Nixpkgs' option names should be consistent with NixOS and the hook too.CC @Atemu @K900
Footnotes
https://github.com/NixOS/nixpkgs/pull/320228#issuecomment-2183092286 ↩
https://github.com/NixOS/nixpkgs/pull/320228#issuecomment-2171511374 ↩
https://github.com/NixOS/nixpkgs/pull/276558 ↩
https://github.com/NixOS/nixpkgs/issues/141803#issuecomment-2010803483 ↩
The text was updated successfully, but these errors were encountered: