Change:
I use intel-compute-runtime to provide opencl to darktable and it's not being fetched from the cache since today 2022-04-22 Also, compiling intel-graphics-compiler (which is a dependency) fails so I had to remove it altogether. Steps to reproduce the behavior: Get's installed from cache Please run and paste the result.
When running the line I see:
The problem is in this: It seams that upstream has fixed it long ago: Upgrading at least to 1.0.9289 could fix the problem.
I get the same error: Any workarounds?
Seems like is inactive.
Upgrading and therefore , , , , and seems to do the trick for me BUT, i don't really have a clue what i'm doing...
so probably we just need someone to update the version here.
that is indeed inevitable, i guess. I had to do some trickery regarding the compilation of and , else it would segfault when compiling with something like which seems to happen when two different clang compilations are present in the build environment. (guess this is the case when building with ) , , , and similar in Now that i have the new versions running, i tried to somehow confirm a working solution and ran like in and it coredumped with that same message as well, so i'm uncertain if this is caused by my changes or if it failed before that anyway. Is coredumping for you as well right now, even without the updated versions?
Hmm, just tried to run in my previous NixOS generation. It gave some output and did not segfault. So my current approach is compiling but seems to not work correctly.
Woah, had in their . This produces a pkgconfig of e.g. So we need to patch with something like Another case for
So far is building, but the depender is failing to build its test suite, because of probably? is linked statically into , a dependee of . Which probably leads to being statically present and hence causing this segfault? See also
Now this builds and does not segfault any longer. I gues the main trick was to add to s to make it compile a shared instead of the static . It seems like the static led to the segfault by including libLLVM statically into the build and when calling functions of libLLVM it got confused about its split personality? i don't know.
So I was allready working on a PR for this and I only just now found this thread. The approach I took is similar to but I didn't update , and since the versions in nixpkgs are already newer. Once I verified it works for me I can send in a PR. I was also the one who did the last update.
beautiful :) Did you also find the switch in and being unnecessary? Also i noticed some of the existing do not apply any longer and need to be cleaned up. The llvm testing tool needs some more work though, got it to work for the static version of but not for the dynamic one.
I'm curious if this is going to work correctly with newer versions of and , i found those being restricted by the release description of at
I didn't even touch . Intel tools always pin a very specific version. Honestly it's quite bad practice from Intel but unless it's really necessary I don't want to downgrade them. They were updated by someone for a reason. If they won't work we would need to duplicate them which is also not so nice. For this same reason I don't want to touch the patches. It might be that IGC doesn't need them. But they were included in the project for a reason. In fact if you look at the current branch there are no patches anymore. It's always a balance since you never know what will depend on these packages in the future. I'd rather keep the changes to a minimum.
Ahh, thanks for the clarification, now i see why i couldn't make sense of the patching mechanism. :)
it's a bit offtopic, but i'm curious to know. Do you understand and care to explain to me some details of why this segfault happened when the was present and linked/loaded into the build of within the test run or at runtime through ?
Honestly I have no idea. I know there were some idiosyncrasies with the and linking. See here; But since I didn't see this issue I don't really know why it happened. I would have to investigate myself.
PR is out my system runs fine with the additions. works.

Discussion:
, lld_11 , opencl-clang , python3 <ins> , spirv-tools , spirv-headers </ins> , spirv-llvm-translator , buildWithPatches ? true

vc_intrinsics_src = fetchFromGitHub { owner = "intel"; repo = "vc-intrinsics"; <del> rev = "e5ad7e02aa4aa21a3cd7b3e5d1f3ec9b95f58872"; sha256 = "Vg1mngwpIQ3Tik0GgRXPG22lE4sLEAEFch492G2aIXs="; </del> <ins> rev = "v0.3.0"; sha256 = "sha256-1Rm4TCERTOcPGWJF+yNoKeB9x3jfqnh7Vlv+0Xpmjbk="; </ins> }; llvmPkgs = llvmPackages_11 // { inherit spirv-llvm-translator;

stdenv.mkDerivation rec { pname = "intel-graphics-compiler"; <del> version = "1.0.8744"; </del> <ins> version = "1.0.11061"; </ins> src = fetchFromGitHub { owner = "intel"; repo = "intel-graphics-compiler"; rev = "igc-${version}"; <del> sha256 = "G5+dYD8uZDPkRyn1sgXsRngdq4NJndiCJCYTRXyUgTA="; </del> <ins> sha256 = "sha256-qS/+GTqHtp3T6ggPKrCDsrTb7XvVOUaNbMzGU51jTu4="; </ins> }; nativeBuildInputs = [ clang cmake bison flex python3 ]; <del> buildInputs = [ clang opencl-clang spirv-llvm-translator llvm lld_11 ]; </del> <ins> buildInputs = [ spirv-headers spirv-tools clang opencl-clang spirv-llvm-translator llvm lld_11 ]; </ins> strictDeps = true;

# https://github.com/intel/intel-graphics-compiler/issues/98 doCheck = false; <ins> patchPhase = '' substituteInPlace ./external/SPIRV-Tools/CMakeLists.txt  --replace '$'''{SPIRV-Tools_DIR}../../..'  '${spirv-tools}'  --replace 'SPIRV-Headers_INCLUDE_DIR "/usr/include"'  'SPIRV-Headers_INCLUDE_DIR "${spirv-headers}/include"'  --replace 'set_target_properties(SPIRV-Tools'  'set_target_properties(SPIRV-Tools-shared'  --replace 'IGC_BUILD__PROJ__SPIRV-Tools SPIRV-Tools'  'IGC_BUILD__PROJ__SPIRV-Tools SPIRV-Tools-shared' substituteInPlace ./IGC/AdaptorOCL/igc-opencl.pc.in  --replace '/@CMAKE_INSTALL_INCLUDEDIR@' "/include"  --replace '/@CMAKE_INSTALL_LIBDIR@' "/lib" ''; </ins> # Handholding the braindead build script # cmake requires an absolute path prebuilds = runCommandLocal "igc-cclang-prebuilds" { } ''

''; cmakeFlags = [ <ins> "-Wno-dev" </ins> "-DVC_INTRINSICS_SRC=${vc_intrinsics_src}" <ins> "-DIGC_OPTION__SPIRV_TOOLS_MODE=Prebuilds" </ins> "-DINSTALL_SPIRVDLL=0" "-DCCLANG_BUILD_PREBUILDS=ON" "-DCCLANG_BUILD_PREBUILDS_DIR=${prebuilds}"

, pkg-config , lit , llvm_11 <ins> , spirv-headers , spirv-tools </ins> }: stdenv.mkDerivation rec { pname = "SPIRV-LLVM-Translator"; <del> version = "unstable-2021-06-13"; </del> <ins> version = "unstable-2022-05-04"; </ins> src = fetchFromGitHub { owner = "KhronosGroup"; repo = "SPIRV-LLVM-Translator"; <del> rev = "c67e6f26a7285aa753598ef792593ac4a545adf9"; sha256 = "sha256-1s3lVNTQDl+pUvbzSMsp3cOUSm6I4DzqJxnLMeeE3F4="; </del> <ins> rev = "99420daab98998a7e36858befac9c5ed109d4920"; sha256 = "sha256-/vUyL6Wh8hykoGz1QmT1F7lfGDEmG4U3iqmqrJxizOg="; </ins> }; nativeBuildInputs = [ pkg-config cmake llvm_11.dev ]; <del> buildInputs = [ llvm_11 ]; </del> <ins> buildInputs = [ spirv-headers spirv-tools llvm_11 ]; </ins> checkInputs = [ lit ]; <ins> makeFlags = [ "llvm-spirv" ]; </ins> cmakeFlags = [ "-DLLVM_INCLUDE_TESTS=ON" <ins> "-DLLVM_DIR=${llvm_11.dev}" "-DBUILD_SHARED_LIBS=YES" "-DLLVM_SPIRV_BUILD_EXTERNAL=YES" </ins> ]; <ins> prePatch = '' substituteInPlace ./test/CMakeLists.txt  --replace 'SPIRV-Tools' 'SPIRV-Tools-shared' ''; </ins> # FIXME: CMake tries to run "/llvm-lit" which of course doesn't exist doCheck = false;

in stdenv.mkDerivation rec { pname = "opencl-clang"; <del> version = "unstable-2021-06-22"; </del> <ins> version = "unstable-2022-03-16"; </ins> inherit passthru; src = fetchFromGitHub { owner = "intel"; repo = "opencl-clang"; <del> rev = "fd68f64b33e67d58f6c36b9e25c31c1178a1962a"; sha256 = "sha256-q1YPBb/LY67iEuQx1fMUQD/I7OsNfobW3yNfJxLXx3E="; </del> <ins> rev = "bbdd1587f577397a105c900be114b56755d1f7dc"; sha256 = "sha256-qEZoQ6h4XAvSnJ7/gLXBb1qrzeYa6Jp6nij9VFo8MwQ="; </ins> }; patches = [

stdenv.mkDerivation rec { pname = "intel-compute-runtime"; <del> version = "21.42.21270"; </del> <ins> version = "22.17.23034"; </ins> src = fetchFromGitHub { owner = "intel"; repo = "compute-runtime"; rev = version; <del> sha256 = "N9MsDcsL8kBWxfZjhukcxZiSJnXxqMgWF0etOhf2/AE="; </del> <ins> sha256 = "sha256-ae6kPiVQe3+hcqXVu2ncCaVQAoMKoDHifrkKpt6uWX8="; </ins> }; nativeBuildInputs = [ cmake pkg-config ];