Repository navigation
mesa: restore OpenCL support. - #136402
Conversation
primeos
left a comment
There was a problem hiding this comment.
Overall this looks mergeable to me with a few changes. Thanks!
|
Works on Nvidia P2000 (not exactly this PR, but my own rebase of #82729 to the latest |
|
Thanks for the reviews, I think I’ve addressed them. |
|
Force pushed to change the commit message (there shouldn’t be a |
|
This way to enable OpenCL (taken from @sbruder #82729 (comment)) does not required mass-rebuild because of |
|
I’m not sure if I understand you correctly, but according to #82729 (comment) using a separate output for OpenCL is not easily possible. Concerning mass rebuilds, that will only affect nixpkgs once (when this PR is merged), but after that it only requires building one additional package ( That is the case independent of what method is used to make the OpenCL support optional (separate output or different package/guards). |
|
But |
|
As "mass-rebuild way" I meant the way to enable OpenCL which I used: (super: self: {
mesa = super.mesa.override { enableOpenCL = true; }
})Here is a single |
Yes it does. However, duplicated files are not that uncommon on a NixOS system and are introduced with every big mass-rebuild (e.g. on an openssl (patch) update, most packages depending on it do not change, but are still stored multiple times). To only store the files once there is While it might be cleaner to move the OpenCL support it into a separate output, it seems to be not that easily possible. Though if you manage to get it working with an extra output, I’m more than happy to use that instead.
Overriding a widely-used package globally will always cause mass-rebuilds. For that reason, |
|
So I suggested that the additional output of |
|
On further testing it turned out that installing OpenCL support into its own output is not that complicated. I force-pushed my attempt at doing it. Enabling OpenCL support now works by setting |
15fc39c to
c3e7ab0
Compare
primeos
left a comment
There was a problem hiding this comment.
I didn't have time to test it yet / investigate if this affects the other outputs and their closure sizes but the diff LGTM now and enabling it by default on Linux seems reasonable (due to the separate output).
There was a problem hiding this comment.
Note to self: We probably want to package this as llvmPackages*.libclc to keep it up-to-date, etc. (outside the scope of this PR but in case anyone has an opinion on that).
There was a problem hiding this comment.
i suggested it before, but it seem not to be done yet
There was a problem hiding this comment.
Did you test if this works? I guess this gets linked as /run/opengl-driver/etc/OpenCL/vendors/mesa.icd but I'm not sure if that path is searched and I haven't tested it yet.
There was a problem hiding this comment.
Yes, this worked when I tested it. The NixOS manual mentions hardware.opengl.extraPackages (which get linked to /run/opengl-driver) as a way for installing OpenCL ICDs, so that seems to be the intended path for them.
rnhmjoj
left a comment
There was a problem hiding this comment.
I haven't tested the driver but the changes look reasonable to me.
The closure size for the other outputs didn't change:
-
before:
- out: 33.2M
- dev: 38.4M
- drivers: 864.5M
-
after:
- out: 33.2M
- dev: 38.4M
- drivers: 864.5M
- opencl: 1.0G
so I think it's safe to be merged. Even if the drivers have some issue it's still an improvement over the current situation.
Co-authored-by: Sandro <[email protected]> Co-authored-by: Simon Bruder <[email protected]>
49a1820 to
b41d29d
Compare
|
@ofborg test sway |
primeos
left a comment
There was a problem hiding this comment.
@sbruder I'm really sorry about the long delay. It was a very busy month for me and I lost track of this PR / didn't get around to merge it. I catched a last mistake and will merge this PR once CI (hopefully) passes. Thanks a lot for this PR and your fast responses!
Also huge thanks to everyone who reviewed this!
(Especially @rnhmjoj for verifying the closure sizes.)
|
Let's ignore CI then I already ran the build and Sway test locally anyway: $ nix-build -A nixosTests.sway
/nix/store/i6c1ybq9jlbha0h6dzzac83agm4vdcwq-vm-test-run-sway |
|
I get the following error when trying to use mesa opencl: Tried to add libclc to the system environment and to opengl.extraPackages - neither worked. Any idea how to fix it? |
|
I am getting the same error When trying to run a hello-world program for OpenCL. It seems that it tried to find that file, but the path is ill-formatted. See the repeated path strace outputThe path is hardcoded in xxd outputThe wrong include directory is added by clover here, which is generated by this meson script. I'm not knowledgeable enough to fix it, but I think this is close to the root of the problem. |
|
Are there any plans to add this in the stable branch? |
|
This PR is quite old, contained in both 21.11 and 22.05 releases. |
Continuation of #82729.
Works with a Radeon RX 480 on NixOS 21.05, see #82729 (comment) for details.
Motivation for this change
Things done
sandbox = trueset innix.conf? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review wip"./result/bin/)