-
-
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
Deprecate usage of OpenGL utilties and NixOS options. #141803
Comments
For the transition period ( NixOS 21.11), I think keeping the old |
I agree. Also, on a related note, having to specify your graphics driver at the xserver level in the module system feels wrong to me. I'm still not exactly sure how it maps given names to driver packages either. |
I propose two changes:
|
potential future work as well:
|
I'm also kind of wondering whether |
This issue has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/how-to-run-bevy-game-in-nixos/17486/11 |
Should we, in addition, consider using a libc-versioned directory? Motivated by https://discourse.nixos.org/t/python-dll-import/22594/17 |
/run/opengl-driver/
to a more appropriate directory
Decided to rename this issue since renaming the underlying path was deemed too risky for potential breakages. |
Could you provide some context as to why? My naive assumption was that we'd have a new path but:
which would be quite trivial. |
TBH, I'm not sure how much value there is to migrating the filesystem path (unless we splay the paths further to increase granularity). I suspect what users see in practice is the nixos option path |
For the NixOS module change, I came up with these terms:
The usage of the NixOS options API would then look a little like this: {
hardware.acceleration.opengl.enable = true;
hardware.drivers.mesa.enable = true;
} Individual drivers would also have a Each acceleration API would have a Additionally, accel APIs have a Here's an example of how a non-trivial driver config could look like: {
hardware.drivers.mesa.enable = true; # Would be default if GUI is enabled
hardware.drivers.mesa.package = p: p.mesa_42; # Perhpaps possible at some point
hardware.drivers.amdvlk.enable = true;
hardware.drivers.amdgpu-pro.enable = true;
hardware.drivers.cuda.enable = true;
hardware.drivers.cuda.package = p: p.cudaPackages_12;
hardware.acceleration.vulkan.enable = true;
# Ideally you could specify the concrete driver name ("RADV", "radeonsi", "zink"
# etc.) here but I don't think that'd be possible to implement
hardware.acceleration.vulkan.default = "mesa"; # AMDVLK is still present but mesa's drivers are preferred
hardware.acceleration.vulkan.drivers.amdgpu-pro = null; # Disable the vulkan driver; can't ever be used
# Perhaps instead:
# hardware.drivers.amdgpu-pro.apis = [ "opencl" ]; # to not insert itself into drivers other than OpenCL?
hardware.acceleration.opencl.enable = true;
hardware.acceleration.opencl.default = "amdgpu-pro"; # OpenCL from AMDGPU-PRO
} It's currently not possible to know which
Alternatively, I had thought of using multiple outputs; one for each driver. I kinda like that approach more as it generally strikes me as cleaner and has the potential to reduce closure size ( In light of this, I'd also like to propose to split the global lib dirs into accel API subdirs for clean separation. Anyhow, that's my current draft. Let me know what you think. |
That was my initial take as well, but there's community projects like nixGL and others who likely have hard coded the path. And there's a potential that we could never fully remove it without breaking someone |
Forgive my ignorance, but wouldn't it be ok to make those kinda breaking changes by deprecating in one release and then removing one or two releases later? Surely nixos isn't promising to never change paths because someone might be using the old location? EDIT:I don't mean to imply we shouldn't consider non-breaking options where possible |
nixGL only sets the LD_LIBRARY_PATH? Although in all probability we must break someone's workflow...
Fun fact: cudaPackages don't ship the driver (except for
Interesting. Would we somehow have to filter the glvnd/opencl loader/vulkan loader configs that come with the drivers to enforce that the declarative configuration be implemented? |
nixGL appears to be actively maintained. I don't think we need to worry about breaking it as they can simply adapt. Also, we could simply keep providing the old path in both NixOS and binaries with a preference for the new path and that should work out fine.
Oh, okay. I'll leave it to you CUDA people to figure that out. I will only be lifting drivers to this interface on a best-effort basis and the rest will keep using their legacy interface with a minor implementation change. Though if you forsee possible issues you could have mapping your driver to this interface, let me know so that we can design the interface better from the start.
That or simply write our own. Though I'll only be adding the Some issues I still need to think about:
|
I think NixGL doesn't care about |
The original protest against renaming the path: NixOS/rfcs#121 (comment) I feel more strongly about the NixOS options being intuitive than the implementation consistent. |
I think @infinisil was more concerned with it being placed under |
I believe I got all of the packages. Once merged, I should be able to deprecate |
This thread is over my head, but I would like to check it catboost, lightgbm, and python-modules/lightgbm need the same? All three have GPU or CUDA support options. |
This is more about deprecating usage of the term |
Talked to @Atemu , we concluded that we can close this ticket and have a more "NixOS options" specific ticket to represent that work. |
Going to do one last pass on documentation to ensure all references have been updated. I'll close this ticket after that sweep |
I wonder if |
It should come from the toplevel |
TheDirectory renaming is now out of scope/run/opengl-driver/
directory contains more than just opengl libraries now. It also includes vulkan implementations, machine learning libraries, hardware-accelerated encoding and decoding, opencl implementations, and many others.This directory is also being used as the way to get access to the host machines gpu drivers. I think it's another source of confusion for many users to have to add
addOpenGLRunpath
so that they can get a vulkan game / cuda workload / opencl workload to work.I think we should deprecate this prior to the 21.11 release, and fully move it to something like
/run/gpu-driver/
or something more representative of the desired affect.I would also like if someone specifies a value forThis was done in 02cef04c8187services.xserver.videoDrivers
, that they would also get the gpu libraries mounted automatically instead of needing to do a separatehardware.opengl-drivers.enable = true;
.cc @ryantm
EDIT: roadmap (2.5 years later... lol):
addOpenGLRunpath -> addDriverRunpath
addOpenGLRunpathcudaPackages.addDriverRunpath
: cudaPackages: generalize and refactor setup hooks #281576autoAddOpenGLRunpathHook -> autoAddDriverRunpath
NixOS Module changes: TODO @Atemu?
The text was updated successfully, but these errors were encountered: