1{ lib
2, stdenv
3, fetchFromGitHub
4, patchelf
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 = "23.17.26241.15";
16
17 src = fetchFromGitHub {
18 owner = "intel";
19 repo = "compute-runtime";
20 rev = version;
21 sha256 = "sha256-A0gtSM6e+VcfcGG/6zReV2LIXq6tGbWIwDQFlQ2TW28=";
22 };
23
24 nativeBuildInputs = [ cmake pkg-config ];
25
26 buildInputs = [ intel-gmmlib intel-graphics-compiler libva level-zero ];
27
28 cmakeFlags = [
29 "-DSKIP_UNIT_TESTS=1"
30 "-DIGC_DIR=${intel-graphics-compiler}"
31 "-DOCL_ICD_VENDORDIR=${placeholder "out"}/etc/OpenCL/vendors"
32 # The install script assumes this path is relative to CMAKE_INSTALL_PREFIX
33 "-DCMAKE_INSTALL_LIBDIR=lib"
34 ];
35
36 outputs = [ "out" "drivers" ];
37
38 postInstall = ''
39 # Avoid clash with intel-ocl
40 mv $out/etc/OpenCL/vendors/intel.icd $out/etc/OpenCL/vendors/intel-neo.icd
41
42 mkdir -p $drivers/lib
43 mv -t $drivers/lib $out/lib/libze_intel*
44 '';
45
46 postFixup = ''
47 patchelf --set-rpath ${lib.makeLibraryPath [ intel-gmmlib intel-graphics-compiler libva stdenv.cc.cc.lib ]} \
48 $out/lib/intel-opencl/libigdrcl.so
49 '';
50
51 meta = with lib; {
52 homepage = "https://github.com/intel/compute-runtime";
53 description = "Intel Graphics Compute Runtime for OpenCL. Replaces Beignet for Gen8 (Broadwell) and beyond";
54 license = licenses.mit;
55 platforms = [ "x86_64-linux" "aarch64-linux" ];
56 maintainers = with maintainers; [ SuperSandro2000 ];
57 };
58}