From bc543061b6c31c66642f9349573329d9ec5c32b4 Mon Sep 17 00:00:00 2001 From: fleaz Date: Sat, 28 Dec 2024 16:47:31 +0100 Subject: [PATCH] Added intel-computer-runtime-legacy --- default.nix | 1 + flake.nix | 1 + intel-compute-runtime-legacy/default.nix | 62 ++++++++++++++++++++++++ test.nix | 6 ++- 4 files changed, 68 insertions(+), 2 deletions(-) create mode 100644 intel-compute-runtime-legacy/default.nix diff --git a/default.nix b/default.nix index 1da6e66..881cfb5 100644 --- a/default.nix +++ b/default.nix @@ -22,6 +22,7 @@ self: super: { netrw-nvim = super.callPackage ./netrw-nvim { }; }); salt-lint = super.callPackage ./salt-lint { }; + intel-compute-runtime-legacy = super.callPackage ./intel-compute-runtime-legacy { }; nerdfonts = super.nerdfonts.override { fonts = [ diff --git a/flake.nix b/flake.nix index cb85cbc..a64d340 100644 --- a/flake.nix +++ b/flake.nix @@ -45,6 +45,7 @@ netrw-nvim = prev.callPackage ./netrw-nvim { }; }); salt-lint = prev.callPackage ./salt-lint { }; + intel-compute-runtime-legacy = prev.callPackage ./intel-compute-runtime-legacy { }; }; }; } diff --git a/intel-compute-runtime-legacy/default.nix b/intel-compute-runtime-legacy/default.nix new file mode 100644 index 0000000..262d7a3 --- /dev/null +++ b/intel-compute-runtime-legacy/default.nix @@ -0,0 +1,62 @@ +{ lib +, stdenv +, fetchFromGitHub +, cmake +, pkg-config +, intel-gmmlib +, intel-graphics-compiler +, level-zero +, libva +}: + +stdenv.mkDerivation rec { + pname = "intel-compute-runtime-legacy"; + version = "24.35.30872.32"; + + src = fetchFromGitHub { + owner = "intel"; + repo = "compute-runtime"; + rev = version; + hash = "sha256-POImMopbrhVXuSx2MQ9mwPNKQx7BljyikKhu6M4hZME="; + }; + + nativeBuildInputs = [ cmake pkg-config ]; + + buildInputs = [ intel-gmmlib intel-graphics-compiler libva level-zero ]; + + 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" + ]; + + outputs = [ "out" "drivers" ]; + + # 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.lib ]} \ + $out/lib/intel-opencl/libigdrcl.so + ''; + + meta = with lib; { + description = "Legacy version of Intel Graphics Compute Runtime for OpenCL."; + 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" "aarch64-linux" ]; + maintainers = with maintainers; [ fleaz ]; + }; +} diff --git a/test.nix b/test.nix index 3bcd101..dc261dd 100644 --- a/test.nix +++ b/test.nix @@ -1,9 +1,11 @@ { pkgs ? import { overlays = [ (import ./default.nix) ]; } }: +let # mypython = pkgs.python3.withPackages (python-pkgs: [ - # python-pkgs.salt-lint + # python-pkgs.dilithium # ]); +in pkgs.mkShell { buildInputs = with pkgs; [ - salt-lint + intel-compute-runtime-legacy ]; }