overlay/intel-compute-runtime-legacy1/default.nix

92 lines
2.1 KiB
Nix
Raw Permalink Normal View History

{
lib,
stdenv,
fetchFromGitHub,
cmake,
pkg-config,
intel-gmmlib,
intel-graphics-compiler,
level-zero,
libva,
gitUpdater,
2024-12-28 15:47:31 +00:00
}:
let
inherit (lib) cmakeBool;
in
2024-12-28 15:47:31 +00:00
stdenv.mkDerivation rec {
# https://github.com/intel/compute-runtime/blob/master/LEGACY_PLATFORMS.md
pname = "intel-compute-runtime-legacy1";
version = "24.35.30872.32"; # 24.35.30872.x is the last series to support Gen8, Gen9 and Gen11 GPU support
2024-12-28 15:47:31 +00:00
src = fetchFromGitHub {
owner = "intel";
repo = "compute-runtime";
rev = version;
2024-12-28 22:17:58 +00:00
hash = "sha256-POImMopbrhVXuSx2MQ9mwPNKQx7BljyikKhu6M4hZME=";
2024-12-28 15:47:31 +00:00
};
nativeBuildInputs = [
cmake
pkg-config
];
2024-12-28 15:47:31 +00:00
buildInputs = [
intel-gmmlib
intel-graphics-compiler
libva
level-zero
];
2024-12-28 15:47:31 +00:00
cmakeFlags = [
"-DSKIP_UNIT_TESTS=1"
"-DIGC_DIR=${intel-graphics-compiler}"
"-DOCL_ICD_VENDORDIR=${placeholder "out"}/etc/OpenCL/vendors"
# The install script assumes this path is relative to CMAKE_INSTALL_PREFIX
"-DCMAKE_INSTALL_LIBDIR=lib"
(cmakeBool "NEO_LEGACY_PLATFORMS_SUPPORT" true)
2024-12-28 15:47:31 +00:00
];
outputs = [
"out"
"drivers"
];
2024-12-28 15:47:31 +00:00
# causes redefinition of _FORTIFY_SOURCE
hardeningDisable = [ "fortify3" ];
postInstall = ''
# Avoid clash with intel-ocl
mv $out/etc/OpenCL/vendors/intel.icd $out/etc/OpenCL/vendors/intel-neo.icd
mkdir -p $drivers/lib
mv -t $drivers/lib $out/lib/libze_intel*
'';
postFixup = ''
patchelf --set-rpath ${
lib.makeLibraryPath [
intel-gmmlib
intel-graphics-compiler
libva
stdenv.cc.cc
]
} \
2024-12-28 15:47:31 +00:00
$out/lib/intel-opencl/libigdrcl.so
'';
passthru.updateScript = gitUpdater {
rev-prefix = "24.35.30872.";
};
2024-12-28 15:47:31 +00:00
meta = with lib; {
description = "Intel Graphics Compute Runtime for OpenCL with support for Gen8, Gen9 and Gen11 GPUs.d";
2024-12-28 15:47:31 +00:00
mainProgram = "ocloc";
homepage = "https://github.com/intel/compute-runtime";
changelog = "https://github.com/intel/compute-runtime/releases/tag/${version}";
license = licenses.mit;
platforms = [ "x86_64-linux" ];
2024-12-28 15:47:31 +00:00
maintainers = with maintainers; [ fleaz ];
};
}