mesa: Only build OpenCL stuff on platforms where it works, fix build on ppc64#456839
mesa: Only build OpenCL stuff on platforms where it works, fix build on ppc64#456839OPNA2608 wants to merge 2 commits intoNixOS:masterfrom
Conversation
1fbc908 to
e28b760
Compare
e28b760 to
d3f0075
Compare
d3f0075 to
4c22031
Compare
4c22031 to
0b0303f
Compare
|
(Back on a computer, evals again) |
0b0303f to
56b0887
Compare
3445189 to
1f61280
Compare
|
Merge conflicts resolved, and made it build on powerpc64-linux hardware again. |
1f61280 to
0634252
Compare
|
Resolved merge conflict. |
0634252 to
5a1a484
Compare
| "zink" # generic OpenGL over Vulkan, experimental | ||
| ] | ||
| # See platformOpenCLWorks | ||
| ++ lib.optionals (lib.meta.availableOn stdenv.hostPlatform spirv-llvm-translator) [ |
There was a problem hiding this comment.
Wonder if there's a way to DRY this condition. Maybe making it a function argument with a default isn't that bad after all...
There was a problem hiding this comment.
Would have to move the default list into at least the let block I think?
{
# ...
galliumDrivers ? null,
vulkanDrivers ? null,
# ...
}:
let
platformOpenCLWorks = /* ... */;
galliumDrivers' =
if galliumDrivers != null then
galliumDrivers
else (
[
# ...
]
++ lib.optionals platformOpenCLWorks [
# ...
]
);
vulkanDrivers' =
/* same pattern as above */;
# ...
in
stdenv.mkDerivation {
# ...
}Don't think this it great… but it would DRY this without introducing a function argument.
5a1a484 to
009329b
Compare
|
Patches to mesa got merged upstream, switched to |
|
Are those patches only in Mesa main or also 26.0.0? Do you have a link to the PRs? I can ask around about getting them backported so we don't have to ship them. |
|
OK so that means it'll be in 26.0.0 in a few days. |
009329b to
87c72ed
Compare
Somewhere in OpenCL-related code (SPIRV-LLVM-Translator at minimum), things go wrong when running `mesa_clc` for OpenCL-using drivers on big-endian: Invalid extended instruction import ‘nepOs.LC’ Based on upstream issues and blog posts, the issue is likely in at least SPIRV-LLVM-Translator, so this one will have BE added to its badPlatforms in the future. When SPIRV-LLVM-Translator is unavailable, don't bother with any OpenCL stuff.
See comments for details.
87c72ed to
04011e4
Compare
Rebased on master for Mesa 26.0.0, dropped With the idea from #473862 (comment), |

OpenCL support doesn't work when building natively on non-LE platforms: https://catfox.life/2024/11/29/the-complexities-of-enabling-opencl-support/
Eventually, the SPIRV stuff that comes before this might need to be marked broken on non-LE just to communicate this properly. But the first place where I've directly stumbled into this is when building
mesa.OpenCL stuff is only needed when building specific drivers, so we need to exclude those when this option is set to false.
(this is untested beyond "it builds", I'm not super familiar with all this stuff)
Things done
passthru.tests.nixpkgs-reviewon this PR. See nixpkgs-review usage../result/bin/.Add a 👍 reaction to pull requests you find important.