-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflake.nix
81 lines (75 loc) · 2.54 KB
/
flake.nix
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
{
inputs = {
nixpkgs.url = "github:NixOS/nixpkgs/nixos-unstable";
nixpkgs-pending.url = "github:ziguana/nixpkgs/level_zero";
};
outputs =
inputs:
let
overlay-pending = final: prev: {
pending = import inputs.nixpkgs-pending {
system = "x86_64-linux";
};
};
pkgs = import inputs.nixpkgs { system = "x86_64-linux"; overlays = [ overlay-pending ]; };
in
with pkgs; rec {
packages.x86_64-linux.default =
let
# on a running system, `libze_intel_gpu.so` will be in `/run/opengl-driver`
# which is in RUNPATH of the loader. here, we must put it into LD_LIBRARY_PATH
libPath = lib.makeLibraryPath [ pending.intel-compute-runtime.drivers ];
in
stdenv.mkDerivation {
src = ./.;
name = "zello_world";
nativeBuildInputs = [
pkg-config
cmake
makeWrapper
];
buildInputs = [ pending.level-zero ];
postInstall = ''
wrapProgram $out/bin/zello_world --set LD_LIBRARY_PATH ${libPath}
'';
};
packages.x86_64-linux.tests =
let
libPath = lib.makeLibraryPath [ pending.intel-compute-runtime.drivers ];
in
stdenv.mkDerivation {
name = "level-zero-tests";
version = "1.8.8";
src = fetchFromGitHub {
owner = "oneapi-src";
repo = "level-zero-tests";
rev = "773b6605ff2d6d0b4350e4a03d5f19e70b0239ec";
sha256 = "sha256-3Rdhzmg+/4Gwkk2aiCm0iaeRRT8U7074lu/J18QRw4I=";
fetchSubmodules = true;
};
patches = [ ./tests_include_thread.patch ];
nativeBuildInputs = [ cmake (boost.override { enableShared = false; }) libpng icu ];
buildInputs = [ pending.level-zero ];
meta = with lib; {
homepage = "https://www.oneapi.io/";
description = "oneAPI Level Zero Conformance & Performance Tests";
license = licenses.mit;
maintainers = [ maintainers.ziguana ];
};
};
devShells.x86_64-linux.default =
let
libPath = lib.makeLibraryPath [ (enableDebugging pending.intel-compute-runtime).drivers ];
level-zero = (enableDebugging pending.level-zero);
in
pkgs.mkShell {
inputsFrom = builtins.attrValues packages.x86_64-linux;
buildInputs = [
gdb
bear
level-zero
];
LD_LIBRARY_PATH = "${libPath}";
};
};
}