Files
nixpkgs/pkgs/by-name/in/intel-compute-runtime/package.nix
Dominik Süß 9ab6c74e84 intel-compute-runtime: fix driver output path
$drivers is not used by NixOS and by moving the `libze_intel*` libraries to that folder, they're not correctly mapped to `/run/opengl-driver/lib` when used in `hardware.graphics.extraPackages`.
2026-09-08 23:33:56 +02:00

87 lines
2.2 KiB
Nix

{
lib,
cmake,
fetchFromGitHub,
intel-gmmlib,
intel-graphics-compiler,
level-zero,
libva,
nix-update-script,
pkg-config,
stdenv,
}:
stdenv.mkDerivation (finalAttrs: {
pname = "intel-compute-runtime";
version = "26.31.39395.13";
src = fetchFromGitHub {
owner = "intel";
repo = "compute-runtime";
tag = finalAttrs.version;
hash = "sha256-/rZvPEI5EFhkeW2h7ebhtZnrU48N54mCAfkRgM3b1L4=";
};
nativeBuildInputs = [
cmake
pkg-config
];
buildInputs = [
intel-gmmlib
intel-graphics-compiler
libva
level-zero
];
cmakeFlags = [
(lib.cmakeBool "SKIP_UNIT_TESTS" true)
(lib.cmakeFeature "IGC_DIR" (toString intel-graphics-compiler))
(lib.cmakeFeature "OCL_ICD_VENDORDIR" "${placeholder "out"}/etc/OpenCL/vendors")
# The install script assumes this path is relative to CMAKE_INSTALL_PREFIX
(lib.cmakeFeature "CMAKE_INSTALL_LIBDIR" "lib")
# disable spectre mitigations (already mitigated in the kernel)
# https://bugs.launchpad.net/ubuntu/+source/intel-compute-runtime/+bug/2110131
(lib.cmakeBool "NEO_DISABLE_MITIGATIONS" true)
# install ocloc without a version suffix
(lib.cmakeBool "NEO_BUILD_UNVERSIONED_OCLOC" true)
];
# 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
'';
postFixup = ''
patchelf --set-rpath ${
lib.makeLibraryPath [
intel-gmmlib
intel-graphics-compiler
libva
stdenv.cc.cc
]
} \
$out/lib/intel-opencl/libigdrcl.so
'';
passthru = {
updateScript = nix-update-script { extraArgs = [ "--use-github-releases" ]; };
};
meta = {
description = "Intel Graphics Compute Runtime oneAPI Level Zero and OpenCL, supporting 12th Gen and newer";
mainProgram = "ocloc";
homepage = "https://github.com/intel/compute-runtime";
changelog = "https://github.com/intel/compute-runtime/releases/tag/${finalAttrs.version}";
license = lib.licenses.mit;
platforms = [
"x86_64-linux"
"aarch64-linux"
];
maintainers = with lib.maintainers; [ SuperSandro2000 ];
};
})