2022-12-02 08:20:57 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchFromGitHub
|
|
|
|
, patchelf
|
|
|
|
, cmake
|
2021-02-05 17:12:51 +00:00
|
|
|
, pkg-config
|
2020-04-24 23:36:52 +00:00
|
|
|
, intel-gmmlib
|
|
|
|
, intel-graphics-compiler
|
2022-12-17 10:02:37 +00:00
|
|
|
, level-zero
|
2020-04-24 23:36:52 +00:00
|
|
|
, libva
|
|
|
|
}:
|
|
|
|
|
|
|
|
stdenv.mkDerivation rec {
|
|
|
|
pname = "intel-compute-runtime";
|
2023-03-15 16:39:30 +00:00
|
|
|
version = "23.05.25593.11";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "intel";
|
|
|
|
repo = "compute-runtime";
|
|
|
|
rev = version;
|
2023-03-15 16:39:30 +00:00
|
|
|
sha256 = "sha256-AsJGcyVqRGz7OBWTlQeTS412iUzMAbIsA4w6CmEf1G8=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-05 17:12:51 +00:00
|
|
|
nativeBuildInputs = [ cmake pkg-config ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
buildInputs = [ intel-gmmlib intel-graphics-compiler libva level-zero ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
cmakeFlags = [
|
|
|
|
"-DSKIP_UNIT_TESTS=1"
|
|
|
|
"-DIGC_DIR=${intel-graphics-compiler}"
|
2020-09-25 04:45:31 +00:00
|
|
|
"-DOCL_ICD_VENDORDIR=${placeholder "out"}/etc/OpenCL/vendors"
|
2020-04-24 23:36:52 +00:00
|
|
|
# The install script assumes this path is relative to CMAKE_INSTALL_PREFIX
|
|
|
|
"-DCMAKE_INSTALL_LIBDIR=lib"
|
|
|
|
];
|
|
|
|
|
2022-12-17 10:02:37 +00:00
|
|
|
outputs = [ "out" "drivers" ];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
postInstall = ''
|
|
|
|
# Avoid clash with intel-ocl
|
|
|
|
mv $out/etc/OpenCL/vendors/intel.icd $out/etc/OpenCL/vendors/intel-neo.icd
|
2022-12-17 10:02:37 +00:00
|
|
|
|
|
|
|
mkdir -p $drivers/lib
|
|
|
|
mv -t $drivers/lib $out/lib/libze_intel*
|
2020-04-24 23:36:52 +00:00
|
|
|
'';
|
|
|
|
|
|
|
|
postFixup = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
patchelf --set-rpath ${lib.makeLibraryPath [ intel-gmmlib intel-graphics-compiler libva stdenv.cc.cc.lib ]} \
|
2020-04-24 23:36:52 +00:00
|
|
|
$out/lib/intel-opencl/libigdrcl.so
|
|
|
|
'';
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-12-02 08:20:57 +00:00
|
|
|
homepage = "https://github.com/intel/compute-runtime";
|
2020-10-19 00:13:06 +00:00
|
|
|
description = "Intel Graphics Compute Runtime for OpenCL. Replaces Beignet for Gen8 (Broadwell) and beyond";
|
2022-12-02 08:20:57 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
platforms = [ "x86_64-linux" "aarch64-linux" ];
|
|
|
|
maintainers = with maintainers; [ SuperSandro2000 ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|