Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at devShellTools-shell 87 lines 2.1 kB view raw
1{ 2 lib, 3 stdenv, 4 fetchFromGitHub, 5 cmake, 6 pkg-config, 7 intel-gmmlib, 8 intel-graphics-compiler, 9 level-zero, 10 libva, 11}: 12 13stdenv.mkDerivation rec { 14 pname = "intel-compute-runtime"; 15 version = "25.22.33944.8"; 16 17 src = fetchFromGitHub { 18 owner = "intel"; 19 repo = "compute-runtime"; 20 tag = version; 21 hash = "sha256-Sz9ELQkSq6CQOfoTlzJoUzj/GuHwQMgtUjmC0P2uzro="; 22 }; 23 24 nativeBuildInputs = [ 25 cmake 26 pkg-config 27 ]; 28 29 buildInputs = [ 30 intel-gmmlib 31 intel-graphics-compiler 32 libva 33 level-zero 34 ]; 35 36 cmakeFlags = [ 37 (lib.cmakeBool "SKIP_UNIT_TESTS" true) 38 (lib.cmakeFeature "IGC_DIR" (builtins.toString intel-graphics-compiler)) 39 (lib.cmakeFeature "OCL_ICD_VENDORDIR" "${placeholder "out"}/etc/OpenCL/vendors") 40 # The install script assumes this path is relative to CMAKE_INSTALL_PREFIX 41 (lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib") 42 # disable spectre mitigations (already mitigated in the kernel) 43 # https://bugs.launchpad.net/ubuntu/+source/intel-compute-runtime/+bug/2110131 44 (lib.cmakeBool "NEO_DISABLE_MITIGATIONS" true) 45 ]; 46 47 outputs = [ 48 "out" 49 "drivers" 50 ]; 51 52 # causes redefinition of _FORTIFY_SOURCE 53 hardeningDisable = [ "fortify3" ]; 54 55 postInstall = '' 56 # Avoid clash with intel-ocl 57 mv $out/etc/OpenCL/vendors/intel.icd $out/etc/OpenCL/vendors/intel-neo.icd 58 59 mkdir -p $drivers/lib 60 mv -t $drivers/lib $out/lib/libze_intel* 61 ''; 62 63 postFixup = '' 64 patchelf --set-rpath ${ 65 lib.makeLibraryPath [ 66 intel-gmmlib 67 intel-graphics-compiler 68 libva 69 stdenv.cc.cc 70 ] 71 } \ 72 $out/lib/intel-opencl/libigdrcl.so 73 ''; 74 75 meta = { 76 description = "Intel Graphics Compute Runtime oneAPI Level Zero and OpenCL, supporting 12th Gen and newer"; 77 mainProgram = "ocloc"; 78 homepage = "https://github.com/intel/compute-runtime"; 79 changelog = "https://github.com/intel/compute-runtime/releases/tag/${version}"; 80 license = lib.licenses.mit; 81 platforms = [ 82 "x86_64-linux" 83 "aarch64-linux" 84 ]; 85 maintainers = with lib.maintainers; [ SuperSandro2000 ]; 86 }; 87}